A product visual inspection method based on industrial application scenarios

Through gray correlation analysis and regression model correction, and combined with k nearest neighbor classification, the problem of high error rate of detection results in the prior art is solved, and the accuracy and adaptability of detection results are improved.

CN118587218BActive Publication Date: 2024-11-26JIANGSU WEILAN DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411072662.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-26
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

The existing visual detection system cannot adapt effectively when facing multiple detection objects and multiple detection environments, resulting in an increase in the error rate of detection results.

Method used

By obtaining various defect images of defective products, extracting characteristic measurement values ​​and performing gray correlation analysis, a regression model between defect characteristic difference value and industrial parameters is constructed, the characteristic value of the product to be detected is corrected, and the defect type is performed using the k nearest neighbor method Classification to reduce the impact of factors such as process procedures and working conditions on the detection results.

Benefits of technology

It improves the accuracy of product defect surface detection results, enhances the adaptability of the detection system, and reduces the impact of factors on the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587218B_ABST
    Figure CN118587218B_ABST
Patent Text Reader

Abstract

The present invention discloses a product visual inspection method based on industrial application scenarios, and relates to the field of product visual inspection. By acquiring various defect images of products, characteristic measurement values ​​of defects in the product processing process and in a static state are extracted respectively, and defect characteristic measurement differences are calculated and obtained, industrial parameters in the product processing process are acquired, gray correlation analysis is performed on the acquired industrial parameters and the defect characteristic measurement differences, the gray correlation degree between the defect characteristic measurement differences and the industrial parameters is acquired, a regression model between the defect characteristic differences and the industrial parameters is constructed, the defect characteristic measurement values ​​and industrial parameter values ​​in the processing process of the product to be inspected and the defect characteristic differences at the industrial parameter values ​​are acquired according to the regression model, the defect characteristic values ​​of the product to be inspected after correction are acquired as classification data samples, the defect types of the inspected products are classified by using the k nearest neighbor method, and the defect classification results of the products are acquired.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of product visual inspection, and in particular to a product visual inspection method based on industrial application scenarios. Background Art

[0002] Machine vision is the process of identifying and detecting by machines, that is, inputting the images captured by CCD or CMOS cameras into computers for processing, to replace the human eye in measurement and identification and other related tasks. Its working principle is to use industrial cameras to obtain the target image of the product to be detected, use digital image processing technology to pre-process the image to be detected, extract the feature vector of the target area, and train the classifier in advance to identify the defect type, and then obtain the detection result. Compared with traditional human eye detection, machine vision detection can stably perform measurement, analysis, detection and identification for a long time in harsh environments, greatly improving the automation level of defect detection. On the basis of ensuring the accuracy of defect detection, it improves the detection efficiency and reduces the detection cost of the manufacturing industry.

[0003] In actual industrial application scenarios, even products on the same production line will have their surface morphology affected by process procedures, operating parameters, raw materials and other factors, causing the corresponding color, background texture and other parameters on the surface to change to a certain extent. However, the existing visual inspection system does not have the ability to adapt to multiple inspection objects and multiple inspection environments, resulting in deviations between the extracted feature image features and the actual situation during the inspection process, which increases the error rate of the inspection results. To this end, we propose a product visual inspection method based on industrial application scenarios. Summary of the invention

[0004] The main purpose of the present invention is to provide a product visual inspection method based on industrial application scenarios, which can effectively solve the problems in the background technology.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A product visual inspection method based on industrial application scenarios, comprising:

[0007] S1: Obtain various defect images of defective product samples, and extract the characteristic measurement values ​​of the jth defect of the defective product during processing and in a static state, respectively, recorded as and Calculate and obtain the measurement difference of the j-th defect characteristic, recorded as Δθ j ,in, n, the defect feature includes at least one of the circularity, grayscale mean, grayscale variance, maximum grayscale value, maximum grayscale difference, entropy, energy, area, and perimeter of the defect area;

[0008] S2: Obtain the value p of the i-th industrial parameter in the process of defective product processing i , i = 1, 2, ..., m, perform grey correlation analysis on the obtained industrial parameters and defect feature measurement differences, and obtain the grey correlation degree R between the j-th defect feature measurement difference and the i-th industrial parameter value ij , the specific process is:

