A PCB surface defect detection algorithm based on YOLOv8 is proposed to address the challenges of small object size and low detection accuracy. This algorithm effectively enhances detection accuracy while ensuring real-time detection speed. Firstly, the conventional convolutional layers in YOLOv8 are substituted with the SPD-Conv module, enabling finer feature extraction for small defects. Secondly, to improve the detection accuracy of small targets, an extra small detection head is incorporated into the Head section. This modification enables the network to prioritize small objects by combining shallow and deep feature maps. Meanwhile, in the neck section, the lightweight upsampling operator named CARAFE is utilized to gather contextual information across a broader receptive field, thus improving the network's ability to fuse features. Finally, this original CIOU loss function was improved to Wise-IOU. Compared to traditional CIOU, Wise-IOU considers not only the relative positions and size differences between objects but also introduces an intelligent weight adjustment mechanism that can adaptively adjust weight coefficients, thereby improving the accuracy and robustness. Experiment shows that the improved model reaches an [email protected] of 91.6%, a 10.1% progress over the original YOLOv8, with a model size of 6.80MB, meeting lightweight requirements, and a detection speed of 108fps, meeting the real-time requirements of PCB defect inspection applications.
Xiaoyan XuJennifer C. Dela Cruz
Lijuan LiuYu ZhangHamid Reza Karimi