A general visual unsupervised defect detection method based on hierarchical reconstruction
By combining hierarchical reconstruction and self-attention mechanism, the problems of deep learning methods' dependence on labeled data and insufficient global feature modeling are solved, achieving high-precision, low-false-report unsupervised defect detection, which is applicable to complex backgrounds and diverse industrial defects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2025-08-27
- Publication Date
- 2026-05-29
AI Technical Summary
Existing deep learning defect detection methods rely on a large number of labeled defect samples, making it difficult to achieve high-precision detection in complex backgrounds or unstructured samples. Furthermore, traditional convolutional networks lack global feature modeling capabilities, resulting in high false detection and false negative rates, making them unsuitable for diverse industrial defects.
An unsupervised method based on hierarchical reconstruction is adopted, which combines multi-scale encoding and decoding structure, self-attention mechanism and residual discriminant network. It reconstructs in parallel through three branches: foreground, background and mask. It captures global features by using self-attention mechanism and introduces mutual exclusion loss function to force decoupling of layers, thus generating high-quality reconstruction results.
It improves the accuracy and robustness of defect detection, reduces the dependence on labeled data, is suitable for detecting complex backgrounds and minute defects, has stable model training and efficient inference, and is applicable to a variety of industrial vision inspection tasks.
Smart Images

