Defect Detection Algorithm for PCBA Based on Improved YOLOv8s Lightweight Network
摘要
In Printed Circuit Board Assembly (PCBA), defect detection is key to improving production line efficiency. However, after assembly, printed circuit boards are usually inspected manually, leading to labor and time wastage, as well as missed and false detections. To address these issues, this paper proposes an improved lightweight YOLOv8s network that effectively reduces model complexity while enhancing the accuracy of PCBA defect detection. First, owing to the lack of publicly available PCBA-related datasets, a dataset called PCBA-DET is constructed for post-assembly PCBA defect detection. Various data augmentation techniques are applied to PCBA-DET to simulate real-world production scenarios and improve the dataset balance. Second, the last C2f module of the YOLOv8s backbone is replaced with a Re-parameterized Large Kernel convolution Network (RepLKNet) to reduce computational cost and increase the effective receptive field of the model. In addition, in the neck network of YOLOv8s, a P2 small object detection layer and Ghost Convolution are introduced to capture more detailed information and effectively reduce the number of model parameters. On the augmented PCBA-DET dataset, the improved model achieves an increase of 2.6 and 0.1 percentage points in terms of mean Average Precision (mAP)@0.5∶0.95 and mAP@0.5, respectively, compared with the baseline model, whereas the number of parameters is reduced by 36.8%.