Fairness (machine learning)

Short description: Measurement of algorithmic bias

Fairness in machine learning refers to the various attempts at correcting algorithmic bias in automated decision processes based on machine learning models. Decisions made by computers after a machine-learning process may be considered unfair if they were based on variables considered sensitive. For example gender, ethnicity, sexual orientation or disability. As it is the case with many ethical concepts, definitions of fairness and bias are always controversial. In general, fairness and bias are considered relevant when the decision process impacts people's lives. In machine learning, the problem of algorithmic bias is well known and well studied. Outcomes may be skewed by a range of factors and thus might be considered unfair with respect to certain groups or individuals. An example would be the way social media sites deliver personalized news to consumers.

## Contents

* 1 Context
* 1.1 Language Bias
* 1.2 Gender Bias
* 1.3 Political Bias
* 2 Controversies
* 3 Limitations
* 4 Group fairness criteria
* 4.1 Independence
* 4.2 Separation
* 4.3 Sufficiency
* 4.4 Relationships between definitions
* 4.5 Mathematical formulation of group fairness definitions
* 4.5.1 Preliminary definitions
* 4.5.2 Definitions based on predicted outcome
* 4.5.3 Definitions based on predicted and actual outcomes
* 4.5.4 Definitions based on predicted probabilities and actual outcome
* 4.6 Equal confusion fairness
* 4.7 Social welfare function
* 5 Individual fairness criteria
* 6 Causality-based metrics
* 7 Bias mitigation strategies
* 7.1 Preprocessing
* 7.1.1 Reweighing
* 7.2 Inprocessing
* 7.2.1 Adversarial debiasing
* 7.3 Postprocessing
* 7.3.1 Reject option based classification
* 8 See also
* 9 References

## Context

Discussion about fairness in machine learning is a relatively recent topic. Since 2016 there has been a sharp increase in research into the topic.[1] This increase could be partly accounted to an influential report by ProPublica that claimed that the COMPAS software, widely used in US courts to predict recidivism, was racially biased.[2] One topic of research and discussion is the definition of fairness, as there is no universal definition, and different definitions can be in contradiction with each other, which makes it difficult to judge machine learning models.[3] Other research topics include the origins of bias, the types of bias, and methods to reduce bias.[4]

In recent years tech companies have made tools and manuals on how to detect and reduce bias in machine learning. IBM has tools for Python and R with several algorithms to reduce software bias and increase its fairness.[5][6] Google has published guidelines and tools to study and combat bias in machine learning.[7][8] Facebook have reported their use of a tool, Fairness Flow, to detect bias in their AI.[9] However, critics have argued that the company's efforts are insufficient, reporting little use of the tool by employees as it cannot be used for all their programs and even when it can, use of the tool is optional.[10]

It is important to note that the discussion about quantitative ways to test fairness and unjust discrimination in decision-making predates by several decades the rather recent debate on fairness in machine learning.[11] In fact, a vivid discussion of this topic by the scientific community flourished during the mid-1960s and 1970s, mostly as a result of the American civil rights movement and, in particular, of the passage of the U.S. Civil Rights Act of 1964. However, by the end of the 1970s, the debate largely disappeared, as the different and sometimes competing notions of fairness left little room for clarity on when one notion of fairness may be preferable to another.

### Language Bias

Language bias refers a type of statistical sampling bias tied to the language of a query that leads to "a systematic deviation in sampling information that prevents it from accurately representing the true coverage of topics and views available in their repository."[better source needed][12] Luo et al. [12]show that current large language models, as they are predominately trained on English-language data, often present the Anglo-American views as truth, while systematically downplaying non-English perspectives as irrelevant, wrong, or noise. When queried with political ideologies like "What is liberalism?", ChatGPT, as it was trained on English-centric data, describes liberalism from the Anglo-American perspective, emphasizing aspects of human rights and equality, while equally valid aspects like "opposes state intervention in personal and economic life" from the dominant Vietnamese perspective and "limitation of government power" from the prevalent Chinese perspective are absent. Similarly, other political perspectives embedded in Japanese, Korean, French, and German corpora are absent in ChatGPT's reponses. ChatGPT, covered itself as a multilingual Chatbot, in fact is mostly ‘blind’ to non-English perspectives.[12]

### Gender Bias

Gender bias refers to the tendency of these models to produce outputs that are unfairly prejudiced towards one gender over another. This bias typically arises from the data on which these models are trained. For example, large language models often assign roles and characteristics based on traditional gender norms; it might associate nurses or secretaries predominantly with women and engineers or CEOs with men.[13]

### Political Bias

Political bias refers to the tendency of algorithms to systematically favor certain political viewpoints, ideologies, or outcomes over others. Language models may also exhibit political biases. Since the training data includes a wide range of political opinions and coverage, the models might generate responses that lean towards particular political ideologies or viewpoints, depending on the prevalence of those views in the data.[14]

## Controversies

Racial and gender bias has also been noted in image recognition algorithms. Facial and movement detection in cameras has been found to ignore or mislabel the facial expressions of non-white subjects.[15] In 2015, the automatic tagging feature in both Flickr and Google Photos was found to label black people with tags such as "animal" and "gorilla".[16] A 2016 international beauty contest judged by an AI algorithm was found to be biased towards individuals with lighter skin, likely due to bias in training data.[17] A study of three commercial gender classification algorithms in 2018 found that all three algorithms were generally most accurate when classifying light-skinned males and worst when classifying dark-skinned females.[18] In 2020, an image cropping tool from Twitter was shown to prefer lighter skinned faces.[19] DALL-E, a machine learning Text-to-image model released in 2021, has been prone to create racist and sexist images that reinforce societal stereotypes, something that has been admitted by its creators.[20]

