Skip to content

foamliu/InsightFace

Repository files navigation

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:

  1. Face detection(MTCNN).
  2. Face alignment(similar transformation).
  3. Central face selection.
  4. Resize -> 112x112.
Original Aligned Original Aligned
image image image image
image image image image
image image image image
image image image image
image image image image

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

Backbones LFW(%)
SE-LResNet152E-IR 99.43%
SE-LResNet152E-IR 99.38%
SE-LResNet101E-IR 99.27%
LResNet101E-IR 99.23%

theta j Distribution

image

Error analysis

False Positive

6 false positives:

1 2 1 2
image image image image
image image image image
image image image image
False Negative

28 false negative, these 10 are randomly chosen:

1 2 1 2
image image image image
image image image image
image image image image
image image image image
image image image image

Releases

No releases published

Packages

No packages published

Languages