On Convergence of Epanechnikov Mean Shift

Kejun Huang, Xiao Fu, Nicholas D. Sidiropoulos

TL;DR

This paper provides the first rigorous convergence proof for the popular Epanechnikov Mean Shift (EMS) clustering algorithm. The authors identify why the original algorithm can get stuck at "non-critical" points due to its non-smooth kernel, propose a "Redux" version with guaranteed finite-time convergence, and introduce a "deflation" variant that is significantly faster than K-means for high-dimensional data.

What Problem Does This Paper Address?

Mean Shift is a classic "mode-seeking" algorithm used for clustering. The idea is simple: treat your data points as samples from an underlying probability density, and move each point toward the nearest local maximum (mode) of that density. The points that converge to the same mode belong to the same cluster.

The Epanechnikov kernel is theoretically the "optimal" kernel for density estimation, but it is non-smooth (it has a sharp cutoff at its boundary). Because of this non-smoothness, standard convergence proofs for Mean Shift—which usually rely on smooth functions like the Gaussian kernel—don't apply. Researchers have long observed that EMS works well, but they couldn't prove it would always reach a local maximum. Furthermore, standard Mean Shift is computationally expensive because it typically runs the iteration starting from every single data point.

Methods

The authors tackle these issues through functional analysis and algorithmic innovation:

  1. Functional Analysis: They analyze the loss function $f(z)$ associated with the Epanechnikov kernel. They prove that while the function is smooth almost everywhere, it has non-smooth points where the distance to a data point exactly equals the kernel bandwidth $w$.
  2. Algorithm 2 (Redux): They show that the original EMS can terminate at a point that isn't a local maximum. To fix this, they propose a "Redux" version: if the algorithm stops at a non-smooth point, it performs a simple check (sampling a point on the boundary) to see if it can continue descending.
  3. Convergence Proof: Using a Majorization-Minimization (MM) framework, they prove that the Redux algorithm is guaranteed to terminate at a local optimum in a finite number of iterations. Interestingly, the non-smoothness that made the proof difficult actually enables this finite-time convergence, whereas smooth kernels only converge asymptotically.
  4. Algorithm 3 (Deflation): To solve the speed problem, they introduce a "deflation" heuristic. Instead of starting from every point, they find one mode, group all points within a specific radius, remove ("deflate") them from the dataset, and repeat.

Datasets

The authors evaluated their approach using synthetic datasets designed to challenge standard clustering algorithms:

  • High-Dimensional GMM: Synthetic data with $d=100$ dimensions and $K=30$ Gaussian clusters.
  • Unbalanced Clusters: The number of points in each cluster was varied ($M_k = 50k$) to test robustness against unbalanced data.
  • Comparison: They benchmarked against Lloyd’s K-means, Expectation-Maximization (EM) for Gaussian Mixture Models, and a two-round EM variant.

Key Insights and Ideas

  • Non-Smoothness is a Double-Edged Sword: While non-smoothness creates "stuck" points for the original algorithm, it is exactly what allows the modified version to reach a local optimum in a finite number of steps. In optimization, we often prefer smoothness, but here, the "sharpness" of the Epanechnikov kernel is a theoretical advantage.
  • High-Dimensional Geometry: The authors leverage a property of the $\chi^2$ distribution: in high dimensions, the mass of a spherical Gaussian is concentrated in a thin shell. This justifies their "deflation" radius ($\sqrt{2d}\sigma$), allowing them to capture almost an entire cluster at once.
  • Parameter Efficiency: Unlike K-means or EM, Mean Shift does not require the number of clusters $K$ as an input. It only requires the kernel bandwidth $w$, which can be tuned via cross-validation.

Key Results

The experimental results, shown in Figure 1, highlight a significant performance gap:

Figure 1: 100 Monte-Carlo simulations on synthetic data. Left: clustering error; right: run time.
  • Accuracy: Both the original and modified Mean Shift achieved zero clustering error across all trials. In contrast, K-means and standard EM showed significant errors (often between 10% and 30%) because they struggled with the marginally separated, unbalanced clusters.
  • Speed: The "Mean Shift Deflation" variant was the clear winner in computational efficiency. As seen in the right panel of Figure 1, it was consistently faster than even the built-in MATLAB K-means implementation, and orders of magnitude faster than the original Mean Shift or sophisticated EM variants.

Limitations and Future Work

  • Spherical Assumption: The deflation heuristic assumes clusters are roughly spherical and have similar variances. The authors acknowledge this is a specific generative model; how well this scales to highly elliptical or overlapping clusters of varying densities remains an open question.
  • Bandwidth Selection: While the algorithm is fast, selecting the optimal bandwidth $w$ via leave-one-out cross-validation can still be a bottleneck for extremely large datasets.
  • Theoretical Bounds: Although they prove finite convergence, the theoretical upper bound on the number of iterations is based on the number of possible subsets of data points ($2^M$), which is astronomically large. In practice, the algorithm usually converges in fewer than 10 steps, but a tighter theoretical bound would be valuable.

Summary updated

BibTeX
@inproceedings{huang2018convergence,
  author = {Kejun Huang and Xiao Fu and Nicholas D. Sidiropoulos},
  title = {{On Convergence of Epanechnikov Mean Shift}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.1609/aaai.v32i1.11657},
}
Figure