Semi-supervised industrial defect detection method based on adaptive depolarization
Through the dynamic exponential moving average update mechanism and adaptive allocation module, the pseudo-label quality and label-free data utilization of semi-supervised industrial defect detection methods are improved, and the problem of pseudo-label distribution bias in the existing technology is solved, and the accurate identification of multiple defects is achieved.
Patent Information
- Application Number
- CN202510613640.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-12
AI Technical Summary
In the existing semi-supervised industrial defect detection methods, the quality of pseudo-labels generated by teacher models is difficult to improve, resulting in the model's cognitive preference for advantageous and simple categories for data distribution, and it is impossible to accurately identify multiple defects.
The dynamic exponential moving average update mechanism and adaptive allocation module are adopted to improve the utilization rate of labelless data through data augmentation and pseudo-label filtering, and construct an adaptive debiased semi-supervised detection method, including dynamic updates and pseudo-label filtering of teacher models and student models.
This improves the performance of defect detection, realizes accurate identification of multiple defects, improves the model's utilization efficiency of labelless data, and reduces the bias of pseudo-label distribution.
Smart Images

Figure CN120471890A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a semi-supervised industrial defect detection method based on adaptive debiasing. Background Art
[0002] The semi-supervised industrial defect detection method based on adaptive debiasing is based on the principle of semi-supervised learning, follows the teacher-student model paradigm, extracts defect image features through convolutional neural networks and performs target detection, optimizes the student model through the output of the teacher model, and ultimately achieves the detection of industrial defect targets.
[0003] Industrial defect detection plays a vital role in modern manufacturing, as it can monitor surface defects in industrial parts, reduce labor costs, and replace manual labor in high-risk environments. In recent years, with the emergence of new technologies in industrial imaging, computer vision, and deep learning, deep learning-based industrial defect detection has made significant progress. Due to its accuracy, efficiency, and low cost, fully supervised learning-based methods have gradually replaced traditional manual quality inspection and become an effective solution for product appearance quality inspection.
[0004] However, fully supervised learning relies heavily on large-scale, precisely labeled samples, while precise labels are extremely scarce in the field of industrial defect detection. To save labeling costs, semi-supervised defect detection attempts to jointly train models using a small amount of labeled data and a large amount of easily accessible unlabeled data.
[0005] Many current semi-supervised detection methods follow a teacher-student model framework. First, a teacher model is trained using a small amount of labeled data. The teacher model is then used to generate pseudo-labels for a large amount of unlabeled data. Finally, the pseudo-labels are combined with the labeled data to train a student model to improve performance. During training, data augmentation is often used as a consistency regularization method. Unlabeled data is augmented to varying degrees, with the strongly augmented data fed into the student model for training and the weakly augmented data fed into the teacher model for training. While this teacher-student model architecture has achieved significant progress in semi-supervised object detection, several issues remain. For example, after the teacher model is trained on labeled data, a fixed proportion of the student model's weights are invariably added to the teacher's weights, making it difficult to improve the quality of generated pseudo-labels. Furthermore, the model tends to generate more pseudo-labels for classes with higher prediction confidence while ignoring other classes. This results in a biased distribution of pseudo-labels toward dominant and simple classes, ultimately misleading the model's understanding of the data distribution.
[0006] Therefore, how to improve the performance of defect detection based on semi-supervised defect detection technology, make the detection results not biased towards certain classes, and achieve accurate identification of multiple defects has become an urgent problem to be solved. Summary of the Invention
[0007] In response to the problems in the background technology, the present invention provides a semi-supervised industrial defect detection method based on adaptive debiasing. On the basis of independently constructed defect datasets and public datasets, the method improves the utilization of unlabeled data through a dynamic exponential moving average update mechanism and an adaptive allocation module, thereby improving the performance of defect detection. It is applied to industrial defect detection with a large amount of unlabeled data to achieve accurate identification of various defects.
[0008] To achieve the above objectives, the present invention provides a semi-supervised industrial defect detection method based on adaptive debiasing, comprising:
[0009] Perform data enhancement on defect images, including weak and strong enhancement on unlabeled data, and weak enhancement on labeled data;
[0010] A semi-supervised defect detection teacher-student network is established based on a deep learning framework, including a teacher model and a student model.
[0011] Use weakly enhanced labeled data to train the teacher model to obtain a trained teacher model;
[0012] Input the weakly augmented unlabeled data into the trained teacher model to generate pseudo labels;
[0013] Two thresholds are dynamically generated through the Gaussian mixture model to filter pseudo labels with different reliability levels;
[0014] The weakly augmented labeled data and the strongly augmented unlabeled data are input into the student model. The student model calculates the loss for the labeled data and calculates different types of losses for the unlabeled data according to the reliability of the pseudo-labels of the unlabeled data.
[0015] The optimization function updates the student model according to the loss calculation result;
[0016] Dynamically updating the teacher model by a dynamic exponential averaging method;
[0017] When the number of training iterations reaches the preset number, the obtained student model is used as the defect detection model to detect defect images.
[0018] As a further improvement of the present invention, for unlabeled data, a mosaic enhancement method is used to perform weak enhancement on the unlabeled data, and a random occlusion enhancement method is used to perform strong enhancement on the unlabeled data.
[0019] As a further improvement of the present invention, a Mosaic enhancement method is used to weakly enhance the labeled data.
[0020] As a further improvement of the present invention, the semi-supervised defect detection teacher-student network includes a data enhancement part and a teacher-student model part. The teacher-student model part includes a teacher model and a student model. The network structures of the teacher model and the student model are the same.
[0021] As a further improvement of the present invention, the semi-supervised defect detection teacher-student network also includes a pseudo-label screening part for screening pseudo-labels with different reliability levels.
[0022] As a further improvement of the present invention, the pseudo-label screening part includes an adaptive allocation module, which assumes that the pseudo-labels obey the two distributions of qualified pseudo-labels and unqualified pseudo-labels, constructs a Gaussian mixture model, inputs the pseudo-label classification scores obtained by the teacher model, and uses the EM algorithm to obtain the mean of the two distributions as the threshold τ 1 and τ 2 ,The two thresholds are dynamically updated in each round of training, which can filter out pseudo labels with different reliability levels.
[0023] As a further improvement of the present invention, the student model calculates losses for labeled data, including classification loss, regression loss, and confidence loss.
[0024] As a further improvement of the present invention, for unlabeled data, different types of losses are calculated according to the reliability of the pseudo labels of the unlabeled data, including:
[0025] The two thresholds are τ 1 and τ 2 , the pseudo-label reliability score of unlabeled data is greater than τ 1 The pseudo-labels of unlabeled data are used to calculate the classification loss, regression loss and confidence loss; the reliability score of the pseudo-labels of unlabeled data is τ 1 and τ 2 The pseudo-labels between only calculate the confidence loss, and the reliability score of the pseudo-labels of unlabeled data is less than τ 2 The pseudo labels are regarded as background to calculate the confidence loss.
[0026] As a further improvement of the present invention, the teacher model is dynamically updated by a dynamic exponential averaging method; comprising:
[0027] The weight of the teacher model weight update is automatically increased or decreased according to the results of the student model in each training.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] Compared with existing models, the semi-supervised industrial defect detection method with adaptive debiasing in the present invention tends to generate more pseudo-labels for categories with higher prediction confidence and ignores other categories, resulting in the pseudo-label distribution being biased towards dominant and simple categories, ultimately misleading the model's understanding of data distribution. The method improves the utilization of unlabeled data through a dynamic exponential moving average update mechanism and an adaptive allocation module, thereby enhancing the performance of defect detection and achieving accurate identification of multiple defects.
[0030] Based on independently constructed defect datasets and public datasets, the present invention improves the utilization of unlabeled data through a dynamic exponential moving average update mechanism and an adaptive allocation module, thereby enhancing the performance of defect detection. It can be used for industrial defect detection with a large amount of unlabeled data to achieve accurate identification of multiple defects.
[0031] Based on the convolutional neural network, the data set is a pipeline defect image data set. Pytorch is selected as the deep learning framework. The teacher-student model paradigm in semi-supervised learning is adopted. The teacher model is used to generate pseudo labels for the student model to assist in training, thereby achieving the defect detection task.
[0032] This invention has important significance and value in the fields of computer vision and industrial defect detection, and proposes new ideas and solutions for semi-supervised training. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flow chart of a semi-supervised industrial defect detection method based on adaptive debiasing disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0035] The present invention is described in further detail below with reference to the accompanying drawings:
[0036] like Figure 1 As shown, the present invention provides a semi-supervised industrial defect detection method based on adaptive debiasing, comprising the steps of:
[0037] S1. Perform data enhancement on defect images, including: weak enhancement and strong enhancement on unlabeled data, and weak enhancement on labeled data;
[0038] in,
[0039] For unlabeled data, the Mosaic enhancement method is used to weakly enhance the unlabeled data, and the random occlusion enhancement method is used to strongly enhance the unlabeled data.
[0040] The Mosaic enhancement method is used to weakly enhance the labeled data.
[0041] S2. Establish a semi-supervised defect detection teacher-student network based on a deep learning framework, including a teacher model and a student model;
[0042] in,
[0043] The semi-supervised defect detection teacher-student network includes a data enhancement part and a teacher-student model part. The teacher-student model part includes a teacher model and a student model. The network structures of the teacher model and the student model are the same.
[0044] The semi-supervised defect detection teacher-student network also includes a pseudo-label screening part for screening pseudo-labels with different reliability levels.
[0045] Further,
[0046] The pseudo-label screening part includes an adaptive allocation module, which assumes that the pseudo-labels obey the two distributions of qualified pseudo-labels and unqualified pseudo-labels, constructs a Gaussian mixture model, inputs the pseudo-label classification scores obtained by the teacher model, and uses the EM algorithm to obtain the mean of the two distributions as the threshold τ 1 and τ 2 ,The two thresholds are dynamically updated in each round of training, which can filter out pseudo labels with different reliability levels.
[0047] S3. Use the weakly enhanced labeled data to train the teacher model to obtain a trained teacher model;
[0048] in,
[0049] Initialize the teacher model using weights trained with weakly augmented labeled data.
[0050] S4, input the weakly enhanced unlabeled data into the trained teacher model to generate pseudo labels;
[0051] S5. Dynamically generate two thresholds through the Gaussian mixture model to filter pseudo labels with different reliability levels;
[0052] in,
[0053] The pseudo-label screening part includes an adaptive allocation module. The adaptive allocation module assumes that the pseudo-labels obey the two distributions of qualified pseudo-labels and unqualified pseudo-labels, constructs a Gaussian mixture model, inputs the pseudo-label classification scores obtained by the teacher model, and uses the EM algorithm to obtain the mean of the two distributions as the threshold τ 1 and τ2 ,The two thresholds are dynamically updated in each round of training, which can screen out pseudo labels with different reliability levels for subsequent auxiliary student model learning.
[0054] S6. Input the weakly enhanced labeled data and the strongly enhanced unlabeled data into the student model. The student model calculates the loss for the labeled data and calculates different types of losses for the unlabeled data according to the reliability of the pseudo labels of the unlabeled data.
[0055] in,
[0056] Initialize the student model with random weights.
[0057] Further,
[0058] The student model calculates losses for labeled data, including classification loss, regression loss, and confidence loss.
[0059] For unlabeled data, different types of losses are calculated based on the reliability of the pseudo-labels of the unlabeled data, including:
[0060] The two thresholds are τ 1 and τ 2 , the pseudo-label reliability score of unlabeled data is greater than τ 1 The pseudo-labels of unlabeled data are used to calculate the classification loss, regression loss and confidence loss; the reliability score of the pseudo-labels of unlabeled data is τ 1 and τ 2 The pseudo-labels between only calculate the confidence loss, and the reliability score of the pseudo-labels of unlabeled data is less than τ 2 The pseudo labels are regarded as background to calculate the confidence loss.
[0061] S7, the optimization function updates the student model according to the loss calculation result;
[0062] in,
[0063] Select an optimization function for the student model, such as stochastic gradient descent;
[0064] According to the loss calculation results, the stochastic gradient descent method is used to update the student model.
[0065] S8. Dynamically updating the teacher model by a dynamic exponential averaging method;
[0066] in,
[0067] According to the results of the student model in each training, the proportion of the teacher model weight update is automatically increased or decreased, which improves the initiative of learning and enables the teacher model to further improve the detection ability and the overall quality of the pseudo-labels, thereby improving the final detection accuracy of the student model.
[0068] S9. When the number of training iterations reaches the preset number, the obtained student model is used as the defect detection model to detect defect images.
[0069] in,
[0070] By repeating steps S4 to S8 until the maximum number of iterations is reached, the student model is the inference model finally obtained by semi-supervised training and is used to detect defect images.
[0071] Advantages of the present invention:
[0072] Compared with existing models, the semi-supervised industrial defect detection method with adaptive debiasing in the present invention tends to generate more pseudo-labels for categories with higher prediction confidence and ignores other categories, resulting in the pseudo-label distribution being biased towards dominant and simple categories, ultimately misleading the model's understanding of data distribution. The method improves the utilization of unlabeled data through a dynamic exponential moving average update mechanism and an adaptive allocation module, thereby enhancing the performance of defect detection and achieving accurate identification of multiple defects.
[0073] Based on independently constructed defect datasets and public datasets, the present invention improves the utilization of unlabeled data through a dynamic exponential moving average update mechanism and an adaptive allocation module, thereby enhancing the performance of defect detection. It can be used for industrial defect detection with a large amount of unlabeled data to achieve accurate identification of multiple defects.
[0074] Based on the convolutional neural network, the present invention uses the pipeline DR defect image dataset PDD and the steel surface defect detection dataset NEU-DET as the data sets, selects Pytorch as the deep learning framework, adopts the teacher-student model paradigm in semi-supervised learning, and uses the teacher model to generate pseudo labels for the student model to assist in training to achieve the defect detection task.
[0075] This invention has important significance and value in the fields of computer vision and industrial defect detection, and proposes new ideas and solutions for semi-supervised training.
[0076] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A semi-supervised industrial defect detection method based on adaptive debiasing, characterized in that: include: Perform data enhancement on defect images, including weak and strong enhancement on unlabeled data, and weak enhancement on labeled data; A semi-supervised defect detection teacher-student network is established based on a deep learning framework, including a teacher model and a student model. Use weakly enhanced labeled data to train the teacher model to obtain a trained teacher model; Input the weakly augmented unlabeled data into the trained teacher model to generate pseudo labels; Two thresholds are dynamically generated through the Gaussian mixture model to filter pseudo labels with different reliability levels; The weakly augmented labeled data and the strongly augmented unlabeled data are input into the student model. The student model calculates the loss for the labeled data and calculates different types of losses for the unlabeled data according to the reliability of the pseudo-labels of the unlabeled data. The optimization function updates the student model according to the loss calculation result; Dynamically updating the teacher model by a dynamic exponential averaging method; When the number of training iterations reaches the preset number, the obtained student model is used as the defect detection model to detect defect images.
2. The method for semi-supervised industrial defect detection based on adaptive debiasing according to claim 1, characterized in that: For unlabeled data, the Mosaic enhancement method is used to weakly enhance the unlabeled data, and the random occlusion enhancement method is used to strongly enhance the unlabeled data.
3. The method for semi-supervised industrial defect detection based on adaptive debiasing according to claim 1, characterized in that: The Mosaic enhancement method is used to weakly enhance the labeled data.
4. The method for semi-supervised industrial defect detection based on adaptive debiasing according to claim 1, characterized in that: The semi-supervised defect detection teacher-student network includes a data enhancement part and a teacher-student model part. The teacher-student model part includes a teacher model and a student model. The network structures of the teacher model and the student model are the same.
5. The method for semi-supervised industrial defect detection based on adaptive debiasing according to claim 1, characterized in that: The semi-supervised defect detection teacher-student network also includes a pseudo-label screening part for screening pseudo-labels with different reliability levels.
6. The method for semi-supervised industrial defect detection based on adaptive debiasing according to claim 5, characterized in that: The pseudo-label screening part includes an adaptive allocation module, which assumes that the pseudo-labels obey the two distributions of qualified pseudo-labels and unqualified pseudo-labels, constructs a Gaussian mixture model, inputs the pseudo-label classification scores obtained by the teacher model, and uses the EM algorithm to obtain the mean of the two distributions as the threshold τ 1 and τ 2 ,The two thresholds are dynamically updated in each round of training, which can filter out pseudo labels with different reliability levels.
7. The method for semi-supervised industrial defect detection based on adaptive debiasing according to claim 1, characterized in that: The student model calculates losses for labeled data, including classification loss, regression loss, and confidence loss.
8. The method for semi-supervised industrial defect detection based on adaptive debiasing according to claim 1, characterized in that: For unlabeled data, different types of losses are calculated based on the reliability of the pseudo-labels of the unlabeled data, including: The two thresholds are τ 1 and τ 2 , the pseudo-label reliability score of unlabeled data is greater than τ 1 The pseudo-labels of unlabeled data are used to calculate the classification loss, regression loss and confidence loss; the reliability score of the pseudo-labels of unlabeled data is τ 1 and τ 2 The pseudo-labels between only calculate the confidence loss, and the reliability score of the pseudo-labels of unlabeled data is less than τ 2 The pseudo labels are regarded as background to calculate the confidence loss.
9. The method of semi-supervised industrial defect detection based on adaptive debiasing according to claim 1, characterized in that: Dynamically updating the teacher model by a dynamic exponential averaging method; comprising: The weight of the teacher model weight update is automatically increased or decreased according to the results of the student model in each training.
Citation Information
Cited By
A Training Method for a Semi-Supervised Industrial Defect Detection Model
CN122574499A