CLIP Meets Diffusion: A Synergistic Approach to Anomaly Detection
Byeongchan Lee, John Won, Seunghyun Lee, Jinwoo Shin
TL;DR
This work tackles anomaly detection under zero-shot and few-shot constraints by fusing discriminative CLIP signals with diffusion-based local features. The proposed CLIPFUSION framework comprises PatchCLIP for global cues and MapDiff for local details, combining language-guided heatmaps and diffusion cross-attention maps into a unified score map via $M := \alpha (M^{\texttt{CLIP}, L}+M^{\texttt{CLIP}, V}) + (1-\alpha) (M^{\texttt{Diff}, L}+M^{\texttt{Diff}, V})$. In zero-shot, only language-guided maps are used, while few-shot benefits come from memory-bank comparisons of features from both models. Experiments on MVTec-AD and VisA show state-of-the-art performance in anomaly segmentation and classification across zero-/few-shot settings, with faster inference than competitive baselines. The results highlight the practical value of multi-modal, multi-model fusion for scalable, real-world anomaly detection and suggest broader applicability to other recognition tasks.
Abstract
Anomaly detection is a complex problem due to the ambiguity in defining anomalies, the diversity of anomaly types (e.g., local and global defect), and the scarcity of training data. As such, it necessitates a comprehensive model capable of capturing both low-level and high-level features, even with limited data. To address this, we propose CLIPFUSION, a method that leverages both discriminative and generative foundation models. Specifically, the CLIP-based discriminative model excels at capturing global features, while the diffusion-based generative model effectively captures local details, creating a synergistic and complementary approach. Notably, we introduce a methodology for utilizing cross-attention maps and feature maps extracted from diffusion models specifically for anomaly detection. Experimental results on benchmark datasets (MVTec-AD, VisA) demonstrate that CLIPFUSION consistently outperforms baseline methods, achieving outstanding performance in both anomaly segmentation and classification. We believe that our method underscores the effectiveness of multi-modal and multi-model fusion in tackling the multifaceted challenges of anomaly detection, providing a scalable solution for real-world applications.
