Abstract
We propose a novel distance-based regularization method for deep metric learning called Multi-level Distance Regularization (MDR). MDR explicitly disturbs a learning procedure by regularizing pairwise distances between embedding vectors into multiple levels that represents a degree of similarity between a pair. In the training stage, the model is trained with both MDR and an existing loss function of deep metric learning, simultaneously; the two losses interfere with the objective of each other, and it makes the learning process difficult. Moreover, MDR prevents some examples from being ignored or overly influenced in the learning process. These allow the parameters of the embedding network to be settle on a local optima with better generalization. Without bells and whistles, MDR with simple Triplet loss achieves the-state-of-the-art performance in various benchmark datasets: CUB-200-2011, Cars-196, Stanford Online Products, and In-Shop Clothes Retrieval.
Introduction
Deep Metric Learning (DML) is fundamental to tasks like image retrieval and face recognition, where the goal is to map images into an embedding space such that similar items are close and dissimilar items are far apart. Standard DML losses, such as Triplet or Contrastive loss, typically employ a binary objective: push positive pairs together and pull negative pairs apart. However, this simple approach often leads to overfitting, where the model focuses on easy examples and fails to generalize to unseen data.
We introduce Multi-level Distance Regularization (MDR), a "plug-and-play" regularization method that improves DML by intentionally disturbing the training process. By forcing pairwise distances to align with discrete, predefined "levels," MDR prevents overfitting and helps models learn more robust, discriminative features.
Methodology
MDR acts as a secondary objective during training, creating a "tug-of-war" with the primary DML loss. This interference forces the network to find more stable local optima that generalize better.
The MDR process consists of three main steps:
- Distance Normalization: Pairwise distances in a mini-batch are normalized using a running mean and standard deviation. This ensures regularization is based on the relative distribution of distances across the entire dataset.
- Level Assignment: A set of learnable "levels" is defined. Each normalized distance is assigned to its nearest level.
- Regularization: The model is penalized if a distance deviates from its assigned level.
Key Insights
- Productive Interference: Making the optimization task harder by introducing a disturbing regularizer leads to better generalization. MDR interferes with the primary loss, forcing the network to find more stable local optima.
- Beyond Binary Labels: While standard losses treat all negatives identically, MDR recognizes degrees of similarity. Multiple levels allow the model to account for varying inter-class similarities and intra-class variations.
- Implicit Normalization: MDR naturally causes embedding vectors to have a consistent length, similar to the effect of $L_2$ normalization, even when not explicitly applied.
Experimental Results
MDR was evaluated on four standard DML benchmarks: CUB-200-2011, Cars-196, Stanford Online Products (SOP), and In-Shop Clothes Retrieval. Combined with a simple Triplet loss, MDR achieved state-of-the-art performance:
- CUB-200-2011: Achieved 68.8% Recall@1 (vs. 57.3% baseline).
- Cars-196: Reached 88.5% Recall@1 (vs. 76.2% baseline).
The method demonstrated significant gains across different architectures (ResNet18, ResNet50, Inception) and was particularly effective in low-dimensional embedding spaces (e.g., 64-dim).
Conclusion
Multi-level Distance Regularization provides a simple yet effective way to improve the generalization of deep metric learning models. By regularizing the distribution of pairwise distances into multiple levels, MDR prevents the network from settling into non-robust solutions, leading to superior performance across diverse benchmarks.
Summary updated