Abstract
Image reconstruction-based anomaly detection has gained significant attention due to the practical challenges of constructing comprehensive anomaly datasets. These methods typically learn to model normal features in an unsupervised or self-supervised manner, identifying anomalies at test time based on reconstruction errors. However, standard models often suffer from "perfect generalization," where they inadvertently reconstruct abnormal regions, thereby failing to flag defects. To address this, we present the Two-Stream Decoder Network (TSDN), which utilizes a Feature Normality Estimator (FNE) to identify and suppress abnormal features during the reconstruction process. Evaluated on the MVTec AD benchmark, TSDN demonstrates state-of-the-art performance, particularly in texture-based defect detection.
Introduction
In automated manufacturing, detecting subtle defects—such as hairline cracks in tiles or minute scratches on metal components—is critical for quality control. Traditional deep learning approaches frequently employ Autoencoders (AEs) for this task. The underlying principle is straightforward: a model trained exclusively on "normal" data should fail to reconstruct anomalous features, resulting in a high pixel-wise error that signals a defect.
However, modern neural networks are often too effective at generalizing. In many cases, they successfully reconstruct defects they have never encountered during training, rendering those anomalies invisible to the detection system. This paper proposes a novel architectural solution to this problem by introducing a two-stream decoder and a gating mechanism designed to filter out abnormal information before it reaches the final output.
The TSDN Framework
The TSDN architecture is designed to overcome the "Skip Connection Paradox." While skip connections are essential in U-Net style architectures for preserving high-resolution details, they also serve as a direct "highway" for abnormal features to bypass the bottleneck and appear in the reconstruction. The TSDN framework introduces three core components to mitigate this:
1. Superpixel Random Filling (SURF)
Because real-world anomalies are rare and diverse, the authors utilize SURF to generate synthetic anomalies during training. By dividing images into superpixels and filling selected regions with random colors, the model is forced to learn the distinction between original textures and distorted artifacts.
2. Two-Stream Decoder Architecture
Instead of a single reconstruction path, the model employs two distinct decoders:
- Abnormality Decoder ($DCD_A$): This stream is specifically trained to predict a binary mask indicating the location of anomalies (the SURF distortions).
- Normality Decoder ($DCD_N$): This stream is tasked with the high-fidelity reconstruction of the original, clean image.
3. Feature Normality Estimator (FNE)
The FNE acts as the critical link between the two decoders. Positioned within the skip connections, it compares the predicted anomaly mask from $DCD_A$ with the feature maps generated by the encoder. If specific feature channels correlate strongly with the predicted anomaly mask, the FNE suppresses them by applying a low weight. This forces the Normality Decoder to "fill in" the suppressed regions using only the surrounding normal context, ensuring that defects are not reconstructed.
Experimental Results
The model was evaluated using the MVTec AD dataset, the industry standard for anomaly detection, which includes 15 categories ranging from textures (e.g., carpet, leather) to complex objects (e.g., bottles, transistors).
Performance Metrics
TSDN demonstrated superior performance compared to previous state-of-the-art (SOTA) methods:
- Overall Accuracy: TSDN achieved an average Image-level AUC of 92.8%, surpassing models like RIAD (91.7%) and DivA (89.5%).
- Texture Specialization: The model was exceptionally effective in texture categories, reaching a 98.2% AUC, a significant improvement over existing benchmarks.
Ablation Study: The Impact of FNE
The researchers conducted ablation studies to validate the FNE module. They found that simply adding standard skip connections to an Autoencoder actually decreased performance in some metrics (dropping from 87.3% to 70.7%) because of the aforementioned feature leakage. However, integrating the FNE module not only recovered this loss but pushed the performance to a peak of 93.9% on specific benchmarks, proving that gated skip connections are vital for this task.
Discussion and Limitations
While TSDN excels at texture-based detection, its performance on complex objects—such as the "Transistor" category—leaves room for improvement. Objects with intricate geometries pose a challenge because normal structural variations can sometimes be mistaken for anomalies if the model's spatial alignment is not perfect. Future research may focus on incorporating geometric priors or enhancing the "inpainting" capabilities of the normality decoder to better handle large-scale structural distortions.
Conclusion
The Two-stream Decoder Feature Normality Estimating Network (TSDN) provides a robust solution to the problem of over-generalization in industrial anomaly detection. By explicitly modeling abnormality and using those insights to gate the reconstruction process, TSDN ensures that defects remain visible as high-error regions. This approach sets a new standard for self-supervised defect detection in manufacturing environments.
Summary updated