[0009] S21: Constructing industrial parameter data sequence E and defect feature measurement difference data sequence F, where E = {E1, E2, ..., E i}, F={F1,F2,...,F j}, E i Represented as the i-th industrial parameter data set, E i ={e ik},e ik is an element in the industrial parameter data set, which is represented by the kth data value in the i-th industrial parameter data set; F j It is represented as the j-th defect feature difference data set, F i ={f jk}, f jk is an element in the defect feature difference data set, which is represented by the kth data value in the jth type defect feature difference data set, k = 1, 2, ..., Q; wherein Q is the total amount of data;

[0010] S22: Set the data value e in the data sequence E ik and data value f in data sequence F jk Perform standardization and obtain standardized data e' ik and f' jk , the processing formula is:

[0011]

[0012] In the formula, are the data means in the i-th industrial parameter data set and the j-th defect feature difference data set, respectively, and

[0013] S23: Calculate the correlation coefficient between all data points in the defect feature measurement difference data sequence F and the industrial parameters. The calculation formula is:

[0014]

[0015] In the formula, r jk It is expressed as the correlation coefficient between the kth data value of the jth type defect characteristic difference in the data sequence F and the industrial parameter; ρ is a constant coefficient, generally, ρ = 0.5;

[0016] Δ min and Δmax They are the minimum difference and maximum difference between the standardized data of industrial parameters and the standardized data of defect characteristic difference, respectively. The calculation formulas are:

[0017] Δ min =min i (min k (|e' ik -f' jk |));

[0018] Δ max =max i (max k (|e' ik -f' jk |));

[0019] In the formula, min(min()) is to first take |e' ik -f' jk |The minimum value of all factors in |, then take all |e' ik -f' jk |The minimum value among the minimum values; max(max()) is to take |e' first ik -f' jk |The maximum value of all factors in |, then take all |e' ik -f' jk |The maximum of the maximum values;

[0020] S24: According to the obtained correlation coefficient r jk , calculate the grey correlation R between the measured difference of the j-th defect characteristic and the i-th industrial parameter value ij , the calculation formula is: Q is the total amount of data;

[0021] S3: Based on the obtained grey correlation degree, a regression model between the defect feature difference and the industrial parameter value is constructed, where the expression of the model is:

[0022]

[0023] In the formula, It is expressed as the defect feature difference; ε is the constant coefficient; m is the type of industrial parameter; n is the type of defect feature;

[0024] S4: Obtain the defect characteristic measurement value θ' and industrial parameter value p' during the processing of the product to be tested i According to the regression model, the industrial parameter value is p' i Defect feature difference Obtain the corrected defect characteristic value of the product to be tested in,

[0025] S5: Corrected defect characteristic value of the product to be tested As the classification data sample, the k-nearest neighbor method is used to classify the defect types of the inspected products and obtain the defect classification results. The specific process is as follows:

[0026] S51: Defect feature measurement value of the defect image in a static state As a comparison sample, build a comparison sample set Among them, λ is the number of comparison samples;

[0027] S52: Calculate the corrected defect characteristic values ​​of the products to be tested respectively The distance value d from each comparison sample in the comparison sample set S λ , the calculation formula is:

[0028] S53: Set the distinguishing distance value to d', the value range is Among them, d λmin d λmax are the distance values ​​d λ Calculate the minimum and maximum values ​​in the result;

[0029] S54: Screening sample set S λ The contrast samples with ≤d' are used as distinguishing samples;

[0030] S55: Statistically distinguish the comparison samples with the largest number in the sample, and determine the defect type of the classified data sample according to the type of the comparison samples with the largest number. The determination principle is:

[0031] When the largest number of contrast sample types in the statistically distinguishable sample is equal to one:

[0032] The defect type of the comparison sample with the largest number of statistically distinguished samples is used as the defect type of the classified data sample, that is, the defect type of the product to be tested is obtained:

[0033] When the largest number of contrast sample types in the statistically distinguished samples is greater than one:

[0034] Return to step S53, reduce the set separation distance value d' by a step length ε, and repeat steps S54 and S55 until d'=d λmin ;

[0035] Among them, the range of step size ε is Wherein, d'0 is the initial discrimination distance value, and α is an integer not less than 5.

[0036] The present invention has the following beneficial effects:

