Deep learning image defect detection method based on Zernike inverse transformation

By generating pseudo-defect images through inverse Zernike transform and combining it with a deep learning model, the problems of scarce defect samples and insufficient simulation capabilities in existing technologies are solved, and the robustness and detection accuracy of industrial visual inspection systems are improved.

CN120765645AActive Publication Date: 2025-10-10SHENZHEN DEEPVISION INNOVATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511270799.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-10-10
Estimated Expiration
2045-09-08

AI Technical Summary

Technical Problem

In existing industrial visual inspection systems, deep learning methods rely heavily on a large number of real defect samples, resulting in weak model generalization ability and difficulty in maintaining high detection accuracy in complex scenarios. In addition, existing data enhancement methods cannot effectively simulate defect patterns with physical characteristics such as edge wear, deformation, and cracks.

Method used

The image is mapped into feature space using Zernike polynomials, and simulated defect images are generated through Zernike inverse transform. The deep learning model is combined for joint training to construct pseudo defect images to enhance the training effect. Different types of defects are simulated by perturbing the Zernike moment, and an improved contrast loss and structure-aware encoder are introduced for training.

Benefits of technology

In the absence of real defect samples, it generates structurally consistent and physically reasonable pseudo-defect images, which improves the robustness and detection capability of the model. It has strong structural discrimination capabilities and is suitable for training and reasoning under conditions without defect samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure QLYQS_1
    Figure QLYQS_1
  • Figure QLYQS_5
    Figure QLYQS_5
Patent Text Reader

Abstract

The invention discloses a deep learning image defect detection method based on Zernike inverse transformation, and relates to the technical field of image processing and artificial intelligence, and the method comprises the steps: reconstructing an image based on a Zernike inverse transformation mechanism; simulating a pseudo defect image by disturbing the amplitude, phase or dimension of the Zernike moment; the original image and the pseudo defect image are combined to construct a training set, joint training is performed on the deep learning image detection model, and a total loss function is constructed through standard cross entropy loss and Zernike structure retention loss; in a scene without real defect data, weak supervision image defect detection training is carried out through a Zernike reconstruction error or an outlier degree in a Zernike space. Therefore, the deep learning image defect detection method based on the Zernike inverse transformation is suitable for the condition of lack of defect samples, and the robustness of an image defect detection model is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing and artificial intelligence technology, and in particular to a deep learning image defect detection method based on Zernike inverse transform. Background Art

[0002] Deep learning methods have become mainstream in existing industrial visual inspection systems, but they rely heavily on supervised training using large numbers of real-world defect samples. However, the wide variety and uneven distribution of defects in real industrial scenarios, coupled with high data acquisition costs and a scarcity of defect samples, make traditional binary classification supervised learning difficult to train, resulting in weak model generalization and difficulty maintaining high detection accuracy in complex real-world scenarios. Methods based on reconstruction error or one-class classification have attempted to address this issue, but these methods lack structural perception and anomaly simulation capabilities, and their training effectiveness is limited, particularly in scenarios lacking real-world defect images.

[0003] In addition, existing data enhancement methods (such as rotation, cropping, and noise perturbation) cannot generate structured defects, lack realism and physical consistency, and cannot effectively simulate defect modes with physical characteristics such as edge wear, deformation, and cracks, limiting the improvement of model performance.

[0004] To address the above problems, the present invention uses Zernike polynomials to map normal images into feature space, performs inverse transformation reconstruction after controllable perturbation of specific Zernike moments, generates simulated defect images, and combines them with deep learning models for joint training to achieve enhanced learning and robust detection of defect images. Summary of the Invention

[0005] The purpose of the present invention is to provide a deep learning image defect detection method based on Zernike inverse transform to solve the problem that the existing technology cannot effectively simulate defect modes with physical characteristics such as edge wear, deformation, and cracks, so that the model can construct an effective supervision signal when defect samples are scarce or there are no defect samples at all, thereby enhancing the robustness of the image defect detection model.

