# Deep Metric Learning by Online Soft Mining and Class-Aware Attention

arXiv: https://arxiv.org/abs/1811.01459 · HTML: https://mlsanity.com/paper/1811.01459/

## Key facts

- Cited by 13 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 4 Nov 2018.

## Built on by (most cited first, 13 of 13)

- [Mutual Contrastive Learning for Visual Representation Learning](https://mlsanity.com/paper/2104.12565/) (2021)
- [Noise-resistant Deep Metric Learning with Ranking-based Instance Selection](https://mlsanity.com/paper/2103.16047/) (2021)
- [Accelerating Neural Field Training via Soft Mining](https://mlsanity.com/paper/2312.00075/) (2023)
- [Leveraging Reviewer Experience in Code Review Comment Generation](https://mlsanity.com/paper/2409.10959/) (2024)
- [Deep Learning for Video-based Person Re-Identification: A Survey](https://mlsanity.com/paper/2303.11332/) (2023)
- [FlameFinder: Illuminating Obscured Fire through Smoke with Attentive Deep Metric Learning](https://mlsanity.com/paper/2404.06653/) (2024)
- [A Decidability-Based Loss Function](https://mlsanity.com/paper/2109.05524/) (2021)
- [Contrastive Embedding Distribution Refinement and Entropy-Aware Attention for 3D Point Cloud Classification](https://mlsanity.com/paper/2201.11388/) (2022)
- [Informative Sample-Aware Proxy for Deep Metric Learning](https://mlsanity.com/paper/2211.10382/) (2022)
- [Enhancing Sample Utilization in Noise-Robust Deep Metric Learning With Subgroup-Based Positive-Pair Selection](https://mlsanity.com/paper/2501.11063/) (2025)
- [Improving Image co-segmentation via Deep Metric Learning](https://mlsanity.com/paper/2103.10670/) (2021)
- [Noise-Resistant Deep Metric Learning with Probabilistic Instance Filtering](https://mlsanity.com/paper/2108.01431/) (2021)
- [Data-Adaptive Mahalanobis Metric Learning for Cross-Head Attention in Transformers](https://mlsanity.com/paper/2610.13261/) (2026)

## Abstract (arXiv)

Deep metric learning aims to learn a deep embedding that can capture the semantic similarity of data points. Given the availability of massive training samples, deep metric learning is known to suffer from slow convergence due to a large fraction of trivial samples. Therefore, most existing methods generally resort to sample mining strategies for selecting nontrivial samples to accelerate convergence and improve performance. In this work, we identify two critical limitations of the sample mining methods, and provide solutions for both of them. First, previous mining methods assign one binary score to each sample, i.e., dropping or keeping it, so they only selects a subset of relevant samples in a mini-batch. Therefore, we propose a novel sample mining method, called Online Soft Mining (OSM), which assigns one continuous score to each sample to make use of all samples in the mini-batch. OSM learns extended manifolds that preserve useful intraclass variances by focusing on more similar positives. Second, the existing methods are easily influenced by outliers as they are generally included in the mined subset. To address this, we introduce Class-Aware Attention (CAA) that assigns little attention to abnormal data samples. Furthermore, by combining OSM and CAA, we propose a novel weighted contrastive loss to learn discriminative embeddings. Extensive experiments on two fine-grained visual categorisation datasets and two video-based person re-identification benchmarks show that our method significantly outperforms the state-of-the-art.
