| Printed Circuit Board(PCB)manufacturing is the core link of the electronic information industry.China’s PCB output value has been maintained in recent years the world’s first,in order to avoid the flow of defective PCB products to the market,for the PCB surface defects detection is particularly important.Traditional PCB surface defect detection technology is gradually eliminated from the market due to its low efficiency and poor portability.Deep learning-based PCB defect detection can effectively extract the deep features of defects,detection effect and noise immunity are stronger,and gradually become the mainstream detection means.However,there are still some application difficulties in the PCB defect detection scenario,such as:(1)PCB defects cover a small area and are difficult to detect;(2)it is difficult to achieve a balance between detection accuracy and speed in the localization and classification scenario;(3)in the pixel-level detection scenario,the defect edge contour extraction is not accurate,which is not conducive to assisting in the repair of related defects.To address the current problems,the main research of this thesis is as follows:(1)A YOLOv5-based improved PCB defect detection algorithm is proposed for classification and localization scenarios.The downsampling module is improved in the backbone network to enhance the feature extraction capability for small target defects;the P2 branch is introduced in the head of feature fusion and classification to enhance the effective pixel detection of defects,while the channel and spatial attention mechanisms are added to the CSP module in order to enhance the feature information of small target defects;the EIo U Loss and Focal Loss are used in the loss function to improve the model localization and the imbalance between positive and negative samples.Finally,the model performance is improved by pre-training,and the accuracy,recall and m AP of the model in this thesis are experimentally verified to reach 93.6%,93.2% and 95.3% on the PCB dataset,respectively,while the detection speed can be well adapted to the PCB defect detection scenario,and the comprehensive performance is better than the current mainstream target detection algorithms.(2)A PCB defect detection algorithm based on a semantic segmentation model is proposed for a more stringent pixel-level detection scenario.Firstly,a high-resolution feature extraction network HRNet is introduced to address the problem that small target information is easily lost in the downsampling process;secondly,a feature pyramid FPN is introduced to fuse the last four layers of feature maps of HRNet to further improve the segmentation performance of the model;finally,the defect edges are optimized by using Point Rend point rendering to ensure the defect contour information integrity.The experiments are conducted on the homemade PCB defect segmentation dataset in this thesis,and the results show that the comprehensive performance of the model in this thesis is better than the current mainstream segmentation algorithms,with MIo U,MRecall,MFscore and MPrecision reaching 81.73%,89.41%,89.76% and90.2%,respectively,which meet the requirements of practical PCB defect pixel-level detection.(3)Relying on the two PCB defect detection algorithms proposed in this thesis,a PCB defect detection system is designed and implemented to meet the needs of different PCB defect detection scenarios.The system functions include user registration and login,algorithm selection,visualization of inspection results and statistical storage of inspection data.Finally,the system is tested for functionality,and the results show that the algorithms in this thesis have a high practicality in the actual PCB defect detection scenario.The thesis includes 57 figures,14 tables,and 76 references. |