Rapid Distance-Based Outlier Detection via Sampling

Mahito Sugiyama, Karsten M. Borgwardt

TL;DR

This paper demonstrates that a surprisingly simple "one-time sampling" approach—where an object's outlier score is just the distance to its nearest neighbor in a tiny random subset—outperforms complex, state-of-the-art distance-based outlier detection methods. Not only is this method significantly faster (linear vs. quadratic time), but it is also more effective at identifying true outliers across a wide variety of high-dimensional datasets.

The Scalability Wall in Outlier Detection

Distance-based outlier detection is a cornerstone of data mining because it doesn't require a pre-defined probability model of the data. However, it faces a massive "scalability wall." Traditionally, to find outliers, one might calculate the distance from every point to its $k$-nearest neighbors. In a dataset of $n$ objects, this requires $O(n^2)$ distance calculations.

While researchers have tried to speed this up using indexing (like tree structures) or partial computations, these fixes often fail when data is high-dimensional (the "curse of dimensionality") or when the dataset is massive. The authors seek a method that is truly scalable—ideally linear in time—without sacrificing the accuracy of detection.

The One-Time Sampling Method

The authors propose One-time sampling ($q_{Sp}$). The algorithm is elegantly simple:

  1. Sample: Randomly pick a small subset $S$ (the "telltale set") from the entire dataset $X$ only once.
  2. Score: For every object $x$ in the full dataset, calculate its outlier score as the distance to its nearest neighbor in the sample set $S$.
  3. Rank: Objects with the largest distances are flagged as outliers.

While "iterative sampling" (sampling a new subset for every object) had been proposed before, this paper shows that sampling only once is both faster and mathematically superior. The time complexity is reduced to $O(nms)$, where $n$ is the number of objects, $m$ is the dimensions, and $s$ is the sample size. Since $s$ is usually a small constant (like 20), the algorithm is effectively linear.

Key Insights: Why Small Samples Work

Counter-intuitively, the method performs best with very small sample sizes. The authors found that an $s$ of around 20 was often optimal, and increasing the sample size actually led to a slight decrease in effectiveness.

AUPRC vs Number of Samples

Furthermore, the "one-time" approach ($q_{Sp}$) is better than "iterative" sampling ($q_{kthSp}$) because it introduces a helpful dependency. In one-time sampling, if an outlier is far from the sample set, it stays far. In iterative sampling, the randomness of picking a new set for every point adds noise to the scores, making it harder to distinguish true outliers.

The intuition relies on the "telltale" nature of outliers: they are, by definition, different from almost all other objects. Therefore, even a tiny random sample is highly likely to consist of "normal" points. An outlier will be far from this sample of normal points, while a normal point will likely be close to at least one other normal point in the sample.

Experimental Results

The authors evaluated their method against 16 different datasets, including 14 real-world datasets from the UCI repository (like KDD1999, Arrhythmia, Spambase) and 2 synthetic Gaussian mixtures to test extreme dimensionality and scale.

  • Effectiveness: The sampling method achieved the highest average Area Under the Precision-Recall Curve (AUPRC) across all datasets. It outperformed established methods like LOF (Local Outlier Factor), Isolation Forest, and One-class SVM.
  • Robustness: The performance was remarkably stable across different sample sizes (from $s=5$ to $s=1000$), varying by less than 2%.
AUPRC Results Table
  • Efficiency: On the KDD1999 dataset (nearly 5 million objects), the proposed sampling method took only 3.46 seconds. In contrast, the standard $k$-nearest neighbor approach ($q_{kthNN}$) took over 31 days (estimated, as it did not finish).

Limitations and Future Work

While the paper provides a strong theoretical and empirical case for one-time sampling, some areas remain for exploration:

  • Distance Metrics: The study primarily uses standard metrics. Performance might vary if the underlying distance metric is poorly suited to the specific data topology.
  • Sample Sensitivity: Although the average performance is high, a single "bad" random sample could theoretically impact results. While the authors used 10 trials to show stability, a production system might need a strategy to ensure the sample set $S$ is representative.
  • Parameter Heuristics: While the method is mostly parameter-free (aside from $s$), the theoretical analysis relies on parameters ($\alpha$ and $\delta$) that are not known in practice. Future work could look at ways to automatically optimize $s$ based on data characteristics.

Summary updated

BibTeX
@inproceedings{sugiyama2013rapid,
  author = {Mahito Sugiyama and Karsten M. Borgwardt},
  title = {{Rapid Distance-Based Outlier Detection via Sampling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2013},
}
Figure