Comparing Contrastive and Triplet Loss: Variance Analysis and Optimization Behavior
Not on the map. Why?
Abstract (arXiv)
Contrastive loss and triplet loss are widely used objectives in deep metric learning, yet their effects on representation quality remain insufficiently understood. We present a theoretical and empirical comparison of these losses, focusing on intra- and inter-class variance and optimization behavior (e.g., greedy updates). Through task-specific experiments with consistent settings on synthetic data and real datasets-MNIST, CIFAR-10-it is shown that triplet loss preserves greater variance within and across classes, supporting finer-grained distinctions in the learned representations. In contrast, contrastive loss tends to compact intra-class embeddings, which may obscure subtle semantic differences. To better understand their optimization dynamics, By examining loss-decay rate, active ratio, and gradient norm, we find that contrastive loss drives many small updates early on, while triplet loss produces fewer but stronger updates that sustain learning on hard examples. Finally, across both classification and retrieval tasks on MNIST, CIFAR-10, CUB-200, and CARS196 datasets, our results consistently show that triplet loss yields superior performance, which suggests using triplet loss for detail retention and hard-sample focus, and contrastive loss for smoother, broad-based embedding refinement.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 8 of its 9 references that are in the map. First posted on arXiv 2 Oct 2025.
Builds on
8 of 9 references.
References · 8
- 2015FaceNet: A Unified Embedding for Face Recognition and Clusteringcited by 2,833
- 2017In Defense of the Triplet Loss for Person Re-Identificationcited by 784
- 2021Understanding Dimensional Collapse in Contrastive Self-supervised Learningcited by 374
- 2019Multi-Similarity Loss with General Pair Weighting for Deep Metric Learningcited by 368
- 2020A Metric Learning Reality Checkcited by 317
- 2017Sampling Matters in Deep Embedding Learningcited by 285
- 2015Feature Learning based Deep Supervised Hashing with Pairwise Labelscited by 59
- 2020Fisher Discriminant Triplet and Contrastive Losses for Training Siamese Networkscited by 15
Built on by
Citing papers per year: 2026: 1.
1 paper.