Defect Detection of PCB Based on Attention Mechanism and Multi-scale Fusion
Considering the low detection accuracy caused by defect areas of PCB due to excessive background interference and the small scale of defective objects,a defect detection method of PCB based on attention mechanism and multi-scale fusion is proposed.Firstly,to enhance the saliency of defective object features and make the model focus more on object features,a 3D attention module is introduced in the feature extraction network based on YOLOv5.Secondly,to make full use of the multi-scale features of tiny defective object,a weighted Bi-directional Feature Pyramid Network(BiFPN)is introduced in the feature fusion network to reduce the loss of feature information of the defective object and improve the detection accuracy of the model for small defective object.Finally,the experimental results show that the method can accurately detect the defective objects in PCB images,and the average detection accuracy is improved by 3.9%compared with the original method while the real-time performance is ensured,which shows the effectiveness of the method.