Real-time Face Liveness Detection

Important

The face liveness detection can be enabled only on the GPU-accelerated video face detector findface-video-worker-gpu.

To spot fake faces and prevent photo attacks, use the integrated 2D anti-spoofing system that distinguishes a live face from a face image. Due to the analysis of not one, but a number of frames, the algorithm captures any changes in a facial expression and skin texture. This ensures that it is a live person in front of a camera and eliminates the possibility of fraud using images on paper or mobile device screens.

The liveness detector estimates a face liveness with a certain level of confidence and returns the confidence score along with a binary result real/fake, depending on the pre-defined liveness threshold.

To enable the face liveness detector, do the following:

  1. Open the /etc/findface-video-worker-gpu.ini configuration file. In the liveness –> fnk parameter, specify the path to the face liveness detector model as shown below.

    sudo vi /etc/findface-video-worker-gpu.ini
    
    [liveness]
    #------------------------------
    ## path to liveness fnk
    fnk = /usr/share/findface-data/models/faceattr/liveness.v1.gpu.fnk
    
  2. Restart findface-video-worker-gpu.

    sudo systemctl restart findface-video-worker-gpu
    

Once the face liveness detector enabled, the findface-video-worker-gpu service will be posting face liveness data to findface-facerouter in the liveness key of the detectorParams dictionary. To process a face according to its liveness, write a plugin.