A Unified Model for Multi-class Anomaly Detection

Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu +2 more
6/8/2022
cs.CV
transformer-attention

Official code: zhiyuanyou/UniAD (332 stars, Python, Apache-2.0, last commit 2022-11-22).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

zhiyuanyou/UniADOfficial100%
Apache-2.0

[NeurIPS 2022 Spotlight] A Unified Model for Multi-class Anomaly Detection

33234Python, ShellSep 16, 20224 years agoApache-2.0

Similar Papers

Cite this paper

@article{you2022unified,
  title  = {A Unified Model for Multi-class Anomaly Detection},
  author = {Zhiyuan You and Lei Cui and Yujun Shen and Kai Yang and Xin Lu and Yu Zheng and Xinyi Le},
  year   = {2022},
  eprint = {2206.03687},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.03687}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2206.03687.svg)](https://codeofpaper.com/paper/2206.03687)

Discussion