Industrial Anomaly Detection and Localization Using Weakly-Supervised Residual Transformers

6 Jun 2023  ·  Hanxi Li, Jingqi Wu, Lin Yuanbo Wu, Hao Chen, Deyin Liu, Mingwen Wang, Peng Wang ·

Recent advancements in industrial Anomaly Detection (AD) have shown that incorporating a few anomalous samples during training can significantly boost accuracy. However, this performance improvement comes at a high cost: extensive annotation efforts, which are often impractical in real-world applications. In this work, we propose a novel framework called "Weakly-supervised RESidual Transformer" (WeakREST), which aims to achieve high AD accuracy while minimizing the need for extensive annotations. First, we reformulate the pixel-wise anomaly localization task into a block-wise classification problem. By shifting the focus to block-wise level, we can drastically reduce the amount of required annotations without compromising on the accuracy of anomaly detection Secondly, we design a residual-based transformer model, termed "Positional Fast Anomaly Residuals" (PosFAR), to classify the image blocks in real time. We further propose to label the anomalous regions using only bounding boxes or image tags as weaker labels, leading to a semi-supervised learning setting. On the benchmark dataset MVTec-AD, our proposed WeakREST framework achieves a remarkable Average Precision (AP) of 83.0%, significantly outperforming the previous best result of 75.8% in the unsupervised setting. In the supervised AD setting, WeakREST further improves performance, attaining an AP of 87.6% compared to the previous best of 78.6%. Notably, even when utilizing weaker labels based on bounding boxes, WeakREST surpasses recent leading methods that rely on pixel-wise supervision, achieving an AP of 87.1% against the prior best of 78.6% on MVTec-AD. This precision advantage is also consistently observed on other well-known AD datasets, such as BTAD and KSDD2.

PDF Abstract

Results from the Paper


 Ranked #1 on Anomaly Detection on BTAD (using extra training data)

     Get a GitHub badge
Task Dataset Model Metric Name Metric Value Global Rank Uses Extra
Training Data
Result Benchmark
Supervised Anomaly Detection BTAD WeakREST-Block Segmentation AP 84.6 # 1
Segmentation AUPRO 90.8 # 2
Segmentation AUROC 99.3 # 1
Detection AUROC 96.5 # 2
Anomaly Detection BTAD WeakREST-Un Segmentation AUROC 98.7 # 1
Detection AUROC 94.4 # 8
Segmentation AUPRO 84.9 # 3
Segmentation AP 63.1 # 2
Unsupervised Anomaly Detection KolektorSDD2 WeakREST-Un Segmentation AUROC 99.7 # 1
Segmentation AUPRO 98.5 # 1
Segmentation AP 76.9 # 1
Supervised Anomaly Detection MVTec AD WeakREST-Block Detection AUROC 99.8 # 1
Segmentation AUROC 99.7 # 1
Segmentation AUPRO 98.4 # 1
Segmentation AP 87.6 # 1
Anomaly Detection MVTec AD WeakREST-Un Detection AUROC 99.6 # 14
Segmentation AUROC 99.3 # 1
Segmentation AUPRO 97.6 # 5
Segmentation AP 83.0 # 1
FPS 25.2 # 16

Methods