A method for eliminating false defects based on the smoothness of structural lines

By establishing calibration structure lines and calculating grayscale difference scores, false defects in deep learning models can be quickly identified and eliminated, solving the problem of false defect detection in deep learning defect detection and improving detection efficiency and accuracy.

CN119048471BActive Publication Date: 2025-12-02ZHUHAI BOTAO TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411160302.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-12-02
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Deep learning suffers from false defects in defect detection, and existing technologies struggle to quickly and efficiently eliminate these false defects on the structural lines, impacting product yield.

Method used

By establishing calibration structure lines, calculating the grayscale difference scores of pixels within the defect area, forming connected component clusters, and using traditional image algorithms to determine the true defect attributes, a deep learning model can be assisted in eliminating false defects.

Benefits of technology

It achieves a rapid, near 100% false defect elimination rate, improving detection efficiency and accuracy while reducing sample collection and training time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048471B_ABST
    Figure CN119048471B_ABST
Patent Text Reader

Abstract

This invention aims to provide a false defect elimination method based on structure line smoothness. This method evaluates whether a defect near a structure line in an image is a real or false defect by assessing its non-smoothness relative to a calibrated structure line, thereby reducing false defect detection. The invention includes the following steps: Step S1. After obtaining the defect detection results of the product, establish a calibrated structure line on the defect image of the product; Step S2. Establish a grayscale conversion image based on the calibrated structure line; Step S3. Calculate the difference score of pixels within candidate defects; Step S4. Form defect connected component clusters based on the difference scores; Step S5. Evaluate the true defect attributes of the connected component clusters and output the results. This invention is applied in the technical field of image processing methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of image processing methods, and particularly to a method for eliminating false defects based on the smoothness of structural lines. Background Technology

[0002] With the rapid development of defect detection needs in industrial imaging, deep learning is increasingly widely used in visual defect detection technologies. However, deep learning also has some limitations. In certain scenarios, the defects detected by the initial model often include some false defects. These false defects often appear on the structural lines of the product, and the imaging of those structural lines often has some similarities to real defects. False defects are one of the important factors affecting product yield. To eliminate these false defects later, more samples are needed to train the model. This process is often quite lengthy in practical project applications because both model training and sample collection take time, and it is often difficult to achieve 100% elimination of false defects.

[0003] Therefore, if a relatively fast solution can be provided that can eliminate nearly 100% of false defects in the model output results in a short time, the above-mentioned technical problems can be solved well. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a false defect elimination method based on the smoothness of the structure line. This method evaluates whether a defect is a real defect or a false defect by comprehensively assessing the non-smoothness of a defect near a structure line in an image relative to a calibrated structure line. This reduces the false detection of defects in defect detection.

[0005] The technical solution adopted in this invention is as follows: This invention includes the following steps:

[0006] Step S1. After obtaining the defect detection results of the product, establish calibration structure lines on the defect image of the product;

[0007] Step S2. Establish a grayscale conversion image based on the calibration structure lines;

[0008] Step S3. Calculate the difference score of pixels within the candidate defect;

[0009] Step S4. Form defective connected component clusters based on the difference scores;

[0010] Step S5. Evaluate the true defect properties of the connected component clusters and output the results.

[0011] As can be seen from the above scheme, after obtaining the defect detection results output by the visual deep learning model for defect detection, the product structure lines are calibrated on the defect image, and a grayscale conversion map is established based on the calibrated structure lines. The smoothness of the calibrated structure lines is judged by calculating the pixel difference score within the defect, forming a cluster of connected components after smoothness analysis of the model detection results. By judging the cluster of connected components, the linear false defects can be quickly and almost completely eliminated based on traditional image algorithms, thus playing a good auxiliary role in filling gaps in the detection results of the deep learning model.

