Product surface defect intelligent detection method and system

By using morphological processing methods based on two-dimensional standardized flow in machine vision technology for unsupervised analysis, the problem of insufficient dependence and generalization capabilities of labeled data in the existing technology is solved, and efficient defect detection is achieved under different production environments and complex conditions.

CN120163808APending Publication Date: 2025-06-17CHONGQING CHEM IND VOCATIONAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510321870.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

Existing machine vision technology relies on supervised learning in product surface defect detection, requires a large amount of labeled data and lacks generalization capabilities, making it difficult to effectively apply in different production environments and complex conditions.

Method used

Unsupervised analysis is performed using morphological processing methods based on two-dimensional standardized flow, features are extracted through two-dimensional convolutional layers, a two-dimensional standard flow model is constructed, image features are mapped to standard normal space, and defects are located and quantified using probability density differences.

Benefits of technology

Reduce dependence on labeled data, improve the generalization ability of the model, and can effectively identify and locate product surface defects under different production environments and complex conditions, reduce detection costs and improve detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163808A_ABST
    Figure CN120163808A_ABST
Patent Text Reader

Abstract

The invention discloses a product surface defect intelligent detection method and system. The system comprises an image processing module and a defect detection module. Firstly, the image processing module can acquire a product image of a to-be-detected product through image acquisition equipment, and pre-processes the product image, so that defect features of the to-be-detected product can be identified more accurately and quickly subsequently. And then, the defect detection module can analyze the product image by adopting a morphological processing method based on a two-dimensional standardized flow so as to obtain surface defect characteristics of the to-be-detected product. Due to the unsupervised characteristic of the morphological processing method of the two-dimensional standardized flow, the dependence on the labeled data during the training of the two-dimensional standardized flow model can be reduced, the detection cost is reduced, the generalization ability of the model is improved, and the robustness and the precision are relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision detection, and particularly to an intelligent detection method and system for product surface defects. Background Art

[0002] The quality of the product film coating process directly affects the performance of the product. For example, the film coating quality of lithium battery electrodes directly affects the battery performance. Traditional manual visual inspection or simple optical equipment has problems such as low efficiency, high misdetection rate, and difficulty in quantifying defects. Although existing machine vision technologies can be applied to surface detection, they mostly rely on supervised learning, require a large amount of labeled data, and have insufficient generalization ability. Summary of the Invention

[0003] Aiming at the deficiencies of the existing technology, the present invention proposes an intelligent detection method and system for product surface defects, which reduces the dependence on labeled data and improves the generalization ability. The specific technical solutions are as follows:

[0004] An intelligent detection method for product surface defects, characterized by comprising:

[0005] Obtain the product image of the product to be inspected, and preprocess the product image;

[0006] Use a morphological processing method based on two-dimensional normalizing flow to analyze the product image, and determine the surface defect features of the product in the product image.

[0007] Further, preprocessing the product image includes:

[0008] Perform gray-scale processing on the product image, and perform edge detection on the gray-scale processed product image to obtain the contour image of the product.

[0009] Further, using a morphological processing method based on two-dimensional normalizing flow to analyze the product image includes:

[0010] Use a two-dimensional convolutional layer to extract features from the product image to obtain the two-dimensional feature distribution of the product image.

[0011] Further, using a morphological processing method based on two-dimensional normalizing flow to analyze the product image includes:

[0012] Construct a two-dimensional normalizing flow model by stacking multiple reversible transformation blocks.

[0013] Further, using a morphological processing method based on two-dimensional normalizing flow to analyze the product image includes:

[0014] Map the image features of the product in the product image to the standard normal space through a bijective invertible flow model to obtain the hidden variable features corresponding to the product image;

[0015] Use the following calculation formula to calculate the log-likelihood of the hidden variable features:

[0016]

[0017] where \(z\sim N(0, I)\), \(N(0, I)\) represents a normal distribution with an expectation of \(0\) and a variance of \(I\), is the Jacobian determinant of the bijective invertible flow model \(f_{\theta}(x) = z\) and \(x = f_{\theta}\) -1 (z), \(\theta\) is the parameter of the two-dimensional standardized flow model, \(p_z(z)\) is the probability distribution of \(z\), \(x\) is the specific value of the hidden variable feature in the original feature space, and \(z\) is the specific value of the hidden variable feature mapped to the standard normal distribution space;

