Quantifying Statistical Significance in Diffusion-Based Anomaly Localization via Selective Inference
Teruyuki Katsuoka, Tomohiro Shiraishi, Daiki Miwa, Vo Nguyen Le Duy, Ichiro Takeuchi
TL;DR
The authors address the reliability of anomaly localization produced by diffusion models by introducing a selective-inference framework that yields valid $p$-values conditioned on the diffusion-based selection. They formulate a two-sample test comparing mean pixel values in detected anomalous regions against a reference, and derive a selective $p$-value that follows a truncated Gaussian under the null, ensuring proper type I error control. The resulting Diffusion-based Anomaly Localization (DAL) Test is implemented via a principled, parameterized approach that uses piecewise-linear mappings and parametric programming to identify truncation intervals. Empirical results on synthetic data and real-world medical and industrial datasets demonstrate that the method controls false positives while achieving competitive power, suggesting practical utility for high-stakes decision-making. The work provides a general framework that can be extended to other diffusion-model architectures and semi-supervised anomaly-detection tasks.
Abstract
Anomaly localization in images (identifying regions that deviate from expected patterns) is vital in applications such as medical diagnosis and industrial inspection. A recent trend is the use of image generation models in anomaly localization, where these models generate normal-looking counterparts of anomalous images, thereby allowing flexible and adaptive anomaly localization. However, these methods inherit the uncertainty and bias implicitly embedded in the employed generative model, raising concerns about the reliability. To address this, we propose a statistical framework based on selective inference to quantify the significance of detected anomalous regions. Our method provides $p$-values to assess the false positive detection rates, providing a principled measure of reliability. As a proof of concept, we consider anomaly localization using a diffusion model and its applications to medical diagnoses and industrial inspections. The results indicate that the proposed method effectively controls the risk of false positive detection, supporting its use in high-stakes decision-making tasks.