[0012] A preferred embodiment is that the calibration structure line in step S1 is a line formed by the set of pixels at the edge of the product in the image of the defect detection result; step S1 also includes the following specific content: constructing a pixel coordinate system with the image of the defect detection result, and using the pixels included in the calibration structure line as sampling points, and calculating the specific coordinates of each sampling point.

[0013] A further preferred embodiment is that step S2 further includes the following specific content: dividing the calibration structure line into two directional attribute segments, namely horizontal attribute segments and vertical attribute segments, based on the changes of the sampling point coordinates on the x-axis and y-axis; setting an extension range to establish a grayscale conversion map; searching along the y-axis direction with each sampling point as the reference point within the horizontal attribute segment; searching along the x-axis direction with each corresponding sampling point as the reference point within the vertical attribute segment; the search range is the extension range; and then forming a directional grayscale conversion map based on the calibration structure line; and establishing a corresponding grayscale integral map through the grayscale conversion map.

[0014] A preferred embodiment is that step S3 further includes the following specific content: by calculating the specific coordinates of each pixel in the defect area in the grayscale conversion image, setting the fluctuation range, adjusting the y-axis coordinate of the target pixel according to the fluctuation range, and collecting the neighborhood average grayscale value of all adjusted coordinate points, and finally calculating the grayscale difference between the grayscale value corresponding to the target pixel and the neighborhood average grayscale value collected in all fluctuation ranges.

[0015] A further preferred embodiment is that step S4 includes the following specific content: setting a maximum grayscale difference threshold and a minimum grayscale difference threshold; in step S3, after calculating the grayscale difference between the grayscale value corresponding to the target pixel and the average grayscale value of the neighborhood collected within all fluctuation ranges, the maximum grayscale difference is compared with the maximum grayscale difference threshold, and the absolute value of the value greater than the maximum grayscale difference threshold is assigned to the light class; the minimum grayscale difference is compared with the minimum grayscale difference threshold, and the absolute value of the value less than the minimum grayscale difference threshold is assigned to the shade class; thereby obtaining candidate defect pixels in the defect area that satisfy the shade class and light class respectively; and using the connected component algorithm to obtain the connected component clusters of defect pixels in the shade class and light class respectively.

[0016] A further preferred embodiment is that step S5 includes the following specific content: setting a threshold for the sum of difference scores and a threshold for the maximum difference score; calculating the sum of difference scores and the maximum difference score for each connected component of the shade class and light class obtained in step S4; wherein if the sum of difference scores corresponding to the connected component is greater than the set threshold for the sum of difference scores or the maximum difference score is greater than the set threshold for the maximum difference score, then the corresponding connected component is determined to satisfy the true defect attribute. Attached Figure Description

[0017] Figure 1 This is a flowchart of the process of this invention;

[0018] Figure 2 It shows the initial product image and the result diagram of the defect detection model;

[0019] Figure 3 It is an image used to establish the calibration structure lines;

[0020] Figure 4 It is a grayscale conversion image established based on the calibration structure lines;

[0021] Figure 5 This is the image after establishing a connected component cluster.

[0022] Figure 6 It is an image after evaluating whether the defect is real or fake. Detailed Implementation

[0023] like Figure 1 As shown, in this embodiment, the present invention includes the following steps:

[0024] Step S1. Figure 2 and Figure 3 As shown, after obtaining the defect detection results of the product, a calibration structure line is established for the defect image of the product; the calibration structure line is a line formed by the set of pixels where the edge of the product is located in the defect detection result image; a pixel coordinate system is constructed with the defect detection result image, and the pixels included in the calibration structure line are used as sampling points to calculate the specific coordinates of each sampling point; wherein, the calibration structure line can be obtained by manually setting it and matching it to the current defect image, or the corresponding calibration structure line can be calculated by the corresponding visual algorithm;

