A Unified Model for Multi-class Anomaly Detection
Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu, Yu Zheng, Xinyi Le
Abstract
Despite the rapid advance of unsupervised anomaly detection, existing methods require to train separate models for different objects. In this work, we present UniAD that accomplishes anomaly detection for multiple classes with a unified framework. Under such a challenging setting, popular reconstruction networks may fall into an "identical shortcut", where both normal and anomalous samples can be well recovered, and hence fail to spot outliers. To tackle this obstacle, we make three improvements. First, we revisit the formulations of fully-connected layer, convolutional layer, as well as attention layer, and confirm the important role of query embedding (i.e., within attention layer) in preventing the network from learning the shortcut. We therefore come up with a layer-wise query decoder to help model the multi-class distribution. Second, we employ a neighbor masked attention module to further avoid the information leak from the input feature to the reconstructed output feature. Third, we propose a feature jittering strategy that urges the model to recover the correct message even with noisy inputs. We evaluate our algorithm on MVTec-AD and CIFAR-10 datasets, where we surpass the state-of-the-art alternatives by a sufficiently large margin. For example, when learning a unified model for 15 categories in MVTec-AD, we surpass the second competitor on the tasks of both anomaly detection (from 88.1% to 96.5%) and anomaly localization (from 89.5% to 96.8%). Code is available at https:// github.com/zhiyuanyou/UniAD .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f1a65e91-b9a5-4e11-afff-04e56899c5e2Cited by top-tier papers97
- AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly DetectionQihang Zhou, Guansong Pang, Yu Tian, Shibo He et al.ICLR 2024 · 380 citations
- AnomalyGPT: Detecting Industrial Anomalies Using Large Vision-Language ModelsZhaopeng Gu, Bingke Zhu, Guibo Zhu, Yingying Chen et al.AAAI 2024 · 312 citations
- MambaAD: Exploring State Space Models for Multi-class Unsupervised Anomaly DetectionHaoyang He, Yuhu Bai, Jiangning Zhang, Qingdong He et al.NeurIPS 2024 · 251 citations
- A Diffusion-Based Framework for Multi-Class Anomaly DetectionHaoyang He, Jiangning Zhang, Hongxu Chen, Xuhai Chen et al.AAAI 2024 · 231 citations
- RealNet: A Feature Selection Network with Realistic Synthetic Anomaly for Anomaly DetectionXimiao Zhang, Min Xu, Xiuzhuang ZhouCVPR 2024 · 140 citations
Builds on17
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Memorizing Normality to Detect Anomaly: Memory-Augmented Deep Autoencoder for Unsupervised Anomaly DetectionDong Gong, Lingqiao Liu, Vuong Le, Budhaditya Saha et al.ICCV 2019 · 1,646 citations
- Anomaly Detection via Reverse Distillation from One-Class EmbeddingHanqiu Deng, Xingyu LiCVPR 2022 · 701 citations
- Explainable Deep One-Class ClassificationPhilipp Liznerski, Lukas Ruff, Robert A. Vandermeulen, Billy Joe Franks et al.ICLR 2021 · 240 citations
- Learning Semantic Context from Normal Samples for Unsupervised Anomaly DetectionXudong Yan, Huaidong Zhang, Xuemiao Xu, Xiaowei Hu et al.AAAI 2021 · 210 citations
Related papers
- MaskAD: Parallel Masked Autoencoder for Multi-class Unsupervised Anomaly DetectionRuiying Lu, Gang Liu, Kang Li, Long Tian et al.AAAI 2026
- UniMMAD: Unified Multi-Modal and Multi-Class Anomaly Detection via MoE-Driven Feature DecompressionYuan Zhao, Youwei Pang, Lihe Zhang, Hanqi Liu et al.CVPR 2026 · 4 citations
- Hierarchical Vector Quantized Transformer for Multi-class Unsupervised Anomaly DetectionRuiying Lu, Yujie Wu, Long Tian, Dongsheng Wang et al.NeurIPS 2023 · 121 citations
- One-for-All: Proposal Masked Cross-Class Anomaly DetectionXincheng Yao, Chongyang Zhang, Ruoqi Li, Jun Sun et al.AAAI 2023 · 42 citations
- Dinomaly: The Less Is More Philosophy in Multi-Class Unsupervised Anomaly DetectionJia Guo, Shuai Lu, Weihang Zhang, Fang Chen et al.CVPR 2025
