[Paper Review] FastFlow: Unsupervised Anomaly Detection and Localization via 2D Normalizing Flows
FastFlow introduces a 2D normalizing flow for unsupervised anomaly detection and pixel-level localization, acting as a plug-in on top of CNN or ViT feature extractors to map normal features to a standard normal distribution and use likelihoods for anomaly scoring.
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.
Motivation & Objective
- Motivate efficient unsupervised anomaly detection and localization when abnormal samples are scarce or unavailable.
- Model normal feature distributions with a 2D normalizing flow that preserves spatial structure.
- Enable end-to-end inference with a lightweight, plug-in flow module compatible with various backbones.
Proposed method
- Extend normalizing flows to 2D with fully convolutional flow blocks to preserve spatial relations.
- Use alternate 3x3 and 1x1 convolution kernels in the flow subnets to balance accuracy and efficiency.
- Train FastFlow on normal data to transform features to a standard normal distribution and use the resulting likelihoods as anomaly scores.
- Support end-to-end inference that outputs pixel-level anomaly maps directly from the 2D flow.
- Incorporate feature extractors from CNNs (e.g., ResNet) and vision transformers (ViT) as plug-ins.
Experimental results
Research questions
- RQ1Can a 2D normalizing flow effectively model global and local feature distributions for unsupervised anomaly detection?
- RQ2Does a 2D flow with fully convolutional blocks improve anomaly localization without sliding-window patch processing?
- RQ3How does FastFlow performance vary with different backbone architectures (CNN vs ViT) and flow configurations?
- RQ4Is end-to-end inference with FastFlow more efficient than patch-based or KNN-based methods while maintaining high accuracy?
Key findings
- FastFlow achieves state-of-the-art image-level AUC and competitive pixel-level AUC on MVTec AD, e.g., 99.4 image-level AUC and 98.5 pixel-level AUC with certain backbones.
- Compared to methods like Patch Core and CFlow, FastFlow offers substantially higher inference speed (up to 10x faster in some setups).
- FastFlow maintains strong performance across backbones (ViT and CNN) and benefits from 2D flow design that preserves spatial information for localization.
- Ablation studies show that alternating 3x3 and 1x1 kernels can improve performance and reduce parameters for larger backbones, while 3x3-only works better for smaller backbones.
- Qualitative results illustrate accurate localization and robust performance under non-aligned/disturbed data scenarios.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.