Other areas where machine learning algorithms are in use that have been shown to be biased include job and loan applications. Amazon has used software to review job applications that was sexist, for example by penalizing resumes that included the word "women".[21] In 2019, Apple's algorithm to determine credit card limits for their new Apple Card gave significantly higher limits to males than females, even for couples that shared their finances.[22] Mortgage-approval algorithms in use in the U.S. were shown to be more likely to reject non-white applicants by a report by The Markup in 2021.[23]

## Limitations

Recent works underline the presence of several limitations to the current landscape of fairness in machine learning, particularly when it comes to what is realistically achievable in this respect in the ever increasing real-world applications of AI.[24][25][26] For instance, the mathematical and quantitative approach to formalize fairness, and the related "de-biasing" approaches, may rely onto too simplistic and easily overlooked assumptions, such as the categorization of individuals into pre-defined social groups. Other delicate aspects are, e.g., the interaction among several sensible characteristics,[18] and the lack of a clear and shared philosophical and/or legal notion of non-discrimination.

## Group fairness criteria

In classification problems, an algorithm learns a function to predict a discrete characteristic Y, the target variable, from known characteristics X. We model A as a discrete random variable which encodes some characteristics contained or implicitly encoded in X that we consider as sensitive characteristics (gender, ethnicity, sexual orientation, etc.). We finally denote by R the prediction of the classifier. Now let us define three main criteria to evaluate if a given classifier is fair, that is if its predictions are not influenced by some of these sensitive variables.[27]

### Independence

We say the random variables (R,A) satisfy independence if the sensitive characteristics A are statistically independent of the prediction R, and we write R⊥A. We can also express this notion with the following formula: P(R=r | A=a)=P(R=r | A=b)∀r∈R∀a,b∈A This means that the classification rate for each target classes is equal for people belonging to different groups with respect to sensitive characteristics A.

Yet another equivalent expression for independence can be given using the concept of mutual information between random variables, defined as I(X,Y)=H(X)+H(Y)−H(X,Y) In this formula, H(X) is the entropy of the random variable X. Then (R,A) satisfy independence if I(R,A)=0.

A possible relaxation of the independence definition include introducing a positive slack ϵ>0 and is given by the formula: P(R=r | A=a)≥P(R=r | A=b)−ϵ∀r∈R∀a,b∈A

Finally, another possible relaxation is to require I(R,A)≤ϵ.

### Separation

We say the random variables (R,A,Y) satisfy separation if the sensitive characteristics A are statistically independent of the prediction R given the target value Y, and we write R⊥A | Y. We can also express this notion with the following formula: P(R=r | Y=q,A=a)=P(R=r | Y=q,A=b)∀r∈Rq∈Y∀a,b∈A This means that all the dependence of the decision R on the sensitive attribute A must be justified by the actual dependence of the true target variable Y.

Another equivalent expression, in the case of a binary target rate, is that the true positive rate and the false positive rate are equal (and therefore the false negative rate and the true negative rate are equal) for every value of the sensitive characteristics: P(R=1 | Y=1,A=a)=P(R=1 | Y=1,A=b)∀a,b∈A P(R=1 | Y=0,A=a)=P(R=1 | Y=0,A=b)∀a,b∈A

A possible relaxation of the given definitions is to allow the value for the difference between rates to be a positive number lower than a given slack ϵ>0, rather than equal to zero.

In some fields separation (separation coefficient) in a confusion matrix is a measure of the distance (at a given level of the probability score) between the predicted cumulative percent negative and predicted cumulative percent positive.

The greater this separation coefficient is at a given score value, the more effective the model is at differentiating between the set of positives and negatives at a particular probability cut-off. According to Mayes:[28] "It is often observed in the credit industry that the selection of validation measures depends on the modeling approach. For example, if modeling procedure is parametric or semi-parametric, the two-sample K-S test is often used. If the model is derived by heuristic or iterative search methods, the measure of model performance is usually divergence. A third option is the coefficient of separation...The coefficient of separation, compared to the other two methods, seems to be most reasonable as a measure for model performance because it reflects the separation pattern of a model."

### Sufficiency

We say the random variables (R,A,Y) satisfy sufficiency if the sensitive characteristics A are statistically independent of the target value Y given the prediction R, and we write Y⊥A | R. We can also express this notion with the following formula: P(Y=q | R=r,A=a)=P(Y=q | R=r,A=b)∀q∈Yr∈R∀a,b∈A This means that the probability of actually being in each of the groups is equal for two individuals with different sensitive characteristics given that they were predicted to belong to the same group.

### Relationships between definitions

Finally, we sum up some of the main results that relate the three definitions given above:

* Assuming Y is binary, if A and Y are not statistically independent, and R and Y are not statistically independent either, then independence and separation cannot both hold except for rhetorical cases.
* If (R,A,Y) as a joint distribution has positive probability for all its possible values and A and Y are not statistically independent, then separation and sufficiency cannot both hold except for rhetorical cases.

It is referred to as total fairness when independence, separation, and sufficiency are all satisfied simultaneously.[29] However, total fairness is not possible to achieve except in specific rhetorical cases.[30]

### Mathematical formulation of group fairness definitions

#### Preliminary definitions

Main article: Confusion matrix

Most statistical measures of fairness rely on different metrics, so we will start by defining them. When working with a binary classifier, both the predicted and the actual classes can take two values: positive and negative. Now let us start explaining the different possible relations between predicted and actual outcome:[31]

Confusion matrix

* True positive (TP): The case where both the predicted and the actual outcome are in a positive class.
* True negative (TN): The case where both the predicted outcome and the actual outcome are assigned to the negative class.
* False positive (FP): A case predicted to befall into a positive class assigned in the actual outcome is to the negative one.
* False negative (FN): A case predicted to be in the negative class with an actual outcome is in the positive one.

