Home

Awesome

Using MXNet for Face-related Algorithm


About

Using mxnet for face-related algorithm, here now only provide :

Before runing

cd model
./get-models.sh

Face Detection

we provide the pre-trained model mxnet-face-fr50-0000.params on baiduyun or dropbox, which is trained with resnet-50+faser-rcnn for 7 epoch on wider-face[4] dataset, our mxnet-face-fr50's performance on fddb is:
mxnet-face-fr50-roc.png

you can also find the result on fddb official website
the training code is come from my anohter repo : train_widerface.py

the way of using mxnet-face-fr50 for face detection is very easy:

BTW, the detection speed is slow, only about 3~4 image/second on k80 GPU.

Face Identification

How to test

run ./test.sh in shell.
This script will run the evaluation on lfw using trained model, the model needs 128x128 image size for input, you can using your own aligned lfw data, we also offered the aligin-lfw dataset, passward : mg2i.
before runing, you should change your own align_data_path in test.sh. the model

How to train

run ./run.sh in shell.
This script will train the lightened cnn face model, using CASIA-WebFace dataset, more accurately, i used the cleaned version.
Again, you should change with your own setting in run.sh, and using your own hyper-parameter when training the model.

Implemented details
How to improve accuracy on LFW?

Face Attribute Prediction

How to prediction

cd attribut
then put the image you want to predict with name aaa.jpg and run in shell:
python -u predict.py --img aaa.jpg the example output will like this:
example_out.png


How to test

run ./test.sh in shell. this script will run the evaluation on CelebA dataset, the dataset is used for face attribute prediction, and each face image will have 40 binary attributes(labels), so we should using our model to predict the attribute of the test images in CelebA.

How to train

run ./run.sh in shell.
This script will train the lightened moon face model, using CelebA train and val dataset, we use the original image set, not the aligned set. so we should first using opencv and dlib to do face detection, enlarge the face area and then cropped it, we finally training the model using the cropped image.

Implemented details
How to improve accuracy on CelebA?

Reference

[1] Wu X, He R, Sun Z. A Lightened CNN for Deep Face Representation[J]. arXiv preprint arXiv:1511.02683, 2015.
[2] Rudd E, Günther M, Boult T. MOON: A Mixed Objective Optimization Network for the Recognition of Facial Attributes[J]. arXiv preprint arXiv:1603.07027, 2016.
[3] Jiang H, Learned-Miller E. Face detection with the faster R-CNN[J]. arXiv preprint arXiv:1606.03473, 2016. [4] Yang S, Luo P, Loy C C, et al. WIDER FACE: A Face Detection Benchmark[J]. arXiv preprint arXiv:1511.06523, 2015.