Metric Learning on Manifolds

Max Aalto, Nakul VermaarXiv 2019

Abstract: Recent literature has shown that symbolic data, such as text and graphs, is often better represented by points on a curved manifold, rather than in Euclidean space. However, geometrical operations on manifolds are generally more complicated than in Euclidean space, and thus many techniques for processing and analysis taken for granted in Euclidean space are difficult on manifolds. A priori, it is not obvious how we may generalize such methods to manifolds. We consider specifically the problem of distance metric learning, and present a framework that solves it on a large class of manifolds, such that similar data are located in closer proximity with respect to the manifold distance function. In particular, we extend the existing metric learning algorithms, and derive the corresponding sample complexity rates for the case of manifolds. Additionally, we demonstrate an improvement of performance in $k$-means clustering and $k$-nearest neighbor classification on real-world complex networks using our methods.

Introduction

In machine learning, we traditionally default to representing data as vectors in Euclidean space, calculating distances via straight lines and clustering data around "means." However, recent research indicates that symbolic data—such as text hierarchies or social networks—often fits much better on curved surfaces (manifolds). Max Aalto and Nakul Verma present a framework for Metric Learning on Manifolds, allowing researchers to "stretch" and "pull" these curved spaces to significantly improve model accuracy.

The Problem: Euclidean Limitations

Most machine learning algorithms rely on a distance metric. In Euclidean space, Mahalanobis distance learning is used to rotate and scale axes so that similar points are closer together. Yet, many real-world datasets have intrinsic structures that Euclidean geometry cannot capture:

  • Hierarchical data (like word taxonomies) expands exponentially, making it a natural fit for hyperbolic space.
  • Topological data (like image patches) might resemble complex structures like a Klein bottle.

While specific algorithms exist for hyperbolic space, there has lacked a general way to apply metric learning to arbitrary curved surfaces. This framework provides a path forward for optimizing any non-Euclidean representation that can be parameterized.

Methodology: Generalized Surfaces

The authors focus on a class of manifolds called Generalized Surfaces (GS). These are manifolds that are "globally diffeomorphic" to an open subset of Euclidean space—essentially, any surface that can be described by a single coordinate chart, such as a Monge patch or a hyperboloid.

Conceptual diagram of a generalized surface $S$ mapped from a base space $B \subset \mathbb{R}^d$.

The Base Space Transformation

Instead of applying a linear transformation directly to the curved manifold—which could warp its global topology—the authors apply a linear transformation $L$ to the base space $B$. By "pulling" the underlying frame of the manifold, the mapping function $F$ translates this transformation back into the original manifold shape. This effectively moves data points along the surface without breaking the surface itself, preserving the manifold's intrinsic geometry.

Algorithmic Innovations

Geodesic Approximation

Calculating the shortest path (geodesic) on a manifold is computationally expensive and often lacks a closed-form solution. The authors introduce a Manifold Distance Approximation algorithm that uses piecewise linear paths and the Euler-Lagrange equation to find the "shortest" path along the curve efficiently.

Visualization of a geodesic path (blue) on a curved manifold and its corresponding projection in the base space.

Manifold-Aware $k$-means

Standard $k$-means requires calculating a centroid, which does not exist in a non-vector space. The authors reformulate the $k$-means objective to rely solely on pairwise distances, allowing clustering to happen directly on the manifold surface.

Key Results and Insights

The framework was evaluated on several real-world complex networks, including football (college games), polbooks (US politics), and 20newsgroup (text documents).

  • Classification Accuracy: On the football dataset, $k$-nearest neighbor error dropped from 0.41 (Euclidean) to 0.25 (Hyperbolic + Metric Learning).
  • Clustering Performance: On the 20newsgroup dataset, metric learning on a hyperboloid improved clustering quality (Normalized Mutual Information) by approximately 3% over raw hyperbolic embeddings.
  • Theoretical Rigor: The authors proved that the "sample complexity" (the amount of data needed to learn a good metric) is $O(1/\sqrt{m})$. Crucially, this rate is dimension-independent, meaning the complexity does not explode as the manifold's dimensions increase.

Conclusion

While the current framework is restricted to manifolds that can be described by a single coordinate chart (excluding closed manifolds like spheres), it represents a significant step toward general non-Euclidean machine learning. Future work may explore extending these manifold-aware metrics to deep learning embeddings and more complex topological structures.

Reference: Aalto, M., & Verma, N. (2019). Metric Learning on Manifolds. arXiv:1902.01738v1 [cs.LG].

Summary updated

BibTeX
@misc{aalto2019metric,
  author = {Max Aalto and Nakul Verma},
  title = {{Metric Learning on Manifolds}},
  year = {2019},
  eprint = {1902.01738},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1902.01738},
}
Figure