davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.73k stars 4.8k forks source link

How to get confidence range 0.91 to 0.99 #375

Open knvpk opened 7 years ago

knvpk commented 7 years ago

Hi ,

I have seen the wiki Training on own dataset using the frozen model 20170512-110547 provided in the Read me. In the wiki the values of confidence ranges from 0.58 to 0.72 when training is done on 19 classes (identities) and 1202 images and 0.45 to 0.53 when training is done on 10 classes (identities) and 50 images.

I have also done on my own dataset having 5 classes and 27 images the confidence range is like 0.4 to 0.74 all these are done using the SVM classifier

Now my question is

  1. Which classifier I need to use to get better confidence range.
  2. I also tested the KNN classifier but same range like SVM . Is classifier effect the confidence range
  3. Is number of images of a single identity varies the result or not.

Thanks in advance and Thanks to @davidsandberg for his effort.

knvpk commented 7 years ago

I have also seen the OpenFace implementation they are using the SVM, GridSearch and some other all classifier giving the results in range not more than 0.78 (rarely).

davidsandberg commented 7 years ago

I tried training a normal classification layer (using softmax etc) and that gave similar probability scores. My guess is that more data is needed to estimate the distribution of the CNN outputs accurately enough to give higher scores. But that is just a guess.

knvpk commented 7 years ago

I have trying on this and another point noted is when i tried the 2500 images with 950 identities SVM classifier probability is range of 0.0034- 0.0056, but wit the same images when done a KNN classifier it range is 0.3 - 0.74. So I think that SVM is not suitable for more image.

My guess is that more data is needed to estimate the distribution of the CNN outputs accurately enough to give higher scores.

What do you mean by more dataset. Is it more than 5000 images?

knvpk commented 7 years ago

is there any noted points from your side @davidsandberg.

knvpk commented 7 years ago

With dlib what they are doing is calculating the 128D embedding of a image and then checking the Euclidean distance between other images, the distance is less than 0.6 then it is the same face or else it another person's face

but this approach will become difficult if there is more number of faces (identities) since we need to calculate distance for very face

knvpk commented 7 years ago
Scenario:
 Identities: 900
 Images: 2100
 classifier: KNN (with weights=distance, k=5, p=2 and metric=minkowski)

I'm getting the 0.8-1.0 accuracy but for unknown person (new person not trained) also it is getting same confidence. I don't know why

knvpk commented 7 years ago

What if we multiply the embeddings with 100 (any specific number )? @davidsandberg