facenet icon indicating copy to clipboard operation
facenet copied to clipboard

A new model trained on VGGFace2

Open Shahnawazgrewal opened this issue 6 years ago • 65 comments

I trained a model on VGGFace2 using center loss. The embedding is powerful than the subset of MS-Celeb. I can make the model public with the two available mode. @davidsandberg

Shahnawazgrewal avatar Jan 22 '18 09:01 Shahnawazgrewal

@Shahnawazgrewal can you please share with us how you've trained the checkpoint? and can you also share with us the checkpoint?

Zumbalamambo avatar Jan 22 '18 16:01 Zumbalamambo

I trained with VGGFace2 as well, the model is not as good as MS Cele. Although the accuracy might be equal or better than MS, the TPR at 0.001 FPR is much lower (98.X compared to 99.X)

I eventually combined this two datasets and reached 99.73% accuracy and 99.63% TPR w/ 0.001 FPR.

JianbangZ avatar Jan 23 '18 01:01 JianbangZ

@Shahnawazgrewal could U please kindly share with us how do U train the VGGFace2 model? When we try to train the data, we always got error as below. Thanks! OutOfRangeError (see above for traceback): FIFOQueue '_1_batch_join/fifo_queue' is closed and has insufficient elements (requested 9, current size 0) [[Node: batch_join = QueueDequeueUpToV2[component_types=[DT_FLOAT, DT_INT64], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](batch_join/fifo_queue, _arg_batch_size_0_0)]]

syy6 avatar Jan 23 '18 05:01 syy6

@Shahnawazgrewal For sure, if U can share your model via Google Drive and etc., that is also much appreciated. Thanks!

syy6 avatar Jan 23 '18 06:01 syy6

@Shahnawazgrewal I add center loss to caffe, I met the error "math_functions.cu:155] Check failed: error == cudaSuccess (11 vs. 0) invalid argument" when I train,have you met this problem or you know how to fix it? thx

Dantju avatar Jan 23 '18 08:01 Dantju

can you please decrease maximum number of epochs. Please read issue #105 I have similar error for MS-Celeb-1M dataset. @syy6

Shahnawazgrewal avatar Jan 23 '18 09:01 Shahnawazgrewal

For sure, I will share the model with you guys. @syy6

Shahnawazgrewal avatar Jan 23 '18 09:01 Shahnawazgrewal

Did you train on a subset of MS-Celeb-1M. @JianbangZ

Shahnawazgrewal avatar Jan 23 '18 10:01 Shahnawazgrewal

@Shahnawazgrewal my subset of MS-Celeb-1M is 70k identities, 4.5 million images. I can achieve 99.5% accuracy and 99.3% TPR with it

JianbangZ avatar Jan 23 '18 15:01 JianbangZ

@Shahnawazgrewal , actually I even tried to reduce the number of epochs, but the issue still exists......

syy6 avatar Jan 24 '18 08:01 syy6

@Shahnawazgrewal it would be very nice if you could share the hyperparameters you used in training. I've recently tried to use the VGGFace2 to train by triplet loss but with no luck. The LFW accuracy and validation rate just levelled off at around 0.96 and 0.7.

yipsang avatar Jan 27 '18 08:01 yipsang

@syy6 Did you check this out before? #600

yipsang avatar Jan 28 '18 03:01 yipsang

@yipsang @Shahnawazgrewal , I just find the issue, one of the input png is broken in my computer, so I got this error. After removing the png, it seems to be fine now.

syy6 avatar Jan 28 '18 07:01 syy6

@JianbangZ, could U please share with us how U take the duplicate between MS & VGG2 dataset? If U look at the namelist of two datasets, certain names are duplicate in both dataset.

syy6 avatar Jan 30 '18 12:01 syy6

@Shahnawazgrewal Dude... where have you uploaded your model?

Zumbalamambo avatar Feb 06 '18 10:02 Zumbalamambo

Here is the link to download a pre-trained model trained with inception-ResNet-v1 with center loss function on VGGFace2 dataset. Please give your general feedback.

Shahnawazgrewal avatar Feb 06 '18 11:02 Shahnawazgrewal

@Shahnawazgrewal , Did you perform the pre-training on MS-Celeb-1M and then fine-tune on VGGFace2 dataset?

Yeongjae avatar Feb 07 '18 11:02 Yeongjae

No. I didn't I trained with inception-ResNet-v1 with center loss function on VGGFace2 dataset from scratch. More specifically I downloaded loosely cropped faces dataset from the VG-GFace2 (http://www.robots.ox.ac.uk/~vgg/data/vgg_face2/ . The dataset is aligned with 160×160 image size and 32 pixels margin based on Multi-task CNN. I trained the model on aligned dataset for 100 epochs with an RMSProp optimizer. @Yeongjae

Shahnawazgrewal avatar Feb 07 '18 12:02 Shahnawazgrewal

@Shahnawazgrewal could you make proper comments for checkpoint files which has been uploaded in dropbox!

RaviRaaja avatar Feb 18 '18 18:02 RaviRaaja

@Shahnawazgrewal based on our evaluation, your model is truly powerful than both provided pretrain-model. I wonder the reason behind this wonderful improvement? Is the dataset used for training the root cause?

P.S. Thank your for uploading this wonderful pretrained checkpoint

tenggyut avatar Mar 02 '18 09:03 tenggyut

@tenggyut , VGGFace2 dataset is considered to be a deep dataset (higher number of image per identity). In my opinion, this could be the reason. In addition, I observed that the model trained on VGGFace2 produced better representation of previously unseen faces.

Shahnawazgrewal avatar Mar 02 '18 09:03 Shahnawazgrewal

@Shahnawazgrewal did you train the model as a classifier or using triple loss?

tenggyut avatar Mar 02 '18 09:03 tenggyut

I trained the model based on center loss. @tenggyut

Shahnawazgrewal avatar Mar 02 '18 10:03 Shahnawazgrewal

@Shahnawazgrewal
I have few questions about your implement detail:

  1. Do you do 2D alignment or just crop 160x160 bounding box after MTCNN.
  2. How is the learning rate you use in RMSProp? Do you decrease learning rate? Thanks for your sharing!

ymcasky avatar Mar 08 '18 01:03 ymcasky

  1. just crop 160x160 bounding box after MTCNN.
  2. I used default settings available.

Shahnawazgrewal avatar Mar 13 '18 16:03 Shahnawazgrewal

Did you train the model with softmax loss combined with center loss? or you just train it with center loss?

DawnHH avatar Mar 19 '18 12:03 DawnHH

combined.

Shahnawazgrewal avatar Mar 24 '18 13:03 Shahnawazgrewal

Validation on LFW dataset with the model trained on VGGFace2 Runnning forward pass on LFW images Model directory: /home/super/datasets/lfw/vggface2-cl Metagraph file: model-20171216-232945.meta Checkpoint file: model-20171216-232945.ckpt-100000 Runnning forward pass on LFW images Accuracy: 0.992+-0.004 Validation rate: 0.96000+-0.01880 @ FAR=0.00067 Area Under Curve (AUC): 0.999 Equal Error Rate (EER): 0.008

Shahnawazgrewal avatar Mar 24 '18 13:03 Shahnawazgrewal

I trained with cosine Face algorithms . accuracy is 0.995, validation rate = 0.985

JianbangZ avatar Mar 24 '18 17:03 JianbangZ

@JianbangZ what do you mean cosine face algorithms? did you replace the L2 norm in center loss with cosine similarity? Or you mean the paper the author released last year, SphereFace?

helloyide avatar Mar 24 '18 17:03 helloyide