With the high density and high precision of PCB boards,manual visual inspection of PCB defects can no longer meet the needs of industrial production.PCB manufacturers need an automatic detection process to detect PCB defects,while AOI+deep learning is widely popular with its relatively low price,low threshold and high precision.This paper attempts to combine the AOI technology with the case segmentation model to obtain the contourinform ation of PCB defects under the condition of accurately obtaining the location information of PCB defects,so as to prepare for further industrial automation.In this paper,the original defect image(PCB solder plate with more complexity than bare plate)is collected by AOI equipment of the production line,and the appropriate data set is generated by labeling and preprocessing.The model selects two representative models of different types of target detection,Mask R-CNN and Yolov5,for pretraining to get the preliminary results.The results are analyzed,and the shortcomings of both in this data set are pointed out and improved.By introducing CBAM attention mechanism The method of MobileNetv3 replacing ResNet50 and Softer-NMS replacing traditional NMS improves the accuracy and reasoning speed of Mask-RCNN model,and improves the accuracy and recall rate of Yolov5 model to make it more in line with actual needs.Finally,compare the two models and select the more suitable one as the final model for deployment.At the same time,a software for forecasting and labeling is designed to facilitate the subsequent improvement of the model and prediction.The final model is Yolov5 improved model,which has achieved excellent results of 90.8%map and 20ms reasoning speed in the data set.Compared with the original model,the improved model is in the aspect of Bboxmap@50 Improved by 3%,recall rate by 5%,accuracy rate by 5%map@50 4%improvement,7%improvement in recall rate and 6%improvement in accuracy rate.Compared with the visual algorithm being used in the plant area,it not only greatly improves the accuracy and reasoning speed,but also additionally obtains the contour information of defects,which is more conducive to the development of plant automation. |