The Laplacian K-modes algorithm for clustering

Weiran Wang, Miguel Á. Carreira-PerpiñánarXiv 2014

Abstract

In addition to finding meaningful clusters, centroid-based clustering algorithms such as K-means or mean-shift should ideally find centroids that are valid patterns in the input space, representative of data in their cluster. This is challenging with data having a nonconvex or manifold structure, as with images or text. We introduce a new algorithm, Laplacian K-modes, which naturally combines three powerful ideas in clustering: the explicit use of assignment variables (as in K-means); the estimation of cluster centroids which are modes of each cluster's density estimate (as in mean-shift); and the regularizing effect of the graph Laplacian, which encourages similar assignments for nearby points (as in spectral clustering). The optimization algorithm alternates an assignment step, which is a convex quadratic program, and a mean-shift step, which separates for each cluster centroid. The algorithm finds meaningful density estimates for each cluster, even with challenging problems where the clusters have manifold structure, are highly nonconvex or in high dimension. It also provides centroids that are valid patterns, truly representative of their cluster (unlike K-means), and an out-of-sample mapping that predicts soft assignments for a new point.

Introduction

Clustering high-dimensional data presents a fundamental trade-off between interpretability and flexibility. Traditional centroid-based methods like $K$-means are computationally efficient but often fail on complex data. Their centroids are simple averages, which in high-dimensional spaces (like image datasets) often result in blurry, non-physical "smudges" rather than valid patterns. Furthermore, $K$-means is geometrically constrained to finding convex, "round" clusters.

Alternative approaches like mean-shift identify "modes" (local density peaks) that serve as valid representative patterns. However, mean-shift does not allow for a fixed number of clusters ($K$) and scales poorly to high dimensions. Spectral clustering excels at capturing complex manifold structures but fails to provide representative centroids and requires computationally expensive post-processing for cluster assignments.

The Laplacian $K$-modes algorithm, proposed by Wang and Carreira-Perpiñán, addresses these limitations by unifying the strengths of these disparate approaches into a single framework.

Methodology: Combining Modes and Manifolds

The Laplacian $K$-modes algorithm optimizes an objective function consisting of two primary terms: a $K$-modes term for centroid validity and a Laplacian smoothing term for manifold awareness.

The K-modes Term

Unlike $K$-means, which minimizes the sum of squared distances to a mean, Laplacian $K$-modes maximizes the kernel density at each cluster's centroid. This ensures that each centroid is a "mode"—a point of high local density that represents a prototypical member of the dataset. As shown in the comparison below, this results in sharp, recognizable centroids for image data, whereas $K$-means produces blurry averages.

Comparison of centroids: K-means produces blurry averages, while K-modes and GMS produce sharp, valid patterns representative of the data.

Laplacian Smoothing

To handle non-convex shapes, the algorithm incorporates a graph Laplacian regularizer. This term penalizes nearby points in the data graph for having different cluster assignments, effectively forcing the clustering boundaries to follow the natural manifold structure of the data.

Optimization Strategy

The algorithm alternates between two steps:

  1. C-step (Centroids): Updates the cluster modes using a mean-shift procedure. This step is efficient as it decouples for each cluster.
  2. Z-step (Assignments): Updates soft assignments by solving a large-scale convex Quadratic Program (QP). The authors employ an accelerated gradient projection algorithm to ensure assignments remain on the probability simplex.

To avoid local optima, a homotopy strategy is used: the algorithm begins with a large kernel bandwidth ($σ$) and no Laplacian penalty, gradually tuning these parameters toward the target values.

Experimental Results

The authors evaluated the algorithm across various synthetic and real-world datasets, including MNIST digits, COIL-20 images, and the TDT2 text corpus.

Manifold Recovery

On synthetic "5-spirals" data, standard $K$-modes fails to capture the interlocking structure because it lacks manifold awareness. Laplacian $K$-modes, however, successfully recovers the complex shapes by leveraging the graph Laplacian regularizer.

Clustering results on a spiral dataset: Standard K-modes (left) fails to capture the manifold, while Laplacian K-modes (center) correctly identifies the interlocking structures.

Performance and Robustness

  • Accuracy: On the COIL-20 dataset, Laplacian $K$-modes achieved an accuracy of 81.0%, outperforming both $K$-means (66.5%) and standard Spectral Clustering (79.0%).
  • Stability: The algorithm demonstrated significant robustness to noise and was less sensitive to hyperparameter choices compared to methods like Normalized Cut.
  • Out-of-Sample Mapping: A key advantage is the ability to assign new, unseen data points to existing clusters without re-running the entire optimization, a common limitation of spectral methods.

Conclusion

Laplacian $K$-modes represents a significant advancement in clustering methodology. By combining the explicit assignments of $K$-means, the valid representative centroids of mean-shift, and the manifold flexibility of spectral methods, it provides a robust tool for high-dimensional data analysis. While it requires careful graph construction and hyperparameter tuning, its ability to produce sharp, prototypical centroids makes it particularly valuable for applications where cluster interpretability is paramount.

Summary updated

BibTeX
@misc{wang2014laplacian,
  author = {Weiran Wang and Miguel Á. Carreira-Perpiñán},
  title = {{The Laplacian K-modes algorithm for clustering}},
  year = {2014},
  eprint = {1406.3895},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1406.3895},
}
Figure