Yolo-cd: a lightweight real-time PCB defect detection model for edge deployments
摘要
In industrial production, the detection of small-object defects faces several challenges, including insufficient accuracy, large model parameter sizes, and high computational demands, which together hinder the deployment of detection models on resource-constrained edge devices. To address these issues, we propose a novel defect detection framework, YOLO-CD. First, the Cross Stage Partial-DualConv (CSP-DC) module integrates dual convolutional kernels with cross-stage networks to reduce feature loss and enhance small-target feature extraction. Second, Compression-Decompression-Large Selective Kernel (CD-LSK) attention introduces a compression-decompression pipeline to focus on critical defect features, addressing LSK inefficiencies. Third, C2FasterBlock uses a dual-branch design to lighten feature fusion, cutting parameters and computation. Finally, Focaler-GIoU loss combines hard-sample focus and improved regression to distinguish similar small defects. The improved algorithm is evaluated through comparative experiments on a PCB defect dataset. The experimental results demonstrate that the proposed YOLO-CD achieves a mean Average Precision (mAP) of 92.3%, with a model size of 3.4MB and a computational complexity of 6.2 GFLOPs. Compared to YOLOv9t, the mAP has increased by 3.9%, while the model size has been reduced by 44.2% and the computational complexity has decreased by 44.1%. Furthermore, deployment on the Jetson Orin NX confirms real-time inference under FP16 and FP32 precision. These results illustrate that YOLO-CD effectively balances detection accuracy and efficiency, providing a reliable and lightweight solution for printed circuit boards (PCBs) defect inspection and other real-world industrial applications.