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

arXiv:2605.23070 · cs.CV · Submitted 2026-05-21 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: We're looking at the paper: "Flow Mismatching: Unsupervised Anomaly Detection via Velocity Discrepancies in Flow Matching Models".

Jane: Here's the gist of the paper. Flow Mismatching is an unsupervised anomaly detection method that leverages velocity discrepancies in flow matching models to identify anomalies where learned normal flow disagrees with geometric paths toward test images Abstract Core Methodology The method treats flow matching as geometric dynamics and exploits the insight that anomalies occur where the learned normal flow velocity disagrees with the geometric path velocity toward a test image Page 1>.

Tom: Given a flow matching model trained only on normal images, it probes its learned velocity field along affine paths from Gaussian noise to a target image, comparing the model-predicted velocity with the geometric velocity toward the target Page 1>.

Jane: Anomalies induce strong local disagreement between these velocities Page 1>.

Tom: Theoretical Foundation The analysis formalizes that the velocity mismatch signal decomposes into two interpretable terms: a denoising error that captures irreducible uncertainty, and a Fisher-divergence term between the test-path and normal-path score functions Page 1>.

Title and authors: Jane: We've seen that Flow Mismatching is a method for finding anomalies in images by looking at velocity discrepancies in flow matching models, and we know it avoids reconstruction methods. But who are the authors behind this work?

Tom: The paper is titled Flow Mismatching: Unsupervised Anomaly Detection via Velocity Discrepancies in Flow Matching Models, and the authors are Shengzhe Chen, Mehrdad Moradi, Kamran Paynabar, and Hao Yan >

Lu: Lu is interested in the underlying idea here—how this approach treats flow matching as geometric dynamics rather than a standard generative model—and he's looking at what that means for representation learning >

Meng: I'm more focused on what it costs to run this. How much compute does this actually take compared to a standard inference pipeline, and can we even deploy something with K times T?

Jane: That’s the practical question right there. So Lu, how does treating flow matching as geometric dynamics specifically help in the anomaly detection process?

Lu: It helps because it allows them to leverage an insight that anomalies occur at places where the learned normal flow velocity disagrees with the geometric path toward a test image >

Tom: So if we put it that plainly, they are comparing two velocities: one predicted by the model following normal generative dynamics, and another which is just what's geometrically happening to get from noise to the target image >

Jane: That makes sense. But what is the specific mechanism that causes those two velocities to disagree strongly only in anomalous regions?

Lu: The paper formalizes this by showing that this velocity mismatch signal decomposes into a denoising error term and a Fisher divergence term between score functions >

Meng: A decomposition sounds good for theory, but does it translate into something concrete we can use to tune the detector on our production images?

Tom: It translates into having two distinct signals: one part captures irreducible uncertainty, and the other is a measure of how different the test path's score function is from the normal path's score function >

Jane: So it’s not just one big error; it’s broken down into a noise component and a true signal that points directly to where something is wrong >

Lu: Yeah, and Theorem four point three shows that this weighted velocity mismatch decomposes into a denoising error term and a Fisher divergence term between score functions > <ref:2605.23070#pg2>

Tom: That's the formal proof that separates the anomaly detection from just general model uncertainty >

The paper's summary: Jane: Okay, we know it’s about velocity discrepancies, but can you give us a high-level summary of what Flow Mismatching actually does and what it achieves?

Lu: The main thing is that if you train the flow matching model only on normal images, the learned field describes normal generative dynamics >

Tom: So when you test with an anomalous image, that anomalous content causes a strong local disagreement between the learned normal flow velocity and the geometric path toward that target image >

Jane: So they then aggregate these mismatches over different time steps and multiple paths to generate pixel wise heatmaps and image level scores without needing any extra components like memory banks or pretrained feature extractors >

Meng: That’s a big win for deployment because it means we can get the results with just forward passes, which is what I need >

Lu: They achieve this by constructing affine paths from random Gaussian noise to a possibly anomalous target image and comparing the two velocities along each path >

Tom: It avoids having to reconstruct the image or find specific features, which is really interesting because it’s a test time detection method >

Jane: So in essence, it's a detector that uses the flow model’s internal dynamics to flag places where those dynamics break when they encounter something unexpected >

Lu: That's right, and they propose Flow Mismatching as an unsupervised anomaly detection method that deliberately avoids reconstruction-based paradigms >

The paper's improvements: Tom: So what are the specific improvements they suggest over previous methods? What’s the advantage here?

Jane: One of the key suggested improvements is this explicit theoretical grounding for anomaly separation, which shows that velocity mismatch separates defects >

Lu: That’s because it leverages that decomposition into a denoising error term and a Fisher divergence term between score functions >

Tom: So they aren't just saying "it works," they are proving *why* the velocity mismatch is the right signal to look for, not just any error in the flow prediction >

