FaceVerificationAndroid icon indicating copy to clipboard operation
FaceVerificationAndroid copied to clipboard

Face verification with mxnet on android

Face Verification on Android

Face verification with mxnet on android

Face Detection

OpenCV has an in-built Viola-Jones face detector which is used here to detect faces.

Face Verification

I use pre-trained LightenedCNN as feature extractor.

arch

For more information please read the original paper

https://arxiv.org/abs/1511.02683

My notes about this paper: Lightened CNN

The similarity metric is cosine similarity. The threshold should be about 0.5 ,and it should be adjusted according to specific applications.

Face Alignment

I use VanillaCNN to detect facial landmarks. This step is crucial for high accuracy.

The paper can be found below

http://www.openu.ac.il/home/hassner/projects/tcnn_landmarks/

My notes about this paper: VanillaCNN

The original implementation is based on Caffe, and I have turned it into MXNet model.You can get more details from below:

https://github.com/flyingzhao/mxnet_VanillaCNN

The face is aligned by three landmarks including two inter-ocular points and one mid-mouth point. Affine transformation is applied with these three points.

MXNet

MXNet is a great deep learning framework and can be used on Android efficiently and flexibly.

I have compiled mxnet for android with ndk-r13b. You can also refer to my blog for more details.

http://blog.csdn.net/tinyzhao/article/details/53288102

You can also download compiled libmxnet_predict.so here

Result

I test on my Xiaomi 4C (Snapdragon 808) and I get about 1.5s per image.