Liveness

While being able to identify a person by performing a search on an image is great, it is not always sufficient as someone could simply use a printed picture of a person to fool the system.

In use cases such as Access Control, Know Your Customer, Customer Onboarding, we also need to check if the image provided to the system is live, i.e. is an actual live person, and not a paper/screen showing their photo.

To facilitate this, we have the liveness API.

Liveness image requirement:

  • There should only be one main face on the image. It should be fully visible within a frame and fully open without any occlusions. No crop is allowed. Small faces in the background are not taken into account.

  • The minimum size of a face box that can be processed is 224x224 pixels.

  • The padding between the face box and the image's borders should be at least 25 pixels.

  • The distance between the pupils on the face should be at least 80 pixels.

  • The out-of-plane rotation angle (face pitch and yaw) should be no more than ±30 degrees.

  • Fish-eye lenses and sunglass images are not supported.

As usual, we start by creating a request:

std::string image_path { “C:\\images\\varun.jpg” };
LivenessRequest liveness_request{ OS::DESKTOP,image_path };

And then we get the response:

LivenessResponse liveness_response = sdk.liveness.check_liveness(liveness_request);
cout<< liveness_response.score;

The image passed in the request should be a high quality image, sufficiently close to the camera.

The returned score represents how confident the system is that this is a real image vs a printed/screen one.