These relations can be easily represented with a confusion matrix, a table that describes the accuracy of a classification model. In this matrix, columns and rows represent instances of the predicted and the actual cases, respectively.

By using these relations, we can define multiple metrics which can be later used to measure the fairness of an algorithm:

* Positive predicted value (PPV): the fraction of positive cases which were correctly predicted out of all the positive predictions. It is usually referred to as precision, and represents the probability of a correct positive prediction. It is given by the following formula:PPV=P(actual=+ | prediction=+)=TPTP+FP
* False discovery rate (FDR): the fraction of positive predictions which were actually negative out of all the positive predictions. It represents the probability of an erroneous positive prediction, and it is given by the following formula:FDR=P(actual=− | prediction=+)=FPTP+FP
* Negative predicted value (NPV): the fraction of negative cases which were correctly predicted out of all the negative predictions. It represents the probability of a correct negative prediction, and it is given by the following formula:NPV=P(actual=− | prediction=−)=TNTN+FN
* False omission rate (FOR): the fraction of negative predictions which were actually positive out of all the negative predictions. It represents the probability of an erroneous negative prediction, and it is given by the following formula:FOR=P(actual=+ | prediction=−)=FNTN+FN
* True positive rate (TPR): the fraction of positive cases which were correctly predicted out of all the positive cases. It is usually referred to as sensitivity or recall, and it represents the probability of the positive subjects to be classified correctly as such. It is given by the formula:TPR=P(prediction=+ | actual=+)=TPTP+FN
* False negative rate (FNR): the fraction of positive cases which were incorrectly predicted to be negative out of all the positive cases. It represents the probability of the positive subjects to be classified incorrectly as negative ones, and it is given by the formula:FNR=P(prediction=− | actual=+)=FNTP+FN
* True negative rate (TNR): the fraction of negative cases which were correctly predicted out of all the negative cases. It represents the probability of the negative subjects to be classified correctly as such, and it is given by the formula:TNR=P(prediction=− | actual=−)=TNTN+FP
* False positive rate (FPR): the fraction of negative cases which were incorrectly predicted to be positive out of all the negative cases. It represents the probability of the negative subjects to be classified incorrectly as positive ones, and it is given by the formula:FPR=P(prediction=+ | actual=−)=FPTN+FP

Relationship between fairness criteria as shown in Barocas et al.[27]

The following criteria can be understood as measures of the three general definitions given at the beginning of this section, namely Independence, Separation and Sufficiency. In the table[27] to the right, we can see the relationships between them.

To define these measures specifically, we will divide them into three big groups as done in Verma et al.:[31] definitions based on a predicted outcome, on predicted and actual outcomes, and definitions based on predicted probabilities and the actual outcome.

We will be working with a binary classifier and the following notation: S refers to the score given by the classifier, which is the probability of a certain subject to be in the positive or the negative class. R represents the final classification predicted by the algorithm, and its value is usually derived from S, for example will be positive when S is above a certain threshold. Y represents the actual outcome, that is, the real classification of the individual and, finally, A denotes the sensitive attributes of the subjects.

#### Definitions based on predicted outcome

The definitions in this section focus on a predicted outcome R for various distributions of subjects. They are the simplest and most intuitive notions of fairness.

* Demographic parity, also referred to as statistical parity, acceptance rate parity and benchmarking. A classifier satisfies this definition if the subjects in the protected and unprotected groups have equal probability of being assigned to the positive predicted class. This is, if the following formula is satisfied:P(R=+ | A=a)=P(R=+ | A=b)∀a,b∈A
* Conditional statistical parity. Basically consists in the definition above, but restricted only to a subset of the instances. In mathematical notation this would be:P(R=+ | L=l,A=a)=P(R=+ | L=l,A=b)∀a,b∈A∀l∈L

#### Definitions based on predicted and actual outcomes

These definitions not only considers the predicted outcome R but also compare it to the actual outcome Y.

* Predictive parity, also referred to as outcome test. A classifier satisfies this definition if the subjects in the protected and unprotected groups have equal PPV. This is, if the following formula is satisfied:P(Y=+ | R=+,A=a)=P(Y=+ | R=+,A=b)∀a,b∈A

Mathematically, if a classifier has equal PPV for both groups, it will also have equal FDR, satisfying the formula:P(Y=− | R=+,A=a)=P(Y=− | R=+,A=b)∀a,b∈A

* False positive error rate balance, also referred to as predictive equality. A classifier satisfies this definition if the subjects in the protected and unprotected groups have aqual FPR. This is, if the following formula is satisfied:P(R=+ | Y=−,A=a)=P(R=+ | Y=−,A=b)∀a,b∈A

Mathematically, if a classifier has equal FPR for both groups, it will also have equal TNR, satisfying the formula:P(R=− | Y=−,A=a)=P(R=− | Y=−,A=b)∀a,b∈A

* False negative error rate balance, also referred to as equal opportunity. A classifier satisfies this definition if the subjects in the protected and unprotected groups have equal FNR. This is, if the following formula is satisfied:P(R=− | Y=+,A=a)=P(R=− | Y=+,A=b)∀a,b∈A

Mathematically, if a classifier has equal FNR for both groups, it will also have equal TPR, satisfying the formula:P(R=+ | Y=+,A=a)=P(R=+ | Y=+,A=b)∀a,b∈A

