[Paper Review] MSFlow: Multi-Scale Flow-based Framework for Unsupervised Anomaly Detection
MSFlow proposes a multi-scale flow-based framework for unsupervised anomaly detection and localization, leveraging asymmetrical parallel flows and a lightweight fusion flow to capture multi-scale representations. It achieves state-of-the-art performance on MVTec AD, with 99.7% AUCROC for detection and 98.8% for localization.
Unsupervised anomaly detection (UAD) attracts a lot of research interest and drives widespread applications, where only anomaly-free samples are available for training. Some UAD applications intend to further locate the anomalous regions without any anomaly information. Although the absence of anomalous samples and annotations deteriorates the UAD performance, an inconspicuous yet powerful statistics model, the normalizing flows, is appropriate for anomaly detection and localization in an unsupervised fashion. The flow-based probabilistic models, only trained on anomaly-free data, can efficiently distinguish unpredictable anomalies by assigning them much lower likelihoods than normal data. Nevertheless, the size variation of unpredictable anomalies introduces another inconvenience to the flow-based methods for high-precision anomaly detection and localization. To generalize the anomaly size variation, we propose a novel Multi-Scale Flow-based framework dubbed MSFlow composed of asymmetrical parallel flows followed by a fusion flow to exchange multi-scale perceptions. Moreover, different multi-scale aggregation strategies are adopted for image-wise anomaly detection and pixel-wise anomaly localization according to the discrepancy between them. The proposed MSFlow is evaluated on three anomaly detection datasets, significantly outperforming existing methods. Notably, on the challenging MVTec AD benchmark, our MSFlow achieves a new state-of-the-art with a detection AUORC score of up to 99.7%, localization AUCROC score of 98.8%, and PRO score of 97.1%. The reproducible code is available at https://github.com/cool-xuan/msflow.
Motivation & Objective
- Address the challenge of unpredictable anomaly size variation in unsupervised anomaly detection, especially for pixel-wise localization.
- Overcome the limitations of existing flow-based methods that struggle with small or large anomalies due to fixed-scale feature representations.
- Design a multi-scale architecture that enhances both image-wise detection and pixel-wise localization through scale-specific and fused feature learning.
- Develop distinct aggregation strategies for detection and localization to exploit the inherent differences between the two tasks.
- Achieve state-of-the-art performance on benchmark datasets, particularly on the challenging MVTec AD dataset.
Proposed method
- Construct a multi-scale feature pyramid using activation outputs from low-level network stages to preserve spatial details for precise localization.
- Implement asymmetrical parallel flows that apply more flow blocks to higher-level features, enabling deeper modeling of global patterns.
- Introduce a lightweight fusion flow to exchange multi-scale perceptions across different levels, improving representation learning without excessive computation.
- Use addition-based aggregation for pixel-wise anomaly localization to retain scale-specific details, and multiplication-based aggregation for image-wise detection to suppress noise and highlight consistent anomalies.
- Compute image-wise anomaly scores using the mean of the top K pixel-wise anomaly scores, with K dynamically determined via occupancy ratio for robustness.
- Optimize the model end-to-end using normalizing flows trained solely on anomaly-free data, leveraging likelihood estimation to identify low-probability anomalies.
Experimental results
Research questions
- RQ1How can flow-based models be adapted to handle extreme variations in anomaly size, from small defects to large-scale anomalies?
- RQ2What is the optimal multi-scale architecture for combining feature representations across different levels to improve both detection and localization?
- RQ3How should multi-scale likelihood outputs be aggregated differently for image-wise detection versus pixel-wise localization to maximize performance?
- RQ4What hyperparameter settings (e.g., K in top-K aggregation) yield robust and optimal detection performance across diverse anomaly types?
- RQ5Can a flow-based framework achieve state-of-the-art performance in unsupervised anomaly detection and localization without any anomaly annotations?
Key findings
- MSFlow achieves a new state-of-the-art on the MVTec AD benchmark with a detection AUCROC score of 99.7%, surpassing prior methods.
- For pixel-wise localization, MSFlow attains a localization AUCROC score of 98.8%, demonstrating high precision in identifying anomalous regions.
- The PRO score reaches 97.1%, indicating strong performance on region-level anomaly detection that accounts for spatial connectivity.
- Multiplication-based aggregation outperforms addition for image-wise detection by suppressing noise and emphasizing consistent anomalies across scales.
- Addition-based aggregation yields better localization performance by preserving scale-specific anomaly cues.
- The model’s detection performance is robust to K in top-K aggregation, maintaining over 99.2% AUCROC across 1% to 10%, with optimal performance at 2–3% occupancy ratio.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.