Detecting and Reducing Social Discrimination in Machine Learning - - PowerPoint PPT Presentation

detecting and reducing social discrimination in machine
SMART_READER_LITE
LIVE PREVIEW

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:


slide-1
SLIDE 1

Detecting and Reducing Social Discrimination in Machine Learning Models

New York Open Stats Meetup

Niels Bantilan 12/14/2017

slide-2
SLIDE 2

What is bias?

slide-3
SLIDE 3

Source: https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing

What is discrimination?

Inmate recidivism risk model

slide-4
SLIDE 4

Bias is an amoral concept

“The preference for or against something”

Discrimination is a moral, socially contextual concept

“When an action is based on biases that lead to the systematic disenfranchisement

  • f people based on arbitrary group membership”

Fairness is the “opposite” of discrimination

(according to a specific definition of discrimination)

slide-5
SLIDE 5

Biased Decisions Biased Data Biased Algorithm Biased Predictions

slide-6
SLIDE 6

Problem

Machine learning models optimized

  • nly for accuracy reflect and amplify

real-world social biases.

slide-7
SLIDE 7
slide-8
SLIDE 8

Themis-ml

(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

slide-9
SLIDE 9

FMLI Design Principles

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.

slide-10
SLIDE 10

Discrimination Discovery

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.

?

slide-11
SLIDE 11

Disparate Treatment

Discrimination Discovery

Hiring decision process

  • nly accept

men’s resumes

Disparate Impact

Hiring decision process

accept all resumes

?

slide-12
SLIDE 12

Discrimination Discovery

Individual-level

(individual consistency)

Group-level

(statistical parity)

slide-13
SLIDE 13

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.

Fairness-aware Machine Learning

Utility Fairness

slide-14
SLIDE 14

Assumptions

1. Prediction target y is a binary variable where y+ = 1 is a beneficial

  • utcome (e.g. “good credit risk”) and y- = 0 is an adverse outcome

(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”).

Fairness-aware Machine Learning

slide-15
SLIDE 15

Instantiated Models Raw Data Model Specifications Predictions on New Data

Machine Learning Pipeline

Deployed Model

Preprocessing Training Evaluation Prediction

slide-16
SLIDE 16

Instantiated Models Raw Data Model Specifications Predictions on New Data

Machine Learning Pipeline

Evaluation Scorer API

Mean difference

  • Compute p(a ⋃ y+) – p(d ⋃ y+).
  • Values range from -1 to 1

○ 1 is the maximum discrimination case. ○ 0 is the statistical parity case. ○

  • 1 is the maximum reverse-discrimination

case.

Deployed Model

slide-17
SLIDE 17

Mean Difference

Loan Granted Loan Denied Man Woman

mean difference = 0.5 - 0.5 = 0 mean difference = 0.67 - 0.25 = 0.42

slide-18
SLIDE 18

Instantiated Models Raw Data Model Specifications Predictions on New Data

Machine Learning Pipeline

Evaluation Scorer API

Consistency

  • For each observation xi, find its k-nearest neighbors xj

∈ knn(xi).

  • Sum the differences between the label yi and all of its

neighbors yj.

  • Normalize the sum of these differences by the total

number of observations N × k number of neighbors.

  • Subtract this normalized value from 1.
  • Values range from 0 to 1

○ 0 indicates no discrimination ○ 1 indicates maximum discrimination

Deployed Model

slide-19
SLIDE 19

Consistency

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

slide-20
SLIDE 20

Instantiated Models Raw Data Model Specifications Predictions on New Data

Machine Learning Pipeline

Preprocessing Transformer API

Relabelling

  • Train a ranker model R on the dataset D.
  • Modify D to create Dnew such that we achieve

statistical parity:

Top-ranked Xd, y- are “promoted” to Xd, y+

Bottom-ranked Xa, y+ are “demoted” to Xa, y-

  • Training a model on Dnew should yield fairer

predictions compared to a model trained on D.

Deployed Model

slide-21
SLIDE 21

is homeowner income Good Credit Risk Bad Credit Risk Woman Man

Relabeling

Original Data Relabeled Data

Assumption: Labels are incorrect, and we should directly change them in favor of the disadvantaged group.

slide-22
SLIDE 22

Instantiated Models Raw Data Model Specifications Predictions on New Data

Machine Learning Pipeline

Prediction Predictor API

Reject Option Classification (ROC)

  • Train an initial classifier K
  • Generate predicted probabilities ŷ on the test set.
  • Compute the proximity of each prediction ŷ to the

decision boundary learned by the classifier.

  • Modify labels within the critical region threshold

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

slide-23
SLIDE 23

Reject Option Classification

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

  • n their sex, so we should offset this by flipping the prediction for those observations.
slide-24
SLIDE 24

Instantiated Models Raw Data Model Specifications Predictions on New Data

Machine Learning Pipeline

Training Estimator API

Additive Counterfactually Fair Model

  • Train linear models to predict each feature in X

using s attribute(s) as input.

  • Compute residuals ij between the predicted

feature values and true feature values for each

  • bservation i and each feature j.
  • The final model is trained on ij as features to

predict y.

Deployed Model

slide-25
SLIDE 25

X - X

Additive Counterfactually Fair Model

X s

  • X

ˆ

residual model model

y y ˆ

protected classes features labels

ˆ

predicted features residual features

slide-26
SLIDE 26

Instantiated Models Raw Data Model Specifications Predictions on New Data

Machine Learning Pipeline

Training Estimator API

Prejudice Remover Regularization

  • Define “prejudice index” (PI) as the degree to

which a prediction ŷ depends on a sensitive attribute s (otherwise known as mutual information).

  • Add PI as a term to your objective function
  • Minimize (or maximize) with gradient descent or
  • ther optimization method of your choice.

Deployed Model

slide-27
SLIDE 27

Prejudice Remover Regularization

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”

slide-28
SLIDE 28

Value of weight Θ

Prejudice Remover Regularization

Fairness-unaware Objective Fairness-aware Model Objective

Fairness-utility tradeoff Cost

slide-29
SLIDE 29

Case Study: German Credit Data

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)

slide-30
SLIDE 30

Measure potential discrimination in the raw data

Case Study: German Credit Data

slide-31
SLIDE 31

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

Case Study: German Credit Data

slide-32
SLIDE 32

Assess Fairness-utility Trade-off

Case Study: German Credit Data

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.

slide-33
SLIDE 33

Live Demo: Fatal Encounters Dataset

www.fatalencounters.org

slide-34
SLIDE 34

So now what?

slide-35
SLIDE 35

MEASURE AND MITIGATE ALL THE THINGS

slide-36
SLIDE 36

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.”

slide-37
SLIDE 37

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

slide-38
SLIDE 38

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

slide-39
SLIDE 39

Future Directions

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

slide-40
SLIDE 40

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

slide-41
SLIDE 41

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?

Questions to Ask Yourself

slide-42
SLIDE 42

@cosmicbboy https://github.com/cosmicBboy https://github.com/cosmicBboy/themis-ml https://arxiv.org/pdf/1710.06921.pdf

Thanks!