[Paper Review] Exploring Plain ViT Reconstruction for Multi-class Unsupervised Anomaly Detection
The paper proposes a plain Vision Transformer–based ViTAD model within a Meta-AD framework for Multi-class Unsupervised Anomaly Detection, achieving state-of-the-art results with a simple design and efficient training on MVTec AD and VisA.
This work studies a challenging and practical issue known as multi-class unsupervised anomaly detection (MUAD). This problem requires only normal images for training while simultaneously testing both normal and anomaly images across multiple classes. Existing reconstruction-based methods typically adopt pyramidal networks as encoders and decoders to obtain multi-resolution features, often involving complex sub-modules with extensive handcraft engineering. In contrast, a plain Vision Transformer (ViT) showcasing a more straightforward architecture has proven effective in multiple domains, including detection and segmentation tasks. It is simpler, more effective, and elegant. Following this spirit, we explore the use of only plain ViT features for MUAD. We first abstract a Meta-AD concept by synthesizing current reconstruction-based methods. Subsequently, we instantiate a novel ViT-based ViTAD structure, designed incrementally from both global and local perspectives. This model provide a strong baseline to facilitate future research. Additionally, this paper uncovers several intriguing findings for further investigation. Finally, we comprehensively and fairly benchmark various approaches using eight metrics. Utilizing a basic training regimen with only an MSE loss, ViTAD achieves state-of-the-art results and efficiency on MVTec AD, VisA, and Uni-Medical datasets. \Eg, achieving 85.4 mAD that surpasses UniAD by +3.0 for the MVTec AD dataset, and it requires only 1.1 hours and 2.3G GPU memory to complete model training on a single V100 that can serve as a strong baseline to facilitate the development of future research. Full code is available at https://zhangzjn.github.io/projects/ViTAD/.
Motivation & Objective
- Motivate MUAD as a practical setting requiring training on normal images across multiple classes.
- Abstract a Meta-AD framework to unify reconstruction-based anomaly detection tasks.
- Instantiate a plain ViT–based symmetric ViTAD model and study macro/micro design choices.
- Demonstrate strong performance and efficiency on standard AD benchmarks while analyzing design factors.
Proposed method
- Formalize Meta-AD with a feature Encoder, a Fuser, and a Decoder in reconstruction-based AD.
- Instantiate ViTAD as a plain columnar ViT with four stages for encoder and decoder, using a simple linear Fuser.
- Train with a single pixel-level loss across multi-stage features to produce anomaly maps.
- Investigate macro-level design factors (skip connections, pre-training, stage usage) and micro-level details (normalization, linear fusion, position encoding, CLS token).
- Use cosine similarity between encoder and decoder features at each stage to form anomaly maps and a combined loss across stages.
Experimental results
Research questions
- RQ1Can a plain (non-pyramidal) ViT architecture achieve competitive MUAD performance compared to pyramid-based methods?
- RQ2How do macro- and micro-design choices of ViTAD affect anomaly detection accuracy and localization under MUAD?
- RQ3What is the impact of pre-training regimes and feature usage on MUAD results?
- RQ4Is a lightweight Fuser sufficient for strong MUAD performance when using plain ViT features?
- RQ5What evaluation benchmarks and metrics best reflect MUAD performance and efficiency?
Key findings
- Plain ViT (ViTAD) with a simple Fuser can achieve SoTA results for MUAD on MVTec AD and VisA without complex pyramidal structures.
- Using the last stage features for the Fuser improves image-level metrics, while multi-stage features provide essential multi-scale information for localization.
- DINO-based self-supervised pre-training yields better MUAD performance than other pre-training methods, with smaller patch sizes and higher resolution improving pixel-level metrics.
- A lightweight linear Fuser suffices for strong performance, contradicting earlier claims that heavy fusion modules are necessary.
- Keeping position embedding and omitting the CLS token slightly improves or maintains performance, while pre-normalization and other micro-details have nuanced effects.
- On the MUAD task, ViTAD reaches 85.4 mAD overall with 1.1 hours training on a single V100 GPU, and image-level mAU-ROC 98.3, pixel-level mAU-ROC 97.7, among other metrics cited in the paper.
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.