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

**Authors:** Jiawei Yu1, Ye Zheng, Xiang Wang, Wei Li, Yushuang Wu, Rui Zhao, Liwei Wu1  
**arXiv:** [2111.07677](https://arxiv.org/abs/2111.07677)  
**Date:** 2021-11-15  
**Summary page:** https://www.summarizepaper.com/en/paper/2111.07677v1/

## Key points

- FastFlow is a proposed method for unsupervised anomaly detection and localization using 2D normalizing flows.
- Existing approaches use deep convolutional neural networks to extract normal image features and estimate the distribution through non-parametric methods.
- Current methods struggle to effectively map image features to a tractable base distribution and overlook the relationship between local and global features.
- FastFlow utilizes 2D normalizing flows as a probability distribution estimator, addressing these limitations.
- It can be used with various deep feature extractors like ResNet and vision transformers for unsupervised anomaly detection and localization.
- During training, FastFlow learns to transform input visual features into a tractable distribution and obtains likelihood values for recognizing anomalies during inference.
- Extensive experiments on the MVTec AD dataset show that FastFlow outperforms previous state-of-the-art methods in terms of accuracy and inference efficiency when combined with different backbone networks.
- FastFlow achieves an impressive 99.4% AUC (Area Under Curve) in anomaly detection while maintaining high inference efficiency.
- FastFlow presents a promising solution for unsupervised anomaly detection and localization by leveraging 2D normalizing flows as an effective probability distribution estimator.
- Its superior performance compared to existing methods highlights its potential for practical applications where collecting labeled anomaly data is challenging or impractical.

## Summary

FastFlow is a proposed method for unsupervised anomaly detection and localization using 2D normalizing flows. Anomaly detection is important when it is not feasible to collect and label sufficient anomaly data. Existing approaches typically extract normal image features using deep convolutional neural networks and estimate the corresponding distribution through non-parametric methods. The anomaly score is then calculated by measuring the distance between the test image feature and the estimated distribution. However, current methods struggle to effectively map image features to a tractable base distribution and overlook the relationship between local and global features, which are crucial for identifying anomalies. To address these limitations, FastFlow utilizes 2D normalizing flows as a probability distribution estimator. It can be used as a plug-in module with various deep feature extractors like ResNet and vision transformers for unsupervised anomaly detection and localization. During the training phase, FastFlow learns to transform input visual features into a tractable distribution and obtains likelihood values for recognizing anomalies during inference. Extensive experiments conducted on the MVTec AD dataset demonstrate that FastFlow outperforms previous state-of-the-art methods in terms of accuracy and inference efficiency when combined with different backbone networks. The approach achieves an impressive 99.4% AUC (Area Under Curve) in anomaly detection while maintaining high inference efficiency. Overall, FastFlow presents a promising solution for unsupervised anomaly detection and localization by leveraging 2D normalizing flows as an effective probability distribution estimator. Its superior performance compared to existing methods highlights its potential for practical applications where collecting labeled anomaly data is challenging or impractical.