[0006] To achieve the above object, the present invention provides a deep learning image defect detection method based on Zernike inverse transform, comprising the following steps: S1. Define the input image in the unit circle area, map the image into feature space through Zernike polynomials, and then reconstruct the image through the Zernike inverse transform mechanism; S2. Setting a perturbation strategy to perturb the amplitude, phase, or dimension of the Zernike moment to simulate a pseudo-defect image, and combining the input image with the pseudo-defect image to construct a training set; S3, according to the degree of disturbance, the pseudo-defect image is divided into different pseudo-defect levels and the positive-negative pair is constructed, and then the structure perception encoder is trained based on the improved contrast loss for extracting the structure feature embedding of the image; wherein the pseudo-defect levels include mild defects, moderate defects and severe defects; S4, based on the trained structure perception encoder, the structure features of the to-be-tested image are extracted, and the normal images or mild defect images in the training set are used to evaluate the abnormality of the to-be-tested image, and then the defect image is identified according to the set threshold.

[0007] Further, in S1, the image reconstruction includes retaining a limited number of Zernike moment coefficients as a basic expression form of the simulated defect image.

[0008] Further, in S2, the disturbance strategy includes: high-order moment deletion, reconstructing the image with blurred boundaries and contour wear to simulate mild wear or blur defects; low-order moment enhancement, reconstructing the image with contour deformation to simulate geometric abnormal defects; odd-order moment injection, breaking the balance of image structure to simulate crack and fault defects; composite disturbance, combining high-order moment deletion, low-order moment enhancement and odd-order moment injection strategy to simulate composite defects.

[0009] Further, S3 includes taking the Zernike space distance between the original normal image and the pseudo-defect image after disturbance as a defect level measurement index, as follows: ; In the formula, is the original normal image, is the pseudo-defect image after disturbance, denotes the Zernike moment coefficient vector.

[0010] Further, in S3, the positive-negative pair is constructed, including: taking the original normal image and the mild defect as the positive pair; taking the original normal image and the moderate defect, the severe defect as the negative pair.

[0011] Further, in S3, the positive-negative pair is constructed, including: taking the original normal image and the mild defect as the positive pair; taking the original normal image and the moderate defect, the severe defect as the negative pair.

[0012] Further, in S3, the improved contrast loss is as follows: ; In the formula, is the original normal image, is the feature of the mild disturbance or enhanced image, is the feature of the moderate disturbance / severe disturbance image, is the cosine similarity function, is the temperature scaling factor.

[0013] Furthermore, in S4, the abnormality of the image to be tested is evaluated, including: comparing with the mean of the structural features of normal samples in the training data set as a first evaluation index; or comparing with the reference feature center of the slightly defective sample as a second evaluation index.

[0014] Furthermore, in S4, the evaluation index of abnormality to be selected includes the L2 norm between the structural features of the image to be tested and the mean of the structural features of the normal sample, or the cosine similarity between the structural features of the image to be tested and the reference feature center of the mild defect sample.

[0015] Furthermore, S4 also includes weighted fusion of the first evaluation index and the second evaluation index to comprehensively evaluate the abnormality of the image to be tested.

[0016] Therefore, the present invention adopts the above-mentioned deep learning image defect detection method based on Zernike inverse transform, which has the following technical effects: (1) This paper proposes an image reconstruction method based on the inverse transform of Zernike polynomials, which is used to controllably generate simulated images of multiple types of defects. By perturbing the specific order and components of the Zernike moments, the paper realizes the physical simulation of different types of defects (such as blur, geometric deformation, and asymmetric structure), which has physical interpretability and controllability. (2) The present invention jointly inputs the simulated defect image and the original image into the deep neural network and introduces a hierarchical comparison mechanism, which improves the model's robustness and discrimination ability for complex defects. It is easy to integrate into the existing industrial inspection system, enabling the model to have the training and reasoning capabilities under conditions of no defect samples or lack of defect samples.

