A multi-class anomaly detection method based on wavelet perceptual bias correction diffusion

By employing a wavelet sensing bias correction diffusion method, combined with latent space modeling and wavelet dual-schedule mask forward diffusion, gated detail residual enhancement, and deterministic reverse bias correction, the problem of insufficient detection accuracy and robustness in multi-category scenarios is solved, achieving high-precision anomaly detection and localization.

CN122637048BActive Publication Date: 2026-11-06SHANDONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610760049.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-11-06
Estimated Expiration
2046-05-29

AI Technical Summary

Technical Problem

Existing technologies struggle to balance appearance differences and anomaly sensitivity across various scenarios, resulting in limited detection accuracy, insufficient detail preservation, and inadequate robustness. They are particularly ineffective in detecting weak texture anomalies and boundary defects.

Method used

A wavelet-based perceptual bias correction diffusion method is adopted, which combines latent space modeling, wavelet dual-scheduling mask forward diffusion, gated detail residual enhancement, and deterministic reverse bias correction to achieve high-precision detection and localization of abnormal regions in multi-category industrial images.

Benefits of technology

It improves the accuracy and stability of multi-category anomaly detection, enhances the detection and localization capabilities of fine-grained texture defects and weak boundary anomalies, and is suitable for scenarios such as industrial surface defect detection, automated visual quality inspection, and intelligent manufacturing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122637048B_ABST
    Figure CN122637048B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on wavelet perceptual deviation correction diffusion multi-class abnormality detection method, belong to industrial intelligent detection field.First, the original industrial image is mapped to latent space representation by pre-training VAE encoder.Second, latent space features are decomposed by discrete wavelet, which are divided into low-frequency structural components and high-frequency detail components;For two kinds of frequency components, design double scheduling mask forward diffusion mechanism, and combine wavelet gated detail residual branch, enhance and correct high-frequency abnormal related texture and boundary information, improve the accuracy and stability of abnormal region correction in multi-class scene.Reconstruct the corresponding normal representation through deterministic reverse bias correction process, fuse latent space difference and image space difference to generate anomaly map, realize anomaly detection and positioning.The method maintains normal texture and structure information while enhancing the detection capability of fine-grained anomalies, weak texture defects and boundary defects, suitable for industrial surface defects, intelligent quality inspection and other scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial intelligent detection technology, specifically relating to a multi-category anomaly detection method based on wavelet sensing deviation correction diffusion. Background Technology

[0002] Anomaly detection is a key technology in computer vision and industrial intelligent inspection, widely used in industrial quality inspection, defect identification, surface inspection, and other scenarios. The goal of anomaly detection is to establish a normal distribution model using normal samples to identify and detect abnormal regions in test images.

[0003] Traditional methods, such as reconstruction, embedding, and synthetic anomaly detection methods, achieve good anomaly detection performance in single-class scenarios. However, with the increasing number of categories and texture complexity in industrial inspection tasks, existing methods face the following problems: 1) Limited detection accuracy: In multi-class scenarios, normal distribution becomes more complex, making it difficult for existing methods to simultaneously consider the appearance differences and anomaly sensitivity between different categories. 2) Insufficient detail preservation: Existing diffusion anomaly detection methods typically employ uniform perturbation and correction mechanisms, which can easily cause unnecessary changes to normal texture details and boundary structures, leading to a decrease in fine-grained anomaly localization capabilities. 3) Insufficient robustness: For weak texture anomalies and boundary defects, high-frequency anomaly information is easily over-smoothed during reconstruction or correction, thus affecting the stability and accuracy of anomaly detection results.

[0004] To address the aforementioned issues, a multi-category anomaly detection method based on wavelet sensing deviation correction diffusion is proposed, with optimized designs for everything from frequency component modeling to the anomaly correction process. Summary of the Invention

