Flownomaly: Single-Step Conditional-Mean Recovery for Few-Shot Anomaly Detection

Bernardo Perrone Ribeiro, Erkut Akdag, Egor Bondarev
10/23/2026
cs.CVcs.LG

Official code: b-rbmp/Flownomaly (10 stars, Python, Apache-2.0, last commit 2026-10-26).

Abstract

Few-shot industrial anomaly detection requires modeling category-specific normality from only a handful of defect-free images. Common approaches tie inference to stored exemplars, impose rigid linear structure, or risk reproducing anomalous content.

Show full abstract

Flownomaly instead casts the problem as normal-counterpart recovery in frozen DINOv2 feature space. Given normal supports, a velocity field is learned through conditional flow matching over frozen patch tokens to transport Gaussian noise toward normal features. Along straight paths, a single recovery step using one evaluation of the optimal field yields the posterior mean of the clean normal token without trajectory integration. The operating time governs how strongly recovery modifies a query token. With no anomalous validation samples available for tuning, a normal-only Jacobian gain-to-noise criterion selects this time from the supports alone. Squared residuals between query tokens and their recovered counterparts yield anomaly signals for both dense localization and image-level detection. Across 1-, 2-, and 4-shot benchmarks on MVTec-AD and VisA, together with sample-shot evaluations on Real-IAD, Flownomaly achieves state-of-the-art performance against recent category-specific methods. In the 1-shot setting, image- and pixel-level AUROC reach 97.8% and 98.0% on MVTec-AD and 95.3% and 98.7% on VisA, with a 2.1-point image-level AUROC improvement over the strongest baseline on VisA. Code is available at https://github.com/b-rbmp/Flownomaly.

View on arXivView PDF

Code Implementations(1)

b-rbmp/FlownomalyOfficial100%
Apache-2.0

[WACV 2027] Official Code of: "Flownomaly: Single-Step Conditional-Mean Recovery for Few-Shot Anomaly Detection"

101PythonOct 17, 20261 months agoApache-2.0
anomaly-detectionflow-matchinggenerative-model

Similar Papers

Cite this paper

@article{ribeiro2026flownomaly,
  title  = {Flownomaly: Single-Step Conditional-Mean Recovery for Few-Shot Anomaly Detection},
  author = {Bernardo Perrone Ribeiro and Erkut Akdag and Egor Bondarev},
  year   = {2026},
  eprint = {2610.32964},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.32964v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.32964.svg)](https://codeofpaper.com/paper/2610.32964)

Discussion