| With the rapid development of the electronic information industry,the new generation of electronic products have higher requirements for the basic hardware.As the basis of the electronic information industry,PCB industry has a decisive impact on the quality of its products on the subsequent production of electronic products.PCB manufacturing process is complex,need to go through more than a dozen manufacturing procedures,in the manufacturing process will inevitably produce a variety of defects,therefore,PCB defect detection is an important step in the whole production process.The traditional PCB defect detection method can not meet the increasing demand of PCB defect detection speed and precision due to its low efficiency and great influence of environmental factors.In recent years,due to the development of computer technology and intelligent algorithms,the realization of PCB defect detection by using deep learning algorithm has become a research hotspot.Based on YOLOv5 algorithm,this paper studies the problems such as small target and not obvious features of PCB defects.The main research contents are as follows:(1)This paper firstly studies the first-stage algorithm and the second-stage algorithm.Through the comparison of experimental results,it can be found that the first-stage target detection algorithm has obvious advantages in the detection speed.YOLOv5,as the latest firststage algorithm,has good results in both speed and accuracy,which can accurately detect PCB defects in real time.Therefore,YOLOv5 is chosen as the basic algorithm in this paper.(2)In view of the small defect target of PCB,the features are not obvious,resulting in false detection,missing detection and other problems in the actual process,this paper proposes a multi-branch attention module MBAM to focus on the feature map in three dimensions,so as to enhance the ability of feature extraction and give more attention to the defect area.The comparison experiment on the mainstream target detection algorithm shows that the detection performance of the mainstream detection algorithm has been improved.(3)The improved YOLOv5 structure is proposed in this paper.Combining MBAM with YOLOv5 network,the detection performance of small targets is effectively improved.In particular,the recall rate and accuracy of open_circuit and mouse_bite are significantly improved.This paper also verifies the influence of MBAM on the network by adding MBAM in different locations of the network.Finally,the optimal location is selected,and the final m AP of the algorithm in this paper reaches 96.7%,achieving the best detection effect.(4)In order to verify the accuracy and feasibility of the algorithm,an experimental system was constructed for PCB defect detection,and a PCB defect detection system based on the improved YOLOv5 algorithm was completed.The system includes hardware experiment platform design,software algorithm and test interface design.Through the construction of the experimental platform,the actual test results of the defective PCB board can effectively detect the defect information. |