[0017] The technical solution of the present invention is further described in detail below through examples. DETAILED DESCRIPTION

[0018] The present invention can be explained in more detail by the following examples. The purpose of disclosing the present invention is to protect all changes and improvements within the scope of the present invention. The present invention is not limited to the following examples.

[0019] The present invention provides a deep learning image defect detection method based on Zernike inverse transform, comprising the following steps: S1, Zernike polynomials are a family of orthogonal complex functions defined on the unit circle, which have good image reconstruction and rotation invariance and are widely used in image shape description. Based on this feature, this embodiment first defines the input image in the unit circle area, maps the image into a feature space through Zernike polynomials, and reconstructs the image through the Zernike inverse transform mechanism. Specifically, given the input image , its Zernike orthogonal expansion within the unit circle is expressed as: ; Where, 、 are the radial order and angular order of the polynomial respectively; is the highest order of Zernike moments; Represents the Zernike moment, which is the difference between the input image and the Zernike basis function The inner product of represents the Zernike orthogonal basis function, which contains radial polynomials and angle terms, and is expressed as , is the Zernike radial polynomial, , .

[0020] By selecting the first few low-order and mid-order coefficients for image reconstruction, the main structural information is retained while the detailed texture is removed, providing a basis for subsequent defect simulation.

[0021] S2. By purposefully perturbing the amplitude, phase, or dimension of the Zernike moments, different types of structural defects are introduced during image reconstruction. Specifically, perturbation strategies include: (1) High-order moment deletion: Delete high-order moments Item, which simulates slight wear or blur defects, can reconstruct a blurred image.

[0022] (2) Low-order moment enhancement: applying gain to low-order terms , As the gain factor, structural deformation is introduced to simulate geometric abnormal defects such as expansion and distortion, and the contour deformation image can be reconstructed.

[0023] (3) Odd-order moment injection: inject odd-order terms into symmetric images , An odd number breaks the balance of the image structure and simulates defects such as cracks and faults.

[0024] (4) Composite perturbation: Combining the perturbation strategies of (1) to (3) above, a multi-type, hierarchical structured pseudo-defect image is constructed with physical rationality and structural continuity, thereby obtaining a more realistic composite defect image.

[0025] Through the above mechanism, the pseudo-defect images with consistent structure and physically reasonable are generated without relying on real defect samples, the real defect features can be simulated and analogized, the model training effect under small sample condition is significantly improved, and higher sensitivity to contour deformation, slight damage and atypical defects is possessed, so that the training data set with visual structure and controllable defect level is generated without non-normal samples (NG samples).

[0026] S3, based on the Zernike disturbance degree, a pseudo-defect level is constructed, and a training strategy of structure contrast learning mechanism is introduced to construct an explicit discriminant structure space based on only positive samples, as follows: First, according to the disturbance intensity, the pseudo-defect images are divided into mild defects (high-order deletion), moderate defects (low-order enhancement) and severe defects (odd injection), and the Zernike space distance between the original normal image and the pseudo-defect image after disturbance is defined as the defect level measurement index: ; In the formula, is the original normal image, is the pseudo-defect image after disturbance, represents the Zernike moment coefficient vector.

[0027] In one embodiment, the size of the Zernike space distance is used to judge the pseudo-defect level. Specifically, two threshold parameters and are set, and the defect level is determined by statistical analysis, as follows: When , it is judged as a mild defect; when , it is judged as a moderate defect; and when , it is judged as a severe defect.

[0028] Then, the positive and negative pairs are constructed according to the pseudo-defect level, as follows: The original normal image and the mild defect ( ): positive pair.

[0029] The original normal image and the moderate defect / severe defect ( / ): negative pair.

[0030] The original normal image and other random enhancement images (obtained by traditional random enhancement method): auxiliary positive pair.

[0031] Here, , 、 All images are from the same source Pseudo defect images after different perturbations.

