-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfairness-summary.html
408 lines (298 loc) · 12.2 KB
/
fairness-summary.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Presentation at Ducit — Part 1</title>
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">
<link rel="stylesheet" href="custom_themes/pal.css" id="theme">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="plugin/highlight/monokai.css">
</head>
<body>
<div id="hidden" style="display:none;">
<div id="static-content">
<footer>
<!-- <p>University of Sussex</p> -->
<img src="images/sussex_logo.svg" style="max-width: 10%; border: none; box-shadow: none; margin: 0;"/>
</footer>
</div>
</div>
<div class="reveal">
<div class="slides">
<section>
<h1>Fair Predictions</h1>
<p>by <b>Thomas Kehrenberg</b> and <b>Oliver Thomas</b> </p>
<h3>Predictive Analytics Lab, University of Sussex</h3>
<!-- <img src="images/Cifas_logo.jpg" alt="Cifas Logo" style="width: 15%; border: none;">
<img src="images/ducit_logo.jpg" alt="Ducit Logo" style="width: 15%; border: none;"> -->
<!-- <p>Talk given at Cifas in association with Ducit</p> -->
<br/>
<p>Mon, 15<sup>th</sup> April 2019</p>
<!-- <img src="images/sussex_logo.svg" style="width: 15%; border: none;"/> -->
</section>
<section>
<section data-markdown><textarea data-template>
## Summary
- How does our data become unfair?
- Define "Fair"
- Methods to enforce fairness
- In the algorithm
- Adjusting the data itself
- Conclusion
</textarea></section>
</section>
<section>
<section data-markdown><textarea data-template>
## How bias gets into the dataset
### Sampling Bias
</textarea></section>
<section data-markdown><textarea data-template>
## Sampling Bias
<img src="images/sampling_1.svg" alt="Data Generation Pipeline" style="width: 55%; border: none; box-shadow: none;">
</textarea></section>
<section data-markdown><textarea data-template>
## Sampling Bias
<img src="images/sampling_2.svg" alt="Data Generation Pipeline" style="width: 55%; border: none; box-shadow: none;">
</textarea></section>
<section data-markdown><textarea data-template>
## Sampling Bias
<img src="images/sampling_3.svg" alt="Data Generation Pipeline" style="width: 55%; border: none; box-shadow: none;">
</textarea></section>
<!-- <section data-markdown><textarea data-template>
## Sampling Bias
This can occur because of instead of drawing i.i.d. (independent and identically distributed), we are instead drawing d.d.d. (depedent and differently distributed)
</textarea></section> -->
</section>
<section data-markdown><textarea data-template>
## How bias gets into the dataset
### Unfairness
<br/>
<img src="images/data_generation.svg" alt="Data Generation Pipeline" style="width: 50%; border: none;">
</textarea></section>
<section data-markdown><textarea data-template>
## Confusion matrix
| | $y=1$ | $y=0$ |
|-----------------|:-------------------:|:-------------------:|
| **$\hat{y}=1$** | true positive (TP) | false positive (FP) |
| **$\hat{y}=0$** | false negative (FN) | true negative (TN) |
<br/>
**acceptance rate**: $AR = P(\hat{y}=1) = \frac{TP + FP}{TP + FP + FN + TN}$
**true positive rate**: $TPR = P(\hat{y}=1|y=1) = \frac{TP}{TP + FN}$
</textarea></section>
<section>
<section data-markdown><textarea data-template>
## Fairness definitions:
### Group Fairness
### Individual Fairness
</textarea></section>
<section data-markdown><textarea data-template>
## Definitions – Group Fairness
### Demographic Parity
Make (positive) predictions at the same rate across different subgroups.
$$
P(\hat{Y} = 1 | S=0) = P(\hat{Y} = 1 | S=1)
$$
→ Equalise acceptance rate accross groups.
</textarea></section>
<section data-markdown><textarea data-template>
## Definitions – Group Fairness
### Equal Odds
Make (positive) predictions at the same rate across different subgroups, conditioned on the known outcome.
$$
P(\hat{Y}=y | S=0, Y=y) = P(\hat{Y}=y | S=1, Y=y)
$$
with $Y \in \\{0,1\\}$
→ Equalise the TPR and the TNR (or FPR) across groups.
</textarea></section>
<section data-markdown><textarea data-template>
## Definitions – Group Fairness
### Equal Opportunity
Make (positive) predictions at the same rate across different subgroups, conditioned on if the known outcome is positive.
$$
P(\hat{Y} = 1 | S=0, Y=1) = P(\hat{Y} = 1 | S=1, Y=1)
$$
→ Equalise the TPR across groups.
</textarea></section>
</section>
<section>
<section data-markdown><textarea data-template>
## Fairness definitions:
### Individual Fairness
> Similar individuals should be treated similarly.
Given some distance measure between individuals (e.g. the Euclidean distance in the feature space),
the distance between individuals and the distance of their associated outcome should be proportional.
</textarea></section>
</section>
<section data-markdown><textarea data-template>
## Fairness-accuracy trade-off
If the class label is *biased*, or the features themselves are biased, then it cannot be possible to be both fair and accurate.
However, if bias solely occurs due to sampling bias, then fairness should improve generalisation.
<!-- Not sure about the above statement, will have a think -->
</textarea></section>
<section data-markdown><textarea data-template>
## How to remove bias?
- During training an algortithm
- Adjusting the data
</textarea></section>
<section>
<!-- <section data-markdown><textarea data-template>
## Common Notation
</textarea></section> -->
<section data-markdown><textarea data-template>
## Notation
- $Y \in \\{0,...,n\\}$: Class label
- $S \in \\{0,...,k\\}$: Sensitive label
- $X = (X_1, ... , X_m)$: Features of a datapoint (Covariates)
- $\theta$: Model parameters that we learn.
</textarea></section>
<section data-markdown><textarea data-template>
## Notation
$\hat{Y}=$ Model's prediction of $Y$
$\hat{S}=$ Model's prediction of $S$
$\hat{X}=$ Model's prediction of $X$
</textarea></section>
</section>
<section>
<section data-markdown><textarea data-template>
## Example Dataset: UCI Adult
U.S. census data from 1994
$Y=$ Does the individual earn > $\$50,000$?
$S=$ Is the individual white?
$X=$ Features of the individual: relationship status, age, education level, hours worked per week etc.
</textarea></section>
<!--
<section data-markdown><textarea data-template>
## Sensitive attributes
- what is a sensitive attribute?
- also known as protected characteristics.
</textarea></section>
-->
</section>
<section data-markdown><textarea data-template>
## In-process methods
- Enforce fairness *during training*
- **Example**: Logistic Regression
* model: $\; f(x) = Wx + b$, $\; \theta = \\{W, b\\}$
* probability score: $\; P(y=1|x, \theta)=\sigma(f(x))$
* with dependency on $s$: $\; P(y=1|x, \theta, s)$
</textarea></section>
<section>
<section data-markdown><textarea data-template>
## In-process: Likelihood
- Manipulate the likelihood $P(y=1|x, \theta, s)$ to enforce fairness
- Introduce target labels $\bar{y}$
- $P(y=1|x, \theta, s) = \sum\limits_{\bar{y}} P(y=1|\bar{y},s)P(\bar{y}|x, \theta, s)$
- Intuition: change the learning goal
Paper: *Kehrenberg et al.*, `arXiv:1810.05598`
</textarea></section>
<section data-markdown><textarea data-template>
## In-process: Likelihood
<!-- - conceptually works best with *Demographic Parity*
* but was also extended to Equal Odds/Opportunity -->
transparent and easy to control
![results1](images/adult_parity_scatter_acc.svg) <!-- .element: style="height: 7em; border: none;"-->
![results2](images/adult_parity_scatter_pr_pr_with_br.svg) <!-- .element: style="height: 7em; border: none;"-->
</textarea></section>
<!-- <section data-markdown><textarea data-template>
## In-process: Likelihood
![results](images/adult_race_PR.png) <!-- .element: style="width: 70%; border: none;" -->
<!-- </textarea></section> -->
</section>
<section>
<section data-markdown><textarea data-template>
## In-process: Constraint
- Different approach: add constraint to model parameters so that model will be fair
- Measure of bias in output $\; f$: $\; Cov(s, f) \approx \frac{1}{N} \sum\limits_{i=1}^{N} (s_i - \bar{s}) \cdot f_i$
* Assumption: $E[f] =0$ which is fulfilled in the Logistic Regression example
- $Cov(s, f)=0$ → $s$ and $f$ independent → Demographic Parity
</textarea></section>
<section data-markdown><textarea data-template>
## In-process: Constraint
- Goal: $\; f$ is predictive of $y$ while keeping $Cov(s, f)$ small
- Classification loss: $\; \mathcal{L}_c(y, \sigma(f(x))\;$ (e.g. cross entropy)
- Total loss: $\;\mathcal{L} = \mathcal{L}_c + \gamma \cdot \| Cov(s, f) \|$
* $\gamma$ is a trade-off parameter
- A variation on this can also enforce Equal Odds/Opportunity
</textarea></section>
</section>
<section>
<section data-markdown><textarea data-template>
## Pre-process
### Change of problem set-up
We are no longer a decision making company and are now a data vendor.
Our concern is that our clients will be unwittingly making *unfair* decisions based on the data that we provide.
</textarea></section>
<section data-markdown><textarea data-template>
## Pre-process
### Possible solutions
- generate some new, fairer examples
- transform the data to a new *fair* space, where everyone is neither male nor female, but somewhere in between.
</textarea></section>
</section>
<section>
<section data-markdown><textarea data-template>
## Pre-process
### Generate Fairer Samples
<img src="images/data_generation.svg" alt="Data Generation Pipeline" style="width: 50%; border: none;">
</textarea></section>
<section data-markdown><textarea data-template>
## Pre-process
### Generate Fairer Samples
By going back to $\tilde{X}$, and $\tilde{Y}$, we can imagine the likely $X$ and $Y$ realised from a different sensitive attibute value.
Model: Auto-Encoding Variational Bayes to obtain $\tilde{X}$ and $\tilde{Y}$.
Use these `imagined` examples alongside actual training data.
Paper: *Thomas et al.*, `Under review at IJCAI'19`
</textarea></section>
</section>
<section>
<section data-markdown><textarea data-template>
## Pre-process
### Transform the dataset
learn some function $g: X \rightarrow Z$ s.t. $Z \perp S$
Then a classifier $f: Z \rightarrow Y$ will be fair.
</textarea></section>
<section data-markdown><textarea data-template>
## Pre-process
### Transform the dataset
<img src="images/Latent.svg" alt="Mapping" style="width: 50%; border: none;">
</textarea></section>
<section data-markdown><textarea data-template>
## Pre-process
### Transform the dataset
Paper: *Quadrianto et al.*, `arXiv:1810.06755`
IEEE Conference on Computer Vision and Pattern Recognition (CVPR) 2019
** Current state-of-the-art approach**
Constrains $Z$ to be in the same space as $X$, so **meaning** retained.
Enforces independent *distributions* so that `$S \in \{0,1,...,n\}$`
</textarea></section>
<section data-markdown><textarea data-template>
## Pre-process
### Transform the dataset
<table style="width:100%">
<tr>
<th>X</th>
<th>Fair X</th>
</tr>
<tr>
<td><img src="images/x_rel_giv_y1.png" alt="X" style="width: 70%; border: none;"></td>
<td><img src="images/x_tilde_rel_giv_y1.png" alt="X tilde" style="width: 70%; border: none;"></td>
</tr>
</table>
</textarea></section>
</section>
<section>
<section data-markdown><textarea data-template>
## Take-aways
<p class="fragment">Data and algorithms are **not** inherently fair</p>
<p class="fragment">Fairness is **application specific**</p>
<p class="fragment">Strategies to be fairer exist</p>
</textarea></section>
</section>
</div>
</div>
<script type="module" src="settings.js"></script>
</body>
</html>