Flow Mismatching: Unsupervised Anomaly Detection via Velocity Discrepancies in Flow Matching Models

AI in healthcare
Published: arXiv: 2605.23070v1
Authors

Shengzhe Chen Mehrdad Moradi Kamran Paynabar Hao Yan

Abstract

We propose Flow Mismatching, an unsupervised anomaly detection method that deliberately avoids reconstruction-based paradigms. Instead, we treat flow matching as geometric dynamics and leverage a key insight: anomalies occur at places where the learned normal flow disagrees with the geometric path toward a test image. Given a flow matching model trained only on normal images, we probe its learned velocity field along affine paths from Gaussian noise to a target image. Along each path, we compare the model-predicted velocity, which follows normal generative dynamics, with the geometric velocity toward the target, which includes any anomalous content. Anomalies induce strong local disagreement between these velocities. Aggregating the mismatch over different time steps and multiple paths yields pixel-wise heatmaps and image-level scores without test-time optimization, feature memories, or additional calibration. Our analysis shows that the population mismatch decomposes into an irreducible denoising term and a Fisher-divergence term between the test-path and normal-path score functions, which identifies the score-gap component that drives anomaly separation and explains the effectiveness of robust path aggregation. Extensive experiments on MVTec-AD and VisA demonstrate superior performance compared with SOTA reconstruction-based and recent flow matching-based approaches.

Paper Summary

Problem
Industrial visual anomaly detection is a challenging task that requires identifying subtle manufacturing defects in images. Anomalies are rare, diverse, and expensive to miss, making it difficult to train models on labeled data. Existing unsupervised anomaly detection methods have limitations, such as relying on reconstruction-based paradigms, feature memories, or expensive inference-time gradient computation.
Key Innovation
Flow Mismatching is a novel unsupervised anomaly detection method that avoids reconstruction-based paradigms. Instead, it treats flow matching as geometric dynamics and leverages a key insight: anomalies occur at places where the learned normal flow velocity disagrees with the geometric path velocity to the test image. Flow Mismatching aggregates per-pixel velocity discrepancies over multiple paths to produce anomaly heatmaps and image-level scores using only forward passes.
Practical Impact
Flow Mismatching has the potential to improve industrial visual anomaly detection by providing a reliable and efficient method for identifying subtle defects in images. This can lead to cost savings and improved product quality in various industries, such as manufacturing, quality control, and inspection. Additionally, Flow Mismatching can be applied to other computer vision tasks, such as anomaly detection in medical images or self-driving cars.
Analogy / Intuitive Explanation
Imagine you're driving a car, and you're trying to reach a destination. The normal flow velocity would be like following the road signs and traffic rules, while the geometric path velocity would be like the actual path you're taking to reach the destination. Anomalies would be like taking a wrong turn or encountering an obstacle, causing a mismatch between the normal flow velocity and the geometric path velocity. Flow Mismatching detects these mismatches to identify anomalies in images.
Paper Information
Categories:
cs.CV
Published Date:

arXiv ID:

2605.23070v1

Quick Actions