[0005] To address the problems of insufficient preservation of local details, inadequate frequency information modeling, and low anomaly detection accuracy in multi-category scenarios in existing technologies, this invention proposes a multi-category anomaly detection method based on wavelet perception bias correction diffusion. This method combines latent space modeling, wavelet dual-scheduling mask forward diffusion, gated detail residual enhancement, and deterministic reverse bias correction to achieve high-precision detection and localization of abnormal regions in multi-category industrial images. The design is reasonable, overcomes the shortcomings of existing technologies, and has good results.

[0006] A multi-class anomaly detection method based on wavelet sensing bias correction diffusion includes the following steps: Step 1: Obtain the latent space representation of the image by encoding the input image; Step 2: Wavelet decomposition is used to separate the low-frequency and high-frequency components of the latent space representation obtained in Step 1, and different diffusion perturbation strategies are designed for each component to construct a frequency-aware forward diffusion process, thereby generating the noisy latent space representation and the deviation direction supervision target required for subsequent deviation direction learning. Step 3: Using the noisy latent space representation constructed in Step 2, the main deviation direction is predicted by the main deviation direction prediction network, and the deviation direction related to high-frequency details is compensated by the wavelet-gated detail residual branch to obtain the final deviation direction prediction result. Step 4: Using the deviation direction prediction results obtained in Step 3, normal representation reconstruction is achieved through a deterministic reverse deviation correction process. Combined with latent space differences and image space differences, anomaly detection and anomaly map generation are achieved in the input image.

[0007] Further, step 1 includes the following sub-steps: Step 1.1: Acquire the original industrial image and perform scale unification processing on the original industrial image; Step 1.2: Input the processed industrial image data into the pre-trained VAE encoder and map it into a low-dimensional latent space to obtain the latent space representation. .

[0008] Furthermore, step 2 includes the following sub-steps: Step 2.1: The latent space representation is decomposed into low-frequency and high-frequency components using discrete wavelet transform, specifically as follows: Let the latent space be represented as ,in Indicates the number of channels. and Let represent the height and width of the latent space representation, respectively, and assume... and All numbers are even; firstly, the latent space representation is divided into four spatial sub-blocks using a 2×2 step sampling method. The low-frequency and high-frequency components are represented as follows: ; ; ; ; in, For low-frequency structural components, , and For high-frequency detail components; The three high-frequency subbands are spliced ​​along the channel dimension to obtain the aggregated high-frequency detail components. : ; Step 2.2: Set different forward diffusion scheduling strategies for the low-frequency structural components and the aggregated high-frequency detail components, where the low-frequency components are used to maintain global structural stability, and the high-frequency components are used to enhance local texture and boundary perturbations; Step 2.3: Inject noise into the low-frequency structural components and the aggregated high-frequency detail components respectively to form corresponding low-frequency disturbance components. and high-frequency disturbance components , is represented as: ; ; in, This represents the cumulative scheduling coefficient at diffusion step t. and These represent random noise injected into the low-frequency and high-frequency components, respectively. Step 2.4: Reconstruct the low-frequency and high-frequency perturbation components using inverse wavelet transform to obtain the candidate perturbation latent space representation. ; Step 2.5: Introduce a latent space block binary masking mechanism to fuse the candidate perturbation latent space representation with the original latent space representation, perturbing only local regions to obtain a noisy latent space representation. The expression is: ; in, This represents element-wise multiplication. Represents a latent space block binary mask. This represents the region complementary to the mask; Step 2.6: Based on the noisy latent space representation Construct a learning objective for the deviation direction, specifically as follows: Let the direction of the true deviation be... Then the noisy latent space representation can be expressed as: ; Among them, the direction of true deviation This refers to the deviation direction monitoring target during the training phase.

