Defect Detection Method and System for Cold Start of Industrial Quality Inspection
Through a three-stage process, the industrial quality inspection model is gradually built using positive samples, few samples and full supervision learning methods, which solves the problems of sparse defect data and high labeling costs, and achieves rapid cold start and high-precision detection.
Patent Information
- Application Number
- CN202210129535.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-11
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-02-11
AI Technical Summary
In industrial quality inspection, due to the scarce defect data and high labeling cost, deep learning algorithms are difficult to start quickly. In the case of limited data, the model accuracy is poor and the degree of overfitting is high, resulting in a long online cycle of quality inspection projects.
The three-stage process is adopted: the model is constructed using the positive sample learning method in the early stage, the small sample learning method in the middle stage, and the fully supervised deep learning method in the later stage, gradually realizing cold start and high-precision detection.
It realizes the rapid algorithm launch in the absence of data, solves the problem of long online launch cycle of quality inspection items, and improves data utilization through selective data reflow, reducing the cost of repeated labeling.
Smart Images

Figure CN114463316B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cold start, and specifically, to a defect detection method and system for industrial quality inspection cold start. Background Art
[0002] Currently, deep learning has been applied to industrial quality inspection in many solutions. However, deep learning algorithms are data-driven and require a large amount of data, especially defect sample data. And for a large amount of defect data, sufficient annotation is also required. In the actual production environment, the data of defective workpieces is usually very scarce and difficult to obtain in large quantities. At the same time, annotation also brings a large amount of costs. With the update of products, data acquisition will also be continuously updated, bringing high costs.
[0003] Therefore, in past deep learning applications, it was usually necessary to first spend a lot of time collecting and annotating data samples, resulting in the inability to quickly start up the quality inspection algorithm for cold start.
[0004] To address the cold start problem:
[0005] In the patent document CN113850790A, a cold start visual detection method for handicraft surface defects is constructed. By collecting defect data sets in other fields, the data set for the quality inspection task is enhanced and expanded to achieve cold start. This solution starts from the data and manually augments the previous data set. However, there are certain distribution differences between the data sets in other fields and the data set for the quality inspection task, resulting in low feature transfer efficiency and even potentially affecting the performance of the model.
[0006] The patent document CN113869964A is a cold start method for a recommendation system, but it cannot be applied to quality inspection. Summary of the Invention
[0007] Aiming at the defects in the prior art, the purpose of the present invention is to provide a defect detection method and system for industrial quality inspection cold start.
[0008] According to the defect detection method for industrial quality inspection cold start provided by the present invention, it includes:
[0009] Step 1: In the early stage of the industrial quality inspection project, construct a preliminary detection model through the positive sample learning method to achieve cold start;
[0010] Step 2: In the middle stage of the industrial quality inspection project, realize detection under data limitations through the few-shot learning algorithm;
[0011] Step 3: In the later stage of the industrial quality inspection project, realize higher-precision detection through the full-supervised quality inspection algorithm.
[0012] Preferably, the step 1 includes:
[0013] Step 1.1: Construct dataset D1 as positive samples;
[0014] Step 1.2: Based on dataset D1, use the positive sample learning method to construct and train model M1; for the input image x, model M1 obtains a corresponding anomaly score: s1 = M1(x). The larger the anomaly score, the greater the degree to which the input data deviates from the training set data distribution and the higher the anomaly probability;
[0015] Step 1.3: Apply model M1 to the production line, set the threshold th1 as the decision boundary. If the anomaly score s1 > th1, then the input image to be detected is determined to be defective; if s1 < th1, then the input image is determined to be non-defective;
[0016] Step 1.4: Construct dataset D2. For the data in Step 1.3, given another threshold th10, regard all the samples with detected anomaly scores greater than th10 as probable defective data, add them to dataset D2, and label this data.
[0017] Preferably, the said Step 2 includes:
[0018] Step 2.1: Based on dataset D2, use the few-shot learning method to construct and train model M2; for the input image x, model M2 obtains a similarity s2 corresponding to the defects in dataset D2. The higher the similarity, the greater the similarity degree with the defects in the training set and the higher the defect probability;
[0019] Step 2.2: Apply model M2 to the production line, set the threshold th2 as the decision boundary. If the similarity s2 > th2, then the input image is determined to be defective; if s2 < th2, then the input image is determined to be non-defective;
[0020] Step 2.3: Inherit all the data and labels of dataset D2 to construct dataset D3. For the data in Step 2.2, given another threshold th20, regard all the samples with detected similarities s2 greater than th20 as probable defective data, add them to dataset D3, and label this data.
[0021] Preferably, the said Step 3 includes:
[0022] Step 3.1: Based on dataset D3, use the deep learning method to construct and train model M3; for the input image x, model M3 obtains a corresponding defect probability s3, 0 < s3 < 1; the larger the defect probability s3, the higher the defect probability of the input sample;
[0023] Step 3.2: Apply model M3 in the production line, set the threshold th3 as the decision boundary. If the defect probability s3 > th3, then determine that the input image is defective; if s3 < th3, then determine that the input image is non-defective.
[0024] Step 3.3: For the data in Step 3.2, given another two thresholds th30 and th31, where th30 < th31. When th30 < s3 < th31, it means that the algorithm is uncertain about the defectiveness judgment of the input image. Label this image and add it to the dataset D3.
[0025] Step 3.4: After the quantity level of the dataset D3 reaches the preset threshold, return to Step 3.1 and continue to execute until the defectiveness judgment of all input images is completed.
[0026] Preferably, the setting of the threshold th1 is as follows: Obtain the anomaly scores of all samples in the dataset D1 through the model M1. The threshold th1 is greater than the anomaly scores of the dataset D1 at a preset ratio, and it is adjusted according to the defect tolerance of the production line.
[0027] The setting of the threshold th2 is as follows: Obtain the similarity of all samples in the dataset D2 through the model M2. The threshold th2 is greater than the anomaly scores of the dataset D2 at a preset ratio, and it is adjusted according to the defect tolerance of the production line.
[0028] The setting of the threshold th3 is as follows: Obtain the defect probability of all samples in the dataset D3 through the model M3. Calculate the detection rate and missed detection rate under different thresholds th3, and then inversely deduce the threshold th3 according to the requirements of the production line.
[0029] According to the defect detection system for industrial quality inspection cold start provided by the present invention, it includes:
[0030] Module M1: In the early stage of the industrial quality inspection project, construct a preliminary detection model through the positive sample learning method to achieve cold start.
[0031] Module M2: In the middle stage of the industrial quality inspection project, realize the detection under data limitation through the few-shot learning algorithm.
[0032] Module M3: In the later stage of the industrial quality inspection project, realize higher-precision detection through the fully supervised quality inspection algorithm.
[0033] Preferably, the module M1 includes:
[0034] Module M1.1: Dataset construction D1, as positive samples.
[0035] Module M1.2: Based on dataset D1, using the positive sample learning method, construct and train model M1; for the input image x, model M1 obtains a corresponding anomaly score: s1 = M1(x). The larger the anomaly score, the greater the degree to which the input data deviates from the training set data distribution, and the higher the anomaly probability.
[0036] Module M1.3: Apply model M1 to the production line, set the threshold th1 as the decision boundary. If the anomaly score s1 > th1, then determine that the input image to be detected is defective; if s1 < th1, then determine that the input image is non-defective.
[0037] Module M1.4: Construct dataset D2. For the data in module M1.3, given another threshold th10, regard all the samples with detected anomaly scores greater than th10 as probable defective data, add them to dataset D2, and label this data.
[0038] Preferably, the said module M2 includes:
[0039] Module M2.1: Based on dataset D2, using the few-shot learning method, construct and train model M2; for the input image x, model M2 obtains a similarity s2 corresponding to the defects in dataset D2. The higher the similarity, the greater the degree of similarity to the defects in the training set, and the greater the defect probability.
[0040] Module M2.2: Apply model M2 to the production line, set the threshold th2 as the decision boundary. If the similarity s2 > th2, then determine that the input image is defective; if s2 < th2, then determine that the input image is non-defective.
[0041] Module M2.3: Inherit all the data and labels of dataset D2 to construct dataset D3. For the data in module M2.2, given another threshold th20, regard all the samples with detected similarities s2 greater than th20 as probable defective data, add them to dataset D3, and label this data.
[0042] Preferably, the said module M3 includes:
[0043] Module M3.1: Based on dataset D3, using the deep learning method, construct and train model M3; for the input image x, model M3 obtains a corresponding defect probability s3, 0 < s3 < 1; the larger the defect probability s3, the greater the probable defective probability of the input sample.
[0044] Module M3.2: Apply model M3 to the production line, set the threshold th3 as the decision boundary. If the defect probability s3 > th3, then determine that the input image is defective; if s3 < th3, then determine that the input image is non-defective.
[0045] Module M3.3: For the data in Module M3.2, given another two thresholds th30 and th31, where th30 < th31, when th30 < s3 < th31, it means that the algorithm's judgment on the defectiveness of the input image is uncertain. The image is labeled and added to the dataset D3;
[0046] Module M3.4: After the quantity level of the dataset D3 reaches the preset threshold, return to Module M3.1 to continue execution until the defectiveness judgment of all input images is completed.
[0047] Preferably, the setting of the threshold th1 is as follows: Obtain the anomaly scores of all samples in the dataset D1 through the model M1. The threshold th1 is greater than the anomaly scores of the dataset D1 at a preset ratio, and it is adjusted according to the defect tolerance of the production line;
[0048] The setting of the threshold th2 is as follows: Obtain the similarity of all samples in the dataset D2 through the model M2. The threshold th2 is greater than the anomaly scores of the dataset D2 at a preset ratio, and it is adjusted according to the defect tolerance of the production line;
[0049] The setting of the threshold th3 is as follows: Obtain the defect probability of all samples in the dataset D3 through the model M3, calculate the detection rate and missed detection rate under different thresholds th3, and then inversely deduce the threshold th3 according to the requirements of the production line.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] 1. The present invention solves the problem of the lack of data and annotation in the early stage of the deep learning industrial quality inspection project and the inability to perform cold start by using the algorithm of positive sample learning;
[0052] 2. The present invention solves the problems of poor model accuracy and high overfitting degree in the middle stage of the deep learning industrial quality inspection project under the condition of limited data and few defect samples by using the algorithm of few-shot learning;
[0053] 3. The present invention realizes the multi-stage gradual start and rapid online of industrial quality inspection by using a three-stage industrial quality inspection process, and solves the problem of the long online cycle of industrial quality inspection projects;
[0054] 4. The present invention realizes efficient data feedback by continuously using the characteristics of each algorithm and selectively collecting samples with high probability of defects and difficult examples, and solves the problems of repeated annotation of a large number of single samples or normal samples in industrial quality inspection and low data utilization rate. Description of the Drawings
[0055] By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes and advantages of the present invention will become more obvious:
[0056] Figure 1 This is the overall flowchart of the method of the present invention;
[0057] Figure 2 This is the flowchart for defect detection of the positive sample learning algorithm;
[0058] Figure 3 This is the flowchart for defect detection of the few-shot learning algorithm;
[0059] Figure 4 This is the flowchart for defect detection of the fully supervised learning algorithm. Specific implementation manners
[0060] The present invention will be described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several changes and improvements can still be made. These all fall within the protection scope of the present invention.
[0061] Embodiment:
[0062] In the existing industrial quality inspection solutions based on deep learning, it is usually necessary to first collect a large amount of data, especially defect sample data, before a detection model can be trained. The data collection and processing steps in this process usually take a long time, making it difficult for the quality inspection system to be quickly deployed in the production line.
[0063] The present invention proposes a three-stage industrial quality inspection process based on deep learning. In the early stage of the industrial quality inspection project, the positive sample learning method is used to quickly launch the detection algorithm and achieve cold start; in the middle stage, the few-shot learning algorithm is used to achieve efficient detection under data limitations; finally, in the later stage when rich samples are collected, the conventional fully supervised quality inspection algorithm is used to achieve high-precision detection. Let the algorithm effectively collect and utilize data throughout the entire life cycle of the industrial quality inspection project.
[0064] The present invention designs a process, which is divided into three periods: the early stage, the middle stage, and the later stage, according to the time sequence of the operation of the industrial quality inspection project. Since data collection is carried out along with the operation of the production line in the quality inspection project, the amount of data collected in the early, middle, and later projects is increasing. The following is a specific description of the solution in three periods, and the process is as Figure 1 .
[0065] One: The early stage.
[0066] In the early stage of the quality inspection project, the amount of data collected is small, and since in the quality inspection project, the normal samples are usually much more than the defect samples, the defect samples in the early stage are extremely scarce and not enough to train a conventional deep learning model. Therefore, the positive sample learning method is used here to construct the early detection model.
[0067] (1) Dataset construction. Collect 100 - 300 pieces of data to construct dataset D1. To achieve rapid algorithm deployment, the annotation step is ignored, and all of D1 is regarded as positive samples.
[0068] (2) Model acquisition. Based on dataset D1, use the method of learning with positive samples (such as the reconstruction method) to construct and train model M1. For the input image x, model M1 obtains a corresponding anomaly score: s1 = M1(x). The larger the anomaly score, the greater the degree to which the input data deviates from the data distribution of the training set, that is, the higher the anomaly probability.
[0069] (3) Detection algorithm operation. The process is as Figure 2 . Apply model M1 to the production line, and set the threshold th1 as the decision boundary. If the anomaly score s1 > th1, then regard the input image to be detected as a defect; if s1 < th1, then regard the input image as normal defect-free data (the method for setting the threshold th1 is: obtain the anomaly scores of all samples in dataset D1 through M1, and th1 should be greater than the anomaly scores of the vast majority of D1, and specifically needs to be adjusted according to the defect tolerance of the production line).
[0070] (4) Data feedback. Construct dataset D2. For the data in (3), given another threshold th10, regard all samples with anomaly scores greater than th10 in (3) as data with a certain probability of defects, add them to dataset D2, and accurately annotate this data.
[0071] II: Mid - term.
[0072] In the mid - term of the quality inspection project, there is a certain amount of data accumulation, but the data diversity is limited, and the defective samples are still scarce. It is easy for the deep learning model trained by conventional methods to overfit and the effect is very poor. Therefore, the few - shot learning method is used here to construct the mid - term detection model.
[0073] (1) Dataset construction. Use the previously constructed dataset D2 as the dataset. Since a large number of normal samples are screened out during the construction of D2, the defective samples in D2 are relatively balanced.
[0074] (2) Model acquisition. Based on dataset D2, use the few - shot learning method (such as the query method) to construct and train model M2. For the input image x, model M2 obtains a corresponding similarity s2 with the defects in dataset D2. The higher the similarity, the greater the similarity with the defects in the training set and the greater the defect probability.
[0075] (3) Detection algorithm operation. The process is as Figure 3. Apply Model M2 to the production line, and set the threshold th2 as the decision boundary. If the similarity s2 > th2, the input image is regarded as a defect; if s2 < th2, the input image is regarded as normal defect-free data (the method for setting the threshold th2 is as follows: obtain the similarity of all samples in the dataset D2 through M2, and th2 should be greater than the abnormal scores of the vast majority of D2, and specifically needs to be adjusted according to the defect tolerance of the production line).
[0076] (4) Data feedback. Construct dataset D3, and D3 inherits all the data and annotations of D2. For the data in (3), given another threshold th20, regard all samples with similarity s2 greater than th20 detected in (3) as data with a certain probability of defects, add them to dataset D3, and perform precise annotation on this data.
[0077] III: Later stage.
[0078] After the operation in the early and middle stages, the system has accumulated a large amount of high-quality labeled data, and at this time, conventional fully supervised deep learning algorithms can be applied.
[0079] (1) Dataset construction. Use dataset D3 as the dataset.
[0080] (2) Model acquisition. Based on dataset D3, use deep learning methods (such as classification network resnet or detection network faster-rcnn, etc.) to construct and train to obtain Model M3. Model M3 obtains a corresponding defect probability s3 for the input image x, where 0 < s3 < 1. The larger the defect probability s3, the greater the probability of defects in the input sample.
[0081] (3) Detection algorithm operation. The process is as Figure 4 . Apply Model M3 to the production line, and set the threshold th3 as the decision boundary. If the defect probability s3 > th3, the input image is regarded as a defect; if s3 < th3, the input image is regarded as normal defect-free data (the method for setting the threshold th3 is to obtain the defect probability of all samples in dataset D3 through M3, calculate the detection rate and missed detection rate under different th3, and then reverse th3 according to the requirements of the production line).
[0082] (4) Data feedback. Update dataset D3. For the data in (3), given another two thresholds th30 and th31, where th30 < th31, when th30 < s3 < th31, it means that the algorithm's judgment on whether the input image is a defect or normal is highly uncertain. At this time, this image can be regarded as a difficult example, so add this input data to D3 after detailed annotation.
[0083] (5) Model update. After the dataset D3 is expanded to a certain level, repeat the iteration of (1) to (4).
[0084] According to the defect detection system for industrial quality inspection cold start provided by the present invention, it includes: Module M1: In the early stage of industrial quality inspection projects, construct a preliminary detection model through the positive sample learning method to achieve cold start; Module M2: In the middle stage of industrial quality inspection projects, through the few-shot learning algorithm, achieve efficient detection under data limitations; Module M3: In the later stage of industrial quality inspection projects, through the fully supervised quality inspection algorithm, achieve high-precision detection.
[0085] The module M1 includes: Module M1.1: Dataset construction D1, as positive samples; Module M1.2: Based on the dataset D1, use the positive sample learning method to construct and train the model M1; The model M1 obtains a corresponding anomaly score for the input image x: s1 = M1(x). The larger the anomaly score, the greater the degree of deviation of the input data from the training set data distribution and the higher the anomaly probability; Module M1.3: Apply the model M1 to the production line, set the threshold th1 as the decision boundary. If the anomaly score s1 > th1, then determine the input image to be detected as defective; if s1 < th1, then determine the input image as non-defective; Module M1.4: Construct the dataset D2. For the data in Module M1.3, given another threshold th10, regard all the samples with detected anomaly scores greater than th10 as probable defective data, add them to the dataset D2, and label this data.
[0086] The module M2 includes: Module M2.1: Based on the dataset D2, use the few-shot learning method to construct and train the model M2; The model M2 obtains a similarity s2 of the defect in the dataset D2 corresponding to the input image x. The higher the similarity, the greater the similarity degree with the defects in the training set and the greater the defect probability; Module M2.2: Apply the model M2 to the production line, set the threshold th2 as the decision boundary. If the similarity s2 > th2, then determine the input image as defective; if s2 < th2, then determine the input image as non-defective; Module M2.3: Inherit all the data and labels of the dataset D2 to construct the dataset D3. For the data in Module M2.2, given another threshold th20, regard all the samples with detected similarities s2 greater than th20 as probable defective data, add them to the dataset D3, and label this data.
[0087] The module M3 includes: Module M3.1: Based on the dataset D3, using deep learning methods, construct and train to obtain the model M3; for the input image x, the model M3 obtains a corresponding defect probability s3, where 0 < s3 < 1; the larger the defect probability s3, the greater the defect probability of the input sample. Module M3.2: Apply the model M3 to the production line, set the threshold th3 as the decision boundary. If the defect probability s3 > th3, then determine that the input image is defective; if s3 < th3, then determine that the input image is non-defective. Module M3.3: For the data in Module M3.2, given another two thresholds th30 and th31, where th30 < th31. When th30 < s3 < th31, it means that the algorithm is uncertain about the defectiveness judgment of the input image, and label this image and add it to the dataset D3. Module M3.4: After the quantity level of the dataset D3 reaches the preset threshold, return to Module M3.1 to continue execution until the defectiveness judgment of all input images is completed.
[0088] The setting of the threshold th1 is as follows: Pass all samples in the dataset D1 through the model M1 to obtain the anomaly score. The threshold th1 is greater than the anomaly scores of the dataset D1 at a preset ratio, and is adjusted according to the defect tolerance of the production line; the setting of the threshold th2 is as follows: Pass all samples in the dataset D2 through the model M2 to obtain the similarity. The threshold th2 is greater than the anomaly scores of the dataset D2 at a preset ratio, and is adjusted according to the defect tolerance of the production line; the setting of the threshold th3 is as follows: Pass all samples in the dataset D3 through the model M3 to obtain the defect probability, calculate the detection rate and missed detection rate under different thresholds th3, and then inversely deduce the threshold th3 according to the requirements of the production line.
[0089] Those skilled in the art know that in addition to implementing the systems, devices and their respective modules provided by the present invention in the form of pure computer-readable program codes, the method steps can be logically programmed to enable the systems, devices and their respective modules provided by the present invention to be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. to achieve the same program. Therefore, the systems, devices and their respective modules provided by the present invention can be regarded as a kind of hardware component, and the modules included therein for implementing various programs can also be regarded as the structure within the hardware component; the modules for implementing various functions can also be regarded as both software programs for implementing the method and the structure within the hardware component.
[0090] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above specific implementation manners. Those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. Without conflict, the embodiments of the present application and the features in the embodiments can be combined arbitrarily with each other.
Claims
1. A defect detection method for cold start of industrial quality inspection, characterized in that, Including: Step 1: In the early stage of industrial quality inspection projects, construct a preliminary detection model through the positive sample learning method to achieve cold start; Step 2: In the middle stage of industrial quality inspection projects, realize detection under data limitations through few-shot learning algorithms; Step 3: In the later stage of industrial quality inspection projects, achieve higher-precision detection through fully supervised quality inspection algorithms; The said Step 1 includes: Step 1.1: Construct dataset D1 as positive samples; Step 1.2: Based on dataset D1, use the positive sample learning method to construct and train model M1; for the input image x, model M1 obtains a corresponding anomaly score: s1 = M1(x). The larger the anomaly score, the greater the degree to which the input data deviates from the training set data distribution and the higher the anomaly probability; Step 1.3: Apply model M1 to the production line, set the threshold th1 as the decision boundary. If the anomaly score s1 > th1, then determine the input image to be detected as defective; if s1 < th1, then determine the input image as non-defective; Step 1.4: Construct dataset D2. For the data in Step 1.3, given another threshold th10, regard all samples with detected anomaly scores greater than th10 as probable defective data, add them to dataset D2, and label this data; The said Step 2 includes: Step 2.1: Based on dataset D2, use the few-shot learning method to construct and train model M2; for the input image x, model M2 obtains a similarity s2 corresponding to the defects in dataset D2. The higher the similarity, the greater the similarity degree with the defects in the training set and the greater the defect probability; Step 2.2: Apply model M2 to the production line, set the threshold th2 as the decision boundary. If the similarity s2 > th2, then determine the input image as defective; if s2 < th2, then determine the input image as non-defective; Step 2.3: Inherit all the data and labels of dataset D2 to construct dataset D3. For the data in Step 2.2, given another threshold th20, regard all samples with detected similarities s2 greater than th20 as probable defective data, add them to dataset D3, and label this data.
2. The defect detection method for cold start in industrial quality inspection according to claim 1, wherein The said Step 3 includes: Step 3.1: Based on dataset D3, use the deep learning method to construct and train model M3; for the input image x, model M3 obtains a corresponding defect probability s3, where 0 < s3 < 1; the larger the defect probability s3, the greater the defect probability of the input sample; Step 3.2: Apply model M3 to the production line, set the threshold th3 as the decision boundary. If the defect probability s3 > th3, then determine the input image as defective; if s3 < th3, then determine the input image as non-defective; Step 3.3: For the data in Step 3.2, given another two thresholds th30 and th31, where th30 < th31. When th30 < s3 < th31, it means that the algorithm is uncertain about the defectiveness judgment of the input image. Label this image and add it to dataset D3; Step 3.4: After the magnitude of the dataset D3 reaches the preset threshold, return to Step 3.1 to continue execution until the defectiveness judgment of all input images is completed.
3. The defect detection method for cold start in industrial quality inspection according to claim 2, characterized in that, The setting of the threshold th1 is as follows: Obtain the anomaly scores of all samples in the dataset D1 through the model M1. The threshold th1 is greater than the anomaly scores of the dataset D1 at a preset ratio, and it is adjusted according to the defect tolerance of the production line. The setting of the threshold th2 is as follows: Obtain the similarity of all samples in the dataset D2 through the model M2. The threshold th2 is greater than the anomaly scores of the dataset D2 at a preset ratio, and it is adjusted according to the defect tolerance of the production line. The setting of the threshold th3 is as follows: Obtain the defect probability of all samples in the dataset D3 through the model M3. Calculate the detection rate and missed detection rate under different thresholds th3, and then inversely deduce the threshold th3 according to the requirements of the production line.
4. A defect detection system for cold start of industrial quality inspection, characterized in that, Including: Module M1: In the early stage of the industrial quality inspection project, construct a preliminary detection model through the positive sample learning method to achieve cold start. Module M2: In the middle stage of the industrial quality inspection project, realize detection under data limitations through the few-shot learning algorithm. Module M3: In the later stage of the industrial quality inspection project, realize higher-precision detection through the fully supervised quality inspection algorithm. The module M1 includes: Module M1.1: Dataset construction D1, as positive samples. Module M1.2: Based on the dataset D1, use the positive sample learning method to construct and train the model M1. The model M1 obtains a corresponding anomaly score for the input image x: s1 = M1(x). The larger the anomaly score, the greater the degree to which the input data deviates from the training set data distribution and the higher the anomaly probability. Module M1.3: Apply the model M1 to the production line, and set the threshold th1 as the decision boundary. If the anomaly score s1 > th1, then determine the input image to be detected as defective; if s1 < th1, then determine the input image as non-defective. Module M1.4: Construct the dataset D2. For the data in Module M1.3, given another threshold th10, regard all samples with detected anomaly scores greater than th10 as probable defective data, add them to the dataset D2, and label this data. The module M2 includes: Module M2.1: Based on the dataset D2, use the few-shot learning method to construct and train the model M2. The model M2 obtains a similarity s2 corresponding to the defect in the dataset D2 for the input image x. The higher the similarity, the greater the degree of similarity to the defects in the training set and the higher the defect probability. Module M2.2: Apply the model M2 to the production line, and set the threshold th2 as the decision boundary. If the similarity s2 > th2, then determine the input image as defective; if s2 < th2, then determine the input image as non-defective. Module M2.3: Inherit all the data and annotations of the dataset D2 to construct the dataset D3. For the data in Module M2.2, given another threshold th20, regard all samples with detected similarities s2 greater than th20 as probable defective data, add them to the dataset D3, and label this data.
5. The defect detection system for cold start in industrial quality inspection according to claim 4, characterized in that The module M3 includes: Module M3.1: Based on dataset D3, using deep learning method, construct and train model M3; for the input image x of model M3, obtain a corresponding defect probability s3, where 0 < s3 < 1; the larger the defect probability s3, the greater the defect probability of the input sample number; Module M3.2: Apply model M3 in the production line, set the threshold th3 as the decision boundary. If the defect probability s3 > th3, then determine the input image as defective; if s3 < th3, then determine the input image as non-defective; Module M3.3: For the data in module M3.2, given another two thresholds th30 and th31, where th30 < th31. When th30 < s3 < th31, it means that the algorithm is uncertain about the defectiveness judgment of the input image. Label this image and add it to dataset D3; Module M3.4: After the quantity level of dataset D3 reaches the preset threshold, return to module M3.1 to continue execution until the defectiveness judgment of all input images is completed.
6. The defect detection system for cold start of industrial quality inspection according to claim 5, characterized in that, The setting of threshold th1 is as follows: Obtain the anomaly scores of all samples in dataset D1 through model M1. Threshold th1 is greater than the anomaly scores of the dataset D1 of the preset ratio, and is adjusted according to the defect tolerance of the production line; The setting of threshold th2 is as follows: Obtain the similarity of all samples in dataset D2 through model M2. Threshold th2 is greater than the anomaly scores of the dataset D2 of the preset ratio, and is adjusted according to the defect tolerance of the production line; The setting of threshold th3 is as follows: Obtain the defect probability of all samples in dataset D3 through model M3, calculate the detection rate and missed detection rate under different thresholds th3, and then inversely deduce the threshold th3 according to the requirements of the production line.
Citation Information
Patent Citations
Cold-start visual detection method for artware surface defects
CN113850790A
Data processing method and related device
CN113869964A
Abnormality detection method and device, electronic equipment and computer readable storage medium
CN113688889A