Achieving algorithmic fairness in decision making is crucial to ensure that automated systems treat people equally and without bias.
Algorithmic fairness can be achieved by using data that is representative of the population being served.
This is because biased data can perpetuate existing inequalities, as seen in the example of a facial recognition system that misidentifies people of color.
One way to ensure data representativeness is by using techniques such as data augmentation and sampling.
Data augmentation involves adding diversity to the existing data, while sampling involves selecting a subset of data that is representative of the population.
For instance, if a company is developing an algorithm to predict employee performance, they can use data from a diverse range of employees to train the model.
This can help reduce bias and ensure that the algorithm is fair to all employees, regardless of their background or characteristics.
Algorithmic Fairness in Practice
Algorithmic fairness is a crucial aspect of machine learning models. In practice, detecting unfair biases in models is the first step to mitigation.
There are three main categories to address biases in models: preprocessing data, employing fair models, and postprocessing model predictions. Preprocessing data involves modifying the underlying data to address bias before it's passed to the Learner.
Employing fair models uses algorithms that incorporate fairness considerations directly, such as generalized linear models with fairness constraints. This can be achieved with the "classif.fairzlrm" Learner.
Postprocessing model predictions involves applying heuristics or algorithms to the predictions to mitigate biases present in them. This can be done using the "EOd" post-processing scheme.
The mlr3pipelines package allows for integrating pre- and postprocessing schemes. Two examples of this are balancing observation weights with the "reweighing_wts" post-processing scheme and enforcing equalized odds fairness definition by stochastically flipping specific predictions with the "EOd" post-processing scheme.
Here are some fairness metrics to consider: classification accuracy and equalized odds. The fairness_accuracy_tradeoff() function can be used to compare these metrics across cross-validation folds.
For more insights, see: Difference between Model and Algorithm in Machine Learning
Fair Machine Learning
Fair Machine Learning is a crucial aspect of algorithmic fairness, and it's essential to understand the different approaches to achieving fairness in machine learning models.
To detect and mitigate biases in models, mlr3fairness offers several options, which can be broadly categorized into three main categories: preprocessing data, employing fair models, and postprocessing model predictions.
Preprocessing data involves addressing bias in the data before it's passed to the Learner, while employing fair models incorporates fairness considerations directly into the algorithm. Postprocessing model predictions involves applying heuristics or algorithms to the predictions to mitigate biases.
All methods often slightly decrease predictive performance, so it's useful to try all approaches to empirically see which balance predictive performance and fairness.
In general, all biases should be addressed at their root cause (or as close to it) as possible, as any other intervention will be suboptimal.
Here are some common methods for addressing bias in machine learning models:
The reweighting method appears to yield marginally better fairness metrics than other methods, though the difference is unlikely to be significant. So in this case, we would likely conclude that introducing bias mitigation steps did not improve algorithmic fairness.
For another approach, see: Fairness Machine Learning
Inprocessing is another approach to correct bias at training time by adding constraints to the optimization objective of the algorithm. 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.
Postprocessing is the final method that 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.
Interpretability
Interpretability is about understanding how models make predictions.
It's a crucial aspect of building trust in ML systems, as it helps us understand why a model is making a particular prediction.
Fairness and interpretability are actually related, as both are about building trust in ML systems.
Interpretability involves understanding how models make predictions, which is essential for identifying potential biases in the data.
By understanding how models make predictions, we can identify potential biases in the data and work to address them.
This is especially important in situations where the consequences of an unfair decision are severe.
For instance, in a loan approval system, understanding how the model makes predictions can help us identify why certain groups are being denied loans at a higher rate.
This can help us identify and address biases in the data, ultimately leading to a fairer outcome for all.
Auditing and Evaluating Models
Auditing a model for bias involves setting a sensitive attribute and selecting a fairness metric. We can use a random forest and evaluate the absolute difference in true positive rate across groups to detect bias.
An \(\epsilon\) value of 0.05 indicates bias, but this value is arbitrary and should be decided based on context. Fairness metrics can also be used in larger benchmark experiments to compare bias across multiple models.
Visualizations, such as fairness_prediction_density() and compare_metrics(), can help understand discrepancies between groups or differences between models. These plots can reveal patterns, like a model being more likely to predict 'Female' observations as having a lower salary.
Recommendations for Government
As governments develop and implement AI models, it's essential to have a robust auditing and evaluation process in place. This ensures accountability and transparency in decision-making.
Regular audits should be conducted to assess the accuracy and fairness of AI models, as seen in the case of the credit scoring model, which was found to have biased results.
Governments should establish clear guidelines and standards for AI model development and deployment, such as requiring transparency in decision-making processes.
Auditing should also involve testing the models for bias and ensuring that they are explainable, as demonstrated in the example of the healthcare model that used explainability techniques to identify potential biases.
Recommended read: Decision Tree Algorithm Machine Learning
Auditing a Model
Auditing a model is a crucial step in ensuring that your predictions are fair and unbiased. With our sensitive attribute set and fairness metric selected, we can train a Learner and test for bias.
The fairness metric can be used to evaluate the absolute difference in true positive rate across groups, such as 'Male' and 'Female'. In this example, an \(\epsilon\) value of 0.05 was used, indicating that there is bias present in the model.
However, the choice of \(\epsilon\) value is arbitrary and should be decided based on context. Using fairness metrics in larger benchmark experiments can also help compare bias across multiple models.
Visualizations can help better understand discrepancies between groups or differences between models. For instance, the fairness_prediction_density() function plots the sub-group densities across group levels and compare_metrics() scores predictions across multiple metrics.
In one example, the model was more likely to predict 'Female' observations as having a lower salary, which could be due to systemic prejudices in the data or bias introduced by the algorithm. The right plot indicated that all fairness metrics exceeded 0.05, supporting the argument that the algorithm may have introduced further bias.
Debiasing and Correcting Models
Debiasing is a crucial step in ensuring algorithmic fairness, and it can be achieved through various methods.
Adversarial debiasing is a technique that trains two classifiers simultaneously to minimize bias. The first classifier, the predictor, tries to accomplish the task of predicting the target variable, while the second classifier, the adversary, tries to predict the sensitive variable from the predictor's output. By minimizing the adversary's loss function, we can improve demographic parity.
Preprocessing is another method used to correct bias in datasets. By removing information about dataset variables that might result in unfair decisions, algorithms can alter as little as possible while still achieving fairness.
Reweighing is an example of a preprocessing algorithm that assigns a weight to each dataset point to make the weighted discrimination 0 with respect to the designated group. This is done by calculating the expected probability of the joint distribution and dividing it by the observed probability.
Correcting and preventing unfairness requires a multi-faceted approach that goes beyond just quantitative methods. Non-quantitative approaches, such as addressing the root cause of bias and promoting team diversity, are also essential in achieving fairness.
By using these debiasing and correcting methods, we can ensure that our models are fair and unbiased, leading to more accurate and trustworthy results.
Understanding and Measuring Fairness
Algorithmic fairness is a complex issue that requires careful consideration and analysis. Much of algorithm fairness research aims at developing methods to analyze and measure unfairness, which can involve analyzing data for potential reasons for unfairness.
Fairness can be measured in different ways, including equalized odds, where the true positive rate and false positive rate are equal for every value of the sensitive characteristics. This means that the probability of being predicted as positive or negative is the same for individuals with different sensitive characteristics.
The notion of equal confusion fairness requires the confusion matrix of a given decision system to have the same distribution when computed stratified over all sensitive characteristics. This can be achieved by ensuring that the true positive rate and false positive rate are equal for every value of the sensitive characteristics.
Here are some common fairness metrics:
- Independence: (TP + FP) / (TP + FP + FN + TN)
- Separation: TN / (TN + FP) and TP / (TP + FN)
- Sufficiency: TP / (TP + FP) and TN / (TN + FN)
These metrics can be used to evaluate the fairness of a model and identify areas for improvement. By understanding and measuring fairness, we can develop more equitable and just algorithms that benefit everyone.
Language
Language plays a significant role in shaping our perceptions and understanding of fairness.
Language bias is a type of statistical sampling bias that can lead to a systematic deviation in sampling information, preventing it from accurately representing the true coverage of topics and views available.
Current large language models, like ChatGPT, are predominantly trained on English-language data and often present Anglo-American views as truth, while downplaying non-English perspectives.
This can result in responses that are biased towards a particular perspective, such as when ChatGPT describes liberalism from the Anglo-American perspective, but neglects equally valid aspects from other cultural contexts.
Language models can be 'blind' to non-English perspectives, as seen in ChatGPT's responses, which lack political perspectives embedded in Japanese, Korean, French, and German corpora.
Using a social welfare function can help algorithm designers consider fairness and predictive accuracy in terms of their benefits to the people affected by the algorithm.
A fresh viewpoint: A Survey on Bias and Fairness in Machine Learning
Gender
Gender bias is a significant issue in AI models, often stemming from the data they're trained on. This bias can lead to unfair outcomes, where one gender is unfairly prejudiced over another.
Large language models, for instance, tend to assign roles and characteristics based on traditional gender norms. Nurses and secretaries are often associated with women, while engineers and CEOs are typically linked to men.
The consequences of this bias can be far-reaching, affecting not only individuals but also society as a whole.
Analyzing and Measuring
Analyzing and measuring unfairness is a crucial step in developing fair machine learning models. This involves analyzing data for potential reasons of unfairness and measuring unfairness in model predictions.
Fairness metrics can be computed and analyzed using built-in plotting functions, such as fairness_accuracy_tradeoff(), to compare classification accuracy and equalized odds across cross-validation folds.
Measuring unfairness can be done using various fairness metrics, including independence, separation, and sufficiency. These metrics can be used to identify biases in the data and model predictions.
Independence is satisfied if the sensitive characteristics are statistically independent of the prediction, and separation is satisfied if the true positive rate and false positive rate are equal for every value of the sensitive characteristics.
Here are some key fairness metrics:
- Independence: P(R=r|A=a) = P(R=r|A=b) ∀r∈R ∀a,b∈A
- Separation: 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
- Sufficiency: P(Y=q|R=r,A=a) = P(Y=q|R=r,A=b) ∀q∈Y r∈R ∀a,b∈A
These metrics can be used to identify biases in the data and model predictions, and to develop strategies to mitigate these biases.
Fairness Metrics and Criteria
Fairness metrics and criteria are essential in evaluating the fairness of machine learning models.
There are two main types of fairness criteria: group fairness and individual fairness. Group fairness compares quantities at a group level, identified by sensitive attributes, while individual fairness compares individuals and follows the principle that "similar individuals should receive similar treatments".
In classification problems, an algorithm learns a function to predict a discrete characteristic Y from known characteristics X. We model A as a discrete random variable that encodes some characteristics contained or implicitly encoded in X that we consider as sensitive characteristics.
Three main criteria to evaluate if a given classifier is fair are:
- Demographic parity, which requires that the positive rate is the same for all groups;
- Equalized odds, which requires that the true positive rate and false positive rate are the same for all groups;
li>Equal opportunity, which requires that the true positive rate is the same for all groups, but allows for different false positive rates.
A crucial aspect of individual fairness is the problem of what variables correlated to sensitive ones are fairly employable by a model in the decision-making process. This 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.
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. 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.
Plecko and Bareinboim propose a unified framework to deal with causal analysis of fairness, consisting of a causal graph with 4 types of variables: sensitive attributes (A), target variable (Y), mediators (W) between A and Y, and variables possibly sharing a common cause with A (Z).
Sources
- https://www.brookings.edu/articles/fairness-in-algorithmic-decision-making/
- https://mlr3book.mlr-org.com/chapters/chapter14/algorithmic_fairness.html
- https://en.wikipedia.org/wiki/Fairness_(machine_learning)
- https://towardsdatascience.com/what-is-algorithm-fairness-3182e161cf9f
- https://virginialawreview.org/articles/measuring-algorithmic-fairness/
Featured Images: pexels.com