[0009] Furthermore, step 3 includes the following sub-steps: Step 3.1: Represent the noisy latent space using a backbone bias direction prediction network. Determine the direction of the main deviation. predict; Step 3.2: Compensate for the bias direction related to high-frequency details using wavelet-gated detail residual branch. Specifically, perform discrete wavelet transform again on the noisy latent space representation to decompose it into low-frequency and high-frequency components, and then perform high-frequency subband splicing to obtain the low-frequency structural components in the current state. and the aggregated high-frequency detail components ; Step 3.3: Generate the gate vector based on the low-frequency structural components, specifically as follows: For low-frequency structural components Perform global average pooling and two fully connected layers of mapping to obtain the gated vector. The expression is: ; in, This indicates a global average pooling operation. and These represent the first fully connected layer and the second fully connected layer, respectively. express Activation function express Activation function This represents the gated vector generated by the low-frequency structural components; Step 3.4: Apply gated weighting to the aggregated high-frequency detail components using gated vectors to obtain the enhanced high-frequency representation. The expression is: ; Step 3.5: Reconstruct the enhanced high-frequency representation and low-frequency structural components using inverse wavelet transform, and then pass them through a 1×1 convolutional layer. High-frequency residual compensation term obtained The expression is: ; Step 3.6: Fuse the main deviation direction prediction result with the high-frequency detail residual compensation term to obtain the final deviation direction prediction result. ; Step 3.7: Use the true deviation direction during the training phase. Prediction results of the final deviation direction For supervision, the objective function is expressed as: ; In the wavelet domain, weighted constraints are applied to the low-frequency and high-frequency deviation direction errors respectively, and the loss function is... Represented as: ; in, and These represent the components of the true deviation direction in the low-frequency and high-frequency domains, respectively. and These represent the components of the prediction bias direction in the low-frequency and high-frequency domains, respectively. and These represent the weighting coefficients for low-frequency and high-frequency terms, respectively.

[0010] Furthermore, step 4 includes the following sub-steps: Step 4.1: Acquire the image to be detected The latent space representation is obtained through a pre-trained VAE encoder. Input the main deviation direction prediction network and the wavelet-gated detail residual branch to obtain the final deviation direction prediction result. ; Step 4.2: Perform deterministic back bias correction based on the final bias direction prediction result to obtain the corrected latent space representation, specifically: Calculate the estimated normal potential space at the current moment based on the final deviation direction prediction results. The expression is: ; The deterministic back bias correction update expression from diffusion step t to diffusion step t−1 is: ; in, This represents the normal latent space representation estimated at the current time. This represents the corrected latent space representation for the next time step. Step 4.3: Decode the corrected latent space representation using the pre-trained decoder to obtain the normally reconstructed image. ; Step 4.4: Calculate the image spatial difference and latent space difference respectively. The image spatial difference is derived from the image to be detected. Compared with normal reconstructed images The difference is obtained, and the latent space difference is represented by the original latent space. With the corrected latent space representation The difference was obtained; Step 4.5: Fuse image spatial differences and latent spatial differences to obtain the final anomaly map. : ; in, This represents the latent space difference clipping threshold. Indicates the image spatial difference cropping threshold; Spatial aggregation is performed on the anomaly map to obtain an image-level anomaly score, which is used to determine whether there are anomalies in the image to be detected.

[0011] The beneficial technical effects of this invention are as follows: 1) Improved detection accuracy: By decoupling low-frequency and high-frequency components in modeling, the ability to differentiate structural and detail information is enhanced, improving the accuracy of multi-class anomaly detection; 2) Enhanced fine-grained localization capability: Through wavelet dual-scheduling perturbation and gated detail residual compensation mechanism, the detection and localization capability of fine texture defects and weak boundary anomalies is effectively improved; 3) Improved algorithm robustness: Through local mask perturbation and frequency-aware bias correction, the erroneous modification of normal areas during diffusion reconstruction is reduced, improving stability in multi-class complex scenarios; 4) Expanded application scenarios: This method is applicable to scenarios such as industrial surface defect detection, automated visual quality inspection, and intelligent manufacturing inspection, especially showing excellent performance in multi-class unsupervised anomaly detection tasks. Attached Figure Description