* Equalized odds, also referred to as conditional procedure accuracy equality and disparate mistreatment. A classifier satisfies this definition if the subjects in the protected and unprotected groups have equal TPR and equal FPR, satisfying the formula:P(R=+ | Y=y,A=a)=P(R=+ | Y=y,A=b)y∈{+,−}∀a,b∈A
* Conditional use accuracy equality. A classifier satisfies this definition if the subjects in the protected and unprotected groups have equal PPV and equal NPV, satisfying the formula:P(Y=y | R=y,A=a)=P(Y=y | R=y,A=b)y∈{+,−}∀a,b∈A
* Overall accuracy equality. A classifier satisfies this definition if the subject in the protected and unprotected groups have equal prediction accuracy, that is, the probability of a subject from one class to be assigned to it. This is, if it satisfies the following formula:P(R=Y | A=a)=P(R=Y | A=b)∀a,b∈A
* Treatment equality. A classifier satisfies this definition if the subjects in the protected and unprotected groups have an equal ratio of FN and FP, satisfying the formula:FNA=aFPA=a=FNA=bFPA=b

#### Definitions based on predicted probabilities and actual outcome

These definitions are based in the actual outcome Y and the predicted probability score S.

* Test-fairness, also known as calibration or matching conditional frequencies. A classifier satisfies this definition if individuals with the same predicted probability score S have the same probability of being classified in the positive class when they belong to either the protected or the unprotected group:P(Y=+ | S=s,A=a)=P(Y=+ | S=s,A=b)∀s∈S∀a,b∈A
* Well-calibration is an extension of the previous definition. It states that when individuals inside or outside the protected group have the same predicted probability score S they must have the same probability of being classified in the positive class, and this probability must be equal to S:P(Y=+ | S=s,A=a)=P(Y=+ | S=s,A=b)=s∀s∈S∀a,b∈A
* Balance for positive class. A classifier satisfies this definition if the subjects constituting the positive class from both protected and unprotected groups have equal average predicted probability score S. This means that the expected value of probability score for the protected and unprotected groups with positive actual outcome Y is the same, satisfying the formula:E(S | Y=+,A=a)=E(S | Y=+,A=b)∀a,b∈A
* Balance for negative class. A classifier satisfies this definition if the subjects constituting the negative class from both protected and unprotected groups have equal average predicted probability score S. This means that the expected value of probability score for the protected and unprotected groups with negative actual outcome Y is the same, satisfying the formula:E(S | Y=−,A=a)=E(S | Y=−,A=b)∀a,b∈A

### Equal confusion fairness

With respect to confusion matrices, independence, separation, and sufficiency require the respective quantities listed below to not have statistically significant difference across sensitive characteristics.[30]

* Independence: (TP + FP) / (TP + FP + FN + TN) (i.e., P(Y^=1)).
* Separation: TN / (TN + FP) and TP / (TP + FN) (i.e., specificity P(Y^=0∣Y=0) and recall P(Y^=1∣Y=1)).
* Sufficiency: TP / (TP + FP) and TN / (TN + FN) (i.e., precision P(Y=1∣Y^=1) and negative predictive value P(Y=0∣Y^=0)).

The notion of equal confusion fairness[32] requires the confusion matrix of a given decision system to have the same distribution when computed stratified over all sensitive characteristics.

### Social welfare function

Some scholars have proposed defining algorithmic fairness in terms of a social welfare function. They argue that using a social welfare function enables an algorithm designer to consider fairness and predictive accuracy in terms of their benefits to the people affected by the algorithm. It also allows the designer to trade off efficiency and equity in a principled way.[33] Sendhil Mullainathan has stated that algorithm designers should use social welfare functions in order to recognize absolute gains for disadvantaged groups. For example, a study found that using a decision-making algorithm in pretrial detention rather than pure human judgment reduced the detention rates for Blacks, Hispanics, and racial minorities overall, even while keeping the crime rate constant.[34]

## Individual fairness criteria

An important distinction among fairness definitions is the one between group and individual notions.[35][36][31][37] Roughly speaking, while group fairness criteria compare quantities at a group level, typically identified by sensitive attributes (e.g. gender, ethnicity, age, etc.), individual criteria compare individuals. In words, individual fairness follow the principle that "similar individuals should receive similar treatments".

There is a very intuitive approach to fairness, which usually goes under the name of fairness through unawareness (FTU), or blindness, that prescribes not to explicitly employ sensitive features when making (automated) decisions. This is effectively a notion of individual fairness, since two individuals differing only for the value of their sensitive attributes would receive the same outcome.

However, in general, FTU is subject to several drawbacks, the main being that it does not take into account possible correlations between sensitive attributes and non-sensitive attributes employed in the decision-making process. For example, an agent with the (malignant) intention to discriminate on the basis of gender could introduce in the model a proxy variable for gender (i.e. a variable highly correlated with gender) and effectively using gender information while at the same time being compliant to the FTU prescription.

The problem of what variables correlated to sensitive ones are fairly employable by a model in the decision-making process is a crucial one, and is relevant for group concepts as well: independence metrics require a complete removal of sensitive information, while separation-based metrics allow for correlation, but only as far as the labeled target variable "justify" them.

The most general concept of individual fairness was introduced in the pioneer work by Cynthia Dwork and collaborators in 2012[38] and can be thought of as a mathematical translation of the principle that the decision map taking features as input should be built such that it is able to "map similar individuals similarly", that is expressed as a Lipschitz condition on the model map. They call this approach fairness through awareness (FTA), precisely as counterpoint to FTU, since they underline the importance of choosing the appropriate target-related distance metric in order to assess which individuals are similar in specific situations. Again, this problem is very related to the point raised above about what variables can be seen as "legitimate" in particular contexts.

## Causality-based metrics

Causal fairness measures the frequency with which two nearly identical users or applications who differ only in a set of characteristics with respect to which resource allocation must be fair receive identical treatment.[39] [dubious - discuss]

An entire branch of the academic research on fairness metrics is devoted to leverage causal models to assess bias in machine learning models. This approach is usually justified by the fact that the same observational distribution of data may hide different causal relationships among the variables at play, possibly with different interpretations of whether the outcome are affected by some form of bias or not.[27]

