Assessing Performance and Fairness Metrics in Face Recognition - Bootstrap Methods
Abstract
The ROC curve is the major tool for assessing not only the performance but also the fairness properties of a similarity scoring function in Face Recognition.
In order to draw reliable conclusions based on empirical ROC analysis, evaluating accurately the uncertainty related to statistical versions of the ROC curves of interest is necessary.
For this purpose, we explain in this paper that, because the True/False
Acceptance Rates are of the form of U-statistics in the case of similarity scoring the naive bootstrap approach is not valid here and that a dedicated recentering technique must be used instead.
This is illustrated on real data of face images, when applied to several ROC-based metrics such as popular fairness metrics
Face Recognition - Performance & Fairness
The deployment of Face Recognition (FR) systems brings with it a pressing demand for methodological tools to assess their trustworthiness.
The reliability of FR systems concerns their estimated performance of course, but also their properties regarding fairness: ideally, the system should exhibit approximately the same performance, independently of the sensitive group (determined by e.g. gender, age group, race) to which it is applied.
While, until now, the benchmark of FR systems is essentially reduced to an ad-hoc evaluation of the performance metrics ( i.e. ROC analysis) on a face image dataset of reference, the purpose of this paper is to explain, and illustrate using real data how the bootstrap methodology can be used to quantify the uncertainty/variability of the performance metrics, as well as that of some popular fairness metrics.
Hopefully, this paves the way for a more valuable and trustworthy comparative analysis of the merits and drawbacks of FR systems.
In FR, the usual objective is to learn an encoder function f : R h × w × c → R d that embeds the images in a way that brings same identities closer together.
Each image is of size ( h, w ) , while c corresponds to the color channel dimension.
It is worth noting that a pre-processing detection step (finding a face within an image) is required to make all face images have the same size ( h, w ) .
For an image x ∈ R h × w × c , its latent representation f ( x ) ∈ R d is called the face embedding of x .
Since the advent of deep learning, the encoder f is a deep Convolutional Neural Network (CNN) whose parameters are learned on a huge FR dataset, made of face images and identity labels.
In brief, the training consists in taking all images x ki , labelled with identity k , computing their embeddings f ( x ki ) and adjusting the parameters of f so that those embeddings are as close as possible (for a given similarity measure) and as far as possible from the embeddings of identity l ̸ = k .
The usual similarity measure is the cosine similarity which is defined as s ( x i , x j ) :
= f
( x i ) ⊺ f ( x j ) / ( || f ( x i ) ||
· || f ( x j ) || ) for two images x i , x j , with || · || standing for the usual Euclidean norm.
In some early works [Schroff et al., 2015], the Euclidean metric || f ( x i ) − f ( x j ) || was also used.
In the rest of this document, we discard the notation f for the encoder, and only use the similarity s (which contains the encoder), as we are not interested in the encoder training.
1.1 Performance Evaluation in Face Recognition
There are generally two FR use cases: identification , which consists in finding the specific identity of a probe face among several previously enrolled identities, and verification (which we focus on throughout this paper), which aims at deciding whether two face images correspond to the same identity or not.
In practice, the evaluation of a trained FR model is achieved using an evaluation dataset, where all possible pairs ( x i , x j ) of face images are considered.
Then, an operating point t ∈ [ − 1 , 1] (threshold of acceptance) is chosen to classify the pair ( x i , x j ) as genuine (same identity) if s ( x i , x j ) > t and impostor (distinct identities) otherwise.
In the following, we describe the statistical measures for evaluating a FR model, given an evaluation dataset.
Assuming that there are K distinct identities, the evaluation dataset can be modeled by a random variable ( X, y ) ∈
R h × w × c × { 1 , . .
. , K } .
We denote by P the corresponding probability law.
For 1 ≤ k ≤ K , we assume that the identities are equiprobable i.e. P ( y = k )
=
1 K .
X is determined by its conditional distributions
X k :=
( X | y
= k ) ∼
I k
and we consider that X k , X l are independent if k ̸ = l .
Let ( X 1 , y 1 ) and ( X 2 , y 2 ) be two independent random variables with law P .
We distinguish between the False Negative Rate (FNR) and the True Negative Rate (TNR), respectively defined by:
F ( t ) =
P ( s ( X 1 , X 2 ) ≤ t | y 1 = y 2 ) and G ( t ) =
P ( s ( X 1 , X 2 ) ≤ t | y 1 ̸ = y 2 ) .
With these notations, the ROC curve is defined as the graph of the mapping
[Equation]
α ∈ [0 , 1] .
Note that by ROC( α ) , one usually means 1 − F ◦ G − 1 (1 − α ) in machine learning and statistical literature but the FR community favors the DET curve ( 1 − ROC( α ) ), which we will call ROC curve in the following.
In practice, those metrics are not computable since we only have a finite dataset.
We denote by n k the number of face images of identity k , for 1 ≤ k ≤ K , within the evaluation dataset.
The images of identity k are modeled by random variables ( X ki ) 1 ≤ i ≤ n k , independent copies of X k .
The empirical approximations F N and G N of F and G are:
[Equation]
and
[Equation]
The empirical ROC curve is naturally:
[Equation]
1.2 Fairness Metrics in Face Recognition
To be consistent with the FR community, we change our previous notations (only for addressing fairness metrics) and define the False Rejection Rate ( FRR ) and the False Acceptance Rate ( FAR ) respectively as FRR( t ) :
= F N ( t ) and FAR( t ) :
= 1 − G N ( t ) .
Both are error rates that should be minimized, one more than the other depending on the use case.
With those notations, the empirical
ROC curve is ROC N ( α ) =
FRR( t α ) with FAR( t α ) = α .
In order to inspect fairness issues in FR, one should look at differentials in performance amongst several subgroups of the population.
Those subgroups are distinguishable by a sensitive attribute ( e.g. gender, race, age, ...).
For a given discrete sensitive attribute that can take A > 1 different values, we enrich our previous model and consider a random variable ( X, y, a ) where a ∈ A = { 0 , 1 , . . .
, A − 1 } .
With a slight abuse of notations, we still denote by P the corresponding probability law and, for every fixed value a , we can further define
[Equation]
The empirical approximations of F a ( t ) and (1 − G a ( t )) are denoted respectively by FRR a ( t ) and
FAR a ( t ) .
In the following, we list several popular FR fairness metrics.
All of them are used by the
U.S. National Institute of Standards and Technology (NIST) in their FRVT report [Grother, 2022].
Those fairness metrics attempt to quantify the differentials in (FAR a ( t )) a ∈A and (FRR a ( t )) a ∈A .
Since each metric fairness has two versions (one for the differentials in terms of FAR , the other in terms of FRR ), we only present its FAR version.
All metrics depend here on the threshold t α which satisfies FAR total ( t α )
=
α ∈ [0 , 1] , meaning that the threshold is set so that it achieves a FAR equal to α for the global population, and not for some specific subgroup.
Max-min ratio.
This metric has also been introduced by Conti et al.
[2022], but for another choice of threshold t α .
Its advantage is to be very interpretable but it is sensitive to low values in the denominator.
[Equation]
Max-geomean ratio.
This metric replaces the previous minimum by the geometric mean FAR † ( t α ) of the values (FAR a ( t α )) a ∈A , in order to be less sensitive to low values in the denominator.
[Equation]
Log-geomean sum.
It is a sum of normalized logarithms.
[Equation]
Gini coefficient.
The Gini coefficient is a measure of inequality in a population.
It ranges from a minimum value of zero, when all individuals are equal, to a theoretical maximum of one in an infinite population in which every individual except one has a size of zero.
[Equation]
Conti et al.
[2022] argue that the choice of a threshold t α achieving a global FAR total =
α is not entirely relevant since it depends on the relative proportions of each sensitive attribute value a within the evaluation dataset together with the relative proportion of intra-group impostors.
They propose instead a threshold t α such that each group a satisfies FAR a ( t α ) ≤ α .
Since we are dealing with a unique evaluation dataset, we do not use such a threshold choice, to be consistent with the last three fairness metrics.
Other fairness metrics exist in the literature such as the maximum difference in the values (FAR a ( t α )) a ∈A used by Alasadi et al.
[2019], Dhar et al.
They have the disadvantage of not being normalized and are thus not interpretable, especially when comparing their values at different levels α .
Assessing the Uncertainty of Face Recognition Metrics through Bootstrap
As previously explained, the ROC curves (and their related scalar summaries) of a similarity scoring function s ( x, x ′ ) (determined in practice by an encoder function to which cosine similarity is next applied) provide the main tool to assess performance and fairness in face recognition.
We now investigate how to bootstrap these functional criteria, in order to evaluate the uncertainty/variability inherent in their estimation based on (supposedly i.i.d.)
sampling observations drawn from the statistical populations under study.
Indeed, this evaluation is crucial to judge whether the similarity scoring function candidate meets the performance/fairness requirements in a trustworthy manner, as will be next discussed on real examples in the next section.
Bootstrapping the ROC curve of a similarity scoring function.
Extending the limit results in
Hiesh and Turnbull [1996], the consistency of the empirical ROC curve (1) of a similarity scoring function s ( x, x ′ ) can be classically established, as well as its asymptotic Gaussianity (under additional hypotheses, involving the absolute continuity of distributions F and G in particular), in a standard multi-sample asymptotic framework, i.e. stipulating that, for all k ∈ { 1 , . .
, K } ,
n k /N
→ λ k >as N → + ∞ ).
Indeed, under appropriate mild technical assumptions, one may prove that the sequence of stochastic processes
[Equation]
converges in distribution to a Gaussian law as N → ∞ .
However, this limit law can hardly be used to build (asymptotic) confidence bands for the true ROC curve (or confidence intervals for scalar summary ROC-based metrics) in practice, due to its great complexity (the limit law, depending on the unknown densities of F and G is built from Brownian bridges and its approximate numerical simulation is a considerable challenge).
Resampling techniques must be used instead, in order to mimic the random fluctuations of ROC N ( α ) − ROC( α ) .
Application of the (smoothed) bootstrap methodology to ROC analysis has been investigated at length in the bipartite ranking context, i.e. for binary classification data [Bertail et al., 2008].
In the classification framework, bootstrap versions of the empirical ROC curve are simply obtained by means of uniform sampling with replacement in the two statistical populations (positive and negative).
In this case, the empirical true/false positive rates are of the form of i.i.d.
averages, which greatly differs from the present situation, where F N ( t ) is an average of independent mono-sample U -statistics of degree 2, while G N ( t ) is a multi-sample Ustatistic of degree (1 , 1) .
As will be shown below and illustrated in Appendix B, the pairwise nature of the statistical quantity F N ( t ) computed is of great consequence, insofar as a ’naive’ implementation of the bootstrap completely fails to reproduce ROC N ’s variability when applied to the latter.
Indeed, it systematically leads to a serious underestimation of F N ( t ) , and consequently to an underestimation of ROC N uniformly on (0 , 1) .
For simplicity’s sake, we describe the reason behind this phenomenon by considering the problem of bootstrapping the statistic F N ( t ) and explain next how to remedy this problem. Bootstrap of F N ( t ) .
For all 1 ≤ k ≤ K , consider ( X k 1 ∗ , . . .
, X kn k ∗ ) a bootstrap sample related to identity k , drawn by simple sampling with replacement from original data { ( X k 1 , . . .
, X kn k ) } .
Recall that the original statistic is of the form:
[Equation]
Using the previous bootstrap sample, we can compute a bootstrap version of F kN ( t ) :
[Equation]
F kN ( t ) is a (non degenerate)
U -statistic of order 2 (an average over all pairs) with symmetric kernel 1 s ( x,x ′ ) ≤ t , and thus involves no ’diagonal’ terms of type 1 s ( X ki ,X ki ) ≤ t .
Indeed, evaluating the similarity of an image and itself brings no information (it is naturally equal to 1 when considering cosine similarity).
By contrast, it is shown in Janssen [1997] that the bootstrap version F kN ∗ ( t ) of
F k N ( t ) is in expectation equal to its V -statistic version, i.e. the version obtained by incorporating the diagonal terms in the average.
In details, denoting E ∗ [ ·| X k 1 , . . .
, X kn k ] the conditional expectation with respect to ( X k 1 , . . .
, X kn k ) (i.e. it denotes the expectation related to the randomness induced by the resampling), we have that:
[Equation]
Grouping all K identities
[Equation]
we can compute a bootstrap version of F N ( t ) :
[Equation]
whose expectation is:
[Equation]
This means that bootstrapping F N ( t ) would result in many values F N ∗ ( t ) that are not centered around F N ( t ) , but centered around F N ∗ ( t ) .
From Janssen [1997]
(Theorem 3 ), we find that P [ √ N ( F N ∗ ( t ) − F N ∗ ( t )) ≤ x | X 11 , . . .
X Kn K ] is a uniformly consistent estimator for
P [ √ N ( F N ( t ) − F ( t )) ≤ x ] .
As a consequence, we can build confidence intervals for F N ( t ) in the following way: from the bootstrap samples, build confidence interval for ( F N ∗ ( t ) − F N ∗ ( t )) and shift it by F N ( t ) . Bootstrap of G − 1 N ( α ) .
By contrast, a naive bootstrap method, involving no recentering, can be applied to:
[Equation]
Since each sample of the 2 -sample U-statistic G k,lN ( t ) is of order (1 , 1) , we have:
[Equation]
[Equation] ] =
G
[Equation]
lN ( t ) and G N
[Equation]
( t ) =
G N ( t ) .
The previous confidence interval method still works here: build a confidence interval for ( G N ∗ ( t ) − G N ∗ ( t )) =
( G N ∗ ( t ) − G N ( t )) and shift it by G N ( t ) .
However, in this case, the bootstrap values G N ∗ ( t ) are centered around G N ( t ) .
This method for confidence interval construction extends naturally to the bootstrap of the empirical quantile function G − 1 N .
In theory, a smoothed version of the bootstrap, consisting in sampling from smoothed (by means of a e.g. Gaussian kernel) versions of the empirical distributions should be used for bootstrapping quantiles.
However, given the very large size of the pooled dataset here, smoothing can be ignored in practice.
Bootstrap of ROC N ( α ) . Finally, we regroup the bootstrap of F N ( t ) and of G − 1 N ( α ) to present the bootstrap of the empirical ROC curve ROC N ( α ) =
F N ◦ G − 1 N (1 − α ) .
Using many bootstrap samples, a confidence interval is found for (ROC N ∗ ( α ) − ROC N ∗ ( α )) =
( F N ∗ ◦ G − 1 N ∗ (1 − α ) −
F N ∗ ◦ G − 1 N (1 − α )) , then shifted by ROC N ( α ) .
A pseudo-code for building the confidence interval for ROC N ( α ) at level α CI ∈ [0 , 1] is summarized in Algorithm 1.
We highlight the significance of the recentering step and why a naive bootstrap does not work in Appendix B.
Bootstrapping fairness metrics We apply the same bootstrap algorithm for all fairness metrics since they are functions of F N and G N .
In details, consider a fairness measure that depends on FRR a ( t ) , the max-min ratio FRR maxmin for instance.
In the expression of FRR maxmin , FRR a ( t ) would be computed as F N ( t ) for the classic fairness measure (equivalent of ROC N above), as F N ∗ ( t ) for the bootstrap fairness (equivalent of ROC N ∗ ) and as F N ∗ ( t ) for the V-statistic fairness (equivalent of ROC N ∗ ), using pairs of attribute a in all three cases. Using those values for each a ∈ A , we take the maximum and divide it by the minimum to get three versions of the fairness metric FRR maxmin : the classic fairness (where each FRR a ( t ) is computed as F N ( t ) ), the bootstrap fairness (where each FRR a ( t ) is computed as F N ∗ ( t ) ) and the V-statistic fairness (where each FRR a ( t ) is computed as
F N ∗ ( t ) ). Finally, the same bootstrap algorithm than for ROC N is used: compute bootstrap samples of the difference between the bootstrap fairness and the V-statistic fairness, then shift it by the classic fairness measure. Confidence bounds can be obtained in the same way than for ROC N .
Numerical Experiments - Discussion
We use as encoder the trained 1 model ArcFace [Deng et al., 2019a] whose CNN architecture is a
ResNet100 [Han et al., 2017].
It has been trained on the MS1M-RetinaFace dataset, introduced by [Deng et al., 2019b] in the ICCV 2019 Lightweight Face Recognition Challenge.
We choose the dataset RFW [Wang et al., 2019] as evaluation dataset.
It is composed of 40 k face images from 11 k distinct identities.
This dataset is also provided with ground-truth race labels (the four available labels are: African, Asian, Caucasian, Indian) and is widely used for fairness evaluation since it is equally distributed among the race subgroups, in terms of images and identities. The official RFW [Figure]
[Figure] t [Figure] protocol only considers a few matching pairs among all the possible pairs given the whole RFW dataset.
The number of images is typically not enough to get good estimates of our fairness metrics at low FAR .
To overcome this, we consider all possible same-race matching pairs among the whole
RFW dataset.
All images are pre-processed by the Retina-Face detector Deng et al.
[2019c] and are of size 112 × 112 pixels.
Our first experiment is the computation of the confidence bands at 95 % confidence level ( α CI = 0 . 05 ) for each intra-group ROC i.e. the ROC corresponding to each race label.
This is the output of our Algorithm 1 using B = 100 bootstrap samples and the result is displayed in
Figure 1.
It can be observed that Caucasians have a better performance than other races and that the uncertainty makes all races potentially indistinguishable in terms of performance at high FAR levels.
Notice that the uncertainty increases when any of the error rates FAR , FRR is low, which happens when a few matching pairs are incorrectly classified, making the error rates really sensitive to those pairs.
To quantify better the uncertainty in the estimation of ROC N ( α ) , we compute the standard deviation of the B = 100 bootstrap ROC curves ROC N ∗ ( α ) , for each race label.
For a fair comparison, we normalize this standard deviation by ROC N ( α ) (classic evaluation).
The result is provided as a function of α in Figure 2.
This normalized standard deviation is a natural proxy measure for the uncertainty in the estimation of the ROC of each race label.
It is worth noting that the higher uncertainty is achieved by Asians and Indians at low FAR levels and by Caucasians at high FAR levels.
Note that Caucasians have the best performance at low FAR levels and, at the same time, the lowest uncertainty about it among all race labels.
[Figure]
The renormalization factor is the classic fairness measure.
Then, we investigate the uncertainty related to certain possible fairness measures.
The race label is used here as the sensitive attribute a .
We compute the previous normalized standard deviation for the considered fairness metrics, in the same way than for
Figure 2.
For each metric, we take B = 100 bootstrap samples, giving 100 fairness values at each
FAR total =
α level.
For each α , the standard deviation of those values is found, and then normalized by the classic fairness measure at this level α , for a fair comparison.
As illustrated in Figure 3, the Gini coefficient and the log-geomean sum fairness metrics show high (similar) uncertainty.
The max-geomean ratio metric displays the lowest uncertainty, both in terms of FAR and FRR , which makes it particularly suitable for fairness evaluation.
In addition, the maxgeomean (and the max-min) ratio metrics have the significant advantage to be interpretable.
While the gold standard by which fairness will be evaluated in the future is not fixed yet, we believe that it should definitely incorporate uncertainty measures, since it could lead to wrong conclusions otherwise.
The bootstrap approach is simple, fast and yet it has not been explored by the FR community.
Acknowledgments and Disclosure of Funding
This research was partially supported by the French National Research Agency (ANR), under grant
ANR-20-CE23-0028 (LIMPID project).
Input: K ≥ 0 , images ( X 11 , . . . , X Kn K ) , encoder f Require: α ∈ [0 , 1] , B ≥ 0 , α CI ∈ [0 , 1] Output: CI − , CI + , bounds for the confidence interval of ROC N ( α ) at level α CI
ROC N ∗ ← F N ∗ ◦ G − 1 N (1 − α ) gap ← ∅ for b ← 1 , B do
X ( b ) ← ∅ for k ← 1 , K do
X k ( b ) ← sample with replacement n k images among ( X k 1 , . .
, X kn k )
X ( b ) ← X ( b ) ∪ X k ( b ) end for
ROC N, ( b ) ← F N ∗ ◦ G − 1 N ∗ (1 − α ) for bootstrap sample X ( b ) gap ( b ) ← ROC N, ( b ) − ROC N ∗ gap ← gap ∪ gap ( b ) end for
CI − ← α CI 2 -th quantile of gap
CI + ← (1 − α CI 2 ) -th quantile of gap
ROC N ← F N ◦ G − 1 N (1 − α )
CI − ← ROC N + CI −
CI + ← ROC N + CI +
B Visualization of the recentering step
In this section, we underline the significance of the recentering step of Algorithm 1.
For the sake of simplicity, we achieve the bootstrap of the ROC curve for the global population, and not for some specific subgroups.
Let suppose that a naive bootstrap is done, that is we get some bootstrap image samples and, for each of them, we compute the bootstrap version ROC N ∗ of ROC N .
If a naive bootstrap is achieved, the bootstrap versions ROC N ∗ (for many bootstrap samples) would be supposed to be centered around ROC N .
By taking quantiles of ROC N ∗ ( α ) for a given FAR level equal to α , we would get the confidence interval at this FAR level α .
However, as illustrated in Figure 4 and
Figure 5, this is not the case.
The theoretical reasons have been detailed in Section 2.
Briefly, since (ROC N ∗ ( α ) − ROC N ∗ ( α )) is a good estimator of (ROC N ( α ) − ROC( α )) , we can obtain confidence intervals for the latter with confidence intervals for the former.
[Figure] [Figure]