[0012] Figure 1 This is a diagram of the multi-class anomaly detection framework based on wavelet sensing deviation correction diffusion in this invention; Figure 2 This is a schematic diagram of the wavelet dual-scheduling mask forward diffusion construction in this invention; Figure 3 This is a schematic diagram of the wavelet-gated detail residual branch in this invention; Figure 4 This is an example of the anomaly heatmap effect on the test set in this invention; Detailed Implementation

[0013] The specific embodiments of the present invention will be further described below with reference to specific examples: A multi-class anomaly detection method based on wavelet sensing bias correction diffusion, such as Figure 1 As shown, the method includes a training phase and an inference phase. The training phase utilizes normal samples to construct a bias direction learning mechanism in the latent space. The inference phase uses the trained model to perform reverse bias correction on the image to be detected and combines latent space differences with image space differences to generate anomaly maps, achieving anomaly detection and localization in multi-class scenarios. The method mainly includes the following steps: This method mainly includes the following steps: Step 1: Encode the input image to obtain its latent space representation; this reduces data dimensionality and computational complexity while preserving structural information and texture details in the image. This step effectively reduces the computational overhead of subsequent diffusion calculations while retaining key anomaly-related features in the original image.

[0014] In this step, the input industrial image is first acquired and then preprocessed uniformly. Preferably, the input image is scaled and then cropped to a fixed resolution to ensure that images of different categories can be modeled at a uniform spatial scale. Then, the preprocessed input image is input into a pre-trained VAE encoder to obtain the corresponding latent space representation. The pre-trained VAE encoder is a variational autoencoder (VAE) with pre-trained and frozen parameters, used to map the original image into a low-dimensional latent space representation. This reduces the computational complexity of subsequent diffusion modeling and bias correction processes while preserving the main structural and texture details in the image.

[0015] Specifically, step 1 includes the following sub-steps: Step 1.1: Acquire raw industrial images The original industrial images were scaled uniformly. Step 1.2: Input the processed industrial image data into the pre-trained VAE encoder. Mapping to a low-dimensional latent space yields the latent space representation. The expression is: ; Representing the latent space It serves as the input for the subsequent wavelet dual-scheduling mask forward diffusion process to complete the frequency-aware bias modeling in the latent space.

[0016] Step 2: Wavelet dual-scheduling mask forward diffusion construction; like Figure 2 As shown, wavelet decomposition is used to process the latent space representation obtained in step 1. Low-frequency and high-frequency components are separated, and different diffusion perturbation strategies are designed for each component to construct a frequency-aware forward diffusion process, generating the noisy latent space representation and the deviation direction supervision target required for subsequent deviation direction learning. Wavelet dual-scheduling mask forward diffusion can ensure that the structural information remains stable, while enhancing the sensitivity to high-frequency anomaly details.

[0017] Step 2 includes the following sub-steps: Step 2.1: The latent space representation is decomposed into low-frequency and high-frequency components using discrete wavelet transform, specifically as follows: A two-dimensional Haar discrete wavelet transform is employed. The latent space is denoted as... ,in Indicates the number of channels. and Let represent the height and width of the latent space representation, respectively, and assume... and All numbers are even; firstly, the latent space representation is divided into four spatial sub-blocks using a 2×2 step sampling method. Using a 2×2 step sampling method to sample the latent space When dividing the space into four sub-blocks, the following rules apply: This indicates the sub-block located in the upper left corner of the latent space after sampling; This indicates the sub-block located in the upper right corner of the latent space after sampling; This indicates the sub-block located in the lower left corner of the latent space after sampling; This represents the sub-block located in the lower right corner of the latent space after sampling. The low-frequency and high-frequency components are then represented as follows: ; ; ; ; in, These are low-frequency structural components used to describe the overall contour and global structure of an image; , and High-frequency detail components are used to describe the local texture, edges, and fine-grained details of an image. To facilitate subsequent unified processing, the three high-frequency subbands are spliced ​​along the channel dimension to obtain the aggregated high-frequency detail components. : ; Step 2.2: Set different forward diffusion scheduling strategies for the low-frequency structural components and the aggregated high-frequency detail components to form a dual-scheduling forward diffusion mechanism.

