The accurate and efficient detection of printed circuit board (PCB) surface defects is crucial to the electronic information manufacturing industry. However, current approaches to PCB defect detection face challenges, including large model sizes and difficulties in balancing detection accuracy with speed. To address these challenges, this paper proposes a novel PCB surface defect detection algorithm, named DVCW-YOLO. First, all standard convolutions in the backbone and neck networks of YOLOv8n are replaced with lightweight DWConv convolutions. In addition, a self-designed C2fCBAM module is introduced to the backbone network for extracting features. Next, within the neck structure, the C2f module is substituted with the more lightweight VOVGSCSP module, thereby reducing model redundancy, simplifying model complexity, and enhancing detection speed. By enhancing prominent features and suppressing less important ones, this modification allows the model to better focus on key regions, thereby improving feature representation capabilities. Finally, the WIoU loss function is implemented to replace the traditional CIoU function in YOLOv8n. This adjustment addresses issues related to low generalization and poor detection performance for small objects or complex backgrounds, while also mitigating the impact of low-quality or extreme samples on model accuracy. Experimental results demonstrate that the DVCW-YOLO model achieves a mean average precision (mAP) of 99.3% and a detection speed of 43.3 frames per second (FPS), which represent improvements of 4% and 4.08%, respectively, over the YOLOv8n model. These results confirm that the proposed model meets the real-time PCB defect detection requirements of small and medium-sized enterprises.
Read full abstract