Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# Face comparison

Face comparison is the process of comparing a face template against a previously stored reference template.

The FaceMatcher module provides methods for comparing two face templates or two face template lists. The methods return a comparison score, from 0 to 65535 representing the degree of similarity between the two templates.

Note

A FaceTemplateList should contain templates from a single user.

## Decision threshold

The decision is the result of the comparison between the biometric comparison similarity score of given biometric data and a predefined threshold to achieve the desired security level. If the score is not less than the predefined minimal matching score threshold, the biometric verification is successful.

A decision threshold applied on the algorithm’s output score determines the operational FMR (False Match Rate), i.e. the probability of a system to falsely accept faces (impostors). Since FMR and FNMR (False Non-Match Rate) are in inverse proportion to each other, FNMR will increase with higher decision thresholds.

The decision threshold is defined according to the following table:

False Match Rate | Decision threshold
--- | ---
1.0% | 2000
0.1% | 3000
0.01% | 4000
0.001% | 5000
0.0001% | 6000
0.00001% | 7000
0.000001% | 8000
0.000001% | 9000
0.0000001% | 10000

Hint

To obtain a value between 0 and 100, we recommend applying the following formula to the matching score (S):

\(S' = MIN(100, S * 8 / 250)\)

## Example

The example below demonstrates how to compare two faces:

Python

    # initialize a FaceMatcher
    face_matcher = FaceMatcher()

    # Compare the templates
    score = face_matcher.compare_templates(reference, probe)
    print(f"Score = {score}")
    print(f"Similarity = {min(100, score * 8 / 250):0.2f}%")

    # Dispose all resources
    del face_matcher

## See also

- FaceEncoder Class

- FaceMatcher Class