Back to Insightface

README

recognition/partial_fc/README.md

0.79.2 KB
Original Source

Partial-FC

Partial FC is a distributed deep learning training framework for face recognition. The goal of Partial FC is to facilitate large-scale classification task (e.g. 10 or 100 million identities). It is much faster than the model parallel solution and there is no performance drop.

Paper

Contents

Partial FC

Glint360K

We clean, merge, and release the largest and cleanest face recognition dataset Glint360K, which contains 17091657 images of 360232 individuals. By employing the Patial FC training strategy, baseline models trained on Glint360K can easily achieve state-of-the-art performance. Detailed evaluation results on the large-scale test set (e.g. IFRT, IJB-C and Megaface) are as follows:

1. Evaluation on IFRT

r denotes the sampling rate of negative class centers.

BackboneDatasetAfricanCaucasianIndianAsianALL
R50MS1M-V376.2486.2184.4437.4371.02
R124MS1M-V381.0889.0687.5338.4074.76
R100Glint360k(r=1.0)89.5094.2393.5465.0788.67
R100Glint360k(r=0.1)90.4594.6093.9663.9188.23

2. Evaluation on IJB-C and Megaface

We employ ResNet100 as the backbone and CosFace (m=0.4) as the loss function. TAR@FAR=1e-4 is reported on the IJB-C datasets, and TAR@FAR=1e-6 is reported on the Megaface dataset.

Test DatasetIJB-CMegaface_IdMegaface_Ver
MS1MV296.498.398.6
Glint360k97.399.199.1

3. License

The Glint360K dataset (and the models trained with this dataset) are available for non-commercial research purposes only.

4. Download

  • Baidu Drive (code:o3az)
  • Magnet URI: magnet:?xt=urn:btih:E5F46EE502B9E76DA8CC3A0E4F7C17E4000C7B1E&dn=glint360k

Refer to the following command to unzip.

cat glint360k_* | tar -xzvf -

# Don't forget the last '-'!

# cf7433cbb915ac422230ba33176f4625  glint360k_00
# 589a5ea3ab59f283d2b5dd3242bc027a  glint360k_01
# 8d54fdd5b1e4cd55e1b9a714d76d1075  glint360k_02
# cd7f008579dbed9c5af4d1275915d95e  glint360k_03
# 64666b324911b47334cc824f5f836d4c  glint360k_04
# a318e4d32493dd5be6b94dd48f9943ac  glint360k_05
# c3ae1dcbecea360d2ec2a43a7b6f1d94  glint360k_06
# md5sum:
# 5d9cd9f262ec87a5ca2eac5e703f7cdf train.idx
# 8483be5af6f9906e19f85dee49132f8e train.rec

Use unpack_glint360k.py to unpack.

5. Pretrain models

Frameworkbackbonenegative class centers sample_rateIJBC@e4IFRT@e6
mxnetR1001.097.3-
mxnetR1000.197.3-
pytorchR501.097.0-
pytorchR1001.097.4-

Docker

Make sure you have installed the NVIDIA driver and Docker engine for your Linux distribution Note that you do not need to install the CUDA Toolkit and other independence on the host system, but the NVIDIA driver needs to be installed.
Because the CUDA version used in the image is 10.1, the graphics driver version on the physical machine must be greater than 418.

1. Docker Getting Started

You can use dockerhub or offline docker.tar to get the image of the Partial-fc.

  1. dockerhub
shell
docker pull insightface/partial_fc:v1
  1. offline images
    coming soon!

2. Getting Started

shell
sudo docker run -it -v /train_tmp:/train_tmp --net=host --privileged --gpus 8 --shm-size=1g insightface/partial_fc:v1 /bin/bash

/train_tmp is where you put your training set (if you have enough RAM memory, you can turn it into tmpfs first).

Benchmark

1. Train Glint360K Using MXNET

BackboneGPUFP16BatchSize / itThroughput img / sec
R1008 * Tesla V100-SXM2-32GBFalse641748
R1008 * Tesla V100-SXM2-32GBTrue643357
R1008 * Tesla V100-SXM2-32GBFalse1281847
R1008 * Tesla V100-SXM2-32GBTrue1283867
R508 * Tesla V100-SXM2-32GBFalse642921
R508 * Tesla V100-SXM2-32GBTrue645428
R508 * Tesla V100-SXM2-32GBFalse1283045
R508 * Tesla V100-SXM2-32GBTrue1286112

2. Performance On Million Identities

We neglect the influence of IO. All experiments use mixed-precision training, and the backbone is ResNet50.

1 Million Identities On 8 RTX2080Ti

MethodGPUsBatchSizeMemory/MThroughput img/secW
Model Parallel81024104082390GPU
Partial FC(Ours)8102481002780GPU

10 Million Identities On 64 RTX2080Ti

MethodGPUsBatchSizeMemory/MThroughput img/secW
Model Parallel64204896844483GPU
Partial FC(Ours)644096672212600GPU

FAQ

Glint360K's Face Alignment Settings?

We use a same alignment setting with MS1MV2, code is here.

Why update Glint360K, is there a bug in the previous version?

In the previous version of Glint360K, there is no bug when using softmax training, but there is a bug in triplet training. In the latest Glint360k, this bug has been fixed.

Dataset in Google Drive or Dropbox?

The torrent has been released.

Dataset Contributors

The Glint360K would not have been possible without the invaluable contributions of the following individuals, who have been instrumental in data scraping, downloading, merging, and cleaning. Their efforts have provided the foundation for our work and have been essential to our success:

ContributorEmial
Bin Qin[email protected]
Lan Wu[email protected]

Thank you to all the contributors for their hard work and dedication!

Citation

If you find Partial-FC or Glint360K useful in your research, please consider to cite the following related paper:

@inproceedings{an_2022_pfc_cvpr,
    title={Killing Two Birds with One Stone: Efficient and Robust Training of Face Recognition CNNs by Partial FC},
    author={An, Xiang and Deng, Jiangkang and Guo, Jia and Feng, Ziyong and Zhu, Xuhan and Jing, Yang and Tongliang, Liu},
    booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
    year={2022}
}
@inproceedings{an_2021_pfc_iccvw,
    title={Partial FC: Training 10 Million Identities on a Single Machine},
    author={An, Xiang and Zhu, Xuhan and Gao, Yuan and Xiao, Yang and Zhao, Yongle and Feng, Ziyong and Wu, Lan and Qin, Bin and Zhang, Ming and Zhang, Debing and Fu, Ying},
    booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops},
    year={2021},
}