Online Progressive Deep Metric Learning

Wenbin Li, Jing Huo, Yinghuan Shi, Yang Gao, Lei Wang, Jiebo Luo

Abstract

Metric learning, especially deep metric learning, has been widely developed for large-scale image input data. However, in many real-world applications, we only have access to vectorized input data. Moreover, well-labeled data is often limited due to high annotation costs, and real-world data is commonly streaming, requiring online processing. In these scenarios, traditional deep metric learning is unsuitable. To address this, we reconsider traditional shallow online metric learning and develop an Online Progressive Deep Metric Learning (ODML) framework, also referred to as Multi-Layer Online Metric Learning (MLOML). Specifically, we take an online metric learning algorithm as a metric-algorithm-based layer (i.e., metric layer), followed by a nonlinear layer, and then stack these layers in a fashion similar to deep learning. Unlike shallow online metric learning, which learns a single metric space, the proposed framework learns multiple hierarchical metric spaces. This progressive and nonlinear approach demonstrates stronger learning abilities than traditional shallow methods, especially with limited training data. We provide theoretical analysis and extensive experimental verification on benchmark datasets.

Introduction: The Challenge of Streaming Vectorized Data

Metric learning aims to find a distance function where similar items are close together and dissimilar items are far apart. While Deep Metric Learning (DML) has seen massive success in computer vision, it typically requires massive datasets and offline batch processing. Many real-world applications—such as credit scoring, medical diagnosis, or power grid monitoring—rely on streaming vectorized data.

Existing Online Metric Learning (OML) algorithms for such data are predominantly linear, learning a single Mahalanobis distance matrix. While fast, they often fail to capture the complex, nonlinear relationships inherent in sophisticated data distributions. The MLOML framework bridges this gap by creating a deep, hierarchical architecture that remains capable of learning from one sample at a time in an online fashion.

The MLOML Framework

The core of the proposed approach is an architecture where each "weight layer" is actually an independent online metric learning algorithm.

The Metric Layer (MOML)

The authors introduce Mahalanobis-based Online Metric Learning (MOML) as the base layer. It employs a "passive-aggressive" strategy: if a new data triplet satisfies distance constraints, the model remains unchanged; otherwise, it updates the metric matrix minimally to satisfy the constraint while preserving proximity to its previous state.

Nonlinear Stacking and Progressive Refinement

Each metric layer is followed by a nonlinear activation function (e.g., ReLU). This allows the model to warp the feature space into increasingly discriminative representations. As data passes through successive layers, the feature space is "cleaned" progressively, moving from overlapping clusters to linearly separable groups.

The MLOML architecture stacks metric layers and nonlinearities, progressively refining the feature space from overlapping clusters to linearly separable groups.

Training Strategies

  • Forward Propagation (FP): Uniquely, MLOML can be trained using only forward passes. Each layer updates itself immediately upon data arrival. This is significantly faster than standard backpropagation and avoids common issues like vanishing gradients.
  • Backward Propagation (BP): The framework also supports traditional backpropagation to fine-tune the entire stack, though empirical results show that FP alone is often highly effective.

Key Results and Empirical Validation

The authors evaluated MLOML on 12 UCI benchmark datasets, including physical, biological, and large-scale traffic data.

Layer-wise Improvement

A critical finding is the impact of depth on accuracy. Experiments showed a clear trend: as the number of metric layers increases (typically up to 3 or 5), the error rate drops significantly before converging. This confirms that the hierarchical structure extracts more nuanced information from each sample than a single linear layer.

Error rates across various datasets show a significant decrease as the number of metric layers in the MLOML framework increases.

Performance and Efficiency

  • Superior Accuracy: MLOML consistently outperformed state-of-the-art linear OML algorithms (like LEGO and OASIS) and even outperformed well-known "batch" (offline) algorithms like LMNN on most datasets.
  • Theoretical Rigor: Unlike many empirical deep learning studies, this work provides a regret bound for the MOML algorithm. This proves mathematically that the algorithm's cumulative loss grows sub-linearly, guaranteeing convergence to an optimal metric.
  • Real-time Viability: MLOML-FP achieves a time complexity of $O(nd^2)$, where $n$ is the number of layers and $d$ is the feature dimension. This makes it viable for high-speed streaming applications where traditional deep learning would be too slow to update.

Conclusion and Future Directions

MLOML offers a powerful alternative to traditional deep learning for vectorized streaming data. While highly effective, the $O(d^2)$ complexity of learning full Mahalanobis matrices can be a bottleneck for extremely high-dimensional data. Future work may explore diagonal matrix approximations or integrated online dimensionality reduction. Additionally, investigating heterogeneous stacks—using different metric learning algorithms in different layers—could further enhance the framework's flexibility.

Summary updated

BibTeX
@article{li2023online,
  author = {Wenbin Li and Jing Huo and Yinghuan Shi and Yang Gao and Lei Wang and Jiebo Luo},
  title = {{Online Progressive Deep Metric Learning}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2023},
  doi = {10.1109/tnnls.2022.3213511},
}
Figure