Three Things to Know about Deep Metric Learning
Yash Patel, Giorgos Tolias, Jiri Matas
TL;DR
This work tackles open-set image retrieval by aligning training with retrieval metrics through a differentiable Recall@k surrogate loss $L$ and a similarity-based mixup called SiMix. It enables large-batch training by a memory-efficient two-pass forward pass and demonstrates that extensive pre-training initializations (ImageNet-21k, CLIP, DINOv2, SWAG, DiHT) substantially boost performance. The combined approach yields state-of-the-art results across standard deep metric learning benchmarks and, with strong initialization, nearly solves several datasets. The proposed methods offer practical scalability for large models in retrieval tasks and provide guidance for hyper-parameter tuning and initialization in DML pipelines.
Abstract
This paper addresses supervised deep metric learning for open-set image retrieval, focusing on three key aspects: the loss function, mixup regularization, and model initialization. In deep metric learning, optimizing the retrieval evaluation metric, recall@k, via gradient descent is desirable but challenging due to its non-differentiable nature. To overcome this, we propose a differentiable surrogate loss that is computed on large batches, nearly equivalent to the entire training set. This computationally intensive process is made feasible through an implementation that bypasses the GPU memory limitations. Additionally, we introduce an efficient mixup regularization technique that operates on pairwise scalar similarities, effectively increasing the batch size even further. The training process is further enhanced by initializing the vision encoder using foundational models, which are pre-trained on large-scale datasets. Through a systematic study of these components, we demonstrate that their synergy enables large models to nearly solve popular benchmarks.
