HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Hard negative examples are hard, but useful

Hong Xuan Abby Stylianou Xiaotong Liu Robert Pless

Hard negative examples are hard, but useful

Abstract

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.

Code Repositories

littleredxh/HardNegative
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
metric-learning-on-cars196SCT(64)
R@1: 73.2
metric-learning-on-cub-200-2011SCT(64)
R@1: 57.7
metric-learning-on-in-shop-1SCT(512)
R@1: 90
metric-learning-on-stanford-online-products-1SCT(512)
R@1: 81.6

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Hard negative examples are hard, but useful | Papers | HyperAI