| PCB in the global output value is growing,China has become the world’s largest PCB production capacity countries.With the rapid development of the electronics industry sector,the demand for high-performance PCBs will continue to grow,but high-performance PCBs are technically complex and have many processes in the production process,which are highly susceptible to defects such as short circuits and broken circuits,all of which greatly affect the life of the PCB.At present,China is widely used in machine vision as the core of the automatic optical inspection system,but this method has high requirements for defective image pixels,complex detection algorithms and other problems.With the rapid development in the field of deep learning,the use of deep learning for defect detection is more efficient,and with the continuous updating of deep learning algorithms,it will also lead to the upgrade of PCB defect detection technology in actual production,which is beneficial to long-term development.Therefore,this paper addresses the existing problems of PCB defect detection,proposes deep learning based defect detection algorithm.PCB defects themselves have a multiplicity of line design,small defect area and similar characteristics between the defects and other problems,resulting in increased difficulty in defect detection and easy to detect errors and omissions,now use deep learning methods to solve the above problems,the main research content is as follows.1)To further improve the detection accuracy rate and solve the problem of oversized model,YOLOv4 was improved and the YOLO-J algorithm was proposed.In order to avoid the problem that the detection effect was greatly reduced by replacing the backbone network with Resnet50,the PANet was improved to achieve feature fusion at more scales;the attention mechanism was added to the network and the Hard-swish activation function was used to improve the feature extraction ability of the model for small targets;the dichotomous K-means algorithm was used to re-invent the model.dichotomous K-means algorithm to recluster the prior frame so that the algorithm can match the dataset more accurately.The experimental results demonstrate that the algorithm achieves 98.2% m AP at Io U=0.5,51.7%m AP and 60.5% recall at Io U=0.5:0.95,which is 6.7% higher m AP and 10.2% higher recall compared to the original algorithm,and the model size is 132 MB,which achieves the model to improve PCB defect detection rate while being lightweight The model size is 132 MB,which achieves the goal of improving the accuracy rate and recall rate of PCB defect detection while the model is lightweight.2)To further improve the model detection accuracy,YOLOv7 algorithm was used for PCB defect detection.YOLO-G algorithm which improved by YOLOv7 was proposed to enhance the detection effect.Bi FPN was incorporated into the Neck network of YOLOv7 to avoid losing location information while enhancing target feature information;the SPDConv module was used instead of the maximum pooling layer in the Transition module to solve the problem of losing pixel information during pooling;the Sim AM was used to enable the network to discriminate important information in a three-dimensional perspective to improve the model detection accuracy.The experimental data show that the m AP of the algorithm is 99.55% at Io U=0.5,67.7% at Io U=0.5:0.95,and 72.8% at recall,which is 8.2%higher than the m AP and 5.8% higher than the recall of the original algorithm. |