Siamese netwroks - how to choose loss function?

I have read several articles about siamese netwroks, and I understand that there are 3 different types of loss functions:

  1. Contrastive Loss - Takes 2 inputs (from same or different classes)
  2. Triplet Loss - Takes 3 inputs (Anchor, Positive, Negative).
  3. Quadruplet Loss - Takes 4 inputs (Anchor, Positive, Negative1, Negative3).
  • I didn't found any description about which loss function to use in each scenario ?
  • How do I which loss function (Contrastive/Triplet/Quadruplet) to choose in the case I'm working on ?
  • Are there any guidelines ?

Example:

  • I have a bag of images (dataset of faces or dataset of cars) and I want to be able to get new image as input and show it's similar images (same person face or same car).
  • I can use any of the 3 losses, but what will be the best to choose ?

Topic siamese-networks data-science-model loss-function deep-learning neural-network

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.