Abstract
Deep Metric Learning (DML) has been more attractive and widely applied in many computer vision tasks, in which a discriminative embedding is requested such that the image features belonging to the same class are gathered together and the ones belonging to different classes are pushed apart. Most existing works insist to learn this discriminative embedding by either devising powerful pair-based loss functions or hard-sample mining strategies. However, in this paper, we start from an another perspective and propose Deep Consistent Graph Metric Learning (CGML) framework to enhance the discrimination of the learned embedding. It is mainly achieved by rethinking the conventional distance constraints as a graph regularization and then introducing a Graph Consistency regularization term, which intends to optimize the feature distribution from a global graph perspective. Inspired by the characteristic of our defined ’Discriminative Graph’, which regards DML from another novel perspective, the Graph Consistency regularization term encourages the sub-graphs randomly sampled from the training set to be consistent. We show that our CGML indeed serves as an efficient technique for learning towards discriminative embedding and is applicable to various popular metric objectives, e.g. Triplet, N-Pair and Binomial losses. This paper empirically and experimentally demonstrates the effectiveness of our graph regularization idea, achieving competitive results on the popular CUB, CARS, Stanford Online Products and In-Shop datasets.
Introduction
Deep Metric Learning (DML) is the engine behind modern face recognition and image search systems. Its primary objective is to map images into a high-dimensional mathematical space where similar items are clustered together and dissimilar items are pushed apart.
Traditionally, DML relies on "local" constraints, comparing pairs or triplets of images at a time. However, this approach often suffers from a "stopping" problem: once a local constraint (like a triplet margin) is satisfied, the model stops learning from those samples. This can result in an embedding space that is locally correct but globally disorganized, characterized by large intra-class variations and narrow inter-class margins. The authors of this paper propose moving beyond these local views by considering the global graph structure of the data.
Methods: Consistent Graph Metric Learning
The authors propose the Deep Consistent Graph Metric Learning (CGML) framework, which reinterprets distance constraints through the lens of graph regularization.
The Discriminative Graph and Consistency
The core of the framework is the "Discriminative Graph," an ideal structure where intra-class distances are minimized and inter-class margins are maximized. Since optimizing the entire dataset's graph is computationally prohibitive, CGML introduces Graph Consistency (GC). The intuition is elegant: if the global embedding space is truly discriminative and well-structured, any two randomly sampled sub-graphs should exhibit nearly identical connectivity patterns.
The GC Loss Term
The framework derives a mathematical upper bound for this consistency. Instead of a direct comparison of adjacency matrices, it minimizes the difference between feature-weighted representations: $L_{gc} = \|S'X'^T - S''X''^T\|_F$. This term acts as a "plug-and-play" regularizer that can be added to standard DML losses like Triplet, N-Pair, or Binomial loss. It serves as a global supervisor, guiding local losses toward a more stable and discriminative global distribution.
Experimental Evaluation
The CGML framework was evaluated on four standard benchmarks: CARS196, CUB-200-2011, Stanford Online Products (SOP), and In-Shop Clothes Retrieval.
Key Results
CGML consistently outperformed baseline versions of the losses it was integrated with across all datasets. For instance, on the CARS dataset, adding CGML to the Triplet loss boosted Recall@1 from 68.1% to 75.8%. On the SOP dataset, the N-Pair version achieved a Recall@1 of 68.4%, outperforming several complex ensemble-based methods.
The method's universality is a key highlight; it provides gains regardless of whether the base loss is pair-based, triplet-based, or N-pair based. This demonstrates its versatility as a general-purpose regularizer for deep metric learning.
Conclusion
CGML introduces a novel perspective to DML by leveraging global graph consistency. By ensuring that randomly sampled sub-graphs are consistent, the framework achieves a more discriminative and stable embedding space. While future work may explore hyperparameter sensitivity and the impact of varying batch sizes, the current empirical results strongly support the effectiveness of graph regularization in learning high-quality image representations.
Summary updated