arsfutura / face-recognition

A framework for creating and using a Face Recognition system.
BSD 3-Clause "New" or "Revised" License
146 stars 49 forks source link

Feature extractor storing OR getting trained from multiple images of same class ? #8

Closed balajib363 closed 4 years ago

balajib363 commented 4 years ago

Nice Work!! When I was running your project, I am curious to understand one part here. For person1 when we have multiple images, we extract features from each image and finally, we will store the trained feature or we will store all the features for future prediction of model???

ldulcic commented 4 years ago

Hi @BalajiB197! I'm not sure what do you mean by "trained features", maybe weights of classifier? In this project, we extract features for each image of each person, then we train Softmax classifier based on these features. We don't store any extracted features for future prediction, we just train classifier with them, only thing that's stored at the end are the weights of Softmax classifier. Does this answer your question?

balajib363 commented 4 years ago

Hello @ldulcic I am referring to this issue, here we are not training the data but we extract 128d features and we do face comparison by storing in DB. The above approach works well, but there is an issue when we test with the same image which we used for extracting the feature by little zoomin/ zoomout the Euclidean distance value is very high. It will be helpful if you can suggest any better approach. Thanks

ldulcic commented 4 years ago

Hi @BalajiB197, sorry for the late response. I've read the issue you linked, people there claim to get good performance by storing vectors in DB and doing comparison. I haven't tried that approach, but I think training a classifier on top of embedding vectors gives you faster inference, especially if you have very big dataset. On the other hand, classifier is not so easy to train and you have to retrain it every time you add new data to dataset. You should try both approaches and see what works best for you. I'll upgrade code in this repo for automatic classifier training sometimes soon, this may help you to build faster face recognition system.

balajib363 commented 4 years ago

@ldulcic Thanks for your suggestions sure will give a try. Training classifier is a good approach but when we have millions of classes/individual faces its not a good idea to just to find one face among those thousand classes.

ldulcic commented 4 years ago

@BalajiB197 I'm not sure I understand, but classification is not "taking one face among thousands". There are various types of classifiers, I was referring to softmax classifier which is used in this project, this classifier basically learns boundaries between classes which gives you much faster inference.