[0025] Step S2. Figure 4As shown, a grayscale conversion map is established based on the calibration structure line. Specifically, based on the distribution of the calibration structure line, i.e., the changes in the sampling point coordinates along the x and y axes, the calibration structure line is divided into two directional attribute segments: a horizontal attribute segment and a vertical attribute segment. The search expansion range is set to exp0, and a grayscale conversion map is established. Within the horizontal attribute segment, the search is performed along the y-axis with each sampling point as the reference point, and within the vertical attribute segment, the search is performed along the x-axis with each corresponding sampling point as the reference point. The search range is equal to exp0, which is set by the user. Then, a directional grayscale conversion map is formed based on the calibration structure line, and a corresponding grayscale integral map is established through the grayscale conversion map.

[0026] Step S3. Calculate the difference score of pixels within the candidate defect, i.e., obtain the smoothness contrast score of the corresponding pixel; by calculating the specific coordinates of each pixel in the grayscale conversion image within the defect area, set the value of the fluctuation range range_offset0, adjust the y-axis coordinate of the target pixel according to the fluctuation range, and collect the average grayscale value of the neighborhood of all adjusted coordinate points. Let the value of range_offset0 be 1, and the coordinates of the target pixel in the grayscale conversion image be (mx, my). Then it is necessary to calculate the average grayscale value on both sides when the y-coordinate is divided into my-1, my, and my+1. When the average grayscale value of the neighborhood on both sides under each y-axis coordinate is different, different neighborhood ranges are required. Generally, one side is divided into two different neighborhood ranges. Calculate the average grayscale value of the neighborhood in different neighborhood ranges. Finally, calculate the grayscale difference between the grayscale value corresponding to the target pixel and the average grayscale value under each neighborhood range under the y-axis coordinate within all fluctuation ranges range_offset0.

[0027] Step S4. Figure 5As shown, defective connected component clusters are formed based on the difference scores; first, the maximum gray-level difference threshold `diff_light_thr0` and the minimum gray-level difference threshold `diff_shade_thr0` are set, where the maximum gray-level difference threshold `diff_light_thr0` is greater than zero, and the minimum gray-level difference threshold `diff_shade_thr0` is less than zero. The gray-level value of the target pixel is `gray_cur`, and the average gray-level value of a certain neighborhood on one side of it is `mean_gray_near`. At this time, the corresponding gray-level difference term `diff_gray` calculated in step S3 satisfies: `diff_gray = gray_cur - mean_gray_near`; the maximum value among all gray-level difference terms of the target pixel is taken as `diff_max_gray0`, and the minimum value among all gray-level difference terms of the target pixel is taken as `diff_min_gray0`; the gray-level difference term... The maximum value `diff_max_gray0` is compared with the maximum gray-level difference threshold `diff_light_thr0`, and pixels with a gray-level difference greater than `diff_light_thr0` are classified into the `light` class. The absolute value of `diff_max_gray0` for these pixels is then calculated as the difference score. Similarly, the minimum gray-level difference `diff_min_gray0` is compared with the minimum gray-level difference threshold `diff_shade_thr0`, and pixels with a gray-level difference less than `diff_shade_thr0` are classified into the `shade` class. The absolute value of `diff_shade_thr0` for these pixels is then calculated as the difference score. This process yields candidate defect pixels in the defect region that satisfy both the `shade` and `light` classes. Connected component algorithms are then used to obtain the connected component clusters of the defect pixels in the `shade` and `light` classes, respectively. Figure 5 The two different colors represent connected component clusters of the shade and light classes, respectively.

[0028] Step S5. Figure 6 As shown, the true defect attributes of the connected component clusters are evaluated and the results are output. A threshold for the sum of difference scores and a threshold for the maximum difference score are set. The sum_score_all and maximum difference score_max_score_all of the difference scores for each connected component are calculated for the shade and light classes obtained in step S4. If the sum_score_all of the difference scores for the obtained connected component is greater than the set threshold for the sum of difference scores, or if the maximum difference score_score_all is greater than the set threshold for the maximum difference score, then the corresponding connected component is determined to satisfy the true defect attribute, and the evaluation result is finally output. Figure 6 Compared to Figure 5 Areas where the color changes are considered genuine defects.

