The convolutional neural network in deep learning has the characteristic that it can autonomously extract image features,its algorithm expression and generalization ability are stronger,and it provides a new direction for the research of defect detection schemes.At present,the defect detection methods based on deep learning all use the anchor-based object detection algorithm,which needs to design anchor with reasonable sizes and proportions for different defects.In order to further reduce the manual intervention in algorithm design,this paper takes the defects of printed circuit boards as the research object,and proposes a anchor-free defect detection algorithm to avoid the need to preset different scale anchors according to the defect size.The main work and results of this paper are as follows:(1)Designing an anchor-free printed circuit board defect detection algorithm.Based on the idea of anchor-free,through the feature pyramid network structure,this algorithm directly predicts the probability of the feature points on multiple detection layers as a certain defect’s center,the width and height mapping coefficient of the corresponding defect,and the defect center offset coefficient to complete the accurate identification and location of defects.It solves the problem that current deep learning-based defect detection methods need to manually preset reasonable-scale anchors,and its generalization performance is stronger.(2)Using the attention mechanism to optimize the proposed anchor-free printed circuit board defect detection algorithm.First,a spatial attention mechanism module at the target level is embedded to explicitly learn the spatial attention mechanism of the model,it can highlight the overall position of the defective target.Second,using a backbone network with an SE module to increase the weight of key channel information in the feature map and highlight the key features of the defective target.By merging two kinds of attention mechanisms,the proposed anchor-free defect detection algorithm is optimized,which further improves the accuracy of detecting defects on printed circuit boards.(3)Training and verification on the open source printed circuit board defect data set from The Open Lab on Human Robot Interaction of Peking University.The algorithm before optimization has achieved excellent detection performance on Mobile Netv2,Res Net101,and Res Ne Xt101 backbone networks.Among them,when Res Ne Xt101 is the backbone network,m AP reaches 96.43%.For the optimized algorithm,when using Rse Net101 as the backbone network,it’s m AP increased by 0.73%,and finally reached 96.50%.The experimental results show that the proposed algorithm has excellent performance in defect detection,it does not need to preset reasonable anchors according to different types of defects,and reduces manual intervention in algorithm design.The algorithm is easy to extend to other defect detection tasks and generalization,and has great practical value. |