Android Face-Recognition application using OpenCV for face detection and MobileFacenet for face verification
Face verification is an important identity authentication technology used in more and more mobile and embedded applications such as device unlock, application login,
mobile payment and so on. Some mobile applications equipped with face verification technology, for example, smartphone unlock, need to run offline.
To achieve userfriendliness with limited computation resources, the face verification models deployed locally on mobile devices are expected to be not only accurate but also small and fast.
However, modern high-accuracy face verification models are built upon deep and big convolutional neural networks (CNNs) which are supervised by novel loss functions during training stage.
The big CNN models requiring high computational resources are not suitable for many mobile and embedded applications.
MobileFaceNets is a class of extremely efficient CNN models tailored for high-accuracy real-time face verification on mobile and embedded devices.
Performance comparison with previous published face verification models on LFW Dataset shown in the table below:
As we can see, MobileFacenet is very small in size but has very high accuracy
- Download and add OpenCV to the android project (you can see this tutorial to add OpenCV library to your android project)
- Download pre-trained MobileFacenet from sirius-ai/MobileFaceNet_TF, convert the model to tflite using the following notebook and put it in android assets folder
How is the result? Is it fast enough to run on a mobile device?
[1] MobileFaceNets: Efficient CNNs for Accurate Real-time Face Verification on Mobile Devices
[2] sirius-ai/MobileFaceNet_TF