| Laptops are essential tools for daily work and learning.When facing the same configuration,consumers pay more attention to the appearance and touch of the laptop.The appearance and touch of laptops cannot be improved without the materials and processes that make up the shell,which urges laptop enterprises to use new materials and new processes when designing and producing new products.With the continuous emergence of new materials and new processes,when put into mass production,it will bring new challenges to defect detection,and it is easy for defective products to flow into the market,which not only affects the purchase enthusiasm of consumers but also damages the brand image of enterprises.In actual production,the surface defects of products are still detected manually.Due to the flow of personnel or the different understanding of defects by different inspectors,it is impossible to provide a stable qualification rate during the peak period of production.Traditional visual methods have a good detection effect for regular defects,but in the face of irregular and random defects,the detection effect is not good.With the continuous development of deep-learning technology,it is possible to use deep learning to detect the surface defects of laptops.This thesis will propose methods for detecting surface defects in laptops from two directions: target detection and image abnormality.The target detection method uses defects as image detection targets.This thesis selects the currently popular target detection method YOLOv5 in the industrial field as a benchmark for improvement.Firstly,this thesis reconstructs the network,using lightweight Ghost convolution to reconstruct YOLOv5,effectively reducing the number of parameters and computational complexity.To solve the problem of small receptive fields in convolutional nuclei that are difficult to capture long-distance dependent information,increasing the Sim AM attention mechanism allows high-level backbone networks to obtain larger receptive fields,which can effectively improve the detection effect of the model on defects.The reconstructed network YOLOv5-SGhost can reach an advanced level.Due to the small proportion of abnormal images compared with normal images,the acquisition cost is high.The neural network can learn abnormal al data,the model will have better distinguishability.To solve this problem,This thesis also proposes a self-supervised learning method for image anomaly detection.This thesis uses data enhancement to randomly fabricate defect data with different sizes and locations to simulate real defects and combines the manufactured defect data and normal data to form self-supervised though there are differences between the manufactured defect data and the real data,the strong generalization ability of neural network makes the trained model still able to distinguish the real defect image.Finally,a CAM-loss driven backbone network is used to obtain more discriminative feature representations of target categories,enabling Grad-CAM to achieve the best image-level level location. |