Double-branch reconstruction type image anomaly detection method for industrial quality inspection

By generating pseudo-abnormal samples and reconstructing their features using a dual-branch reconstruction network, the problem of detecting complex anomalies in existing technologies is solved, achieving efficient identification of logical and structural anomalies in industrial quality inspection and improving detection accuracy and generalization ability.

CN121330375APending Publication Date: 2026-01-13CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511501366.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing industrial quality inspection methods are ineffective at detecting complex logical and structural anomalies in scarce and uncertainly distributed images, especially those anomaly patterns that do not depend on obvious defects.

Method used

The SAM and LaMa models are used to generate pseudo-anomaly samples. The WideResNet50-2 network is used to extract features. The Butterworth high-pass filter and the dual-branch reconstruction network are combined to reconstruct the pseudo-anomaly features and high-frequency components, so as to achieve alignment and accurate localization between the anomaly and normal feature spaces.

Benefits of technology

It significantly improves the detection accuracy and generalization ability of complex anomaly patterns, and can identify structural and logical anomalies, thereby improving the intelligent detection performance of industrial quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330375A_ABST
    Figure CN121330375A_ABST
Patent Text Reader

Abstract

The invention relates to a double-branch reconstruction type image anomaly detection method for industrial quality inspection, and belongs to the field of anomaly detection. The method comprises the following steps: 1) carrying out pseudo-anomaly synthesis on an original industrial image, and constructing a training sample containing anomaly features; 2) adopting a pre-trained feature extraction network to perform feature extraction on the pseudo abnormal samples and the normal samples; 3) using a Butterworth high-pass filter to extract a high-frequency component of the pseudo abnormal sample; 4) constructing a double-branch reconstruction network, respectively reconstructing the pseudo-abnormal features and the high-frequency components, and realizing feature alignment and reconstruction of pseudo-abnormal data by taking normal sample feature distribution as a target; and 5) verifying the effectiveness of the proposed method in an anomaly detection task through a comparison experiment with a plurality of existing methods. The innovation point of the invention lies in providing a new pseudo-abnormal data generation mechanism, designing a space and high-frequency double-branch reconstruction network, and significantly improving the detection capability of structural and logic anomalies in industrial quality inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of anomaly detection and relates to a dual-branch reconstruction-based image anomaly detection method for industrial quality inspection. Background Technology

[0002] Image anomaly detection plays a crucial role in modern industrial quality inspection, significantly improving detection efficiency and effectively reducing labor costs while maintaining high accuracy. In contrast, traditional manual quality inspection methods heavily rely on human labor and experience, are susceptible to subjective judgment and operational fatigue, and carry the risk of missed detections and false detections. However, in real production environments, anomaly samples are often scarce, have uncertain distributions, and exhibit high diversity, making it difficult to widely apply supervised learning methods based on a large number of labeled samples in practical industrial scenarios. Therefore, current mainstream research is gradually shifting towards unsupervised learning methods, especially detection frameworks built based on strategies such as reconstruction, regression modeling, and feature embedding, which can achieve good generalization performance without the need for anomaly samples to participate in training.

[0003] While existing methods have made significant progress in detecting structural anomalies, such as obvious surface defects like scratches, contamination, and breakage, these methods often overlook deeper semantic and logical information within images. Logical anomalies refer to abnormal patterns that violate the semantic relationships or logical constraints between objects in a scene. Even if there are no obvious defects in a local area, such anomalies can disrupt the logical consistency of the overall structure due to issues like missing objects, duplicate assembly, or incorrect placement.

[0004] To address the aforementioned issues, this paper proposes a structural and logical dual-branch reconstruction-based image anomaly detection method for industrial quality inspection. This method aligns anomaly detection with normal features by synthesizing pseudo-anomaly samples and reconstructing them into normal features. Simultaneously, it interpolates the generated anomaly score map to the original image size for precise localization, thereby effectively improving anomaly detection capabilities. This method can detect not only surface defects at the structural level but also complex anomalies at the logical level, such as improper matching and missing components, significantly enhancing intelligent detection performance in industrial quality inspection scenarios. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a dual-branch reconstruction-based image anomaly detection method for industrial quality inspection.

[0006] To achieve the above objectives, the technical solution of the present invention is as follows:

[0007] A dual-branch reconstruction-based image anomaly detection method for industrial quality inspection includes the following steps:

