Linear-time Outlier Detection via Sensitivity

Mario Lucic, Olivier Bachem, Andreas Krause

Distance-based outlier detection methods are highly accurate but notoriously slow, typically scaling quadratically with dataset size. This paper introduces a linear-time algorithm that uses "sensitivity"—the worst-case impact a data point has on a clustering objective—as a highly effective measure of outlierness. The resulting method outperforms traditional techniques like KNN and LOF in accuracy while being orders of magnitude faster.

The Computational Bottleneck of Outlier Detection

Finding outliers—whether they represent financial fraud, network intrusions, or noisy sensor readings—is a classic machine learning problem. Distance-based methods, such as K-Nearest Neighbors (KNN) and Local Outlier Factor (LOF), are popular because they are non-parametric; they don't require assuming a specific data distribution.

However, these methods have a fatal flaw: they require computing pairwise distances between all data points. This results in $O(n^2)$ computational complexity, making them practically useless for massive modern datasets. Existing workarounds, like using KD-trees for indexing or random subsampling, either degrade in high-dimensional spaces or sacrifice accuracy by ignoring data density. The authors tackle the challenge of achieving the accuracy of exhaustive distance-based methods but in linear time.

Sensitivity as a Measure of Outlierness

The authors borrow a concept called sensitivity from the literature on coresets (small data summaries used to speed up machine learning). In a clustering problem (like k-means), sensitivity measures the maximum impact a single data point can have on the overall clustering cost. Intuitively, an outlier will have a massive impact on a clustering solution because it forces the algorithm to stretch clusters or create new ones just to accommodate it.

Figure 3: Comparison of clustering with and without outliers. Outliers (green stars) significantly shift the cluster centers (red crosses) and boundaries, demonstrating high sensitivity.

The Algorithm: From Sensitivity to Influence

Because exact sensitivity is computationally impossible to calculate for all possible clusterings, the authors compute a mathematically rigorous upper bound called influence. The algorithm works in two primary stages:

  1. Approximate Clustering: Run a fast, adaptive seeding step (specifically, k-means++) to find a rough set of cluster centers.
  2. Calculate Influence: For each point, calculate its influence score based on its distance to the nearest center and the local density.
Figure 4: The proposed workflow: (a) raw data with outliers, (b) a rough approximation using fast seeding, and (c) the resulting influence scores where bubble size represents outlierness.

The brilliance of the influence mathematical bound is that it naturally combines three intuitive outlier metrics into a single equation: local outlierness (distance from cluster center), cluster spread (variance), and inverse cluster density (sparsity of the neighborhood).

To scale even further, the authors provide a distributed, divide-and-conquer version of the algorithm. To avoid the trap of picking the "wrong" number of clusters ($k$), they compute the influence across multiple values of $k$ in a single pass and average the results.

Key Results and Scalability

The authors evaluated their method on 13 datasets, including 11 real-world UCI datasets and 2 synthetic Gaussian models.

  • State-of-the-Art Accuracy: The proposed "Influence" method achieved the highest Area Under the Precision-Recall Curve (AUPRC) on 12 out of the 13 evaluated datasets, beating exhaustive KNN, LOF, and sampling-based baselines.
  • Massive Speedups: Because the algorithm runs in $O(nkd)$ time, it is exceptionally fast. On a 1-million-point dataset, it achieved a 27x speedup over approximate KNN and a 40x speedup over approximate LOF.
  • Extreme Scalability: On the KDDCup-Full dataset (~4.9 million points), the algorithm computed outlier scores in less than 10 minutes. In contrast, exhaustive baseline methods had to be terminated after running for over 24 hours.

Conclusion

By defining an outlier by how much it ruins a model's objective function, the authors provide a robust, mathematically grounded approach that unifies existing heuristics. While the user must still define the hyperparameter $k$, the method's variance reduction techniques make it highly resilient. This sensitivity-based approach offers a path forward for accurate outlier detection on the massive scales required by modern data science.

Summary updated

BibTeX
@inproceedings{lucic2016linear,
  author = {Mario Lucic and Olivier Bachem and Andreas Krause},
  title = {{Linear-time Outlier Detection via Sensitivity}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2016},
}
Figure