Abstract
Deep metric learning, which learns discriminative features to process image clustering and retrieval tasks, has attracted extensive attention in recent years. A number of deep metric learning methods, which ensure that similar examples are mapped close to each other and dissimilar examples are mapped farther apart, have been proposed to construct effective structures for loss functions and have shown promising results. In this paper, different from the approaches on learning the loss structures, we propose a robust SNR distance metric based on Signal-to-Noise Ratio (SNR) for measuring the similarity of image pairs for deep metric learning. By exploring the properties of our SNR distance metric from the view of geometry space and statistical theory, we analyze the properties of our metric and show that it can preserve the semantic similarity between image pairs, which well justify its suitability for deep metric learning. Compared with Euclidean distance metric, our SNR distance metric can further jointly reduce the intra-class distances and enlarge the inter-class distances for learned features. Leveraging our SNR distance metric, we propose Deep SNR-based Metric Learning (DSML) to generate discriminative feature embeddings. By extensive experiments on three widely adopted benchmarks, including CARS196, CUB200-2011 and CIFAR10, our DSML has shown its superiority over other state-of-the-art methods. Additionally, we extend our SNR distance metric to deep hashing learning, and conduct experiments on two benchmarks, including CIFAR10 and NUS-WIDE, to demonstrate the effectiveness and generality of our SNR distance metric.
Introduction
The primary objective of Deep Metric Learning (DML) is to train neural networks to map images into an embedding space where semantic similarity is reflected by spatial proximity. This capability is the cornerstone of applications such as face recognition, image retrieval, and clustering. Historically, the research community has focused on "structure-learning"—the design of sophisticated loss functions like Triplet Loss or N-pair Loss. However, these methods predominantly rely on the Euclidean distance metric to measure similarity. This paper argues that Euclidean distance is fundamentally limited as it only accounts for straight-line distance in $n$-dimensional space, neglecting the inherent variance and informativeness of the learned features.
Deep SNR-based Metric Learning (DSML)
To address the limitations of Euclidean distance, we introduce a novel metric inspired by signal processing: the Signal-to-Noise Ratio (SNR) distance. In this framework, anchor features are treated as "signals," while the difference between pairs is considered "noise." Given an anchor feature $h_i$ and a compared feature $h_j$, the noise is defined as $n_{ij} = h_j - h_i$. The SNR distance ($d_S$) is then calculated as the ratio of noise variance to signal variance: $$d_S(h_i, h_j) = \frac{var(h_j - h_i)}{var(h_i)}$$
Advantages of the SNR Metric
The SNR metric offers several theoretical and practical advantages over standard Euclidean distance:
- Joint Optimization: Minimizing the SNR distance does not merely pull points together; it simultaneously encourages the anchor feature to possess higher variance, thereby increasing its information content.
- Non-Commutativity: Unlike Euclidean distance, the SNR metric is sensitive to the choice of anchor ($d(A, B) \neq d(B, A)$), providing more descriptive constraints during training.
- Geometric Constraints: The metric can be visualized as a set of "forces." While Euclidean distance provides an attractive force between similar pairs, the SNR metric introduces an additional force that pushes features away from the origin, effectively enlarging inter-class distances while tightening intra-class clusters.
Experimental Evaluation
We integrated the SNR metric into four widely used loss structures—Contrastive, Triplet, Lifted Structured, and N-pair—forming the Deep SNR-based Metric Learning (DSML) framework. The performance was evaluated on standard benchmarks including CARS196 (car models) and CUB200-2011 (bird species).
Using an AlexNet backbone, the transition from Euclidean to SNR distance resulted in significant performance improvements across all tested loss functions. For instance, in the Triplet loss configuration, Recall@1 increased from 24.8% to 38.5% on CARS196 and from 33.9% to 45.7% on CUB200-2011.
Furthermore, the generality of the SNR metric was demonstrated through its extension to Deep SNR-based Hashing (DSNRH). On the large-scale NUS-WIDE dataset, DSNRH consistently outperformed state-of-the-art hashing methods across various bit lengths.
Conclusion
This paper demonstrates that the choice of distance metric is a critical factor in the effectiveness of deep metric learning. By treating features as signals and their differences as noise, the proposed SNR distance metric provides a robust and discriminative framework that significantly outperforms traditional Euclidean-based methods. Future research will explore the scalability of this metric with more advanced architectures such as ResNets and Vision Transformers.
Summary updated