Skip to contentScholarGate
LibraryBookshelfDeskReview StudioAssistant
Sign in
On this page
IntuitionHow it worksWhen to use itStrengths & limitationsCommon pitfallsApplicationsFrequently asked🔒 Read the full methodSourcesRelated methods
Cite this pageSpotted an issue on this page? Report or suggest a fix →
Home›Machine learning›Online Metric Learning
Machine learningMachine learning

Online Metric Learning

Online Metric Learning (Incremental Distance Metric Learning from Streaming Data) · Also known as: OML, incremental metric learning, streaming metric learning, online distance metric learning

Online Metric Learning adapts a Mahalanobis distance metric incrementally as new labeled examples or pairwise constraints arrive one at a time, without storing the full dataset. It merges the efficiency of online learning with the representational power of metric learning, making it suitable for streaming, large-scale, or continually changing environments where retraining from scratch is impractical.

ScholarGate
  1. Machine learning
  2. v1
  3. 2 Sources
  4. PUBLISHED
Cite this page →
Tools & resources
Download slides
Learn & explore

Read the full method

Members only

Sign in with a free account to read this section.

Sign in

Method map

The neighbourhood of related methods — select a node to explore.

Online Metric Learning
Metric LearningOnline LearningSiamese Network

When to use it

Use Online Metric Learning when data arrive as a stream or in very large batches that preclude full batch re-training, when pairwise or triplet supervision is available sequentially (e.g., user feedback, click-through pairs), or when the similarity structure may drift over time. It is well-suited for retrieval, few-shot recognition, and ranking tasks. Avoid it when the full dataset is small and fits comfortably in memory — batch metric learning methods such as LMNN or NCA will typically converge to a better metric with less hyperparameter sensitivity. Also avoid when no pairwise or class-label supervision is available.

Strengths & limitations

Strengths
  • Processes one example at a time, requiring O(d²) memory for the metric matrix rather than O(n) for the full dataset.
  • Adapts continuously to distribution shifts without full retraining, making it appropriate for non-stationary streams.
  • Strong theoretical guarantees: online mistake bounds and regret bounds have been established for major algorithms.
  • Generalises classical distance-based classifiers (k-NN) by learning a task-specific geometry.
  • Compatible with pairwise labels, triplet constraints, or class-label supervision, offering flexible supervision signals.
Limitations
  • Learning a full d×d metric matrix scales quadratically with feature dimension; high-dimensional inputs (e.g., raw images) require low-rank or diagonal approximations.
  • Convergence is sensitive to the learning rate and regularization schedule, which often need careful tuning per dataset.
  • The PSD projection step adds computational overhead at each update.
  • Less accurate than batch methods on small, stationary datasets where global optimization is feasible.

Frequently asked

How is Online Metric Learning different from batch metric learning (e.g., LMNN)?

Batch methods like LMNN optimize the metric over all training data simultaneously, achieving strong final accuracy but requiring full data access and expensive re-training when new data arrive. Online Metric Learning updates the metric after each example, trading some final-state accuracy for speed, memory efficiency, and adaptability to streaming or non-stationary data.

What supervision signal does Online Metric Learning need?

Most algorithms require pairwise constraints (similar / dissimilar labels for pairs) or triplet constraints (anchor, positive, negative). Some variants accept only class labels and derive implicit pairwise constraints on the fly. Pure unsupervised online metric learning is an active research area but less mature.

How do I handle high-dimensional input efficiently?

A full d×d PSD matrix becomes prohibitive for large d. Low-rank parameterizations (M = W^T W with W of rank k << d) or diagonal approximations (Euclidean weighting) reduce storage to O(kd) and make each update O(kd) rather than O(d²).

Can Online Metric Learning forget earlier constraints?

Yes — like all online algorithms it can exhibit catastrophic forgetting when the distribution shifts dramatically. Regularizing toward the previous metric (the Bregman divergence term in the update) slows but does not eliminate forgetting. For strong non-stationarity, reservoir sampling or memory replay of past constraints can mitigate this.

What evaluation metric should I use?

Common choices for retrieval tasks are Recall@k (fraction of true positives in the k nearest neighbors) and Mean Average Precision (MAP). For classification downstream, accuracy of a k-NN classifier under the learned metric is standard. Report results at multiple time steps across the stream to reveal adaptation dynamics.

Sources

  1. Shalev-Shwartz, S., Singer, Y., & Ng, A. Y. (2004). Online and batch learning of pseudo-metrics. Proceedings of the 21st International Conference on Machine Learning (ICML 2004), pp. 94. ACM. link ↗
  2. Jin, R., Wang, S., & Zhou, Y. (2009). Regularized distance metric learning: Theory and algorithm. Advances in Neural Information Processing Systems (NIPS 2009), 22, 862–870. link ↗

How to cite this page

ScholarGate. (2026, June 3). Online Metric Learning (Incremental Distance Metric Learning from Streaming Data). ScholarGate. https://scholargate.app/en/machine-learning/online-metric-learning

Related methods

Metric LearningOnline LearningSiamese Network

Which method?

Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.

  • Metric LearningMachine learning↔ compare
  • Online LearningMachine learning↔ compare
  • Siamese NetworkDeep learning↔ compare
Compare side by side →

Similar methods

Metric LearningRobust Metric LearningEnsemble Metric LearningSemi-supervised Metric LearningOnline Few-shot LearningBayesian Metric LearningOnline Self-supervised LearningOnline Learning

Related reference concepts

Support Vector Machines and Kernel MethodsDimensionality ReductionSupport Vector ClassificationLearning to RankMultidimensional ScalingVC Dimension and Capacity

Spotted an issue on this page? Report or suggest a fix →

ScholarGate — Online Metric Learning (Online Metric Learning (Incremental Distance Metric Learning from Streaming Data)). Retrieved 2026-07-21 from https://scholargate.app/en/machine-learning/online-metric-learning · Dataset: https://doi.org/10.5281/zenodo.20539026
Quick facts
Originator
Shalev-Shwartz, S.; Singer, Y.; and others
Year
2004–2009
Type
Online / incremental learning of distance metrics
DataType
Labeled pairwise or triplet constraints from streaming observations
Subfamily
Machine learning
Related methods
Metric LearningOnline LearningSiamese Network
ScholarGate

A content-first reference library for research methods — what each one is, how it works, and where it comes from.

Open data (CC-BY)

Explore

  • Library
  • Search the library…
  • Browse by field
  • Fields
  • Journey
  • Compare
  • Which method?

Reference

  • Subjects
  • Atlas
  • Glossary
  • Methodology
  • Philosophy

Your tools

  • Bookshelf
  • Desk
  • Chat

Company

  • About
  • Pricing
  • Contact
  • Suggest a method

Entries are compiled from published sources for reference. Verifying the accuracy and suitability of any information for your own use remains your responsibility.

© 2026 ScholarGate · A research-method reference library
  • Privacy
  • Cookies
  • Terms
  • Delete account