Introduction
Industrial anomaly detection (AD) traditionally relies on training separate models for each product category to ensure high precision. However, this "one-model-per-category" approach is difficult to scale and deploy in complex manufacturing environments. Recent efforts have shifted toward "unified" models—single architectures capable of detecting anomalies across multiple object classes.
Despite their promise, unified models face two significant challenges:
- Identical Shortcuts: Models trained to reconstruct inputs often learn to reconstruct the anomalies themselves, leading to missed detections.
- The Blurry Problem: Many models operate on low-resolution feature maps. When upsampled to the original image size, the resulting heatmaps lack the detail necessary to identify tiny defects like hairline cracks.
To address these issues, researchers at Tencent Youtu Lab have introduced DRDC (Diffusion Refinement with Dual Conditioning), a framework that leverages the global structural awareness of Transformers and the high-resolution refinement capabilities of Diffusion Models.
Methodology: The DRDC Framework
The DRDC architecture splits the anomaly detection task into two distinct stages: a base reconstruction and a high-resolution diffusion-based refinement.
1. Base Model
A Transformer-based network serves as the foundation, performing initial feature reconstruction. While it captures the global structure of the object, the resulting heatmap is often low-resolution and blurry.
2. Diffusion Refinement via Inpainting
The core innovation of DRDC is the use of a Diffusion Model for inpainting rather than full generation. By masking portions of the input image and tasking the model with filling them in, the framework forces the model to "imagine" normal textures based on its training on healthy samples. This effectively breaks the "identical shortcut" because the model cannot simply copy pixels from the masked area.
To enable multi-class performance, the authors implement Dual Conditioning:
- Model Conditioning: The U-Net is conditioned on the input image during training to learn category-specific noise distributions (e.g., distinguishing between a screw and a leather texture).
- Test-time Conditioning: During inference, unmasked pixels from the original image are preserved at each reverse diffusion step, ensuring the reconstruction remains faithful to the specific instance being inspected.
3. Spatio-temporal Fusion
A dedicated module merges heatmaps across different timesteps and spatial scales, producing a refined, noise-free final anomaly map.
Experimental Evaluation
DRDC was evaluated on three major benchmarks: MVTec-AD, BeanTechAD, and VisA.
Key Results
The framework achieved state-of-the-art performance on MVTec-AD, with 98.5% image-wise AUROC and 98.1% pixel-wise AUROC. Notably, DRDC showed significant improvements in detecting "thin" defects in categories like screws and capsules, where traditional low-resolution models often fail.
As shown in the table above, performance degrades as the scaling size decreases. This quantifies the "blurry problem" and highlights the necessity of the high-resolution refinement provided by the diffusion stage.
Efficiency and Insights
By focusing on high-frequency details recovered early in the reverse diffusion process, the authors reduced inference time. Starting the process at a later timestep (e.g., 250 instead of 1000) allows for rapid refinement. While the current inference time of ~14.8 seconds is slower than GAN-based methods (0.29s), it represents a significant leap in practicality for diffusion-based AD.
Conclusion
DRDC successfully addresses the "identical shortcut" and "blurry problem" in unified anomaly detection. By reframing reconstruction as a dual-conditioned inpainting task, it achieves high-resolution precision across multiple object categories. Future work will focus on optimizing sampling speeds to meet the requirements of real-time industrial assembly lines.
Summary updated