[0018] Sum the log-likelihood of the hidden variable features as the abnormal two-dimensional probability to obtain the corresponding probability map;

[0019] Use the bilinear interpolation algorithm to upsample the probability map to the resolution of the product image to obtain the surface defect features of the product.

[0020] Furthermore, use a morphological processing method based on two-dimensional standardized flow to analyze the product image, including:

[0021] Locate and quantify the defects in the product image using the probability density difference.

[0022] Furthermore, it also includes: comparing the surface defect features of the product with the stored defect model to determine the defect type to which the product belongs.

[0023] An intelligent detection system for product surface defects, characterized by including:

[0024] An image processing module configured to acquire the product image of the product to be inspected and preprocess the product image;

[0025] A defect detection module configured to analyze the product image using a morphological processing method based on two-dimensional standardized flow to determine the surface defect features of the product in the product image.

[0026] Furthermore, it also includes: a feature comparison module configured to compare the surface defect features of the product with the stored defect model to determine the defect type to which the product belongs.

[0027] Beneficial effects: By adopting the intelligent detection method and system for product surface defects of the present invention, and analyzing the product image by using an unsupervised morphological processing method based on two-dimensional normalizing flow, it is possible to identify and locate the defects in the product surface image by using the probability density difference, thereby reducing the dependence on labeled data, enabling the model to be applicable not only to the recognition under the shape and appearance of the current product, but also to be more easily trained and effectively applied in different production environments and complex conditions of product shapes, thus improving the generalization ability of the model. Description of the Drawings

[0028] To more clearly illustrate the specific embodiments of the present invention, the drawings required for use in the specific embodiments will be briefly introduced below. In all the drawings, the components or parts are not necessarily drawn to actual scale.

[0029] Figure 1 Flowchart of the intelligent detection method for product surface defects provided by an embodiment of the present invention;

[0030] Figure 2 System block diagram of the intelligent detection system for product surface defects provided by an embodiment of the present invention. Specific Embodiments

[0031] The embodiments of the technical solution of the present invention will be described in detail below with reference to the drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and thus are only examples and cannot be used to limit the protection scope of the present invention.

[0032] As Figure 1 shown, an intelligent detection method for product surface defects includes:

[0033] Step 1: Obtain a product image of the product to be inspected and preprocess the product image;

[0034] Step 2: Analyze the product image by using a morphological processing method based on two-dimensional normalizing flow to determine the surface defect features of the product in the product image.

[0035] Specifically, first, a product image of the product to be inspected can be collected by an image acquisition device and the product image can be preprocessed to more accurately and quickly identify the defect features of the product to be inspected subsequently. Then, a morphological processing method based on two-dimensional normalizing flow can be used to analyze the product image, thereby obtaining the surface defect features of the product to be inspected. Due to the unsupervised characteristics of the morphological processing method based on two-dimensional normalizing flow, the dependence on labeled data during the training of the two-dimensional normalizing flow model can be reduced, the detection cost can be lowered, the generalization ability of the model can be improved, and it has high robustness and accuracy.

[0036] In this embodiment, optionally, preprocessing the product image includes:

[0037] Performing grayscale processing on the product image, and performing edge detection on the grayscale-processed product image to obtain the contour image of the product.

[0038] Specifically, in step 1, the preprocessing of the product image includes: First, performing grayscale processing on the product image to convert the product image into a grayscale image. Then, existing edge detection algorithms can be used to detect the product contour in the grayscale image to determine the edge contour of the product to be inspected. Finally, a morphological processing method based on two-dimensional normalizing flow is used to identify and locate defects in the edge contour image, so as to obtain the surface defect features of the product to be inspected. In this way, the data calculation amount when using the morphological processing method to identify defects can be reduced, the algorithm running speed and accuracy can be accelerated, and the efficiency of the detection method can be improved.

[0039] In this embodiment, optionally, analyzing the product image by using a morphological processing method based on two-dimensional normalizing flow includes: Extracting features of the product image by using a two-dimensional convolutional layer.

