Distance Metric Learning with Application to Clustering with Side-Information
Eric P. XingAndrew Y. NgMichael I. JordanStuart J. Russell
Develops a convex optimization framework to learn Mahalanobis distance metrics from pairwise similarity constraints, guaranteeing global optimality and substantially improving clustering accuracy on multidimensional data.
Many machine learning and data analysis methods, including clustering and nearest-neighbor algorithms, depend on a distance metric that captures meaningful relationships in the data. When the default Euclidean metric produces clusters that do not align with a user’s intent, practitioners have had few systematic options beyond manual adjustment. The paper addresses this limitation by developing a method to learn a metric automatically from examples of similar (and, when available, dissimilar) pairs of points.
The work sets out to formulate metric learning as a convex optimization problem that finds a Mahalanobis distance respecting the supplied pairwise constraints, then to demonstrate that the resulting metric improves clustering accuracy on both synthetic and real data.
The approach begins with a convex program that minimizes distances between similar pairs while enforcing a lower bound on distances between dissimilar pairs and requiring the metric matrix to remain positive semi-definite. Efficient algorithms are derived for both diagonal and full matrices: Newton-Raphson for the diagonal case and projected gradient ascent for the full case. The method is evaluated on artificial data designed to expose limitations of Euclidean distance and on nine UCI data sets, where “little” and “much” side-information is generated by sampling pairs that share class labels. Performance is measured by clustering accuracy under four variants of K-means, with and without the learned metric and with and without instance-level constraints.
The learned metrics consistently raise clustering accuracy. On the UCI collections, K-means that uses either the diagonal or full learned metric outperforms standard K-means in nearly every data set; combining the metric with constrained K-means yields further gains, sometimes by large margins. Accuracy rises with the amount of side-information supplied, although the benefit saturates at different rates across data sets. Visualizations of the rescaled data confirm that similar points are drawn together while dissimilar points remain separated.
These results show that modest amounts of pairwise side-information can be turned into a reusable metric that generalizes to unseen points and improves downstream unsupervised tasks. The convex formulation guarantees that solutions are globally optimal and computationally tractable, removing the need for ad-hoc metric tweaking.
The principal limitations are dependence on the quality and quantity of side-information and the higher cost of the full-matrix procedure. Further gains are likely from integrating the metric-learning step with other algorithms that rely on distances, such as kernel methods or nearest-neighbor classifiers, and from testing on larger, higher-dimensional collections where the value of an automatically tuned metric may be even greater.
- Paper: A training algorithm for optimal margin classifiers, B. Boser et al. (1992). Understanding the foundational theory of maximal-margin hyperplanes and quadratic programming from support vector machines is essential before studying distance metric learning framed as convex optimization.
- Paper: Distance Metric Learning for Large Margin Nearest Neighbor Classification, Kilian Q. Weinberger et al. (2005). This paper extends distance metric learning to large-margin nearest neighbor classification by casting the objective as a semidefinite program directly inspired by foundational metric learning principles.
- Paper: Dimensionality Reduction by Learning an Invariant Mapping, Raia Hadsell et al. (2006). This work builds upon pairwise distance metric learning by introducing a siamese network architecture that learns nonlinear invariant mappings using a contrastive loss.
