# Statistical Test for Diffusion-Based Anomaly Localization via Selective Inference

arXiv: https://arxiv.org/abs/2402.11789 · HTML: https://mlsanity.com/paper/2402.11789/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Builds on 26 of its 39 references that are in the map.
- First posted on arXiv 19 Feb 2024.

## Builds on (most cited first, 26 of 26)

- [Denoising Diffusion Probabilistic Models](https://mlsanity.com/paper/2006.11239/) (2020)
- [Autoencoders for Unsupervised Anomaly Segmentation in Brain MR Images: A Comparative Study](https://mlsanity.com/paper/2004.03271/) (2020)
- [Fast Unsupervised Brain Anomaly Detection and Segmentation with Diffusion Models](https://mlsanity.com/paper/2206.03461/) (2022)
- [Exact post-selection inference, with application to the lasso](https://mlsanity.com/paper/1311.6238/) (2013)
- [MedPerf: Open Benchmarking Platform for Medical Artificial Intelligence using Federated Evaluation](https://mlsanity.com/paper/2110.01406/) (2021)
- [Unsupervised Detection of Lesions in Brain MRI using constrained adversarial auto-encoders](https://mlsanity.com/paper/1806.04972/) (2018)
- [Optimal Inference After Model Selection](https://mlsanity.com/paper/1410.2597/) (2014)
- [Anomaly Detection with Conditioned Denoising Diffusion Models](https://mlsanity.com/paper/2305.15956/) (2023)
- [Exact Post-Selection Inference for Sequential Regression Procedures](https://mlsanity.com/paper/1401.3889/) (2014)
- [Selective Inference for Hierarchical Clustering](https://mlsanity.com/paper/2012.02936/) (2020)
- [Diffusion Models for Counterfactual Generation and Anomaly Detection in Brain Images](https://mlsanity.com/paper/2308.02062/) (2023)
- [Valid Inference Corrected for Outlier Removal](https://mlsanity.com/paper/1711.10635/) (2017)
- [Testing for a Change in Mean After Changepoint Detection](https://mlsanity.com/paper/1910.04291/) (2019)
- [More Powerful Conditional Selective Inference for Generalized Lasso by Parametric Programming](https://mlsanity.com/paper/2105.04920/) (2021)
- [Unsupervised Anomaly Detection in Medical Images Using Masked Diffusion Model](https://mlsanity.com/paper/2305.19867/) (2023)
- [Computing Valid p-values for Image Segmentation by Selective Inference](https://mlsanity.com/paper/1906.00629/) (2019)
- [Selective Inference for Group-Sparse Linear Models](https://mlsanity.com/paper/1607.08211/) (2016)
- [Quantifying Statistical Significance of Neural Network-based Image Segmentation by Selective Inference](https://mlsanity.com/paper/2010.01823/) (2020)
- [Valid P-Value for Deep Learning-Driven Salient Region](https://mlsanity.com/paper/2301.02437/) (2023)
- [Conditional Selective Inference for Robust Regression and Outlier Detection using Piecewise-Linear Homotopy Continuation](https://mlsanity.com/paper/2104.10840/) (2021)
- [Fast and More Powerful Selective Inference for Sparse High-order Interaction Model](https://mlsanity.com/paper/2106.04929/) (2021)
- [Exact Post Model Selection Inference for Marginal Screening](https://mlsanity.com/paper/1402.5596/) (2014)
- [CAD-DA: Controllable Anomaly Detection after Domain Adaptation by Statistical Inference](https://mlsanity.com/paper/2310.14608/) (2023)
- [Dynamic Addition of Noise in a Diffusion Model for Anomaly Detection](https://mlsanity.com/paper/2401.04463/) (2024)
- [Statistical Test for Anomaly Detections by Variational Auto-Encoders](https://mlsanity.com/paper/2402.03724/) (2024)
- [Statistical Test for Attention Map in Vision Transformer](https://mlsanity.com/paper/2401.08169/) (2024)

## Built on by (most cited first, 1 of 1)

- [A Survey on Diffusion Models for Anomaly Detection](https://mlsanity.com/paper/2501.11430/) (2025)

## Abstract (arXiv)

Anomaly localization in images -- identifying regions that deviate from normal 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.