[0018] Considering that low-frequency structural components primarily determine the overall appearance and contour stability of normal samples, while high-frequency detail components are more likely to carry information about local texture anomalies, weak boundary anomalies, and fine-grained defects, this invention does not employ a uniform forward perturbation method to process both. Instead, it sets different perturbation scheduling strategies for each. Preferably, a first diffusion scheduling is used for low-frequency components to maintain global structural stability as much as possible; a second diffusion scheduling is used for high-frequency components to enhance the sensitivity to perturbations of local textures and boundary details. In the implementation, the first diffusion scheduling is a square cosine scheduling, and the second diffusion scheduling is a linear scheduling.

[0019] Step 2.3: Inject noise into the low-frequency structural components and the aggregated high-frequency detail components respectively to form corresponding low-frequency disturbance components. and high-frequency disturbance components , is represented as: ; ; in, This represents the cumulative scheduling coefficient at diffusion step t. and These represent random noise injected into the low-frequency and high-frequency components, respectively. By using the above method, the low-frequency structural components and high-frequency detail components can have different degradation rates and sensitivities during forward perturbation.

[0020] Step 2.4: Reconstruct the low-frequency and high-frequency perturbation components using inverse wavelet transform to obtain the candidate perturbation latent space representation. ; The low-frequency disturbance component obtained in step 2.3 and high-frequency disturbance components Inverse wavelet transform Reconstructing as a candidate perturbation latent space representation The expression is: ; Step 2.5: Use a latent space block binary mask to fuse the candidate perturbation latent space representation with the original latent space representation, perturbing only local regions to obtain a noisy latent space representation. This preserves the visible, normal context information; To avoid excessive destruction of normal context information due to uniformly applying perturbations to the entire latent space region, this invention further introduces a latent space block binary masking mechanism. Let the generated binary mask be... The final noisy latent space representation is then... Represented as: ; in, This represents element-wise multiplication. Represents a latent space block binary mask. The region is complementary to the mask; this expression means that candidate perturbation results are retained only in the local regions selected by the mask, while the original latent space representation is retained in the unselected regions. This allows us to retain visible normal contextual information while constructing training perturbation samples.

[0021] Step 2.6: Based on the noisy latent space representation A deviation direction learning objective is constructed to provide a supervisory signal for subsequent deviation prediction, specifically as follows: During the training phase, instead of directly predicting the anomaly category label, the deviation direction of the current perturbation latent space relative to the normal latent space is predicted. Let the true deviation direction be... Then the noisy latent space representation can be expressed as: ; Among them, the direction of true deviation This refers to the bias direction supervision target during the training phase, used for supervised learning of the subsequent bias direction prediction network. It should be noted that the bias direction supervision target is the true bias direction. The monitoring signal is not obtained through manual annotation, but is automatically constructed from the forward perturbation process.

[0022] Step 3: Using the noisy latent space representation constructed in Step 2, design a backbone deviation direction prediction network and high-frequency detail residual compensation. Input the noisy latent space representation into the backbone deviation direction prediction network to predict the deviation direction of the current latent space state relative to the normal latent space distribution. At the same time, use wavelet-gated detail residual branches to compensate for the deviation direction related to high-frequency details, so as to improve the modeling ability of fine-grained anomalous regions and predict the anomalous related feature representation, i.e., the deviation direction. Step 3 includes the following sub-steps: Step 3.1: Represent the noisy latent space using a backbone bias direction prediction network. Predict the direction of the main deviation; The deviation direction prediction network is a U-Net network with time-step embedding. Let the deviation direction prediction network be... The prediction result of the main deviation direction is expressed as: ; in, This represents the noisy latent space representation under the current diffusion step. Indicates the corresponding diffusion time step. This represents the deviation direction prediction result output by the backbone network.

