Structural Teacher-Student Normality Learning for Multi-Class Anomaly Detection and Localization

Hanqiu Deng, Xingyu LiarXiv 2024 · DOI

Introduction: The Challenge of Multi-Class Anomaly Detection

Visual anomaly detection aims to identify defects—such as scratches or missing components—by learning from "normal" samples. While traditional methods excel in "one-class" settings (one model per object category), they struggle to scale to industrial environments with diverse product lines. Training a single "unified" model for multiple classes often leads to cross-class interference, where the model becomes overly tolerant, misidentifying anomalies as acceptable variations of "normal" states.

Visualizing cross-class interference and its impact on anomaly detection and localization.

Methodology: Structural Normality Learning (SNL)

To address interference, the authors propose Structural Teacher-Student Normality Learning (SNL). Unlike standard Teacher-Student frameworks that focus on local pixel-level features, SNL emphasizes the structural relationships within the feature space.

1. Structural Distillation

The student network is trained to replicate the teacher's structural feature organization through three mechanisms:

  • Spatial-Channel Distillation: Matches global attention maps using KL divergence.
  • Intra-Affinity Distillation: Captures relationships between different regions within a single image.
  • Inter-Affinity Distillation: Learns relationships across different images in a batch, helping the model distinguish between distinct categories.

2. Central Residual Aggregation Module (CRAM)

To prevent the student from "over-generalizing" (i.e., successfully reconstructing anomalies), the Central Residual Aggregation Module (CRAM) introduces a bottleneck. It defines a set of "normality centers" representing typical features. The student must represent features as residuals relative to these centers, effectively constraining the model to a compact "normal" manifold. This ensures a high discrepancy (error signal) when encountering anomalous features.

Experimental Results

The SNL framework was evaluated on the MVTecAD and VisA benchmarks in a unified multi-class setting.

Performance comparison between baseline and SNL in multi-class and one-class settings.

SNL achieved state-of-the-art results:

  • MVTecAD: 98.3% Image-level AUROC and 98.0% Pixel-level AUROC.
  • VisA: 94.0% Image-level AUROC and 98.7% Pixel-level AUROC.

Notably, SNL also improved performance in the traditional one-class setting, suggesting that structural constraints enhance feature specificity regardless of the number of categories.

Conclusion

SNL effectively mitigates cross-class interference by prioritizing structural consistency and feature compactness. While the method achieves top-tier performance, future work may involve integrating SNL with anomaly synthesis techniques to further refine localization precision.

Summary updated

BibTeX
@misc{deng2024structural,
  author = {Hanqiu Deng and Xingyu Li},
  title = {{Structural Teacher-Student Normality Learning for Multi-Class Anomaly Detection and Localization}},
  year = {2024},
  eprint = {2402.17091},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.17091},
}
Figure