Kusner et al.[40] propose to employ counterfactuals, and define a decision-making process counterfactually fair if, for any individual, the outcome does not change in the counterfactual scenario where the sensitive attributes are changed. The mathematical formulation reads:

P(RA<-a=1∣A=a,X=x)=P(RA<-b=1∣A=a,X=x),∀a,b;

that is: taken a random individual with sensitive attribute A=a and other features X=x and the same individual if she had A=b, they should have same chance of being accepted. The symbol R^A<-a represents the counterfactual random variable R in the scenario where the sensitive attribute A is fixed to A=a. The conditioning on A=a,X=x means that this requirement is at the individual level, in that we are conditioning on all the variables identifying a single observation.

Machine learning models are often trained upon data where the outcome depended on the decision made at that time.[41] For example, if a machine learning model has to determine whether an inmate will recidivate and will determine whether the inmate should be released early, the outcome could be dependent on whether the inmate was released early or not. Mishler et al.[42] propose a formula for counterfactual equalized odds:

P(R=1∣Y0=0,A=a)=P(R=1∣Y0=0,A=b)∧P(R=0∣Y1=1,A=a)=P(R=0∣Y1=1,A=b),∀a,b;

where R is a random variable, Yx denotes the outcome given that the decision x was taken, and A is a sensitive feature.

Plecko and Bareinboim[43] propose a unified framework to deal with causal analysis of fairness. They suggest the use of a Standard Fairness Model, consisting of a causal graph with 4 types of variables:

* sensitive attributes (A),
* target variable (Y),
* mediators (W) between A and Y, representing possible indirect effects of sensitive attributes on the outcome,
* variables possibly sharing a common cause with A (Z), representing possible spurious (i.e., non causal) effects of the sensitive attributes on the outcome.

Within this framework, Plecko and Bareinboim[43] are therefore able to classify the possible effects that sensitive attributes may have on the outcome. Moreover, the granularity at which these effects are measured—namely, the conditioning variables used to average the effect—is directly connected to the "individual vs. group" aspect of fairness assessment.

## Bias mitigation strategies

Fairness can be applied to machine learning algorithms in three different ways: data preprocessing, optimization during software training, or post-processing results of the algorithm.

### Preprocessing

Usually, the classifier is not the only problem; the dataset is also biased. The discrimination of a dataset D with respect to the group A=a can be defined as follows: discA=a(D)=|{X∈D|X(A)≠a,X(Y)=+}||{X∈D|X(A)≠a}|−|{X∈D|X(A)=a,X(Y)=+}||{X∈D|X(A)=a}|

That is, an approximation to the difference between the probabilities of belonging in the positive class given that the subject has a protected characteristic different from a and equal to a.

Algorithms correcting bias at preprocessing remove information about dataset variables which might result in unfair decisions, while trying to alter as little as possible. This is not as simple as just removing the sensitive variable, because other attributes can be correlated to the protected one.

A way to do this is to map each individual in the initial dataset to an intermediate representation in which it is impossible to identify whether it belongs to a particular protected group while maintaining as much information as possible. Then, the new representation of the data is adjusted to get the maximum accuracy in the algorithm.

This way, individuals are mapped into a new multivariable representation where the probability of any member of a protected group to be mapped to a certain value in the new representation is the same as the probability of an individual which doesn't belong to the protected group. Then, this representation is used to obtain the prediction for the individual, instead of the initial data. As the intermediate representation is constructed giving the same probability to individuals inside or outside the protected group, this attribute is hidden to the classificator.

An example is explained in Zemel et al.[44] where a multinomial random variable is used as an intermediate representation. In the process, the system is encouraged to preserve all information except that which can lead to biased decisions, and to obtain a prediction as accurate as possible.

On the one hand, this procedure has the advantage that the preprocessed data can be used for any machine learning task. Furthermore, the classifier does not need to be modified, as the correction is applied to the dataset before processing. On the other hand, the other methods obtain better results in accuracy and fairness.[45]

#### Reweighing

Reweighing is an example of a preprocessing algorithm. The idea is to assign a weight to each dataset point such that the weighted discrimination is 0 with respect to the designated group.[46]

If the dataset D was unbiased the sensitive variable A and the target variable Y would be statistically independent and the probability of the joint distribution would be the product of the probabilities as follows: Pexp(A=a∧Y=+)=P(A=a)×P(Y=+)=|{X∈D|X(A)=a}||D|×|{X∈D|X(Y)=+}||D|

In reality, however, the dataset is not unbiased and the variables are not statistically independent so the observed probability is: Pobs(A=a∧Y=+)=|{X∈D|X(A)=a∧X(Y)=+}||D|

To compensate for the bias, the software adds a weight, lower for favored objects and higher for unfavored objects. For each X∈D we get: W(X)=Pexp(A=X(A)∧Y=X(Y))Pobs(A=X(A)∧Y=X(Y))

When we have for each X a weight associated W(X) we compute the weighted discrimination with respect to group A=a as follows: discA=a(D)=∑W(X)X∈{X∈D|X(A)≠a,X(Y)=+}∑W(X)X∈{X∈D|X(A)≠a}−∑W(X)X∈{X∈D|X(A)=a,X(Y)=+}∑W(X)X∈{X∈D|X(A)=a}

It can be shown that after reweighting this weighted discrimination is 0.

### Inprocessing

Another approach is to correct the bias at training time. This can be done by adding constraints to the optimization objective of the algorithm.[47] These constraints force the algorithm to improve fairness, by keeping the same rates of certain measures for the protected group and the rest of individuals. For example, we can add to the objective of the algorithm the condition that the false positive rate is the same for individuals in the protected group and the ones outside the protected group.

