AutoUAD: Hyper-parameter Optimization for Unsupervised Anomaly Detection

Wei Dai, Jicong FanICLR 2025

Introduction

In supervised learning, practitioners rely on a "cheat sheet": labeled validation sets that explicitly reveal how well a model is performing. If tweaking a hyperparameter increases accuracy, that change is kept. Unsupervised Anomaly Detection (UAD), however, is much harder because we are essentially "flying blind." Models are trained on "normal" data to find outliers, but during the tuning phase, there are no labeled anomalies to validate against.

Consequently, practitioners often stick to default hyperparameters, which rarely perform optimally across the high diversity of real-world data. To address this "unsupervised model selection" problem, AutoUAD introduces a framework for automatically tuning hyperparameters without requiring any labeled data. By using a novel metric called Normalized Pseudo Discrepancy (NPD), the framework guides Bayesian Optimization to find optimal model settings across diverse datasets.

Proposed Surrogate Metrics

To estimate model performance without labels, the authors propose three new surrogate metrics:

  1. Relative-Top-Median (RTM): An internal metric based on the assumption that a good UAD model should assign very low anomaly scores to the vast majority of data and significantly higher scores to a tiny minority.
  2. Expected-Anomaly-Gap (EAG): A more robust extension of RTM that calculates the "gap" between potential anomalies and normal data across a range of thresholds, reducing the metric's sensitivity to any single threshold choice.
  3. Normalized Pseudo Discrepancy (NPD): The paper’s flagship contribution. This "semi-internal" metric splits the training data and generates a synthetic dataset of "pseudo-anomalies" drawn from an isotropic Gaussian distribution (random noise). NPD then measures the statistical discrepancy between the anomaly scores of the real validation data and this synthetic noise.

These metrics are integrated into a Bayesian Optimization loop (specifically using the Tree-structured Parzen Estimator). The optimization treats the surrogate metric as the objective function, searching the hyperparameter space to maximize the "separation" the model achieves.

Key Insights and Hyperparameter Sensitivity

  • The Power of Maximum Entropy: Why use a Gaussian distribution for pseudo-anomalies? Mathematically, for a given variance, the Gaussian distribution has the highest entropy, representing "maximum uncertainty." If a model cannot distinguish its training data from random Gaussian noise, it hasn't effectively learned the boundary of "normality."
  • Internal vs. Semi-Internal: Purely internal metrics (like RTM) only look at the training data and are prone to overfitting. By introducing an external reference point (the synthetic Gaussian data), NPD provides a more stable and reliable signal for optimization.
  • Theoretical Guarantees: The authors provide a theoretical error bound, proving that maximizing NPD is mathematically linked to minimizing the False Positive and False Negative rates on unseen test data.
  • Hyperparameter Sensitivity: UAD models are incredibly sensitive to settings like weight decay or hidden dimensions. They often feature "jagged" performance landscapes with many local optima that manual tuning would likely miss.
Hyperparameter sensitivity landscapes across various UAD models and datasets.

Experimental Setup and Results

The researchers evaluated their approach on 38 real-world tabular benchmark datasets sourced from ADBench and DAMI. These cover a wide variety of domains, including medical (Breastw, Thyroid), industrial (Fault, Satellite), and general datasets (Letter, Glass, Wine). The datasets vary significantly in dimensionality (5 to 400 features) and anomaly ratios (~1% to ~40%), providing a rigorous test for the framework's generalizability.

Key Findings: * NPD is the Winner: Across nearly all 38 datasets, the NPD metric consistently outperformed existing heuristics (like ModelCentrality or HITS) and other internal metrics. * Significant Performance Boost: Using AutoUAD with NPD led to substantial gains in AUC (Area Under the ROC Curve). For example, on the OCSVM algorithm, AutoUAD achieved a mean AUC of ~84%, compared to ~74% for a random search and ~78% for default settings. * Efficiency: Despite the complexity of Bayesian Optimization, the NPD calculation itself is hyperparameter-free and computationally efficient, making it highly scalable to large datasets.

Limitations and Future Work

While highly effective, the framework does have limitations. The Gaussian Assumption, while a strong "maximum uncertainty" proxy, might be too simplistic for extremely high-dimensional or complex data manifolds where anomalies might look very different from random noise. Additionally, the effectiveness of the tool is bound by the user-defined search space constraints; if the "perfect" setting is outside the range provided to the Bayesian Optimizer, the system cannot find it.

Future directions suggested by the authors include exploring more sophisticated ways to generate "pseudo-anomalies" that better mimic real-world outliers without requiring actual labels. They also aim to extend this framework to non-tabular data, such as images or time-series.

Summary updated

BibTeX
@inproceedings{dai2025autouad,
  author = {Wei Dai and Jicong Fan},
  title = {{AutoUAD: Hyper-parameter Optimization for Unsupervised Anomaly Detection}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=ErQPdaD5wJ},
}
Figure