Abstract:To address the issue that existing models struggle to simultaneously balance detection accuracy, model volume, and inference speed in printed circuit board (PCB) surface defect detection tasks, a high-precision PCB surface defect detection method based on enhanced lightweight YOLO (ELYOLO) is proposed. Firstly, based on ghost network (GhostNet) and decoupled fully-connected attention (DFCA), a ghost long-range attention (GLA) module is proposed to lighten the backbone network while maintaining accuracy. Then, according to the linear attention mechanism, a Mamba-inspired linear attention (MLLA) module is designed at the end of the backbone network to accurately capture global contextual information. Secondly, based on grouped and shuffled convolution (GSConv) and feature path aggregation, an efficient neck network is proposed, which optimizes the effect of multi-scale feature fusion while reducing computational bottlenecks. Finally, unified intersection over union (UIoU) is adopted as the bounding box regression loss function to improve the localization accuracy of the model. Experimental results indicate that on the public PCB defect dataset, compared with the baseline model YOLOv11n, the number of parameters and computational cost of the proposed ELYOLO model are reduced by 7.4% and 17.5%, respectively, while mAP50 and mAP50-95 are increased by 3.0 and 2.3 percentage points, respectively. The model also demonstrates excellent generalization ability, proving that ELYOLO can effectively balance detection accuracy, model volume, and inference speed.