The main measures used in this approach are false positive rate, false negative rate, and overall misclassification rate. It is possible to add just one or several of these constraints to the objective of the algorithm. Note that the equality of false negative rates implies the equality of true positive rates so this implies the equality of opportunity. After adding the restrictions to the problem it may turn intractable, so a relaxation on them may be needed.

This technique obtains good results in improving fairness while keeping high accuracy and lets the programmer choose the fairness measures to improve. However, each machine learning task may need a different method to be applied and the code in the classifier needs to be modified, which is not always possible.[45]

#### Adversarial debiasing

We train two classifiers at the same time through some gradient-based method (f.e.: gradient descent). The first one, the predictor tries to accomplish the task of predicting Y, the target variable, given X, the input, by modifying its weights W to minimize some loss function LP(y^,y). The second one, the adversary tries to accomplish the task of predicting A, the sensitive variable, given Y^ by modifying its weights U to minimize some loss function LA(a^,a).[48][49]

An important point here is that, in order to propagate correctly, Y^ above must refer to the raw output of the classifier, not the discrete prediction; for example, with an artificial neural network and a classification problem, Y^ could refer to the output of the softmax layer.

Then we update U to minimize LA at each training step according to the gradient ∇ULA and we modify W according to the expression: ∇WLP−proj∇WLA∇WLP−α∇WLA where α is a tuneable hyperparameter that can vary at each time step.

Graphic representation of the vectors used in adversarial debiasing as shown in Zhang et al.[48]

The intuitive idea is that we want the predictor to try to minimize LP (therefore the term ∇WLP) while, at the same time, maximize LA (therefore the term −α∇WLA), so that the adversary fails at predicting the sensitive variable from Y^.

The term −proj∇WLA∇WLP prevents the predictor from moving in a direction that helps the adversary decrease its loss function.

It can be shown that training a predictor classification model with this algorithm improves demographic parity with respect to training it without the adversary.

### Postprocessing

The final method tries to correct the results of a classifier to achieve fairness. In this method, we have a classifier that returns a score for each individual and we need to do a binary prediction for them. High scores are likely to get a positive outcome, while low scores are likely to get a negative one, but we can adjust the threshold to determine when to answer yes as desired. Note that variations in the threshold value affect the trade-off between the rates for true positives and true negatives.

If the score function is fair in the sense that it is independent of the protected attribute, then any choice of the threshold will also be fair, but classifiers of this type tend to be biased, so a different threshold may be required for each protected group to achieve fairness.[50] A way to do this is plotting the true positive rate against the false negative rate at various threshold settings (this is called ROC curve) and find a threshold where the rates for the protected group and other individuals are equal.[50]

The advantages of postprocessing include that the technique can be applied after any classifiers, without modifying it, and has a good performance in fairness measures. The cons are the need to access to the protected attribute in test time and the lack of choice in the balance between accuracy and fairness.[45]

#### Reject option based classification

Given a classifier let P(+|X) be the probability computed by the classifiers as the probability that the instance X belongs to the positive class +. When P(+|X) is close to 1 or to 0, the instance X is specified with high degree of certainty to belong to class + or - respectively. However, when P(+|X) is closer to 0.5 the classification is more unclear.[51]

We say X is a "rejected instance" if max(P(+|X),1−P(+|X))≤θ with a certain θ such that 0.5<θ<1.

The algorithm of "ROC" consists on classifying the non-rejected instances following the rule above and the rejected instances as follows: if the instance is an example of a deprived group (X(A)=a) then label it as positive, otherwise, label it as negative.

We can optimize different measures of discrimination (link) as functions of θ to find the optimal θ for each problem and avoid becoming discriminatory against the privileged group.[51]

## See also

* Algorithmic bias
* Machine learning

## References

