[Paper Review] It Takes Two to Tango: Mixup for Deep Metric Learning
This paper introduces Metrix, a novel mixup-based data augmentation method for deep metric learning that interpolates both input samples and their corresponding positive/negative labels to improve representation learning. By treating metric learning as binary classification of example pairs, Metrix enables effective label interpolation, leading to state-of-the-art performance across four benchmark datasets by enhancing embedding space coverage and generalization to unseen classes.
Metric learning involves learning a discriminative representation such that embeddings of similar classes are encouraged to be close, while embeddings of dissimilar classes are pushed far apart. State-of-the-art methods focus mostly on sophisticated loss functions or mining strategies. On the one hand, metric learning losses consider two or more examples at a time. On the other hand, modern data augmentation methods for classification consider two or more examples at a time. The combination of the two ideas is under-studied. In this work, we aim to bridge this gap and improve representations using mixup, which is a powerful data augmentation approach interpolating two or more examples and corresponding target labels at a time. This task is challenging because unlike classification, the loss functions used in metric learning are not additive over examples, so the idea of interpolating target labels is not straightforward. To the best of our knowledge, we are the first to investigate mixing both examples and target labels for deep metric learning. We develop a generalized formulation that encompasses existing metric learning loss functions and modify it to accommodate for mixup, introducing Metric Mix, or Metrix. We also introduce a new metric - utilization, to demonstrate that by mixing examples during training, we are exploring areas of the embedding space beyond the training classes, thereby improving representations. To validate the effect of improved representations, we show that mixing inputs, intermediate representations or embeddings along with target labels significantly outperforms state-of-the-art metric learning methods on four benchmark deep metric learning datasets.
Motivation & Objective
- To bridge the gap between data augmentation in classification and metric learning by extending mixup to handle both input and label interpolation in metric learning.
- To address the challenge of non-additive loss functions in metric learning that complicate standard label interpolation.
- To improve generalization to unseen classes by exploring embedding space regions beyond training classes during training.
- To introduce a new evaluation metric, utilization, to quantify how well test examples align with training examples, including mixed ones.
- To achieve state-of-the-art performance across multiple deep metric learning benchmarks using a unified, generic framework.
Proposed method
- Formulate metric learning as a binary classification task over pairs of examples, where each pair is labeled as 'positive' (same class) or 'negative' (different class) relative to an anchor.
- Propose a generalized framework that extends mixup to metric learning by interpolating both input features and the binary positive/negative labels of pairs.
- Define the 'positivity' of a mixed example as a function of the interpolation factor α, ensuring that the interpolated label reflects the relative contribution of positive and negative pairs.
- Introduce a new metric, utilization, which measures the average minimum distance from test embeddings to any training embedding (clean or mixed), with lower values indicating better coverage of the embedding space.
- Apply Metrix at different levels: input-level (raw images), intermediate-level (feature maps), and embedding-level (final representations), with consistent improvements.
- Use standard metric learning loss functions (e.g., contrastive, triplet, multi-similarity) within the Metrix framework, demonstrating its compatibility and effectiveness across diverse loss types.
Experimental results
Research questions
- RQ1Can mixup be effectively extended to deep metric learning, where loss functions are not additive over individual examples?
- RQ2How should labels be interpolated in metric learning when the task is to distinguish between positive and negative pairs rather than single-class labels?
- RQ3Does mixing examples and labels during training lead to better generalization to unseen classes in metric learning?
- RQ4To what extent does mixup exploration improve coverage of the embedding space, as measured by the utilization metric?
- RQ5Can Metrix consistently outperform state-of-the-art methods across multiple benchmark datasets and loss functions?
Key findings
- Metrix achieves state-of-the-art performance on four deep metric learning benchmarks: CUB200, Cars196, SOP, and In-Shop, outperforming prior methods including Proxy Anchor and Proxy Synthesis.
- On CUB200 with contrastive loss, utilization drops from 0.41 to 0.32 when using Metrix, indicating that test samples are closer to mixed training examples in the embedding space.
- Using Metrix with the multi-similarity loss (Wang et al., 2019) achieves new state-of-the-art results on all four benchmarks, even though this loss was not SOTA without mixup.
- Embedding-level mixup (Metrix/embed) yields the strongest gains, with R@1 increasing to 80.6% on In-Shop and 91.6% on the 100-shot recall, surpassing previous SOTA.
- The utilization metric confirms that mixup leads to a more comprehensive exploration of the embedding space, with test queries lying closer to mixed training examples than to clean ones.
- The proposed positivity function shows a monotonic increase with the interpolation factor α, validating the theoretical consistency of label interpolation in the Metrix framework.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.