The detection of defects is a crucial component of ensuring the quality of printed circuit board (PCB) products. Owing to the diminutive nature of surface defects on PCBs, current detection algorithms struggle to accurately extract small defect features, leading to a propensity for missed detections. To tackle these challenges, we propose a PCB defect detection algorithm that builds upon the YOLOv7 framework with enhancements. Firstly, we integrate the proposed CREC module into the backbone network to enhance the capture of local features pertaining to minor defects. Secondly, we propose the integration of a multi-scale feature fusion module, SPPB, within the head network to selectively activate channels or positions related to small defects in the feature map, thereby enhancing the accuracy of local feature extraction for small defects. Subsequently, we introduce MPNWD to optimize the loss function, helping the model focus more on learning the features of small defects; Finally, we add a small object detection layer P2, and introduce contextual information to facilitate the model's comprehension of the relationship between small defects and their surrounding areas..Experimental results demonstrate the effectiveness of the enhanced YOLOv7 algorithm in testing the PCB_DATASET defect dataset, achieving a detection accuracy (mAP) of 99.3%, surpassing YOLOv7 by 5.4%, and outperforming other algorithms in terms of detection accuracy.
Abstract
The detection of defects is a crucial component of ensuring the quality of printed circuit board (PCB) products. Owing to the diminutive nature of surface defects on PCBs, current detection algorithms struggle to accurately extract small defect features, leading to a propensity [...]