deepinsight / insightface

State-of-the-art 2D and 3D Face Analysis Project
https://insightface.ai
22.76k stars 5.34k forks source link

Train ArcFace on VGGFace2 dataset #1146

Open ThanosRoidis opened 4 years ago

ThanosRoidis commented 4 years ago

I am trying to train a ResNet-34 on the VGGFace2 dataset using ArcFace loss (custom Keras implementation), but I can not get better results than regular Softmax Cross-Entropy loss.

In the published ArcFace paper, on Table 7, you report the results of a (VGG2, R50, ArcFace) model which I am trying to replicate, but you do not specify anywhere the paper the training arguments / hyperparameters when training on VGG2, other than m=0.3, and I can not find them anywhere in this repo.

Can anyone please tell me where can I find them (learning rate, steps, dropout, preprocessing, etc)

nttstar commented 4 years ago

For vgg2, just set m=.3 and lr drops at 40K, 60K, 80K iterations.

ThanosRoidis commented 4 years ago

@nttstar Starting at 0.1 and then divided by 10 with a batch size of 512 (momentum 0.9) as noted in the paper for the other datasets?

Also, the input is 112x112 (mtcnn aligned) and the embedding size 512, or 224x224 and 2048 as in the vgg2 paper?

nttstar commented 4 years ago

These are our base settings: batchsize: 512 ; 112x112 aligned; emb-size 512.

ThanosRoidis commented 4 years ago

Final question, on what iteration do you stop training?

jacksoncsy commented 4 years ago

Dear both, I have the same question, when do you stop training? at which epoch/iteration? Many thanks!

nttstar commented 4 years ago

@jacksoncsy Anytime after 80K iters.

jacksoncsy commented 4 years ago

Thanks Jia! May I further ask you how to convert your iterations to epochs? For example, in the setting of 8x GPUs, batch size 128 per GPU, 3m VGGFace2 images, 80K iters equals to how many epochs? Many thanks!

nttstar commented 4 years ago

I haven't trained vgg2 for quite a while. The total batch-size is 512 and you can easily estimate the epoch numbers.

jacksoncsy commented 4 years ago

Thanks, I see! So essentially, not many epochs for vggface2 then.