Efficient Parameter-Free Clustering Using First Neighbor Relations

M. Saquib Sarfraz, Vivek Sharma, Rainer Stiefelhagen

Abstract

Clustering often requires manual tuning of hyperparameters like the number of clusters ($K$) or distance thresholds, which can be subjective and data-dependent. This paper introduces FINCH (First Neighbor Clustering Hierarchy), a parameter-free algorithm that discovers natural data groupings by analyzing only the first neighbor of each point. FINCH is computationally efficient, scaling to millions of samples, and achieves state-of-the-art performance across diverse datasets without human intervention.

Introduction

Clustering is a fundamental task in data science, yet popular algorithms often require "prior knowledge" that users may not possess. K-means requires a predefined $K$, while Spectral Clustering's $O(N^3)$ complexity limits its use on large-scale data. Other methods like DBSCAN or Agglomerative clustering require sensitive tuning of distance thresholds or linkage criteria. FINCH addresses these issues by providing a "universal" clustering solution that automatically discovers structure based on local data relationships, requiring zero hyper-parameters.

The FINCH Methodology

The core of FINCH is a simple yet powerful clustering equation. It defines an adjacency link between two points $i$ and $j$ if they are each other's first neighbors, or if they share a common first neighbor. This approach forms "chains" of points that naturally coalesce into clusters without needing a global distance metric.

Illustration of the first neighbor relation and the resulting adjacency matrix and graph.

The algorithm operates recursively: it partitions the data, calculates the means of the resulting clusters, and repeats the process on these means until a single cluster remains. This creates a hierarchy of partitions, allowing users to select the desired granularity or use a refinement step to reach a specific $K$ if necessary. By avoiding the calculation of a full $N \times N$ distance matrix and utilizing approximate nearest neighbor (ANN) search, the complexity stays at a manageable $O(N \log N)$.

Experimental Evaluation

FINCH was tested on a wide array of datasets, including biological data (MICE Protein), text (REUTERS), and large-scale computer vision benchmarks (MNIST, STL-10). Notably, it processed 8.1 million MNIST samples in just 18 minutes on a standard workstation, a feat that causes most traditional algorithms to fail due to memory or time constraints.

Comparison of FINCH against standard clustering algorithms on synthetic 2D datasets.

As shown in the visual comparisons above, FINCH excels at identifying complex, non-spherical clusters that challenge methods like K-means, achieving significantly higher accuracy (e.g., 98% vs. 88% on the top dataset). On the MNIST-70k dataset, FINCH achieved a 98.84% Normalized Mutual Information (NMI), outperforming K-means and Spectral Clustering even without prior knowledge of the number of digits.

Insights and Future Directions

A key takeaway is that the "first neighbor" is a sufficient statistic for uncovering meaningful data structures. FINCH is particularly useful for "Deep Clustering," where it can provide pseudo-labels to train neural networks, which in turn improves feature quality and clustering accuracy. For instance, using FINCH with a ResNet-50 on the STL-10 dataset improved accuracy to ~95%, a 10% jump over previous state-of-the-art methods.

While highly effective, the algorithm currently cannot discover single-point clusters by design, and its performance remains dependent on the quality of the input features. Future work may explore theoretical performance bounds and further integration with deep learning for unsupervised feature extraction.

Summary updated

BibTeX
@inproceedings{sarfraz2019efficient,
  author = {M. Saquib Sarfraz and Vivek Sharma and Rainer Stiefelhagen},
  title = {{Efficient Parameter-Free Clustering Using First Neighbor Relations}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00914},
}
Figure