[0023] Step 3.2: Compensate for the bias direction related to high-frequency details using wavelet-gated detail residual branching, such as... Figure 3 As shown, specifically: the noisy latent space representation is decomposed into low-frequency and high-frequency components by discrete wavelet transform again, and then high-frequency subbands are spliced ​​together to obtain the low-frequency structural components in the current state. and the aggregated high-frequency detail components ; Let the current latent space be represented as Wavelet transform yields: ; By splicing the three high-frequency subbands along the channel dimension, we obtain the aggregated high-frequency representation in the current state: ; in, This represents the low-frequency structural components in the current state. This represents the high-frequency detail components in the current state.

[0024] Step 3.3: Generate the gate vector based on the low-frequency structural components, specifically as follows: In order to utilize low-frequency structural information to guide the enhancement process of high-frequency detail components, the low-frequency structural components... Perform global average pooling and two fully connected layers of mapping to obtain the gated vector. The expression is: ; in, This indicates a global average pooling operation. and These represent the first fully connected layer and the second fully connected layer, respectively. express Activation function express Activation function This represents the gated vector generated by the low-frequency structural components; Step 3.4: Apply gated weighting to the aggregated high-frequency detail components using gated vectors to obtain the enhanced high-frequency representation. The expression is: ; This method allows the high-frequency detail enhancement process to be guided by low-frequency structural information, thereby reducing irrelevant high-frequency disturbances and highlighting anomalously relevant textures and boundary information.

[0025] Step 3.5: Reconstruct the enhanced high-frequency representation and low-frequency structural components using inverse wavelet transform, and then pass them through a 1×1 convolutional layer. High-frequency residual compensation term obtained The expression is: ; Step 3.6: Predict the direction of the main deviation. High-frequency detail residual compensation term The results are fused to obtain the final deviation direction prediction result. : ; Step 3.7: Use the true deviation direction during the training phase. Prediction results of the final deviation direction For supervision, the objective function is expressed as: ; To enhance the ability to model the differences between low-frequency structures and high-frequency details, weighted constraints are applied to the low-frequency and high-frequency deviation direction errors in the wavelet domain, respectively, and the loss function is... Represented as: ; in, and These represent the components of the true deviation direction in the low-frequency and high-frequency domains, respectively. and These represent the components of the prediction bias direction in the low-frequency and high-frequency domains, respectively. and These represent the weighting coefficients for low-frequency and high-frequency terms, respectively.

[0026] Step 4: Using the deviation direction prediction results obtained in Step 3, normal representation reconstruction is achieved through a deterministic reverse deviation correction process. Combined with latent space differences and image space differences, anomaly detection and anomaly map generation are achieved in the input image.

[0027] Specifically, it includes the following sub-steps: Step 4.1: In the inference phase, acquire the image to be detected. Through pre-trained VAE encoder Obtain the latent space representation : ; Representing the latent space Input the main deviation direction prediction network and the wavelet-gated detail residual branch to obtain the final deviation direction prediction result. ; Step 4.2: Perform deterministic reverse bias correction based on the final bias direction prediction result to obtain the corrected latent space representation, in order to restore a latent space representation that is closer to the normal distribution. Specifically: Calculate the estimated normal potential space at the current moment based on the final deviation direction prediction results. The expression is: ; The deterministic back bias correction update expression from diffusion step t to diffusion step t−1 is: ; in, This represents the normal latent space representation estimated at the current time. This represents the corrected latent space representation for the next time step. Step 4.3: Decode the corrected latent space representation using the pre-trained decoder to obtain the normally reconstructed image. ; Let the pre-trained decoder be Then the image is reconstructed normally. Represented as: ; Step 4.4: Calculate the image spatial difference and latent space difference respectively. The image spatial difference is derived from the image to be detected. Compared with normal reconstructed images The difference is obtained, and the latent space difference is represented by the original latent space. With the corrected latent space representation The differences are obtained; in order to suppress the influence of extreme values ​​on the abnormal map generation results, threshold clipping can be performed on the image spatial differences and latent space differences respectively.

