Antithetic Flow-Matching Residuals for Multi-Class Anomaly Detection
Abstract
AFR detects anomalies by averaging antithetic one-step predictions from a flow-matching diffusion transformer on frozen DINOv2 features across noise levels, improving defect detection without category labels.
A generative model of normal images can find defects by restoring a noised test image and comparing it with the input. The accuracy of this approach heavily depends on two characteristics of the noise, its amount and its randomness. An optimum level is dependent on the defect. Moreover, an arbitrary choice of sampled noise introduces an error of its own. We present AFR (antithetic flow-matching residuals), which detects anomalies by observing the one-step x-predictions of a flow-matching diffusion transformer (DiT) trained on frozen DINOv2 features. At every noise level along the straight path between Gaussian noise and data, AFR averages the predictions of only one antithetic noise pair, ε and -ε, as opposed to multiple random noise draws. This cancels the part of the prediction error that changes sign with the noise sample while costing only two independent samples. AFR then averages the residual over 10 noise levels and measures each feature channel in units of its normal error. This is done so that defects in precisely predicted channels are not drowned by the others. With one model per dataset and no category labels, AFR outperforms recent state-of-the-art multi-class anomaly detection methods on MVTec AD, VisA and BTAD, at 36 ms per image including the encoder. Code and models are available at https://github.com/Vshayan/Antithetic-Flow-Matching.
Get this paper in your agent:
hf papers read 2612.01546 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 1
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper