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

Density-based Clustering with Kernel Diffusion

Chao Zheng, Yingjie Chen, Chong Chen, Jianqiang Huang, Xian-Sheng Hua

TL;DR

Classic density-based clustering algorithms like DBSCAN and Density Peaks Clustering (DPC) struggle when clusters have wildly different sizes, densities, and spreads. This paper introduces Kernel Diffusion Density (KD)—and an asymptotically equivalent, linear-time fast surrogate (FKD)—which derives local density from the stationary distribution of a kernel-based random walk. Even as a fully unsupervised method, it substantially improves DBSCAN and DPC on standard benchmarks and outperforms supervised, graph-convolutional methods on large-scale face clustering benchmarks.

What Problem Does This Paper Address?

Density-based clustering methods detect clusters of arbitrary shapes by finding high-density regions and connecting neighboring points. To do this, algorithms like DBSCAN and DPC need a density function $\rho(x)$, almost always estimated naively by counting points in an $\epsilon$-ball ($\rho_{\text{naive}}$).

However, real-world data rarely features uniform cluster densities or spreads. A rigid, global ball-radius $\epsilon$ tends to "wash out" subtle local structures: it merges small or low-density clusters into surrounding valleys and under-detects cluster peaks. Existing heuristics (like local contrast transformations or kernel density estimation) still inherit the flaws of the underlying naive counting or suffer from boundary bias and quadratic scaling.

Methods

The authors reframe density estimation through a Markovian diffusion process on data:

  1. Locally Adaptive Bivariate Kernels: Instead of simple Euclidean distance kernels, they define kernels that truncate adaptively based on local geometry:
  2. Symmetric-Gaussian Kernel: Combines a Gaussian kernel with an $\epsilon$-neighborhood indicator.
  3. Asymmetric-Gaussian Kernel: Weights distances using an indicator over the $k$-nearest neighbors $N_k(x)$ of $x$, accommodating varying local densities.
  4. Kernel Diffusion Density ($\rho_{\text{KD}}$): The kernel induces a row-normalized random walk transition matrix $P = [p(x, y)]$. As the diffusion process $X_t$ evolves over continuous time ($t \to \infty$), it magnifies dense, well-connected geometric structures. The stationary distribution $\pi$ of this ergodic Markov chain serves as the kernel diffusion density function $\rho_{\text{KD}}$.
  5. Fast Kernel Diffusion Surrogate ($\rho_{\text{FKD}}$): Computing the exact stationary distribution via power iteration or QR decomposition scales poorly to large datasets. The authors propose $\rho_{\text{FKD}}(x) = \int_D p(y, x) dF_n(y)$, which simply computes the column averages of $P$.
  6. Theoretical Guarantees: The authors prove that $\rho_{\text{FKD}}$ normalizes cluster density averages regardless of cluster sizes (Theorem 1) and that $\rho_{\text{FKD}}$ converges almost surely to $\rho_{\text{KD}}$ at an $O(n^{-1})$ rate (Theorem 2), running in linear time and space.

Datasets

  • Synthetic Data: Gaussian mixture models exhibiting unbalanced weights and variances.
  • 13 UCI Benchmarks: Standard classification datasets ranging from ~100 to ~5,500 samples (e.g., Banknote, Breast-Cancer, Glass, Iris, Libras, Seeds, Wine).
  • Large-Scale Face Clustering:
  • emore_200k: 200,000 face images across 2,577 identities.
  • MS1M: ~584,000 face images across 8,573 identities.

Key Insights and Ideas

  • Diffusion as an Auto-Equalizer: In naive density estimation, small clusters are dwarfed by large, dense ones. In the diffusion operator, random walks get "trapped" in tightly clustered subgraphs. The fast surrogate naturally elevates densities of smaller clusters by averaging incoming transition probabilities rather than raw counts.
  • Asymmetric Neighbors Win: The asymmetric Gaussian kernel ($k$-NN based) routinely outperforms the symmetric $\epsilon$-ball kernel because the neighborhood radius dynamically contracts in dense clusters and expands in sparse ones.
  • Unsupervised Beats Supervised GCNs: Rather than training complex Graph Convolutional Networks (GCNs) with link labels on face subgraphs, a principled diffusion density applied to DPC matches or exceeds state-of-the-art supervised face-clustering pipelines.

Key Results

  • UCI Benchmarks: Across 13 benchmark datasets evaluated on DPC and DBSCAN, $\rho_{\text{asym}}^{\text{KD}}$ and $\rho_{\text{asym}}^{\text{FKD}}$ substantially outperformed naive densities. For example, on the Banknote dataset, pairwise F-score leaped from 54.3% ($\rho_{\text{naive}}$) to 93.6% ($\rho_{\text{asym}}^{\text{FKD}}$) under DPC.
  • Face Clustering (MS1M):
  • Proposed $\rho_{\text{asym}}^{\text{KD}}$ achieved 88.15% Pairwise F-score ($F_P$) and 87.14% BCubed F-score ($F_B$), outperforming strong supervised GCN methods such as GCN(V+E) ($F_P = 87.55\%, F_B = 85.94\%$) and LTC ($F_P = 85.66\%, F_B = 85.52\%$).
  • $\rho_{\text{asym}}^{\text{FKD}}$ delivered near-identical accuracy ($F_P = 87.26\%, F_B = 87.41\%$) at a fraction of the compute.
  • Efficiency: While $\rho_{\text{KD}}$ memory and execution time explode as $N$ climbs toward 584k samples, $\rho_{\text{FKD}}$ maintained flat, low runtime and memory usage throughout.

Limitations and Future Work

  • Hyperparameter Dependency: While more robust than naive density estimators, the approach still relies on choosing neighborhood parameters ($k$ or $\epsilon$) and bandwidth $h$.
  • Downstream Heuristics: The method provides a superior density function, but still relies on standard clustering heuristics from DBSCAN or DPC (e.g., peak/cutoff selection on DPC decision maps).
  • Nearest Neighbor Graph Construction: Computing $k$-nearest neighbors or $\epsilon$-neighborhoods on massive datasets remains a potential computational bottleneck before the linear-time $\rho_{\text{FKD}}$ step can be executed.

Summary updated

BibTeX
@inproceedings{zheng2022density,
  author = {Chao Zheng and Yingjie Chen and Chong Chen and Jianqiang Huang and Xian-Sheng Hua},
  title = {{Density-based Clustering with Kernel Diffusion}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=-geBFMKGlkq},
}
Figure