Manuscript Offprint
arXiv:2610.32964Flownomaly: Single-Step Conditional-Mean Recovery for Few-Shot Anomaly Detection
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. 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.
1. Introduction
Industrial visual anomaly detection aims to identify rare and unpredictable defects, including scratches, contamination, misplaced components, and structural damage [4]. Few-shot anomaly detection (FSAD) addresses this setting by characterizing category-specific normality from only a handful of defect-free reference images and detecting unseen defects at both image and pixel levels [14, 16].

Figure 1. Conceptual illustration of Flownomaly. A query patch token is (1) perturbed with Gaussian noise and (2) recovered using a single evaluation of the velocity field fitted to the normal supports. Tokens consistent with normal appearance undergo little displacement (left), whereas less compatible tokens tend to undergo larger changes toward the normal support features (right). The squared distance between a query token and its recovered counterpart defines the anomaly score.
Frozen visual foundation models provide strong transferable representations in this low-data regime, but existing paradigms face distinct limitations: stored feature banks tie inference to finite exemplars [6, 27], fitted linear subspaces impose rigid linearity assumptions [18], reference-graph alignment requires query-time optimization [29], and feature reconstruction risks reproducing anomalies [10, 32].
To overcome these limitations, we formulate FSAD as normal-counterpart recovery in frozen feature space by asking: can few-shot normal supports define a nonlinear recovery operator that maps a query token to a normality-biased counterpart in a single step? The discrepancy between the observed token and this recovered counterpart provides the anomaly signal. Conditional flow matching (CFM) [1, 23, 24] provides the training principle for this op-erator by fitting a time-conditioned velocity field that transports Gaussian noise to normal support features. Under squared loss, the CFM optimum predicts the conditional mean path velocity; along a straight path, this determines the posterior mean of the clean normal feature in one field evaluation, without trajectory integration.
Flownomaly applies this recovery principle to standardized multi-depth tokens from a frozen DINOv2 encoder (Fig. 1). Training the velocity field exclusively on normal tokens biases the recovery toward normal appearance rather than reproducing anomalous content. At inference, all query tokens are perturbed at a calibrated operating time and recovered in a single step via one batched velocity-field evaluation. However, single-step recovery introduces a calibration challenge: the operating time balances sensitivity to query variations against upper-tail residual variation on normal features. In the absence of anomalous validation samples in FSAD, the operating time should be chosen from normal supports alone. Flownomaly addresses this via a normal-only Jacobian gain-to-noise criterion. Support-derived augmentations also drive field fitting and checkpoint selection, ensuring that no stage relies on anomalous samples, auxiliary supervision, or test labels.
Experiments on MVTec-AD [4], VisA [37], and Real-IAD [31] demonstrate strong detection and localization performance, with the largest image-level gains on VisA and Real-IAD. Ablations further show that trajectory integration provides no detection advantage, reveal a broad region of well-performing operating times, and show that the normal-only criterion selects within it. In summary, this paper provides the following contributions:
• A formulation of FSAD as normal-counterpart recovery in frozen feature space, using a single-step recovery operator derived from the posterior-mean identity of straight-path CFM.
• A normal-only Jacobian gain-to-noise calibration criterion that selects the operating time from normal supports alone, without anomalous validation data or test labels.
• An extensive evaluation across three benchmarks demonstrating state-of-the-art results and showing that single-step recovery matches trajectory integration at substantially lower velocity-network cost.
2.1. Few-Shot Anomaly Detection
Existing FSAD frameworks differ primarily in how normal supports are modeled and compared against query features. Reference-based approaches directly retain normal features for inference: PatchCore [27] constructs a coreset-reduced patch memory, AnomalyDINO [6] performs nearest-neighbor matching over frozen DINOv2 tokens, and WinCLIP [16] combines visual-reference association with vision-language alignment. Beyond direct feature matching, PromptAD [20] learns category-specific one-class prompts from few-shot normal supports, while registration-based methods [14] learn category-agnostic correspondences between query and reference features that transfer to unseen object categories.
More structured frameworks explicitly model normal feature geometry and transformations. SubspaceAD [18] represents normal DINOv2 tokens through a linear principal-component subspace, DCP-SFR [17] adds structure-aware refinement to preserve weak anomaly cues, ANoCo [29] measures the optimization displacement required to align queries with an anchored reference graph, and FoundAD [34] learns a nonlinear projection onto the natural-image manifold in a unified multi-class setting.
In contrast to discrete memory banks or rigid linear subspaces, Flownomaly represents target-category normality through a continuous, time-conditioned velocity field over frozen features, eliminating nearest-neighbor search and query-time optimization.
2.2. Normal-Counterpart Recovery
Reconstruction-based models score discrepancies between observed query features and their normal counterparts. A central challenge lies in preventing the network from reproducing anomalous content. Reverse Distillation [8] reconstructs multi-scale teacher features through a one-class bottleneck, while UniAD [32] employs neighbor-masked attention and feature jittering to limit this identity shortcut. In FSAD, FastRecon [10] reconstructs query features from normal references through distribution-regularized regression, FastRef [21] transfers query characteristics into normal prototypes while suppressing anomalous content, and INP-Former [25] extracts normal prototypes from the query image as linear combinations of its own tokens, scoring residuals through a prototype-guided decoder.
Generative models obtain normal counterparts through denoising. DiffusionAD [35] performs one-step noise-to-normal image reconstruction scored by a segmentation network, while OmiAD [11] distills an adaptive masked diffusion model into a one-step multi-class detector.
Flownomaly instead learns feature-space recovery from the support set alone, keeping the normality model independent of query content. The method requires no synthetic abnormal-normal pairs, teacher distillation, pixel decoders, or auxiliary segmentation heads.
2.3. Flow-Based Anomaly Detection
Flow-based anomaly detection traditionally models normal data through invertible mappings to tractable latent priors. Normalizing flows derive anomaly scores from exact likelihood estimates or latent log-probabilities, as in CFLOW-AD [12], FastFlow [33], and MSFlow [36].
Recent flow-matching methods instead use learned velocity fields for correction or anomaly scoring. In brain imaging, Reflect [3] learns a one-step rectified-flow correction from synthetically corrupted to clean VAE latents. WT-Flow [19] combines time-reversed flow matching with a local Worst Transport interpolant to estimate a density proxy. TCCM [22] scores deviations from time-conditioned contraction dynamics, whereas Flow Mismatching [5] aggregates velocity discrepancies across multiple query paths.
Unlike prior flow-based detectors that rely on likelihood proxies, reverse trajectories, or multi-path velocity discrepancies, Flownomaly employs flow matching exclusively for normal-counterpart recovery, eliminating trajectory integration and multi-path aggregation. In practice, one batched velocity-field evaluation per image produces the residuals used for both dense localization and image-level detection.
3. Method
Flownomaly is a category-specific few-shot anomaly detection method that models normality through a nonlinear recovery operator over frozen DINOv2 patch tokens. Figure 2 provides an overview of the method. Given k defect-free support images alongside an unlabelled query image, Flownomaly predicts an image-level anomaly score and a dense pixel-level localization map. Support views are encoded into standardized multi-depth features, and a compact time-conditioned velocity MLP is trained via conditional flow matching (CFM) along straight paths to transport Gaussian noise toward normal tokens. Under squared-error CFM, the population-optimal field predicts the conditional mean path velocity, and along a straight path its single-step update yields a posterior-mean normal counterpart without trajectory integration.
At inference, query tokens perturbed at a calibrated operating time are recovered in one batched forward pass. Tokens consistent with normal supports typically undergo little displacement, whereas anomalous tokens tend to receive larger normal-directed updates, yielding residuals that delineate defects. Checkpoint selection and operating-time calibration rely exclusively on support-derived normal data. The remainder of this section details support feature extraction (Sec. 3.1), velocity field fitting (Sec. 3.2), single-step recovery (Sec. 3.3), anomaly scoring (Sec. 3.4), and normal-only operating-time calibration (Sec. 3.5).
3.1. Problem Setup and Support Features
Each category provides a support set of defect-free images. Given an unlabelled query image , the objective is to predict both an image anomaly score and a dense pixel-level localization map.
Multi-depth DINOv2 features. Following SubspaceAD [18], Flownomaly represents each patch with tokens from middle-to-late blocks of a frozen DINOv2 encoder [26] rather than the final layer alone, capturing complementary texture and semantic cues. The multi-depth token at position , where is the encoder's token dimension, is formed by standardizing each block's features with channel-wise statistics estimated on fitting views alone, then averaging across the selected blocks (Suppl. A.1). Standardizing prior to averaging aligns feature scales across depths and prevents blocks with larger activations from dominating.
Support-derived normal pools. The few-shot normal supports should fulfill three distinct roles: fitting the velocity field, guiding checkpoint selection, and calibrating the operating time. Holding out entire images is impossible in the one-shot setting; instead, three disjoint sets of augmentations of the same support images are generated via separate random streams. Valid tokens from these streams form the fitting, validation, and calibration pools , , and , providing held-out augmented views for checkpoint selection and calibration. Augmentation padding is discarded; view counts and random stream details are discussed in Sec. 4.3 and Suppl. A.1.
3.2. Conditional Flow Matching on Normal Tokens
To represent the normality of the target category, Flownomaly learns a time-conditioned velocity field that transports Gaussian noise toward the distribution of normal support features; once trained, this field enables single-step counterpart recovery (Sec. 3.3). Fitting follows conditional flow matching along the straight path between noise and features [1, 23, 24]. For a fitting token , noise , and a time , the training state is
The state interpolates between Gaussian noise at and a clean normal token at along a straight trajectory with constant velocity . Sampling uniformly trains the field across all noise-to-feature perturbation scales. Given a state and time , the velocity field , parameterized by weights , predicts the velocity of the noise-to-feature interpolation. Implemented as a residual MLP with sinusoidal time embeddings (detailed in Suppl. A.2), it represents the sole trained component, as the encoder remains frozen. Its parameters minimize the training objective:
Support-only checkpoint selection. During training, each checkpoint is evaluated on using fixed noise and interpolation-time grids. The checkpoint with the lowest validation CFM loss is selected, and its parameters are denoted by . The selected field is then used for operating-time calibration and inference.

