FaceAntiSpoofing : A Machine Learning Model to Determine If a Face is Real

David Cochard
axinc-ai
Published in
2 min readFeb 3, 2022

This is an introduction to「FaceAntiSpoofing」, a machine learning model that can be used with ailia SDK. You can easily use this model to create AI applications using ailia SDK as well as many other ready-to-use ailia MODELS.

Overview

FaceAntiSpoofing is a machine learning model that determines whether a face in a picture is real (an actual person being photographed) or fake (printed on a sheet of paper). It can be used for identity verification (Know Your Customer, or KYC for short) and other purposes.

Source: https://github.com/kprokofi/light-weight-face-anti-spoofing

Architecture

FaceAntiSpoofing is based on MobileNetV3 and was trained on the CelebA-Spoof dataset.

Source: https://github.com/Davidzhangyuanhan/CelebA-Spoof

CelebA-Spoof contains images of faces printed on paper or displayed on a PC, tablet, or cell phone.

Source: https://github.com/Davidzhangyuanhan/CelebA-Spoof

It also contains variants of the same picture under different angles and shapes.

Source: https://github.com/Davidzhangyuanhan/CelebA-Spoof

The accuracy of the MobileNet3 Large model reaches 99.8% on the CelebA-Spoof dataset.

Source: https://github.com/kprokofi/light-weight-face-anti-spoofing

Usage

FaceAntiSpoofing can be used with ailia SDK using the following command. By appending the --detection option, the faces are detected in the input image and labelled as real or fake.

$ python3 face-anti-spoofing.py --input input.jpg --detection

ax Inc. has developed ailia SDK, which enables cross-platform, GPU-based rapid inference.

ax Inc. provides a wide range of services from consulting and model creation, to the development of AI-based applications and SDKs. Feel free to contact us for any inquiry.

--

--

David Cochard
axinc-ai

Engineer with 10+ years in game engines & multiplayer backend development. Now focused on machine learning, computer vision, graphics and AR