Jane: They also offer a more robust way to aggregate these signals by using an aggregator A, like a minimum aggregator which suppresses path specific spurious responses and reduces false positives >

Meng: From my standpoint, suppressing false positives is crucial because I don't want my model flagging every little texture as an anomaly just because one random path got lucky >

Tom: That makes sense. So they are using that aggregation to ensure that only pixels consistently anomalous across paths retain high scores >

Lu: And they also have this time weighting w of t equals t squared which balances stable early semantic evidence with sharp late localization, which reduces estimator variance while keeping the integral well posed near zero >

Jane: So it’s a multi-scale approach that combines both the temporal stability and the geometric path comparison to get a robust result across different scales >

Lu: They also showed that this joint scaling of K equal to T equal to ten resulted in an I AUROC of ninety-eight point seven, which is a solid metric showing that tuning those parameters actually pays off >

Conclusion: Tom: So to wrap up, Flow Mismatching is a method for finding anomalies by looking at velocity discrepancies in flow matching models that’s unsupervised and tunable for different use cases.

Jane: It’s a test-time detector that lets practitioners choose their operating point based on whether they need speed or high accuracy >

Lu: The paper's limitation is that the theoretical interpretation assumes the learned flow is a good approximation of the oracle normal flow; if it's under trained, the score gap might not cleanly reflect population level Fisher divergence signals >

Meng: And they also flag that scaling up to substantially larger images could increase both memory usage and inference cost >

Tom: So that’s our final word on this paper and Flow Mismatching, which is a novel way to use flow matching for unsupervised anomaly detection.

Arizona State University · Georgia Institute of Technology

cs.CV

Submitted: 2026-05-21

Updated: 2026-11-14

Comments: 55 pages (main text + appendix). NeurIPS 2026 preprint. Project page: https://hyan46.github.io/yan-flow-mismatching-neurips-2026/

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

Importance score: 97/100

The gist: Flow Mismatching is an unsupervised anomaly detection method that leverages velocity discrepancies in flow matching models to identify anomalies where learned normal flow disagrees with geometric…

Key concepts

Flow Matching
This is a model trained to predict the velocity field that moves noise toward a target image. The paper treats this learned flow as geometric dynamics, allowing researchers to probe how the model 'flows' compared to ideal physical paths.
Velocity Mismatch
This is the core anomaly signal. It measures the difference between two velocities: what the trained model predicts for a specific path and what the actual geometric path velocity should be toward a test image. Large mismatches indicate an anomaly.
Fisher-Divergence Term
This term mathematically explains why velocity mismatch separates defects. It quantifies the difference between score functions (which represent the learned flow) along different paths, providing a clear signal for where anomalies are located.

Terminology

Summary

Flow Mismatching is an unsupervised anomaly detection method that leverages velocity discrepancies in flow matching models to identify anomalies where learned normal flow disagrees with geometric paths toward test images Abstract

Core Methodology

The method treats flow matching as geometric dynamics and exploits the insight that anomalies occur where the learned normal flow velocity disagrees with the geometric path velocity toward a test image Page 1>. Given a flow matching model trained only on normal images, it probes its learned velocity field along affine paths from Gaussian noise to a target image, comparing the model-predicted velocity with the geometric velocity toward the target Page 1>. p. 0 Anomalies induce strong local disagreement between these velocities Page 1>. p. 0

Theoretical Foundation

The analysis formalizes that the velocity mismatch signal decomposes into two interpretable terms: a denoising error that captures irreducible uncertainty, and a Fisher-divergence term between the test-path and normal-path score functions Page 1>. This decomposition explains why velocity mismatch separates defects Page 1>. p. 1 Specifically, Theorem 4. p. 33 shows that the weighted velocity mismatch decomposes into a denoising error term and a Fisher divergence term between score functions Page 6>. p. 0

Signal Aggregation and Weighting

To ensure robustness, the method aggregates per-pixel velocity discrepancies over multiple paths using an aggregator A, such as the minimum aggregator which acts as consensus voting to reduce false positives Page 4>. Time discretization is performed using evenly spaced interior times T = n j T +1: j = 1,. p. 3.., To, and a time-dependent weight function w(t) = t squared is used for weighting Page 4>. p. 3 This weighting balances stable early semantic evidence with sharp late localization, reducing estimator variance while keeping the integral well posed near t = 0 Page 6>. p. 6 p. 6

Performance and Scaling

Flow Mismatching achieves competitive performances on MVTec-AD and VisA, matching or surpassing SOTA reconstruction-based benchmarks Page 9>. The method exposes an explicit test-time compute knob where K controls path-wise robustness and T controls multi-noise-scale evidence Page 4>. p. 3 Empirical ablation confirms that accuracy improves with increased test-time compute, while modest K, T still yield reasonable results Page 8>. p. 3 The statistical guarantees show that only K ≳ log(omegaT) paths are needed for uniform control over all pixels and times Page 17>. p. 3