[0029] The above-mentioned solution achieves high-efficiency operation and can quickly analyze a defect; it also has good versatility and can solve most of the problems of false defect misjudgment in similar structural lines in practical applications; moreover, the solution of this invention is highly efficient in solving problems, does not require a large number of samples as support, and can also achieve a high accuracy rate, reaching a false defect elimination rate of nearly 100%.

[0030] Although the embodiments of the present invention are described with reference to actual solutions, they do not constitute a limitation on the meaning of the present invention. Modifications to the embodiments and combinations with other solutions based on this specification will be obvious to those skilled in the art.

Claims

1. A method for eliminating false defects based on the smoothness of structural lines, characterized in that, It includes the following steps: Step S1. After obtaining the defect detection results of the product, establish calibration structure lines on the defect image of the product; Step S2. Establish a grayscale conversion image based on the calibration structure lines; Step S3. Calculate the difference score of pixels within the candidate defect; Step S4. Form defective connected component clusters based on the difference scores; Step S5. Evaluate the true defect properties of the connected component clusters and output the results; Step S3 also includes the following specific content: by calculating the specific coordinates of each pixel in the defect area in the grayscale conversion image, setting the fluctuation range, adjusting the y-axis coordinate of the target pixel according to the fluctuation range, and collecting the neighborhood average grayscale value of all adjusted coordinate points, and finally calculating the grayscale difference between the grayscale value corresponding to the target pixel and the neighborhood average grayscale value collected in all fluctuation ranges. Step S4 includes the following specific contents: setting the maximum threshold and minimum threshold of gray level difference. After calculating the gray level difference between the gray level value corresponding to the target pixel and the average gray level value of the neighborhood collected in all fluctuation ranges in step S3, the maximum value of the gray level difference is compared with the maximum threshold of gray level difference, and the absolute value of the value greater than the maximum threshold of gray level difference is assigned to the light class. The minimum value of the gray level difference is compared with the minimum threshold of gray level difference, and the absolute value of the value less than the minimum threshold of gray level difference is assigned to the shade class. Thus, candidate defect pixels in the defect area that satisfy the shade class and light class respectively are obtained. The connected component algorithm is used to obtain the connected component clusters of defect pixels in the shade class and light class respectively. Step S5 includes the following specific content: setting a threshold for the sum of difference scores and a threshold for the maximum difference score; calculating the sum of difference scores and the maximum difference score for each connected component of the shade class and light class obtained in step S4; if the sum of difference scores for the connected component is greater than the set threshold for the sum of difference scores or the maximum difference score is greater than the set threshold for the maximum difference score, then the corresponding connected component is determined to satisfy the true defect attribute.

2. The method for eliminating false defects based on the smoothness of structural lines according to claim 1, characterized in that, The calibration structure line mentioned in step S1 is a line formed by the set of pixels at the edge of the product in the image of the defect detection result; step S1 also includes the following specific content: constructing a pixel coordinate system with the image of the defect detection result, and using the pixels included in the calibration structure line as sampling points to calculate the specific coordinates of each sampling point.

3. The method for eliminating false defects based on the smoothness of structural lines according to claim 2, characterized in that, Step S2 further includes the following specific content: Based on the changes in the coordinates of the sampling points along the x-axis and y-axis, the calibration structure line is divided into two directional attribute segments: a horizontal attribute segment and a vertical attribute segment. An extension range is set to establish a grayscale conversion map. Within the horizontal attribute segment, each sampling point is used as a reference point to search along the y-axis direction. Within the vertical attribute segment, each corresponding sampling point is used as a reference point to search along the x-axis direction. The search range is the extension range. Then, a directional grayscale conversion map is formed based on the calibration structure line. A corresponding grayscale integral map is established through the grayscale conversion map.

Citation Information

Patent Citations

  • Appearance defect detection method for data line forming outer mold

    CN116485787A