[0037] Compared with the prior art, the technical solution of the present invention obtains various defect images of the product and extracts the characteristic measurement value of the jth defect in the product processing process and in the static state respectively. and Calculate the defect feature measurement difference Δθ j , obtain the industrial parameters in the product processing process, perform grey correlation analysis on the obtained industrial parameters and the defect feature measurement difference, and obtain the j-th defect feature measurement difference Δθ j The grey correlation degree R between the i-th industrial parameter ij According to the obtained grey correlation value, a regression model between the defect feature difference and the industrial parameter is constructed to obtain the defect feature measurement value θ' and the industrial parameter value p' during the processing of the product to be tested. i , according to the regression model, the industrial parameter value p' i Defect feature difference Obtain the corrected defect characteristic value of the product to be tested The defect characteristic value of the product to be tested after correction As the classification data sample, the k-nearest neighbor method is used to classify the defect types of the inspected products to obtain the defect classification results. It can correct the feature image feature quantities extracted in the actual industrial application scenarios, reduce the influence of factors such as process procedures, operating parameters, and raw materials on the inspection results, and thus improve the accuracy of product defect surface inspection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of a process of a product visual inspection method based on an industrial application scenario of the present invention;

[0039] Figure 2 This is a schematic diagram of the product defect classification process control in the technical solution of the present invention. DETAILED DESCRIPTION

[0040] The present invention will be further described below in conjunction with specific implementation methods, wherein the accompanying drawings are only used for exemplary descriptions and represent only schematic diagrams rather than actual drawings, and should not be understood as limiting the present invention. In order to better illustrate the specific implementation methods of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product.

[0041] like Figure 1-Figure 2 As shown, the technical solution of the present invention proposes a product visual inspection method based on an industrial application scenario, comprising the following steps:

[0042] S1: Obtain various defect images of defective product samples, and extract the characteristic measurement values ​​of defects of defective products during processing and in a static state;

[0043] S2: Obtain the industrial parameter values ​​during the processing of defective products, perform grey correlation analysis on the obtained industrial parameters and the defect feature measurement difference, and obtain the grey correlation degree between the defect feature measurement difference and the industrial parameter value;

[0044] S3: Construct a regression model between defect feature difference and industrial parameters based on the obtained grey correlation value;

[0045] S4: Obtain the defect characteristic measurement value and industrial parameter value during the processing of the product to be inspected, calculate the defect characteristic difference at the industrial parameter value according to the regression model, and obtain the corrected defect characteristic value of the product to be inspected;

[0046] S5: Use the corrected defect feature value of the product to be inspected as the classification data sample, use the k-nearest neighbor method to classify the defect type of the inspected product, and obtain the defect classification result

[0047] The specific implementation process of the technical solution of the present invention includes the following steps:

[0048] Step 1: Obtain various defect images of defective product samples, and extract the characteristic measurement values ​​of the jth defect in the defective product processing and static state, respectively, recorded as and Calculate and obtain the measurement difference of the j-th defect characteristic, recorded as Δθ j ,in,

[0049] It should be noted that defect features include at least one of the circularity, grayscale mean, grayscale variance, maximum grayscale value, maximum grayscale difference, entropy, energy, area, and perimeter of the defect area; in actual application, the feature type with higher discrimination should be selected according to the type of processed product. For example, in the battery detection process, the bubble defect is one of the battery surface defects. The length, width, area, and perimeter of the battery surface defect area have large variability. For the bubble defect, its length, width, area, and perimeter are mostly larger than other defects. However, there are also small defect areas in the bubble defect, which makes this defect feature have uncertainty factors and unreliability; and for the rectangularity feature, most of the defect areas on the battery surface are concentrated around 0.75. This defect feature is not separable for battery surface detection and should be discarded;

[0050] Step 2: Obtain the industrial parameter values ​​during the processing of defective products. It should be noted that industrial parameters can be factors such as process procedures, working condition parameters, raw materials, etc., such as environmental parameters, including processing temperature, humidity, and air pressure; equipment parameters, including equipment temperature, operating time, wear degree, etc., as long as the processing factors that can affect the product processing flow can be used as industrial parameters; gray correlation analysis is performed on the obtained industrial parameters and the defect feature measurement difference to obtain the j-th defect feature measurement difference Δθ j The grey correlation degree R between the i-th industrial parameter ij , the specific process is:

[0051] S21: Constructing industrial parameter data sequence E and defect feature measurement difference data sequence F, where E = {E1, E2, ..., E i}, F={F1,F2,...,F j}, E i Represented as the i-th industrial parameter data set, E i ={e ik},e ik is an element in the industrial parameter data set, which is represented by the kth data value in the i-th industrial parameter data set; F j It is represented as the j-th defect feature difference data set, F i ={f jk}, f jk is an element in the defect feature difference data set, which is represented by the kth data value in the jth type defect feature difference data set, k = 1, 2, ..., Q; wherein Q is the total amount of data;

[0052] S22: Set the data value e in the data sequence E ik and data value f in data sequence F jk Perform standardization and obtain standardized data e' ik and f' jk , the processing formula is:

