InsightFace
Implementation of Additive Angular Margin Loss for Deep Face Detection. paper.
@article{deng2018arcface,
title={ArcFace: Additive Angular Margin Loss for Deep Face Recognition},
author={Deng, Jiankang and Guo, Jia and Niannan, Xue and Zafeiriou, Stefanos},
journal={arXiv:1801.07698},
year={2018}
}
DataSet
CASIA WebFace DataSet, 494,414 faces over 10,575 identities.
Dependencies
- PyTorch 1.0.0
Usage
Data wrangling
Extract images, scan them, to get bounding boxes and landmarks:
$ python pre_process.py
Image alignment:
- Face detection(MTCNN).
- Face alignment(similar transformation).
- Central face selection.
- Resize -> 112x112.
Original | Aligned | Original | Aligned |
---|---|---|---|
Train
$ python train.py
To visualize the training process:
$ tensorboard --logdir=runs
Performance evaluation
DataSet
Use Labeled Faces in the Wild (LFW) dataset for performance evaluation:
- 13233 faces
- 5749 identities
- 1680 identities with >=2 photo
Download LFW database put it under data folder:
$ wget http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz $ wget http://vis-www.cs.umass.edu/lfw/pairs.txt $ wget http://vis-www.cs.umass.edu/lfw/people.txt
Get it started
$ python lfw_eval.py
Results
# | image size | network | use-se | loss func | gamma | batch size | weight decay | s | m | LFW accuracy |
---|---|---|---|---|---|---|---|---|---|---|
1 | 112x112 | ResNet-152 | True | ce | na | 128 | 5e-4 | 50 | 0.5 | 99.42% |
2 | 112x112 | ResNet-152 | True | focal | 2.0 | 128 | 5e-4 | 50 | 0.5 | 99.38% |
3 | 112x112 | ResNet-101 | True | focal | 2.0 | 256 | 5e-4 | 50 | 0.5 | 99.27% |
4 | 112x112 | ResNet-101 | False | focal | 2.0 | 256 | 5e-4 | 50 | 0.5 | 99.23% |
θj Distribution
Error analysis
False Positive
8 false positives:
1 | 2 | 1 | 2 |
---|---|---|---|
False Negative
27 false negative, these 10 are randomly chosen:
1 | 2 | 1 | 2 |
---|---|---|---|