[0028] Step 4.5: Fuse image spatial differences and latent spatial differences to obtain the final anomaly map. : ; in, This represents the latent space difference clipping threshold. The image spatial difference cropping threshold is represented; the latent spatial difference is upsampled to a scale consistent with the image resolution and then fused with the image spatial difference to obtain an anomaly map for pixel-level anomaly localization; the anomaly map is spatially aggregated to obtain an image-level anomaly score, which is used to determine whether there is an anomaly in the image to be detected.

[0029] The method of this invention is trained on a training set containing only normal samples and validated on a test set containing both normal and abnormal samples. The MVTec-AD and VisA datasets were selected for the test to verify the effectiveness of the method in multi-class unsupervised anomaly detection scenarios. During the training phase, a deviation direction supervision target is constructed by performing wavelet dual-schedule mask forward perturbation on the latent space of normal samples, and a deviation correction mechanism that regresses from the perturbed state to the normal state is jointly learned using a deviation direction prediction network and a wavelet-gated detail residual branch. During the testing phase, a deterministic reverse deviation correction process is used to gradually restore the latent space representation of the image to be detected to a position closer to the normal distribution, and the final anomaly map is output by combining latent space differences and image spatial differences, as shown below. Figure 4 As shown, it enables multi-category anomaly detection and localization.

[0030] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A multi-class anomaly detection method based on wavelet perceptual bias correction diffusion, characterized by, Includes the following steps: Step 1: Obtain an image latent space representation by encoding an input image ; Step 2: Wavelet decomposition is used to separate the low-frequency and high-frequency components of the latent space representation obtained in Step 1, and different diffusion perturbation strategies are designed for each component to construct a frequency-aware forward diffusion process, thereby generating the noisy latent space representation and the deviation direction supervision target required for subsequent deviation direction learning. Step 3: Using the noisy latent space representation constructed in Step 2, the main deviation direction is predicted by the main deviation direction prediction network, and the deviation direction related to high-frequency details is compensated by the wavelet-gated detail residual branch to obtain the final deviation direction prediction result. Step 4: Using the deviation direction prediction results obtained in Step 3, normal representation reconstruction is achieved through a deterministic reverse deviation correction process. Combined with latent space differences and image space differences, anomaly detection and anomaly map generation are achieved in the input image. Step 3 includes the following sub-steps: Step 3.1: Predicting the backbone bias direction using the backbone bias direction prediction network on the noisy latent space representation Performing the backbone bias direction prediction; Step 3.2: Compensate for the bias direction related to high-frequency details using wavelet-gated detail residual branch. Specifically, perform discrete wavelet transform again on the noisy latent space representation to decompose it into low-frequency and high-frequency components, and then perform high-frequency subband splicing to obtain the low-frequency structural components in the current state. and the aggregated high-frequency detail components ; Step 3.3: Generate the gate vector based on the low-frequency structural components, specifically as follows: For low-frequency structural components Perform global average pooling and two fully connected layers to obtain the gated vector. ; Step 3.4: Apply gated weighting to the aggregated high-frequency detail components using gated vectors to obtain the enhanced high-frequency representation. ; Step 3.5: Reconstruct the enhanced high-frequency representation and low-frequency structural components using inverse wavelet transform, and then pass them through a 1×1 convolutional layer. High-frequency residual compensation term obtained ; Step 3.6: Fuse the main deviation direction prediction result with the high-frequency detail residual compensation term to obtain the final deviation direction prediction result. ; Step 3.7: Use the true deviation direction during the training phase. Prediction results of the final deviation direction For supervision, the objective function is expressed as: ; In the wavelet domain, weighted constraints are applied to the low-frequency and high-frequency deviation direction errors respectively, and the loss function is... Represented as: ; in, and These represent the components of the true deviation direction in the low-frequency and high-frequency domains, respectively. and These represent the components of the prediction bias direction in the low-frequency and high-frequency domains, respectively. and These represent the weighting coefficients for low-frequency and high-frequency terms, respectively.