[0053]

[0054] In the formula, E i 、F j are the data means in the i-th industrial parameter data set and the j-th defect feature difference data set, respectively, and

[0055] S23: Calculate the correlation coefficient between all data points in the defect feature measurement difference data sequence F and the industrial parameters. The calculation formula is:

[0056]

[0057] In the formula, r jk It is expressed as the correlation coefficient between the kth data value of the jth type defect characteristic difference in the data sequence F and the industrial parameter; ρ is a constant coefficient, generally, ρ = 0.5;

[0058] Δ min and Δ max They are the minimum difference and maximum difference between the standardized data of industrial parameters and the standardized data of defect characteristic difference, respectively. The calculation formulas are:

[0059] Δ min =min i (min k (|e' ik -f' jk |));

[0060] Δ max =max i (max k (|e' ik -f' jk |));

[0061] In the formula, min(min()) is to first take |e' ik -f' jk |The minimum value of all factors in |, then take all |e' ik -f' jk |The minimum value among the minimum values; max(max()) is to take |e' first ik -f' jk |The maximum value of all factors in |, then take all |e' ik -f' jk |The maximum of the maximum values;

[0062] S24: According to the obtained correlation coefficient r jk , calculate the grey correlation R between the measured difference of the j-th defect characteristic and the i-th industrial parameter value ij , the calculation formula is: Q is the total amount of data;

[0063] Step 3: According to the obtained grey correlation degree, a regression model between the defect feature difference and the industrial parameter value is constructed, where the expression of the model is:

[0064]

[0065] In the formula, It is expressed as the defect feature difference; ε is the constant coefficient; m is the type of industrial parameter; n is the type of defect feature;

[0066] It should be noted that according to the principle of regression model, there is a certain linear relationship between the independent variable and the dependent variable. In the regression model constructed in this scheme, the defect characteristic difference is regarded as the dependent variable, and the industrial parameter is regarded as the independent variable to construct the model. The normalized result of the grey correlation value is: As the weight value of industrial parameters;

[0067] Step 4: Obtain the defect characteristic measurement value θ' and industrial parameter value p' during the processing of the product to be inspected i , according to the regression model, the industrial parameter value p' i Defect feature difference Obtain the corrected defect characteristic value of the product to be tested in,

[0068] Step 5: Correct the defect characteristic value of the product to be tested As the classification data sample, the k-nearest neighbor method is used to classify the defect types of the inspected products and obtain the defect classification results. The specific process is as follows:

[0069] S51: Defect feature measurement value of the defect image in a static state As a comparison sample, build a comparison sample set Among them, λ is the number of comparison samples;

[0070] S52: Calculate the corrected defect characteristic values ​​of the products to be tested respectively The distance value d from each comparison sample in the comparison sample set S λ , the calculation formula is:

[0071] S53: Set the distinguishing distance value to d', the value range is Among them, d λmin d λmax are the distance values ​​d λ Calculate the minimum and maximum values ​​in the result;

[0072] S54: Screening sample set S λ The contrast samples with ≤d' are used as distinguishing samples;

[0073] S55: Statistically distinguish the comparison samples with the largest number in the sample, and determine the defect type of the classified data sample according to the type of the comparison samples with the largest number. The determination principle is:

[0074] When the largest number of contrast sample types in the statistically distinguishable sample is equal to one:

[0075] The defect type of the comparison sample with the largest number of statistically distinguished samples is used as the defect type of the classified data sample, that is, the defect type of the product to be tested is obtained:

[0076] When the largest number of contrast sample types in the statistically distinguished sample is greater than one, e.g. Figure 2 As shown:

[0077] Return to step S53, reduce the set separation distance value d' by a step length ε, and repeat steps S54 and S55 until d'=d λmin ;

[0078] Among them, the range of step size ε is Wherein, d'0 is the initial discrimination distance value, and α is an integer not less than 5.

