DuoAD: Leveraging [CLS] Dual Characteristics for Training-Free Few-Shot Anomaly Detection

📅 2026-07-26
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work proposes a fully automatic, training-free few-shot anomaly detection framework that addresses the limitation of existing methods, which predominantly rely on local image patch features while overlooking the global contextual information embedded in the [CLS] token of Vision Transformers. The study is the first to reveal and exploit the dual nature of the [CLS] token: its global semantic invariance and its attention map’s ability to indicate spatial anomalies. By integrating a semantic consistency-driven automatic augmentation strategy with an attention-guided dynamic feature reweighting mechanism, the method achieves precise anomaly localization and scoring without manual hyperparameter tuning. Under single-sample settings on MVTec-AD, VisA, and Real-IAD, it attains Image-AUC scores of 97.7%, 93.2%, and 84.5%, respectively, demonstrating plug-and-play state-of-the-art performance across categories, backbone architectures, and datasets.
📝 Abstract
Vision foundation models have enabled strong training-free anomaly detection (AD). However, most existing approaches rely primarily on independent local patch features, leaving the global contextual information encoded by Vision Transformers (ViTs) underexploited. In this work, we identify the dual characteristics of the ViT [CLS] token: its embedding provides anomaly-invariant global semantic representation, while its attention maps implicitly highlight spatially abnormal regions. Building on this observation, we propose a fully automated AD framework leveraging global context to remove manual tunings. Our framework introduces (1) an automatic augmentation selection strategy driven by [CLS]-level semantic consistency, and (2) an attention-guided feature reweighting mechanism that dynamically adjusts patch contributions according to [CLS] attention saliency. By integrating these components over multi-level features, our method achieves stable anomaly scoring and precise localization without training or parameter tuning. Under the one-shot setting, it achieves Image-AUC scores of 97.7%, 93.2%, and 84.5% on MVTec-AD, VisA, and Real-IAD. Using a single fixed configuration across categories, backbones, and datasets, the method establishes a new state-of-the-art for plug-and-play, training-free anomaly detection while maintaining strong robustness and practical scalability.
Problem

Research questions and friction points this paper is trying to address.

anomaly detection
training-free
Vision Transformers
global context
few-shot
Innovation

Methods, ideas, or system contributions that make the work stand out.

training-free anomaly detection
Vision Transformer [CLS] token
attention-guided reweighting
semantic consistency
few-shot AD