🤖 AI Summary
This work addresses the challenge of anomaly detection in high-dimensional foundation model token spaces under the absence of anomalous samples, where normal data exhibit high heterogeneity and unstable sampling. To overcome this, the authors propose a geometry-driven preconditioning approach based on rectified flows: by geometrically reparameterizing embeddings into a well-conditioned latent space and integrating optimal transport–coupled rectified flows to stabilize energy-based model (EBM) training, the method enables accurate finite-step MCMC sampling and precise anomaly localization. This approach achieves, for the first time, stable EBM optimization in high-dimensional token spaces, attaining image- and pixel-level AUROC scores of 98.6%/97.9% on MVTec-AD and 97.3%/99.0% on VisA, with image-level performance surpassing existing unified EBM methods by up to 10.8%.
📝 Abstract
Unified anomaly detection requires modeling highly heterogeneous normal data without access to anomalous samples. While foundation models like DINOv2 provide rich token representations, leveraging these spaces for explicit density estimation remains challenging. Energy-Based Models (EBMs) offer a principled formulation, but their training in high-dimensional token spaces is unstable due to anisotropy and strong cross-dimensional correlations, which degrades finite-step Markov Chain Monte Carlo (MCMC) sampling. We identify this instability as fundamentally geometric and introduce ReFP-AD (Rectified Flow Preconditioning for Anomaly Detection), which learns a geometric reparameterization that maps high-dimensional embeddings into a well-conditioned latent space via an optimal transport (OT)-coupled rectified flow. This preconditioning enables stable persistent contrastive divergence with preconditioned Stochastic Gradient Langevin Dynamics (SGLD) in full-dimensional token spaces. Anomaly scores are then derived from the learned energy landscape using gradient norms. Under a strict unified protocol on the MVTec-AD and VisA datasets, ReFP-AD achieves 98.6%/97.9% Image/Pixel AUROC on MVTec-AD and 97.3%/99.0% on VisA, outperforming prior unified EBM baselines by up to +10.8% in Image AUROC. Ablation experiments demonstrate that geometric reparameterization is critical for finite-step MCMC and accurate anomaly localization in high-dimensional token spaces. Code is available at https://github.com/CLendering/ReFP-AD