Mini-batch spectral clustering

Yufei Han, Maurizio Filippone

TL;DR

This paper introduces Mini-Batch Spectral Clustering (MBSC), a method that scales spectral clustering to massive datasets by framing it as a stochastic optimization problem on the Stiefel manifold. Unlike popular approximation methods that sacrifice accuracy for speed, MBSC achieves $O(n)$ complexity per iteration while guaranteed to converge to the exact solution in the limit.

What Problem Does This Paper Address?

Spectral clustering is a "gold standard" for identifying complex, non-linear structures in data, but it has a massive scalability problem. To find the clusters, you typically have to compute the eigenvectors of a Laplacian matrix ($L$).

For a dataset with $n$ samples:

  1. Storage: You need $O(n^2)$ space to store the matrix.
  2. Computation: Finding the spectrum (eigenvectors) takes $O(n^3)$ time.

When $n$ is in the hundreds of thousands, these requirements become physically impossible for standard hardware. While approximations like the Nyström method exist, they often "smear" the data's structure, leading to lower clustering quality. The authors set out to find a way to keep the accuracy of exact spectral clustering while bringing the computational cost down to a linear $O(n)$ scale.

Methods

The authors rethink spectral clustering not as a static matrix decomposition problem, but as a constrained optimization problem.

  1. The Stiefel Manifold: They cast the search for the top $k$ eigenvectors as minimizing a trace function subject to an orthonormality constraint ($W^T W = I$). This constraint means the solution $W$ lives on a "Stiefel manifold"—a specific geometric space for orthonormal matrices.
  2. Stochastic Riemannian Gradient Descent: Instead of calculating the gradient using the entire Laplacian matrix (which is $O(n^2)$), they use stochastic linear algebra. They estimate the gradient using "mini-batches" of the Laplacian's columns.
  3. The "On-the-Fly" Trick: Crucially, they show that you don't even need to store the Laplacian. You can compute the necessary columns of $L$ from the raw data only when needed for a specific mini-batch update.
  4. Retraction: To ensure the matrix $W$ stays "on the manifold" (remains orthonormal) after a gradient step, they use a QR decomposition as a "retraction" mapping.
  5. Adaptive Learning: They adapt the Adagrad optimizer to work on manifolds, simplifying the tuning of learning rates.

Datasets

The authors evaluated MBSC on several well-known benchmarks from the LibSVM repository:

  • Pendigits: 10,992 samples (16 features, 10 classes)
  • Shuttle: 58,000 samples (9 features, 7 classes)
  • MNIST: 60,000 samples (780 features, 10 classes)
  • Covtype-I: 100,000 samples (54 features, 5 classes)
  • Covtype-II: 581,012 samples (54 features, 7 classes)

Key Insights and Ideas

  • Exactness in the Limit: Unlike Nyström approximations, which are inherently biased by the choice of "inducing points," MBSC is an iterative solver for the exact problem. Given enough iterations, it recovers the true eigenvectors.
  • The Variance Asymmetry: The authors provide a mathematical proof showing that to reduce noise in the early stages of optimization, it is better to average gradients over many small subsets (increasing repetitions $N_r$) rather than simply using one large mini-batch.
  • Memory Efficiency: By calculating columns of the Laplacian on-the-fly (the MBSC-E variant), the algorithm can process over half a million samples using less than 4GB of RAM—a feat impossible for traditional spectral clustering.

Key Results

  • Efficiency vs. Accuracy: On the MNIST and Shuttle datasets, MBSC reached the same accuracy as the "Exact" solution using orders of magnitude fewer floating-point operations (FLOPs) than the standard Power Method.
  • Outperforming Nyström: In many cases, MBSC achieved higher Normalized Mutual Information (NMI) scores than the Nyström method at a comparable computational budget.
  • Scalability: On the largest dataset (Covtype-II, ~581k samples), MBSC-E produced stable clustering results in about 3.5 hours. For context, the traditional Power Method was labeled "too expensive" to even run on this data.

Limitations and Future Work

  • Implementation Sensitivity: While the theoretical complexity is $O(n)$, the actual wall-clock time is highly dependent on how efficiently the system handles on-the-fly kernel computations.
  • Hybrid Approaches: The authors suggest that MBSC could be combined with Nyström-style approximations to further reduce the variance of the stochastic gradients.
  • Distributed Computing: The paper notes that the mini-batch nature of the algorithm makes it a prime candidate for implementation in distributed frameworks like Spark or TensorFlow, which could scale the method to billions of points.

Summary updated

BibTeX
@inproceedings{han2017mini,
  author = {Yufei Han and Maurizio Filippone},
  title = {{Mini-batch spectral clustering}},
  booktitle = {IJCNN},
  year = {2017},
  url = {https://openreview.net/forum?id=39XB9R3dJV},
}

Loading related content...

Figure