Abstract
A lightweight YOLOv5 improved algorithm-based inspection model is proposed to address the problems of defective printed circuit boards (PCBs), which are difficult to identify. First, the detection part of YOLOv5 is changed to dual-head detection to significantly improve the inference speed of the model on edge devices and adapt to the real-time target detection requirements. Second, the introduction of GSConv in the Neck part helps to further reduce the number of parameters of the model and improve the computational efficiency, which can enhance the model's capture ability.Finally, BiFPN is introduced to fuse multi-scale information to enhance the model's detection ability for targets of different sizes. The experimental results show that the improved lightweight YOLOv5 algorithm in this paper achieves 94.9% in the average accuracy mean (mAP@0.5), which is only 0.5 percentage points less compared to the original YOLOv5s algorithm. However, the improved algorithm has 56.2% fewer floating point operations (GFLOPs) and 53.7% fewer parameters. This improvement not only makes the algorithm more accurate and lightweight, but also significantly improves the efficiency of PCB inspection, which better meets the needs of industrial production.