Learning to rank anomalies: scalar performance criteria and maximization of rank statistics

Myrto Limnios, Nathan Noiry, Stéphan ClémençonMachine Learning 2024

Introduction

Anomaly detection is a critical task in data science, yet it remains fundamentally challenging due to the scarcity of labeled "abnormal" data. Traditional methods often rely on local density or recursive partitioning but frequently lack a global objective function and exhibit high sensitivity to hyperparameters. This paper bridges the gap between unsupervised anomaly detection and supervised learning by reframing the problem as one of "learning to rank."

The Challenge of Anomaly Ranking

Instead of binary classification (normal vs. abnormal), the authors focus on anomaly ranking. The goal is to learn a scoring function $s(x)$ that accurately orders observations by their degree of abnormality. To evaluate such functions in an unsupervised setting, the authors utilize the Mass-Volume (MV) curve. This metric serves as the unsupervised counterpart to the ROC curve, measuring the probability mass captured by a scoring function within a specific volume of the feature space.

Mass-Volume (MV) curves representing the ranking performance of various scoring functions.

Methodology: From Unsupervised to Bipartite Ranking

The proposed framework employs a two-stage procedure to transform the unsupervised problem into a supervised bipartite ranking task:

  1. Synthetic Data Generation: Since true anomalies are unknown, the authors generate a sample of "pseudo-anomalies" drawn from a uniform distribution over the feature space. This acts as a background against which the structure of the normal data becomes a signal.
  2. Bipartite Ranking: The task becomes discriminating the "normal" data from this synthetic "noise."

The core innovation is the use of two-sample linear rank statistics (e.g., the Wilcoxon-Mann-Whitney statistic) as a scalar performance criterion. The authors demonstrate that maximizing these statistics is mathematically equivalent to optimizing the area under the MV curve. This is implemented via Ranking Forest (rForest), a recursive partitioning algorithm designed to maximize the Area Under the Curve (AUC) directly.

Empirical Evaluation

The methodology was validated using a variety of synthetic models and real-world benchmarks from the UCI Repository. The synthetic models included Gaussian distributions with diverse correlation structures (Decreasing, Marginal, Negative, and Equicorrelation) across dimensions up to $d=30$.

Probability density functions for the four synthetic Gaussian models used in the experiments.

Real-world datasets included:

  • Wine Quality: Identifying rare quality levels.
  • Statlog (Shuttle): Detecting rare flight states.
  • MAGIC Gamma Telescope: Discriminating signal (gamma particles) from background noise (hadron rays).

Key Results and Insights

  • Superior Performance: The rForest method consistently outperformed state-of-the-art benchmarks like Local Outlier Factor (LOF) and Isolation Forest (iForest). On the Telescope dataset, rForest achieved near-perfect Rank Power (up to 0.99).
  • Robustness: Unlike many density-based methods, the rank-based approach remained stable as dimensionality increased and showed lower variance across replications compared to LOF.
  • Theoretical Rigor: The paper provides non-asymptotic generalization guarantees, proving that the learned scoring function converges to the optimal "oracle" function as sample size grows.
  • Rarity as a Label: By introducing uniform noise, the structure of normal data becomes a detectable signal, allowing researchers to leverage the robust toolbox of supervised bipartite ranking.

Conclusion

By establishing the MV-ROC duality, this work provides a theoretically grounded and empirically robust framework for anomaly detection. While the current reliance on uniform sampling for synthetic data presents some limitations in non-compact spaces, the transition to a "learning to rank" paradigm offers a powerful new direction for identifying rare events in complex datasets.

Summary updated

BibTeX
@article{limnios2024learning,
  author = {Myrto Limnios and Nathan Noiry and Stéphan Clémençon},
  title = {{Learning to rank anomalies: scalar performance criteria and maximization of rank statistics}},
  journal = {Machine Learning},
  year = {2024},
  doi = {10.1007/s10994-024-06609-9},
}
Figure