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$ – Abhishek Verma Mar 11 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 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$ – Abhishek Verma Mar 12 at 8:09
  • $\begingroup$ Its something with the problem being too hard for the loss or network model $\endgroup$ – Ari K Mar 12 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$ – Abhishek Verma Mar 13 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.