On Diffusion Modeling for Anomaly Detection
Victor Livernoche, Vineet Jain, Yashar Hezaveh, Siamak Ravanbakhsh
TL;DR
This work examines diffusion models for anomaly detection and finds that while DDPMs perform well, they are computationally intensive. It introduces Diffusion Time Estimation (DTE), which leverages the posterior distribution over diffusion time $p(\sigma_t^2|x_s)$ to score anomalies, deriving an analytic inverse-Gamma form and offering non-parametric and parametric (IG and categorical) estimators for scalable inference. Across 57 datasets in the ADBench benchmark, DTE variants achieve competitive performance with significantly faster inference than DDPMs, and image embeddings further boost performance. Overall, diffusion-time based anomaly detection emerges as a scalable alternative to traditional methods and deep-learning approaches for diverse unsupervised and semi-supervised settings.
Abstract
Known for their impressive performance in generative modeling, diffusion models are attractive candidates for density-based anomaly detection. This paper investigates different variations of diffusion modeling for unsupervised and semi-supervised anomaly detection. In particular, we find that Denoising Diffusion Probability Models (DDPM) are performant on anomaly detection benchmarks yet computationally expensive. By simplifying DDPM in application to anomaly detection, we are naturally led to an alternative approach called Diffusion Time Estimation (DTE). DTE estimates the distribution over diffusion time for a given input and uses the mode or mean of this distribution as the anomaly score. We derive an analytical form for this density and leverage a deep neural network to improve inference efficiency. Through empirical evaluations on the ADBench benchmark, we demonstrate that all diffusion-based anomaly detection methods perform competitively for both semi-supervised and unsupervised settings. Notably, DTE achieves orders of magnitude faster inference time than DDPM, while outperforming it on this benchmark. These results establish diffusion-based anomaly detection as a scalable alternative to traditional methods and recent deep-learning techniques for standard unsupervised and semi-supervised anomaly detection settings.
