Learning to Rank Anomalies: Scalar Performance Criteria and Maximization of Two-Sample Rank Statistics

Myrto Limnios, Nathan Noiry, Stéphan Clémençon · DOI

Abstract

The ability to collect and store ever more massive databases has been accompanied by the need to process them efficiently. In many cases, most observations have the same behavior, while a probable small proportion of these observations are abnormal. Detecting the latter, defined as outliers, is one of the major challenges for machine learning applications (e.g. in fraud detection or in predictive maintenance). In this paper, we propose a methodology addressing the problem of outlier detection, by learning a data-driven scoring function defined on the feature space which reflects the degree of abnormality of the observations. This scoring function is learnt through a well-designed binary classification problem whose empirical criterion takes the form of a two-sample linear rank statistics on which theoretical results are available. We illustrate our methodology with preliminary encouraging numerical experiments.

Introduction

In critical domains such as fraud detection and predictive maintenance, identifying anomalies is rarely a simple binary task. Instead, practitioners require a way to prioritize observations based on their degree of "abnormality." This shift from binary classification to anomaly ranking allows for more efficient allocation of human intervention.

The primary challenge in anomaly ranking is the lack of labeled data and the difficulty of optimizing functional performance criteria. The gold standard for evaluation is the Mass-Volume (MV) curve, which measures the volume of the region where the scoring function exceeds a threshold against the probability mass it captures. However, the MV curve is a functional criterion, making it difficult to optimize directly in an unsupervised setting.

Methodology

The proposed framework transforms the unsupervised ranking problem into a supervised-style optimization task through two key steps:

  1. Synthetic Outlier Generation: To provide a reference for "abnormality," the authors generate a synthetic sample from a uniform distribution across the feature space. This sample acts as a proxy for the background noise of potential outliers.
  2. Rank-Based Optimization: The model learns a scoring function $s(x)$ by maximizing a two-sample linear rank statistic. This approach uses a score-generating function $\phi$ to weight the ranks, allowing the model to prioritize specific regions of the distribution.
Figure 2: Various score-generating functions (phi) used to weight ranks, such as Logistic, Mann-Whitney, and Van der Waerden tests.

By selecting different $\phi$ functions, researchers can tune the sensitivity of the ranker. For instance, some functions are more robust to noise, while others are optimized to identify the most extreme outliers.

Theoretical Framework: The Rank-MV Connection

A core contribution of this work is the formal proof that maximizing two-sample rank statistics is mathematically equivalent to minimizing the area under the MV curve (AMV). This provides a scalar, optimizable target for what was previously a functional problem.

Figure 1: An illustration of a performance curve (e.g., MV curve) where the goal is to minimize the area under the curve to achieve optimal ranking.

This connection allows for the use of standard machine learning architectures, such as Multi-Layer Perceptrons (MLPs), to learn complex scoring functions. To handle the non-smooth nature of rank statistics, the authors employ a hybrid loss function combining standard Binary Cross-Entropy (BCE) with a regularized proxy of the rank statistic as a penalty term.

Experimental Results

The methodology was validated using synthetic 2D datasets consisting of a Gaussian "normal" distribution surrounded by "radial" outliers. Key findings include:

  • Ranking Accuracy: The model achieved an accuracy of 0.91 ± 0.13 when identifying the top 25 most abnormal points.
  • Stability and Convergence: Increasing the weight of the rank-based penalty ($\lambda$) led to faster and more stable convergence compared to using BCE alone.
  • Visual Validation: Heatmaps of the resulting scoring functions showed a clear, smooth gradient decreasing from the center of the normal distribution toward the outliers, confirming the model's ability to recover the underlying density structure.

Conclusion and Future Work

This research provides a robust theoretical and empirical foundation for anomaly ranking via rank statistics. While highly effective in low-dimensional spaces, future work will address the "curse of dimensionality" associated with uniform synthetic outlier generation. Additionally, the authors aim to extend this framework to high-dimensional real-world datasets and develop fully differentiable rank-based loss functions to further streamline the optimization process.

Summary updated

BibTeX
@inproceedings{limnios2021learning,
  author = {Myrto Limnios and Nathan Noiry and Stéphan Clémençon},
  title = {{Learning to Rank Anomalies: Scalar Performance Criteria and Maximization of Two-Sample Rank Statistics}},
  booktitle = {LIDTA@ECML/PKDD},
  year = {2021},
}
Figure