Advanced usage

Binocular NIR Liveness Detection

1.Camera requirements

In order to improve the effect of binocular liveness detection, the algorithm has certain requirements for infrared camera and infrared fill light. Need to select an infrared camera with clear imaging to control the infrared fill light Intensity, to prevent two extreme conditions of infrared image is too bright or too dark.

index requirements
WDR >= 80db
SNR >= 50db
White balance suggest open
FPS >20fps
Format YUV/MJPG
Resolution >= 480p
Binocular distance <= 3cm

Normal infrared exposure

../_images/normal_exp.jpg

Infrared overexposure(unsuitable)

../_images/high_exp.jpg

Infrared low exposure(unsuitable)

../_images/low_exp.jpg

2. Index

There are several standard indicators for liveness detection, as follows:

  • False reject rate (FRR): If 99%, it means 100 cheating prosthesis attacks, 99 times will be rejected.
  • False recognition rate (FAR): If 0.5%, it means 1000 real person requests, there will be 5 times because the liveness score is lower than the threshold is rejected by mistake.
  • Pass rate (TAR): If 99%, it means 100 real person requests, there will be 99 passes because the liveness score is higher than the threshold.
  • Threshold: Above this value, it can be judged as a living body, 0.4 is recommended

3. Usage

//Liveness detection (face frame corresponding to bbox color camera)
float score = dfaceNIRLiveness.liveness_check(color_box, ir_box);

4. Android native Camera API binocular configuration

Please communicate with the development board manufacturer whether the native Camera API of the Android firmware supports opening two camera previews at the same time. By default, Android 5.1 and earlier versions support a maximum of one camera preview at the same time. If you do not support binocular preview, you need to recompile the HAL hardware layer.

Modify #define CAMERAS_SUPPORTED_SIMUL_MAX 1 to 2 in CameraHal_Module.h.

RGB Monocular Liveness Detection

1. Camera requirements

At present, the monocular liveness detection works best under the wide dynamic camera. You can choose the USB wide dynamic camera or the MIPI camera + board ISP. Excessive camera noise will also affect the performance of single RGB liveness detection.

index requirements
WDR >= 80db
SNR >= 50db
White balance suggest open
FPS >20fps
Format YUV/MJPG
Resolution >= 480p
Binocular distance <= 3cm

2. Level configuration

At present, the RGB liveness detection provides four levels, namely Level_1, Level_2, Level_3, Please select Level_1 for RGB+NIR liveness detect, select Level_2 for single RGB liveness detect.

3. Usage

//liveness detection
float score = dfaceRGBLiveness.liveness_check(frame, bbox);

5. Index

There are several standard indicators for liveness detection, as follows:

  • False reject rate (FRR): If 99%, it means 100 cheating prosthesis attacks, 99 times will be rejected.
  • False recognition rate (FAR): If 0.5%, it means 1000 real person requests, there will be 5 times because the liveness score is lower than the threshold is rejected by mistake.
  • Pass rate (TAR): If 99%, it means 100 real person requests, there will be 99 passes because the liveness score is higher than the threshold.
  • Threshold: Above this value, it can be judged as a living body, 0.7 is recommended

Liveness Detection Selection

1. Security rank

RGB Liveness + NIR Liveness > RGB Liveness > NIR Liveness

Face Detection And Recognition

1. Detection accuracy and performance configuration

There are many factors that affect the performance of face detection, mainly related to the working mode of face detection and the minimum face size. The larger the minimum face size setting, the faster the speed, but the face detection accuracy will decrease. We provide two working modes for face detection , Respectively, speed priority mode and precision priority mode, different scenes can be switched, for example, the usual camera detection can use speed priority mode, picture detection (ID card, registered pictures) scenes recommend using precision priority mode to increase the face detection accuracy.

//set minimum face size
dfaceDetect.SetMinSize(80);
//working mode Precision_Low Precision_High
dfaceDetect.SetWorkMode(Precision_Low);
//face detect
List<Bbox> box = dfaceDetect.detectionMax(frame);

2. Recognition distance configuration

The recognition distance is mainly related to the camera resolution and the minimum face size setting value. We provide two minimum face size settings, namely the minimum face detection size setting and the minimum face size recognition setting. The smaller the value, the farther the detection and recognition distance (note that detecting the smallest face will affect the detection speed, the smaller the value, the slower the speed). The higher the camera resolution, the higher the upper limit of detection and recognition distance.

Camera Resolution detect minimum size recognize minimum size valid distance
480P 100px 100px 1m
720P 120px 100px 3m
1080P 160px 100px 5m

3. Reduce false recognition rate

In order to reduce the false recognition rate of the production environment, we need to pay attention to the following indicators to find the most suitable balance point.

method Disadvantages
Raise the recognition threshold Increase identification confirmation time
Increase face quality filtering Extra compute time
Increase the minimum face size Reduce effective recognition distance
Improve the quality of face database Increase the cost of maintenance database
Switch to a higher accuracy model Extra compute time

Face Landmarks and pose

1. Landmarks number

../_images/WFLW_annotation.png