Why is my siamese network learning very well in e.g. 1 out of every 5 runs? The rest of the time it's not learning and maintains an accuracy of 0.5.

Any explanations? Is the contrastive loss taken in the embedded space to loose of a constraint?

The task is greyscale signature matching.

Additionally, trying the model on facial matching gives a constant 0.5 accuracy, no learning at all - the images are RGB, and maybe it's a higher-order task in general.

Anyways, would appreciate any and all enlightenment in this matter.

P.S. I'm thinking to try a variational autoencoder for the face dataset, where I then use the trained encoder as the siamese network "head".

I would appreciate any guidance or thoughts on this approach as well.

  • $\begingroup$ Are your loss values changing? Check the input, output and loss calculation. Or post some more data here. $\endgroup$ Mar 11, 2021 at 22:54
  • $\begingroup$ My loss is fluctuating but not steadily growing or decreasing - which makes sense because my accuracy is steadily hovering around 0.5 (random) $\endgroup$
    – Ari K
    Mar 12, 2021 at 0:32
  • $\begingroup$ Did you check your pipelines for input and output. Also, if the loss calculation is right? Also, have you set all parameters to trainable? $\endgroup$ Mar 12, 2021 at 8:09
  • $\begingroup$ Its something with the problem being too hard for the loss or network model $\endgroup$
    – Ari K
    Mar 12, 2021 at 18:13
  • $\begingroup$ I think its an implementation mistake or dataset is too easy. I need to see code first. Post it here. $\endgroup$ Mar 13, 2021 at 0:18


You must log in to answer this question.