Abstract
In the field of printed circuit board (PCB) manufacturing, surface defect detection serves as a critical process in the production line, directly impacting the quality and safety of subsequent electronic products. However, accurately detecting tiny surface defects in real time remains a significant challenge given the complex layouts of PCBs. To address this issue, this study proposes a novel Ghost-BiFPN-Efficient-YOLOv8 (GBE-YOLOv8) model architecture for PCB defect detection based on an improved YOLOv8n. The backbone network of the model employs lightweight Ghost Conv to partially replace regular convolutions, thereby reducing computational complexity and parameter count. The neck network incorporates a multi-stage feature fusion module named G-C2f and a dynamic weighting module named BiFPN-Concat to enhance the model's ability to characterize PCB defects. The model's head network employs an Efficient Head that combines mixed depthwise convolution and partial convolution, further optimizing detection accuracy and computational efficiency. Simultaneously, a comprehensive evaluation of model performance was conducted using publicly available datasets. And the working mechanisms of each improved method were analyzed through class activation heatmaps to further enhance the interpretability of the model. Experimental results demonstrate that compared to the baseline model and several other state-of-the-art object detection algorithms, the proposed method exhibits significant advantages across various evaluation metrics, and its mAP@0.5, mAP@0.5:0.95, parameters, GFLOPs and FPS achieve 98.9%, 61.4%, 2.6 M, 7.5 and 252, respectively. Furthermore, each optimization method achieves the expected design purpose, and the combined application of all optimization methods enables the model to strike an optimal balance between detection accuracy and computational complexity. Consequently, this research can provide a reliable technical solution for high-precision real-time detection of surface defects on PCBs in industrial production lines.