Cosine similarity too small in Facial Recognition application

Hi all, I’m new to Tensorflow and I’m trying to develop a simple Facial Recognition application.

I have an image of myself to take features from my face and then with another similar image I try to identify myself. I am using the InceptionResnetV2 model from TensorFlow Hub. The problem is that after taking the features of the test image, I compare them with the features of the previous image using cosine of similarity and I get a very small value (close to 0) being the first image and the test image very similar, as you can see in the “Images” and “Test” directories of my Github repository. Furthermore, which is the typical threshold value to recognize someone?

I have the code and the images in the next GitHub repository: GitHub - andergalvan/Facial_Recognition

First I execute image_features.ipynb file to take features and then, facial_recognition.ipynb file to make predictions.

If someone could help me, I would appreciate it a lot.


Welcome to the Tensorflow Forum!

We can’t have access to shared repository to understand the process. Are you training with features extracted from the InceptionResnetV2 ?

I think the features do not make any sense unless we use them and train on the faces since the features correspond to the imagenet classes.

Thank you!