(a) Support-Only Field Learning and Selection
(b) Single-Step Inference / Anomaly Scoring
Figure 2. Overview of Flownomaly. (a) Disjoint augmented views of the normal supports are encoded into standardized multi-depth DINOv2 tokens (Sec. 3.1): fitting views train the velocity field via conditional flow matching (Sec. 3.2), validation views select the checkpoint , and calibration views determine the operating time via a normal-only criterion (Sec. 3.5). (b) At inference, query tokens perturbed with Gaussian noise at are recovered in one batched evaluation of (Sec. 3.3). Squared residuals to recovered counterparts form the anomaly score map, which is smoothed and upsampled for dense localization (Sec. 3.4).
3.3. Single-Step Conditional-Mean Recovery
CFM learns a velocity field along the full noise-to-normal path, whereas Flownomaly requires only a normality-biased counterpart for each query token. For the straight interpolation in Eq. (1), the posterior mean of the clean normal token is available from a single evaluation of the population-optimal field at an intermediate state.
Let be a normal token from the empirical fitting distribution, let be independent Gaussian noise, and let denote the corresponding random interpolation state. Under the squared-error objective in Eq. (2), the population-optimal field is the conditional expectation of its regression target [1, 23]:
From the definition of ,
Taking conditional expectations given , using and applying Eq. (3), results in
At the population optimum, this single-step recovery is a conditional clean-token estimator expressed through the straight-path CFM velocity field. This identity relates to Tweedie's formula [9] and to conversions between velocity, noise, and clean-data prediction in diffusion models [13, 28]. Flownomaly uses this relation to construct a nonlinear, normality-biased recovery operator from few-shot normal supports. The learned field is evaluated once at a perturbed query state, and the discrepancy between the query token and its recovered counterpart provides the anomaly score. Replacing with the fitted field defines the recovery operator
The update spans the remaining interval 1 - t to the data endpoint t = 1 in one operation, termed single-step recovery. Although equivalent to one Euler step of size 1 - t, it estimates the conditional mean rather than an integrated ODE endpoint. Multi-step integration provides no detection advantage (Sec. 4.8).
For a query image , let denote the standardized token at position . Each query token is perturbed with at operating time ,
and its counterpart is recovered as
All query tokens are processed in one batch, so recovery requires a single forward pass through . Equation (5) identifies the conditional mean under the normal-token corruption model. For potentially anomalous queries, Eq. (8) uses the learned field to estimate a normality-biased counterpart; the identity alone does not guarantee recovery of an actual defect-free counterpart or anomaly separation. The post-hoc analysis in Suppl. B.1 supports this interpretation: recovery residuals increase with distance to the unrotated support-token bank, while recovered tokens generally move closer to that bank.
3.4. Anomaly Scoring
The anomaly score for each patch token is given by the squared recovery residual:
Collecting over all patch positions forms the residual map at token resolution. For dense localization, the map is Gaussian-smoothed with token widths and bilinearly upsampled to image resolution to yield the predicted anomaly map. For image-level detection, the anomaly score averages the largest fraction of the unsmoothed, upsampled map; both predictions are evaluated at .
3.5. Normal-Only Operating-Time Calibration
The operating time controls how strongly recovery modifies a query token. At the population optimum, recovery becomes query-independent as and approaches the global normal mean, while as , the factor suppresses the field update and recovery approaches the identity. Neither extreme provides useful conditional recovery, so the operating time must be selected from the interior. Without a normal-only selection rule, must be fixed in advance.
Let denote the recovery residual, whose squared norm is the anomaly score of Eq. (9). A useful operating time makes this residual respond strongly to small deviations from normal appearance while remaining small on normal tokens.
Locally, an anomalous token can be viewed as a perturbed normal token. This motivates a signal-to-noise criterion computed from normal calibration views alone: the residual response to a perturbation is the signal, while the upper-tail residual of normal tokens is the noise level.
For calibration view m and noise repetition j, the gain measures the squared first-order response of the residual to input changes, averaged over calibration tokens and random unit directions, since anomaly directions are unknown. The upper-tail level is the mean of the largest 1% of squared residuals produced by the same tokens. Their ratio defines the Jacobian gain-to-noise (JGN) score:
where provides numerical stability. Under a first-order isotropic approximation, a larger JGN score indicates that smaller input deviations can produce increases in squared residuals comparable to the upper-tail squared residuals of normal tokens.
Over the candidate time grid T, the selected operating time is the smallest maximizer of the median across calibration views of the per-view median across noise repetitions. Median aggregation limits the influence of atypical views and noise draws. The same random draws are reused across candidate times, and no anomalous samples or test labels are used. JGN is therefore a normal-only rule for selecting the operating time rather than an estimator of the category-wise test-label optimum. Formal definitions, the random-probe estimator, and the selection rule are given in Suppl. A.3; the candidate grid and remaining constants appear in Sec. 4.3.
4. Experiments
The experiments evaluate Flownomaly for few-shot anomaly detection and localization on MVTec-AD and VisA (Sec. 4.5), and under the sample-shot setting on Real-IAD (Sec. 4.6). Beyond baseline comparisons, targeted ablations validate Flownomaly's central design choices, spanning single-step recovery, normal-only operating-time calibration, residual scoring, and backbone scaling (Sec. 4.8).
4.1. Datasets
Flownomaly is evaluated on three industrial anomaly detection benchmarks: MVTec-AD [4], VisA [37], and Real-IAD [31], comprising 15, 12, and 30 categories, respectively. Following established FSAD protocols [6, 18, 29], the first two benchmarks use randomly selected normal reference images under 1-, 2-, and 4-shot settings. For Real-IAD, each selected physical sample contributes five fixed views under a multi-view sample-shot protocol.
4.2. Evaluation Metrics
Following standard practice [6, 27], image-level performance is evaluated by AUROC (I-AUROC), AUPR, and , while pixel-level performance is evaluated via AUROC (P-AUROC), AUPRO, and , with all metrics averaged across categories. is maximized over decision thresholds, and AUPRO is integrated up to a false-positive rate of 0.3 [4].
4.3. Implementation Details
Flownomaly employs a frozen DINOv2 ViT-g/14-reg encoder [7, 26] at resolution, aggregating features from blocks , corresponding to 40–80% relative depth. The encoder output is a spatial grid of standardized patch tokens. The time-conditioned residual MLP uses a bottleneck width of , half the token embedding dimension, and is optimized with AdamW and a cosine learning-rate schedule. Following SubspaceAD [18], each normal support is augmented with 30 random rotations sampled from – for fitting, while validation and calibration each use three independently sampled rotations. Consistent with prior work [6, 18], rotation augmentation is disabled for the orientation-sensitive MVTec-AD transistor category, which remains included in the aggregate evaluation.
Operating time and scoring. JGN selects from using normal calibration views
Table 1. Few-shot anomaly detection performance on MVTec-AD and VisA for category-specific methods. Flownomaly is reported as mean standard deviation over 3 seeds. All values are percentages. Bold and underlined indicate the best and second-best results, respectively.
| Setup | Method | MVTec-AD | VisA | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AUROC | Image-level AUPR | AUROC | Pixel-level AUPRO | AUROC | Image-level AUPR | AUROC | Pixel-level AUPRO | ||||||
| 1-shot | PatchCore [27] | 83.4 | 92.2 | 90.5 | 92.0 | 79.7 | 50.4 | 79.9 | 82.8 | 81.7 | 95.4 | 80.5 | 38.0 |
| WinCLIP [16] | 93.1 | 96.5 | 93.7 | 95.2 | 87.1 | 55.9 | 83.8 | 85.1 | 83.1 | 96.4 | 85.1 | 41.3 | |
| PromptAD [20] | 94.6 | 97.1 | 95.2 | 95.9 | 87.9 | 53.2 | 86.9 | 88.4 | 82.9 | 96.7 | 85.1 | 35.0 | |
| AnomalyDINO [6] | 96.6 | 98.2 | 95.8 | 96.8 | 92.7 | 60.2 | 87.4 | 89.0 | 84.3 | 97.8 | 92.5 | 45.1 | |
| SubspaceAD [18] | 97.1 | 98.6 | 96.7 | 97.5 | 94.5 | 60.5 | 93.2 | 93.0 | 89.6 | 98.2 | 95.5 | 47.5 | |
| DCP-SFR [17] | 97.3 | 98.8 | 96.7 | 96.9 | 92.7 | 60.7 | 92.0 | 93.7 | 87.8 | 98.2 | 93.3 | 44.9 | |
| ANoCo [29] | 97.9 | 99.1 | 96.9 | 97.7 | 95.4 | 64.9 | 92.7 | 93.3 | 88.8 | 98.7 | 94.9 | 51.9 | |
| Flownomaly | |||||||||||||
| 2-shot | PatchCore [27] | 86.3 | 93.8 | 92.0 | 93.3 | 82.3 | 53.0 | 81.6 | 84.8 | 82.5 | 96.1 | 82.6 | 41.0 |
| WinCLIP [16] | 94.4 | 97.0 | 94.4 | 96.0 | 88.4 | 58.4 | 84.6 | 85.8 | 83.0 | 96.8 | 86.2 | 43.5 | |
| PromptAD [20] | 95.7 | 97.9 | 95.3 | 96.2 | 88.5 | 54.3 | 88.3 | 90.0 | 82.4 | 97.1 | 85.8 | 37.1 | |
| AnomalyDINO [6] | 96.9 | 98.2 | 96.1 | 97.0 | 93.1 | 61.0 | 89.7 | 90.7 | 86.3 | 98.0 | 93.4 | 47.6 | |
| SubspaceAD [18] | 97.5 | 98.8 | 97.0 | 97.8 | 94.9 | 61.7 | 93.8 | 93.4 | 90.2 | 98.3 | 95.7 | 45.8 | |
| DCP-SFR [17] | 97.7 | 98.9 | 97.0 | 97.1 | 93.3 | 61.6 | 92.5 | 94.2 | 88.0 | 98.4 | 93.8 | 46.9 | |
| ANoCo [29] | 98.4 | 99.2 | 97.3 | 98.0 | 96.0 | 65.3 | 93.3 | 92.9 | 90.3 | 98.7 | 94.7 | 53.0 | |
| Flownomaly | |||||||||||||
| 4-shot | PatchCore [27] | 88.8 | 94.5 | 92.6 | 94.3 | 84.3 | 55.0 | 85.3 | 87.5 | 84.3 | 96.8 | 84.9 | 43.9 |
| WinCLIP [16] | 95.2 | 97.3 | 94.7 | 96.2 | 89.0 | 59.5 | 87.3 | 88.8 | 84.2 | 97.2 | 87.6 | 47.0 | |
| PromptAD [20] | 96.6 | 98.5 | 96.0 | 96.5 | 90.5 | 55.2 | 89.1 | 90.8 | 83.1 | 97.4 | 86.2 | 38.9 | |
| AnomalyDINO [6] | 97.7 | 98.7 | 96.6 | 97.2 | 93.4 | 61.8 | 92.6 | 92.9 | 88.8 | 98.2 | 94.1 | 49.4 | |
| SubspaceAD [18] | 98.0 | 99.0 | 97.2 | 97.9 | 95.1 | 62.7 | 94.7 | 94.3 | 91.1 | 98.4 | 96.0 | 47.1 | |
| DCP-SFR [17] | 98.0 | 98.9 | 96.8 | 97.5 | 93.5 | 61.9 | 92.8 | 94.7 | 88.9 | 98.6 | 94.2 | 47.1 | |
| ANoCo [29] | 98.7 | 99.3 | 97.6 | 98.1 | 96.2 | 65.7 | 95.2 | 95.1 | 91.7 | 98.8 | 95.7 | 54.2 | |
| Flownomaly | |||||||||||||
(Suppl. A.3). Unless stated otherwise, inference uses one Gaussian sample per token and one batched velocity-field evaluation. The image score averages the largest of the unsmoothed, upsampled residual map, following DINOv2-based FSAD methods [6, 18].
4.4. Baselines
Flownomaly is evaluated against representative FSAD methods spanning distinct modeling paradigms: memory-based patch retrieval (PatchCore [27], AnomalyDINO [6]), vision-language association and prompt learning (WinCLIP [16], PromptAD [20]), linear subspace modeling (SubspaceAD [18]), structural cue refinement (DCP-SFR [17]), and graph-based alignment (ANoCo [29]).
4.5. Few-Shot Anomaly Detection Performance
Table 1 compares Flownomaly with recent category-specific methods across the 1-, 2-, and 4-shot settings. Flownomaly consistently achieves strong localization performance across both MVTec-AD and VisA datasets, attaining the best or tied-best pixel-level results across all evaluated shot settings and metrics. The largest image-level gains occur on VisA, where AUROC surpasses the strongest baseline by 2.1, 2.3, and 1.1 percentage points (pp) in the 1-, 2-, and 4-shot regimes, respectively. On MVTec-AD, Flownomaly leads or ties seven of nine image-level comparisons and remains within 0.2 pp of ANoCo on the other two. In the full-shot setting, Flownomaly achieves the best or tied-best result in 11 of 12 metric–dataset comparisons. Complete full-shot results for MVTec-AD and VisA are reported in Suppl. C.2.
Qualitative comparison. Figure 3 illustrates representative localization results in the 1-shot setting. Flownomaly accurately localizes both fine texture defects and structural damage while suppressing background responses.
4.6. Sample-Shot Anomaly Detection on Real-IAD
Real-IAD contains five views per physical sample. Under the sample-shot protocol, selecting normal samples provides 5s reference images. Table 2 reports detection and localization performance under this setting across 3 seeds. PatchCore, PromptAD, AnomalyDINO, and SubspaceAD are reproduced under published settings. ANoCo and DCP-SFR are omitted as their implementations were unavailable.
Flownomaly achieves the strongest image-level performance and the highest pixel-level AUROC and at every sample-shot setting. In the 1-sample setting, image AUROC increases from 85.2% with SubspaceAD to 88.2%, while pixel-level improves from 42.7% to 50.6%. These results indicate that the recovery formulation remains effective under multi-view references.
(a) MVTec-AD

