Talk to our team
Menu

Fairness-Aware Grouping for Continuous Sensitive Variables: Application for Debiasing Face Analysis with respect to Skin Tone

Authors
  • Veronika Shilova
  • Emmanuel Malherbe
  • Giovanni Palma
  • Laurent Risser
  • Jean-Michel Loubes
Affiliations
  • Artefact Research Center
  • Institut de Mathématiques de Toulouse
  • L’Oréal Research and Innovation
  • INRIA
Accepted at
ECAI 2025
Date
arXiv
2507.11247

Abstract

Within a legal framework, fairness in datasets and models is typically assessed by dividing observations into predefined groups and then computing fairness measures (e.g., Disparate Impact or Equality of Odds with respect to gender). However, when sensitive attributes such as skin color are continuous, dividing into default groups may overlook or obscure the discrimination experienced by certain minority subpopulations. To address this limitation, we propose a fairness-based grouping approach for continuous (possibly multidimensional) sensitive attributes. By grouping data according to observed levels of discrimination, our method identifies the partition that maximizes a novel criterion based on inter-group variance in discrimination, thereby isolating the most critical subgroups. We validate the proposed approach using multiple synthetic datasets and demonstrate its robustness under changing population distributions - revealing how discrimination is manifested within the space of sensitive attributes. Furthermore, we examine a specialized setting of monotonic fairness for the case of skin color. Our empirical results on both CelebA and FFHQ, leveraging the skin tone as predicted by an industrial proprietary algorithm, show that the proposed segmentation uncovers more nuanced patterns of discrimination than previously reported, and that these findings remain stable across datasets for a given model. Finally, we leverage our grouping model for debiasing purpose, aiming at predicting fair scores with group-by-group post-processing. The results demonstrate that our approach improves fairness while having minimal impact on accuracy, thus confirming our partition method and opening the door for industrial deployment.

Cite this paper

