Deep Variational Metric Learning

Xudong Lin, Yueqi Duan, Qiyuan Dong, Jiwen Lu, Jie ZhouECCV 2018

Abstract

Deep metric learning has been extensively explored recently, which trains a deep neural network to produce discriminative embedding features. Most existing methods usually enforce the model to be indiscriminating to intra-class variance, which makes the model over-fitting to the training set to minimize loss functions on these specific changes and leads to low generalization power on unseen classes. However, these methods ignore a fact that in the central latent space, the distribution of variance within classes is actually independent on classes. In this paper, we propose a deep variational metric learning (DVML) framework to explicitly model the intra-class variance and disentangle the intra-class invariance, namely, the class centers. With the learned distribution of intra-class variance, we can simultaneously generate discriminative samples to improve robustness. Our method is applicable to most of existing metric learning algorithms, and extensive experiments on three benchmark datasets including CUB-200-2011, Cars196 and Stanford Online Products show that our DVML significantly boosts the performance of currently popular deep metric learning methods.

Introduction

The primary objective of Deep Metric Learning (DML) is to map images into a feature space where similar objects are clustered together and dissimilar ones are pushed apart. Conventional DML approaches often attempt to collapse all samples of a single class into a single point in the embedding space. However, this approach ignores natural intra-class variations such as pose, lighting, and viewpoint. By forcing the model to be "blind" to these variations, it often overfits to the training data, failing to generalize to novel classes where these variations manifest differently.

DVML addresses this by positing that intra-class variance (e.g., "rotating 45 degrees") is largely class-independent. By explicitly modeling this noise, the framework can better isolate the underlying signal: the object's identity.

Methodology: The DVML Framework

The core of the DVML framework is a Variational Auto-Encoder (VAE) architecture designed to disentangle the embedding space into two distinct components:

  1. Intra-class Invariance ($z_I$): Represents the stable identity or "class center."
  2. Intra-class Variance ($z_V$): Captures sample-specific variations like lighting or pose.
The DVML framework architecture, illustrating the disentanglement of features into invariance ($z_I$) and variance ($z_V$) components during training and testing.

Training Objectives

The model is trained using a four-part loss function:

  • KL Divergence: Regularizes the learned variance distribution against a Gaussian prior.
  • Reconstruction Loss: Ensures the disentangled components $z_I$ and $z_V$ retain enough information to reconstruct the original feature.
  • Synthesized Metric Loss: The framework samples new variances from the learned distribution and adds them to class centers to create "synthetic hard samples." This latent space augmentation forces the model to remain discriminative across the entire distribution of possible variations.
  • Invariant Metric Loss: Standard metric learning is applied to the clean class centers ($z_I$) to maintain their discriminative power.

Experimental Results

DVML was evaluated on three benchmark datasets: CUB-200-2011 (birds), Cars196 (cars), and Stanford Online Products (SOP). As a "plug-and-play" framework, it was integrated with several popular baseline losses, including Triplet, N-pair, and Angular loss.

Performance comparison on the Cars196 dataset. The addition of DVML consistently improves NMI, F1, and Recall@K metrics across various baseline methods.

On the Cars196 dataset, which features significant geometric and viewpoint variations, DVML provided substantial gains. For instance, when paired with the N-pair loss, Recall@1 improved from 72.3% to 80.4%. Similar improvements were observed on the large-scale SOP dataset, where Triplet loss performance jumped from 54.9% to 66.5% R@1. While gains on the fine-grained CUB-200-2011 dataset were more modest, they remained statistically significant, confirming the framework's broad utility.

Conclusion

Deep Variational Metric Learning shifts the paradigm from suppressing intra-class variance to explicitly modeling it. By disentangling identity from environmental noise and utilizing latent space augmentation, DVML significantly enhances the robustness and generalization of existing metric learning algorithms. While the VAE architecture introduces some computational overhead, the consistent performance boosts across diverse datasets make it a powerful tool for modern image retrieval and clustering tasks.

Summary updated

BibTeX
@inproceedings{lin2018deep,
  author = {Xudong Lin and Yueqi Duan and Qiyuan Dong and Jiwen Lu and Jie Zhou},
  title = {{Deep Variational Metric Learning}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  url = {https://openreview.net/forum?id=HJWyUKZ_Wr},
}
Figure