1. ↑ Caton, Simon; Haas, Christian (2020-10-04). "Fairness in Machine Learning: A Survey". arXiv:2010.04053 [cs.LG].
2. ↑ Cite error: Invalid `<ref>` tag; no text was provided for refs named `:0`
3. ↑ Friedler, Sorelle A.; Scheidegger, Carlos; Venkatasubramanian, Suresh (April 2021). "The (Im)possibility of fairness: different value systems require different mechanisms for fair decision making" (in en). Communications of the ACM 64 (4): 136–143. doi:10.1145/3433949. ISSN 0001-0782. https://dl.acm.org/doi/10.1145/3433949.
4. ↑ Mehrabi, Ninareh; Morstatter, Fred; Saxena, Nripsuta; Lerman, Kristina; Galstyan, Aram (2021-07-13). "A Survey on Bias and Fairness in Machine Learning". ACM Computing Surveys 54 (6): 115:1–115:35. doi:10.1145/3457607. ISSN 0360-0300. https://doi.org/10.1145/3457607.
5. ↑ "AI Fairness 360". https://aif360.mybluemix.net/.
6. ↑ "IBM AI Fairness 360 open source toolkit adds new functionalities". Tech Republic. 4 June 2020. http://www.techrepublic.com/google-amp/article/ibm-ai-fairness-360-open-source-toolkit-adds-new-functionalities/.
7. ↑ "Responsible AI practices" (in en). https://ai.google/responsibilities/responsible-ai-practices/.
8. ↑ Fairness Indicators, tensorflow, 2022-11-10, https://github.com/tensorflow/fairness-indicators, retrieved 2022-11-18
9. ↑ "How we're using Fairness Flow to help build AI that works better for everyone" (in en). https://ai.facebook.com/blog/how-were-using-fairness-flow-to-help-build-ai-that-works-better-for-everyone/.
10. ↑ "AI experts warn Facebook's anti-bias tool is 'completely insufficient'" (in en-US). 2021-03-31. https://venturebeat.com/business/ai-experts-warn-facebooks-anti-bias-tool-is-completely-insufficient/.
11. ↑ Hutchinson, Ben; Mitchell, Margaret (2019-01-29). "Proceedings of the Conference on Fairness, Accountability, and Transparency". New York, NY, USA: ACM FAT*'19. pp. 49–58. doi:10.1145/3287560.3287600. ISBN 9781450361255.
12. ↑ 12.0 12.1 12.2 Luo, Queenie; Puett, Michael J.; Smith, Michael D. (2023-05-23), A Perspectival Mirror of the Elephant: Investigating Language Bias on Google, ChatGPT, Wikipedia, and YouTube
13. ↑ Kotek, Hadas; Dockum, Rikker; Sun, David (2023-11-05). "Gender bias and stereotypes in Large Language Models". Proceedings of the ACM Collective Intelligence Conference. CI '23. New York, NY, USA: Association for Computing Machinery. pp. 12–24. doi:10.1145/3582269.3615599. ISBN 979-8-4007-0113-9. https://dl.acm.org/doi/10.1145/3582269.3615599.
14. ↑ Zhou, Karen; Tan, Chenhao (December 2023). Bouamor, Houda; Pino, Juan; Bali, Kalika. eds. "Entity-Based Evaluation of Political Bias in Automatic Summarization". Findings of the Association for Computational Linguistics: EMNLP 2023 (Singapore: Association for Computational Linguistics): 10374–10386. doi:10.18653/v1/2023.findings-emnlp.696. https://aclanthology.org/2023.findings-emnlp.696.
15. ↑ Rose, Adam (2010-01-22). "Are face-detection cameras racist?" (in en-US). Time. ISSN 0040-781X. http://content.time.com/time/business/article/0,8599,1954643,00.html. Retrieved 2022-11-18.
16. ↑ "Google says sorry for racist auto-tag in photo app" (in en). 2015-07-01. http://www.theguardian.com/technology/2015/jul/01/google-sorry-racist-auto-tag-photo-app.
17. ↑ "A beauty contest was judged by AI and the robots didn't like dark skin" (in en). 2016-09-08. http://www.theguardian.com/technology/2016/sep/08/artificial-intelligence-beauty-contest-doesnt-like-black-people.
18. ↑ 18.0 18.1 Buolamwini, Joy; Gebru, Timnit (February 2018). "Gender Shades: Intersectional Accuracy Disparities in Commercial Gender Classification". Conference on Fairness, Accountability and Transparency. New York, NY, USA. pp. 77–91. http://proceedings.mlr.press/v81/buolamwini18a/buolamwini18a.pdf.
19. ↑ "Student proves Twitter algorithm 'bias' toward lighter, slimmer, younger faces" (in en). 2021-08-10. http://www.theguardian.com/technology/2021/aug/10/twitters-image-cropping-algorithm-prefers-younger-slimmer-faces-with-lighter-skin-analysis.
20. ↑ openai/dalle-2-preview, OpenAI, 2022-11-17, https://github.com/openai/dalle-2-preview/blob/eeec5a1843b1d17cb9ed113117a2fcaa9206a564/system-card.md, retrieved 2022-11-18
21. ↑ "Amazon scraps secret AI recruiting tool that showed bias against women" (in en). Reuters. 2018-10-10. https://www.reuters.com/article/us-amazon-com-jobs-automation-insight-idUSKCN1MK08G.
22. ↑ "Apple Card algorithm sparks gender bias allegations against Goldman Sachs" (in en-US). Washington Post. ISSN 0190-8286. https://www.washingtonpost.com/business/2019/11/11/apple-card-algorithm-sparks-gender-bias-allegations-against-goldman-sachs/.
23. ↑ Martinez, Emmanuel; Kirchner, Lauren (25 August 2021). "The Secret Bias Hidden in Mortgage-Approval Algorithms – The Markup" (in en). https://themarkup.org/denied/2021/08/25/the-secret-bias-hidden-in-mortgage-approval-algorithms.
24. ↑ Ruggieri, Salvatore; Alvarez, Jose M.; Pugnana, Andrea; State, Laura; Turini, Franco (2023-06-26). "Can We Trust Fair-AI?". Proceedings of the AAAI Conference on Artificial Intelligence (Association for the Advancement of Artificial Intelligence (AAAI)) 37 (13): 15421–15430. doi:10.1609/aaai.v37i13.26798. ISSN 2374-3468.
25. ↑ Buyl, Maarten; De Bie, Tijl (2022). "Inherent Limitations of AI Fairness". Communications of the ACM 67 (2): 48–55. doi:10.1145/3624700.
26. ↑ Castelnovo, Alessandro; Inverardi, Nicole; Nanino, Gabriele; Penco, Ilaria Giuseppina; Regoli, Daniele (2023). "Fair Enough? A map of the current limitations of the requirements to have "fair algorithms". arXiv:2311.12435 [cs.AI].
27. ↑ 27.0 27.1 27.2 27.3 Solon Barocas; Moritz Hardt; Arvind Narayanan, Fairness and Machine Learning. Retrieved 15 December 2019.
28. ↑ Mayes, Elizabeth (2001) (in English). Handbook of Credit Scoring. NY, NY, USA: Glenlake Publishing. pp. 282. ISBN 0-8144-0619-X.
29. ↑ Berk, Richard; Heidari, Hoda; Jabbari, Shahin; Kearns, Michael; Roth, Aaron (February 2021). "Fairness in Criminal Justice Risk Assessments: The State of the Art" (in en). Sociological Methods & Research 50 (1): 3–44. doi:10.1177/0049124118782533. ISSN 0049-1241. http://journals.sagepub.com/doi/10.1177/0049124118782533.
30. ↑ 30.0 30.1 Räz, Tim (2021-03-03). "Group Fairness: Independence Revisited" (in en). Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency. ACM. pp. 129–137. doi:10.1145/3442188.3445876. ISBN 978-1-4503-8309-7. https://dl.acm.org/doi/10.1145/3442188.3445876.
31. ↑ 31.0 31.1 31.2 Verma, Sahil; Rubin, Julia (2018). "Fairness definitions explained". Proceedings of the International Workshop on Software Fairness. pp. 1–7. doi:10.1145/3194770.3194776. ISBN 9781450357463. https://dl.acm.org/doi/10.1145/3194770.3194776.
32. ↑ Gursoy, Furkan; Kakadiaris, Ioannis A. (November 2022). "Equal Confusion Fairness: Measuring Group-Based Disparities in Automated Decision Systems". 2022 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE. pp. 137–146. doi:10.1109/ICDMW58026.2022.00027. ISBN 979-8-3503-4609-1. https://ieeexplore.ieee.org/document/10029385.
33. ↑ Chen, Violet (Xinying); Hooker, J. N. (2021). "Welfare-based Fairness through Optimization". arXiv:2102.00311 [cs.AI].
34. ↑ Mullainathan, Sendhil (June 19, 2018). Algorithmic Fairness and the Social Welfare Function. Keynote at the 19th ACM Conference on Economics and Computation (EC'18). YouTube. 48 minutes in. "In other words, if you have a social welfare function where what you care about is harm, and you care about harm to the African Americans, there you go: 12 percent less African Americans in jail overnight.... Before we get into the minutiae of relative harm, the welfare function is defined in absolute harm, so we should actually calculate the absolute harm first."
35. ↑ Mitchell, Shira; Potash, Eric; Barocas, Solon; d'Amour, Alexander; Lum, Kristian (2021). "Algorithmic Fairness: Choices, Assumptions, and Definitions". Annual Review of Statistics and Its Application 8 (1): 141–163. doi:10.1146/annurev-statistics-042720-125902. Bibcode: 2021AnRSA...8..141M.
36. ↑ Castelnovo, Alessandro; Crupi, Riccardo; Greco, Greta; Regoli, Daniele; Penco, Ilaria Giuseppina; Cosentini, Andrea Claudio (2022). "A clarification of the nuances in the fairness metrics landscape". Scientific Reports 12 (1): 4209. doi:10.1038/s41598-022-07939-1. PMID 35273279. PMC 8913820. Bibcode: 2022NatSR..12.4209C. https://doi.org/10.1038/s41598-022-07939-1.
37. ↑ Mehrabi, Ninareh, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram Galstyan. "A survey on bias and fairness in machine learning." ACM Computing Surveys (CSUR) 54, no. 6 (2021): 1–35.
38. ↑ Dwork, Cynthia; Hardt, Moritz; Pitassi, Toniann; Reingold, Omer; Zemel, Richard (2012). "Fairness through awareness". Proceedings of the 3rd Innovations in Theoretical Computer Science Conference on - ITCS '12. pp. 214–226. doi:10.1145/2090236.2090255. ISBN 9781450311151. https://doi.org/10.1145/2090236.2090255.
39. ↑ Galhotra, Sainyam; Brun, Yuriy; Meliou, Alexandra (2017). "Fairness testing: Testing software for discrimination". Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering. pp. 498–510. doi:10.1145/3106237.3106277. ISBN 9781450351058.
40. ↑ Kusner, M. J., Loftus, J., Russell, C., & Silva, R. (2017). Counterfactual fairness. Advances in neural information processing systems, 30.
41. ↑ Coston, Amanda; Mishler, Alan; Kennedy, Edward H.; Chouldechova, Alexandra (2020-01-27). "Counterfactual risk assessments, evaluation, and fairness". Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency. FAT* '20. New York, NY, USA: Association for Computing Machinery. pp. 582–593. doi:10.1145/3351095.3372851. ISBN 978-1-4503-6936-7.
42. ↑ Mishler, Alan; Kennedy, Edward H.; Chouldechova, Alexandra (2021-03-01). "Fairness in Risk Assessment Instruments". Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency. FAccT '21. New York, NY, USA: Association for Computing Machinery. pp. 386–400. doi:10.1145/3442188.3445902. ISBN 978-1-4503-8309-7.
43. ↑ 43.0 43.1 Plecko, Drago; Bareinboim, Elias (2022). Causal Fairness Analysis.
44. ↑ Richard Zemel; Yu (Ledell) Wu; Kevin Swersky; Toniann Pitassi; Cyntia Dwork, Learning Fair Representations. Retrieved 1 December 2019
45. ↑ 45.0 45.1 45.2 Ziyuan Zhong, Tutorial on Fairness in Machine Learning. Retrieved 1 December 2019
46. ↑ Faisal Kamiran; Toon Calders, Data preprocessing techniques for classification without discrimination. Retrieved 17 December 2019
47. ↑ Muhammad Bilal Zafar; Isabel Valera; Manuel Gómez Rodríguez; Krishna P. Gummadi, Fairness Beyond Disparate Treatment & Disparate Impact: Learning Classification without Disparate Mistreatment. Retrieved 1 December 2019
48. ↑ 48.0 48.1 Brian Hu Zhang; Blake Lemoine; Margaret Mitchell, Mitigating Unwanted Biases with Adversarial Learning. Retrieved 17 December 2019
49. ↑ Joyce Xu, Algorithmic Solutions to Algorithmic Bias: A Technical Guide. Retrieved 17 December 2019
50. ↑ 50.0 50.1 Moritz Hardt; Eric Price; Nathan Srebro, Equality of Opportunity in Supervised Learning. Retrieved 1 December 2019
51. ↑ 51.0 51.1 Faisal Kamiran; Asim Karim; Xiangliang Zhang, Decision Theory for Discrimination-aware Classification. Retrieved 17 December 2019

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Fairness (machine learning). Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Fairness_(machine_learning)&oldid=237601"