@inproceedings{shilova2025fairnessaware,
  title = {Fairness-Aware Grouping for Continuous Sensitive Variables: Application for Debiasing Face Analysis with respect to Skin Tone},
  author = {Veronika Shilova and Emmanuel Malherbe and Giovanni Palma and Laurent Risser and Jean-Michel Loubes},
  booktitle = {European Conference on Artificial Intelligence (ECAI 2025)},
  year = {2025},
  doi = {10.3233/FAIA251472},
  url = {https://doi.org/10.3233/FAIA251472}
}

Introduction

Group fairness measures inherently depend on the underlying distribution of machine learning data, such as specific input variables or the predicted scores for a given task. These measures are becoming increasingly impactful in light of recent AI regulations, such as the EU AI Act, which emphasize the need for reporting algorithmic performance across demographic groups. Beyond reporting, addressing disparities generally involves mitigation strategies applied on a group-by-group basis, based on qualitative sensitive variables. We refer, for instance, to [Besse et al.(2022)Besse, del Barrio, Gordaliza, Loubes, and Risser, Chouldechova and Roth(2020), Del Barrio et al.(2020)Del Barrio, Gordaliza, and Loubes, Dwork et al.(2012)Dwork, Hardt, Pitassi, Reingold, and Zemel, Gordaliza et al.(2019)Gordaliza, Del Barrio, Fabrice, and Loubes, Kamishima et al.(2011)Kamishima, Akaho, and Sakuma, Risser et al.(2022)Risser, Sanz, Vincenot, and Loubes, Wang et al.(2022)Wang, Zhang, and Zhu] and references therein. The sensitive attribute can also be natively continuous, which is of primary interest in our paper. In this case, defining groups in the attribute space remains relevant, but raises the question on how to choose the partition and on which criteria.

A major field impacted by this problem is Computer Vision, for which widespread applications in high-stakes tasks have raised many ethical questions in recent years. A very sensitive scenario is when models are applied to facial images, since the risk of bias with respect to (w.r.t.) skin tone might be related to ethnicity. This risk may occur for models that address transversal problems, such as face verification and attribute prediction, as first highlighted by [Buolamwini and Gebru(2018)] in which automated commercial facial analysis algorithms were shown to be biased against women with darker skin tones. It was later confirmed by [Thong et al.(2023)Thong, Joniak, and Xiang], as well as for text-to-image generation models, including DALL-E [Cho et al.(2023)Cho, Zala, and Bansal]. Such bias has been observed for many commercial applications, such as pedestrian detection [Li et al.(2023)Li, Chen, Zhang, Sarro, Zhang, and Liu], online ad delivery service [Sweeney(2013)], or online cosmetic product recommendation [Malherbe et al.(2022)Malherbe, Remise, Zhang, and Perrot]. In this paper, we focus on the industrial scenario of a make-up recommendation algorithm based on selfie pictures. The recommended products and make-up strategy should indeed only depend on user’s face morphology and not on its skin tone nor ethnicity.

Although being central for these fairness topics, the effective way to measure skin tone remains an open question. Many studies [Buolamwini and Gebru(2018), Schumann et al.(2024)Schumann, Olanubi, Wright, Monk, Heldreth, and Ricco] rely on manual annotators grouping individuals into predefined skin tone categories, such as the Fitzpatrick scale [Fitzpatrick(1988)] or Monk scale [Schumann et al.(2024)Schumann, Olanubi, Wright, Monk, Heldreth, and Ricco]. However, this approach presents three major drawbacks. First, a simplistic division of tones risks oversimplifying the skin color and failing to capture nuanced biases embedded in datasets and models, which is obvious in the binary extreme of ”darker” and ”lighter” categories, but also occurs with the six groups of the commonly used Fitzpatrick scale. Second, these categories are predefined, while fairness is always related to a given task. The discriminated groups thus differ from one task to another, and hence cannot be captured by a default grouping of individuals. Third, manual annotations can introduce perception biases. Annotators might perceive skin tones differently depending on their cultural background [Garcia and Abascal(2016), Gevers et al.(2012)Gevers, Gijsenij, Van de Weijer, and Geusebroek], which introduces annotator bias in the data. To overcome the limitations described above, an alternative line of research [Robin et al.(2020)Robin, Loïc, Malherbe, and Perrot, Thong et al.(2023)Thong, Joniak, and Xiang] focuses on the estimated skin tone as a continuous quantity expressed in the color space, thus capturing a broader spectrum of skin tones. However, in the context of fairness, the necessity to consider groups raises the question on how to segment such skin color space.

In this paper, we introduce a paradigm that tailors the partitioning process to a given classification task. Our contributions are:

We propose novel data-driven approaches to segment a continuous, possibly multidimensional sensitive variable into groups being homogeneous w.r.t. the discrimination present in a dataset or a model;

We show through extensive experiments on skin tone that data-driven segmentation reveals more discrimination patterns than predefined groups and remains robust to population shifts, allowing us to better isolate how discrimination manifests within the sensitive attribute space. We also introduce and study the particular case of monotonic fairness, which may occur with skin tone;

We use the groups identified by our data-driven method to mitigate the bias of a predictive model. Compared to other partitions, we obtain the best trade-off between model fairness and accuracy.

Related work

Measures of fairness for groups and for continuous attributes

Measuring and ensuring fairness in machine learning systems have become a central focus in recent years, leading to the development of various metrics assessing group-level disparities [Caton and Haas(2024)]. Group fairness seeks to guarantee equitable treatment across predefined demographic groups, and several standard measures have been proposed to evaluate and mitigate biases in algorithmic decision-making.

The most commonly used measure of algorithmic bias is Statistical Parity [Corbett-Davies et al.(2017)Corbett-Davies, Pierson, Feller, Goel, and Huq], frequently quantified in the fair learning literature through Disparate Impact (DI) [Feldman et al.(2015)Feldman, Friedler, Moeller, Scheidegger, and Venkatasubramanian]. Statistical Parity requires that individuals from different demographic groups have equal chances of receiving a positive outcome. However, its simplicity comes at a cost, as it does not account for the true distributions of target outcomes between groups. For instance, if one group is historically underrepresented in the positive class, targeting equal outcomes across groups reduces overall accuracy. On the other hand, the Equalized Odds [Berk et al.(2021)Berk, Heidari, Jabbari, Kearns, and Roth] metric focuses on ensuring that the rates of true positives and false positives are comparable across all groups. By considering the underlying differences between groups, this measure highlights error rate equality, making it particularly relevant in contexts where fairness in outcomes is critical, such as criminal justice and healthcare. Despite its advantages, achieving Equalized Odds in practice can be challenging without sacrificing predictive accuracy.

In the case of a continuous sensitive attribute, fairness is often quantified through a measure of statistical correlation. The most common measures are Hirschfeld-Gebelein-Rényi (HGR) maximum correlation coefficient [Mary et al.(2019)Mary, Calauzenes, and El Karoui] and Generalized Disparate Impact [Giuliani et al.(2023)Giuliani, Misino, and Lombardi], which is a modified formulation of HGR. These fairness metrics primarily evaluate the overall dependence between a continuous sensitive variable and a target variable, without specifying which groups within the population are more or less affected by discrimination. As a result, these metrics are not directly applicable to detect and locate biases in models. This limitation is particularly relevant in the context of emerging legal frameworks, such as the EU AI Act, which mandates that AI systems ensure they do not disadvantage specific groups based on attributes such as skin tone, age, or income, which, in fact, are inherently continuous.

Skin color as a sensitive variable in Computer Vision

While attributes representing skin tone is often provided in Computer Vision datasets, it is represented as a discrete attribute in the most commonly used ones. For example, the skin color attribute has been annotated in the two groups Pale/Not Pale in the CelebA dataset [Liu et al.(2015)Liu, Luo, Wang, and Tang], in the 6 groups of the Fitzpatrick scale [Fitzpatrick(1988)] in the IJB-C [Maze et al.(2018)Maze, Adams, Duncan, Kalka, Miller, Otto, Jain, Niggel, Anderson, Cheney, et al.] and Facet [Gustafson et al.(2023)Gustafson, Rolland, Ravi, Duval, Adcock, Fu, Hall, and Ross] datasets, and in the 10 groups of the Monk scale [Schumann et al.(2024)Schumann, Olanubi, Wright, Monk, Heldreth, and Ricco] in the MST-E dataset [Garcia and Abascal(2016)]. These commonly used groups for skin tone are of a limited number, when compared to the full range of skin colors. Besides, they are generally given by a human annotator (as in the datasets mentioned above), which has been observed to be biased with respect to its geographical region or its culture [Gevers et al.(2012)Gevers, Gijsenij, Van de Weijer, and Geusebroek], or to the inferred race/ethnicity of the individual in the picture [Garcia and Abascal(2016)]. To mitigate annotator bias and limited skin groups granularity, the recent line of work intended to consider skin tone as a measured color, thus a continuous quantity. The study [Thong et al.(2023)Thong, Joniak, and Xiang] proposed to extract skin color directly from pixels instead of relying on human perception and converted it in the CIELAB color space [Weatherall and Coombs(1992)]. This color space, unlike RGB, correlates with the response of the human eye by covering its entire range of color perception and is a golden standard to measure skin color in clinical dermatology [Wilkes et al.(2015)Wilkes, Wright, du Plessis, and Reeder] and aesthetic cosmetology [Ly et al.(2020)Ly, Dyer, Feig, Chien, and Del Bino]. However, estimation of skin color directly from pixels’ color may be noisy as it depends on lightning conditions of a given picture, especially for in-the-wild pictures [Thong et al.(2023)Thong, Joniak, and Xiang]. As a more reliable estimate, using a spectrophotometer to measure panelists’ skin reflectance provides a ground truth value for training a supervised model [Ly et al.(2020)Ly, Dyer, Feig, Chien, and Del Bino, Robin et al.(2020)Robin, Loïc, Malherbe, and Perrot].

The previous approaches to quantifying fairness w.r.t. skin tone in datasets and models [Buolamwini and Gebru(2018), Cho et al.(2023)Cho, Zala, and Bansal, Li et al.(2023)Li, Chen, Zhang, Sarro, Zhang, and Liu, Thong et al.(2023)Thong, Joniak, and Xiang] predefine the sensitive attribute into binary or discrete groups. For instance, [Buolamwini and Gebru(2018), Cho et al.(2023)Cho, Zala, and Bansal, Li et al.(2023)Li, Chen, Zhang, Sarro, Zhang, and Liu], divide the population into two broad categories: Lighter and Darker skin tones. In contrast, [Thong et al.(2023)Thong, Joniak, and Xiang] proposes a more granular characterization with four subgroups that combine two dimensions: Lighter and Darker skin tones representing skin lightness, and Red and Yellow skin hues reflecting variations in perceived skin color gradation from reddish to yellowish tones. Further improvements can however be made, since these discretizations overlook both the underlying data distribution and the target variable. Another limit of these predefined groups is that samples inside a group are assumed to be homogeneous in terms of fairness, which is not guaranteed in reality. Besides, as already shown in [Kearns et al.(2018)Kearns, Neel, Roth, and Wu], overly simplistic group definitions may overlook fairness nuances and underestimate the level of discrimination present in the data or/and introduced by the model.

Color space for skin tone

In view of the litterature for skin tone estimation, in this work we consider the skin tone as a color in the three-dimensional CIELAB color space. We present below this color space and the color attributes commonly derived from it.

CIELAB color space for measures. CIE L∗a∗b∗ (CIELAB) color space [Sève(2009)] was defined by the International Commission on Illumination in 1976 with the aim of approximating human perception of color differences. A color is expressed by a vector (L∗,a∗,b∗)∈ℝ3 with the property that the Euclidean distance between two colors is proportional to their difference as perceived by humans, which is not verified in the RGB space. The L∗∈[0,100] component corresponds to the perceptual lightness and ranges from black to white. The a∗∈[−128,127] component refers to the green-red opponent, with negative values corresponding to green and positive values to red. The b∗∈[−128,127] component describes the blue-yellow opponent colors, with negative values corresponding to blue and positive values to yellow.

Individual typology angle. The individual typology angle (ITA) is a one dimensional measure of skin tone defined by [Chardon et al.(1991)Chardon, Cretois, and Hourseau] in the CIE L∗a∗b∗ color space as follows:

ITA=arctan(L∗−50b∗)×180∘π.(1)

It is widely used for skin color measurements in dermatology [Wilkes et al.(2015)Wilkes, Wright, du Plessis, and Reeder] and aesthetic cosmetology [Ly et al.(2020)Ly, Dyer, Feig, Chien, and Del Bino]. In fairness field, ITA is commonly applied to facial images [Karkkainen and Joo(2021), Merler et al.(2019)Merler, Ratha, Feris, and Smith] and skin analysis [Kinyanjui et al.(2020)Kinyanjui, Odonga, Cintas, Codella, Panda, Sattigeri, and Varshney]. The Fitzpatrick scale is derived from ITA by predefined segmentation into 6 groups.

Hue angle. Hue angle h∗ measures the perceived gradation of colors, and is defined as the angular coordinate in the L∗a∗b∗ space:

h∗=arctan(b∗a∗)×180∘π,(2)

where h∗ ranges from 0∘ to 360∘. However, we are primarily interested in the values between 0∘ to 90∘, since they correspond to the red and yellow colors in which skin undertone is expressed [Chardon et al.(1991)Chardon, Cretois, and Hourseau]. The hue angle was originally proposed for skin color measurements by [Weatherall and Coombs(1992)], and is now widely adapted for skin color estimation in cosmetology [De Rigal et al.(2007)De Rigal, Abella, Giron, Caisey, and Lefebvre].

In our experiments, to ensure that these quantities are not biased, we extract the skin tone values from face pictures leveraging a proprietary model implementing the methodology detailed in [Malherbe et al.(2022)Malherbe, Remise, Zhang, and Perrot, Robin et al.(2020)Robin, Loïc, Malherbe, and Perrot]. Since the underlying algorithm aims to approximate physical measurements from a device, it is not susceptible to human-induced annotation bias. The detailed methodology is beyond the scope of this paper.

From continuous to discrete: enhancing fairness in sensitive variable segmentation

In this paper, we place ourselves in the case of a dataset with a binary classification task as target outcome and a continuous sensitive attribute. Formally, we consider a dataset consisting of i.i.d observations (X,L,Y)∼𝒟, tuples of random variables X∈ℝd (d∈ℕ), L∈ℒ⊂ℝp (p=1 or 2) and Y∈{0,1} drawn from a distribution 𝒟. In our application, X contains images of human faces in the RGB color space, L is a continuous (multidimensional) sensitive attribute corresponding to skin color, such as L∗, ITA or (L∗,h∗) from CIE L∗a∗b∗ color space defined in previous section, and Y is an observed outcome variable. The parameters θ of a binary classifier Yˆ=gθ(X)∈{0,1} are trained using the observations from the dataset 𝒟. In this setting, our objectives are two-fold:

Showcase the relevance of using continuous (possibly, multidimensional) skin color score to measure bias in Computer Vision datasets and models;

Propose a fairness-based segmentation of continuous (multidimensional) skin color. In other words, instead of measuring the fairness of a dataset or a model using predefined groups (e.g. Pale vs. Not Pale, Fitzpatrick groups), we propose to divide the observation according to groups in the skin color space ℒ. Such groups would need (i) to be connected and (ii) to have homogeneous levels of discrimination for the target problem Y or model Yˆ.

For the second objective, we formally write a partition 𝒫={𝒫k}k=1K as a set of connected subsets 𝒫k⊂ℒ with the two following properties: there is no overlap between elements of the partition: ∀k1,k2∈{1,…,K}, 𝒫k1∩𝒫k2=∅; and 𝒫 totally covers ℒ: ∪k=1K𝒫k=ℒ. We consider that the number of groups K is given, as a user-defined variable.

In the remainder of the paper, we omit ∗ in the notation of L∗ and h∗ for readability purposes. Although we will keep the example of skin tone, our methods apply to any continuous sensitive attribute.

Inter-group variability as criteria for a fairness based segmentation

We now focus on dividing ℒ into K groups 𝒫k representing different levels of fairness, given a classification problem. Contrary to predefined groups, these groups should be based on the level of discrimination introduced by either the ground truth Y or the predicted variable Yˆ.

Formally, for a partition 𝒫 we define S𝒫 to be a multinomial random variable associating the observations of L to their group 𝒫k:

S𝒫=k⟺L∈𝒫k, where k=1,…,K,(3)

which is commonly called the group membership. Note that while it is generally a provided variable in the dataset, it depends here on the partition 𝒫 and is thus not fixed given an observation. Then, we define Φ(S𝒫) as a real function of this multinomial random variable S𝒫. Φ is an extension of a fairness measure m computed on each group 𝒫k and takes K values Φ(k), k=1,…,K:

Φ(k)=m(𝒟,𝒫k)∈ℝ.(4)

For instance, a typical measure m is the disparate impact, computed for samples in group 𝒫k versus all other samples:

m(𝒟,𝒫k)=ℙ(Y=1|L∈𝒫k)−ℙ(Y=1|L∉𝒫k).(5)

We propose to find the partition 𝒫 of the continuous sensitive attribute L, such that its components 𝒫k have the most different levels of discrimination according to the fairness measured by Φ. In other terms, such partition is the most expressive one in terms of the measure of fairness Φ. Our objective is thus to find the partition 𝒫 over all possible partitions that maximizes:

arg max𝒫⁡𝕍ar(Φ(S𝒫)).(6)

where the variance is calculated over the observations of L in the dataset. The variance of Φ(S𝒫) can thus be rewritten as:

𝕍ar(Φ(S𝒫))=𝕍arL∼𝒟(Φ(S𝒫))==∫l∈ℒ(Φ(S𝒫)−𝔼[Φ(S𝒫)])2pL(l)dl=(7)
=∑k=1K∫l∈𝒫k(Φ(k)−𝔼[Φ(S𝒫)])2pL(l)dl==∑k=1Kℙ(S𝒫=k)(Φ(k)−𝔼[Φ(S𝒫)])2,(8)

where pL(l) is the probability density function of L and

𝔼[Φ(S𝒫)]=∫l∈ℒΦ(S𝒫)pL(l)dl=∑k=1Kℙ(S𝒫=k)Φ(k).(9)

The interpretation behind this maximization is two-fold. First, from the expression over 𝒟 of Equation (7), we argue that the exact partition maximizes the variability of fairness outcomes across observations, so that it obtains on average the most ”unfair” measures for each person of 𝒟. Indeed, the variance in question captures the mean deviation between each observation’s group fairness measure Φ(S𝒫) and the population-wide expected fairness value. Second, when expressed as a sum over the groups (Equation (8)), this same variance can be viewed as the inter-group variance—weighted by each group’s probability ℙ(S𝒫=k). Hence, maximizing it enhances the “expressivity” of our partition by increasing the variability of fairness measures among groups.

One-group-versus-all as fairness measure

We propose to choose the fairness measure m(𝒟,𝒫k) (Equation (4)) based on the following. A model g is considered fair w.r.t. the sensitive attribute S𝒫 if the model’s output does not depend on the value of the sensitive attribute. This is usually modeled as the expected output Yˆ being independent of the sensitive attribute S𝒫:

𝔼[Yˆ]=𝔼[Yˆ|S𝒫=k],∀k=1,…,K.(10)

Hence, we choose as fairness measure:

Φ(k)=m(𝒟,𝒫k)=ℙ(Y=1|S𝒫=k)−ℙ(Y=1).(11)

This measure is a natural extension of the well-known disparate impact for two classes (see Section 4.3) and is related to the definition of subgroup fairness defined in [Kearns et al.(2018)Kearns, Neel, Roth, and Wu]. Under this choice, Equation (6) can be rewritten in the following way

𝕍ar(Φ(S𝒫))=𝕍ar(ℙ(Y=1|S𝒫)−ℙ(Y=1))==∑k=1Kℙ(L∈𝒫k)(ℙ(Y=1|S𝒫=k)−ℙ(Y=1))2.(12)

Note that 𝔼[Φ(S𝒫)]=𝔼[ℙ(Y=1|S𝒫)−ℙ(Y=1)]=0.

Therefore, maximizing the variance defined in Equation (12) when Y is binary is equivalent to maximizing the sum of squared distances between 𝔼[Y] and 𝔼[Y|S𝒫=k] for each group 𝒫k. Each of the terms is multiplied by the ”weight” of the group 𝒫k, which takes into account the impact of this group on the population. We see that with this fairness measure, the optimal partition 𝒫 has the groups with the worst-case level of discrimination and with the major impact, or equivalently the most discriminating partition. In the following section, we provide a formal expression illustrating this in the case K=2.

Relation with Disparate Impact in the binary case

For K=2, we establish the relation between the Φ(k) chosen in the previous section, and the well-known Disparate Impact. The proof is in Appendix A. In the proposition below, we shift S𝒫 values (Equation (3)) to 0 and 1 to align with usual binary notations.

The maximized quantity π(1−π)DI2 is made of two terms. First, the usual DI which promotes a separation into groups exhibiting the most different behaviors, and thus promoting unfairness. Second, the impact of the weights π(1−π) enforces the probability of occurrence of the two groups to be as similar as possible, with a maximum achieved for this part at π=1/2. This provides another insight of the criterion we promote. We do not want to select a too small (or too large) group w.r.t. the other, exhibiting a particular behavior due to its size difference. Our objective is rather to identify two kind of behaviors which are intrinsically different without relying on the sampling properties of the individuals. This is coherent with the choice of so-called balance error groups when providing a mathematically sound definition for bias in the data as shown in [Gordaliza et al.(2019)Gordaliza, Del Barrio, Fabrice, and Loubes].

Fairness aware segmentation algorithms

In the following section, we provide methods to find the partition from Equation (6) for one- and two-dimensional sensitive variable L∈ℒ⊂ℝp, p=1,2. We consider partitions 𝒫 as follows:

In the one-dimensional case, we consider 𝒫k=[lk−1,lk] to be segments, with lk−1<lk.

In the two-dimensional case, we consider 𝒫k to be rectangles, i.e. of the shape [l,l′]×[h,h′].

Leveraging K-Means in the case of monotonic fairness in 1D

Finding the exact solution to Equation (6) is not feasible. Hence an alternative is given by clustering algorithms [Ezugwu et al.(2022)Ezugwu, Ikotun, Oyelade, Abualigah, Agushaka, Eke, and Akinyelu, Xu and Wunsch(2005)], which naturally align with a segmentation objective. Since we aim at maximizing the distance between different groups in terms of the fairness measure Φ, we naturally consider applying the usual K-Means algorithm [MacQueen(1967)] on a set of points ψj∈ℝ whose values will aim at reflecting this fairness. This procedure is detailed hereafter.

Let us consider M∈ℕ and a grid Λ={λ0,…,λM} on ℒ, where λj=λ0+jδ, δ=λM−λ0M, j=0,…,M. We compute on the M intervals the ψj=ℙ(Y=1|L∈[λj−1,λj])−ℙ(Y=1), j=1,...,M, as shown in Figure 1. In this case, applying K-means on the ψj will compute a partition 𝒫 that minimizes

arg min𝒫⁡∑k=1K∑j=1M(ψj−μk)2𝟙{ψj∈𝒫k},(14)

where μk=∑j=1Mψj𝟙{ψj∈𝒫k}∑j=1M𝟙{ψj∈𝒫k} is the centroid of the k -th group.

By applying K-Means algorithm, the k -th cluster will correspond to 𝒫k. The ψj values will be homogeneous within each cluster, while being as distinct as possible between clusters. The K-Means minimization is indeed equivalent to maximizing the sum of (μk−𝔼(μk))2 over clusters, which relates to the maximization problem given by Equation (6). One notes that this is an heuristic approach and the obtained 𝒫 is not the exact solution of Equation (6). Indeed, while groups 𝒫k will be homogeneous in terms of fairness express by ψj, the exact Φ (Equation 4) is not computed on the groups 𝒫k, and in particular Φ(k)≠μk.

Furthermore, in general, K-Means do not guarantee that groups will be connected in the ℒ space. The underlying distance used in L dimension between λj1 and λj2 is indeed |ψj1−ψj2|, which can take low or null values for far λj1,λj2∈ℒ. We now define the property of monotonic fairness, that will guarantee that each groups from this method is connected.

According to Proposition 2, the assumption of monotonicity of fairness is crucial, since if it is not fulfilled, K-Means can produce groups that are disconnected (see Figure 6 in Appendix B for details). This notion of monotonic fairness can well occur in practice, for example in skin tone, as we’ll illustrate in the following sections.

Note that Y may be replaced by the model output Yˆ in Definition 1 and Proposition 2, to analyze the model forecasts’ discrimination.

FairGroups: exhaustive search with optimal precalculation of fairness metric Φ

We now look for the solution of Equation (6) in the general case, without any assumption on function P(Y=1|L=l). We again consider a grid Λ on L with M intervals. To find the partition 𝒫 for a given K, we perform an exhaustive search over all possible combinations of intervals on the grid [λj1,λj2], j1<j2. To speed up the exhaustive search, we propose Algorithms 1 and 2 (Appendix C) to efficiently precalculates Ψj1,j2:=ℙ(Y=1|L∈[λj1,λj2])−ℙ(Y=1), ∀j1<j2 with a complexity O(M2) using a dynamic programming strategy.

For this, we define an upper triangular matrix UΨΛ∈ℝM×M where we store all the precalculated values as follows

(UΨΛ)i,j={Ψi−1,j, for i≤j, where i,j=1,…,M−1,0, for i>j.

Each value Ψj1,j2 of matrix UΨΛ is estimated using the ratio between ∑j1<j2∑𝒟𝟙{L∈[λj1,λj2]}𝟙{Y=1} and ∑j1<j2∑𝒟𝟙{L∈[λj1,λj2]}, that both can be computed by recurrence on λj1 and λj2 using Algorithm 1. Matrix UΨΛ is then efficiently precomputed with Algorithm 2 and is subsequently used for exhaustive search. This eliminates the need to recalculate the values of Ψj1,j2, when evaluating potential combination of intervals, thereby significantly speeding up the computational process. One notes that given the grid Λ, the ψj defined in the previous section are the diagonal of UΨΛ, since ψj=Ψj−1,j

Given this matrix UΨΛ, we find the partition 𝒫 of segments 𝒫k=[λjk−1,λjk] (jk−1<jk) of Equation (6) as:

arg max0<j1<j2<…⋯<jK−1<M⁡∑k=1Kℙ(L∈[λjk−1,λjk])(Ψjk−1,jk−𝔼[Φ(S𝒫)])2,

where 𝔼[Φ(S𝒫)]=∑k=1Kℙ(L∈[λjk−1,λjk])Ψjk−1,jk. The ℙ(L∈[λjk−1,λjk]) values are precalculated using Algorithm 1. The solution is then exact, up to the approximation of the partitions search space induced by the grid Λ.

Partition of L[0,M] into intervals corresponding to SP=1,2,3.
Figure 1. Partition of L∈[λ0,λM] into intervals corresponding to S𝒫=1,2,3.

Experiments

The code for using our methods and reproducing these experiments is in open access (https://github.com/artefactory/fairness_metrics).

Synthetic datasets

We first evaluate our proposed methods on a series of synthetic data. To do so, we suppose that the discrimination is expressed in the dataset in terms of Statistical Parity, i.e. we have distinct intervals with different probability of success ℙ(Y=1|L). We also choose to work in the scenario of monotonic fairness (Proposition 2).

We suppose that L∼𝒰(0,100) and corresponding Y∼Bernoulli(p(L)), where p(L)=0.1×𝟙{L≤20}+0.3×𝟙{20<L≤30}+0.5×𝟙{30<L≤55}+0.7×𝟙{55<L≤88}+0.9×𝟙{88<L≤100} (see Figure 2). First, we sample N=50000 pairs of observations (L,Y) from this distribution 𝒟. Second, to illustrate a non-uniform scenario, we additionally sample a dataset in the case L follows a truncated normal distribution on [0,100] from ∼𝒩(50,20). The two empirical distributions are shown in Figure 7 (Appendix D).

On both datasets, we apply the K-Means and the FairGroups methods to find the partition of L, as shown in Figure 2. We compute Φ(S𝒫) values for each group 𝒫k in y-axis, as well as their asymptotic confidence intervals using the delta method following the work [Besse et al.(2022)Besse, del Barrio, Gordaliza, Loubes, and Risser] (as red transparent areas in Figures 2 and 9 in Appendix D). To measure how close each found partition is to the ground truth partition, we measure the pairwise Rand index [Rand(1971)] with the ground truth partition, a common measure of the similarity between two data clusterings. One notes that the ground truth partition is independent of the L distribution and is thus the same for both synthetic datasets. Table 1 shows results alongside the variance 𝕍ar(Φ(S𝒫)) values.

From Figure 2 and Table 1, we conclude that FairGroups approach managed to find the ground truth partition almost perfectly, i.e. the Rand Index is 0.99. Furthermore, we can see that FairGroups manages to find the ground truth partition of L regardless of its distribution, with very high Rand Index for the non-uniform distribution. On the other hand, K-Means groups remains quite close to the ground truth in the case of uniform data, but is less accurate than FairGroups. For non-uniform data, we see that K-Means Rand Index is even lower.

Data and protocol for face analysis w.r.t skin tone

In this section, we use the women face pictures of CelebA dataset [Liu et al.(2015)Liu, Luo, Wang, and Tang] as 𝒟, with the number of observations N=84602. We predict skin tone L,a,b values for each image in 𝒟 using the proprietary algorithm [Robin et al.(2020)Robin, Loïc, Malherbe, and Perrot], and derive from it L, ITA or (L,h) as the sensitive variable. As the target output variable Y, we use the attribute ”Attractive”. We fine-tune on 5 epochs a ResNet18 [He et al.(2016)He, Zhang, Ren, and Sun] as model gθ, without any bias mitigation strategy, with batch size equal to 64. The prediction Yˆ for each CelebA image is obtained after a 5-fold cross-validation, stratified on 10 equal-sized bins of L. We also consider FFHQ (https://github.com/NVlabs/ffhq-dataset) (N=26906) for assessing the generalization of our partitioning algorithm, with skin tone extracted as for CelebA pictures. FFHQ does not have a ground truth Y for our task, so that we predict Yˆ as the mean of our models gθ, meaning we are looking at the discrimination of the same model. Please note that the sensitive attribute values being estimated by a proprietary algorithm, they cannot be publicly shared.

The ”Attractive” target on CelebA dataset represents an interesting case of monotonic fairness (Definition 1), as shown in Figure 4. We indeed observe in the initial data as well as in the model’s predictions that, on average, the darker a person’s skin is, the more discriminated they are. Please note that this target is known to represent a biased annotation [Risser et al.(2022)Risser, Sanz, Vincenot, and Loubes], and was chosen purely for illustrative purpose.

Partitions of skin tone in 1D

We estimated partitions of skin tone given by ITA and compare them to the default partition of ITA with Fitzpatrick scale in 6 groups. Figure 3 and Table 2 show the results comparing the different groupings. Both FairGroups and K-Means partitions identify groups with varying levels of discrimination. The Fitzpatrick scale, as a default partition, does not consider the underlying data distribution, so that the confidence intervals for certain groups are relatively broad, so that it is difficult to draw conclusions regarding fairness between groups.

We also consider the partitions of FFHQ and compare them with the partitions of CelebA applied to FFHQ, as done in the previous subsection. From Table 2, we observe that both FairGroups and K-Means partitions remain stable when the data distribution changes. This suggests that the partitions effectively reveal how discrimination manifests within the sensitive attribute space.

Amplification of skin color bias by the model

The proposed data-driven segmentation can also uncover whether discrimination is exacerbated when a model is trained on the target task. This is indeed the case if the differences between Φ(S𝒫) values for the ground truth Y and the model’s output Yˆ are significant.

To demonstrate that the model amplifies discrimination on CelebA, we first compute FairGroups partition 𝒫 by using Y as a target variable. We then use this partition to recalculate the values of Φ(S𝒫) for Yˆ as a target (Equation 11). Figure 4 illustrates that the discrimination is significantly amplified for the darkest skin tones (L<43) in the CelebA dataset, since the fairness measure Φ(S𝒫) calculated on the predicted Yˆ is significantly lower than when computed on the ground truth Y.

Extension to partitioning skin tone in 2D

We now compare different partitions in the two-dimensional space (L,h). In the literature, the default partition into 4 groups with the thresholds L≤60 and h≤55 is used to conclude about fairness [Thong et al.(2023)Thong, Joniak, and Xiang]. In Figure 5, we compare the partition 𝒫 computed by FairGroups with this default partition in the left, and the confidence intervals for Φ(S𝒫) on the right. We see that FairGroups partition identifies two discriminated groups (Groups I and II), while the default partition captures only one (Group I). Indeed, according to the default partition, Group II has a value Φ(S𝒫) close to 0, suggesting that this group is not discriminated against. In contrast, the same group identified by FairGroups, located in the same quadrant, has a Φ(S𝒫) close to -0.2, indicating discrimination. Additionally, FairGroups partition finds a Group I facing a higher level of discrimination than the equivalent in default segmentation. Moreover, we note that the confidence intervals for Φ(S𝒫) in FairGroups partition are narrower compared to those of the default groups.

In Table 3, we compute the 𝕍ar(Φ(𝒮𝒫)) values for the two partitions on CelebA and FFHQ, and observe significantly higher values for the one from FairGroups. We also apply the CelebA partition to FFHQ and demonstrate that it closely aligns with the skin tone partition of FFHQ (see Table 3), thus revealing how discrimination manifests in the skin tone space.

Partitions on synthetic dataset with uniform distribution of L: P(Y=1|L) on the left and FairGroups partition on the right.
Figure 2. Partitions on synthetic dataset with uniform distribution of L: ℙ(Y=1|L) on the left and FairGroups partition on the right.
Partitions of IT!A using different methods.
Figure 3. Partitions of ITA using different methods. Fitzpatrick (default) partition of ITA (top). FairGroups partition of ITA (bottom left). K-Means partition of ITA (bottom right).
Bias amplification for dark skin tones.
Figure 4. Bias amplification for dark skin tones. Conditional distribution of ”Attractive” (Y/Yˆ) w.r.t. L (left). FairGroups partition of L based on Φ(S𝒫) and Y (right).
Default and FairGroups Partition of (L,h) into 4 groups on CelebA (left), and their (SP) with Confidence intervals (right).
Figure 5. Default and FairGroups Partition of (L,h) into 4 groups on CelebA (left), and their Φ(S𝒫) with Confidence intervals (right).

Application to model debiasing

In this section, we leverage the proposed partitions to mitigate bias at inference time through a post-processing strategy. Specifically, we adopt the optimal transport-based approach introduced in [Gouic et al.(2020)Gouic, Loubes, and Rigollet], which maps the conditional distribution of model scores for each group to a fair target distribution. This approach is supported by a theoretical result related to Statistical Parity (SP): the minimum classification error achievable under SP constraints corresponds to the solution of a Wasserstein barycenter problem [Gouic et al.(2020)Gouic, Loubes, and Rigollet]. In this framework, the barycenter serves as a common target distribution to which group-conditional score distributions are aligned, ensuring SP across groups while minimizing the loss in predictive accuracy.

In practice, our methodology closely follows the procedure outlined in [Gouic et al.(2020)Gouic, Loubes, and Rigollet] and [Xian et al.(2023)Xian, Yin, and Zhao], where the predicted score distribution for a group 𝒫k is adjusted via a transformation of its cumulative distribution function. Let ηk(X)=𝔼(Y|X,L∈𝒫k) denote the conditional expected score for group 𝒫k; the goal is to map this distribution to a group-specific target distribution gk∗ by solving:

min∀k,gk∈𝒢∀k,k′‖gk−gk′‖∞<α⁡∑k=1Kℙ(L∈𝒫k)2W1(ηk,gk),(16)

where α∈[0,1] is a user parameter, W1 the Wasserstein-1 distance and 𝒢 the class of scorers in X space (gk∗ representing ℙ(Yˆ=1|X,L∈𝒫k)). We select W1 as our application focuses on binary classification; please note that for regression tasks or scenarios requiring Equality of Odds, W2 is more appropriate, as detailed in [Gouic et al.(2020)Gouic, Loubes, and Rigollet]. The details for this post-processing is beyond the scope of this paper (see Appendix F for experimental illustrations).

We evaluated this post-processing on the model gθ obtained using the protocol of Section 6.2. We calculated PR-AUC [Zhu(2004)] and HGR [Mary et al.(2019)Mary, Calauzenes, and El Karoui] between predictions and ITA using the corrected ℙ(Yˆ=1|X) predicted on the successive test sets. As shown in Table 4, post-processing with FairGroups achieves the lowest HGR score, indicating a significant reduction in dependence between the predictions and the sensitive attribute, with only a minor reduction of accuracy and PR-AUC. This appears to be the best trade-off between predictive performance and fairness, which demonstrates the effectiveness of FairGroups partition to mitigate the bias of a model.

Note that given a sample X, this post-processing requires to know the sensitive attribute L in order to debias the predicted Yˆ, which is accessible at inference time for our industrial scenario [Robin et al.(2020)Robin, Loïc, Malherbe, and Perrot].

Conclusion

In this paper, we proposed FairGroups, a data-driven algorithm aiming to divide a continuous sensitive variable into groups that reflects the unfairness of a given task. We observed on synthetic and real-world datasets that our method successfully captures the specificities of the target task while taking into account the group sizes, contrary to predefined groups. FairGroups partitions obtain better evaluation metrics, and appear stable across various data distributions.

We performed extensive experiments on the case of skin tone on CelebA and FFHQ face pictures, which is a typical sensitive attribute that we extracted as a continuous physical quantity using a proprietary algorithm. We observed the property of monotonic fairness w.r.t. skin tone, for which K-Means grouping provides a practical and effective approximation to the exact solution. We could also apply and validate FairGroups partitions in one and two-dimensional skin tone spaces, and obtain the best trade-off between fairness and accuracy when applying on it model debiasing based on an optimal-transport post-processing.

As future work, we will study the impact of the choice of K and investigate its optimal value, and improve the scalability of our algorithm in the case of multi-dimensional sensitive attribute.

Next step

A problem worth researching?

Tell us what you are trying to solve, and we will put you in touch with the people who work on it.