Used Keras from Tensorflow to Fine-tune ResNet50 to create an embedding space where photos of the same person are placed close together and photos of 2 different people are placed far apart. Once this model is trained it can be used as a face recognition model by measuring the distance between an unknown identity's photo and a database of known identities in the embedding space. Once you find a known identity that has a distance below some margin (margin value set at training time) with the unknown identity's photo you can link these 2 photos as pertaining to the same identity. This type of model is also known as a Siamese model. Used triplet loss function and Adam optimizer during training. Trained using Labeled Face in the Wild dataset.
The benefit of using Siamese model over a Simple Classifier Model is that for a classifier model if you want to add a new class/identity for the model to recognize you have to retrain the entire model every time you add a class. However with a Siamese model there is no need to retrain you model because the model does not detect classes but rather similarity.
Used OpenCV face detector model to crop faces prior to training.
Positive column consist of the same person as the anchor column. Whereas negative column consists of a different person.
Results after training for 10 epochs: (You want positive distance to be low and negative distance to be high)
As you can see with rows 5-7 the lighting of the photo seemed to have caused some issues. So I retrained my model but this time greyscaled all the images prior to training.
Results after 10 Epochs:
This change provided better results, not perfect but still impressive for 10 epochs of training and considering that the model did not see any photos of these people during training, still it is able to accurately detect similarity and differences between them.