Compute FAR, FRR and EER Metrics in TensorFlow – TensorFlow Tutorial

By | March 15, 2022

FAR, FRR and EER are three common used metrics in face and voiceprint recognition. In this tutorial, we will introduce how to compute them using tensorflow.

FAR, FRR and EER

FAR = False Acceptance Rate

FRR = False Rejection Rate

EER  = (FAR+FRR)/2

Compute FAR FRR and EER in TensorFlow

How to compute FAR, FRR and EER?

In order to compute these threee metrics, we need three data sets: gallery set, probe set that is in gallery set and probe set that is not in gallery.

In order to understand gallery and probe set, you can view this tutorial:

Understand Train Set, Gallery Set and Probe Set in Face Recognition – Deep Learning Tutorial

Set Description Metric
gallery set We can view this set as to our target members.
probe set in gallery This is the test set, we will test how many true members can be found from galley set. FRR
imposter set (probe set not in gallery) All members are imposters, we will test how many imposters can be viewed as target members. FAR

For example, we have saved 100 target members in a dataset, it is gallery set. We can use 100 true members (probe set in gallery) and 100 imposters to test.

Here is an example:

# calculating EER

n_probe = 100
n_imposter = 100

probe_scores =  compute_sim(probe_set, gallery_set)
imposter_scores = compute_sim(imposter_set, gallery_set)

eer = 0.0
mink = 1.0

for thres in [0.01*i+0.5 for i in range(50)]:
    far = (imposter_scores > thres) / n_imposter
    frr = (probe_scores <= thres) / n_probe

    k = abs(far - frr)
    if k < mink:
        mink = k
        eer = (far + frr) / 2

We should notice:

imposter_scores > thres: it means the total count that score is bigger than threshold in imposter set. We will compute FAR based on the total number of imposter set.

probe_scores <= thres: it means the total count that score is smaller than threshold in probe set. We will compute FRR based on the total number of probe set.

The denominator of FAR and FRR is different.

Leave a Reply