TITLE:
BCN-YOLO: A Deep Learning Network for PCB Defect Detection
AUTHORS:
Junjie Liu, Shuxin Yao, Boxiong Li, Jianqing Liu
KEYWORDS:
PCB Bare Board, YOLOv7, Small Object Detection, Loss Function, Attention Mechanism
JOURNAL NAME:
Journal of Computer and Communications,
Vol.13 No.8,
August
7,
2025
ABSTRACT: To address the issues of missed detection and false detection during the defect inspection process of the PCB, an improved YOLOv7-based algorithm for PCB defect detection is proposed. Firstly, the Bi-Former attention mechanism and CARAFE upsampling operator are introduced into the original YOLOv7 backbone network to achieve more flexible computation allocation and content awareness, enabling the network to dynamically perceive sparsity in queries. Secondly, a powerful feature pyramid network, CMPANet, is proposed to extract more shallow features, effectively improving the model’s detection performance on small targets. Finally, the NWD loss function is introduced to optimize the regression loss function in combination with IoU, reducing sensitivity to position deviations of small targets. Experimental results demonstrate that the modified YOLOv7 achieves a mAP@0.5 value of 95.25%. Compared to the original model, the mAP@0.5 and mAP@0.5:0.9 values are improved by 3.32% and 2.86%, respectively, while the F1 score is enhanced by 3.91%. The detection speed is 44.84 FPS. These improvements effectively enhance the accuracy of detecting small target defects on PCBs. Additionally, the performance on AI-TOD, Tiny-Person, and Wider-Person small target datasets shows improvements over the original network.