(b) VisA
Figure 3. Qualitative comparison on MVTec-AD and VisA under the 1-shot setting. Columns show the query image, ground-truth mask, and anomaly maps from the open-source category-specific baselines AnomalyDINO [6] and SubspaceAD [18], followed by Flownomaly. Flownomaly delineates defects more sharply, with fewer spurious background activations and closer agreement with the ground-truth masks on both datasets. Additional qualitative results and representative failure modes are provided in Suppl. D and B.4, respectively.
Table 2. Sample-shot anomaly detection and localization on Real-IAD. Results are percentages reported as mean ± standard deviation over 3 seeds. Bold and underlined indicate the best and second-best results, respectively.
| Method | Image-level | Pixel-level | ||||
|---|---|---|---|---|---|---|
| AUROC | AUPR | AUROC | AUPRO | |||
| 1-sample shot (5 views) | ||||||
| PatchCore [27] | ||||||
| PromptAD [20] | ||||||
| AnomalyDINO [6] | ||||||
| SubspaceAD [18] | ||||||
| Flownomaly | ||||||
| 2-sample shot (10 views) | ||||||
| PatchCore [27] | ||||||
| PromptAD [20] | ||||||
| AnomalyDINO [6] | ||||||
| SubspaceAD [18] | ||||||
| Flownomaly | ||||||
| 4-sample shot (20 views) | ||||||
| PatchCore [27] | ||||||
| PromptAD [20] | ||||||
| AnomalyDINO [6] | ||||||
| SubspaceAD [18] | ||||||
| Flownomaly | ||||||
4.7. Computational Efficiency
Only the velocity network is optimized, as the encoder remains frozen. In the 1-shot setting, fitting one category takes a median of 24 s on MVTec-AD and 28 s on VisA, with 2.6 GB of peak GPU memory. At inference, the velocity network contributes 2.2 ms of the total 60.9 ms image latency (Table 3), with most computation arising from the frozen encoder. The velocity network adds 23.2 M parameters per category ( 88 MiB); unlike token memory banks, this footprint does not grow with k. Additional details are given in Suppl. A.4.
4.8. Ablation Study
The ablation study examines the main design choices of Flownomaly, focusing on single-step recovery, operating-time calibration, recovery-residual scoring, and backbone scaling. Further ablations covering the feature representation and the support-view construction are provided in the supplementary material.
Single-step recovery is sufficient. A central premise of Flownomaly is that the learned velocity field can directly serve as a conditional-mean recovery operator without integrating a complete flow trajectory. Table 3 compares single-step recovery with Euler integration across 2, 5, 10, and 20 velocity evaluations from the same perturbed query state. All variants share the checkpoint, operating time, and initial Gaussian draw, isolating the effect of trajectory integration.
Table 3. Effect of the number of velocity-field evaluations (NFE) in the 1-shot setting.
| NFE | MVTec-AD | VisA | Latency (ms/image) | |||
|---|---|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | Velocity | Total model | |
| 1 | 2.2 | 60.9 | ||||
| 2 | 3.7 | 62.4 | ||||
| 5 | 8.0 | 66.7 | ||||
| 10 | 15.1 | 73.8 | ||||
| 20 | 29.2 | 87.9 | ||||
Increasing NFE from 1 to 20 changes image- and pixel-level AUROC by at most 0.2 pp while raising velocity-network latency by , from 2.2 to 29.2 ms/image. Total model latency increases from 60.9 to 87.9 ms/image. Therefore, full trajectory integration provides negligible detection benefit despite substantially higher computational cost, empirically supporting the single-step recovery formulation.
Operating-time robustness and normal-only selection. The label-free JGN calibration is assessed by sweeping . This reveals how sharply detection depends on and whether the selected time lies in a high-performing region. For each category and metric (image-level AUROC or AUPR), the retrospective regret at is the gap between the best value over and the value at . Figure 4 reports this regret averaged across categories. Test labels are used only to define the retrospective reference.

