A Scalable Kernel-Based Algorithm for Semi-Supervised Metric Learning

Dit-Yan Yeung, Hong Chang, Guang Dai

Abstract

This paper presents a novel, scalable algorithm for non-linear metric learning using semi-supervised pairwise similarity constraints. Traditional metric learning methods often suffer from a trade-off between the ability to capture non-linear structures and computational efficiency. By employing a low-rank kernel approximation via landmark points and a closed-form eigenvalue weighting scheme, the proposed method achieves high discriminative power on complex datasets while maintaining efficiency for large-scale applications. Experiments on synthetic XOR data and real-world benchmarks (Isolet, MNIST) demonstrate significant improvements in class separability over linear baselines like Relevant Component Analysis (RCA).

Introduction

Metric learning is fundamental to many machine learning tasks, including clustering, nearest-neighbor classification, and information retrieval. The goal is to learn a distance function that brings "similar" items closer together while pushing "dissimilar" items further apart. However, existing research faces two primary hurdles: linearity and scalability.

Most popular methods, such as RCA or Mahalanobis metric learning, are linear and struggle with complex, non-linear data distributions like the XOR problem. Conversely, while kernel methods can handle non-linearity, they typically involve $O(n^3)$ computational complexity, making them impractical for large datasets. This paper introduces a "middle ground"—a method that is non-linear enough to capture complex patterns but efficient enough to scale to thousands of points.

Methodology

The proposed Kernel-Based Metric Learning approach utilizes several key techniques to ensure both performance and efficiency:

  • Eigenvalue Weighting: Instead of learning a full kernel matrix, the algorithm decomposes an existing kernel (e.g., Gaussian RBF) into its eigenvalues and eigenvectors. It then learns a set of weights ($\beta$) to rescale these eigenvalues, minimizing the average squared distance between pairs of points known to be similar. This formulation allows for a simple, efficient closed-form solution.
  • Low-Rank Approximation: To address scalability, the authors use a "landmark" approach similar to the Nyström method. By representing the full kernel matrix using a subset of $m$ points, complexity is significantly reduced. The authors ensure that points involved in similarity constraints are included in the landmark set to preserve critical structural information.
  • Out-of-Sample Generalization: Inspired by Locally Linear Embedding (LLE), the method maps new, unseen data points into the learned metric space without requiring a full re-run of the learning process.

Experimental Evaluation

Non-linearity and the XOR Problem

The algorithm's ability to handle non-linear distributions was tested using a synthetic XOR dataset. Linear methods like RCA fail to separate the classes in this scenario. In contrast, the proposed kernel-based approach successfully warps the feature space to cluster similar points.

Visualization of the metric learning process on XOR data, showing the initial constraints (a), landmark selection (b), and the final non-linear embedding (f).

Quantitative Results and Scalability

The performance was evaluated using a separability measure ($J$), defined as the ratio of the mean distance between different classes to the mean distance within the same class. A higher $J$ indicates a more effective metric.

On a large XOR dataset (8,000 points), the proposed method achieved a $J$ value of 4.74, vastly outperforming the linear RCA method (1.25) and a standard RBF kernel (1.42). The experiments also demonstrated that as the number of landmarks ($m$) increases, performance improves and eventually plateaus, confirming that low-rank approximations can effectively capture the utility of the full kernel matrix.

Separability measure (J) for XOR data across different landmark counts (m), compared to RBF and RCA baselines.

Real-World Benchmarks

The method was further validated on the Isolet (spoken letter) and MNIST (handwritten digit) datasets. On Isolet, the method achieved a $J$ of 2.79, more than doubling the performance of the raw input data (1.38) and significantly outperforming RCA (1.30).

Conclusion

By combining kernel methods with low-rank approximations and a closed-form optimization, this work provides a scalable solution for non-linear metric learning. The results indicate that "weak" supervision in the form of pairwise similarity constraints is sufficient to significantly improve data separability. Future work may involve incorporating dissimilarity constraints and exploring non-uniform landmark selection to further optimize the approximation efficiency.

Summary updated

BibTeX
@inproceedings{yeung2007scalable,
  author = {Dit-Yan Yeung and Hong Chang and Guang Dai},
  title = {{A Scalable Kernel-Based Algorithm for Semi-Supervised Metric Learning}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2007},
}
Figure