EasyDeepLearn

What is triplet loss and its main challenge?

hard

Answer

  • L(a, p, n) = max(d(a, p) - d(a, n) + margin, 0), where a=anchor, p=positive, n=negative.
  • Wants the anchor closer to positives than to negatives by at least the margin.
  • Main challenge: 'triplet mining' — most random triplets are easy (already satisfied), so you must actively sample semi-hard / hard triplets to keep training progressing.
  • Standard in face recognition (FaceNet).
  • Superseded in most tasks by info-NCE / softmax-based losses.
Check yourself — multiple choice
  • Uses two examples
  • Anchor + positive + negative; hard-triplet mining is the practical challenge; used in face recognition
  • Only two negatives
  • No margin needed

Triplet: d(a,p) < d(a,n) - margin; hard mining is key.

#losses#contrastive

Practise Deep Learning

214 interview questions in this topic.

Related questions