2. The multi-class anomaly detection method based on wavelet sensing deviation correction diffusion according to claim 1, characterized in that, Step 1 includes the following sub-steps: Step 1.1: Acquire the original industrial image and perform scale unification processing on the original industrial image; Step 1.2: Input the processed industrial image data into the pre-trained VAE encoder and map it into a low-dimensional latent space to obtain the latent space representation. .

3. The multi-class anomaly detection method based on wavelet sensing deviation correction diffusion according to claim 1, characterized in that, Step 2 includes the following sub-steps: Step 2.1: The latent space representation is decomposed into low-frequency and high-frequency components using discrete wavelet transform, specifically as follows: Let the latent space be represented as ,in Indicates the number of channels. and Let represent the height and width of the latent space representation, respectively, and assume... and All numbers are even; firstly, the latent space representation is divided into four spatial sub-blocks using a 2×2 step sampling method. The low-frequency and high-frequency components are represented as follows: ; ; ; ; in, For low-frequency structural components, , and For high-frequency detail components; The three high-frequency subbands are spliced ​​along the channel dimension to obtain the aggregated high-frequency detail components. : ; Step 2.2: Set different forward diffusion scheduling strategies for the low-frequency structural components and the aggregated high-frequency detail components, where the low-frequency components are used to maintain global structural stability, and the high-frequency components are used to enhance local texture and boundary perturbations; Step 2.3: Inject noise into the low-frequency structural components and the aggregated high-frequency detail components respectively to form corresponding low-frequency disturbance components. and high-frequency disturbance components , represented as: ; ; in, This represents the cumulative scheduling coefficient at diffusion step t. and These represent random noise injected into the low-frequency and high-frequency components, respectively. Step 2.4: Reconstruct the low-frequency and high-frequency perturbation components using inverse wavelet transform to obtain the candidate perturbation latent space representation. ; Step 2.5: Introduce a latent space block binary masking mechanism to fuse the candidate perturbation latent space representation with the original latent space representation, perturbing only local regions to obtain a noisy latent space representation. The expression is: ; in, This represents element-wise multiplication. Represents a latent space block binary mask. This represents the region complementary to the mask; Step 2.6: Based on the noisy latent space representation Construct a deviation direction learning objective, specifically as follows: Let the direction of the true deviation be Then the noisy latent space representation can be expressed as: ; Among them, the direction of true deviation This refers to the deviation direction monitoring target during the training phase.

4. The multi-class anomaly detection method based on wavelet sensing deviation correction diffusion according to claim 3, characterized in that, Step 4 includes the following sub-steps: Step 4.1: Acquire the image to be detected The latent space representation is obtained through a pre-trained VAE encoder. Input the main deviation direction prediction network and the wavelet-gated detail residual branch to obtain the final deviation direction prediction result. ; Step 4.2: Perform deterministic reverse bias correction based on the final bias direction prediction result to obtain the corrected latent space representation, specifically: Calculate the estimated normal potential space at the current moment based on the final deviation direction prediction results. The expression is: ; The deterministic back bias correction update expression from diffusion step t to diffusion step t−1 is: ; in, This represents the normal latent space representation estimated at the current time. This represents the corrected latent space representation for the next time step. Step 4.3: Decode the corrected latent space representation using the pre-trained decoder to obtain the normally reconstructed image. ; Step 4.4: Calculate the image spatial difference and latent space difference respectively. The image spatial difference is derived from the image to be detected. Compared with normal reconstructed images The difference is obtained, and the latent space difference is represented by the original latent space. With the corrected latent space representation The difference was obtained; Step 4.5: Fuse image spatial differences and latent spatial differences to obtain the final anomaly map. : ; in, This represents the latent space difference clipping threshold. Indicates the image spatial difference cropping threshold; Spatial aggregation is performed on the anomaly map to obtain an image-level anomaly score, which is used to determine whether there are anomalies in the image to be detected.

Citation Information

Patent Citations

  • Cell fluorescence image generation method based on conditional diffusion model, model and application

    CN117671072A

  • Image denoising method and apparatus based on wavelet high-frequency channel synthesis

    US20240161251A1