Skip to content
Advertisement

Regarding the accuracy of the Siamese CNN

JavaScript

and the result of training is as follows

JavaScript

The model is predicting with good accuracy, when i am comparing two dissimilar images. Further it is predicting really good with same class of images. But when I am comparing Image1 with image1 itself, it is predicting that they are similar only with the probability of 0.5. in other case if I compare image1 with image2, then it is predicting correctly with a probability of 0.8.(here image1 and image2 belongs to same class)

when I am comparing individual images, it is predicting correctly, I have tried different alternatives did not workout. May I know what might be the error?

Advertisement

Answer

The L1 distance between two equal vectors is always zero.

When you pass the same image, the encodings generated are equal (encoded_l is equal to encoded_r). Hence, the input to your final sigmoid layer is a zero vector.

And, sigmoid(0) = 0.5.

enter image description here

This is the reason providing identical inputs to your model gives 0.5 as the output.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement