Detecting and Reducing Social Discrimination in Machine Learning Models
New York Open Stats Meetup
Niels Bantilan 12/14/2017
Detecting and Reducing Social Discrimination in Machine Learning - - PowerPoint PPT Presentation
Detecting and Reducing Social Discrimination in Machine Learning Models New York Open Stats Meetup Niels Bantilan 12/14/2017 What is bias? What is discrimination? Inmate recidivism risk model Source:
New York Open Stats Meetup
Niels Bantilan 12/14/2017
Source: https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing
Inmate recidivism risk model
“The preference for or against something”
“When an action is based on biases that lead to the systematic disenfranchisement
(according to a specific definition of discrimination)
Biased Decisions Biased Data Biased Algorithm Biased Predictions
Machine learning models optimized
real-world social biases.
(thee-mus em-el)
An open source library that implements a fairness-aware machine learning interface (FMLI) to measure and reduce social bias in machine learning algorithms.
Available on github!
https://github.com/cosmicBboy/themis-ml
Model flexibility
Users have varying degrees of control over the model training process.
Fairness as performance
Build tooling that enable users to optimize for both accuracy and fairness.
Transparency of fairness-utility tradeoff
Enable the user to assess the impact of fairness-aware methods on predictive power.
Objective
Given a set of decision records {(X, y)} ∈ D, a measure of social bias b, and a protected class s, identify a subset of potentially discriminated decision records.
?
Disparate Treatment
Hiring decision process
men’s resumes
Disparate Impact
Hiring decision process
accept all resumes
?
Individual-level
(individual consistency)
Group-level
(statistical parity)
Objective
Given a set of decision records {(X, y)} ∈ D, a measure of social bias b, a protected class s, and a measure of performance p, train a machine learning model that makes fair predictions while preserving the accuracy of decisions.
Utility Fairness
Assumptions
1. Prediction target y is a binary variable where y+ = 1 is a beneficial
(e.g. “bad credit risk”) 2. Protected class {d, a} ∈ s is a binary variable where d = 1 is the disadvantaged group (e.g. “immigrant”) and a = 0 is the advantaged group (e.g. “citizen”).
Instantiated Models Raw Data Model Specifications Predictions on New Data
Deployed Model
Preprocessing Training Evaluation Prediction
Instantiated Models Raw Data Model Specifications Predictions on New Data
Evaluation Scorer API
Mean difference
○ 1 is the maximum discrimination case. ○ 0 is the statistical parity case. ○
case.
Deployed Model
Loan Granted Loan Denied Man Woman
mean difference = 0.5 - 0.5 = 0 mean difference = 0.67 - 0.25 = 0.42
Instantiated Models Raw Data Model Specifications Predictions on New Data
Evaluation Scorer API
Consistency
∈ knn(xi).
neighbors yj.
number of observations N × k number of neighbors.
○ 0 indicates no discrimination ○ 1 indicates maximum discrimination
Deployed Model
Loan Granted Loan Denied Man Woman Home-owner Not home-owner
consistency = 1 - [ ( 0 + 0 ) / ( 2 × 5 ) ] = 1 consistency = 1 - [ ( 5 + 5 ) / ( 2 × 5 ) ] = 0
k neighbors = 5
Instantiated Models Raw Data Model Specifications Predictions on New Data
Preprocessing Transformer API
Relabelling
statistical parity:
○
Top-ranked Xd, y- are “promoted” to Xd, y+
○
Bottom-ranked Xa, y+ are “demoted” to Xa, y-
predictions compared to a model trained on D.
Deployed Model
is homeowner income Good Credit Risk Bad Credit Risk Woman Man
Original Data Relabeled Data
Assumption: Labels are incorrect, and we should directly change them in favor of the disadvantaged group.
Instantiated Models Raw Data Model Specifications Predictions on New Data
Prediction Predictor API
Reject Option Classification (ROC)
decision boundary learned by the classifier.
around the decision boundary (where 0.5 < < 1): ○ predicted labels of Xd are assigned as y+. ○ predicted labels Xa are assigned as y –.
Deployed Model
is homeowner income Good Credit Risk Bad Credit Risk Woman Man
Original Prediction Relabeled Data
Assumption: Observations close to the decision boundary were labelled incorrectly based
Instantiated Models Raw Data Model Specifications Predictions on New Data
Training Estimator API
Additive Counterfactually Fair Model
using s attribute(s) as input.
feature values and true feature values for each
predict y.
Deployed Model
X - X
X s
ˆ
residual model model
y y ˆ
protected classes features labels
ˆ
predicted features residual features
Instantiated Models Raw Data Model Specifications Predictions on New Data
Training Estimator API
Prejudice Remover Regularization
which a prediction ŷ depends on a sensitive attribute s (otherwise known as mutual information).
Deployed Model
Minimize objective function L2 Regularization “Don’t weight a particular feature too much” Logistic Regression Cost “Don’t make mistakes on predictions with respect to ‘true labels’” Prejudice Index Regularization “Don’t depend on sensitive features too much to make predictions”
Value of weight Θ
Fairness-unaware Objective Fairness-aware Model Objective
Fairness-utility tradeoff Cost
1000 loan application records 1 binary target variable y:
700 “good” credit_risk 300 “bad” credit_risk
~20 input variables X:
housing credit_history purpose foreign_worker personal_status_and_sex age_in_years
3 binary protected classes s:
is_foreign is_female age_below_25
Source: https://archive.ics.uci.edu/ml/datasets/statlog+(german+credit+data)
Measure potential discrimination in the raw data
Does the algorithm make socially biased predictions?
6.4 9.5 12.6 24.3 29.4 34.5 29.2 32.3 35.4
Mean difference in raw data Mean difference score of logistic regression test predictions
Assess Fairness-utility Trade-off
Baseline Remove protected attributes Relabel target variable Counterfactually fair model Reject-option classification
Mean difference and AUC scores generated by a logistic regression model for each experimental condition, by protected attributes.
Live Demo: Fatal Encounters Dataset
www.fatalencounters.org
FML-as-a-service “FMLAAS”
Organizations (private, nonprofit, govt) Data Third-party Predictive Service Models Predictions
Use Case: “As a law-enforcement agency, I need to identify individuals who are most likely to be connected to gang X.”
FMLI Web Service
FMLI Use Case 1: “As a law-enforcement agency, I want to measure the degree to which my data contains discriminatory patterns”
FML-as-a-service “FMLAAS”
Organizations (private, nonprofit, govt) Data Third-party Predictive Service Models fit measure predict Metrics Predictions
FMLI Use Case: “As a third-party predictive service, I want to make sure my models are compliant with anti-discrimination laws.”
FML-as-a-service “FMLAAS”
Organizations (private, nonprofit, govt) Data Third-party Predictive Service Models FMLI Web Service fit measure predict Metrics, Features, Models, Predictions Predictions
Flexible Definitions of Fairness Multiple Sensitive Attributes Multi-valued Categorical Sensitive Attributes Multi-class Classification Task Regression Task Learning Fair Representations Fairness-aware Regularization Fairness-aware Generative Modeling Systematizing the Fairness-Utility Tradeoff
Mathematical Formalization Ethics & Values
Government, Law, Business, Academia, Civil Society, Media Law, Political Science, Social Science Product Management, UX/UI Design Engineering, Data Science, Machine Learning, Statistics
1. What historical data am I using in my training data? 2. Are these data correlated with socially sensitive attributes? 3. Are any sensitive attributes correlated with the target label? 4. Who labelled my training data, or by what process did I obtain my labels? 5. What kinds of features should I include during the training process? 6. What does discrimination and fairness mean in my system? 7. How are my predictions being used? 8. How can my predictions be misinterpreted/misused by the end user? 9. Is it okay for my model to encode social biases? 10. What negative/positive feedback loops is my system introducing into the world?
@cosmicbboy https://github.com/cosmicBboy https://github.com/cosmicBboy/themis-ml https://arxiv.org/pdf/1710.06921.pdf