Surface defect detection method
By mapping the detection scores to a two-dimensional array and using the RGB polynomial regression formula to generate a heat map, the problem of complex multi-detection frame results in the existing technology is solved and more efficient surface defect detection is achieved.
Patent Information
- Application Number
- CN202410638531.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-06
AI Technical Summary
When existing surface defect detection methods deal with multiple detection frames, especially when the detection frames overlap, the results are complex and not conducive to judgment, resulting in low accuracy.
Use the pre-trained neural network model (EfficientNet-SSD) to generate detection frames, map the detection scores to a two-dimensional array and perform fitting, use the RGB polynomial regression formula to convert the detection scores into three-dimensional RGB values, generate a heat map and overlay it onto the image of the object to be detected to simplify the observation of the results.
It improves the intuitiveness and accuracy of the detection results, can quickly determine the abnormal points in the object to be detected, and simplifies the analysis in the case of complex detection frame overlap.
Smart Images

Figure CN118608461A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image detection, and in particular to a surface defect detection method. Background Art
[0002] Heatmap is a visualization tool that uses colors to express data density. It presents data in a two-dimensional space in the form of hot spots of different colors to show the distribution and concentration of data, thus helping us observe data trends and patterns. Heatmaps are generated by mapping numerical data to colors. Generally, the larger the data value, the darker the color, and the smaller the data value, the lighter the color. It can be used in the detection of abnormal fault types of various products.
[0003] Currently, among the commonly used methods for detecting wafer anomalies, presenting the results through detection frames is a good method. However, when there are too many detection frames, it is not conducive to viewing the detection results. Imagine when there are multiple detection frames in a picture and the detection frames overlap, such a detection result picture is quite complicated and not conducive to judging the detection results. Summary of the invention
[0004] In view of this, the present invention proposes a surface defect detection method, aiming to solve the problem of low accuracy of existing surface defect detection methods.
[0005] The present invention provides a surface defect detection method, comprising:
[0006] Acquire an image of an object to be detected, and input the image of the object to be detected into a pre-trained neural network model to obtain a plurality of detection frames recording detection scores;
[0007] Mapping the detection scores recorded by the multiple detection boxes into a two-dimensional array respectively;
[0008] Fitting the detection score, and then converting the fitted detection score into an RGB polynomial regression formula;
[0009] Mapping each detection score recorded in the two-dimensional array into a three-dimensional RGB value using the detection score to RGB polynomial regression formula;
[0010] A heat map is generated according to the three-dimensional RGB values, and the heat map is superimposed on the image of the object to be detected to display abnormal points displayed in the heat map.
[0011] Furthermore, in the above surface defect detection method, the training method of the neural network model includes:
[0012] Taking images of the object to be detected having abnormal points, wherein each of the images is a multi-channel RGB image;
[0013] Manually marking abnormal points in each of the images of the object to be detected, and using a detection frame to frame the abnormal points in the image, each detection frame includes the abnormal points of the object to be detected;
[0014] Screening out images containing abnormal points to construct a data set, and dividing the data set into a training set and a test set;
[0015] A neural network model based on the EfficientNet-SSD algorithm is constructed and the image data in the training set is input for training to generate a neural network model based on the EfficientNet-SSD algorithm. The autonomous learning ability of the EfficientNet-SSD model is used to extract features from the image to obtain feature images of various resolutions. Based on the feature images of various resolutions, detection frames of various resolutions are generated on these feature images, and the probability that each pixel in the detection frames of various resolutions is an abnormal point is output. The image data of the test set is used to evaluate the EfficientNet-SSD neural network model to obtain an optimized neural network model.
[0016] Furthermore, the above-mentioned surface defect detection method also includes: adjusting the positions of the detection frames generated with different resolutions and position combinations through the above-mentioned generated neural network model based on the EfficientNet-SSD algorithm, so that these detection frames are close to the real frames that mark the abnormal points, thereby optimizing the neural network model, thereby obtaining an optimized EfficientNet-SSD neural network model, and evaluating the above-mentioned optimized EfficientNet-SSD neural network model using the image data of the test set to obtain the optimized neural network model.
[0017] Furthermore, in the above surface defect detection method, mapping the detection scores recorded by the multiple detection frames into a two-dimensional array respectively includes:
[0018] According to the size of the original detection image, a two-dimensional matrix of the same size is established;
[0019] According to the coordinates of each pixel point in the detection frame, the detection score of each pixel point in the detection frame is correspondingly assigned to the corresponding element of the two-dimensional matrix;
[0020] Repeat the above steps to accumulate the detection scores of each pixel point in each detection frame to the corresponding element of the two-dimensional matrix. In this way, the value of each element in the two-dimensional matrix is the cumulative sum of the detection scores of the corresponding pixel points in each detection frame.
[0021] Furthermore, in the above surface defect detection method, mapping each detection score recorded in the two-dimensional array into a three-dimensional RGB value includes:
[0022] An RGB matrix is generated according to the size of the original detection image, and the detection scores of each element in the two-dimensional matrix are calculated using R, G, and B polynomial regression formulas to obtain the values of each RGB channel in the RGB matrix.
[0023] Furthermore, in the above surface defect detection method, the fitting detection score to RGB polynomial regression formula includes:
[0024] Customize the relationship between color and detection score;
[0025] The relationship between the detection score and the RGB value of the color is used to determine the polynomial regression formula: f(x)=a n x n +a n-1 x (n-1) +…+a2x 2 +a1x+a o The constants in , and then the solution of polynomial regression is as follows:
[0026] R=1.06105X 7 -3.12570X 6 +3.40036X 5 -1.68407X 4 +3.86728X 3 -3.68337X 2 +1.012
[0027] 10X 1 +1.38694;
[0028] G=2.12211X 7 -7.73688X 6 +1.12571X 5 -8.26694X 4 +3.14362X 3 -5.52839X 2 +3.375
[0029] 45X 1 -1.98135;
[0030] B=-2.12211X 7 +8.29394X 6 -1.29283X 5 +1.01249X 4 -4.07428X 3+7.41653X 2 -3.5
[0031] 7669X 1 +7.92540.
[0032] Furthermore, in the above surface defect detection method, the relationship between the color and the detection score is as follows:
[0033] When the detection score is 1, the corresponding RGB values are 255, 0, 0;
[0034] When the detection score is 0.875, the corresponding RGB values are 255, 127.5, and 0;
[0035] When the detection score is 0.75, the corresponding RGB values are 255, 255, and 0;
[0036] When the detection score is 0.625, the corresponding RGB values are 127.5, 255, and 0;
[0037] When the detection score is 0.5, the corresponding RGB values are 0, 255, and 0 respectively;
[0038] When the detection score is 0.375, the corresponding RGB values are 0, 127.5, and 127.5;
[0039] When the detection score is 0.25, the corresponding RGB values are 0, 0, and 255;
[0040] When the detection score is 0.125, the corresponding RGB values are 0, 0, and 127.5;
[0041] When the detection score is 0, the corresponding RGB values are 0, 0, 0 respectively.
[0042] Furthermore, in the above surface defect detection method, the fitting detection score is converted into the RGB polynomial regression formula through the determination coefficient R 2 Score is an indicator to measure the goodness of fit of the model, where:
[0043] yi is the actual value, is the predicted value, is the average of the predicted values.
[0044] Furthermore, the surface defect detection method further includes: normalizing each detection score recorded in the two-dimensional array and mapping it to (0-1), and the normalization formula is as follows:
[0045] in,
[0046] max(x) is the maximum value in the two-dimensional array, min(x) is the minimum value in the two-dimensional array, x ij is the data to be normalized, x normali,j is the normalized data.
[0047] Furthermore, in the above-mentioned surface defect detection method, the captured image recording the object to be detected is pre-processed and then input into a pre-trained neural network model based on the EfficientNet-SSD algorithm to generate a detection score for each pixel point in the detection frame of multiple resolutions and position combinations as an abnormal point.
[0048] The surface defect detection method of the present invention pre-processes an image recording the object to be detected and inputs it into a pre-trained neural network model to generate detection scores for each pixel point in a detection frame of multiple resolutions and position combinations as an abnormal point, and then maps the detection scores of the corresponding pixel points in a two-dimensional array, and uses a two-dimensional detection score to three-dimensional RGB polynomial regression formula to map the two-dimensional array with the detection scores into three-dimensional RGB values, thereby generating a heat map, and superimposing the heat map on the original image of the object to be detected, so as to intuitively, quickly and accurately judge the abnormal points in the object to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0050] Figure 1 A flow chart of a surface defect detection method provided by an embodiment of the present invention;
[0051] Figure 2 A relationship diagram between the detection score and color defined in the surface defect detection method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to be able to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features described in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0053] See also Figure 1 , the surface defect detection method of the embodiment of the present invention includes:
[0054] Step 1: obtain an image of the object to be detected, and input the image of the object to be detected into a pre-trained neural network model to obtain multiple detection frames with detection scores recorded.
[0055] Specifically, the captured images recording the objects to be detected are pre-processed and then input into a pre-trained neural network model based on the EfficientNet-SSD algorithm to generate detection scores for abnormal points for each pixel in the detection frame with multiple resolutions and position combinations.
[0056] In the present embodiment, the object to be detected can be a semiconductor element, and more specifically, the object to be detected in the present embodiment is a wafer. The shooting tool can be a camera with higher pixels, such as a 25 million pixel camera. Preprocessing can be an image cut into a certain resolution, for example, a multi-channel RGB image of 448*448 (or other resolutions such as 800*800) pixels. The detection score refers to the probability that a pixel composed of any pixel and other pixels in the image is an abnormal point. The resolution and position combination here refers to the different sizes (resolutions) of the detection frames and the different positions in the picture. Since the detection frames are not staggered at intervals, each detection frame may have partial area overlap.
[0057] In this embodiment, each pixel in the detection box corresponds to a detection score.
[0058] Step 2: Map the detection scores recorded by the multiple detection boxes into a two-dimensional array respectively.
[0059] Specifically, in step 1, according to the size of the original detection image (the resolution in the length direction is L, the resolution in the width direction is W, and the image size is L*W), a two-dimensional matrix of the same size is established, and the two-dimensional matrix has L rows and W columns.
[0060] Step 3, assigning the detection score of each pixel in the detection frame to the corresponding element of the two-dimensional matrix according to the coordinates of each pixel in the detection frame;
[0061] Repeat the above steps to accumulate the detection scores of each pixel in each detection frame to the corresponding elements of the two-dimensional matrix.
[0062] In this way, the value of each element in the two-dimensional matrix is the cumulative sum of the detection scores of the corresponding pixel points in each detection frame.
[0063] It should be noted that the detection score of each pixel in the detection frame is between 0 and 1, and the cumulative sum is between 0 and N, where N is a known quantity, which is the superposition of the detection scores of the detection frame at the same pixel. In this way, the detection score data can be further remapped to between 0 and 1 through normalization.
[0064] Step S4, fitting the detection score, and then converting the fitted detection score into an RGB polynomial regression formula.
[0065] In the specific implementation, an RGB matrix is generated according to the size of the original detection image, and the detection scores of each element in the two-dimensional matrix in the above step 2 are calculated using the R, G, and B polynomial regression formulas to obtain the values of each RGB channel in the RGB matrix.
[0066] Specifically, the polynomial regression formula is: f(x) = a n x n +a n-1 x (n-1) +…+a2x 2 +a1x+a o .
[0067] In this embodiment, the process of obtaining the polynomial is as follows:
[0068] The relationship between custom colors and detection scores is as follows Figure 2 :
[0069] When the detection score is 1, the corresponding RGB values are 255, 0, 0;
[0070] When the detection score is 0.875, the corresponding RGB values are 255, 127.5, and 0;
[0071] When the detection score is 0.75, the corresponding RGB values are 255, 255, and 0;
[0072] When the detection score is 0.625, the corresponding RGB values are 127.5, 255, and 0;
[0073] When the detection score is 0.5, the corresponding RGB values are 0, 255, and 0 respectively;
[0074] When the detection score is 0.375, the corresponding RGB values are 0, 127.5, and 127.5;
[0075] When the detection score is 0.25, the corresponding RGB values are 0, 0, and 255;
[0076] When the detection score is 0.125, the corresponding RGB values are 0, 0, and 127.5;
[0077] When the detection score is 0, the corresponding RGB values are 0, 0, 0 respectively.
[0078] Table 1 below shows the use of Figure 2 The data shown is the result of running it 20 times.
[0079] Table 1
[0080] <![CDATA[R 2 (R)]]> <![CDATA[R 2 (G)]]> <![CDATA[R 2 (B)]]> 1 0.8 0.15 0.25 2 0.86 0.67 0.31 3 0.92 0.93 0.73 4 0.96 0.96 0.87 5 0.97 0.97 0.88 6 0.99 0.98 0.98 7 1 1 1 8 1 1 1 9 1 1 1 10 1 1 1 11 1 1 1 12 1 1 1 13 1 1 1 14 1 1 1 15 1 1 1 16 1 1 1 17 1 1 1 18 1 1 1 19 1 1 1 20 1 1 1
[0081] From the above table, we can find that when N=7, R 2 It is already equal to 1. Although it is also equal to 1 when N=8~20, the more complex the polynomial regression formula is, the longer the system calculation time is. Therefore, when N=7, it can be considered to be an optimal solution. Therefore, it can be concluded that when N=7, the solution of the polynomial regression is as follows:
[0082] R=1.06105X 7 -3.12570X 6 +3.40036X 5 -1.68407X 4 +3.86728X 3 -3.68337X 2 +1.01210X 1 +1.38694;
[0083] G=2.12211X 7 -7.73688X 6 +1.12571X 5 -8.26694X 4 +3.14362X 3 -5.52839X 2 +3.37545X 1 -1.98135;
[0084] B=-2.12211X 7 +8.29394X 6 -1.29283X 5 +1.01249X 4 -4.07428X 3 +7.41653X 2 -3.57669X 1 +7.92540
[0085] By R 2 Score is used to judge the goodness of fit of the model to the data. (Determination coefficient (R 2 Score):R 2 It is an indicator of the goodness of fit of the model, which indicates the degree to which the model explains the changes in the data.2 The closer the value is to 1, the better the model fits the data.
[0086] When a polynomial regression formula is used to generate a formula specifically for mapping R, G, and B through the detection score, the R-Squared calculation method is:
[0087]
[0088] Among them, y i is the actual value, is the predicted value, is the average of the predicted values.
[0089] The RGB value corresponding to any pixel point can be obtained by using the detection score converted to RGB polynomial regression formula obtained by fitting in the embodiment of the present invention. For example, when the detection score at a pixel point in a detection frame is 0.32 (32%), 0.32 is converted into three-dimensional data of R=0, G=70, B=195 through the above R, G, B polynomial regression formula, and then rendered and displayed as the corresponding color.
[0090] When the detection score at a pixel in a detection box is 0.79 (79%), 0.79 is converted into three-dimensional data of R=255, G=227, B=0 through the above polynomial regression formula, and then rendered and displayed as the corresponding color.
[0091] Step S5, generating a heat map according to the three-dimensional RGB values, and superimposing the heat map on the image of the object to be detected to display the abnormal points displayed in the heat map.
[0092] Therefore, through the polynomial regression formula, the data with a detection score of 0 to 1 (0 to 100%) can be converted into corresponding R, G, and B parameters. In this way, different colors can be reflected in different detection results (for example, red represents a higher probability that the point is an abnormal point) and displayed as a heat map.
[0093] From the above, it can be seen that the present invention determines the constant parameters of the polynomial regression formula by defining the relationship between the abnormal point detection score and RGB, and generates a formula for mapping R, G, and B through the polynomial regression formula; the detection scores in the detection frame are accumulated in an accumulated manner, and a two-dimensional matrix of accumulated detection scores is generated, and then the detection score data is remapped between 0 and 1 through normalization; then the polynomial regression formula is used to recalculate the values of R, G, and B, and finally a heat map that is conducive to identifying abnormal points will be generated.
[0094] That is to say, according to the size of each detection box, the detection scores of the corresponding pixel points are mapped in a two-dimensional array, and the two-dimensional detection score to three-dimensional RGB polynomial regression formula is used to remap the two-dimensional array with the detection scores to 0-1, generate a three-dimensional array RGB value, and convert it into a heat map based on the three-dimensional array RGB value, and the heat map result is superimposed on the original image of the object to be detected and displayed.
[0095] In this way, by manually observing the thermogram, abnormal points on the object to be detected can be determined based on the thermogram.
[0096] It can be concluded from the above embodiments that the present invention pre-processes the image recording the object to be detected and inputs it into a pre-trained neural network model to generate detection scores for each pixel point in the detection frame of multiple resolutions and position combinations as an abnormal point, and then maps the detection scores of the corresponding pixel points in a two-dimensional array, and uses the two-dimensional detection score to three-dimensional RGB polynomial regression formula to map the two-dimensional array with the detection scores into three-dimensional RGB values, and generates a heat map based on this, and superimposes the heat map on the original image of the object to be detected, so as to intuitively, quickly and accurately judge the abnormal points in the image of the object to be detected, which is conducive to determining the locations where defects exist on the surface of the object to be detected.
[0097] In the above embodiment, the neural network model selected is EfficientNet-SSD, and the training process of the neural network model based on the EfficientNet-SSD algorithm is:
[0098] Step 1: capture images of the object to be detected having abnormal points, wherein each of the images is a multi-channel RGB image.
[0099] Specifically, the object to be inspected may be a wafer, and a 25-megapixel camera may be used to capture images of multiple wafers with the same abnormal points or images of multiple wafers with different abnormal points, and then the images may be cropped into multi-channel RGB images with a resolution of 448*448 (or other resolutions such as 800*800).
[0100] In the specific implementation, wafers with abnormal points are placed on the inspection table respectively, and the wafers are photographed using a 25-megapixel camera and the images are stored in a designated folder.
[0101] Step 2, manually marking abnormal points in each of the images of the object to be detected, using a detection frame to frame the abnormal points in the image, and each detection frame includes the abnormal points of the object to be detected;
[0102] Specifically, the detection frame can be a rectangular frame, an elliptical frame, etc.
[0103] Step 3, screen out images containing abnormal points to construct a data set, and divide the data set into a training set and a test set; for example, 80% of the data set can be selected as the training set, and the remaining 20% of the data in the data set can be used as the test set.
[0104] Step 4: construct a neural network model based on the EfficientNet-SSD algorithm and input the image data in the training set for training to generate a neural network model based on the EfficientNet-SSD algorithm, wherein the neural network model based on the EfficientNet-SSD algorithm is used to predict the detection score of the input image after detection of the detection frames corresponding to multiple resolutions and position combinations, wherein the resolution of the detection frame and the position in the image are adaptively determined according to the sample set, the training set and the training accuracy during the training process of the neural network model based on the EfficientNet-SSD algorithm, and the detection score is used to indicate the probability that each pixel corresponding to each resolution and position combination is an abnormal point after detecting the image.
[0105] In order to make the neural network model more perfect, this embodiment may further include: step 5, through the above-generated neural network model based on the EfficientNet-SSD algorithm, the position of the detection frames generated with different resolutions and position combinations is adjusted to make these detection frames close to the real frames that mark the abnormal points, thereby optimizing the neural network model, thereby obtaining an optimized EfficientNet-SSD neural network model, and using the image data of the test set to evaluate the above-mentioned optimized EfficientNet-SSD neural network model to obtain the optimized neural network model.
[0106] In this embodiment, an optimizer is used to optimize the neural network model using a standard momentum optimization algorithm (Momentum).
[0107] The specific implementation process of the embodiment of the present invention is as follows:
[0108] Place the object to be detected on the detection table, set the shooting path of the detection camera (for example, a 25-megapixel camera can be selected), obtain the image of the object to be detected, input the image into the pre-trained neural network model, and the neural network model will output multiple detection frames with detection scores; generate a two-dimensional array according to the size of the captured image, map the detection score in the two-dimensional array according to the size of the detection frame, and generate a three-dimensional array according to the size of the captured image; then obtain the detection score and convert it into a three-dimensional RGB polynomial regression formula, normalize the two-dimensional array with the detection score, and store the result back to the two-dimensional array, input the normalized two-dimensional array of detection scores into the three-dimensional RGB polynomial regression formula, obtain the three-dimensional RGB value, and store the result back to the previously generated three-dimensional array, generate a heat map according to the RGB value of the three-dimensional array, and overlay the heat map on the original detection image.
[0109] Among them, the two-dimensional array normalization formula is as follows:
[0110] in,
[0111] max(x) is the largest value in this two-dimensional array, min(x) is the smallest value in this two-dimensional array, x ij is the data to be normalized, x normali,j is the normalized data.
[0112] In summary, in an embodiment of the present invention, an image of an object to be detected is input into a pre-trained neural network model to obtain a plurality of detection frames recording detection scores. By definition, the detection scores of each pixel in each detection frame are accumulated to the corresponding elements of the two-dimensional matrix. In this way, the value of each element in the two-dimensional matrix is the cumulative sum of the detection scores of the corresponding pixel points in each detection frame. The detection scores are fitted, and then the fitted detection scores are converted to an RGB polynomial regression formula. The detection scores recorded in the two-dimensional array are mapped to three-dimensional RGB values using the detection score conversion RGB polynomial regression formula. Finally, a heat map is generated to help identify abnormal locations, making the detection results more intuitive and accurate.
[0113] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A surface defect detection method, It is characterized in that include: Acquire an image of an object to be detected, and input the image of the object to be detected into a pre-trained neural network model to obtain a plurality of detection frames recording detection scores; Mapping the detection scores recorded by the multiple detection boxes into a two-dimensional array respectively; Fitting the detection score, and then converting the fitted detection score into an RGB polynomial regression formula; Mapping each detection score recorded in the two-dimensional array into a three-dimensional RGB value using the detection score to RGB polynomial regression formula; A heat map is generated according to the three-dimensional RGB values, and the heat map is superimposed on the image of the object to be detected to display abnormal points displayed in the heat map.
2. The surface defect detection method according to claim 1, It is characterized in that The training method of the neural network model includes: Taking images of the object to be detected having abnormal points, wherein each of the images is a multi-channel RGB image; Manually marking abnormal points in each of the images of the object to be detected, and using a detection frame to frame the abnormal points in the image, each detection frame includes the abnormal points of the object to be detected; Screening out images containing abnormal points to construct a data set, and dividing the data set into a training set and a test set; A neural network model based on the EfficientNet-SSD algorithm is constructed and the image data in the training set is input for training to generate a neural network model based on the EfficientNet-SSD algorithm. The autonomous learning ability of the EfficientNet-SSD model is used to extract features from the image to obtain feature images of various resolutions. Based on the feature images of various resolutions, detection frames of various resolutions are generated on these feature images, and the probability that each pixel in the detection frames of various resolutions is an abnormal point is output. The image data of the test set is used to evaluate the EfficientNet-SSD neural network model to obtain an optimized neural network model.
3. The surface defect detection method according to claim 2, It is characterized in that Also includes: Through the neural network model based on the EfficientNet-SSD algorithm generated above, the positions of the detection frames generated with different resolutions and position combinations are adjusted so that these detection frames are close to the real frames marking the abnormal points, thereby optimizing the neural network model to obtain the optimized EfficientNet-SSD neural network model. The optimized EfficientNet-SSD neural network model is evaluated using the image data of the test set to obtain the optimized neural network model.
4. The surface defect detection method according to claim 1, It is characterized in that Mapping the detection scores recorded by the plurality of detection frames into a two-dimensional array respectively includes: According to the size of the original detection image, a two-dimensional matrix of the same size is established; According to the coordinates of each pixel point in the detection frame, the detection score of each pixel point in the detection frame is correspondingly assigned to the corresponding element of the two-dimensional matrix; Repeat the above steps to accumulate the detection scores of each pixel point in each detection frame to the corresponding element of the two-dimensional matrix. In this way, the value of each element in the two-dimensional matrix is the cumulative sum of the detection scores of the corresponding pixel points in each detection frame.
5. The surface defect detection method according to claim 3, It is characterized in that Mapping each detection score recorded in the two-dimensional array into a three-dimensional RGB value includes: An RGB matrix is generated according to the size of the original detection image, and the detection scores of each element in the two-dimensional matrix are calculated using R, G, and B polynomial regression formulas to obtain the values of each RGB channel in the RGB matrix.
6. The surface defect detection method according to claim 1 or 5, It is characterized in that The fitting detection score to RGB polynomial regression formula includes: Customize the relationship between color and detection score; The relationship between the detection score and the RGB value of the color is used to determine the polynomial regression formula: f(x)=a n x n +a n-1 x (n-1) +…+a 2 x 2 +a 1 x+a o The constants in , and then the solution of polynomial regression is as follows: R=1.06105X 7 -3.12570X 6 +3.40036X 5 -1.68407X 4 +3.86728X 3 -3.68337X 2 +1.012 10X 1 +1.38694; G=2.12211X 7 -7.73688X 6 +1.12571X 5 -8.26694X 4 +3.14362X 3 -5.52839X 2 +3.375 45X 1 -1.98135; B=-2.12211X 7 +8.29394X 6 -1.29283X 5 +1.01249X 4 -4.07428X 3 +7.41653X 2 -3.5 7669X 1 +7.92540。 7. The surface defect detection method according to claim 6, It is characterized in that The relationship between the color and the detection score is as follows: When the detection score is 1, the corresponding RGB values are 255, 0, 0; When the detection score is 0.875, the corresponding RGB values are 255, 127.5, and 0; When the detection score is 0.75, the corresponding RGB values are 255, 255, and 0; When the detection score is 0.625, the corresponding RGB values are 127.5, 255, and 0; When the detection score is 0.5, the corresponding RGB values are 0, 255, and 0 respectively; When the detection score is 0.375, the corresponding RGB values are 0, 127.5, and 127.5; When the detection score is 0.25, the corresponding RGB values are 0, 0, and 255; When the detection score is 0.125, the corresponding RGB values are 0, 0, and 127.5; When the detection score is 0, the corresponding RGB values are 0, 0, 0 respectively.
8. The surface defect detection method according to claim 1, It is characterized in that The fitting detection score is converted into the RGB polynomial regression formula through the determination coefficient R 2 Score is an indicator to measure the goodness of fit of the model, where: yi is the actual value, is the predicted value, is the average of the predicted values.
9. The surface defect detection method according to claim 1, It is characterized in that Also includes: Each detection score recorded in the two-dimensional array is normalized and mapped to (0-1). The normalization formula is as follows: in, max(x) is the maximum value in the two-dimensional array, min(x) is the minimum value in the two-dimensional array, x ij is the data to be normalized, x normali,j is the normalized data.
10. The surface defect detection method according to claim 1, It is characterized in that The captured images recording the objects to be detected are pre-processed and then input into a pre-trained neural network model based on the EfficientNet-SSD algorithm to generate detection scores for each pixel in the detection frame of various resolutions and position combinations as an abnormal point.
Citation Information
Cited By
On-device defect detection apparatus and defect detection method using the same
KR102986636B1
