Live camera spoof detection

SmartFace Platform currently supports spoof checking based on the pose estimation and liveness check. There is also possibility to plugin external spoof detector in case you would like to use some.

Setting up spoof detection

The spoof detection can be enabled per camera. The spoof detection is turned off by default. To enable the spoof detection set the spoofDetectorResourceIds attribute in Camera entity. Valid values are body_parts_cpu_remote, liveness_distant_cpu_remote, liveness_distant_gpu_remote, liveness_nearby_cpu_remote, liveness_nearby_gpu_remote, external, none. It is possible to enable multiple spoof detectors at once by setting up the mentioned values in spoofDetectorResourceIds separated by a comma. Multiple enabled spoof detectors work in parallel and you will get the result of all the spoof checks performed on a matched face.

Spoof detection based on pose estimation

The spoof detection based on an estimation of a body pose applies body parts detection and pose estimation for evaluation of certain poses that can indicate that person tries to perform presentation attack. To enable spoof check based on pose estimation it is required to have body parts detection enabled. To enable the body parts detection set the PedestrianDetectorResourceId attribute in Camera entity to the value body_parts_cpu_remote.

To enable spoof detection based on the pose estimation it is required to enable the body parts detection first.

Spoof detection based on liveness check

The spoof detection based on liveness check is using our own proprietary neural network to evaluate multiple features of the image that can indicate that person on the image tries to perform presentation attack. The two main detections are available: distant and nearby. Mostly, the distant is optimized for seamless access and analysis of approaching persons, while the nearby is optimized for persons who are standing close to the camera in order to be identified. As it is stated above, it is also possible to use both these detections simultaneously, but it is not allowed to use same type of detection with both cpu and gpu.

The thresholds can be specified (default value is 0). For advanced users, it is also possible to customize conditions, under which will be the liveness analysis performed (e.g. brightness range, head pose limits, face area size, ...).

"spoofDetectorConfig": {
"distantLivenessScoreThreshold": 0,
"nearbyLivenessScoreThreshold": 0,
"distantLivenessConditions": "default",
"nearbyLivenessConditions": "default"
}


These values can be set either when creating a camera using endpoint POST ​/api​/v1​/Cameras or when modifying existing camera using endpoint PUT ​/api​/v1​/Cameras.

External spoof detection

For external spoof detector there is possibility to set threshold value via

"spoofDetectorConfig": {    "externalScoreThreshold": 0}

These values can be set either when creating a camera using endpoint POST ​/api​/v1​/Cameras or when modifying existing camera using endpoint PUT ​/api​/v1​/Cameras .

Spoof check result

The result of a spoof check is available only in the notification matchResults.match. This notification was enriched by a spoof check data. The result of a spoof check is currently not stored in the database. To see more about notifications see the chapter Notifications explained.

"SpoofCheck": {
"Performed": false,
"Passed": false,
"BodyPartsSpoofCheck": {
"Performed": false,
"PhotoInHandsDetected": false,
"Passed": false
},

"DistantLivenessSpoofCheck": {
"Performed": false,
"Score": 0.0, "Passed": false
},

"NearbyLivenessSpoofCheck": {
"Performed": false,
"Score": 0.0, "Passed": false
},
"ExternalSpoofCheck": {
"Performed": false,
"Passed": false,
"Score": 0.0,
"Quality": 0.0
}
}

Spoof check statuses

SpoofCheck.Performed - this attribute represents value if all spoof detectors which are turned-on actually did the detection. This attribute could be false if all spoof detectors are turned off or if at least one (from turned on) was not performed.

SpoofCheck.Passed - this attribute represents cumulated value of pass for all enabled spoof detectors with logical AND. This value could be true only if all enabled spoof detectors were performed and all passed. So no spoof was detected.

SpoofCheck.BodyPartsSpoofCheck.Performed - this attribute is true if body part spoof detection is enabled and detection was performed. There is possibility that body parts are not detected around matched face in that case will be this attribute also false.

SpoofCheck.BodyPartsSpoofCheck.PhotoInHandsDetected - this attribute is true if body part spoof detection was performed and hands of detected pedestrian are in front of face. So spoof is detected.

SpoofCheck.BodyPartsSpoofCheck.Passed- this attribute is true if body parts spoof detection was performed and hands of detected pedestrian are not in front of face.

SpoofCheck.DistantLivenessSpoofCheck.Performed - this attribute is true if liveness analysis is enabled and analysis was performed. There is possibility that conditions are not fulfilled in that case will be this attribute also false.

SpoofCheck.DistantLivenessSpoofCheck.Passed - this attribute is true when Score is greater than given threshold spoofDetectorConfig.distantLivenessScoreThreshold.

SpoofCheck.ExternalSpoofCheck.Performed - this attribute is true if external spoof detection is enabled and detection was performed

SpoofCheck.ExternalSpoofCheck.Passed - this attribute is true when Score is under given threshold spoofDetectorConfig.externalScoreThreshold