The detection of defects on the surface of metal workpieces is a very important part of the manufacturing production process,and the accuracy of the detection has a crucial impact on the quality and reliability of the products.High-precision surface defect detection can reduce leakage and misjudgment,improve the accuracy and stability of the detection,ensure that the products meet the standards and regulations,and at the same time reduce production costs and the risk of quality problems.The traditional manual inspection method has a large impact of human factors,low efficiency,poor repeatability,high cost,and lack of data analysis to identify potential quality problems or directions for improvement,and currently does not fully meet the production needs of the manufacturing industry.With the rapid development of machine vision and deep learning technologies,the field of metal workpiece surface defect detection provides new ideas.The use of deep learning techniques can achieve high accuracy detection of metal workpiece surface defects by learning the features of a large amount of data.Deep learning models can be scaled to large data sets and can be adapted to various industrial production scenarios by increasing the size or complexity of the model to improve accuracy.However,the industrial defect detection using deep learning technology still faces the serious problems of small data samples,weak model generalization and robustness,and the detection speed cannot fully meet the production realtime requirements.This thesis proposes a real-time online detection algorithm to solve the problem of small sample size,poor generalization and robustness of the model,and poor realtime inference,which is of great practical significance to the current dilemma and problem of metal workpiece surface defect detection in industrial scenarios.The specific research is as follows:The problem of difficult data sample collection for deep learning-based surface defect detection is addressed,resulting in weak generalization ability and poor robustness of the model,a generative adversarial network data generation algorithm is proposed.The proposed generative adversarial model constructs the data samples,performs feature analysis on the constructed data,and retains the data that can expand the data sample distribution.For the current problem of low defect detection accuracy for medium and small targets when using deep learning techniques for defect detection,a surface defect detection algorithm based on attention mechanism and multi-scale feature fusion is proposed.the spatial attention mechanism as well as the channel attention mechanism in the feature map makes the feature map get the attention weight values in channel and spatial dimensions,increases the connection of features in channel and space,enhances the ability to extract effective features of defect images,and performs bidirectional feature fusion in thelow-level feature layer.The features at the lower level are fully utilized in order to achieve the goal of improving the defect detection accuracy for small and medium-sized targets.The algorithm proposed in this thesis has been shown to be more accurate in detecting defects in small and medium-sized targets and more accurate in regression of bounding boxes by means of weighted box fusion.For surface defect detection in data collection,for the very difficult to collect,or even non-existent difficult defects cannot use the data-driven deep learning surface defect detection method,but defect leakage will cause uncontrollable risk to product quality,a surface defect detection algorithm that combines target detection with anomaly detection is proposed,using a combination of supervised learning and unsupervised learning,for the data that can be collected to a certain sample of the target detection method to detect,for the very difficult to collect,or even non-existent difficult defects using anomaly detection algorithms to identify unknown anomalies and improve the detection of defects.A Tensor RT accelerated deployment is proposed to remove a large number of redundant parameters obtained by deep learning models from the training process,reduce the size of the model,improve the computational efficiency of the model,enhance the inference speed of the model,and real-time online detection of time defects. |