NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

KNN-DBSCAN: a DBSCAN in high dimensions

Youguang Chen, William Ruys, George Biros · OpenReview

TL;DR

This paper introduces KNN-DBSCAN, a novel density-based clustering algorithm that leverages k-nearest neighbor (kNN) graphs instead of traditional epsilon-neighborhood graphs. This modification significantly improves scalability for high-dimensional datasets, enabling efficient clustering of massive datasets that were previously intractable for DBSCAN.

What Problem Does This Paper Address?

DBSCAN is a powerful density-based clustering algorithm known for its ability to find arbitrarily shaped clusters and handle noise. However, its core operation relies on constructing an epsilon-neighborhood graph (e-NNG), which involves range searches. In high-dimensional spaces, these range searches become computationally prohibitive due to the "curse of dimensionality," making traditional DBSCAN implementations inefficient and non-scalable. Existing parallel DBSCAN algorithms also struggle with high dimensions, often resorting to approximations or facing memory limitations. This paper aims to bridge this gap by proposing a DBSCAN variant that can efficiently handle high-dimensional data.

Methods

The core innovation of KNN-DBSCAN lies in its use of a k-nearest neighbor (kNN) graph instead of an e-NNG. The algorithm defines core points based on the number of neighbors within a certain radius (similar to DBSCAN's definition but adapted for kNN). It then modifies the reachability and connectivity definitions to be based on the kNN graph.

Key methodological contributions include:

  • KNN-DBSCAN Algorithm: A new density-based clustering algorithm that uses kNN graphs. It shares hyperparameters with DBSCAN but uses a different reachability condition.
  • Approximate MST for Clustering: The paper proposes an "inexact MST" construction method that can be efficiently parallelized. This method uses Boruvka's algorithm for both local and distributed MST construction, enabling efficient clustering of core points.
  • Parallel Implementation: A hybrid MPI/OpenMP implementation of KNN-DBSCAN is presented, designed for distributed-memory systems. This implementation focuses on efficient MST construction and handling of cut edges between processes.

Datasets

The paper evaluates KNN-DBSCAN on a variety of datasets:

  • 2D Datasets: Used for initial visualization and comparison with DBSCAN (e.g., Two Moons, Aggregation, Chameleon, Worms).
  • High-Dimensional Synthetic Datasets: Used for scalability testing, with dimensions ranging from 3D to 32D and up to 65 billion points.
  • Real-World Datasets: MNIST70K, MNIST2M, and CIFAR-10 are used for comparing KNN-DBSCAN with PDBSCAN.
  • High-Dimensional Datasets with Dimensionality Reduction: Datasets like KC House, Credit Card, Online Shoppers, and Human Activity, originally in higher dimensions, were reduced to lower dimensions (5D or 6D) for some comparisons.

Key Insights and Ideas

  • kNN Graph as a Scalable Alternative: The fundamental insight is that a kNN graph, which is less sensitive to the epsilon parameter and more amenable to efficient construction in high dimensions (especially with approximate methods like GOFMM), can serve as a robust basis for density-based clustering.
  • Equivalence of MST and Clustering: The paper reinforces the known connection between Minimum Spanning Trees (MSTs) and clustering. By constructing an MST on the relevant neighborhood graph (e-NNG for DBSCAN, kNNG for KNN-DBSCAN), connected components directly correspond to clusters.
  • Inexact MST for Parallelism: The development of an "inexact MST" is crucial for parallelization. By partitioning the graph and constructing local MSTs and then a "cut MST," the algorithm avoids the communication overhead of exact MST construction in distributed settings.
  • Parameter Sensitivity: While KNN-DBSCAN uses similar parameters to DBSCAN, the paper suggests that its approach can accelerate parameter tuning because changing epsilon doesn't necessitate recomputing the entire kNN graph.

Key Results

  • Scalability: KNN-DBSCAN demonstrates remarkable scalability. It can cluster one billion 3D points in under a second on 28K cores and 65 billion 20D points in under 40 seconds using 114,688 cores.
  • Speedup: The parallel implementation achieves significant speedups, up to 37x faster than state-of-the-art parallel DBSCAN on a 20D dataset. Strong scaling experiments show speedups of 13.8x to 22.2x with 256 MPI processes.
  • Clustering Quality: KNN-DBSCAN produces clustering results that are either identical or very similar to DBSCAN on small-scale datasets, often outperforming it in terms of silhouette scores. On real-world datasets, the Normalized Mutual Information (NMI) scores are comparable to or better than PDBSCAN.
  • High-Dimensional Performance: The algorithm shows good performance on datasets up to 32 dimensions, with speedups increasing with dimensionality in strong scaling tests.

Limitations and Future Work

  • kNNG Construction Cost: The paper acknowledges that constructing the kNNG (even with approximate methods like GOFMM) is still the dominant cost. However, this is a preprocessing step, and multiple KNN-DBSCAN runs for hyperparameter tuning can amortize this cost.
  • Theoretical Equivalence: KNN-DBSCAN is not formally equivalent to DBSCAN, although they produce similar results for many parameter choices. The theoretical implications of using an approximate kNNG are not fully explored.
  • Future Directions:
    • Investigating the effect of kNNG accuracy on clustering results.
  • Extending the approach to algorithms like OPTICS, which handle varying densities.
  • Exploring GPU acceleration for further performance gains.
  • Developing methods to automatically determine optimal hyperparameters.

Summary updated

BibTeX
@article{chen2020knn,
  author = {Youguang Chen and William Ruys and George Biros},
  title = {{KNN-DBSCAN: a DBSCAN in high dimensions}},
  journal = {ACM Trans. Parallel Comput.},
  year = {2020},
  url = {https://openreview.net/forum?id=IZZqV4DFIE},
}
Figure