[0008] Step 1: Use the SAM model and LaMa model to perform pseudo-anomaly synthesis at the structural and logical levels on the original normal industrial image to generate image samples containing pseudo-anomaly regions.

[0009] Step 2: Use the WideResNet50-2 network as a feature extractor to extract feature representations for normal images and pseudo-anomaly images respectively;

[0010] Step 3: Use a Butterworth high-pass filter to process the pseudo-anomaly image to extract its high-frequency components;

[0011] Step 4: Design a dual-branch reconstruction network to reconstruct the extracted pseudo-anomaly features and high-frequency components respectively, and map them to the normal feature space;

[0012] Step 5: Verify the effectiveness of the proposed method in image anomaly detection tasks through comparative experiments with other methods;

[0013] Furthermore, the specific process of step one includes:

[0014] The synthesis of pseudo-anomalies includes logical anomaly synthesis and structural anomaly synthesis. In logical anomaly synthesis, the Segment Anything Model (SAM) is used to automatically generate high-quality candidate component masks on the original normal image. These masks are then filtered and selected according to the required size. Then, morphological dilation operations are performed on these candidate masks:

[0015]

[0016] in The final mask after screening. For expansion, For radius r dil . structural elements.

[0017] After obtaining the candidate component mask Next, we construct a logic exception for component pasting. Specifically, we randomly sample the target placement region T within the image and perform a similarity / affine transformation φ on the mask and corresponding pixels. Simultaneously, we constrain the overlap ratio with the original position to not exceed a threshold, and the area change of the pasted component to not exceed a threshold, to avoid obviously unnatural overlaps or scale abrupt changes. Let the pasted mask be M. paste =1 T The pasted result image I is obtained. paste :

[0018]

[0019] To simultaneously cover both missing and replacement logical exceptions, for Ipaste The masked area is then subjected to another LaMa-based region inpainting to obtain the redrawn image. Finally, the original image and the redrawn image are fused using pixel-by-pixel multiplication (Hadamard product ⊙) to obtain a pseudo-logic anomaly image.

[0020]

[0021] In the synthesis of structural anomalies, we employ two types of operations: mask injection and cutPaste. Mask injection uses a randomly generated local mask R∈{0,1}. H×W Within the function, the original pixels are replaced with values ​​generated by the injection function g, thereby simulating local damage such as scratches, stains, and gaps, ultimately resulting in a pseudo-structural anomaly image.

[0022]

[0023] Where ⊙ is the Hadamard multiplication; c is a constant (for occlusion, c = 0 / gray); η is noise, and α controls the intensity. To obtain a natural boundary, R is slightly dilated and feathered, and the injection results are subjected to intensity trimming and a small amount of mixing.

[0024] Then we use CutPaste to randomly select two non-overlapping rectangular areas. And swap their pixels:

[0025]

[0026] To ensure that the model can learn logical and structural anomalies in a balanced way during training, the ratio of logical and structural anomalies introduced in each round of sample generation is set to 1:1.

[0027] Furthermore, the specific process of step two includes:

[0028] A WideResNet50-2 network is used as the feature extractor to extract feature representations from normal images and pseudo-anomaly images, respectively. Specifically, given an input image... A pre-trained WideResNet50-2 network is used as a feature extractor to obtain feature outputs at different levels:

[0029] F2, F3 = WideResNet50-2(I) | layer,layer

[0030] in, To achieve spatial consistency of features at different scales, bilinear interpolation is used to unify the features of the two layers to the same resolution (H). ′ W′ ):

