cs.CVSep 27, 2026

Focus and Supplement: Dual-Enhanced Vision Transformer for Multi-Class Anomaly Classification

Authors: Xurui Li, Enjie Xu, Chenzhou Li, Shilei Zeng, Dayou Huang, Tianyi Ma, Yu Zhou

Organizations: School of Electronic Information and Communications, Huazhong University of Science and Technology

Abstract

Multi-class anomaly classification in industrial vision remains challenging due to noisy/incomplete anomaly representations and the unknown number of anomaly classes. To overcome this, we propose MACO, a novel multi-class anomaly classification framework that learns comprehensive representations and dynamically estimates class number without prior knowledge. First, a soft-focus attention uses anomaly maps to concentrate on relevant abnormal regions, while suppressing background noise. Second, auxiliary classification ([A-CLS]) tokens complement the [CLS] token. They collectively attend to diverse anomaly sub-regions, yielding more holistic and discriminative features. These [A-CLS] tokens are also effective across more tasks and domains. To infer the class number, we propose Correlation-based Number Estimation strategy. It computes the average correlation among labeled classes and transfers its separability cue to the unlabeled set. Experiments on MVTec AD and MTD datasets demonstrate our superiority. Under known class number, MACO improves ARI by 6.5% and \textbf{16.3%} on both datasets, respectively. In the more challenging unknown number scenario, it achieves an \textbf{11.2%} NMI gain on MTD and outperforms existing number estimation strategies by \textbf{24.1%} UPS on MVTec AD. Code will be released at https://github.com/HUST-SLOW/MACO.

Figures & tables

Explore similar work

Jul 27, 2026cs.CV

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

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.
Jul 16, 2026cs.CV

SwinAD: Multi-stage feature reconstruction for unsupervised industrial anomaly detection

Industrial anomaly detection aims to identify and localize defective regions without relying on exhaustive annotations of all possible defect types. Although recent unsupervised methods have achieved strong performance, most are primarily designed for single-class settings and often struggle in multi-class scenarios, where diverse normal patterns may lead to over-generalization and reduce the discriminative capability between normal and anomalous regions. In this paper, we propose SwinAD, a reconstruction-based framework for multi-class unsupervised anomaly detection that leverages a frozen pretrained Swin Transformer V2 encoder and a feature diversity-preserving reconstruction decoder. The hierarchical encoder provides semantically rich multi-scale features, while stage-wise bottleneck modules with dropout prevent trivial identity mapping and encourage robust reconstruction of normal patterns. To further improve localization, we introduce a feature diversity-preserving reconstruction framework that maintains complementary reconstruction hypotheses instead of relying on a single decoding branch. The discrepancies between encoder features and the two reconstructed features are then aggregated across multiple scales to produce the final anomaly map. Experiments conducted on three industrial anomaly detection benchmarks, including MVTec AD, VisA, and Real-IAD, demonstrate that SwinAD achieves competitive image-level performance and strong pixel-level localization accuracy, with particularly notable improvements in pixel-level AP and 1 on MVTec AD. These results indicate that combining hierarchical Swin features with diverse multi-scale reconstruction substantially improve pixel-level localization in multi-class unsupervised anomaly setting.
May 12, 2026cs.CV

Anomaly-Aware Vision-Language Adapters for Zero-Shot Anomaly Detection

Zero-shot anomaly detection aims to identify defects in unseen categories without target-specific training. Existing methods usually apply the same feature transformation to all samples, treating normal and anomalous data uniformly despite their fundamentally asymmetric distributions, compact normals versus diverse anomalies. We instead exploit this natural asymmetry by proposing AVA-DINO, an anomaly-aware vision-language adaptation framework with dual specialized branches for normal and anomalous patterns that adapt frozen DINOv3 visual features. During training on auxiliary data, the two branches are learned jointly with a text-guided routing mechanism and explicit routing regularization that encourages branch specialization. At test time, only the input image and fixed, predefined language descriptions are used to dynamically combine the two branches, enabling an asymmetric activation. This design prevents degenerate uniform routing and allows context-specific feature transformations. Experiments across nine industrial and medical benchmarks demonstrate state-of-the-art performance, achieving 93.5% image-AUROC on MVTec-AD and strong cross-domain generalization to medical imaging without domain-specific fine-tuning. https://github.com/aqeeelmirza/AVA-DINO