Deep Relational Metric Learning

Wenzhao Zheng, Borui Zhang, Jiwen Lu, Jie Zhou · DOI

Introduction

Deep Metric Learning (DML) aims to learn a mapping from image space to an embedding space where semantically similar items are clustered together and dissimilar items are separated. Conventional DML approaches typically focus on minimizing intraclass variance to create highly discriminative embeddings. However, this "squashing" effect often discards subtle variations—such as background, pose, or texture—that are crucial for generalizing to previously unseen classes in zero-shot retrieval scenarios.

Deep Relational Metric Learning (DRML) proposes a shift in this paradigm. Instead of a single, monolithic embedding, DRML learns an ensemble of features representing diverse aspects of an image and employs a graph-based relational module to capture the interactions between these features.

Comparison of conventional DML, ensemble-based DML, and the proposed DRML framework.

The DRML Framework

The DRML architecture introduces two primary innovations to preserve rich characteristic information while maintaining discriminative power.

Adaptive Ensemble Learning

The model utilizes a shared CNN backbone followed by $K$ parallel fully connected layers to generate an ensemble of individual features. To prevent these features from becoming redundant, the authors implement a bottleneck reconstruction loss. During training, each image is dynamically assigned to the feature extractor that best reconstructs the original global CNN feature. This competitive mechanism encourages different extractors to specialize in distinct visual attributes, such as color, shape, or texture, without requiring explicit attribute labels.

Relational Module and Inference

Rather than simply concatenating the ensemble features, DRML treats them as nodes in a graph. A relational module learns "meta-relational" features that define the edges between these nodes, capturing the structural dependencies between different visual aspects.

The detailed DRML architecture, showing the transition from individual features to relational inference.

The model then performs relational inference through a message-passing operation, similar to Graph Neural Networks. Each node updates its state by integrating information from its neighbors based on the learned relations. The final "relation-aware" embedding is used for distance calculations during retrieval. The entire pipeline is trained end-to-end using a combination of ensemble loss, reconstruction loss, and standard metric learning losses like Triplet or ProxyAnchor.

Experimental Evaluation

The authors evaluated DRML on three standard benchmarks for image retrieval and clustering: CUB-200-2011 (birds), Cars196 (cars), and Stanford Online Products (SOP). All tests were conducted in a zero-shot setting, where test classes were entirely disjoint from training classes.

Key Results

DRML consistently outperformed state-of-the-art baselines across all datasets:

  • CUB-200-2011: Combined with ProxyAnchor loss (DRML-PA), the model achieved a Recall@1 of 68.7%, improving upon the standalone ProxyAnchor baseline (67.3%).
  • Cars196: The framework reached a Recall@1 of 86.9%, a significant improvement over standard methods.
  • Stanford Online Products: On this large-scale dataset, DRML-PA achieved 71.5% Recall@1, demonstrating its scalability to tens of thousands of classes.

Ablation studies confirmed that the relational module is vital; replacing it with simple feature concatenation resulted in a measurable performance decline.

Discussion and Conclusion

The core insight of DRML is that intraclass variation should be treated as a feature rather than noise. By preserving these nuances through an adaptive ensemble and modeling their interactions via a relational graph, the model achieves superior generalization.

While highly effective, DRML introduces some computational overhead due to the parallel branches and relational module. Additionally, performance can be sensitive to the number of ensemble features $K$ and loss-balancing hyperparameters. Future research may explore extending this relational approach to other domains, such as video analysis or 3D point cloud processing, where structural relationships are inherently critical.

Summary updated

BibTeX
@inproceedings{zheng2021deep,
  author = {Wenzhao Zheng and Borui Zhang and Jiwen Lu and Jie Zhou},
  title = {{Deep Relational Metric Learning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01185},
}
Figure