[0031] F i ′ =Interp(F i ,(H ′ W ′ ),i∈{2,3}

[0032] Subsequently, the aligned features are stitched and fused along the channel dimension:

[0033]

[0034] Finally, channel compression and feature projection are performed using 1×1 convolution to obtain a fused feature representation with a target dimension of 512:

[0035]

[0036] Furthermore, the specific process of step three includes:

[0037] A Butterworth high-pass filter is used to perform frequency domain processing on the pseudo-anomaly image to extract its high-frequency components. Specifically, the input pseudo-anomaly grayscale image is transformed to the frequency domain using a two-dimensional Fast Fourier Transform (FFT), and the frequency domain matrix is ​​obtained through a spectrum center shift operation. Let the image size be H×W, and the spectrum center coordinates be (c H ,c w Based on this, a frequency domain distance function is defined:

[0038]

[0039] Where (u, v) are the frequency coordinates. Construct a Butterworth high-pass filter mask based on the distance function:

[0040]

[0041] Where D0 is the cutoff frequency, n is the filter order, and ε is a constant to prevent division by zero errors. By multiplying the mask point-by-point with the frequency domain matrix to retain high-frequency components, and then restoring it to the spatial domain using inverse Fourier transform (IFFT), a filtered image containing only high-frequency features is obtained. Finally, the output is converted to a single-channel tensor format for use as high-frequency feature input in the subsequent dual-branch reconstruction network. This high-pass filtering process effectively extracts edge texture and detail information from pseudo-anomaly samples, thereby highlighting local structural differences in anomaly regions.

[0042] Furthermore, the specific process of step four includes:

[0043] A dual-branch reconstruction network is designed to reconstruct the extracted pseudo-anomaly features and high-frequency components separately, mapping them to the normal feature space. This network aims to simultaneously recover the structural information and logical consistency of the image through multi-layer feature alignment and reconstruction constraints. The dual-branch reconstruction network includes a spatial reconstruction branch and a high-frequency reconstruction branch.

[0044] Spatial Reconstruction Branch: This branch employs a multi-scale autoencoder structure, with input being the pseudo-anomaly feature map obtained by the feature extractor. Then, a learnable 2D positional encoding layer is used to add positional information to the input features, giving the model spatial awareness. The encoder part then passes through multiple convolutional layers, batch normalization, and ReLU activation operations. Some convolutional layers use downsampling with a stride of 2 to acquire semantic features at different scales. The decoder part consists of deconvolutional upsampling layers and skip connections, used to restore spatial resolution and fuse intermediate features from the encoding stage, maintaining structural consistency. The feature projection layer uses 1×1 convolutions for channel mapping and dimensionality compression, outputting 1024 channels to form the semantic layer reconstructed feature representation.

[0045] High-frequency reconstruction branch: The high-frequency reconstruction branch adopts a convolutional autoencoder network structure, and its input is the pseudo-anomaly high-frequency component extracted by the Butterworth high-pass filter. The encoder consists of multiple convolutional blocks, each containing two convolutional layers and a group normalization (GroupNorm) operation. It also uses max pooling to downsample features and gradually extract texture features at different scales. The decoder gradually restores spatial resolution through deconvolutional upsampling layers and concatenates the features of the corresponding layers in each stage with those in the encoding stage to achieve detail reconstruction. The output projection layer uses 1×1 convolutions for channel mapping and outputs features with the same dimension as the semantic branch.

[0046] The spatial reconstruction branch and the high-frequency reconstruction branch work in parallel during the training phase, respectively outputting spatial reconstruction features. and high-frequency reconstruction features During the inference phase, the feature differences between the input pseudo-anomaly samples and the outputs of the two branches are calculated respectively, resulting in feature difference map a:

[0047]

[0048] Among them, F n The features of the original normal image are used. The resulting feature difference map A is interpolated to the original image resolution to generate the anomaly score map S.

[0049] S = Interp(A,H,W)

[0050] In image-level anomaly detection, the average of the k pixels with the highest response values ​​in the anomaly score map is taken to obtain the anomaly score for the entire image.

[0051]

[0052] When the score exceeds a preset threshold, the sample is determined to be an abnormal sample; otherwise, it is considered a normal sample, thereby achieving unified detection and location of anomalies.

[0053] Furthermore, the specific process of step five includes:

[0054] To verify the effectiveness of the proposed method, experiments were conducted on the MVTec LOCO AD and MVTec AD datasets. The experiments used image-level AUC (Area Under Curve) and pixel-level sPRO (Per-Region Overlap) metrics to evaluate the detection performance and compared it with several current state-of-the-art anomaly detection methods. Experimental results show that the proposed method exhibits significant advantages in logical anomaly detection tasks, outperforming existing methods in both overall detection accuracy and anomaly localization capability, fully validating the effectiveness and superiority of the proposed method. Furthermore, this experimental design not only comprehensively evaluates the performance of the method under different types of anomaly scenarios but also provides a reliable technical basis for its promotion in practical industrial quality inspection applications.

[0055] The beneficial effects of this invention are as follows: This invention proposes a bi-branch reconstruction-based image anomaly detection method for industrial quality inspection, which, compared with existing technologies, has advantages such as reasonable structure, high detection accuracy, and strong interpretability. Specifically, it includes: 1) By introducing the SAM model and the LaMa model, pseudo-anomalies are synthesized from the original normal industrial image, generating diverse anomaly samples from both structural and logical levels, thus improving the model's learning ability for complex anomaly patterns; 2) Using the synthesized pseudo-anomaly image, multi-scale features and high-frequency components are extracted, and both are used together for reconstruction training, thereby achieving full representation and learning of anomaly features; 3) A bi-branch reconstruction network is designed to reconstruct the extracted semantic features and high-frequency details respectively, and map them to the normal feature space, achieving collaborative detection of structural and logical anomalies. Through the above technical solutions, this invention can simultaneously identify explicit structural defects and potential logical anomalies in images, significantly improving the anomaly detection accuracy and generalization ability in industrial quality inspection scenarios.

[0056] The unique advantages, core objectives, and salient features of this invention will be gradually revealed in the following detailed description. For those skilled in the art, these highlights will naturally become clear after in-depth study, and may even provide further inspiration and understanding during the practical application of this invention. In short, the value and potential benefits of this invention will be fully revealed and verified in the following discussion. Attached Figure Description

[0057] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0058] Figure 1 This is a schematic flowchart of a two-branch reconstructive image anomaly detection method for industrial quality inspection.