Figure 4. Operating-time robustness on MVTec-AD and VisA in the 1-shot setting. Curves show mean category-wise image-level regret; lower is better. The dashed lines mark the median category-wise JGN selection at .
Both datasets exhibit a broad low-regret interior, indicating robust performance across a wide range of operating times. The median category-wise JGN selection is 0.65 on both datasets and lies within this region. Category-wise JGN selection yields median image-AUROC regrets of 0.06 and 0.14 pp on MVTec-AD and VisA relative to the retrospective oracle. Across alternative feature configurations, JGN selects operating times from 0.60 to 0.85 on both datasets (Suppl. B.3), rather than returning a fixed value. Additional calibration analysis is provided in Suppl. B.2.
Recovery-residual scoring. Table 4 evaluates whether the proposed recovery residual provides a more informative anomaly signal than alternative quantities derived from the same recovery process, under otherwise identical settings. The recovery residual explicitly compares the displacement implied by the perturbed query with the velocity predicted by the normal model. The velocity norm measures only the magnitude of that prediction, while the scale-invariant cosine discrepancy measures angular disagreement between the query token and its recovered counterpart.
Replacing the recovery residual with the velocity norm reduces image AUROC by 0.9/1.0 pp on MVTec-AD/VisA, while the cosine discrepancy reduces it by 1.1/5.1 pp. These results show that the full recovery discrepancy is more informative than either alternative.
Table 4. Effect of the scoring rule (1-shot setting), with all other factors fixed. Best results are in bold.
| Scoring rule | MVTec-AD | VisA | ||
|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | |
| Recovery residual | ||||
| Velocity norm | ||||
| Cosine residual | ||||
Backbone scaling. The accuracy–latency trade-off is evaluated across DINOv2-S, -B, -L, and -g. For each backbone, the velocity-network bottleneck width is set to half the encoder's token embedding dimension (d/2). Table 5 illustrates that scaling from the DINOv2-S configuration to the DINOv2-g improves image AUROC by 3.1 pp on MVTec-AD and 3.5 pp on VisA, while model latency increases from 18.1 to 60.9 ms/image. A comparison in Suppl. C.1 shows that DINOv3-7B [30] does not improve over DINOv2-g in this setting.
Table 5. Backbone-scale ablation in the 1-shot setting. Best results are in bold.
| Backbone | Latency (ms) | MVTec-AD | VisA | ||
|---|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | ||
| DINOv2-S | 18.1 | ||||
| DINOv2-B | 25.5 | ||||
| DINOv2-L | 51.9 | ||||
| DINOv2-g | 60.9 | ||||
5. Conclusion
This work has presented Flownomaly, which reframes category-specific FSAD as normal-counterpart recovery in frozen DINOv2 feature space. Its central insight is that the conditional-mean structure of straight-path CFM enables a normality-biased counterpart to be estimated in a single recovery step, without trajectory integration. Residuals between query features and their recovered counterparts provide the anomaly signal for both detection and localization. Field fitting and checkpoint selection rely exclusively on support-derived normal data, while the normal-only Jacobian gain-to-noise criterion calibrates the operating time without anomalous validation data. Flownomaly achieves state-of-the-art results on VisA and Real-IAD, while leading most evaluated comparisons on MVTec-AD. Additional field evaluations provide negligible detection benefit, while performance remains stable across a broad range of operating times. Because token-wise residual scoring does not explicitly enforce global structural constraints, logical anomalies such as incorrect part counts remain challenging (Suppl. B.4). Future work will investigate category-agnostic recovery fields, explicit modeling of such global constraints, and more compact feature extractors.
Acknowledgements
This work is supported by the STRUCTURE ITEA 24017 project.
References
[1] Michael Albergo, Nicholas M Boffi, and Eric Vanden-Eijnden. Stochastic interpolants: A unifying framework for flows and diffusions. Journal of Machine Learning Research, 26(209): 1–80, 2025. 1, 3, 4
[2] Haim Avron and Sivan Toledo. Randomized algorithms for estimating the trace of an implicit symmetric positive semi-definite matrix. Journal of the ACM (JACM), 58(2):1–34, 2011. 12
[3] Farzad Beizaee, Sina Hajimiri, Ismail Ben Ayed, Gregory Lodygensky, Christian Desrosiers, and Jose Dolz. Reflect: Rectified Flows for Efficient Brain Anomaly Correction Transport. In proceedings of Medical Image Computing and Computer Assisted Intervention – MICCAI 2025. Springer Nature Switzerland, 2025. 3
[4] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Mvtec ad-a comprehensive real-world dataset for unsupervised anomaly detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9592–9600, 2019. 1, 2, 5
[5] Shengzhe Chen, Mehrdad Moradi, Kamran Paynabar, and Hao Yan. Flow mismatching: Unsupervised anomaly detection via velocity discrepancies in flow matching models. arXiv preprint arXiv:2605.23070, 2026. 3
[6] Simon Damm, Mike Laszkiewicz, Johannes Lederer, and Asja Fischer. Anomalydino: Boosting patch-based few-shot anomaly detection with dinov2. In 2025 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pages 1319–1329. IEEE, 2025. 1, 2, 5, 6, 7, 15, 16, 17, 18
[7] Timothée Darcet, Maxime Oquab, Julien Mairal, and Piotr Bojanowski. Vision transformers need registers. In International conference on learning representations, pages 2632–2652, 2024. 5
[8] Hanqiu Deng and Xingyu Li. Anomaly detection via reverse distillation from one-class embedding. In 2022 IEEE/CVF conference on computer vision and pattern recognition (CVPR), pages 9727–9736. IEEE, 2022. 2
[9] Bradley Efron. Tweedie's formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011. 4
[10] Zheng Fang, Xiaoyang Wang, Haocheng Li, Jiejie Liu, Qiugui Hu, and Jimin Xiao. Fastrecon: Few-shot industrial anomaly detection via fast feature reconstruction. In 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pages 17435–17444. IEEE, 2023. 1, 2
[11] Yaoxuan Feng, Wenchao Chen, Yuxin Li, Bo Chen, Yubiao Wang, Zixuan Zhao, Hongwei Liu, and Mingyuan Zhou. OmiAD: One-step adaptive masked diffusion model for multiclass anomaly detection via adversarial distillation. In Forty-second International Conference on Machine Learning, 2025. 2
[12] Denis Gudovskiy, Shun Ishizaka, and Kazuki Kozuka. Cflow-ad: Real-time unsupervised anomaly detection with localization via conditional normalizing flows. In 2022 IEEE/CVF winter conference on applications of computer vision (WACV), pages 1819–1828. IEEE, 2022. 2
[13] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840–6851, 2020. 4
[14] Chaoqin Huang, Haoyan Guan, Aofan Jiang, Ya Zhang, Michael Spratling, and Yan-Feng Wang. Registration based few-shot anomaly detection. In European conference on computer vision, pages 303–319. Springer, 2022. 1, 2
[15] Michael F Hutchinson. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 18(3):1059–1076, 1989. 12
[16] Jongheon Jeong, Yang Zou, Taewan Kim, Dongqing Zhang, Avinash Ravichandran, and Onkar Dabeer. Winclip: Zero/few-shot anomaly classification and segmentation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 19606–19616, 2023. 1, 2, 6
[17] Le Jiang, Yan Huang, Zhen Xu, Yong Xu, Hau-San Wong, and Si Wu. Defect cue-preserved structural feature refinement for few-shot anomaly detection. In 2026 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2026), pages 35607–35616, 2026. 2, 6
[18] Camile Lendering, Erkut Akdag, and Egor Bondarau. Subspacead: Training-free few-shot anomaly detection via subspace modeling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 28557–28566, 2026. 1, 2, 3, 5, 6, 7, 15, 16, 17, 18
[19] Liangwei Li, Lin Liu, Hanzhe Liang, Juanxiu Liu, Jing Zhang, Ruqian Hao, Xiaohui Du, Yong Liu, and Pan Li. Time-reversed flow matching with worst transport in high-dimensional latent space for image anomaly detection. arXiv preprint arXiv:2508.05461, 2025. 3
[20] Xiaofan Li, Zhizhong Zhang, Xin Tan, Chengwei Chen, Yanyun Qu, Yuan Xie, and Lizhuang Ma. Promptad: Learning prompts with only normal samples for few-shot anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16838–16848, 2024. 2, 6, 7
[21] Yufei Li, Long Tian, Yuyang Dai, Wenchao Chen, Liang Bao, and Xiyang Liu. Fastref: Fast prototype refinement for few-shot industrial anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 43040–43049, 2026. 2
[22] Zhong Li, Qi Huang, Yuxuan Zhu, Lincen Yang, Mohammad Mohammadi Amiri, Niki van Stein, and Matthijs van Leeuwen. Scalable, explainable and provably robust anomaly detection with one-step flow matching. Advances in Neural Information Processing Systems, 38:87834–87899, 2026. 3
[23] Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matthew Le. Flow matching for generative modeling. In The Eleventh International Conference on Learning Representations, 2023. 1, 3, 4
[24] Xingchao Liu, Chengyue Gong, and Qiang Liu. Flow straight and fast: Learning to generate and transfer data with rectified flow. In The Eleventh International Conference on Learning Representations, 2023. 1, 3
[25] Wei Luo, Yunkang Cao, Haiming Yao, Xiaotian Zhang, Jianan Lou, Yuqi Cheng, Weiming Shen, and Wenyong Yu. Exploring intrinsic normal prototypes within a single image for universal anomaly detection. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9974–9983. IEEE, 2025. 2
[26] Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy V. Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel HAZIZA, Francisco Massa, Alaaeldin El-Nouby, Mido Assran, Nicolas Ballas, Wojciech Galuba, Russell Howes, Po-Yao Huang, Shang-Wen Li, Ishan Misra, Michael Rabbat, Vasu Sharma, Gabriel Synnaeve, Hu Xu, Herve Jegou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. DINov2: Learning robust visual features without supervision. Transactions on Machine Learning Research, 2024. Featured Certification. 3, 5
[27] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf, Thomas Brox, and Peter Gehler. Towards total recall in industrial anomaly detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 14318–14328, 2022. 1, 2, 5, 6, 7, 15
[28] Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. In International Conference on Learning Representations, 2022. 4
[29] Jungwook Seo, Minjeong Kim, Younkwan Lee, Seungho Shin, and Sungyong Baik. Anomaly as non-conformity via training-free graph laplacian energy minimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 21336–21345, 2026. 1, 2, 5, 6, 15
[30] Oriane Siméoni, Huy V Vo, Maximilian Seitzer, Federico Baldassarre, Maxime Oquab, Cijo Jose, Vasil Khalidov, Marc Szafraniec, Seungeun Yi, Michaël Ramamonjisoa, et al. Dinov3. arXiv preprint arXiv:2508.10104, 2025. 8, 14
[31] Chengjie Wang, Wenbing Zhu, Bin-Bin Gao, Zhenye Gan, Jiangning Zhang, Zhihao Gu, Shuguang Qian, Mingang Chen, and Lizhuang Ma. Real-iad: A real-world multi-view dataset for benchmarking versatile industrial anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 22883–22892, 2024. 2, 5
[32] Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu, Yu Zheng, and Xinyi Le. A unified model for multi-class anomaly detection. Advances in Neural Information Processing Systems, 35:4571–4584, 2022. 1, 2
[33] Jiawei Yu, Ye Zheng, Xiang Wang, Wei Li, Yushuang Wu, Rui Zhao, and Liwei Wu. Fastflow: Unsupervised anomaly detection and localization via 2d normalizing flows. arXiv preprint arXiv:2111.07677, 2021. 2
[34] Guangyao Zhai, Yue Zhou, Xinyan Deng, Lars Heckler-Kram, Nassir Navab, and Benjamin Busam. Foundation visual encoders are secretly few-shot anomaly detectors. In International Conference on Learning Representations, pages 97353–97376, 2026. 2
[35] Hui Zhang, Zheng Wang, Dan Zeng, Zuxuan Wu, and Yu-Gang Jiang. Diffusionad: Norm-guided one-step denoising
diffusion for anomaly detection. IEEE transactions on pattern analysis and machine intelligence, 47(8):7140–7152, 2025. 2
[36] Yixuan Zhou, Xing Xu, Jingkuan Song, Fumin Shen, and Heng Tao Shen. Msflow: Multiscale flow-based framework for unsupervised anomaly detection. IEEE transactions on neural networks and learning systems, 36(2):2437–2450, 2024. 2
[37] Yang Zou, Jongheon Jeong, Latha Pemula, Dongqing Zhang, and Onkar Dabeer. Spot-the-difference self-supervised pre-training for anomaly detection and segmentation. In European conference on computer vision, pages 392–408. Springer, 2022. 2, 5
Flownomaly: Single-Step Conditional-Mean Recovery for Few-Shot Anomaly Detection
Supplementary Material
This supplement provides implementation, optimization, and efficiency details (Sec. A); additional analyses covering feature ablations, operating-time calibration, recovery contraction diagnostics, and qualitative failure modes (Sec. B); additional evaluations covering full-shot benchmarking and backbone comparisons (Sec. C); extended qualitative localization results across datasets (Sec. D); and per-category few-shot and sample-shot performance tables (Sec. E) supporting the main paper.
A. Implementation and Efficiency
A.1. Support Sampling
Flownomaly results in the main paper are reported over three support samplings, generated with random seeds 42, 43, and 44. For each sampling and category, the selected defect-free images determine all fitting, validation, and calibration views.
The three pools are built from the same images but from disjoint sets of augmentations. The fitting pool contains each support image together with 30 rotations drawn uniformly from ; the validation and calibration pools contain three rotations each. The three sets of angles are sampled from separate random streams for fitting, checkpoint selection, and calibration. Rotation introduces padding regions that carry no object content: those tokens are masked out of every pool, and therefore out of the standardization statistics , the fitting batches, the validation loss, and the calibration statistics.
Standardized multi-depth tokens. With denoting the DINOv2 token at position of block , the standardized multi-depth token is defined as
where is the set of selected blocks, and are the channel-wise mean and standard deviation of block evaluated over valid tokens of the fitting views, and ensures numerical stability. Only the fitting views define and , which are then applied unchanged to validation, calibration, and query tokens.
A.2. Architecture and Optimization
The velocity network receives and a shared 256-dimensional sinusoidal embedding of . The time embedding is concatenated with before projection to a bottleneck of width , and also provides the scale and shift used to modulate each of four residual blocks. After projection back to dimensions, a learned scalar function of gates an input-aligned skip from . The output projection and skip gate are initialized at zero. The resulting velocity network contains 23.2 M trainable parameters. The network is optimized with AdamW, weight decay , and a cosine learning-rate schedule from to for at most 1000 epochs. Training employs batches of 10,240 tokens, mixed precision, and gradient-norm clipping at 1.0. Fixed-draw validation is performed every three epochs; early stopping operates with a patience of ten evaluations and requires an improvement of at least .
A.3. Calibration and Scoring
Operating-time calibration takes three calibration views per support image, giving total views in the -shot setting. These views are independent rotations when rotation augmentation is enabled and identity views otherwise. In the full-shot setting, instead denotes the number of images in the held-out calibration partition. Calibration evaluates independent Gaussian-noise repetitions and random probes per token, with the numerical-stability constant set to . All candidate times in share the same noise draws and probe directions, reducing sampling variation in comparisons between candidates.
Definitions. Let index calibration views, the positions of view whose tokens are valid, that is, outside augmentation padding, and the token at position of view . For each view, indexes independent Gaussian draws , one per token. With
denoting the residual of the main paper, where is the recovery operator, and its Jacobian with respect to the token while holding fixed, the two terms of the JGN ratio are
where the expectation in Eq. (S3) is over random unit directions . The gain term therefore averages over positions and directions, whereas the upper-tail term aggregates only over positions to summarize the largest residuals produced by a normal view.
Why the ratio is well posed. Both the residual and its Jacobian contain a factor , so and share a factor. Apart from the stabilizer , this factor cancels in their ratio, preventing a trivial preference induced by remaining-time scaling: a criterion built on the gain alone would drift toward small purely through this scaling.
Estimating the direction-averaged Jacobian gain. The probes , with , are Rademacher vectors with entries drawn uniformly from , so each probe has unit norm and . For any matrix ,
so the probe average is an unbiased estimator of the direction-averaged squared gain, in the manner of stochastic trace estimation applied to [2, 15]. Replacing the expectation in Eq. (S3) by its B-probe estimate gives the quantity actually computed,
where each Jacobian–vector product is obtained by one forward-mode automatic-differentiation pass through the residual, so the full Jacobian is never materialized. The finite-probe estimate is substituted for when computing JGN. JGN is computed through the complete recovery mapping, including the time-dependent input skip. Rademacher probes are adopted because anomaly directions are unavailable under normal-only calibration, so isotropic unit probes evaluate the direction-averaged response by construction.
Operating-time selection. The final operating time selects the earliest candidate maximizing the median of the JGN ratio across noise draws and calibration views:
At inference, the residual map is Gaussian-smoothed with token widths before bilinear upsampling. Image scoring aggregates the unsmoothed upsampled map.
A.4. Runtime, Memory, and Model Size
All measurements are conducted on a single NVIDIA H100 GPU with mixed precision, reported as category-wise medians for a single seed (spread is across categories). Latency is measured from preprocessed input tensors with the first batch discarded as warm-up. In the 1-shot setting, velocity-field fitting takes a median of 24 s per category on MVTec-AD and 28 s on VisA (maxima 37 and 72 s, scaling linearly with k), while JGN calibration adds 14 s; feature extraction takes 2 s. Peak GPU memory across all stages is 2.6 GB. The velocity network contains 23.2 M parameters ( 88 MiB), while the frozen 1.1 B-parameter encoder is shared across categories; unlike token memory banks, the velocity network's footprint does not grow with k.
B. Additional Analyses
B.1. Recovery Contracts Toward Normal Support Features
For the population-optimal field, single-step recovery satisfies
This identity motivates normality-biased recovery, but does not establish how a field learned from finite normal supports behaves on anomalous queries. This analysis examines the implied mechanism directly: tokens farther from the empirical normal set should undergo larger recovery changes, and those changes should move them toward that set.
Let denote the token bank extracted from the unrotated normal support images assigned to fitting. This finite bank serves only as an empirical reference for the following analysis; it excludes the rotation-augmented fitting views and should not be interpreted as the complete training distribution or an underlying normal manifold. Throughout this subsection, abbreviates a query token of the main paper and its recovered counterpart. For each query token, its nearest-support distance is evaluated before and after recovery:
These are distances to the finite support set, not to an assumed underlying normal manifold. Let
Recovery dynamics are characterized via
The correlation between and measures whether distance from normal support is reflected in the anomaly score. A ratio indicates contraction toward the support set, while indicates that the recovery update has a component pointing toward the nearest support token.
Statistics are computed separately within each category and then summarized across categories. This prevents categories with more test tokens from dominating the analysis. For the binned curves, distances and residuals are normalized by their category-wise normal-token medians. Ground-truth masks serve only for this post-hoc stratification of normal and anomalous tokens.
Figure S1 reveals the same pattern on both datasets. The recovery residual increases monotonically across nearest-support-distance bins, with median category-wise Spearman correlations of 0.825 on MVTec-AD and 0.817 on VisA. The association remains strong within normal tokens (0.803/0.809) and anomalous tokens (0.921/0.918), rather than arising only from differences between the two groups.
Recovered counterparts generally contract toward the normal support features. The median is 0.861/0.826 for normal tokens and 0.760/0.782 for anomalous tokens on MVTec-AD/VisA. Relative to each category's normal-token distance scale, the absolute contraction is larger for anomalous tokens. Recovery is directionally consistent with this contraction: median cosine alignment with the nearest-support direction is 0.503/0.558 for normal tokens and 0.635/0.605 for anomalous tokens.
Therefore, larger residuals are associated with greater support distance, while recovery updates are generally directed toward empirical normal support features. Although this does not constitute an anomaly-separation guarantee, the observed behavior is consistent with the normality-biased recovery mechanism underlying Flownomaly.
B.2. Operating-Time Selection and Robustness
JGN calibrates a category-specific operating time from support-derived normal calibration views alone. To assess selection quality, retrospective regret is evaluated relative to an optimistic test-label oracle (the candidate time maximizing test image AUROC, evaluated strictly post hoc).
As reported in Table S1, median regret is only 0.06 percentage points (pp) on MVTec-AD and 0.14 on VisA. VisA's larger mean and maximum (4.82 pp) are driven by macaroni2, whose empirical test curve favors an earlier operating time. These regret statistics, together with the category-wise diagnostics in Table S2, are computed for seed 42; the per-category median selection for this sampling is 0.65 on both datasets.
Figure S2 pools all category–seed pairs from seeds 42–44. Selections remain confined to on MVTec-AD and [0.65, 0.70] on VisA. Pooled over all 45 MVTec-AD pairs, the 0.65 and 0.70 bins are near-evenly populated (18 and 21 selections); on VisA, 0.65 accounts for 28 of 36 pairs.
Table S1. Retrospective image-AUROC regret of the normal-only JGN selection, measured in percentage points relative to the category-wise test-label oracle. Regret statistics are computed over categories for seed 42; the column reports the range of per-category selections across all three seeds.
| Dataset | range | Regret (pp) | ||
|---|---|---|---|---|
| Mean | Median | Maximum | ||
| MVTec-AD | 0.60–0.75 | 0.15 | 0.06 | 0.82 |
| VisA | 0.65–0.70 | 0.54 | 0.14 | 4.82 |
Table S2. Category-level operating-time diagnostics for seed 42. Regret is the image-AUROC difference, in percentage points, from the retrospective test-label oracle.
| MVTec-AD | VisA | ||||
|---|---|---|---|---|---|
| Category | Regret (pp) | Category | Regret (pp) | ||
| bottle | 0.75 | 0.08 | candle | 0.70 | 0.09 |
| cable | 0.65 | 0.82 | capsules | 0.65 | 0.36 |
| capsule | 0.65 | 0.08 | cashew | 0.65 | 0.02 |
| carpet | 0.70 | 0.00 | chewinggum | 0.65 | 0.04 |
| grid | 0.75 | 0.00 | fryum | 0.65 | 0.23 |
| hazelnut | 0.70 | 0.00 | macaroni1 | 0.65 | 0.26 |
| leather | 0.70 | 0.00 | macaroni2 | 0.70 | 4.82 |
| metal_nut | 0.65 | 0.00 | pcb1 | 0.65 | 0.18 |
| pill | 0.70 | 0.61 | pcb2 | 0.65 | 0.03 |
| screw | 0.65 | 0.23 | pcb3 | 0.65 | 0.00 |
| tile | 0.70 | 0.00 | pcb4 | 0.65 | 0.02 |
| toothbrush | 0.65 | 0.14 | pipe_fryum | 0.65 | 0.45 |
| transistor | 0.60 | 0.06 | — | — | — |
| wood | 0.65 | 0.22 | — | — | — |
| zipper | 0.65 | 0.00 | — | — | — |
B.3. Feature and Support-View Ablations
As shown in Table S3, feature depth has the clearest and most consistent effect. Replacing the default 40–80% depth window with shallow 20–40% blocks reduces image AUROC by 12.1 pp on MVTec-AD and 9.3 pp on VisA, while pixel AUROC decreases by 2.1 and 5.2 pp. Retaining only the block at 80% depth preserves MVTec-AD performance but lowers VisA image AUROC by 3.3 pp.
Removing layer-wise standardization has little effect on MVTec-AD but reduces VisA image AUROC by 1.3 pp. Removing rotation-derived views reduces image AUROC by 4.0 pp on MVTec-AD and 2.0 pp on VisA. This ablation also removes view diversity from the validation and calibration pools, therefore measuring the complete support-view construction rather than only fitting.
The JGN-selected operating time also changes with the feature representation: the median shifts from 0.60 for shallow features to 0.85 without layer standardization, with the same ordering on both datasets, showing that the selected operating time responds to changes in the feature representa-
Residual increases with support distance

