A Masked Reverse Knowledge Distillation Method Incorporating Global and Local Information for Image Anomaly Detection

Yuxin Jiang, Yunkang Can, Weiming ShenarXiv 2025 · DOI

Introduction

In unsupervised Image Anomaly Detection (AD), the standard paradigm involves training a "student" network to mimic a pre-trained "teacher" network using only defect-free samples. At inference, the discrepancy between the student's output and the teacher's signal serves as an anomaly score. However, a significant challenge in this field is overgeneralization: deep learning models often become so proficient at mimicking the teacher that they accurately reconstruct abnormal regions they have never seen. This "photocopier effect" occurs because the input and supervisory signals are equivalent, allowing the model to rely on low-level texture copying rather than semantic understanding.

Proposed Methodology

To address overgeneralization, this paper introduces Masked Reverse Knowledge Distillation (MRKD). The core innovation is shifting the student's task from simple reconstruction to restoration. By breaking the equivalence between the input and the supervisory signal, the model is forced to learn the underlying manifold of normal data.

Comparison of RD4AD and the proposed MRKD framework. MRKD breaks the input-supervisory equivalence by shifting from reconstruction to restoration.

MRKD utilizes two complementary masking strategies to capture both high-level semantics and fine-grained textures:

  1. Image-Level Masking (ILM): Utilizing Natural Synthetic Anomalies (NSA), patches from other normal images are pasted onto the training sample. The student must restore these regions to their original state, forcing the network to leverage global context to infer missing information.
  2. Feature-Level Masking (FLM): Individual pixels within the student's internal feature maps are randomly masked. A dedicated generation module then recovers these pixels, compelling the network to learn local correlations and maintain textural precision.

Experimental Results

The MRKD framework was evaluated on three industry-standard benchmarks: MVTec AD, Magnetic Tile Defect (MTD), and beanTech Anomaly Detection (BTAD).

On the MVTec AD dataset, MRKD achieved state-of-the-art performance with an image-level 98.9% AU-ROC and a pixel-level 98.4% AU-ROC. Notably, in categories like "transistor" where previous methods like RD4AD struggled, MRKD improved the Per-Region Overlap (AU-PRO) score by 13.4%.

Qualitative comparison of anomaly detection results on MVTec AD. MRKD produces cleaner heatmaps and more accurate localization compared to RD4AD.

Qualitative analysis shows that MRKD produces significantly "cleaner" heatmaps than its predecessors. By focusing on restoration, the model effectively ignores the "noise" of abnormal textures that distillation-only models often accidentally reconstruct.

Discussion and Conclusion

The success of MRKD highlights that restoration tasks are superior to simple reconstruction for anomaly detection. By integrating global information (via ILM) and local information (via FLM), the model develops a robust understanding of normality.

One observed limitation is the model's sensitivity to harmless impurities, such as dust or minor background scratches, which it occasionally flags as anomalies. Future work will focus on incorporating higher-level semantic cues to distinguish between functional defects and benign environmental noise, as well as exploring Transformer-based architectures to further enhance context capture.

Summary updated

BibTeX
@misc{jiang2025masked,
  author = {Yuxin Jiang and Yunkang Can and Weiming Shen},
  title = {{A Masked Reverse Knowledge Distillation Method Incorporating Global and Local Information for Image Anomaly Detection}},
  year = {2025},
  eprint = {2512.15326},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.15326},
}
Figure