davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.83k stars 4.81k forks source link

Pre-trained models (20170512-110547) VS Pre-trained models (20180402-114759) #948

Open tensorflowt opened 5 years ago

tensorflowt commented 5 years ago

Hello, David! First of all, thank you very much for sharing the pre-training model, which is very helpful to my learning.I just tested your new version of pre-training model (20180402-114759), but to my surprise, the effect is very poor. It doesn't work as well as the older version (20170512-110547).Can you help me? Thanks!

yuwgle commented 5 years ago

I also want to know the difference between these two models

NightFury10497 commented 5 years ago

@tensorflowt @yuwgle Can you share the drive link to the pre trained model?

SthPhoenix commented 5 years ago

Hello! Also noticed great accuracy drop with 20180402-114759 model. My use case is as follows:

  1. I have a DB of 100k persons, 1 image per person.
  2. I index faces embeddings using LSH to search engine (LSH recall is near 1.0)
  3. I acquire 1000 approximate candidates using LSH and than perform sorting using Euclidean or Cosine distance. (my basic implementation uses Euclidean, but I have tried Cosine for 20180402-114759 model)
  4. Out of 1000 sorted candidates TOP 100 returned to user.

And I got the following results:

  1. Using dlib embeddings true positive is usually in TOP-3 hits using query images with adequate resolution and lighting conditions.
  2. Using FaceNet with 20170512-110547 model I get true positives in TOP-3 for a bit harder images and in TOP-10 for images of same person wearing glasses, beard, and in harder lighting.
  3. Using FaceNet with 20180402-114759 model I get true positives in TOP-3 ONLY for query images in same lighting conditions, similar poses and obscuring factors (i.e. if in indexed image person was wearing glasses true positive will be in TOP-3 only if on query image person also wears glasses). In some cases true positive occurs below TOP-100 for images containing faces in same poses, same age, same resolution but in different white balance and background.

It seems to me that 512D embeddings contains some less informative features, which are neglected, and even help if you use SVM for face verification, but adds a lot of 'noise' if you try to compute cosine/euclidean distance between two embeddings.

yuwgle commented 5 years ago

@NightFury10497 I just download the pretrained model in README.md. Which is : https://drive.google.com/open?id=1EXPBSXwTaqrSC0OhUdXNmKSh9qJUQ55-

chenyuqing commented 5 years ago

@yuwgle @tensorflowt Older version is 128 dimensional face embedding, and the new one is 512 dimensional face embedding. That's what I think these days.

zhenglilei commented 5 years ago

Hello, David! First of all, thank you very much for sharing the pre-training model, which is very helpful to my learning.I just tested your new version of pre-training model (20180402-114759), but to my surprise, the effect is very poor. It doesn't work as well as the older version (20170512-110547).Can you help me? Thanks!

@yuwgle @tensorflowt @chenyuqing The most important change is using FIXED_STANDARDIZATION instead of PER_IMAGE_STANDARDIZATION. The former was used in training the 20180402-114759 model so that if the wrong standardization is used, the model accuracy drops significantly. Here is the comparison table at the end of the page: https://github.com/davidsandberg/facenet/wiki/Training-using-the-VGGFace2-dataset

The FIXED_STANDARDIZATION is very simple as below, one can see facenet.create_input_pipeline() for details: img = (np.float32(img) - 127.5) / 128.0

pango99 commented 5 years ago

20180402-114759 is for SVM embedding compare,20170512-110547 is for Euclidean/Cosine distance embedding compare, is it?

SE2AI commented 4 years ago

model of 2017 mainly trained on CASIA-webface, while model of 2018 trained both on CASIA and vggface?