[Paper Review] DiAD: A Diffusion-based Framework for Multi-class Anomaly Detection
DiAD proposes a novel diffusion-based framework for multi-class anomaly detection that combines a pixel-space autoencoder, a semantic-guided (SG) denoising network linked to Stable Diffusion, and a spatial-aware feature fusion (SFF) block to preserve semantic integrity and reconstruct large anomalous regions. It achieves state-of-the-art performance, attaining 97.2 AUROC and 96.8 AP on the MVTec-AD dataset for anomaly detection and localization.
Reconstruction-based approaches have achieved remarkable outcomes in anomaly detection. The exceptional image reconstruction capabilities of recently popular diffusion models have sparked research efforts to utilize them for enhanced reconstruction of anomalous images. Nonetheless, these methods might face challenges related to the preservation of image categories and pixel-wise structural integrity in the more practical multi-class setting. To solve the above problems, we propose a Difusion-based Anomaly Detection (DiAD) framework for multi-class anomaly detection, which consists of a pixel-space autoencoder, a latent-space Semantic-Guided (SG) network with a connection to the stable diffusion's denoising network, and a feature-space pre-trained feature extractor. Firstly, The SG network is proposed for reconstructing anomalous regions while preserving the original image's semantic information. Secondly, we introduce Spatial-aware Feature Fusion (SFF) block to maximize reconstruction accuracy when dealing with extensively reconstructed areas. Thirdly, the input and reconstructed images are processed by a pre-trained feature extractor to generate anomaly maps based on features extracted at different scales. Experiments on MVTec-AD and VisA datasets demonstrate the effectiveness of our approach which surpasses the state-of-the-art methods, e.g., achieving 96.8/52.6 and 97.2/99.0 (AUROC/AP) for localization and detection respectively on multi-class MVTec-AD dataset. Code will be available at https://lewandofskee.github.io/projects/diad.
Motivation & Objective
- Address the limitations of existing diffusion models in multi-class anomaly detection, particularly category and semantic confusion during reconstruction.
- Preserve semantic consistency and structural details in reconstructed anomalous regions while maintaining class identity.
- Improve reconstruction accuracy for large-scale defects by integrating multi-scale features effectively.
- Develop a robust, unsupervised framework that generalizes across multiple object classes without requiring class-specific fine-tuning.
- Achieve state-of-the-art performance in both anomaly localization and classification across standard benchmarks.
Proposed method
- Utilizes a pixel-space autoencoder to reconstruct input images in the pixel space, enabling direct comparison between input and output.
- Introduces a Semantic-Guided (SG) denoising network that connects to the Stable Diffusion denoising U-Net, ensuring semantic consistency during reconstruction.
- Employs a Spatial-aware Feature Fusion (SFF) block that fuses features from multiple scales using Instance Normalization and SiLU activation to enhance reconstruction fidelity.
- Leverages a pre-trained ImageNet backbone (e.g., ResNet50, WideResNet101) to extract multi-scale features from both input and reconstructed images.
- Computes anomaly scores via cosine similarity between feature maps at different layers, focusing on f2, f3, and f4 layers for optimal performance.
- Applies forward diffusion with a tunable number of timesteps to gradually noisify input images before denoising, improving reconstruction quality.
Experimental results
Research questions
- RQ1Can a diffusion-based framework effectively reconstruct anomalous regions while preserving the original image’s semantic class and structural details in a multi-class setting?
- RQ2How does the integration of a semantic-guided denoising network with Stable Diffusion improve reconstruction fidelity compared to standard diffusion models?
- RQ3To what extent does the spatial-aware feature fusion mechanism enhance reconstruction accuracy for large-scale anomalies?
- RQ4Which pre-trained feature extractors and feature layers yield the best anomaly detection performance across classification and segmentation tasks?
- RQ5How does the number of forward diffusion steps affect the final reconstruction quality and anomaly detection performance?
Key findings
- DiAD achieves 97.2 AUROC and 96.8 AP on the MVTec-AD dataset for anomaly detection, significantly outperforming prior SOTA methods.
- On the VisA dataset, DiAD attains 96.8 AUROC and 99.0 AP for localization and detection, respectively, demonstrating strong generalization across diverse anomaly types.
- The ablation study confirms that using ResNet50 as the backbone yields the best classification performance (97.2 AUROC), while WideResNet101 excels in segmentation (56.4 F1max).
- The SFF block with IN+SiLU activation outperforms BN+ReLU, achieving 97.2 AUROC and 96.8 AP when combined with the SG network.
- Using feature maps from layers f2, f3, and f4 (64×64, 32×32, 16×16) yields the highest performance, with 97.2 AUROC and 99.0 AP on MVTec-AD.
- Increasing forward diffusion steps beyond 600 improves reconstruction quality, but performance drops sharply when steps are too low (e.g., <600), indicating a critical threshold for effective denoising.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.