Term
Triplet loss
Meaning
A metric learning loss over anchor, positive and negative samples. It penalizes an embedding unless the anchor's distance to a positive from the same class is smaller than its distance to a negative from another class by at least a margin, with the hinge clipped at zero.
Source In Defense of the Triplet Loss for Person Re-Identification
How papers use it 11 papers
In Defense of the Triplet Loss for Person Re-Identification
Use The central object of the paper. The authors use the triplet loss to train a CNN end-to-end so that the embedding can be compared directly with the Euclidean distance, without a separate metric learning step. Naive random triplet sampling performs poorly in their experiments, so the paper's contribution is a set of batch-level variants of this loss rather than the plain form.
Conditional Image Generation with PixelCNN Decoders
Use Used to train the supervised face embedding network on a large set of cropped portraits. The loss makes the embedding of an image of a person closer to the embeddings of other images of that person than to embeddings of other people. The resulting embedding then serves as the conditioning vector h for the Conditional PixelCNN.
Meaning A loss for learning embeddings in which an anchor example is pulled closer to a positive example of the same identity than to a negative example of a different identity, by a margin.
Supervised Contrastive Learning
Use Discussed as a special case of the contrastive loss, where one positive and one negative are used. Under the paper's Taylor approximation, the single-positive, single-negative contrastive form becomes a triplet loss with margin proportional to 2τ. The paper contrasts it with SupCon, noting that triplet training in practice needs computationally expensive hard negative mining, while the SupCon gradient gives a built-in emphasis on hard negatives that requires large batches.
Meaning A metric learning loss that uses exactly one positive and one negative per anchor. It trains an embedding so that the anchor is closer to the positive than to the negative by a margin.
A Survey of Convolutional Neural Networks: Analysis, Applications, and Prospects
Use Used to learn face embeddings in FaceNet, which replaces softmax with triplet loss. The paper also notes that VGGFace trains with it, and that triplet loss and its variants are used for identification tasks such as face, person and vehicle re-identification.
Meaning A loss defined over three images, an anchor, a positive from the same identity as the anchor, and a negative from a different identity. Training reduces the anchor-to-positive distance and increases the anchor-to-negative distance.
Recent Advances in Convolutional Neural Networks
Use Introduced in Section 3.4.4 as one of the four loss functions surveyed for CNN training. The paper notes that for some arrangements of anchor, positive and negative distances the loss is zero, so those triplets contribute nothing in backpropagation. It motivates the Coupled Clusters loss as a remedy for this weakness. The paper also says the triplet loss and its variants have been used for re-identification, verification and image retrieval, citing other works for these applications.
Meaning A metric learning loss that takes three instances at a time: an anchor, a positive from the same class as the anchor, and a negative from a different class. It penalizes the case where the anchor-positive squared distance does not fall below the anchor-negative squared distance by at least a margin, so training pulls positives toward the anchor and pushes negatives away.
Embedding Dimension of Contrastive Learning and $k$-Nearest Neighbors
Use Used to train the embedding networks on the sampled contrastive triplets. The paper writes the loss for a triplet (x, y⁺, z⁻) as \(L_F(x,y^+,z^-)=\|F(x)-F(y)\|_2^2-\|F(x)-F(z)\|_2^2+1\), with F the embedding network, and applies it to the ResNet-18 models.
Meaning A training loss defined on a triplet of an anchor, a positive example and a negative example. It compares squared embedding distances from the anchor to the positive and to the negative, so that minimizing it pushes the positive closer to the anchor than the negative.
Relational Knowledge Distillation
Use Used to train the metric learning teacher models, with margin 0.2 and distance-weighted triplet sampling, on embeddings that are L2-normalized. It also serves as the Triplet baseline that the student models are compared against in the metric learning tables. In the RKD metric learning runs the student is trained only with the RKD losses and no triplet task loss, while the DarkRank comparison uses the triplet loss together with its own objective.
Meaning A metric learning loss over anchor, positive and negative examples that requires the squared distance from the anchor to the negative to exceed the squared distance from the anchor to the positive by at least a margin, and is zero when this condition holds.
SphereFace: Deep Hypersphere Embedding for Face Recognition
Use Discussed as a Euclidean margin loss that needs triplet mining, which the paper describes as time-consuming and sensitive to performance. The paper also notes that triplet loss causes data expansion, and it appears as a baseline on LFW, YTF and MegaFace.
Meaning A metric learning loss on triplets of samples (anchor, positive, negative) that enforces a Euclidean margin so that the anchor is closer to the positive than to the negative. It is a generic background definition, not one the paper gives.
Deep Learning for Person Re-identification: A Survey and Outlook
Use Discussed in the loss-function review as one of the three main objectives for Re-ID. The review says that easy triplets can dominate training, so informative triplet mining is used, and that online hardest-positive and hardest-negative mining within each batch helps discriminative learning. The AGW baseline instead uses its weighted variant, the WRT loss, which avoids an extra margin parameter.
Meaning A ranking loss over image triplets, each consisting of an anchor, a positive sample with the same identity and a negative sample with a different identity. It penalises the case where the anchor-to-negative distance is not larger than the anchor-to-positive distance by at least a margin.
ArcFace: Additive Angular Margin Loss for Deep Face Recognition
Use Serves as a comparison point for sample-to-sample comparisons, in contrast with the sample-to-class comparisons of ArcFace. In the ablation on CASIA with ResNet50, a Triplet variant with margin 0.35 scores below ArcFace, and combining Triplet with ArcFace gives no clear gain over ArcFace alone. The paper uses the angular form of the triplet margin in its related-work discussion.
Meaning A metric learning loss that uses triplets of an anchor, a positive and a negative sample. It enforces that the anchor is closer to the positive than to the negative by a margin, usually measured as a Euclidean distance. Because the triplets are formed from samples in a mini-batch, its comparisons are local.
Dense Passage Retrieval for Open-Domain Question Answering
Use Tested as an alternative to negative log likelihood for training the dense retriever, where the paper finds it has little effect on the results. Its margin is set to 1 in the comparison.
Meaning A ranking loss that uses a margin to require a positive item to score higher than a negative item for the same query. It compares the positive and negative items directly rather than through a softmax over many candidates.