[0032] In addition, an improved contrast loss is introduced to train a structure-aware encoder, which is expressed as follows: ; Where, for improved contrast loss; is the original normal image; To slightly perturb or enhance the features of the image; is the feature of moderately disturbed / severely disturbed image, subscript The label for moderate disturbance / severe disturbance; is the cosine similarity function; is the temperature scaling factor.

[0033] In this embodiment, the improved contrast loss is not the general “semantic contrast”, but the structural level contrast. It uses the pseudo defect level generated by Zernike perturbation to let the model explicitly learn “normal Mild The advantages of the improved contrast loss include: (1) learning structural sensitivity and effectively detecting subtle defects; (2) reducing the missed detection rate, especially for mild anomalies; (3) having hierarchical discrimination capabilities, not just binary classification; (4) can be trained without relying on real defect samples; (5) the feature space is more interpretable and the defect level can be directly quantified.

[0034] Based on the above, this embodiment uses a CNN or Transformer as the backbone network, coupled with a projection head to learn structural spatial embeddings. A structure-aware encoder is trained using the constructed positive and negative pairs. The trained structure-aware encoder is then used to extract the structural feature embeddings of the image and identify abnormal images. This hierarchical comparison mechanism gives the model strong structural discrimination capabilities, surpassing traditional one-class methods. It is also highly practical, simple to deploy, and easily integrated into existing industrial inspection systems.

[0035] S4. During the testing phase, the model does not need to input defect images for inference. Defect recognition can be completed using only a single image to be tested. The details are as follows: (1) Input image: a single image to be tested .

[0036] (2) Zernike expansion: Calculate the image to be tested The Zernike moment coefficient vector .

[0037] (3) Feature extraction: Use the trained structure-aware encoder to extract the image to be tested Deep feature representation of .

[0038] (4) Extraction-based deep feature representation , the image to be tested The larger the value, the more abnormal it is. Perform binary determination of whether it is abnormal.

[0039] In one of the possible embodiments, a threshold value may be set. 、 and , Used to distinguish normal from defective, and Used to subdivide defects into different levels of mild / moderate / severe.

[0040] In another feasible embodiment, the abnormality evaluation method includes two methods: one is to compare with the mean of the structural features of the normal samples in the training data set, which is suitable for the case where the normal data distribution is compact; the other is to compare with the reference feature center of the slightly defective sample, which is more robust in the presence of redundancy and complex background. The specific steps for comparing with the feature mean of the normal samples in the training data set are as follows: first calculate the mean center of the structural features of the original normal image in the training set. , and then calculate the abnormal score of the image to be tested , as an evaluation index of abnormality. Since the mean of the training set Sometimes it contains a lot of redundant structures (such as repeated backgrounds, complex textures), which leads to inaccurate structure centers. To this end, a method of comparing with reference mild samples is designed. This embodiment uses images with mild defects in the training data set. These images are synthesized from the original normal image by deleting the Zernike high-order moment coefficients, and have slightly degraded structural characteristics. The specific steps are: setting the reference feature center of the slightly pseudo-defect image , is the number of images with mild pseudo-defects, and the cosine similarity score of the reference feature center between the image to be tested and the image with mild pseudo-defects is calculated. , as an evaluation index of abnormality.

[0041] In other embodiments, the two abnormality assessment methods described above may be weighted and integrated, or one of them may be selected separately according to data characteristics.

[0042] Therefore, the present invention adopts the above-mentioned deep learning image defect detection method based on Zernike inverse transform, simulates defects based on image structure, has physical interpretability and controllability, and introduces a hierarchical comparison mechanism to enable the model to have strong structural discrimination ability, which helps to improve the robustness of model detection; at the same time, it does not rely on the acquisition of real defect images, and only relies on normal samples to complete training. The specific implementation is simple and easy to operate, compatible with mainstream deep models, and easy to integrate into existing industrial inspection systems.

