Abstract
Defects generated during PCB manufacturing, transportation, and storage seriously impact the quality and performance of electronic components. However, detection accuracy is limited due to excessive background interference and the small size of defect targets. To alleviate these issues, this paper proposes an improved PCB defect detection method based on RT-DETR, named SCP-DETR. Firstly, to effectively detect small targets, the S2 feature layer is incorporated into the neck feature fusion. While this improves detection capability, it also introduces considerable computational overhead. To mitigate this, we use SPDConv (Space-to-Depth Convolution) to process the S2 feature layer, reducing the computational complexity. The processed S2 feature layer is then fused with the S3 feature layer and higher-level features. Subsequently, we feed these features into a specially designed CO-Fusion module. By embedding our proposed CSPOKM(CSP Omni-Kernel Module) into the original fusion module, the CO-Fusion module effectively learns feature representations from global to local scales, ultimately enhancing small-target detection performance. Finally, downsampling operations are replaced with PSConv(Pinwheel-shaped Convolution), which better accommodates the Gaussian spatial pixel distributions of subtle small targets. Experimental results demonstrate that the proposed method achieves an mAP@0.5 of 97%, surpassing RT-DETR-r18 by 3%, and an mAP@0.5:0.95 of 53.4%, representing an improvement of 2.2%. Additionally, compared with the recently released YOLOv11m, our method improves mAP@0.5 by 5.6%. These results demonstrate the superior performance of the proposed method in PCB defect detection, which holds significant implications for industrial production. The code is available at https://github.com/Yttong-rr/SCPDETR/tree/master.