cs.CVOct 30, 2026

VariaFlow: Uncertainty-Aware Flow Matching for Unsupervised Anomaly Detection

Authors: Arnela Hadzic, Martin Urschler, Cosmin I. Bercea

Organizations: Institute for Medical Informatics, Statistics and Documentation, Medical University of Graz, Graz, Austria · Institute of Visual Computing, Graz University of Technology, Graz, Austria · Technical University of Munich, School of Medicine and Health, TUM University Hospital, Klinikum rechts der Isar, Department of Diagnostic and Interventional Radiology, Munich, Germany

Abstract

Reconstruction-based anomaly detection no longer fails at reconstruction. Generative models produce high-quality pseudo-healthy reconstructions, and the remaining difficulty is the step of scoring residuals. The residual between a scan and its reconstruction has two indistinguishable sources, genuine pathology and the anatomical variation that separates one healthy brain from another. Scoring against a single reconstruction treats both as anomalous, inflating false positives where healthy anatomy varies most while small or subtle lesions are lost in the surrounding reconstruction error. We identify the missing quantity as the predictive variance, how much a healthy reconstruction can vary at each location. We introduce VariaFlow, which estimates this variance from an ensemble of mask-guided restorations under an unconditional flow matching prior, each started from a different noise initialization, and which normalizes the residual by the resulting standard deviation. Few-step flow matching keeps the ensemble computationally affordable, and restoring at two spatial scales captures lesions of different size. Across three brain MRI datasets spanning stroke and tumor, VariaFlow is trained once on healthy anatomy and generalizes across all three, attaining the highest AUROC (0.94, 0.80, 0.78) on each and the highest AUPRC on both cross-domain datasets, exceeding the strongest baseline by 37% and 50%. Under domain shift, the same baseline drops by up to 52% in AUPRC, whereas VariaFlow stays more stable and achieves the best small-lesion Dice on all three datasets.

Figures & tables

Explore similar work

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

    May 21, 2026Shengzhe Chen, Mehrdad Moradi, Kamran Paynabar +1Flow MatchingIndustrial Anomaly Detection

  2. Reconstruction-Shift Discrimination via Mask-Guided Latent Diffusion for Medical Anomaly Detection

    Aug 1, 2026Yibo Wan, Jinyu Cai, Yunhe Zhang +2Latent Diffusion ModelsMedical Image Anomaly Detection

  3. Unsupervised Brain Anomaly Detection as a Bayesian Inverse Problem with Diffusion Prior

    Sep 21, 2026Hugues Roy, Reuben Dorent, Ninon BurgosMedical Image Anomaly DetectionAnomaly Localization