[0079] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A product visual inspection method based on industrial application scenarios, It is characterized in that include: S1: Obtain various defect images of defective product samples, and extract the characteristic measurement values ​​of the jth defect of the defective product during processing and in a static state, respectively, recorded as and Calculate and obtain the measurement difference of the j-th defect characteristic, recorded as Δθ j ,in, j=1,2,...,n; S2: Obtain the value p of the i-th industrial parameter in the process of defective product processing i , i = 1, 2, ..., m, perform grey correlation analysis on the obtained industrial parameters and defect feature measurement differences, and obtain the grey correlation degree R between the j-th defect feature measurement difference and the i-th industrial parameter value ij ; S3: Based on the obtained grey correlation degree, a regression model between the defect feature difference and the industrial parameter value is constructed, where the expression of the model is: In the formula, It is expressed as the defect feature difference; ε is the constant coefficient; m is the type of industrial parameter; n is the type of defect feature; S4: Obtain the defect characteristic measurement value θ' and industrial parameter value p' during the processing of the product to be tested i According to the regression model, the industrial parameter value is p' i Defect feature difference Obtain the corrected defect characteristic value of the product to be tested in, S5: Corrected defect characteristic value of the product to be tested As the classification data sample, the k-nearest neighbor method is used to classify the defect types of the products to be inspected, and the defect classification results are obtained; The specific process of step S2 is: S21: Constructing industrial parameter data sequence E and defect feature measurement difference data sequence F, where E = {E 1 ,E 2 ,...,E i }, F={F 1 ,F 2 ,...,F j }, E i Represented as the i-th industrial parameter data set, E i ={e ik },e ik is an element in the industrial parameter data set, which is represented by the kth data value in the i-th industrial parameter data set; F j It is represented as the j-th defect feature difference data set, F i ={f jk }, f jk is an element in the defect feature difference data set, which is represented by the kth data value in the jth type defect feature difference data set, k = 1, 2, ..., Q; wherein Q is the total amount of data; S22: Set the data value e in the data sequence E ik and data value f in data sequence F jk Perform standardization and obtain standardized data e' ik and f' jk , the processing formula is: In the formula, are the data means in the i-th industrial parameter data set and the j-th defect feature difference data set, respectively, and S23: Calculate the correlation coefficient between all data points in the defect feature measurement difference data sequence F and the industrial parameters. The calculation formula is: In the formula, r jk It is expressed as the correlation coefficient between the kth data value of the jth type defect characteristic difference in the data sequence F and the industrial parameter; ρ is the constant coefficient; Δ min and Δ max They are the minimum difference and maximum difference between the standardized data of industrial parameters and the standardized data of defect characteristic difference, respectively. The calculation formulas are: D min =min i (min) k (|e' ik -f' jk |)); D max =max i (max. k (|e' ik -f' jk |)); In the formula, min(min( )) is the first |e' ik -f' jk |The minimum value of all factors in |, then take all |e' ik -f' jk |The minimum value among the minimum values; max(max()) is to take |e' first ik -f' jk |The maximum value of all factors in |, then take all |e' ik -f' jk |The maximum of the maximum values; S24: According to the obtained correlation coefficient r jk , calculate the grey correlation R between the measured difference of the j-th defect characteristic and the i-th industrial parameter value ij , the calculation formula is: is the total amount of data; The specific process of step S5 is: S51: Defect feature measurement value of the defect image in a static state As a comparison sample, build a comparison sample set Among them, λ is the number of comparison samples; S52: Calculate the corrected defect characteristic values ​​of the products to be tested respectively The distance value d from each comparison sample in the comparison sample set S λ ; S53: Setting the distinguishing distance value to d'; S54: Screening sample set S λ The contrast samples with ≤d' are used as distinguishing samples; S55: Statistically distinguishing the largest number of comparison samples in the sample, and determining the defect type of the classified data sample according to the type of the largest number of comparison samples; In step S55, When the largest number of contrast sample types in the statistically distinguishable sample is equal to one: The defect type of the comparison sample with the largest number of statistically distinguished samples is used as the defect type of the classified data sample, that is, the defect type of the product to be tested is obtained: When the largest number of contrast sample types in the statistically distinguished samples is greater than one: Return to step S53, reduce the set separation distance value d' by a step length ε, and repeat steps S54 and S55 until d'=d λmin .

2. According to claim 1, a product visual inspection method based on industrial application scenarios, It is characterized in that Distance value d λ The calculation formula is:

3. According to claim 1, a product visual inspection method based on industrial application scenarios, It is characterized in that The range of the distance value d' is Among them, d λmin d λmax are the distance values ​​d λ Calculates the minimum and maximum values ​​in the result.

4. According to claim 1, a product visual inspection method based on industrial application scenarios, It is characterized in that The range of step size ε is Among them, d' 0 is the initial distinguishing distance value, and α is an integer not less than 5.

5. According to the product visual inspection method based on industrial application scenarios according to claim 1, It is characterized in that The defect feature includes at least one of the circularity, grayscale mean, grayscale variance, maximum grayscale value, maximum grayscale difference, entropy, energy, area, and perimeter of the defect area.