[0059] Figure 2 The diagram shows the proposed bi-branch structure. Detailed Implementation

[0060] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0061] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0062] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0063] like Figure 1 As shown, this invention provides a dual-branch reconstruction-based image anomaly detection method for industrial quality inspection, applicable to product quality inspection in industrial production scenarios. By locating and detecting anomalies in acquired image data, it achieves the identification of structural defects and logical anomalies. The specific steps of this method include the following:

[0064] Using normal industrial images as training data, pseudo-anomalies are first synthesized from the normal samples to construct a hybrid anomaly sample set containing both logical and structural anomalies. This process aims to enable the model to simultaneously learn structural and semantic logical anomaly features during the training phase, thereby improving its ability to detect complex anomalies. The pseudo-anomaly synthesis includes the following two parts:

[0065] (1) Logical Anomaly Synthesis: Logical anomalies refer to situations where the semantic relationships or logical constraints between objects in an image are broken, such as missing parts, duplicate assembly, incorrect positioning, or improper logical matching. In this embodiment, the SAM (Segment Anything Model) model is used to generate a target region mask, and LaMa (Large Mask Inpainting Model) is used for image inpainting and content replacement. Specifically, by randomly selecting a semantic target region T in the image, a corresponding mask M is generated using SAM, and then the LaMa model is used to fill in the content or repair the structure in this region, forming a logical anomaly sample. This process can simulate logical anomalies caused by missing, incorrectly assembled, or displaced parts in real industrial scenarios.

[0066] (2) Structural Anomaly Synthesis: Structural anomalies refer to physical defects such as damage, contamination, or scratches in the local texture or geometric structure of an image. In this embodiment, local perturbation of the image is achieved through mask-based injection and cut-paste techniques. Mask-based injection is used to randomly insert noise blocks or different image fragments into the image region, thereby generating adhesive anomalies; cut-paste operation simulates structural misalignment or defects by randomly replacing different regions within the same image. This process can effectively simulate structural anomalies such as surface scratches, stains, and cracks commonly found in actual quality inspection.

[0067] To ensure that the model learns logical and structural anomalies in a balanced way during training, the ratio of logical to structural anomalies in each round of sample generation is set to 1:1. That is, in each batch of training samples, half of the samples are generated through logical anomaly synthesis, and the other half are generated through structural anomaly synthesis, thereby achieving balanced coverage of logical and structural anomalies in the overall training set.

[0068] After obtaining the pseudo-anomaly image, let the given normal image be I, where and its corresponding pseudo-anomaly image The feature extractor WideResNet50-2 was used to extract I and I respectively. Feature extraction is performed. Specifically, the WideResNet50-2 network is used as a pre-trained feature extractor to extract feature representations of the image at multiple scale layers (layer 2 and layer 3) to obtain feature maps containing mid-level structural information and high-level semantic information. Subsequently, to further enhance the model's ability to perceive details in abnormal regions, pseudo-abnormal images are processed. A Butterworth high-pass filter was used for frequency domain processing to extract its high-frequency components, which were then used to characterize edge, texture, and minute structural changes in the image.

