Skip to main content
Version: 3.20.2

Facial recognition

Introduction

Face SDK allows you to perform the following operations to compare biometric face templates:

  • Verification (1:1) — comparison of two face templates for belonging to the same person (comparison of two faces).
  • Identification (1:N) — comparison of one biometric face template with other face templates (face search through face database). The result of the recognition is a similarity score between the compared templates.

Processing Blocks for facial recognition

  • FACE_TEMPLATE_EXTRACTOR — used to build biometric face templates.
  • VERIFICATION_MODULE — used for comparison of two faces.
  • MATCHER_MODULE — used for searching faces in the database.
  • TEMPLATE_INDEX — used to create a database of biometric face templates for searching in MATCHER_MODULE module.

Modifications and versions of facial recognition blocks

Modification of the FACE_TEMPLATE_EXTRACTOR processing block determines the template generation speed and recognition accuracy. The slower the module is, the higher its recognition accuracy. Currently, the following modifications exist:

VersionTemplate creation (ms)Template size (bytes)
1 647 296
note

The default modification is "1000".

For VERIFICATION_MODULE, MATCHER_MODULE, TEMPLATE_INDEX blocks modification and version determines Template type.

Facial recognition blocks specification

Processing Block configurable parameters

Face template extractor

  1. The input Context must contain an image in binary format and objects array from Face Detector and Face Fitter:
Click here to expand the input Context specification
{
"image" : {
"format": "NDARRAY",
"blob": "data pointer",
"dtype": "uint8_t",
"shape": [height, width, channels]
},
"objects": [{
"id": {"type": "long", "minimum": 0},
"class": "face",
"confidence": {"double", "minimum": 0, "maximum": 1},
"bbox": [x1, y2, x2, y2]
"keypoints": {
"left_eye_brow_left": {"proj" : [x, y]},
"left_eye_brow_up": {"proj" : [x, y]},
"left_eye_brow_right": {"proj" : [x, y]},
"right_eye_brow_left": {"proj" : [x, y]},
"right_eye_brow_up": {"proj" : [x, y]},
"right_eye_brow_right": {"proj" : [x, y]},
"left_eye_left": {"proj" : [x, y]},
"left_eye": {"proj" : [x, y]},
"left_eye_right": {"proj" : [x, y]},
"right_eye_left": {"proj" : [x, y]},
"right_eye": {"proj" : [x, y]},
"right_eye_right": {"proj" : [x, y]},
"left_ear_bottom": {"proj" : [x, y]},
"nose_left": {"proj" : [x, y]},
"nose": {"proj" : [x, y]},
"nose_right": {"proj" : [x, y]},
"right_ear_bottom": {"proj" : [x, y]},
"mouth_left": {"proj" : [x, y]},
"mouth": {"proj" : [x, y]},
"mouth_right": {"proj" : [x, y]},
"chin": {"proj" : [x, y]},
"points": ["proj": [x, y]]
}
}]
}
  1. After calling the Estimation Processing Block, each object from the "objects" array will be added attributes corresponding to this block. Biometric template will be stored in binary sample.
Click here to expand the output Context specification
[{
"keypoints": {},
"template": {
"face_template_extractor_{modification}_{version}": {
"format": "NDARRAY",
"blob": "data pointer",
"dtype": "uint8_t",
"shape": [size]
}
}
}]

Verification module

  1. The input container Context must contain two biometric templates written in the fields "template1" and "template2". The template type must correspond to the modification of the Processing Block.
Click here to expand input Context Specification
{
"template1" : {
"face_template_extractor_{modification}_{version}": {
"format": "NDARRAY",
"blob": "data pointer",
"dtype": "uint8_t",
"shape": [size]
}
},
"template2" : {
"face_template_extractor_{modification}_{version}": {
"format": "NDARRAY",
"blob": "data pointer",
"dtype": "uint8_t",
"shape": [size]
}
}
}
  1. After the verification processing block is called, the result will be placed in "result".
Click here to expand output Context Specification
[{
"template2": {},
"result": {
"distance": {"long", "minimum": 0},
"score": {"double", "minimum": 0, "maximum": 1},
"far": {"double", "minimum": 0, "maximum": 1},
"frr": {"double", "minimum": 0, "maximum": 1},
}
}]

Template index module

  1. Input Context must contain an array of biometric templates in the `"templates" field.
Click here to expand input Context Specification
{
"templates" : [
"face_template_extractor_{modification}_{version}": {
"format": "NDARRAY",
"blob": "data pointer",
"dtype": "uint8_t",
"shape": [size]
},
]
}
  1. After calling the Template Index block, the resulting index will be placed in the "template_index" field.
Click here to expand output Context Specification
[{
"templates": {},
"template_index": {"Non-serializable"}
}]

Matcher module

  1. Input Context must contain an array "template_index", obtained after running the module "TEMPLATE_INDEX". and a set of searched biometric templates placed in the array "queries".
Click here to expand input Context Specification
{
"queries": [
"template" : {
"face_template_extractor_{modification}_{version}": {
"format": "NDARRAY",
"blob": "data pointer",
"dtype": "uint8_t",
"shape": [size]
},
}
]
"template_index": {"Non-serializable"}
}
  1. After the Matcher module is called, the result will be placed in the array "results"
Click here to expand output Context Specification
[{
"template_index": {"Non-serializable"},
"result": [{
"distance": {"long", "minimum": 0},
"score": {"double", "minimum": 0, "maximum": 1},
"far": {"double", "minimum": 0, "maximum": 1},
"frr": {"double", "minimum": 0, "maximum": 1},
}]
}]

Facial recognition results

  • distance — distance between compared template vectors. The smaller is the value, the higher is the confidence in correct recognition.
  • far — probability of erroneous confirmations when the system takes images of different people for the image of the same person.
  • frr — probability of erroneous rejections when the system mistakes two images of the same person for images of different people.
  • score — degree of similarity of faces from 0 (0%) to 1 (100%). High degree of similarity means that two biometric templates belong to the same person.