Vision transformer and Mamba-attention fusion for high-precision PCB defect detection

A Asim Niaz M Muhammad Umraiz S Shafiullah Soomro K Kwang Nam Choi

Abstract

Defects in printed circuit boards (PCBs) are being detected using computer vision-based techniques. Defect-free PCBs are essential for the reliability of consumer electronics. However, deep learning-based methods often struggle with imbalanced defect distributions and limited generalization. To address these challenges, we propose ViT-Mamba, a hybrid framework that combines Vision Transformers with a Mamba-inspired attention mechanism for global feature extraction and precise defect segmentation. We further introduce an artificial defect generation module that systematically creates six types of PCB defects to improve robustness. A multiscale hierarchical refinement strategy is employed to enhance feature representation for accurate segmentation. Experiments on a public PCB defect dataset show that ViT-Mamba outperforms existing methods, achieving a mean Average Precision (mAP) of 99.69%.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 20, Issue 9
Published September 25, 2025
Pages e0331175
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (4)

A

Asim Niaz

M

Muhammad Umraiz

S

Shafiullah Soomro

K

Kwang Nam Choi