Figure CN121053098B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computer vision and defect detection, specifically relating to a general visual unsupervised defect detection method based on hierarchical reconstruction. Background Technology
[0002] In the fields of industrial automation and intelligent manufacturing, defect detection, as a crucial aspect of product quality control, has received widespread attention. Traditional defect detection methods largely rely on image processing techniques based on manual features. While these methods are effective in scenarios with simple structures and fixed defect types, as industrial products become increasingly complex and defect forms more diverse, rule-based detection methods are no longer sufficient to meet practical needs. This is especially true in complex backgrounds or unstructured samples, where false positive and false negative rates increase significantly. Therefore, traditional methods are no longer a robust detection solution. To improve detection accuracy, deep learning-based defect detection models are gradually emerging as a reliable alternative.
[0003] In recent years, with the development of deep learning, supervised defect detection methods based on convolutional neural networks have rapidly advanced, achieving high-precision detection results, especially when sufficient labeled defect samples are available. However, supervised learning methods heavily rely on large-scale, high-quality defect samples as training data. In real-world industrial scenarios, defect samples are often scarce, difficult to collect, unevenly distributed, and diverse in type, making it extremely difficult to construct a complete training set. Furthermore, traditional convolutional networks tend to focus on extracting local features during training, lacking the ability to model long-distance dependencies in images, which can easily lead to blurred reconstructions or incomplete features, thus affecting the final discrimination performance. Therefore, how to construct an unsupervised defect detection model with high detection accuracy has become a pressing technological challenge.
[0004] Furthermore, most existing deep learning methods employ single-scale, shallow reconstruction approaches, making it difficult to simultaneously preserve both global semantic information and local structural features of an image. This results in poor model perception of complex textures or minute defects. In particular, when faced with complex image scenes, existing algorithms often struggle to achieve sufficient detection accuracy and speed. Summary of the Invention
[0005] To address the aforementioned issues, this invention discloses a general unsupervised visual defect detection method based on hierarchical reconstruction. Combining a multi-scale encoding / decoding structure, a self-attention mechanism, and a residual discriminant network, it effectively improves the robustness and accuracy of defect localization, making it applicable to various industrial visual inspection tasks. Through an innovative three-branch parallel reconstruction mechanism (foreground, background, and mask), and with forced structural decoupling via a mutually exclusive loss function, this method can accurately learn and reconstruct complex background textures. This effectively avoids the problems of traditional single-flow models misclassifying normal texture fluctuations as defects or incorrectly reconstructing defect regions, thus achieving lower false alarm and false negative rates on complex surfaces such as fabrics, brushed metal, and wood grain.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows:
[0007] A general unsupervised visual defect detection method based on hierarchical reconstruction is proposed, consisting of two stages: image reconstruction and defect discrimination. The image reconstruction stage includes the following steps:
[0008] S1: Input the original image x into the image reconstruction module R. x first passes through the encoder G in the generator. E The feature representation x is obtained by downsampling. feature ;
[0009] S2: Feature representation x obtained from the encoder through a self-attention structure feature Perform self-attention matrix calculation to obtain the global features of the input;
[0010] S3: Input the result of the self-attention matrix calculation into the decoder G D Perform upsampling calculations;
[0011] S4: Reconstruct the results during training. Input the discriminator and calculate the discrimination result. Adversarial training between the generator and discriminator improves the reconstruction performance of the reconstruction module. During inference, no discriminator input is required; proceed directly to S5.
[0012] The defect identification stage includes the following steps:
[0013] S5: Compare the original image x with the reconstruction result from the image reconstruction module. Create a silhouette image (sub);
[0014] S6: Input the silhouette image sub into the defect discrimination model I, and output the final discrimination result based on the silhouette data distribution.
[0015] Furthermore, regarding the image reconstruction stage, step S1 specifically includes the following steps:
[0016] S1.1: Input the original image into the image reconstruction module R. The original image includes defective and defect-free images. In training mode, defect-free images are used, allowing the model to learn the distribution of defect-free samples. In inference mode, there is no restriction on using defective images, and the model will output the discrimination result.
[0017] S1.2: The image reconstruction module R adopts a hierarchical structure, consisting of three independent codecs. These three codecs have the same structure and are responsible for reconstructing the foreground layer f, background layer b, and mask layer m of the original image, respectively.
[0018] S1.3: After the image is input into the image reconstruction module R, it first passes through the encoder G of the generator. E Obtain the feature space representation x of the input image feature ;
[0019] S1.4: The encoder G E Composed of multiple convolutional layers, activation function layers, and normalization layers, this encoder has the ability to extract deep semantic features of images. It adopts a hierarchical coding strategy, extracting semantic features at different scales in each layer and passing the semantic features at different scales to the corresponding decoding stage through skip connections.
[0020] Furthermore, regarding the image reconstruction stage, step S2 specifically includes converting the original image feature representation x calculated by the encoder in step S1 into a digital image representation. feature Input the self-attention structure; the self-attention structure mainly calculates the self-attention matrix. The self-attention matrix consists of Q, K, and V, where Q, K, and V are represented by the feature representation x. feature The results are obtained through three independent convolutions. Then, matrix dot multiplication is performed on Q and K, and the result is input into the SoftMax layer to obtain the correlation matrix A of the Q and K matrices. The correlation matrix A is then processed by the SoftMax layer. Q,K Perform another matrix dot product with the V matrix to obtain the weighted output O of the self-attention structure.
[0021] Furthermore, regarding the image reconstruction stage, step S3 specifically includes the following steps:
[0022] S3.1: Introduce a skip connection structure between the encoder and decoder to directly transmit the features of a certain scale of the encoder to the corresponding scale reconstruction path in the decoder;
[0023] S3.2: Input the globally weighted features output from the self-attention structure into the decoder G. D In the process, multi-stage upsampling operations are performed to restore the original spatial resolution;
[0024] S3.3: Perform feature synthesis on the calculated foreground layer f, background layer b, and mask layer m to obtain the reconstruction result.
[0025] Furthermore, regarding the image reconstruction stage, step S4 specifically includes: converting the reconstruction result into a training mode. Input the discriminator and perform adversarial training between the generator and the discriminator, modeling them using a mini-maximum game approach. The inference mode does not require step S4 and proceeds directly to step S5.
[0026] Furthermore, regarding the defect identification stage, step S5 specifically includes comparing the original image x with the reconstruction result from the image reconstruction module. The silhouette image 'sub' is obtained by performing silhouette calculation. Silhouette calculation is a matrix subtraction, that is, subtracting corresponding elements and taking the absolute value.
[0027] Furthermore, regarding the defect identification stage, step S6 specifically includes the following steps:
[0028] S6.1: Input the silhouette image sub into defect discrimination module I. The defect discrimination module consists of a lightweight discrimination network based on ResNet50 pre-trained on the ImageNet dataset, and outputs residual fusion features;
[0029] S6.2: Input the residual fusion features after ResNet processing into a fully connected layer and connect it to a single neuron as a classifier. Output the final defect probability.
[0030] The present invention has the following beneficial effects:
[0031] 1. Improved accuracy and robustness of defect detection: Through a hierarchical reconstruction mechanism of foreground, background, and mask, the model can learn and distinguish different components of an image more precisely. Combined with skip connections to preserve details and a self-attention mechanism to capture global information, it significantly improves the semantic consistency and detail restoration capabilities of image reconstruction. This makes the reconstruction of normal images more accurate, while the difference between the reconstructed defect region and the original image becomes more pronounced, thereby improving the defect detection rate and localization accuracy, especially for complex backgrounds and small defects.
[0032] 2. Enhanced understanding and utilization of global features: The application of the self-attention mechanism enables the model to fully consider the long-distance dependencies between different regions in the image during reconstruction, overcoming the shortcomings of traditional convolutional networks in global information modeling. This helps to generate reconstructed images that are more consistent with the overall structure and semantics, thereby indirectly improving the ability to identify abnormal patterns.
[0033] 3. Reduced dependence on labeled data and wide applicability: As an unsupervised learning method, this invention only requires training with defect-free normal samples, without the need for expensive and hard-to-obtain defect samples and their labels, which greatly reduces the deployment threshold in industrial scenarios and is especially suitable for application scenarios with a wide variety of defect types and forms.
[0034] 4. Stable model training and efficient inference: Although adversarial training is introduced, a relatively stable training process can be achieved through a carefully designed network structure and loss function. During the inference phase, only the reconstruction and discrimination modules need to be fed forward, resulting in high computational efficiency and demonstrating potential for real-time industrial inspection.
[0035] 5. Good prospects for engineering deployment and promotion: The overall method structure is relatively clear, and key modules (such as ResNet50) have mature implementations, which facilitates engineering deployment. Its unsupervised nature allows it to flexibly adapt to different types of industrial products and defect detection tasks. Attached Figure Description
[0036] Figure 1 This is an overall structural diagram of the present invention.
[0037] Figure 2 This is a structural diagram of the layered generator in a specific embodiment of the present invention.
[0038] Figure 3 This is a diagram of the self-attention structure in a specific embodiment of the present invention.
[0039] Figure 4 This is a structural diagram of the defect identification module in a specific embodiment of the present invention. Detailed Implementation
[0040] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.
[0041] As shown in the figure, the core idea of the general visual unsupervised defect detection method based on hierarchical reconstruction described in this invention is as follows: First, the input image is processed by a specially designed image reconstruction module. This module innovatively adopts a hierarchical modeling and reconstruction strategy of foreground, background, and mask layers, combined with skip connections to retain multi-scale features, and uses a self-attention mechanism to capture global contextual information, thereby generating a high-quality, multi-dimensional reconstructed representation of the original image. This reconstruction aims to accurately reproduce the pattern of a normal image. Second, the difference between the original image and the reconstructed image is compared (the silhouette image is calculated), and this difference information is input into the defect discrimination module to determine whether the input sample has a defect. Since the model is only trained on defect-free images to learn normal patterns, when faced with defective images, its reconstruction result will significantly deviate from the original image in the defective region, thus making the defect easier to identify. The innovation of this invention is summarized as follows:
[0042] 1. Objective: To address the problem of confusion between complex textures and defects, this invention proposes a reconstruction strategy that explicitly decomposes an image into three independent layers: foreground, background, and mask.
[0043] 2. Implementation: Three parallel encoder-decoder networks with identical structures but independent weights are used to learn the decoupled representations of the three layers respectively.
[0044] 3. Key Enhancement: A self-attention module is strategically introduced after each independent encoder and before the multi-branch decoder. This module is used to capture long-range dependencies in the feature maps, which is crucial for distinguishing between global texture patterns (which should be classified as background) and localized isolated objects (which should be classified as foreground).
[0045] 4. Core Constraint: Design a novel mutually exclusive loss function (L... excl This function forces structural decoupling between the two layers at the training level by penalizing the simultaneous occurrence of similar structural features (such as edges) in the foreground and background layers.
[0046] 5. Final Synthesis: The three learned layers are fused using a defined synthesis function to generate a high-fidelity, texture-aware reconstruction of the normal image. This high-quality reconstruction allows defective regions to produce more significant and easily detectable signals in the residual image when compared with the original image.
[0047] Specific examples Figure 1 As shown, the general visual unsupervised defect detection method based on hierarchical reconstruction described in this invention is divided into two stages: image reconstruction and defect discrimination.
[0048] The image reconstruction stage includes the following steps:
[0049] S1: Input the original image x into the image reconstruction module R, and then pass it through the encoder G in the generator. E Obtain the feature representation x of the input image x. feature The details are as follows;
[0050] S1.1: Input the original image into the image reconstruction module R;
[0051] Specifically, the original images are divided into defective and non-defective images. During the training phase, non-defective images are used to allow the model to learn the data distribution of non-defective samples. During the inference phase, there is no restriction on whether defective images are used, and the model will output the discrimination result.
[0052] S1.2: The image reconstruction module R adopts a hierarchical structure, consisting of three independent codecs and their respective self-attention modules. These three codecs have the same structure but are independently responsible for reconstructing the foreground layer f, background layer b, and mask layer m of the original image; the codecs do not share parameters, such as... Figure 2 As shown; the formula is expressed as:
[0053] f = G f (x)
[0054] b = G b (x)
[0055] m = G m (x)
[0056] In the formula G f G b G m It consists of three independent codecs;
[0057] S1.3: After the image is input into the image reconstruction module R, it first passes through the encoder G in the generator. E Obtain the feature space representation x of the input image feature ;
[0058] S1.4: The encoder G described in S1.3 E Composed of multiple convolutional layers, activation function layers, and normalization layers, this encoder is responsible for extracting deep semantic features from the image. It employs a hierarchical encoding strategy, extracting semantic features at different scales in each layer. In each encoding stage, convolutional kernels of different sizes and channel numbers are used to achieve multi-scale feature aggregation. The encoder retains the extracted features at each stage and passes them to the corresponding decoding stage via skip connections. This allows for the fusion of low-level features and high-level semantics during image reconstruction, compensating for potential loss of image details due to multiple downsampling. The final generated feature representation x... feature It is a multidimensional vector that contains key attributes such as the structure and texture of the input image.
[0059] S2: Take the x obtained in step S1 feature Features are processed through a self-attention structure to calculate the self-attention matrix, thus obtaining global information about the input.
[0060] Specifically, self-attention structures are mainly used to calculate the self-attention matrix, such as... Figure 3 As shown; the self-attention matrix consists of Q, K, and V, where Q, K, and V are represented by the feature representation x. feature The self-attention matrix is obtained through three independent convolutions, where the Q and K matrices are both 32×32×64 in size, and the V matrix is 32×32×512 in size. This design of the self-attention matrix size can balance computational efficiency and computational accuracy.
[0061] After obtaining the self-attention matrices Q, K, and V, matrix dot products are performed on Q and K, and the results are input into the SoftMax layer to obtain the relevance matrix A of the Q and K matrices; the relevance matrix A is then processed by the SoftMax layer. Q,K Performing another matrix dot product with matrix V yields the weighted output O of the self-attention structure; the formula is expressed as:
[0062]
[0063] O = A·V
[0064] In the formula d is the scaling factor. k The dimension of the K vector is d. k =64. The SoftMax operation is applied to each row to normalize the attention weights so that their sum is 1; V is also flattened into a two-dimensional matrix before computation. The output dimension is the same Then reshape it into a three-dimensional tensor.
[0065] S3: Input the result of the self-attention matrix calculation into the decoder G D Perform upsampling calculations and decode to the input size, as follows;
[0066] S3.1: A skip connection structure is introduced between the encoder and the decoder to directly pass the features of a certain scale of the encoder to the corresponding scale of the features in the decoder; the skip connection performs element-wise addition operation on the channel dimension between the feature map output by the intermediate layer of the encoder and the feature map of the same scale of the decoder.
[0067] S3.2: Input the globally weighted features output from the self-attention structure into the decoder G. D In the process, multi-stage upsampling operations are performed; the decoder G DThe feature map is gradually restored to the same spatial resolution as the input image by using upsampling and convolutional structures. At each stage, the decoder receives shallow features from skip connections as supplementary information and fuses context-aware features provided by the attention module.
[0068] S3.3: Perform feature synthesis on the calculated foreground layer f, background layer b, and mask layer m to obtain the reconstruction result. The formula is expressed as:
[0069]
[0070] In the formula, × represents matrix dot product.
[0071] S4: Decoder G D Reconstruction results Input discriminator D, and conduct adversarial training between the generator and the discriminator; in the inference scenario, step S4 is not required, and step S5 is performed directly;
[0072] Specifically, the generator G is an image reconstruction network that takes the latent representation z as input and outputs the reconstruction result. Discriminator D is a binary classification neural network used to distinguish whether the input image is a real sample x to p. data (x) is still the reconstruction result (generated sample). This process can be modeled using a mini-maximum game approach, with the following formula:
[0073]
[0074] In the formula, This indicates the expected calculation, where log is the natural logarithm function.
[0075] Calculate the training loss function; the complete loss function includes the context loss L. con Combating Losses L adv Potential losses L lat Binary loss L bin and mutual exclusion loss L excl The binary loss L bin During calculation, the denominator will be checked for zero. If it is zero, the denominator will be set to 1e-6 to ensure the feasibility of the calculation. The formula is expressed as:
[0076]
[0077] L excl =||Ψ(f,b)|| F +||Ψ(f,x)|| F
[0078]
[0079] In the formula, This represents the expectation calculation, |.|1 represents the L1 norm, D represents the discriminator, |.|2 represents the L2 norm, ∑ represents the summation operation, and λ con ,λ adv ,λ lat ,λ bin ,λ excl The hyperparameters representing the weights of each loss term, and Representing the horizontal and vertical gradients of image α, and Represents the horizontal and vertical gradients of image β, ⊙ denotes element-wise multiplication between matrices, and |.| F This refers to the Frobenius norm of the matrix, where W represents all the training parameters of the model. This indicates the optimization objective.
[0080] The defect identification stage includes the following steps:
[0081] S5: Compare the original image x with the reconstruction result from the image reconstruction module. The silhouette image sub is obtained by creating a silhouette; the formula is expressed as:
[0082]
[0083] In the formula, the subtraction is matrix subtraction, that is, subtracting the corresponding elements and taking the absolute value.
[0084] S6: Input the silhouette image sub into the defect discrimination model I, and output the final discrimination result based on the silhouette distribution, as follows;
[0085] S6.1: Input the silhouette image sub into defect detection module I;
[0086] The defect discrimination module consists of a lightweight discrimination network based on a ResNet50 pre-trained model on the ImageNet dataset, such as... Figure 4 As shown, ResNet50 introduces residual connections, enabling the network to directly learn the residual mapping between the input and the desired output. Its basic unit is a residual block, each of which includes three convolutional layers, and each layer is followed by batch normalization and an activation function (ReLU). While the input signal passes through the convolutional transformation path, it is also directly added to the convolutional output through an identity mapping path to form a residual fusion output.
[0087] S6.2: Input the residual fusion result after ResNet into the fully connected layer and output a single neuron as the classification result;
[0088] The output feature map of ResNet50 is subjected to global average pooling, then fed into a single fully connected layer, followed by a sigmoid activation function to generate the final discriminant value, with the output range limited to the [0,1] interval.
[0089] It should be noted that the above content merely illustrates the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. For those skilled in the art, various improvements and modifications can be made without departing from the principle of the present invention, and all such improvements and modifications fall within the scope of protection of the claims of the present invention.
Claims
1. A general unsupervised visual defect detection method based on hierarchical reconstruction, characterized in that: It is divided into two stages: image reconstruction and defect detection. The image reconstruction stage includes the following steps: S1: Transfer the original image Input image reconstruction module , First, through the encoder in the generator. Feature representation is obtained by downsampling calculation ; The image reconstruction module R adopts a hierarchical structure, consisting of three independent codecs. These three codecs have the same structure and are responsible for reconstructing the foreground layer f, background layer b, and mask layer m of the original image, respectively. The codecs do not share parameters. The encoder adopts a hierarchical coding strategy, extracting semantic features at different scales in each layer and passing the semantic features at different scales to the corresponding decoding stage through skip connections. S2: Feature representation obtained from the encoder through a self-attention structure Perform self-attention matrix calculation to obtain the global features of the input; S3: Input the result of the self-attention matrix calculation into the decoder Perform upsampling calculations to obtain the reconstruction results. ; S4: Reconstruct the results during training. Input the discriminator and calculate the discrimination result; use adversarial training between the generator and the discriminator to improve the reconstruction effect of the reconstruction module; during inference, there is no need to input the discriminator and directly enter S5; The defect identification stage includes the following steps: S5: Convert the original image Reconstruction results from the image reconstruction module Create a silhouette image ; S6: Convert the silhouette image Input defect discrimination model The final discrimination result is output based on the silhouette data distribution.
2. The general unsupervised visual defect detection method based on hierarchical reconstruction according to claim 1, characterized in that: For the image reconstruction stage, step S1 specifically includes the following steps: S1.1: Input the original image into the image reconstruction module The original images include defective and defect-free images. In training mode, defect-free images are used to allow the model to learn the distribution of defect-free samples. In inference mode, there is no restriction on whether defective images are used, and the model will output the discrimination result. S1.2: The foreground layer Background layer and mask layer The formula is expressed as: ; ; ; In the formula , , It consists of three independent codecs; S1.3: Input the image into the image reconstruction module Then, first through the encoder of the generator. Obtain the feature space representation of the input image ; S1.4: The encoder It consists of multiple convolutional layers, activation function layers, and normalization layers, and has the ability to extract deep semantic features of images.
3. The general unsupervised visual defect detection method based on hierarchical reconstruction according to claim 1, characterized in that: For the image reconstruction stage, step S2 specifically includes reconstructing the original image feature representation obtained by the encoder in step S1. Input self-attention structure; self-attention structure is used to compute self-attention matrix; self-attention matrix is composed of... , , composition, , , Represented by features The results were obtained after three independent convolutions; then... , Perform matrix dot product operations and input the results into the SoftMax layer to obtain... , Relevance matrix of the matrix ; relevance matrix and Perform a matrix dot product on the matrix again to obtain the weighted output of the self-attention structure. The formula is expressed as: ; ; In the formula This is the scaling factor. for Vector dimension, i.e. The SoftMax operation is applied to each row to normalize the attention weights so that their sum is 1. It was also flattened into a two-dimensional matrix form before calculation. The output dimensions are the same Then reshape it into a three-dimensional tensor. .
4. The general unsupervised visual defect detection method based on hierarchical reconstruction according to claim 1, characterized in that: For the image reconstruction stage, step S3 specifically includes the following steps: S3.1: Introduce a skip connection structure between the encoder and decoder to directly transmit the features of a certain scale of the encoder to the corresponding scale reconstruction path in the decoder; S3.2: Input the globally weighted features output from the self-attention structure into the decoder. In the process, multi-stage upsampling operations are performed to restore the original spatial resolution; S3.3: For the completed foreground layer Background layer and mask layer Feature synthesis is performed to obtain the reconstruction result. The formula is expressed as: ; In the formula This represents the matrix dot product.
5. The general unsupervised visual defect detection method based on hierarchical reconstruction according to claim 1, characterized in that: Regarding the image reconstruction stage, step S4 specifically includes: converting the reconstruction results into training mode. Input the discriminator and perform adversarial training between the generator and the discriminator, modeling the model using a mini-maximum game; the inference mode does not require step S4 and proceeds directly to step S5. Specifically, generator For image reconstruction networks, input latent representations Output the reconstruction results Discriminator This is a binary classification neural network used to distinguish whether an input image is a real sample. Or the result of reconstruction This process is modeled using a mini-maximum game approach, with the following formula: ; In the formula, This indicates the expected calculation. It is the natural logarithm function; Calculate the training loss function; the complete loss function includes the context loss. Combating losses Potential losses Binary loss and mutual exclusion loss ; including binary loss During calculation, the denominator will be checked for zero. If it is zero, the denominator will be set to 1e-6 to ensure the feasibility of the calculation. The formula is expressed as: ; ; ; ; ; ; ; In the formula, This indicates the expected calculation. Indicates representative Norm, Indicates the discriminator, Indicates representative Norm, This represents the summation operation. The hyperparameters representing the weights of each loss term, and Representative image Horizontal and vertical gradients, and Representing an image Horizontal and vertical gradients, This represents element-wise multiplication between matrices. It refers to the Frobenius norm of the matrix. This represents all the training parameters of the model. This indicates the optimization objective.
6. The general visual unsupervised defect detection method based on hierarchical reconstruction according to claim 1, characterized in that: Regarding the defect identification stage, step S5 specifically includes processing the original image... Reconstruction results from the image reconstruction module Perform silhouette calculations to obtain silhouette images The formula is expressed as: ; In the formula, the subtraction is matrix subtraction, that is, subtracting the corresponding elements and taking the absolute value.
7. The general unsupervised visual defect detection method based on hierarchical reconstruction according to claim 1, characterized in that: Regarding the defect identification stage, step S6 specifically includes the following steps: S6.1: Transform the silhouette image Input defect detection module The defect discrimination module consists of a lightweight discrimination network based on ResNet50 pre-trained on the ImageNet dataset, which outputs residual fusion features. S6.2: Input the residual fusion features after passing through ResNet into a fully connected layer and connect it to a single neuron as a classifier; output the final defect probability.
Citation Information
Patent Citations
Defect detection method based on generative adversarial network and attention
CN114943694A
Self-attention-based method for detecting defective area of color-textured fabric
WO2023070911A1