Recovery reduces support distance

Recovery points toward normal support
Figure S1. Recovery relative to the support-derived normal token set. Left: recovery residual versus pre-recovery support distance, with both quantities normalized by their category-wise normal-token medians and aggregated equally across categories. Middle: , where values below one indicate contraction toward the normal support features. Right: cosine alignment between the recovery update and the direction toward the nearest support token, where positive values indicate movement toward the normal support features. Bars and error bars report the median and interquartile range across categories. Ground-truth masks serve only for post-hoc stratification.
Table S3. Feature and support-view ablations in the 1-shot setting. AUROC results are mean standard deviation over three seeds. The final column reports the median selected over categories for MVTec-AD/VisA under seed 42. Disabling rotations also removes diversity from the support-derived validation and calibration pools.
| Configuration | MVTec-AD | VisA | Median (MVTec-AD/VisA) | ||
|---|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | ||
| Default: 40–80%, standardized | 0.65/0.65 | ||||
| Single block at 80% depth | 0.70/0.70 | ||||
| Shallow blocks at 20–40% depth | 0.60/0.60 | ||||
| Without layer standardization | 0.85/0.85 | ||||
| Without rotation-derived views | 0.60/0.60 | ||||

Figure S2. Distribution of category-specific operating times selected by JGN, pooled across three seeds. Each observation represents one category–seed pair.
tion rather than remaining fixed.
B.4. Qualitative Failure Modes
Flownomaly scores token-wise feature discrepancies against the support-derived normal distribution. While effective for localized defects, it does not explicitly model object-level relations, part counts, or global configurations.
Figure S3 illustrates two representative failure cases where the predicted anomaly map remains empty:
-
Logical anomalies: In MVTec-AD cable with swapped wires (top), individual wire segments appear locally normal, producing near-zero residuals and an empty anomaly map despite the invalid configuration.
-
Missing components: In VisA pcb3 (bottom), the missing component reveals the same background as previously seen in normal support views; because the observed tokens remain compatible with the normal distribution, the predicted anomaly map is blank.
C. Additional Evaluations
C.1. Backbone Comparison
Table S4 complements the Table 5 of the main paper by comparing against DINOv3-7B [30]. DINOv3 employs a patch size (versus DINOv2's ), so the default input resolution produces a patch token grid. To ensure a direct comparison on an identical feature map resolution, DINOv3 is additionally evaluated at a higher resolution of , matching the default grid (). As shown in Table S4, DINOv3-7B does not

Query
Ground-Truth

Flownomaly

Query
Ground-Truth

Flownomaly
Figure S3. Failure modes where the predicted anomaly map remains essentially empty. Columns show the query image, ground-truth mask, and Flownomaly anomaly map. Top: Logical anomaly with swapped wires (MVTec-AD cable). Bottom: Missing component revealing previously seen background (VisA pcb3).
improve over DINov2-g at either resolution, consistent with findings reported by SubspaceAD [18]. As in the DINov2 ablation, the velocity-network bottleneck width is half the encoder's token embedding dimension (d/2).
Table S4. DINov3 vs. DINov2 backbone ablation in the 1-shot setting across MVTec-AD and VisA. DINov3 (16 × 16 patch size) is evaluated at 672 × 672 (42 × 42 token grid) and at 768 × 768 to match DINov2's 48 × 48 token grid.
| Backbone | Res. | MVTec-AD | VisA | ||
|---|---|---|---|---|---|
| I-AUROC | P-AUROC | I-AUROC | P-AUROC | ||
| DINov2-g | |||||
| DINov3-7B | |||||
| DINov3-7B | |||||
C.2. Full-Shot Evaluation
Although Flownomaly is designed for FSAD, performance is also evaluated across all available normal training images. Rotations are disabled, and the images are partitioned into fitting, validation, and calibration pools. For normal training images, validation and calibration each receive images. Tables S5 and S6 report the aggregate results on MVTec-AD and VisA, respectively.
D. Additional Qualitative Results
To complement the qualitative results in the main paper, this section provides an extended set of qualitative comparisons, presenting detailed anomaly maps for representative samples from the MVTec-AD dataset in Fig. S4, the VisA dataset in Fig. S5, and the Real-IAD dataset in Fig. S6. These exam-
Table S5. Full-shot anomaly detection and localization on MVTec-AD. Rotation augmentations are disabled in the full-shot setting. All values are percentages. Bold denotes the best result, and underlined denotes the second-best result.
| Method | Image-level | Pixel-level | ||||
|---|---|---|---|---|---|---|
| AUROC | AUPR | AUROC | AUPRO | |||
| PatchCore [27] | 99.2 | 99.8 | 98.8 | 98.1 | 92.6 | 59.3 |
| AnomalyDINO [6] | 99.5 | 99.8 | 99.0 | 98.2 | 95.0 | 64.3 |
| SubspaceAD [18] | 99.2 | 99.6 | 98.3 | 98.2 | 95.6 | 64.7 |
| ANoCo [29] | 99.4 | 99.7 | 98.5 | 98.2 | 96.4 | 67.8 |
| Flownomaly | 99.7 | 99.9 | 99.0 | 98.7 | 96.4 | 67.2 |
Table S6. Full-shot anomaly detection and localization on VisA. Rotation augmentations are disabled in the full-shot setting. All values are percentages. Bold denotes the best result, and underlined denotes the second-best result.
| Method | Image-level | Pixel-level | ||||
|---|---|---|---|---|---|---|
| AUROC | AUPR | AUROC | AUPRO | |||
| PatchCore [27] | 92.8 | 91.4 | 88.0 | 98.5 | 91.1 | 43.7 |
| AnomalyDINO [6] | 97.6 | 98.0 | 94.5 | 98.8 | 96.1 | 53.8 |
| SubspaceAD [18] | 98.2 | 98.3 | 95.0 | 99.1 | 96.9 | 53.0 |
| ANoCo [29] | 98.7 | 98.9 | 96.1 | 99.2 | 95.3 | 54.7 |
| Flownomaly | 98.9 | 98.9 | 96.5 | 99.3 | 97.0 | 54.8 |
ples further illustrate the model's localization performance across diverse object categories and anomaly types under the 1-shot (and 1-sample) settings, confirming that Flownomaly consistently achieves sharp defect delineation while suppressing background responses.
Carpet
Query Image
Ground-Truth
AnomalyDINO
SubspaceAD
Flownomaly

Screw
Tile
Toothbrush
Transistor
Wood
Figure S4. Additional qualitative localization results on representative MVTec-AD samples under the 1-shot setting. Columns show the input image, ground-truth mask, baseline anomaly maps (AnomalyDINO [6], SubspaceAD [18]), and Flownomaly's predicted anomaly map.
Capsules
Query Image
Ground-Truth
AnomalyDINO
SubspaceAD
Flownomaly

Cashew
Chewing Gum
Pipe Fryum
PCB 4
Fryum
Figure S5. Additional qualitative localization results on representative VisA samples under the 1-shot setting. Columns show the input image, ground-truth mask, baseline anomaly predictions (AnomalyDINO [6], SubspaceAD [18]), and Flownomaly.
Audiojack
Query Image
Ground-Truth
AnomalyDINO
SubspaceAD
Flownomaly

Bottle Cap
Phone Battery
Porcelain Doll
Regulator
Zipper
Figure S6. Qualitative localization results on representative Real-IAD samples under the 1-sample setting (spanning five multi-view captures of a single normal physical sample). Columns show the input query image, ground-truth mask, baseline anomaly maps (AnomalyDINO [6], SubspaceAD [18]), and Flownomaly.
E. Per-Category Few-Shot and Sample-Shot Results
Tables S7 and S8 report per-category results on MVTec-AD and VisA under the 1-, 2-, and 4-shot settings. For Real-IAD, due to the 30-category scale, per-category results are partitioned across two separate tables: Table S9 reports the 1- and 2-sample settings, and Table S10 reports the 4-sample setting.
Table S7. Per-category anomaly detection and localization results on MVTec-AD under the 1-, 2-, and 4-shot settings. Results are mean and sample standard deviation over three seeds. All values are percentages.
| Setup | Category | MVTec-AD | |||||
|---|---|---|---|---|---|---|---|
| AUROC | Image-level AUPR | AUROC | Pixel-level AUPRO | ||||
| 1-shot | bottle | ||||||
| cable | |||||||
| capsule | |||||||
| carpet | |||||||
| grid | |||||||
| hazelnut | |||||||
| leather | |||||||
| metal_nut | |||||||
| pill | |||||||
| screw | |||||||
| tile | |||||||
| toothbrush | |||||||
| transistor | |||||||
| wood | |||||||
| zipper | |||||||
| 2-shot | bottle | ||||||
| cable | |||||||
| capsule | |||||||
| carpet | |||||||
| grid | |||||||
| hazelnut | |||||||
| leather | |||||||
| metal_nut | |||||||
| pill | |||||||
| screw | |||||||
| tile | |||||||
| toothbrush | |||||||
| transistor | |||||||
| wood | |||||||
| zipper | |||||||
| 4-shot | bottle | ||||||
| cable | |||||||
| capsule | |||||||
| carpet | |||||||
| grid | |||||||
| hazelnut | |||||||
| leather | |||||||
| metal_nut | |||||||
| pill | |||||||
| screw | |||||||
| tile | |||||||
| toothbrush | |||||||
| transistor | |||||||
| wood | |||||||
| zipper | |||||||
Table S8. Per-category anomaly detection and localization results on VisA under the 1-, 2-, and 4-shot settings. Results are mean and sample standard deviation over three seeds. All values are percentages.
| Setup | Category | VisA | |||||
|---|---|---|---|---|---|---|---|
| AUROC | Image-level AUPR | AUROC | Pixel-level AUPRO | ||||
| 1-shot | candle | ||||||
| capsules | |||||||
| cashew | |||||||
| chewinggum | |||||||
| fryum | |||||||
| macaroni1 | |||||||
| macaroni2 | |||||||
| pcb1 | |||||||
| pcb2 | |||||||
| pcb3 | |||||||
| pcb4 | |||||||
| pipe_fryum | |||||||
| 2-shot | candle | ||||||
| capsules | |||||||
| cashew | |||||||
| chewinggum | |||||||
| fryum | |||||||
| macaroni1 | |||||||
| macaroni2 | |||||||
| pcb1 | |||||||
| pcb2 | |||||||
| pcb3 | |||||||
| pcb4 | |||||||
| pipe_fryum | |||||||
| 4-shot | candle | ||||||
| capsules | |||||||
| cashew | |||||||
| chewinggum | |||||||
| fryum | |||||||
| macaroni1 | |||||||
| macaroni2 | |||||||
| pcb1 | |||||||
| pcb2 | |||||||
| pcb3 | |||||||
| pcb4 | |||||||
| pipe_fryum | |||||||
Table S9. Per-category anomaly detection and localization results on Real-IAD under the 1- and 2-sample settings. Under the sample-shot protocol, each physical sample comprises five fixed multi-view captures (5 and 10 support images, respectively). Results are mean and sample standard deviation over three seeds. All values are percentages.
| Category | 1-sample | 2-sample | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AUROC | Image-level AUPR | AUROC | Pixel-level AUPR | AUROC | Image-level AUPR | AUROC | Pixel-level AUPR | |||||
| audiojack | ||||||||||||
| bottle_cap | ||||||||||||
| button_battery | ||||||||||||
| end_cap | ||||||||||||
| eraser | ||||||||||||
| fire_hood | ||||||||||||
| mint | ||||||||||||
| mounts | ||||||||||||
| pcb | ||||||||||||
| phone_battery | ||||||||||||
| plastic_nut | ||||||||||||
| plastic_plug | ||||||||||||
| porcelain_doll | ||||||||||||
| regulator | ||||||||||||
| rolled_strip_base | ||||||||||||
| sim_card_set | ||||||||||||
| switch | ||||||||||||
| tape | ||||||||||||
| terminalblock | ||||||||||||
| toothbrush | ||||||||||||
| toy | ||||||||||||
| toy_brick | ||||||||||||
| transistor1 | ||||||||||||
| u_block | ||||||||||||
| usb | ||||||||||||
| usb_adaptor | ||||||||||||
| vcpill | ||||||||||||
| wooden_beads | ||||||||||||
| woodstick | ||||||||||||
| zipper | ||||||||||||
Table S10. Per-category anomaly detection and localization results on Real-IAD under the 4-sample setting. Under the sample-shot protocol, each physical sample comprises five fixed multi-view captures (20 support images). Results are mean and sample standard deviation over three seeds. All values are percentages.
| Category | 4-sample | |||||
|---|---|---|---|---|---|---|
| AUROC | Image-level AUPR | AUROC | Pixel-level AUPRO | |||
| audiojack | ||||||
| bottle_cap | ||||||
| button_battery | ||||||
| end_cap | ||||||
| eraser | ||||||
| fire_hood | ||||||
| mint | ||||||
| mounts | ||||||
| pcb | ||||||
| phone_battery | ||||||
| plastic_nut | ||||||
| plastic_plug | ||||||
| porcelain_doll | ||||||
| regulator | ||||||
| rolled_strip_base | ||||||
| sim_card_set | ||||||
| switch | ||||||
| tape | ||||||
| terminalblock | ||||||
| toothbrush | ||||||
| toy | ||||||
| toy_brick | ||||||
| transistor1 | ||||||
| u_block | ||||||
| usb | ||||||
| usb_adaptor | ||||||
| vcpill | ||||||
| wooden_beads | ||||||
| woodstick | ||||||
| zipper | ||||||