Quantifying Statistical Significance of Deep Nearest Neighbor Anomaly Detection via Selective Inference

Abstract

In real-world applications, anomaly detection (AD) often operates without access to anomalous data, necessitating semi-supervised methods that rely solely on normal data. Among these methods, deep $k$-nearest neighbor (deep $k$NN) AD stands out for its interpretability and flexibility, leveraging distance-based scoring in deep latent spaces. Despite its strong performance, deep $k$NN lacks a mechanism to quantify uncertainty—an essential feature for critical applications such as industrial inspection. To address this limitation, we propose a statistical framework that quantifies the significance of detected anomalies in the form of $p$-values, thereby enabling control over false positive rates at a user-specified significance level (e.g.,0.05). A central challenge lies in managing selection bias, which we tackle using Selective Inference—a principled method for conducting inference conditioned on data-driven selections. We evaluate our method on diverse datasets and demonstrate that it provides reliable AD well-suited for industrial use cases.

Cite

Text

Niihori et al. "Quantifying Statistical Significance of Deep Nearest Neighbor Anomaly Detection via Selective Inference." Advances in Neural Information Processing Systems, 2025.

Markdown

[Niihori et al. "Quantifying Statistical Significance of Deep Nearest Neighbor Anomaly Detection via Selective Inference." Advances in Neural Information Processing Systems, 2025.](https://mlanthology.org/neurips/2025/niihori2025neurips-quantifying/)

BibTeX

@inproceedings{niihori2025neurips-quantifying,
  title     = {{Quantifying Statistical Significance of Deep Nearest Neighbor Anomaly Detection via Selective Inference}},
  author    = {Niihori, Mizuki and Nishino, Shuichi and Katsuoka, Teruyuki and Shiraishi, Tomohiro and Taji, Kouichi and Takeuchi, Ichiro},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2025},
  url       = {https://mlanthology.org/neurips/2025/niihori2025neurips-quantifying/}
}