Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Hard negative examples are hard, but useful

About

Triplet loss is an extremely common approach to distance metric learning. Representations of images from the same class are optimized to be mapped closer together in an embedding space than representations of images from different classes. Much work on triplet losses focuses on selecting the most useful triplets of images to consider, with strategies that select dissimilar examples from the same class or similar examples from different classes. The consensus of previous research is that optimizing with the \textit{hardest} negative examples leads to bad training behavior. That's a problem -- these hardest negatives are literally the cases where the distance metric fails to capture semantic similarity. In this paper, we characterize the space of triplets and derive why hard negatives make triplet loss training fail. We offer a simple fix to the loss function and show that, with this fix, optimizing with hard negative examples becomes feasible. This leads to more generalizable features, and image retrieval results that outperform state of the art for datasets with high intra-class variance.

Hong Xuan, Abby Stylianou, Xiaotong Liu, Robert Pless• 2020

Related benchmarks

TaskDatasetResultRank
Image RetrievalCUB-200-2011 (test)
Recall@157.7
251
Image RetrievalIn-shop Clothes Retrieval Dataset
Recall@190.9
120
Image RetrievalCUB
Recall@157.7
87
In-shop clothes retrievalin-shop clothes retrieval dataset (test)
Recall@190.9
78
Image RetrievalSOP (test)
Recall@181.9
42
Image RetrievalIn-Shop (test)
Recall@190.9
38
Image RetrievalStanford Online Products (SOP) standard (test)
Recall@181.9
27
Image RetrievalCars196 standard (test)
Recall@173.4
23
Image RetrievalCAR
Recall@173.4
20
Image RetrievalCAR
R@173.4
8
Showing 10 of 32 rows

Other info

Code

Follow for update