Comparison with Existing Methods

Flow Mismatching matches or surpasses SOTA reconstruction-based benchmarks including CFLOW-AD and MambaAD Page 9>. In comparison to other flow matching-based methods, the authors show that Flow Mismatching yields the leading best results on both datasets Page 9>. p. 8 The method's ability to capture small anomalies accurately is demonstrated through qualitative results in Figure 13 and Figure 14 Page 34, Page 35>.

Limitations

One limitation is that Flow Mismatching requires O(KT) forward evaluations per test image, meaning its throughput depends directly on the chosen test-time compute budget Page 25>. Furthermore, the theoretical interpretation assumes that the learned flow is a good approximation of the oracle normal flow; if under-trained, the score gap may not cleanly reflect population-level Fisher-divergence signals Page 31>. p. 0 Finally, experiments focus on industrial anomaly benchmarks at moderate image resolutions, and scaling to substantially larger images may increase both memory usage and inference cost Page 25>.

Implementation Details

The velocity field is parameterized using a time-conditioned attention U-Net architecture Page 16>. The training objective uses the standard flow-matching regression objective with affine interpolants and target velocity, optimized with StableAdamW Page 16>. p. 2 The default setting involves sampling K = 10 paths and using T = 10 time steps (i. p. 8e., KT = 100 model forward evaluations per image) with the minimum aggregator applied Page 5>. p. 7

Ablation Study Insights

The ablation study on test-time compute shows that larger K and T improve performance monotonically, and even the smallest setting K=T=2 yields reasonable results Page 8>. The minimum aggregator is justified because it suppresses path specific spurious responses and reduces false positives by targeting lower tail evidence across seeds Page 18>. p. 8 The joint scaling of K=T shows that the performance gains are significant, with Joint K = T = 10 resulting in an I-AUROC of 98. p. 47 Page 31>.

Pooled Category Analysis

When normal data are pooled from several categories, the mismatch signal remains valid because each test path is anchored at the same endpoint y Page 19>. The t squared weighting further suppresses early-time discrepancies, yielding a stable aggregated score Page 19>. p. 5 Path aggregation provides an additional stabilizing effect by reducing sensitivity to any individual seed and preserving mismatch patterns consistent across paths Page 19>. p. 0

Time Weighting Rationale

The time weighting w(t) = t squared arises naturally from variance-weighted loss in y-space, translating to t squared on velocity residuals after accounting for the (1 − t) squared scaling factor Page 4>. This weighting balances stable early semantic evidence with sharp late localization, reducing estimator variance while keeping the integral well posed near t = 0 Page 6>. The analysis shows that small t emphasizes Fisher (score) mismatch and large t emphasizes denoising error under (7) Page 14>. p. 0

Conclusion on Robustness

The final implemented heatmap H(i) is computed by aggregating velocity mismatches over time, using the minimum aggregator for paths, and applying the time-dependent weight w(t) = t squared Page 4>. This directly implements the theoretical decomposition at the pixel level and provides a conservative lower-tail analogue of the population mismatch signal Page 4>. p. 7 The method is designed to be flexible, allowing practitioners to choose an appropriate operating point depending on their latency and accuracy requirements Page 18>. p. 3

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Improved Anomaly Detection Capability: The system can detect anomalies by comparing the model-predicted velocity, which follows normal generative dynamics, with the geometric velocity toward the target, allowing it to identify anomalies at places where the learned normal flow velocity disagrees with the geometric path toward a test image.

  2. Enhanced Test-Time Compute Flexibility: The detector offers a tunable compute mechanism where increasing K (number of paths) and T (time steps) allows practitioners to choose between high-throughput processing or accuracy-critical inspection, with complexity remaining at O(KT).

  3. Robust Localization via Conservative Aggregation: By using the minimum aggregator for path discrepancy, the system ensures that only pixels consistently anomalous across paths retain high scores, which is justified by the observation that minimum aggregation suppresses path specific spurious responses and reduces false positives.

  4. Theoretical Grounding for Separation: The method leverages a theoretical decomposition showing the velocity mismatch signal separates 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.

  5. Multi-Scale Information Integration: By aggregating over time with a weight function w(t) = t squared, the system balances evidence by emphasizing later times for localization while integrating over the full trajectory, as multi-t weighting combines both stable early semantic evidence and sharp late localization.

  6. Robustness to Sample Variability: The use of K independent Gaussian seeds and aggregation allows the method to approximate expectations over x0 for a test image y, providing statistical guarantees that ensure uniform control over all pixels and times.

Sources

Related papers