[0040] Specifically, when analyzing the product image by using the morphological processing method, first, the feature distribution in the edge contour image can be extracted through a two-dimensional convolutional layer to retain spatial information in the flow model as much as possible to improve the accuracy of defect identification and location. In this embodiment, the two-dimensional convolutional layer can adopt a fully convolutional network, in which 3×3 convolutions and 1×1 convolutions appear alternately, so as to retain spatial information in the flow model.

[0041] In this embodiment, optionally, analyzing the product image by using a morphological processing method based on two-dimensional normalizing flow includes: Constructing a two-dimensional normalizing flow model by stacking multiple reversible transformation blocks.

[0042] Specifically, after extracting the image features of the product to be inspected through the two-dimensional convolutional layer, the constructed two-dimensional normalizing flow model can be used to map the image features to the standard normal distribution space. In this embodiment, a two-dimensional normalizing flow model can be constructed by stacking multiple reversible transformation blocks, and through step-by-step, hierarchical, and reversible mapping, the complex feature distribution can be gradually normalized while ensuring the model's expressive ability, computational efficiency, and training stability. Specifically:

[0043]

[0044] where f K is a reversible transformation block, X is the input space, representing the distribution space of the original image features, and Z is the output space, representing the standard normal distribution space after being mapped by this model.

[0045] In this embodiment, optionally, a morphological processing method based on two-dimensional normalizing flow is used to analyze the product image, including:

[0046] Mapping the image features of the product in the product image to the standard normal space through a bijective invertible flow model to obtain the hidden variable features corresponding to the product image;

[0047] The following calculation formula is used to calculate the log-likelihood of the hidden variable features:

[0048]

[0049] where \(z\sim N(0, I)\), and \(N(0, I)\) represents a normal distribution with an expectation of \(0\) and a variance of \(I\). is the Jacobian determinant of the bijective invertible flow model \(f_{\theta}(x) = z\) and \(x = f_{\theta}\) -1 (z), \(\theta\) is the parameter of the two-dimensional normalizing flow model, \(p_z(z)\) is the probability distribution of \(z\), \(x\) is the specific value of the hidden variable feature in the original feature space, that is, the feature instance of the image, and \(z\) is the specific value of the hidden variable feature mapped to the standard normal distribution space;

[0050] Summing the log-likelihood of the hidden variable features as the abnormal two-dimensional probability to obtain the corresponding probability map;

[0051] Using the bilinear interpolation algorithm to upsample the probability map to the resolution of the product image to obtain the surface defect features of the product.

[0052] Specifically, after extracting the image features of the product to be inspected through the two-dimensional convolutional layer, first, the image features can be input into the trained two-dimensional normalizing flow model. Through the bijective invertible flow model in the two-dimensional normalizing flow model, the image features are mapped to the standard normal space to obtain the hidden variable features corresponding to the product image. Then, the log-likelihood of the hidden variable features can be calculated using the above formula. The image features in the abnormal region should be outside the distribution, and their likelihood should be lower than that of the image features in the normal region. Therefore, the likelihood can be used as the abnormal score. Specifically, the log-likelihood of the hidden variable features can be used as the abnormal two-dimensional probability, and the two-dimensional probabilities of all channels are summed to obtain the probability map corresponding to the product to be inspected, so as to more intuitively display the defects in the detection region in the future. Finally, the existing bilinear interpolation method can be used to upsample the probability map to restore its resolution to the product image.

[0053] In this embodiment, optionally, a morphological processing method based on two-dimensional normalizing flow is used to analyze the product image, including: locating and quantifying the defects of the product image using the probability density difference.

[0054] Specifically, the probability map includes the anomaly probability of each pixel in the edge contour image. Based on the probability map, the defects of the product image can be quickly located and quantified by using the probability density difference between each pixel, so as to obtain the surface defect characteristics of the image to be inspected.

[0055] In this embodiment, optionally, it further includes: comparing the surface defect characteristics of the product with the stored defect models to determine the defect type to which the product belongs.

[0056] Specifically, after obtaining the surface defect characteristics of the product to be inspected, the surface defect characteristics can be compared with each pre-constructed defect model, so as to determine the surface defect type of the product to be inspected, such as scratches, dents, bubbles, etc.

[0057] Such as Figure 2 As shown, an intelligent detection system for surface defects of a product, the detection system includes:

