Statistical Inference for Clustering-based Anomaly Detection

Nguyen Thi Minh Phu, Duong Tan Loc, Vo Nguyen Le DuyarXiv 2025 · DOI

Abstract

Clustering-based anomaly detection (AD) algorithms, such as DBSCAN, are widely used to identify outliers in unsupervised settings. However, these methods often lack statistical reliability, leading to high False Positive Rates (FPR) due to "double dipping"—the practice of using the same data to both identify and test a hypothesis. We present SI-CLAD, a novel framework that leverages Selective Inference (SI) to provide valid p-values for detected anomalies. By characterizing the selection events of clustering algorithms as geometric constraints, SI-CLAD ensures rigorous FPR control while maintaining high detection power.

The Problem: The "Double Dipping" Trap

In unsupervised anomaly detection, researchers often use clustering to find data points that deviate from the main distribution. A significant challenge arises when trying to determine the statistical significance of these "anomalies." Traditional statistical tests suffer from selection bias because the hypothesis (e.g., "this point is an outlier") is generated by the same data used for testing.

This "double dipping" results in "naive" p-values that are overly optimistic, often approaching zero even for normal noise. While conservative methods like the Bonferroni correction can mitigate this, they often lack the power to detect genuine anomalies. There is a critical need for a framework that provides valid inference without sacrificing sensitivity.

Methods: SI-CLAD and the Geometry of DBSCAN

The proposed framework, SI-CLAD (Statistical Inference for CLustering-based Anomaly Detection), specifically addresses the popular DBSCAN algorithm. The core innovation lies in performing statistical testing conditional on the selection event—the specific logic DBSCAN used to label a point as an anomaly.

Characterizing the Selection Event

To make the inference tractable, the authors decompose the data into a test statistic direction and a nuisance direction. This reduces a high-dimensional problem into a search along a one-dimensional parameterized line. The "selection event" in DBSCAN—how it identifies core points and forms clusters—is mathematically translated into a set of quadratic inequalities.

The SI-CLAD method characterizes the selection event by identifying the intervals on a 1D line where the clustering results remain consistent with the observed data.

Directly solving these inequalities for the entire DBSCAN process is computationally intensive. SI-CLAD employs a "divide-and-conquer" strategy using parametric programming. This hierarchical line search identifies the exact intervals (the "Truncated Region") where the observed set of anomalies remains constant, allowing for the calculation of valid, non-conservative p-values.

Key Insights and Results

Guaranteed FPR Control

Experimental results on synthetic and real-world datasets (including Heart Disease and Breast Cancer diagnostics) demonstrate that SI-CLAD successfully maintains the FPR below the pre-specified significance level (e.g., $\alpha = 0.05$). In contrast, naive methods frequently "hallucinate" anomalies, yielding FPRs 5-10x higher than the limit.

Comparison of detection results showing that while naive methods produce near-zero p-values for normal points (C and D), SI-CLAD provides valid p-values that correctly identify them as non-significant.

Superior Detection Power

Beyond validity, SI-CLAD achieves a higher True Positive Rate (TPR) compared to both the Bonferroni correction and simpler "over-conditioned" SI methods. By precisely modeling the DBSCAN selection event, the framework recovers the power to identify real anomalies that other rigorous methods might miss.

Limitations and Future Directions

While SI-CLAD provides a robust foundation for reliable anomaly detection, several avenues for future work remain:

  • Algorithm Expansion: The current implementation is specific to DBSCAN; adapting it to other density-based algorithms like OPTICS or DENCLUE is a logical next step.
  • Distributional Assumptions: The framework currently assumes Gaussian noise and Euclidean distance metrics.
  • Hyperparameter Tuning: The statistical guarantees assume that DBSCAN parameters ($eps$ and $MinPts$) are fixed beforehand. Modeling the selection event of the parameter tuning process itself remains a challenge.

Summary updated

BibTeX
@misc{phu2025statistical,
  author = {Nguyen Thi Minh Phu and Duong Tan Loc and Vo Nguyen Le Duy},
  title = {{Statistical Inference for Clustering-based Anomaly Detection}},
  year = {2025},
  eprint = {2504.18633},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.18633},
}
Figure