AI Models

This SDK makes extensive use of AI models, particularly for detection, analysis and facial recognition tasks. Wherever possible, one model is used for several tasks, as in the case of the face attributes classifier model, which detects glasses, hats, make-up, mouth opening, smiles and gender. But as a general rule, an AI model is dedicated to a single task.

The following models are available:

Model Name

Description

EyeGazeEstimator2A

Estimates the direction of gaze.

EyeOpennessDetector1A

Detects the degree of eye opening.

EyeRednessDetector1A

Detects red-eye.

FaceAgeEstimator1A

Estimates the subject’s age.

FaceAttackSupportDetector3A

Detects presentation attacks that use media such as screen, print, or ID card.

FaceAttributesClassifier2A

Detects facial attributes such as glasses, hat, make-up, mouth opening, smile and gender of the subject.

FaceBackgroundUniformityEstimator1A

Estimates color and structure uniformity of the background.

FaceBlurinessDetector1A

Detects presentation attacks that tend to create blurry images.

FaceColorBasedPad2A

Detects presentation attacks using a color-based method.

FaceDepthPad2A

Detects presentation attacks using depth-based method.

FaceDetector3A

Face detector version 3A.
Obsolete Replaced by version 4A.

FaceDetector3B

Face detector version 3B.
Obsolete, Replaced by version 4B.

FaceDetector3C

Face detector version 3C. Ultra-light detector, dedicated to short-range real-time detection/tracking applications only.

FaceDetector4A

Face detector version 4A. Highest accuracy detector in this SDK, mainly for server-based or offline applications.

FaceDetector4B

Face detector version 4B. Light and accurate detector, mainly for mobile/embedded real-time detection/tracking applications.

FaceEncoder8A

Face encoder version 8A.
Legacy model Use version 9A whenever possible.

FaceEncoder8B

Face encoder version 8B.
Legacy model Use version 9B whenever possible.

FaceEncoder9A

Face encoder version version 9A. Highest accuracy face encoder in this SDK, mainly for server-based 1:N applications.

FaceEncoder9B

Face encoder version 9B. Light and accurate face encoder, mainly for mobile/embedded 1:1 applications.

FaceEncoder9C

Face encoder version 9C. Ultra-light face encoder, dedicated to face tracking only.

FaceEncodingQualityEstimator3A

Estimates the quality of the encoded template.

FaceExpressionClassifier1A

Face expression classifier.

FaceLandmarksEstimator2A

Extracts 68 landmark features.

FaceMaskClassifier2A

Detects the presence of a protective mask on a subject’s face.

FaceOcclusionDetector2A

Detects occlusions on the subject’s face (eyes, nose, mouth)

FacePeriocularEncoder2A

Encodes templates using only the periocular region of the subject’s face. Highest accuracy periocular encoder in this SDK. Provides an efficient alternative to face encoders when people wear masks in server-based 1:N applications.

FacePoseEstimator1A

Estimates the pose of the face (yaw pitch, roll).

FaceSegmenter1A

Face segmenter / background removal.

Important

Models can be downloaded at the following URL:

AI model files

AI model files have the .id3nn extension. You must copy the necessary data files into your application package. If you wish to reduce the size of your application, we recommend copying only the files required by the biometric algorithm.

In your application’s source code you should specify location of these files.

Warning

AI model files MUST NOT be renamed.

Loading AI models

It is recommended to load the AI models on application startup. The FaceLibrary Class provides methods for loading and unloading AI model file in memory.

An example is given below:

FaceLibrary.load_model(ai_models_path, FaceModel.FACE_DETECTOR_4B, ProcessingUnit.CPU)
FaceLibrary.load_model(ai_models_path, FaceModel.FACE_ENCODER_9B, ProcessingUnit.CPU)

Warm-up

The first execution, or inference, of a model takes generally more time. To mitigate this problem, a warm-up method can be called on application startup to prepare the inference of model.

For example, you can prepare the face detection model by calling the FaceDetector.warmUp Method.

Processing units

The inference of the AI models can be executed on either the CPU or the GPU if available, by specifying a ProcessingUnit Enumeration. The GPU options selects a default backend depending on your platform. Detailed backend options are available to ensure a specific backend.

Warning

Inference on GPU is an experimental feature. Some models might be unstable on some backend or provide nonsense result. We strongly encourage you to verify the results on those backends, and contact our support in case of inadequate behaviour.

See also