[0058] An image processing module configured to acquire a product image of a product to be inspected and preprocess the product image;

[0059] A defect detection module configured to analyze the product image by using a morphological processing method based on two-dimensional normalizing flow to determine the surface defect characteristics of the product in the product image.

[0060] Specifically, the detection system includes an image processing module and a defect detection module. Among them, the image processing module can acquire the product image of the product to be inspected through an image acquisition device and preprocess the product image, so as to more accurately and quickly identify the defect characteristics of the product to be inspected subsequently. The defect detection module can analyze the product image by using a morphological processing method based on two-dimensional normalizing flow, so as to obtain the surface defect characteristics of the product to be inspected. Due to the unsupervised characteristic of the morphological processing method based on two-dimensional normalizing flow, the dependence on labeled data during the training of the two-dimensional normalizing flow model can be reduced, the detection cost can be reduced, the generalization ability of the model can be improved, and it has high robustness and accuracy.

[0061] In this embodiment, optionally, it further includes: a feature comparison module configured to compare the surface defect characteristics of the product with the stored defect models to determine the defect type to which the product belongs.

[0062] Specifically, the detection system further includes a feature comparison module, which can compare the surface defect characteristics with each pre-constructed defect model, so as to determine the surface defect type of the product to be inspected.

[0063] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present invention, and they should all be covered within the scope of the claims and the specification of the present invention.

Claims

1. A method for intelligent detection of product surface defects, characterized in that: include: Acquire a product image of the product to be inspected, and preprocess the product image; The product image is analyzed by using a morphological processing method based on two-dimensional standardized flow to determine the surface defect features of the product in the product image.

2. The intelligent detection method for product surface defects according to claim 1, characterized in that: Preprocessing the product image includes: Grayscale processing is performed on the product image, and edge detection is performed on the grayscale processed product image to obtain a contour image of the product.

3. The intelligent detection method for product surface defects according to claim 1, characterized in that: The product image is analyzed using a morphological processing method based on a two-dimensional normalized flow, including: A two-dimensional convolutional layer is used to extract features of the product image to obtain a two-dimensional feature distribution of the product image.

4. The intelligent detection method for product surface defects according to claim 1, characterized in that: The product image is analyzed using a morphological processing method based on a two-dimensional normalized flow, including: A two-dimensional standard flow model is constructed by stacking multiple reversible transformation blocks.

5. The intelligent detection method for product surface defects according to claim 1, characterized in that: The product image is analyzed using a morphological processing method based on a two-dimensional normalized flow, including: Mapping the image features of the product in the product image to the standard normal space through a bijective reversible flow model to obtain hidden variable features corresponding to the product image; The log-likelihood of the hidden variable features is calculated using the following formula: Among them, z~N(o,I), N(o,I) represents a normal distribution with an expected value of o and a variance of I. For the bijective reversible flow model, fθ(x) = z and x = fθ -1 The Jacobian determinant of (z), θ is the parameter of the two-dimensional normalized flow model, pz(z) is the probability distribution of z, x is the specific value of the hidden variable feature in the original feature space, and z is the specific value of the hidden variable feature mapped to the standard normal distribution space; summing the log-likelihood of the hidden variable features as the abnormal two-dimensional probability to obtain a corresponding probability map; The probability map is upsampled to the resolution of the product image using a bilinear interpolation algorithm to obtain surface defect features of the product.

6. The intelligent detection method for product surface defects according to claim 1, characterized in that: The product image is analyzed using a morphological processing method based on a two-dimensional normalized flow, including: Probability density differences are used to locate and quantify defects in the product image.

7. The intelligent detection method for product surface defects according to claim 1, characterized in that: Also includes: The surface defect characteristics of the product are compared with the stored defect model to determine the defect type of the product.

8. A product surface defect intelligent detection system, characterized in that: include: An image processing module, configured to obtain a product image of a product to be inspected and pre-process the product image; The defect detection module is configured to analyze the product image by using a morphological processing method based on a two-dimensional standardized flow to determine the surface defect features of the product in the product image.

9. The intelligent detection method for product surface defects according to claim 8, characterized in that: Also includes: The feature comparison module is configured to compare the surface defect features of the product with the stored defect model to determine the defect type of the product.