[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A deep learning image defect detection method based on inverse Zernike transform, characterized in that: The following steps are involved: S1. Define the input image in the unit circle area, map the image into feature space through Zernike polynomials, and then reconstruct the image through the Zernike inverse transform mechanism; S2. Setting a perturbation strategy to perturb the amplitude, phase, or dimension of the Zernike moment to simulate a pseudo-defect image, and combining the input image with the pseudo-defect image to construct a training set; S3. According to the degree of disturbance, the pseudo-defect image is divided into different pseudo-defect levels and positive and negative pairs are constructed. Then, a structure-aware encoder is trained based on the improved contrast loss to extract the structural features of the image for embedding. Among them, the false defect levels include mild defects, moderate defects and severe defects; S4. Based on the trained structure-aware encoder, the structural features of the image to be tested are extracted, and the normal images or slightly defective images in the training set are used to evaluate the abnormality of the image to be tested, and then the defective image is identified according to the set threshold.

2. The deep learning image defect detection method based on Zernike inverse transform according to claim 1 is characterized in that: In S1, image reconstruction involves retaining a finite number of Zernike moment coefficients as the basic representation of the simulated defect image.

3. The deep learning image defect detection method based on Zernike inverse transform according to claim 1, characterized in that: In S2, the perturbation strategy includes: High-order moment deletion, reconstructing images with blurred boundaries and contour wear, simulating mild wear or blurred defects; Low-order moment enhancement, reconstructing contour deformation images and simulating geometric abnormal defects; Odd-order moment injection breaks the image structure balance and simulates cracks and fault defects; Composite perturbation, combining high-order moment deletion, low-order moment enhancement and odd-order moment injection strategies, simulates complex defects.

4. The deep learning image defect detection method based on Zernike inverse transform according to claim 1, characterized in that: S3 includes taking the Zernike space distance between the original normal image and the perturbed pseudo-defect image as the defect level measurement indicator, as follows: ; Where, is the original normal image, is the pseudo defect image after disturbance, represents the Zernike moment coefficient vector.

5. The deep learning image defect detection method based on Zernike inverse transform according to claim 1, characterized in that: In S3, positive and negative pairs are constructed, including: taking the original normal image and the mild defect as the positive pair; taking the original normal image and the moderate defect and the severe defect as the negative pair.

6. The deep learning image defect detection method based on Zernike inverse transform according to claim 1, characterized in that: In S3, constructing positive and negative pairs also includes: using the original normal image and the randomly enhanced image as auxiliary positive pairs.

7. The deep learning image defect detection method based on Zernike inverse transform according to claim 1, characterized in that: In S3, the improved contrast loss is as follows: ; Where, is the original normal image, To slightly perturb or enhance the features of the image, is the feature of moderately disturbed / severely disturbed image, is the cosine similarity function, is the temperature scaling factor.

8. The deep learning image defect detection method based on Zernike inverse transform according to claim 1, characterized in that: In S4, the abnormality of the image to be tested is evaluated, including: comparing with the mean of the structural features of normal samples in the training data set as a first evaluation index; or comparing with the reference feature center of the slightly defective sample as a second evaluation index.

9. The deep learning image defect detection method based on Zernike inverse transform according to claim 8, characterized in that: In S4, the evaluation index of abnormality degree includes the L2 norm between the structural features of the image to be tested and the mean of the structural features of the normal sample, or the cosine similarity between the structural features of the image to be tested and the reference feature center of the mild defect sample.

10. The deep learning image defect detection method based on Zernike inverse transform according to claim 8, characterized in that: S4 also includes weighted fusion of the first evaluation index and the second evaluation index to comprehensively evaluate the abnormality of the image to be tested.

Citation Information

Patent Citations

  • Hierarchical control method and system for energy storage device

    CN114498772A

  • Model training and defect detection method, device and equipment and readable storage medium

    CN119180811A

  • Device for amplifying a signal using self-reference quantitative phase imaging

    WO2024003470A1