Abstract
Anomaly detection from a single image is challenging since anomaly data is always rare and can be with highly unpredictable types. With only anomaly-free data available, most existing methods train an AutoEncoder to reconstruct the input image and find the difference between the input and output to identify the anomalous region. However, such methods face a potential problem - a coarse reconstruction generates extra image differences while a high-fidelity one may draw in the anomaly. In this paper, we solve this contradiction by proposing a two-stage approach, which generates high-fidelity yet anomaly-free reconstructions. Our Unsupervised Two-stage Anomaly Detection (UTAD) relies on two technical components, namely the Impression Extractor (IE-Net) and the Expert-Net. The IE-Net and Expert-Net accomplish the two-stage anomaly-free image reconstruction task while they also generate intuitive intermediate results, making the whole UTAD interpretable. Extensive experiments show that our method outperforms state-of-the-arts on four anomaly detection datasets with different types of real-world objects and textures.
Introduction: The Reconstruction Contradiction
In unsupervised anomaly detection, models are typically trained exclusively on anomaly-free data. The standard approach involves using an AutoEncoder to reconstruct the input image; the difference between the input and the reconstruction then highlights potential anomalies. However, this approach suffers from a fundamental "reconstruction contradiction."
If the reconstruction is too coarse, the model fails to capture fine-grained normal details, leading to significant differences even in normal regions (false positives). Conversely, if the model is powerful enough to achieve high-fidelity reconstruction, it may inadvertently learn to reconstruct the anomalies themselves, effectively "healing" the defects and leading to false negatives.
Proposed Method: UTAD Framework
To resolve this contradiction, the Unsupervised Two-stage Anomaly Detection (UTAD) framework decouples the reconstruction process into two distinct stages: Impression Extraction and High-fidelity Reconstruction.
Stage 1: Impression Extraction (IE-Net)
The first stage uses the Impression Extractor (IE-Net) to generate a coarse, anomaly-free "impression" ($m$) of the input image. By maximizing mutual information between the input and the latent space, the IE-Net is forced to capture only the most representative and frequent features of the normal training data. This process naturally filters out rare anomalous regions, resulting in a clean but potentially blurry or color-shifted template of the object.
Stage 2: High-fidelity Reconstruction (Expert-Net)
The second stage employs the Expert-Net to restore the fine-grained details lost in the first stage without re-introducing anomalies. Inspired by style transfer techniques, the Expert-Net uses Adaptive Instance Normalization (AdaIN) to fuse the coarse impression with structural details extracted from the input. It is trained to map normal images to their corresponding impressions, ensuring that it only reconstructs details that align with the normal distribution.
Perceptual Measurement
Rather than a simple pixel-wise subtraction, UTAD utilizes Perceptual Measurement (PM) to identify anomalies. By comparing the input, the impression, and the final reconstruction within the feature space of a pre-trained VGG-19 network, the system becomes robust to minor misalignments and lighting variations that might otherwise trigger false positives.
Experimental Results
The authors evaluated UTAD on several benchmarks, most notably the MVTec AD dataset, which contains 15 categories of industrial objects and textures.
- Quantitative Performance: UTAD achieved state-of-the-art results, with a mean Area Under the ROC Curve (AuROC) of 0.90 and a mean Intersection over Union (IoU) of 0.53—a 6% improvement over previous leading methods like CAVGA.
- Qualitative Superiority: Visual analysis demonstrates that UTAD produces significantly cleaner anomaly maps. While baseline models often struggle with "edge effects" (flagging the boundaries of normal objects), UTAD's high-fidelity reconstruction maintains sharp edges, reducing false positives.
- Ablation Studies: Experiments confirmed that both stages are critical. Removing the Expert-Net leads to blurry reconstructions and high false positive rates, while removing the IE-Net's information bottleneck allows anomalies to be reconstructed.
Conclusion
UTAD provides a robust solution to the reconstruction contradiction in unsupervised anomaly detection. By separating the task into "impression extraction" and "expert reconstruction," the framework ensures that the final output is both detailed and free of defects. This two-stage approach not only improves detection accuracy but also enhances interpretability through the generation of intermediate anomaly-free impressions.
Summary updated