Facial Recognition Tutorial

I have written up a tutorial about using Siamese Networks for facial similarity learning. It is in a similar in style to Jeremy’s notebooks, and (hopefully) easy to understand.


I am working on a similar problem statement. I am trying to find similarity between images of newts(a type of amphibian). Given images to two newts, the output should tell whether the images have same Newt or different Newt. Do you think this is in line with this work??

If you could please help me with this.
Thank you!

1 Like

If the number of classes is very high/unstable , you can try siamese networks , it should work. There are more accurate versions of it too, that rank items using a triplet loss.

Thanks for the reply. Yeah, I have read some papers using triplet images. But then, it was also mentioned that the networks are sensitive to the training triplets (i.e. training dataset), I don’t have the data set in form of triplets as of now. Just a question, do these networks have specific architecture for faces or I can use other types of images too??

I have set up the tutorial in a way that any images,not just faces , can be used. There are two blog posts, and the code itself in GitHub.
If you just want to play with my code , just put each class of the newt in it’s own folder


Interesting project. It would be interesting to see how well it’s doing in terms of accuracy compared to openface http://cmusatyalab.github.io/openface/models-and-accuracies/

Also, if I recall correctly the Facenet paper from Google mentions that selecting hard triplets is crucial to improve the model. It would make sense that your approach also suffers from that (in order to improve the model, extra attention should be put into selecting pairs of images that are hard to differentiate).

1 Like

@marcemile: I worked using openface. It does decent face recognition. But the issue with it is it affected by lighting condition. I also found installation very troublesome.

1 Like


Your demonstration on face recognition is really interesting. I just wanted to know how it works in reality. What I mean is that during the training and validating process, the Siamese network often calculates loss and accuracy values based on batch size. So, even if the generalised model can achieve a good result, the application in reality will be different because we have to match an image against hundreds or thousands of images, not just some images within the scope of batch size. Do you have any idea about this concern?