AI Ethics & Fairness
1. Introduction to AI Ethics
AI ethics encompasses the moral principles and techniques used to guide the development and deployment of artificial intelligence. As AI systems influence hiring, lending, healthcare, and criminal justice, ensuring they operate fairly and responsibly is paramount.
1.1 Core Ethical Principles
- Beneficence: AI should promote well-being and benefit humanity.
- Non-maleficence: AI should not cause harm.
- Autonomy: Human agency and decision-making should be preserved.
- Justice: Benefits and risks of AI should be distributed fairly.
- Transparency: AI systems should be understandable and open to scrutiny.
- Accountability: Clear responsibility should exist for AI outcomes.
2. Bias in Data and Algorithms
Bias in AI can arise at multiple stages of the machine learning pipeline. Understanding these sources is the first step toward building fairer systems.
2.1 Sources of Data Bias
- Representation Bias: Certain groups are underrepresented in training data. Example: facial recognition datasets historically contained fewer images of people with darker skin tones.
- Measurement Bias: Features or labels are measured differently across groups. Example: using arrest records as a proxy for crime rates introduces bias against over-policed communities.
- Sampling Bias: Training data is not drawn from the same distribution as the deployment population.
- Label Bias: Human annotators introduce subjective biases into ground truth labels.
- Aggregation Bias: A single model is used for populations that should be modeled separately.
2.2 Algorithmic Amplification
Even when data is relatively unbiased, algorithms can amplify small biases through feedback loops. A recommendation system that slightly favors popular content will, over time, make popular content even more dominant—a phenomenon called the Matthew effect or rich-get-richer dynamic.
3. Formal Fairness Definitions
Fairness in machine learning has been formalized through several mathematical criteria. Let Y be the true label, Ŷ the predicted label, and A the sensitive attribute (e.g., gender, race).
3.1 Demographic Parity (Statistical Parity)
P(Ŷ = 1 | A = 0) = P(Ŷ = 1 | A = 1)
In other words, the positive prediction rate should be equal across all groups.
3.2 Equalized Odds
P(Ŷ = 1 | A = 0, Y = y) = P(Ŷ = 1 | A = 1, Y = y) for y ∈ {0, 1}
This requires equal true positive rates AND equal false positive rates across groups.
3.3 Equal Opportunity
P(Ŷ = 1 | A = 0, Y = 1) = P(Ŷ = 1 | A = 1, Y = 1)
Qualified individuals from all groups should have an equal chance of receiving a positive prediction.
3.4 Calibration
P(Y = 1 | Ŷ = s, A = 0) = P(Y = 1 | Ŷ = s, A = 1)
4. Detecting Bias
Before mitigating bias, we must detect and quantify it using appropriate metrics.
4.1 Key Metrics
| Metric | Formula | Interpretation |
|---|---|---|
| Disparate Impact Ratio | P(Ŷ=1|A=0) / P(Ŷ=1|A=1) | Values < 0.8 indicate adverse impact (US 80% rule) |
| Statistical Parity Difference | P(Ŷ=1|A=0) − P(Ŷ=1|A=1) | Should be close to 0 |
| Equal Opportunity Difference | TPRA=0 − TPRA=1 | Should be close to 0 |
| Average Odds Difference | ½[(FPR0−FPR1) + (TPR0−TPR1)] | Should be close to 0 |
4.2 Visualization Techniques
- Confusion matrix per group: Compute separate confusion matrices for each sensitive group.
- ROC curves per group: Plot ROC curves stratified by group to visualize performance disparities.
- Calibration curves per group: Check if predicted probabilities are well-calibrated for each group.
- Fairness dashboards: Tools like IBM AI Fairness 360, Google What-If Tool, and Microsoft Fairlearn provide interactive bias auditing.
5. Bias Mitigation Strategies
Bias can be mitigated at three stages of the ML pipeline: pre-processing (data level), in-processing (algorithm level), and post-processing (output level).
5.1 Pre-Processing Methods
- Resampling: Oversample underrepresented groups or undersample overrepresented ones.
- Reweighting: Assign higher weights to underrepresented group-label combinations.
- Disparate Impact Remover: Transform features to remove correlations with the sensitive attribute while preserving rank ordering.
- Learning Fair Representations: Learn a latent representation that encodes information about the data but obfuscates the sensitive attribute (Zemel et al., 2013).
5.2 In-Processing Methods
- Adversarial Debiasing: Train the model jointly with an adversary that tries to predict the sensitive attribute from the model’s predictions. The model is penalized if the adversary succeeds.
- Fairness Constraints: Add fairness metrics as constraints to the optimization objective:
minθ L(θ) subject to |FPRA=0 − FPRA=1| ≤ ε - Prejudice Remover: Adds a regularization term that penalizes mutual information between predictions and the sensitive attribute.
5.3 Post-Processing Methods
- Threshold Adjustment: Use different classification thresholds for different groups to equalize a chosen fairness metric (Hardt et al., 2016).
- Reject Option Classification: Re-label instances near the decision boundary in favor of the disadvantaged group.
- Calibrated Equalized Odds: Adjusts predicted probabilities post-hoc to satisfy equalized odds while maintaining calibration as much as possible.
6. Ethical Frameworks for AI
Several ethical frameworks guide how we reason about the morality of AI systems.
6.1 Consequentialism (Utilitarianism)
Judges actions by their outcomes. An AI system is ethical if it maximizes overall well-being. Challenge: How to measure and compare well-being across different stakeholders.
6.2 Deontological Ethics (Kantian)
Judges actions by adherence to rules or duties, regardless of outcomes. An AI system should respect rights and follow ethical rules (e.g., never discriminate based on race). Challenge: Rules may conflict.
6.3 Virtue Ethics
Focuses on the character of the agent. Applied to AI: the development team should cultivate virtues like honesty, diligence, and empathy throughout the development process.
6.4 Care Ethics
Emphasizes relationships and responsibilities. AI systems should be designed with particular care for vulnerable populations who may be disproportionately affected.
7. Responsible AI Principles
Major technology organizations and governments have established responsible AI frameworks.
- Fairness: AI should treat all people equitably.
- Reliability & Safety: AI should perform reliably and safely.
- Privacy & Security: AI should respect privacy and be secure.
- Inclusiveness: AI should empower everyone and engage people.
- Transparency: AI should be understandable.
- Accountability: People should be accountable for AI systems.
7.1 Privacy Concerns in AI
- Data Collection: Models often require vast amounts of personal data for training.
- Model Memorization: Large models can memorize and potentially leak training data (Carlini et al., 2021).
- Membership Inference: Attackers can determine if a specific data point was in the training set.
- Model Inversion: Attackers can reconstruct training data features from model outputs.
7.2 Informed Consent
Users should be informed about how their data is collected, used, and shared. Meaningful consent requires:
- Clear, plain-language explanation of data usage.
- Granular control over what data is shared.
- Easy ability to withdraw consent.
- Transparency about automated decision-making.
8. Societal Impacts of AI
8.1 Labor Market Disruption
AI automation is reshaping employment. While AI creates new job categories, it also displaces workers in routine cognitive and manual tasks. The net effect depends on the pace of automation, investment in reskilling, and policy responses.
8.2 Concentration of Power
AI development requires massive computational resources and data, favoring large corporations. This can lead to monopolistic dynamics and power imbalances between technology companies, governments, and individuals.
8.3 Surveillance and Civil Liberties
AI-powered surveillance (facial recognition, behavioral analytics) raises serious concerns about civil liberties, freedom of expression, and the potential for authoritarian misuse.
8.4 Environmental Impact
Training large AI models has significant carbon footprints. GPT-3 training was estimated to produce approximately 552 tonnes of CO&sub2;. Responsible AI must consider environmental sustainability.
9. Fairness-Accuracy Trade-Off
Imposing fairness constraints typically comes at some cost to predictive accuracy. The magnitude of this trade-off depends on:
- Degree of existing bias: More biased models see larger accuracy drops when corrected.
- Choice of fairness criterion: Stricter criteria (demographic parity) may cost more than relaxed ones (equal opportunity).
- Base rate differences: Larger base rate differences between groups amplify the trade-off.
10. Summary & GATE DA Key Takeaways
- Memorize the formal definitions of demographic parity, equalized odds, equal opportunity, and calibration.
- Understand the impossibility theorem: you cannot simultaneously satisfy all fairness criteria when base rates differ.
- Know the three stages of bias mitigation: pre-processing, in-processing, post-processing.
- Be prepared to calculate disparate impact ratios and statistical parity differences from confusion matrices.
- Understand the sources of bias: historical, representation, measurement, sampling, label, aggregation.
- Questions may present a scenario and ask you to identify which fairness criterion is violated.
- AI ethics encompasses fairness, accountability, transparency, and privacy.
- Bias enters through data (historical, representation, measurement) and algorithms (amplification).
- Formal fairness: Demographic Parity, Equalized Odds, Equal Opportunity, Calibration.
- The impossibility theorem limits simultaneous satisfaction of multiple fairness criteria.
- Mitigation: pre-processing (reweighting, fair representations), in-processing (adversarial debiasing, constraints), post-processing (threshold adjustment).
- Responsible AI requires balancing fairness, accuracy, privacy, safety, and transparency.