[0069] Then, a dual-branch reconstruction network is designed to reconstruct the extracted pseudo-anomaly features and their high-frequency components separately, and map the reconstruction results to the normal feature space. The dual-branch reconstruction network includes a spatial reconstruction branch and a high-frequency reconstruction branch: the spatial reconstruction branch is used to recover the semantic structure of the pseudo-anomaly features, and the high-frequency reconstruction branch is used to recover the detailed texture of the pseudo-anomaly image. The two branches work in parallel during the training phase, and through multi-layer feature alignment and reconstruction constraints, the model can simultaneously maintain image structural information and logical consistency. During the inference phase, the feature reconstruction differences of the input pseudo-anomaly sample in the two branches are calculated to obtain the anomaly response map.

[0070]

[0071] Where, d n Features of the original normal image The spatial reconstruction result of pseudo-anomaly features This is the reconstruction result of the high-frequency components of the pseudo-anomaly. To achieve visualization and quantitative analysis of the anomaly region, the anomaly response map A is upsampled to the original image resolution using bilinear interpolation to obtain the anomaly score map S.

[0072] Then, based on the response intensity of the pixels in the anomaly score map, the overall anomaly score is calculated:

[0073]

[0074] in, This represents the anomaly response values ​​of the top k pixels in the anomaly score map. By taking the average of the top-k responses as the anomaly score for the entire image, the influence of noise can be effectively suppressed and the main anomaly areas highlighted. When S... img When a sample exceeds a set threshold, it is determined to be an abnormal sample. This process enables unified detection and localization of structural and logical anomalies.

[0075] To verify the effectiveness and superiority of the method of this invention, experiments were conducted on the MVTec LOCO AD dataset and the MVTec AD dataset. The experiments selected these two publicly available industrial visual anomaly detection datasets, which respectively include logical anomaly scenarios and structural anomaly scenarios, enabling a comprehensive evaluation of the detection performance of the method under different anomaly types. The experimental evaluation metrics used were image-level AUC (Area Under the Curve) and pixel-level sPRO (Per-RegionOverlap): image-level AUC measures the method's ability to distinguish between normal and abnormal images at the sample level; pixel-level sPRO evaluates the model's accuracy and coverage in anomaly region localization.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

[0077] like Figure 2 As shown, this invention proposes a dual-branch reconstruction structure. This structure, based on the introduction of pseudo-anomaly synthesis, freezes the feature extractor, using it only for feature extraction; subsequently, the pseudo-anomaly features are input into two corresponding sub-networks (a spatial reconstruction network and a high-frequency reconstruction network). The spatial reconstruction network receives the semantic features of the pseudo-anomaly image as input, while the high-frequency reconstruction network receives the high-frequency components of the pseudo-anomaly image as input. The two branches jointly optimize four loss functions to achieve accurate modeling and recovery of structural and logical anomalies.

[0078] Loss of the spatial reconstruction branch. The first half of the features used to reconstruct the network output for constrained spatial feature reconstruction Consistency with the original normal feature F:

[0079]

[0080] High-frequency branching loss. Used to constrain the output of high-frequency reconstruction networks Align with the original normal feature F:

[0081]

[0082] Cross-branch consistency loss. To enhance the synergy between semantic branches and high-frequency branches and prevent them from shifting during training, a cross-branch consistency loss is defined.

[0083]

[0084] Contrast Loss. To enhance the discriminative power of pseudo-anomalies, a sample-level contrastive loss based on the InfoNCE form is further introduced. This loss is primarily used to robusten difficult samples:

[0085]

[0086] Among them, F anom Indicates pseudo-anomaly features, This indicates the characteristics of the spatial reconstruction branch.

Claims

1. A dual-branch reconstruction-based image anomaly detection method for industrial quality inspection, characterized in that, The method includes the following steps: Step 1: Use the SAM model and LaMa model to perform pseudo-anomaly synthesis at the structural and logical levels on the original normal industrial image to generate image samples containing pseudo-anomaly regions. Step 2: Use the WideResNet50-2 network as a feature extractor to extract feature representations for normal images and pseudo-anomaly images respectively; Step 3: Use a Butterworth high-pass filter to process the pseudo-anomaly image to extract its high-frequency components; Step 4: Design a dual-branch reconstruction network to reconstruct the extracted pseudo-anomaly features and high-frequency components respectively, and map them to the normal feature space; Step 5: Verify the effectiveness of the proposed method in image anomaly detection tasks through comparative experiments with other methods.

