A feature regulation-based retro-distillation image anomaly detection method, device and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2026-03-24
AI Technical Summary
Existing anomaly detection methods based on knowledge distillation have shortcomings in addressing issues such as overlapping feature distributions and multi-scale noise interference, resulting in inaccurate anomaly localization and low computational efficiency, making it difficult to meet the real-time requirements of industrial inspection.
A backdistillation network is constructed, including a pre-trained teacher model, a bottleneck layer, a student model, a feature masking and recovery module, and a collaborative difference optimization and loss calculation module. The feature selection module dynamically adjusts the feature weights at different scales, and the feature masking and recovery module generates compact features. The network is then trained through the collaborative difference optimization and loss calculation module to improve feature discrimination ability.
It effectively distinguishes between normal and abnormal features, improves the semantic robustness and generalization ability of the model, reduces the impact of abnormal information on the subsequent reasoning process, and improves the accuracy and efficiency of anomaly detection.
Smart Images

Figure CN120339647B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method, apparatus, and medium for detecting anomalies in back-distillation images based on feature modulation, belonging to the field of artificial intelligence technology. Background Technology
[0002] In recent years, anomaly detection methods based on knowledge distillation have attracted widespread attention due to their advantages in feature representation and differential learning. These methods (such as STPM and MRKD) construct a teacher-student model framework, using the teacher model to extract features from normal samples and guide the student model's learning, thereby locating anomalous regions through feature differences. Specifically, the STPM method employs a feature pyramid matching strategy, aligning multi-scale features layer by layer to transfer knowledge of normal patterns; the MRKD method, on the other hand, optimizes the discriminative power of the feature space by introducing masking techniques and a dual-teacher model architecture.
[0003] However, existing technologies still have the following key shortcomings:
[0004] Feature distribution overlap problem: Due to the high overlap of normal and abnormal features in low-dimensional space, the student model has difficulty accurately capturing subtle differences, resulting in a significant decrease in the reliability of anomaly localization, especially in complex textures or weak anomaly scenes with a high false detection rate.
[0005] Multi-scale noise interference problem: During feature pyramid or multi-scale propagation, low-level features extracted by shallow networks (such as local texture and lighting noise) can interfere with the expression of high-level semantic features through cascading operations, reducing the model's sensitivity to abnormal regions.
[0006] Computational efficiency bottleneck: Existing methods often employ complex architectures (such as multi-teacher models and dense feature interaction modules) to improve performance, resulting in an exponential increase in computational complexity, which makes it difficult to meet the stringent real-time requirements of industrial inspection scenarios.
[0007] The aforementioned shortcomings pose a serious challenge to existing methods in fields where both accuracy and efficiency are critical. Summary of the Invention
[0008] The purpose of this invention is to provide a method, device, and medium for detecting anomalies in back-distillation images based on feature modulation, thereby improving the reliability of anomaly localization on the surface of industrial products and enhancing the semantic robustness of the model.
[0009] To achieve the above objectives, the present invention employs the following technical solution:
[0010] A feature-modulated backdistillation image anomaly detection method includes the following steps:
[0011] A backdistillation network is constructed, including a pre-trained teacher model, a bottleneck layer, a student model, a feature masking and recovery module, and a collaborative difference optimization and loss calculation module. The bottleneck layer introduces a feature selection module, and the student model is a decoding network with a structure that is reverse symmetric to that of the teacher model.
[0012] Acquire normal images and perform natural synthesis of anomalous pixels to generate a composite image containing both normal and anomalous pixels;
[0013] The synthesized image is input into the teacher model to extract multi-scale features. The weights of features at different scales are dynamically adjusted through the feature selection module of the bottleneck layer, and then compressed to obtain compact features.
[0014] Features are recovered from the compact features using a student model, and normal pixel features and abnormal pixel features are generated by combining feature masks and recovery modules.
[0015] The differences between normal and abnormal pixel features and the output features of the teacher model are calculated. The distance between normal and abnormal pixel features is calculated through the collaborative difference optimization and loss calculation module. The back distillation network is trained by combining the difference loss.
[0016] The image to be tested is input into the trained backdistillation network. Multi-scale features are extracted by the teacher model, processed by the bottleneck layer, and then input into the student model to generate recovery features.
[0017] Calculate the cosine similarity difference map of the output features of the teacher model and the student model, fuse them to generate an anomaly score map and locate the anomaly region.
[0018] Preferably, the teacher model is the WideResNet50 model.
[0019] Preferably, the feature selection module dynamically adjusts the weights of features at different scales and compresses them to obtain compact features, specifically including:
[0020] Multi-scale feature fusion is used to fuse the output features of the teacher model into a single feature. This feature is then subjected to global average pooling and one-dimensional convolution to generate channel weights.
[0021] Multiply the channel weights by the output features of the teacher module to obtain the weighted features;
[0022] Compact features are generated by compressing weighted features using a type of embedding.
[0023] Preferably, the formula for the one-dimensional convolution generating channel weights is:
[0024] ,
[0025] in: Elements indicating a compact or firm characteristic. express of A set of adjacent channels, In a one-dimensional convolution kernel, the first... The weight parameters of each adjacent channel, Indicates the first Attention weights for each channel, This represents the Sigmoid function. Indicates the first The first channel The characteristic values of each adjacent channel.
[0026] Preferably, the normal pixel feature distance is the cosine similarity deviation between the normal features output by the student model and the normal features input by the teacher model. The formula is as follows:
[0027]
[0028] in, This represents the normal features output by the student model. This represents the normal features input to the teacher model. Indicates transpose. Represents the set of normal pixels. The number of the coded block. Indicates normal characteristics;
[0029] The abnormal pixel feature distance is the cosine similarity deviation between the abnormal features output by the student model and the abnormal features input by the teacher model. The formula is as follows:
[0030] ,
[0031] in, This indicates the abnormal features of the teacher model input. This represents the anomalous features output by the student model. Represents the set of abnormal pixels. Indicates abnormal characteristics.
[0032] Preferably, the weighted loss function of the collaborative difference optimization module is:
[0033] ,
[0034] in, Indicates the first In the coded block, the ... Each normal pixel weight Indicates the first In the coded block, the ... A normal pixel cosine distance Indicates the first In the coded block, the ... Weight of each abnormal pixel Indicates the first In the coded block, the ... Cosine distance of anomalous pixels Indicates the first The number of normal pixels in each coded block Indicates the first The number of abnormal pixels in each coded block.
[0035] Preferably, the normal pixel weight is calculated using the following formula:
[0036] ,
[0037] ,
[0038] in, This represents the mean of the distances to normal features. For hyperparameters;
[0039] The weight of the abnormal pixels is calculated using the following formula:
[0040] ,
[0041] ,
[0042] in, This represents the mean of the distances to normal features.
[0043] Preferably, the anomaly scoring graph is generated through the following steps:
[0044] Bilinear upsampling is performed on the cosine similarity difference map; the final score map is generated by pixel-by-pixel multiplication and accumulation.
[0045] A feature-modulated backdistillation image anomaly detection device includes a processor and a memory storing program instructions, wherein the processor is configured to execute the feature-modulated backdistillation image anomaly detection method when running the program instructions.
[0046] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the feature-modulated backdistillation image anomaly detection method described above.
[0047] The advantages of this invention are as follows: This invention, through a collaborative difference optimization module and masking technology, can effectively distinguish between normal and abnormal pixels. During training, the feature distance of normal pixels is reduced to maintain consistency, while the feature distance of abnormal pixels is increased to clearly distinguish them. A feature selection module is proposed to learn the correlation of features at different scales, reducing the impact of anomalous information on the subsequent inference process and improving the model's generalization ability. Attached Figure Description
[0048] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0049] Figure 1 This is a schematic diagram of the method flow of the present invention.
[0050] Figure 2 This is a schematic diagram of the feature processing flow of the present invention.
[0051] Figure 3 This is a schematic diagram of the feature selection module of the present invention.
[0052] Figure 4 This is a comparison chart of the detection effects of different methods in simulation experiment 1.
[0053] Figure 5 This is a comparison chart of the detection effects of different methods in simulation experiment 2.
[0054] Figure 6 Normal images were captured for this example.
[0055] Figure 7 This is a naturally synthesized anomalous image. Detailed Implementation
[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] Example 1
[0058] like Figure 1 As shown, a feature-modulated backdistillation image anomaly detection method effectively distinguishes normal and abnormal pixels through a collaborative difference optimization module and masking techniques. During training, the feature distance of normal pixels is reduced to maintain consistency, while the feature distance of abnormal pixels is increased to clearly distinguish them. A feature selection module is proposed to learn the correlation of features at different scales, reducing the impact of anomalous information on the subsequent inference process and improving the model's generalization ability.
[0059] Specifically, it is applied to the identification of surface defects in industrial products, including the training and inference phases.
[0060] Training phase:
[0061] S1: Construct a backdistillation network, including a pre-trained teacher model, a bottleneck layer, a student model, a feature masking and recovery module, and a collaborative difference optimization and loss calculation module. The bottleneck layer introduces a feature selection module, and the student model is a decoding network with a structure that is reverse symmetric to the teacher model.
[0062] As a refinement of the above embodiments, the teacher model is a pre-trained WideResNet50, and the student model is a decoding network whose structure is reverse-symmetric to that of the teacher model.
[0063] S2: Acquire a normal image and perform a natural synthesis of anomalies to generate a composite image containing both normal and abnormal pixels. The image is an image of surface defects in an industrial product.
[0064] For example: Normal image acquisition: Capturing surface images of defect-free screws using a high-resolution industrial camera, ensuring intact threads and no cracks in the head, such as... Figure 6 .
[0065] Natural Synthetic Anomalies (NSA): Employing Poisson image editing techniques, anomaly patches are seamlessly embedded into normal screw images to generate synthetic training samples. Figure 7 This shows an abnormal area where the screw head is clearly broken.
[0066] As a refinement of the above embodiments, the Natural Synthesis Anomalous Operation (NSA) generates a dataset containing normal pixels using the following formula. and abnormal pixels Synthetic image :
[0067] ,
[0068] in, For gradient operators, For the target image, A randomly selected rectangular patch.
[0069] S3: Input the synthesized image into the teacher model to extract multi-scale features. ( The feature selection module of the bottleneck layer dynamically adjusts the weights of features at different scales and compresses them to obtain compact features.
[0070] As a refinement of the above embodiments, in order to reduce the introduction of abnormal information and dynamically adjust the information of features at different scales, a feature selection module is introduced in the bottleneck layer, the specific structure of which is as follows: Figure 3 As shown, the aggregated features obtained by global average pooling are processed by an execution size of Fast one-dimensional convolution generates weights.
[0071] Specifically, including:
[0072] First, multi-scale feature fusion (MFF) is used to integrate the output of the teacher network. , , Fusion It is adjusted by a global average pooling. Then, after one-dimensional convolution, the first... Channel weights of each channel :
[0073] ,
[0074] in: Elements indicating a compact or firm characteristic. express of A set of adjacent channels, In a one-dimensional convolution kernel, the first... The weight parameters of each adjacent channel, Indicates the first The attention weights for each channel, after being normalized using the sigmoid function, range from [value missing]. This is used to indicate the importance of the channel. Representing the Sigmoid function ensures the interpretability of the attention weights. Indicates the first The first channel The feature values of the nth adjacent channel; one weight parameter corresponds to the feature value of one adjacent channel. Specifically, in the channel dimension, the feature value of the nth adjacent channel is used as the weight parameter. Taking the channel as the center, take the left and right sides together. The feature values of its neighbors (including itself). This strategy can be implemented using a kernel size of... A fast one-dimensional convolution implementation, namely:
[0075] ,
[0076] in, This represents a one-dimensional convolution with channel weights. With original features Multiplication yields weighted features The formula is as follows:
[0077] ,
[0078] Features The information is transmitted to a one-class embedding (OCE) for compression. This step effectively mitigates the propagation of anomalous perturbations and improves the robustness of the student model in capturing normal patterns.
[0079] S4: Recover features from the compact features using the student model, and generate normal pixel features and abnormal pixel features by combining the feature mask and recovery module.
[0080] As a refinement of the above embodiments, the bottleneck layer outputs compact features The multi-scale features extracted from the teacher model are generated after being compressed and filtered by the bottleneck layer.
[0081] The student model employs a reverse-symmetric structure compared to the teacher model (the teacher model acts as the encoder, and the student model as the decoder), and obtains information through reverse operations. Recovery features.
[0082] The feature masking and recovery module also includes a mask generation module. It dynamically generates masks to suppress interference in abnormal regions or enhance details in normal regions. The weights of the recovered features are adjusted through lightweight network layers (such as convolutional layers), and parameters are randomly initialized to improve flexibility.
[0083] The feature masking and restoration module outputs features including: normal pixel features restored by the student model. Abnormal pixel features recovered by the student model .
[0084] The mathematical expression is as follows:
[0085] ,
[0086] .
[0087] Through reverse structure and mask generation, the student model learns to align abnormal features with normal features while preserving the ability to distinguish details.
[0088] S5: Calculate the difference between normal pixel features and abnormal pixel features relative to the output features of the teacher model. Calculate the distance between normal pixel features and abnormal pixel features through the collaborative difference optimization and loss calculation module, and train the backdistillation network by combining the difference loss.
[0089] As a refinement of the above embodiments, the feature distance is calculated as follows:
[0090] Normal pixel distance That is, in the first In each coded block, the set of normal pixels The feature distance, with a value range of . The larger the value, the greater the difference between the two, and the more normal the characteristics of the student's recovery. With the original characteristics of teachers The cosine similarity deviation is obtained as follows:
[0091] ,
[0092] in, This represents the normal features output by the student model. This represents the normal features input to the teacher model. Indicates transpose. Represents the set of normal pixels. This refers to the number of the encoding block, corresponding to a specific layer in the teacher and student models (e.g., different convolutional blocks in WideResNet50). Multi-scale anomaly detection is achieved by calculating feature distances layer by layer. This indicates a normal characteristic.
[0093] Teacher characteristics With student characteristics The vector dot product is used to measure the directional similarity between two vectors.
[0094] Abnormal pixel distance That is, in the first Set of abnormal pixels in each coded block The feature distance, with a value range of . The larger the value, the greater the difference between the two, which is reflected in the abnormal characteristics recovered by the students. With the original characteristics of teachers The cosine similarity deviation is obtained as follows:
[0095] ,
[0096] in, This indicates the abnormal features of the teacher model input. This represents the anomalous features output by the student model. Represents the set of abnormal pixels. Indicates abnormal characteristics.
[0097] The weighted loss function of the collaborative difference optimization module is:
[0098] ,
[0099] in, Indicates the first In the coded block, the ... Each normal pixel weight Indicates the first In the coded block, the ... A normal pixel cosine distance Indicates the first In the coded block, the ... Weight of each abnormal pixel Indicates the first In the coded block, the ... Cosine distance of anomalous pixels Indicates the first The number of normal pixels in each coded block Indicates the first The number of abnormal pixels in each coded block.
[0100] Molecular logic:
[0101] Normal term: Minimize the normal pixel distance so that the student model recovers features that are close to those of the teacher model.
[0102] Anomalies: Maximize the distance between anomalous pixels to enhance the discriminative power of anomalous features.
[0103] The purpose of the denominator is to normalize the weights and avoid optimization bias caused by imbalanced sample sizes.
[0104] The dynamic weight adjustment of the loss function is as follows:
[0105] Mean calculation: Calculate the mean distances between normal and abnormal features separately.
[0106] , ,
[0107] Weighting:
[0108] Normal pixel weights: The larger the value is than the mean, the higher the weight, forcing the model to prioritize optimizing difficult samples.
[0109] Abnormal pixel weights: The smaller the value of the mean, the higher the weight, to avoid the model over-recovering abnormal features.
[0110] in, This is a hyperparameter that adjusts the effect. The exponent for normal pixels is... The index of abnormal pixels is - . The optimal value is 2, when As the value increases from 1.5 to 2, performance gradually improves. When the value is greater than 2, performance begins to decline.
[0111] Reasoning stage:
[0112] S6: Input the image to be tested into the trained backdistillation network, extract multi-scale features through the teacher model, process them through the bottleneck layer, and then input them into the student model to generate recovery features.
[0113] As a refinement of the above embodiments, a cosine similarity difference map is provided. :
[0114] ,
[0115] in, These are the spatial coordinates of the feature map, corresponding to the location of a local region in the original image. For example: in In the image, Indicates the central area.
[0116] The teacher model is represented in the first... The feature vector extracted from each coding block is located at... .
[0117] The student model is represented in the first... The feature vector recovered from each decoded block is located at... .
[0118] S7: Calculate the cosine similarity difference map of the output features of the teacher model and the student model, fuse them to generate an anomaly score map and locate the anomaly region.
[0119] As a refinement of the above embodiments, the anomaly scoring graph is generated through the following steps:
[0120] Bilinear upsampling is performed on the cosine similarity difference map; the final score map is generated by pixel-by-pixel multiplication. The formula is as follows:
[0121] .
[0122] Example 2
[0123] Simulation Experiment 1: This experiment simulates the present invention on the MVTecAD dataset.
[0124] Simulation conditions: Performed using PyTorch 1.12.1 and Python 3.8.
[0125] like Figure 4As shown, the feature-modulated backdistillation anomaly detection method is compared with mainstream methods such as MRKD, PatchCore, and PaDiM in the MVTecAD industrial dataset (covering surface defects of various products). Experimental results show that the feature-modulated backdistillation anomaly detection method exhibits more accurate localization capabilities in complex texture scenes (such as carpet fiber breakage) and small defects (such as scratches on capsule surfaces). Among the compared methods, MRKD has a high false detection rate in anomaly areas due to the lack of a feature modulation mechanism; although PatchCore can capture local features, its fusion of multi-scale information is insufficient, leading to missed detection of small defects. Through the Collaborative Differential Optimization (CDO) module, the feature-modulated backdistillation anomaly detection method significantly distinguishes between normal and abnormal feature distributions. Its anomaly score distribution map shows that normal samples are concentrated in low-score areas, while abnormal samples are significantly offset and clearly spaced. As shown in the figure comparison, the localization results of the feature-modulated backdistillation anomaly detection method are closer to the real mask, especially in the complex texture of the "cable" category, where the false detection area is significantly reduced.
[0126] Example 3
[0127] Simulation Experiment 2: This experiment simulates the present invention on the BTAD dataset.
[0128] Simulation conditions: Performed using PyTorch 1.12.1 and Python 3.8.
[0129] like Figure 5 As shown, based on the BTAD real-world industrial scene dataset (including interference such as lighting changes and occlusion), the feature-modulated backdistillation anomaly detection method is compared with VT-ADL, AE (MSE+SSIM), and RD4AD. The results show that the feature-modulated backdistillation anomaly detection method can still stably detect anomalies in challenging scenarios such as reflective metal parts and low-contrast cracks on plastic surfaces. In contrast, the comparative methods, due to their limited feature extraction or insufficient dynamic adjustment capabilities, exhibit positioning errors or missed detections. For example, VT-ADL mistakenly identifies background noise as a defect in a heavily occluded screw surface with stains. The feature-modulated backdistillation anomaly detection method effectively suppresses interference and captures subtle anomaly patterns by dynamically fusing multi-scale information through a feature selection module (SF). In the attached figure, the feature-modulated backdistillation anomaly detection method outperforms the benchmark method in the "Category 2" occluded scenario, verifying its anti-interference capability.
[0130] This disclosure also provides a feature-modulated backdistillation image anomaly detection device, including a processor and a memory. Optionally, the device may further include a communication interface and a bus. The processor, communication interface, and memory can communicate with each other via the bus. The communication interface can be used for information transmission. The processor can call logical instructions in the memory to execute the feature-modulated backdistillation image anomaly detection method of the above embodiments.
[0131] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0132] Memory, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as the program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor executes the program instructions / modules stored in the memory to perform functional applications and data processing, thereby realizing the feature-controlled backdistillation image anomaly detection method described in the above embodiments.
[0133] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory may include high-speed random access memory and may also include non-volatile memory.
[0134] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to perform the aforementioned feature-modulated backdistillation image anomaly detection method.
[0135] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0136] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting anomalies in backdistillation images based on feature modulation, characterized in that, Includes the following steps: A backdistillation network is constructed, including a pre-trained teacher model, a bottleneck layer, a student model, a feature masking and recovery module, and a collaborative difference optimization and loss calculation module. The bottleneck layer introduces a feature selection module, and the student model is a decoding network with a structure that is reverse symmetric to that of the teacher model. Acquire normal images and perform natural synthesis of anomalous pixels to generate a composite image containing both normal and anomalous pixels; The synthesized image is input into the teacher model to extract multi-scale features. The weights of features at different scales are dynamically adjusted through the feature selection module of the bottleneck layer, and then compressed to obtain compact features. Features are recovered from the compact features using a student model, and normal pixel features and abnormal pixel features are generated by combining feature masks and recovery modules. The differences between normal and abnormal pixel features and the output features of the teacher model are calculated. The distance between normal and abnormal pixel features is calculated through the collaborative difference optimization and loss calculation module. The back distillation network is trained by combining the difference loss. The image to be tested is input into the trained backdistillation network. Multi-scale features are extracted by the teacher model, processed by the bottleneck layer, and then input into the student model to generate recovery features. Calculate the cosine similarity difference map of the output features of the teacher model and the student model, fuse them to generate an anomaly score map and locate the anomaly region; The weighted loss function of the collaborative difference optimization and loss calculation module is: , in, Indicates the first In the coded block, the ... Each normal pixel weight Indicates the first In the coded block, the ... A normal pixel cosine distance Indicates the first In the coded block, the ... Weight of each abnormal pixel Indicates the first In the coded block, the ... Cosine distance of anomalous pixels Indicates the first The number of normal pixels in each coded block Indicates the first The number of abnormal pixels in each coded block; The formula for the normal pixel weight is as follows: , , in, This represents the mean of the distances to normal features. For hyperparameters; The weight of the abnormal pixels is calculated using the following formula: , , in, This represents the mean of the normal feature distances.
2. The feature-modulated backdistillation image anomaly detection method according to claim 1, characterized in that, The teacher model is the WideResNet50 model.
3. The method for detecting anomalies in back-distillation images based on feature modulation according to claim 1, characterized in that, The feature selection module dynamically adjusts the weights of features at different scales and compresses them to obtain compact features, specifically including: Multi-scale feature fusion is used to fuse the output features of the teacher model into a single feature. This feature is then subjected to global average pooling and one-dimensional convolution to generate channel weights. Multiply the channel weights by the output features of the teacher module to obtain the weighted features; Compact features are generated by compressing weighted features using a type of embedding.
4. The feature-modulated backdistillation image anomaly detection method according to claim 3, characterized in that, The formula for the one-dimensional convolution generation channel weights is: , in: Elements indicating a compact or firm characteristic. express of A set of adjacent channels, In a one-dimensional convolution kernel, the first... The weight parameters of each adjacent channel, Indicates the first Attention weights for each channel, This represents the Sigmoid function. Indicates the first The first channel The characteristic values of each adjacent channel.
5. The method for detecting anomalies in back-distillation images based on feature modulation according to claim 1, characterized in that, The normal pixel feature distance is the cosine similarity deviation between the normal features output by the student model and the normal features input by the teacher model. The formula is as follows: in, This represents the normal features output by the student model. This represents the normal features input to the teacher model. Indicates transpose. Represents the set of normal pixels. The number of the coded block. Indicates normal characteristics; The abnormal pixel feature distance is the cosine similarity deviation between the abnormal features output by the student model and the abnormal features input by the teacher model. The formula is as follows: , in, This indicates the abnormal features of the teacher's model input. This represents the anomalous features output by the student model. Represents the set of abnormal pixels. Indicates abnormal characteristics.
6. The method for detecting anomalies in back-distillation images based on feature modulation according to claim 1, characterized in that, The anomaly scoring graph is generated through the following steps: Bilinear upsampling is performed on the cosine similarity difference map; the final score map is generated by pixel-by-pixel multiplication and accumulation.
7. A feature-modulated backdistillation image anomaly detection device, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to execute, when running the program instructions, the feature-modulated back-distillation image anomaly detection method as described in any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the feature-modulated back-distillation image anomaly detection method as described in any one of claims 1-6.
Citation Information
Patent Citations
Lung CT anomaly detection method based on multi-scale cutting and self-supervised reconstruction
CN117237269A
Abnormal detection method and system, medium, electronic equipment and abnormal detection model
CN117934422A