Questions tagged [siamese]

11 questions
6
votes
2 answers

How to set up a DL classification model so that it selects from an ever changing menu

The question is edited for clarity after tchainzzz's comments about meta-learning. Let's say we have 10,000 pet pictures and 10,000 kids. Each kid is presented with 10 randomly picked pet pictures at a time. Each time, they have to pick the one…
2
votes
1 answer

What is meant by siamese network: train one network for each class or one network for all classes (example of training face recognition)

In siamese networks, the aim is to make closer the data from the same class and push far away the data coming from the different classes. Suppose that we want a face identification system with 5 peoples face images (3 for each people) (P1, P2, ...,…
Mas A
  • 175
  • 9
2
votes
0 answers

About the calculation of covariance matrix in mahalanobis distance: How $W^TW$ is equal to the covariance matrix?

I was reading about deep metric learning (from here) and came across the mahalanobis distance. I understood why we can not use euclidean distance if the distribution is not isotropic (the covariance between dimensions of our data is not 0, so they…
2
votes
2 answers

Understand the idea of margin in contrastive loss for siamese networks

I was studying siamese networks for authentication. Loss is: Y is 0 for dissimilar pairs and 1 for similar pairs. D_w is the distance (e.g. euclidean distance) between two pairs (by using weights w). If pairs are similar, then loss is equal to the…
Mas A
  • 175
  • 9
2
votes
1 answer

why contrastive loss for siamese network

For a siamese network, contrastive loss is typically used. $$ L = y \cdot d(x_0, x_1) + (1-y)\max(0, m - d(x_0, x_1)) $$ That is, it tries to reduce the distance for the positive examples and increase it for negative examples upto the margin, m. Is…
DSKim
  • 1,109
  • 2
  • 11
  • 15
1
vote
0 answers

Training in steps has any importance?

I'm trying to train a Siamese network for face Verification and eventually I came across the Contrastive Loss method for embedding vector distancing (kinda... I guess...). At the end, the model needs to yield '1' if two images has the same person in…
0
votes
0 answers

Can siamese model trained with euclidean distance as distance metric use cosine similarity during inference?

If I have 3 embeddings Anchor, Positive, Negative from a Siamese model trained with Euclidean distance as distance metric for triplet loss. During inference can cosine similarity similarity be used? I have noticed if I calculate Euclidean distance…
0
votes
0 answers

How to train a Siamese Net with convolutional + fully connected layers

I am trying to implement a Siamese net for binary classification of audio based on a paper. Below is a summary of the information the authors provided about the model architecture. This model generates embeddings using a Siamese network (SNN)…
0
votes
0 answers

Validation Loss gets better after adding Augmentation Layers but Test accuracy gets worse

I'm building a Siamese Network which should learn a face comparison function. My model consists a CNN (which gets 2 inputs, and yields 2 embedding vectors). With the outputs I calculate: tf.math.abs(embed[1] - embed[0]) and feed the result to a…
0
votes
0 answers

NN's Accuracy binds for some reason with the label's probability

I'm working on a project of face comparing using Siamese neural network architecture. For research purpuoses I'm using the LFW, CFPLFW (Front Profile) and CALFW (Cross Age) datasets. btw, is there any way of working with those datasets and utilizing…
-1
votes
1 answer

How to use siamese network in binary classification - inference mode

Siamese network consists of two identical networks. Networks share the same weights. The general workflow is as follows (taken from here): Suppose that I have 10 images of apples, 10 images of bananas, 10 images of strawberries, and 3 of oranges. I…
Mas A
  • 175
  • 9