FastFlow: Unsupervised Anomaly Detection and Localization via 2D Normalizing Flows

15 Nov 2021  ·  Jiawei Yu, Ye Zheng, Xiang Wang, Wei Li, Yushuang Wu, Rui Zhao, Liwei Wu ·

Unsupervised anomaly detection and localization is crucial to the practical application when collecting and labeling sufficient anomaly data is infeasible. Most existing representation-based approaches extract normal image features with a deep convolutional neural network and characterize the corresponding distribution through non-parametric distribution estimation methods. The anomaly score is calculated by measuring the distance between the feature of the test image and the estimated distribution. However, current methods can not effectively map image features to a tractable base distribution and ignore the relationship between local and global features which are important to identify anomalies. To this end, we propose FastFlow implemented with 2D normalizing flows and use it as the probability distribution estimator. Our FastFlow can be used as a plug-in module with arbitrary deep feature extractors such as ResNet and vision transformer for unsupervised anomaly detection and localization. In training phase, FastFlow learns to transform the input visual feature into a tractable distribution and obtains the likelihood to recognize anomalies in inference phase. Extensive experimental results on the MVTec AD dataset show that FastFlow surpasses previous state-of-the-art methods in terms of accuracy and inference efficiency with various backbone networks. Our approach achieves 99.4% AUC in anomaly detection with high inference efficiency.

PDF Abstract

Results from the Paper


Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Anomaly Detection MVTec AD Fastflow Detection AUROC 99.4 # 20
Segmentation AUROC 98.5 # 19
FPS 21.8 # 14
Anomaly Detection MVTec LOCO AD FastFlow Avg. Detection AUROC 79.2 # 24
Detection AUROC (only logical) 75.5 # 22
Detection AUROC (only structural) 82.9 # 24
Segmentation AU-sPRO (until FPR 5%) 56.8 # 11
Anomaly Detection One-class CIFAR-10 FastFlow AUROC 66.7 # 30
Anomaly Detection VisA FastFlow Segmentation AUPRO (until 30% FPR) 59.8 # 22

Methods