Anomaly Detection with Variance Stabilized Density Estimation

Amit Rozner, Barak Battash, Henry Li, Lior Wolf, Ofir Lindenbaum

TL;DR

Density-based anomaly detection often fails in high dimensions because deep generative models can assign high likelihoods to anomalies while overfitting normal points. This paper introduces Variance-Stabilized Density Estimation (VSDE), which penalizes the variance of log-likelihoods over normal training data to encourage a stable, uniform density around inliers. Combined with autoregressive Probabilistic Normalized Networks and a feature-permutation spectral ensemble, this approach establishes a new state of the art across 52 tabular datasets without requiring dataset-specific hyperparameter tuning.

What Problem Does This Paper Address?

In anomaly detection (AD), the standard probabilistic intuition is straightforward: model the distribution of "normal" data, and flag any test point with low likelihood as anomalous.

In practice, however, likelihood-based detectors consistently underperform compared to geometric algorithms (like $k$-NN or Isolation Forests) and one-class classification methods (like Deep SVDD or contrastive learning). In high-dimensional tabular spaces, density estimators suffer from the curse of dimensionality and overfitting:

  1. They create sharp, isolated likelihood spikes directly over individual training examples.
  2. They occasionally assign counter-intuitively high likelihoods to simple out-of-distribution points.

The authors set out to fix density estimation so it can reliably serve as an anomaly score for complex tabular data.

Methods

The authors introduce a framework centered around regularized density learning:

  • Variance-Stabilized Density Estimation (VSDE): Instead of standard maximum likelihood estimation (MLE), VSDE optimizes: $$\min_\theta \; -\mathbb{E}_{X_N}[\log \hat{p}_\theta(x)] + \lambda \operatorname{Var}_{X_N}[\log \hat{p}_\theta(x)]$$ Minimizing the variance of the log-likelihood across normal training samples ($X_N$) discourages sharp spikes and encourages the model to treat the inlier distribution as roughly uniform across a compact support.

  • Probabilistic Normalized Networks (PNNs): To model densities without restrictive distributional assumptions (such as Gaussian mixtures), the authors employ an autoregressive PNN. By modeling the cumulative distribution function (CDF) via a neural network with strictly positive weights, the exact density $\hat{p}_\theta(x^{(i)} \mid x^{(<i)})$ is obtained analytically via differentiation, guaranteeing a universal approximator for compact densities.

  • Spectral Feature Permutation Ensemble: Because autoregressive models depend on feature ordering, the authors train an ensemble across random feature permutations. Rather than taking a simple arithmetic mean, they construct an empirical covariance matrix of the log-likelihood scores and use its leading eigenvector to weight each model's prediction—adapting unsupervised spectral ensembling to density estimation.

Datasets

The authors evaluated their model on a large benchmark of 52 tabular datasets:

  • 47 classical tabular datasets from the recent ADBench benchmark (Han et al., 2022), spanning biomedicine, audio, finance, fraud detection, and image feature embeddings.
  • 5 classic datasets commonly used in the anomaly detection literature from ODDS (Rayana, 2016; Pang et al., 2019).
  • Synthetic 2D data to visually analyze density surfaces.
  • Semi-synthetic benchmarks containing four distinct injected anomaly types: Global, Clustered, Local, and Dependency-based.

Dataset sizes ranged from 80 to 619,326 samples, feature dimensions ranged from 3 to 1,555, and anomaly ratios varied from 0.03% to 39.91%.

Key Insights and Ideas

  • Empirical Validation of the Low-Variance Hypothesis: On 47 of the 52 evaluated datasets, the empirical variance of log-likelihoods for normal points was strictly lower than for anomalies ($\sigma_n^2 / \sigma_a^2 < 1$). Normal data naturally clusters around stable, predictable manifolds, while anomalies scatter irregularly.
  • Regularization Overrides Dimensional Pathology: Unregularized MLE models create needle-thin peaks around training samples, yielding poor AUCs on slightly displaced test inliers. Penalizing variance flattens these peaks into a plateau, drastically improving separation at test time.
  • Spectral Weighting Over Simple Averaging: Weighting autoregressive permutations by the principal eigenvector of their covariance matrix filters uncorrelated estimation noise across different variable orders.

Key Results

  • State-of-the-Art Performance: Across all 52 tabular datasets, VSDE achieved a mean AUC of 86.0% and median AUC of 92.4%, outperforming the second-best baseline (Internal Contrastive Learning / ICL) by 1.2 and 2.2 points, respectively.
  • Consistent Ranking: VSDE earned an average rank of 3.3 across the benchmark (surpassing ICL's 3.8 and DTE-NP's 3.9) and was never ranked last on any dataset.
  • Dolan-Moré Performance Profiles: Under performance profile analysis, VSDE's score was never worse than 0.82 $\times$ the best-performing algorithm on any evaluated dataset.
  • Robustness to Contamination: When injecting up to 5% anomalous samples into the training set, the model showed virtually no performance degradation on datasets such as Breastw and Cardio.
  • Anomaly Type Breakdown: On semi-synthetic data, the method excelled on Global (98.7% AUC) and Clustered (92.9% AUC) anomalies, while Local (85.0%) and Dependency (83.5%) anomalies proved moderately more difficult.

Limitations and Future Work

  • Tabular-Only Focus: The current architecture uses dense layers within the PNN and does not incorporate convolutional or recurrent mechanisms needed for raw image or sequential/time-series data.
  • Performance on Local Anomalies: Because local anomalies are drawn close to inlier modes, they often land within high-likelihood regions, making them harder for variance-regularized densities to catch.
  • Lack of Theoretical Guarantees for Spectral Ensembling: While adapting spectral ensembling from supervised classification works well empirically, a formal theoretical analysis for unsupervised density combinations remains open.
  • Connections to Model Selection Criteria: The authors suggest future work investigating theoretical connections between the VSDE objective and the Watanabe-Akaike Information Criterion (WAIC).

Summary updated

BibTeX
@inproceedings{rozner2024anomaly,
  author = {Amit Rozner and Barak Battash and Henry Li and Lior Wolf and Ofir Lindenbaum},
  title = {{Anomaly Detection with Variance Stabilized Density Estimation}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=QWnjmAggVj},
}
Figure