2. The dual-branch reconstruction-based image anomaly detection method for industrial quality inspection according to claim 1, characterized in that: The pseudo-anomaly synthesis of the structural and logical layers in step one Includes the following processes: For input normal images Several masks {M} are generated using the SAM model. i }, where M i ∈{0,1} H×W Each mask is filtered to obtain candidate component masks. Subsequently, a target region T is randomly selected within the image, and pixel replacement is performed on the mask region through a similarity / affine transformation φ to construct a pasted pseudo-anomaly image. The pasted mask is denoted as M. paste =1 T The pasted result image I is obtained. paste : Then, for image I paste The masked region is inpainted based on the LaMa model to obtain the redrawn image. To merge the original image and the repaired area, a pixel-wise multiplication operation (Hadamard product) is used to fuse the original image and the redrawn image, resulting in a pseudo-logical anomaly image. The above operations yield synthesized logical anomaly images. For structural anomaly synthesis, mask injection and cut-paste methods are used to generate structural anomaly samples. During training data construction, logical anomaly samples and structural anomaly samples each account for half of the total samples to ensure balanced learning of the two types of anomaly features during model training.

3. The dual-branch reconstruction-based image anomaly detection method for industrial quality inspection according to claim 2, characterized in that: The feature extraction in step two includes: A pre-trained WideResNet50-2 is used as the feature extractor to perform forward computation on the original normal image and the pseudo-abnormal image before synthesis to obtain their multi-scale features, which include the outputs of the network's layer 2 and layer 3. The multi-scale features are then interpolated and aligned to a uniform spatial resolution before being concatenated at the channel level, and the concatenation result is subjected to local smoothing pooling. Subsequently, 1×1 convolution is used to perform channel projection / dimensionality reduction to obtain the fused feature representation, which serves as the input to the subsequent dual-branch reconstruction module.

4. The dual-branch reconstruction-based image anomaly detection method for industrial quality inspection according to claim 3, characterized in that: Step three includes: using a Butterworth high-pass filter to process the pseudo-anomaly image in the frequency domain to extract its high-frequency components; specifically, the gray-level components of the pseudo-anomaly image are transformed to the frequency domain space by a two-dimensional fast Fourier transform (FFT), and the frequency domain matrix is ​​obtained by shifting the center of the spectrum; in the frequency domain, a Butterworth high-pass filter mask is constructed according to the following formula.

5. The dual-branch reconstruction-based image anomaly detection method for industrial quality inspection according to claim 4, characterized in that: The two-branch reconstruction network in step four includes a first reconstruction branch and a second reconstruction branch: The first reconstruction branch is used to reconstruct the extracted pseudo-anomaly features into corresponding normal feature representations; in this spatial feature reconstruction branch, the intermediate layer feature map extracted by the feature extractor after pseudo-anomaly synthesis of the given input image is denoted as... First, perform positional encoding on the input features and then sum them to obtain the positional embedding features. Residual reconstruction is then employed, with the encoder-decoder network outputting the final reconstructed features. The encoder consists of two 3×3 convolutional layers (stride s=2, padding p=1) followed by batch normalization (BN) and ReLU activation. The decoder consists of two 4×4 deconvolutional layers (stride s=2, padding p=1), also followed by BN and ReLU operations. To improve the continuity and detail preservation of feature reconstruction, element-wise skip connections are made between the corresponding layers in the encoder at spatial dimensions of 32×32 and 64×64 during the decoding stage, respectively, to achieve feature fusion and context compensation. The second reconstruction branch is used to reconstruct the extracted high-frequency components into normal features consistent with normal samples, thereby aligning abnormal features to the normal feature space. For this high-frequency reconstruction branch, the high-frequency enhanced grayscale image obtained by Butterworth high-pass filtering is... The data is fed into the global branch, resulting in a globally reconstructed feature of the same size as the teacher's feature.

6. The dual-branch reconstruction-based image anomaly detection method for industrial quality inspection according to claim 5, characterized in that: The experimental comparison in step five: Several existing logical anomaly detection methods were selected as comparison objects, and their performance was evaluated by comparing them under the same industrial image dataset and experimental environment. The image-level AUC index was used to measure the overall anomaly recognition capability, and the pixel-level sPRO index was used to evaluate the localization accuracy of the anomaly region.

Citation Information

Cited By

  • A referenceless quality assessment method and system for substation scene images

    CN122493206A