Abstract
Existing metric learning losses can be categorized into two classes: pair-based and proxy-based losses. The former class can leverage fine-grained semantic relations between data points, but slows convergence in general due to its high training complexity. In contrast, the latter class enables fast and reliable convergence, but cannot consider the rich data-to-data relations. This paper presents a new proxy-based loss that takes advantages of both pair- and proxy-based methods and overcomes their limitations. Thanks to the use of proxies, our loss boosts the speed of convergence and is robust against noisy labels and outliers. At the same time, it allows embedding vectors of data to interact with each other in its gradients to exploit data-to-data relations. Our method is evaluated on four public benchmarks, where a standard network trained with our loss achieves state-of-the-art performance and most quickly converges.
Introduction
Deep Metric Learning (DML) is fundamental to tasks like face recognition and image retrieval, where the goal is to learn an embedding space that clusters similar items and separates dissimilar ones. Historically, DML has been divided into pair-based and proxy-based approaches. Pair-based methods, such as Triplet Loss, capture fine-grained relations but suffer from high computational complexity ($O(M^2)$ or $O(M^3)$). Proxy-based methods, like Proxy-NCA, offer faster convergence ($O(MC)$) by comparing data points to class-representative vectors (proxies) but often fail to capture complex data-to-data interactions.
Methods
The proposed Proxy Anchor Loss bridges this gap by utilizing proxies as anchors. Unlike traditional proxy methods where a data point acts as an anchor to find proxies, this approach considers each proxy as an anchor and relates it to all data points within a training batch.
As shown in the comparison above, while pair-based methods (a, b, c) relate data points directly and standard proxy methods (d) relate one data point to one proxy, Proxy Anchor Loss (e) allows a single proxy to interact with all relevant data points in the batch. This formulation uses a Log-Sum-Exp function to smoothly approximate a hard max, effectively weighting "hard" examples more heavily. Crucially, this allows data-to-data interactions to be reflected in the gradients, capturing the relational richness of pair-based methods without the sampling complexity.
Key Results
The method was evaluated on four standard benchmarks: CUB-200-2011, Cars-196, Stanford Online Products (SOP), and In-shop Clothes Retrieval.
Proxy Anchor Loss achieved state-of-the-art (SOTA) accuracy across all datasets. Notably, on the Cars-196 dataset, it reached a higher Recall@1 in approximately 20 minutes than competing methods achieved in 100 minutes. On CUB-200-2011, it improved the previous best Recall@1 by 2.7%. Furthermore, the method demonstrated robustness against noisy labels and maintained stability across high embedding dimensions.
Conclusion
Proxy Anchor Loss effectively combines the efficiency of proxy-based learning with the relational depth of pair-based methods. By removing the need for complex sampling and providing faster convergence, it offers a robust solution for large-scale DML. Future research may address scaling to datasets with millions of classes and extending the framework to deep hashing.
Reference: Kim, S., Kim, D., Cho, M., & Kwak, S. (2020). Proxy Anchor Loss for Deep Metric Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).
Summary updated