Abstract
This paper introduces MLCA (Metric Learning for Cluster Analysis), a novel method for supervised clustering that replaces slow, iterative optimization with a simple, closed-form solution. By leveraging a clever relaxation of the $k$-means objective and revealing a deep connection to multivariate linear regression, the authors achieve state-of-the-art clustering performance while being orders of magnitude faster—reducing training times from days to seconds.
Introduction: The Challenge of Supervised Clustering
Clustering is only as good as the distance metric it uses. While standard Euclidean distance works for simple blobs, complex data (like images or textures) requires a learned metric that identifies which features are relevant for grouping.
Supervised clustering attempts to learn this metric from "ground truth" examples of clustered data. However, previous state-of-the-art approaches, often based on structured SVMs, are computationally expensive. They rely on iterative subgradient methods that converge slowly, making them impractical for medium-to-large datasets. The authors set out to find a way to learn a Mahalanobis distance metric that is both mathematically rigorous and computationally efficient.
Methods: From $k$-means to Closed-Form Regression
The authors formulate the problem as a large-margin structured prediction task. Their goal is to find a Mahalanobis distance matrix $M$ such that the ground-truth clustering is the optimal solution to a $k$-means objective.
Key technical steps include:
- Relaxation: The discrete $k$-means assignment problem is NP-hard. The authors relax the search space from discrete cluster assignments to the set of rank-$k$ orthogonal projection matrices.
- Worst-Case Empirical Risk: Instead of a standard convex surrogate loss, they directly optimize a (non-convex) worst-case empirical risk.
- The Closed-Form Solution: They prove that for a given training set, the optimal metric $M$ can be calculated directly using the Moore-Penrose pseudoinverse of the data matrix $X$ and the ground-truth partition matrix $C$: $M \propto X^\dagger C (X^\dagger)^T$.
- Regression Connection: They show that this solution is equivalent to performing multivariate linear regression where the "labels" are the cluster indicators. Essentially, the learned metric is the outer product of the regression weights ($M = WW^T$).
Key Results and Efficiency
The performance gains are dramatic, particularly regarding efficiency. By finding a closed-form solution, the authors bypass the need for gradient descent, making the complexity linear relative to the training data size in most cases.
On synthetic benchmarks, MLCA trained in 0.005 seconds, whereas previous state-of-the-art methods like Lajugie et al. took over 4,000 seconds. On the Weizmann Horses dataset for image segmentation, MLCA took 13 seconds to train, compared to 5 days for iterative competitors. Despite the speed, MLCA achieved lower (better) $\Delta$-loss and Rand-loss across almost all benchmarks, including Oxford Flowers-17 and SynthDB for dynamic textures.
Insights and Limitations
The discovery that supervised clustering is essentially a specific form of multivariate regression provides a bridge between two previously distinct areas of machine learning. The learned matrix $M$ is naturally low-rank (rank $\le k$), which acts as an implicit regularizer and simplifies the dimensionality of the feature space.
However, the method requires "full supervision," meaning complete ground-truth clustering for training sets, making it less suited for semi-supervised scenarios with sparse labels. Additionally, while the closed-form solution is fast, computing the pseudoinverse for massive datasets can be memory-intensive. As a Mahalanobis metric, it learns a linear transformation; extending this closed-form logic to non-linear embeddings remains a potential area for future research.
Summary updated