Printed circuit board PCB occupy an important position in the electronic information industry and have been widely used in integrated circuits,artificial intelligence,medical devices,aerospace and industrial equipment.Deep learning-based target detection algorithms can accurately and quickly find defects and reduce the rate of missed detection,and greatly reduce the cost of detection.Therefore,the use of deep learning technology for PCB defect detection has very far-reaching research significance and market application prospects.1.Propose a defect detection model based on YOLO v4 algorithm and improved feature fusion method.Firstly,to address the shortcomings of the AOI method for PCB defect detection,which is susceptible to environmental interference and high cost,the target detection algorithm YOLO v4,which can be well balanced in terms of detection speed and accuracy,is used for PCB defect detection;secondly,to improve the small target defect leakage problem,an improved feature fusion method is proposed to reconstruct the feature fusion module D-PAN to improve the multi-scale fusion effect and thus enhance the small target information;finally,for the problem that the v4 model preset anchors do not match the PCB defect size in the dataset,a K-Means clustering algorithm is used to calculate the correlation between them and the defect size using the clustering results,so as to achieve accurate matching.The experimental results show that the performance of small target detection can be improved.2.In order to further improve the defect detection accuracy,a detection model based on DConv and Focal loss for PCB defect information enhancement is given.Deformable convolution is applied to the feature extraction network so that it can perform adaptive learning of the perceptual field with the target region of interest to enhance the defect feature information extraction.Meanwhile,Ghost convolution blocks are used to replace some of the residual convolution blocks to reduce the number of parameters of the model while maintaining accuracy,and to compensate for the additional computational effort brought by deformable convolution.Finally,the confidence loss function of the benchmark model is modified to Focal loss in order to alleviate the problems of unbalanced number of positive and negative samples as well as unbalanced number of difficult and easy samples.Experimental results show that it can improve the defect detection accuracy and reduce the occurrence of missed detection. |