Compare commits
3 Commits
6d4113a407
...
f7dfdd101d
| Author | SHA1 | Date | |
|---|---|---|---|
|
f7dfdd101d
|
|||
|
4c64230a6f
|
|||
|
548b052c42
|
@ -44,6 +44,7 @@
|
||||
\def\r{{\vec{r}}}
|
||||
\def\s{{\vec{s}}}
|
||||
\def\u{{\vec{u}}}
|
||||
\def\D{\ensuremath{\mathcal{D}}}
|
||||
|
||||
|
||||
\begin{document}
|
||||
@ -56,5 +57,6 @@
|
||||
\include{./sections/_formation_control.tex}
|
||||
\include{./sections/_cooperative_robotics.tex}
|
||||
\include{./sections/_safety_controllers.tex}
|
||||
\include{./sections/_neural_networks.tex}
|
||||
|
||||
\end{document}
|
||||
BIN
src/year2/distributed-autonomous-systems/img/safety_control.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 74 KiB |
@ -0,0 +1,303 @@
|
||||
\chapter{Neural networks}
|
||||
|
||||
\begin{description}
|
||||
\item[Supervised learning] \marginnote{Supervised learning}
|
||||
Given $M$ data-label samples $\{ (\D^1, p^1), \dots, (\D^M, p^M) \}$, the goal is to approximate the mapping through a non-linear function $\phi(\cdot; \u)$ parametrized on $\u$.
|
||||
\end{description}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Neuron model] \marginnote{Neuron model}
|
||||
Computational unit composed of a set of weights $\u \in \mathbb{R}^d$ ($\mathbb{R}^{d+1}$ if with bias) that, given an input $\x \in \mathbb{R}^d$, computes:
|
||||
\[
|
||||
x^{+} = \sigma(\x^T \u + u_{b})
|
||||
\]
|
||||
where $\sigma: \mathbb{R} \rightarrow \mathbb{R}$ is an activation function.
|
||||
|
||||
\begin{remark}
|
||||
The bias can be easily added by considering as weights $\begin{bmatrix} u_b & \u \end{bmatrix}^T$ and as input $\begin{bmatrix} 1 & \x \end{bmatrix}^T$.
|
||||
\end{remark}
|
||||
|
||||
|
||||
\item[Multi-layer perceptron] \marginnote{Multi-layer perceptron}
|
||||
Network with $T$ layers each (for simplicity) with $d$ neurons where the $h$-th unit at layer $t$ has weights $\u_{h,t} \in \mathbb{R}^d$. The update at each neuron is defined as:
|
||||
\[
|
||||
x_{h,t+1} = \sigma(\x_t^T \u_{h,t})
|
||||
\quad
|
||||
x_{h,0} = \D^i_h
|
||||
\]
|
||||
In matrix form, it becomes:
|
||||
\[
|
||||
\begin{split}
|
||||
\begin{bmatrix}
|
||||
x_{1, t+1} \\ \vdots \\ x_{d, t+1}
|
||||
\end{bmatrix}
|
||||
&=
|
||||
\begin{bmatrix}
|
||||
\sigma(\x_t^T \u_{1,t}) \\
|
||||
\vdots \\
|
||||
\sigma(\x_t^T \u_{d,t})
|
||||
\end{bmatrix} \\
|
||||
\x_{t+1} &= f(\x_t, \u_t) \quad \u_t = \begin{bmatrix}
|
||||
\u_{1,t} \\ \vdots \\ \u_{d,t}
|
||||
\end{bmatrix} \in \mathbb{R}^{d^2}
|
||||
\end{split}
|
||||
\]
|
||||
\end{description}
|
||||
|
||||
|
||||
|
||||
\section{Training problem definition}
|
||||
|
||||
\begin{description}
|
||||
\item[Single sample training] \marginnote{Single sample training}
|
||||
Task of finding $\u = (\u_0, \dots, \u_{T-1})$ such that at the last layer $t=T$ the prediction is as accurate as possible:
|
||||
\[ \Vert \x_T - p \Vert < \varepsilon \]
|
||||
|
||||
By using forward simulation of the dynamics $\x_{t+1} = f(\x_t, \u_t)$, we can obtain the output of the last layer as:
|
||||
\[
|
||||
\x_T = \phi(\x_0; \u) = \phi(\D; \u)
|
||||
\]
|
||||
where $\phi$ is called shooting map and it passes the data sample through the layers (from a deep learning point-of-view, it represents the composition of function).
|
||||
|
||||
The best weights $\u^*$ can be obtained by solving:
|
||||
\[
|
||||
\min_{\u} l(\x_T; p) = \min_{\u} l(\phi(\D; \u); p)
|
||||
\]
|
||||
where $l$ is the loss.
|
||||
|
||||
\begin{remark}
|
||||
In optimal control, the learning problem is a reduced/condensed problem and the algorithm to solve it is a direct single shooting.
|
||||
\end{remark}
|
||||
|
||||
By defining:
|
||||
\[
|
||||
J(\u) = l(\phi(\D; \u); p)
|
||||
\]
|
||||
The reduced optimization problem is:
|
||||
\[
|
||||
\min_{\u} J(\u)
|
||||
\]
|
||||
And can be solved using the gradient method:
|
||||
\[
|
||||
\u^{k+1} = \u^k - \alpha^k \nabla J(\u^k)
|
||||
\]
|
||||
|
||||
|
||||
\item[Multiple samples training] \marginnote{Multiple samples training}
|
||||
With multiple samples, the shooting function is applied at each data point:
|
||||
\[
|
||||
\x_T^m = \phi(\x_0^m; \u)
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
$\u$ is independent of $m$ (it is called ensemble control).
|
||||
\end{remark}
|
||||
|
||||
The optimization problem becomes:
|
||||
\[
|
||||
\min_{\u} \sum_{m=1}^{M} J_m(\u)
|
||||
\qquad
|
||||
J_m(\u) = l(\phi(\x_0^m; \u); p^m)
|
||||
\]
|
||||
And its solution with the gradient method is:
|
||||
\[
|
||||
\u^{k+1} = \u^k - \alpha^k \sum_{m=1}^{M} \nabla J_m(\u^k)
|
||||
\]
|
||||
\end{description}
|
||||
|
||||
|
||||
\section{Backpropagation}
|
||||
|
||||
|
||||
\subsection{Preliminaries}
|
||||
|
||||
\begin{description}
|
||||
\item[Finite-horizon optimal control problem] \marginnote{Finite-horizon optimal control problem}
|
||||
Optimization problem defined as:
|
||||
\[
|
||||
\begin{aligned}
|
||||
&\min_{\x, \u} \sum_{t=0}^{T-1} l_t(\x_t, \u_t) + l_T(\x_T)
|
||||
&& \x_0 = \x_\text{init} \\
|
||||
&\,\text{subject to } \x_{t+1} = f_t(\x_t, \u_t)
|
||||
\end{aligned}
|
||||
\]
|
||||
where:
|
||||
\begin{itemize}
|
||||
\item $\x = (\x_1, \dots, \x_T)$ are the state trajectories,
|
||||
\item $\u = (\u_1, \dots, \u_{T-1})$ are the input trajectories,
|
||||
\item $f_t: \mathbb{R}^n \times \mathbb{R}^m \rightarrow \mathbb{R}^n$ for $t=0, \dots, T-1$ are the dynamics,
|
||||
\item $l_t: \mathbb{R}^n \times \mathbb{R}^m \rightarrow \mathbb{R}$ for $t=0, \dots, T-1$ are the stage costs,
|
||||
\item $l_T: \mathbb{R}^n \rightarrow \mathbb{R}$ is the terminal cost.
|
||||
\end{itemize}
|
||||
|
||||
\item[Adjoint method (general case)] \marginnote{Adjoint method (general case)}
|
||||
Algorithm to compute the gradient of the cost function of a finite-horizon optimal control problem.
|
||||
|
||||
Given the initial trajectory $(\x^0, \u^0)$, the method works as follows:
|
||||
\begin{enumerate}
|
||||
\item Repeat for the number of iterations $k = 0, 1, \dots$:
|
||||
\begin{enumerate}
|
||||
\item Perform backward simulation of the co-state $\lambda$ for $t = T-1, \dots, 0$:
|
||||
\[
|
||||
\begin{split}
|
||||
\lambda_t &= \nabla_{[\x_t^k]} l_t(\x_t^k, \u_t^k) + \nabla_{[\x_t^k]} f_t(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\qquad
|
||||
\lambda_T = \nabla l_T(\x_T^k) \\
|
||||
\Delta \u_t^k &= \nabla_{[\u_t^k]} l_t(\x_t^k, \u_t^k) + \nabla_{[\u_t^k]} f_t(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
Intuitively, $\lambda_t$ is the derivative of the cost function w.r.t. the first argument and $\Delta \u_t^k$ is w.r.t. the second.
|
||||
\end{remark}
|
||||
|
||||
\item Apply descent step on the control input for $t = 0, \dots, T-1$:
|
||||
\[
|
||||
\u_{t}^{k+1} = \u_{t}^{k} - \alpha^k \Delta \u_t^k
|
||||
\]
|
||||
\item Apply forward simulation of the dynamics for $t = 0, \dots, T-1$:
|
||||
\[
|
||||
\x_{t+1}^{k+1} = f_t(\x_t^{k+1}, \u_t^{k+1})
|
||||
\qquad
|
||||
\x_0^{k+1} = \x_\text{init}
|
||||
\]
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
|
||||
\item[Adjoint method (simplified)] \marginnote{Adjoint method (simplified)}
|
||||
Without stage cost and with a time-invariant dynamics, the problem becomes:
|
||||
\[
|
||||
\begin{aligned}
|
||||
&\min_{\x, \u} l_T(\x_T) && \x_0 = \x_\text{init} \\
|
||||
&\,\text{subject to } \x_{t+1} = f(\x_t, \u_t)
|
||||
\end{aligned}
|
||||
\]
|
||||
|
||||
The backward simulation of the co-state becomes:
|
||||
\[
|
||||
\begin{split}
|
||||
\lambda_t &= \nabla_{[\x_t^k]} f(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\qquad
|
||||
\lambda_T = \nabla l_T(\x_T^k) \\
|
||||
\Delta \u_t^k &= \nabla_{[\u_t^k]} f(\x_t^k, \u_t^k) \lambda_{t+1}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
The co-states $\lambda_t$ represent the partial derivatives necessary to apply the chain rule and $\Delta\u_t = \frac{\partial J(\u)}{\partial \u_t}$.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Adjoint method for neural networks}
|
||||
|
||||
\begin{description}
|
||||
\item[Backpropagation (one-sample)] \marginnote{Backpropagation (one-sample)}
|
||||
The simplified adjoint method is equivalent to the backpropagation algorithm for neural networks with:
|
||||
\[
|
||||
f(\x_t, \u_t) =
|
||||
\begin{bmatrix}
|
||||
f_1(\x_t^k, \u_t^k) \\ \vdots \\ f_d(\x_t^k, \u_t^k)
|
||||
\end{bmatrix} =
|
||||
\begin{bmatrix}
|
||||
\sigma(\x_t^T \u_{1,t}) \\ \vdots \\ \sigma(\x_t^T \u_{d,t})
|
||||
\end{bmatrix}
|
||||
\qquad
|
||||
t = 0, 1, \dots, T-1
|
||||
\]
|
||||
|
||||
The gradient w.r.t. the first argument is:
|
||||
\[
|
||||
\begin{split}
|
||||
\nabla_{[\x_t^k]} f(\x_t^k, \u_t^k)
|
||||
&= \begin{bmatrix}
|
||||
\nabla_{[\x_t^k]} f_1(\x_t^k, \u_t^k) & \dots & \nabla_{[\x_t^k]} f_d(\x_t^k, \u_t^k)
|
||||
\end{bmatrix} \\
|
||||
&= \begin{bmatrix}
|
||||
\u_{1,t}^k \sigma'((\x_t^k)^T \u_{1,t}^k) & \dots & \u_{d,t}^k \sigma'((\x_t^k)^T \u_{d,t}^k)
|
||||
\end{bmatrix} \in \mathbb{R}^{d \times d}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
The gradient w.r.t. the second argument is:
|
||||
\[
|
||||
\begin{split}
|
||||
\nabla_{[\u_t^k]} f(\x_t^k, \u_t^k)
|
||||
&= \begin{bmatrix}
|
||||
\nabla_{[\u_t^k]} f_1(\x_t^k, \u_t^k) & \dots & \nabla_{[\u_t^k]} f_d(\x_t^k, \u_t^k)
|
||||
\end{bmatrix} \\
|
||||
&= \begin{bmatrix}
|
||||
\x_t^k \sigma'((\x_t^k)^T \u_{1,t}^k) & \dots & 0_d \\
|
||||
0_d & \ddots & 0_d \\
|
||||
\vdots & & \vdots \\
|
||||
0_d & \dots & \x_t^k \sigma'((\x_t^k)^T \u_{d,t}^k)
|
||||
\end{bmatrix} \in \mathbb{R}^{d^2 \times d}
|
||||
\end{split}
|
||||
\]
|
||||
|
||||
\begin{remark}
|
||||
When computing $\nabla_{[\u_t^k]} f(\x_t^k, \u_t^k) \lambda_{t+1}$, a summation is sufficient instead of performing the complete matrix multiplication:
|
||||
\[
|
||||
\begin{bmatrix}
|
||||
\x_t^k \sigma'((\x_t^k)^T \u_{1,t}^k) & \dots & 0_d \\
|
||||
0_d & \ddots & 0_d \\
|
||||
\vdots & & \vdots \\
|
||||
0_d & \dots & \x_t^k \sigma'((\x_t^k)^T \u_{d,t}^k)
|
||||
\end{bmatrix}
|
||||
\begin{bmatrix}
|
||||
\lambda_{1,t+1} \\ \vdots \\ \lambda_{d,t+1}
|
||||
\end{bmatrix}
|
||||
\]
|
||||
\end{remark}
|
||||
|
||||
\item[Backpropagation (multiple samples)] \marginnote{Backpropagation (multiple samples)}
|
||||
With $M$ data points, $\Delta \u_t^{m,k}$ is computed individually for each example and the update step is performed as:
|
||||
\[
|
||||
\u_t^{k+1} = \u_t^k - \alpha^k \sum_{m=1}^{M} \Delta \u_t^{m,k}
|
||||
\]
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Federated machine learning}
|
||||
|
||||
\begin{description}
|
||||
\item[Federated machine learning] \marginnote{Federated machine learning}
|
||||
Given a parameter server and $N$ agents each with $M_i$ data points, the problem is defined as:
|
||||
\[ \min_\u \sum_{i=1}^{N} \sum_{m=1}^{M_i} l(\phi(\mathcal{D}^m; \u); p^m) = \min_\u \sum_{i=1}^{N} J_i(\u) \]
|
||||
Communication is only between the parameter server and the agents.
|
||||
|
||||
\item[Federated backpropagation] \marginnote{Federated backpropagation}
|
||||
Algorithm that works as follows:
|
||||
\begin{enumerate}
|
||||
\item Repeat for the number of iterations $k = 0, 1, \dots$:
|
||||
\begin{enumerate}
|
||||
\item The parameter server sends the current weights $\u_k$ to the agents.
|
||||
\item Each agent computes the step direction $\vec{d}_i^k = -\nabla J_i(\u^k)$ and sends it to the parameter server.
|
||||
\item The parameter server performs the update step:
|
||||
\[ \u^{k+1} = \u^k + \alpha^k \sum_{i=1}^{N} \vec{d}_i^k \]
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\end{description}
|
||||
|
||||
|
||||
\subsection{Distributed machine learning}
|
||||
|
||||
\begin{description}
|
||||
\item[Distributed machine learning] \marginnote{Distributed machine learning}
|
||||
Given $N$ agents each with $M_i$ data points, the problem is defined as:
|
||||
\[ \min_\u \sum_{i=1}^{N} \sum_{m=1}^{M_i} l(\phi(\mathcal{D}^m; \u); p^m) = \min_\u \sum_{i=1}^{N} J_i(\u) \]
|
||||
Communication is only between neighboring agents.
|
||||
|
||||
\item[Distributed backpropagation] \marginnote{Distributed backpropagation}
|
||||
Algorithm that works as follows:
|
||||
\begin{enumerate}
|
||||
\item Repeat for the number of iterations $k = 0, 1, \dots$:
|
||||
\begin{enumerate}
|
||||
\item Each agent sends its local weights $\u_i^k$ to its neighbors.
|
||||
\item Each agent computes the local step direction $\vec{d}_i^k = -\nabla J_i\left( \sum_{j \in \mathcal{N}_i} a_{ij}\u_j^k \right)$.
|
||||
\item Each agent performs the local update step:
|
||||
\[ \u_i^{k+1} = \sum_{j \in \mathcal{N}_i} \left( a_{ij} \u_j^k + \alpha^k \vec{d}_i^k \right) \]
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\end{description}
|
||||
@ -25,6 +25,11 @@
|
||||
|
||||
The goal is to design a feedback control law $\kappa^s: X \rightarrow \mathbb{R}^m$ for a control-affine non-linear dynamical system such that the set $X^s$ is forward invariant (i.e., any trajectory starting in $X^s$ remains in $X^s$).
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.25\linewidth]{./img/safety_control.png}
|
||||
\end{figure}
|
||||
|
||||
\begin{remark}
|
||||
The time derivative of $V^s(\x(t))$ along the system trajectories is given by:
|
||||
\[
|
||||
@ -116,6 +121,11 @@
|
||||
\item[Single-robot obstacle avoidance] \marginnote{Single-robot obstacle avoidance}
|
||||
Task where the goal is to keep an agent to a safety distance $\Delta > 0$ from an obstacle.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.35\linewidth]{./img/safety_control_single.png}
|
||||
\end{figure}
|
||||
|
||||
A control barrier function to solve the task can be:
|
||||
\[
|
||||
V^s(\x) = \Vert \x - \x_\text{obs} \Vert^2 - \Delta^2
|
||||
@ -152,6 +162,11 @@
|
||||
\item[Multi-robot collision avoidance] \marginnote{Multi-robot collision avoidance}
|
||||
Task with $N$ single integrator agents that want to keep a safety distance $\Delta > 0$ among them.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.35\linewidth]{./img/safety_control_multi.png}
|
||||
\end{figure}
|
||||
|
||||
The local control barrier function to solve the task can be defined as:
|
||||
\[
|
||||
V^s_{i,j}(\x_i, \x_j) = \Vert \x_i - \x_j \Vert^2 - \Delta^2
|
||||
|
||||
@ -10,5 +10,6 @@
|
||||
\makenotesfront
|
||||
\include{./sections/_gdpr.tex}
|
||||
\include{./sections/_claudette.tex}
|
||||
\include{./sections/_discrimination.tex}
|
||||
|
||||
\end{document}
|
||||
BIN
src/year2/ethics-in-ai/module2/img/decision_anatomy.png
Normal file
|
After Width: | Height: | Size: 293 KiB |
BIN
src/year2/ethics-in-ai/module2/img/gemini_diversity.png
Normal file
|
After Width: | Height: | Size: 595 KiB |
BIN
src/year2/ethics-in-ai/module2/img/pasmoc2_thresholds.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
src/year2/ethics-in-ai/module2/img/sapmoc_density.png
Normal file
|
After Width: | Height: | Size: 235 KiB |
BIN
src/year2/ethics-in-ai/module2/img/stable_diffusion_ceo.png
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
src/year2/ethics-in-ai/module2/img/stable_diffusion_nurse.png
Normal file
|
After Width: | Height: | Size: 426 KiB |
BIN
src/year2/ethics-in-ai/module2/img/tech_workforce.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
425
src/year2/ethics-in-ai/module2/sections/_discrimination.tex
Normal file
@ -0,0 +1,425 @@
|
||||
\chapter{Discrimination}
|
||||
|
||||
\begin{description}
|
||||
\item[Disparate treatment] \marginnote{Disparate treatment}
|
||||
The outcome of an algorithm is based on protected features.
|
||||
|
||||
\item[Disparate impact] \marginnote{Disparate impact}
|
||||
The outcome of an algorithm that uses neutral features is disproportionate against certain groups without an acceptable reason.
|
||||
\end{description}
|
||||
|
||||
|
||||
\section{Biased data}
|
||||
|
||||
|
||||
\subsection{Historical bias}
|
||||
|
||||
\begin{description}
|
||||
\item[Historical bias] \marginnote{Historical bias}
|
||||
System trained on intrinsically biased data will reproduce the same biased behavior.
|
||||
|
||||
\begin{remark}
|
||||
Data can be biased because it comes from past human judgement or by the hierarchies of the society (e.g., systems working on marginalized languages will most likely have lower performance compared to a widespread language).
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
\begin{example}[Amazon AI recruiting tool]
|
||||
Tool that Amazon used in the past to review job applications. It was heavily biased towards male applicants and, even with the gender removed, it was able to infer it from the other features.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.3\linewidth]{./img/tech_workforce.png}
|
||||
\caption{Tech companies workforce in the US}
|
||||
\end{figure}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[UK AI visa and asylum system]
|
||||
System used by the UK government to assess visa and asylum applications. It was found that:
|
||||
\begin{itemize}
|
||||
\item The system ranked applications based on nationality.
|
||||
\item Applicants from certain countries were automatically flagged as high risk.
|
||||
\end{itemize}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Generative AI]
|
||||
Prompting Stable Diffusion to generate the image of a \texttt{ceo} and a \texttt{nurse} highlights the gender and ethnicity bias of the training data.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\begin{subfigure}{0.5\linewidth}
|
||||
\centering
|
||||
\includegraphics[width=\linewidth]{./img/stable_diffusion_nurse.png}
|
||||
\end{subfigure}
|
||||
\hfill
|
||||
\begin{subfigure}{0.4\linewidth}
|
||||
\centering
|
||||
\includegraphics[width=\linewidth]{./img/stable_diffusion_ceo.png}
|
||||
\end{subfigure}
|
||||
\end{figure}
|
||||
|
||||
Also, other systems (e.g., Gemini) included constraints to favor diversity resulting in unexpected results.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.45\linewidth]{./img/gemini_diversity.png}
|
||||
\end{figure}
|
||||
|
||||
In the context of language models, some systems implement a refusal mechanism to prevent a biased response. However:
|
||||
\begin{itemize}
|
||||
\item Using a different prompt on the same topic might bypass the filter.
|
||||
\item Refusal might be applied unequally depending on demographics or domain.
|
||||
\end{itemize}
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Proxy variables}
|
||||
|
||||
\begin{description}
|
||||
\item[Proxy variable] \marginnote{Proxy variable}
|
||||
Neutral feature that is connected to a protected one resulting in a disparate impact on a certain group.
|
||||
\end{description}
|
||||
|
||||
\begin{example}[Disaster relief allocation system]
|
||||
A system that predicts which communities need assistance based on past insurance claims is biased as it is a proxy for socioeconomic conditions: low-income communities often have lower insurance coverage and therefore will be disadvantaged by this system.
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Optum healthcare algorithm]
|
||||
System used in US hospitals to predict which patients would benefit from additional resources. It was trained on historical data and it was found out that it was using the past healthcare cost data as a proxy to assess medical needs.
|
||||
|
||||
Due to historical disparity in accessing healthcare, this would cause a disparate impact on minorities that were unable to afford healthcare.
|
||||
\end{example}
|
||||
|
||||
\begin{example}[Hurricane Katrina and racial disparities]
|
||||
Due to historical racial segregation, the neighborhoods of many US cities can be divided by ethnicity. When Hurricane Katrina hit New Orleans, it mainly damaged the side of the city mostly lived by low-income communities. However, the evacuation plans assumed the availability of private vehicles and shelters were mostly built in the wealthier areas. Also, federal aid arrived quicker for wealthier communities and many low-income residences were never rebuilt.
|
||||
|
||||
An AI system trained on these data would reproduce the same behavior using the area one lives as a proxy.
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Biases embedded in predictors}
|
||||
|
||||
\begin{description}
|
||||
\item[Bias embedded in predictors] \marginnote{Bias embedded in predictors}
|
||||
A system that uses favorable features that only a certain group has.
|
||||
\end{description}
|
||||
|
||||
\begin{example}[House allocation in Los Angeles]
|
||||
VI-SPDAT is a system used in Los Angeles to distribute housing resources to homeless. As it relied on self-reported information, it was favoring those with higher literacy levels.
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Unbalanced samples}
|
||||
|
||||
\begin{description}
|
||||
\item[Unbalanced samples] \marginnote{Unbalanced samples}
|
||||
The dataset does not reflect the statistical composition of the population.
|
||||
\end{description}
|
||||
|
||||
\begin{example}
|
||||
Due to the lack of data of certain groups, a system to predict diseases will be more inaccurate towards minorities.
|
||||
\end{example}
|
||||
|
||||
|
||||
|
||||
\section{Algorithm choice}
|
||||
|
||||
|
||||
\subsection{Aggregation bias problem}
|
||||
|
||||
\begin{description}
|
||||
\item[Aggregation bias problem] \marginnote{Aggregation bias problem}
|
||||
System that has good results overall but with poor performance for specific groups.
|
||||
\end{description}
|
||||
|
||||
\begin{example}
|
||||
A system to predict the distribution of humanitarian aid trained on past successful data can present aggregation bias due to geographical data as a large part of the training data will most likely come from well established urban areas.
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Different base rates}
|
||||
|
||||
\begin{description}
|
||||
\item[Base rate/prior probability] \marginnote{Base rate/prior probability}
|
||||
Proportion of samples belonging to a certain class.
|
||||
\end{description}
|
||||
|
||||
\begin{example}[COMPAS system]
|
||||
COMPAS is a system used by US courts to determine the risk of recidivism (high, medium, low).
|
||||
|
||||
\begin{description}
|
||||
\item[Loomis case]
|
||||
E. Loomis was a defendant that according to COMPAS had a high risk of recidivism and was sentenced to 6 years in prison. The decision was appealed by Loomis as COMPAS has the following issues:
|
||||
\begin{itemize}
|
||||
\item Its functioning is unknown,
|
||||
\item Its validity cannot be verified,
|
||||
\item It discriminates on gender and ethnicity,
|
||||
\item Statistical predictions violate the right to individualized decisions.
|
||||
\end{itemize}
|
||||
|
||||
The Supreme Court of Wisconsin rejected the argument and stated that:
|
||||
\begin{itemize}
|
||||
\item Statistical algorithms do not violate the right to individualized decisions as they are used to enhance a judge's evaluation,
|
||||
\item Gender is necessary to achieve statistical accuracy,
|
||||
\item Judges should be informed about the possibility of racial discrimination by COMPAS.
|
||||
\end{itemize}
|
||||
|
||||
\item[ProPublica and Northpointe studies]
|
||||
ProPublica, a non-profit organization, published a study on the accuracy and fairness of COMPAS by comparing the predicted recidivism rates of $\num{11757}$ defendants and the actual rates between 2013 and 2014. Results found out that:
|
||||
\begin{itemize}
|
||||
\item The overall accuracy is moderate-low ($61.2\%$),
|
||||
\item Black defendants were more likely labeled with a high level of risk, leading to a higher probability of high risk misclassification ($45\%$ blacks vs $23\%$ whites).
|
||||
\item White defendants were more likely labeled with a low level of risk, leading to a higher probability of low risk misclassification ($48\%$ blacks vs $28\%$ whites).
|
||||
\end{itemize}
|
||||
|
||||
Northpointe, the software house of COMPAS, stated that ProPublic made several statistical and technical errors as:
|
||||
\begin{itemize}
|
||||
\item The accuracy of COMPAS is higher that human judgement.
|
||||
\item The general recidivism risk scale is equally accurate for blacks and whites,
|
||||
\item COMPAS is compliant with the principle of fairness and does not implement racial discrimination.
|
||||
\end{itemize}
|
||||
\end{description}
|
||||
|
||||
\indenttbox
|
||||
\begin{remark}[Decision workflow]
|
||||
A decision system can be represented in three steps:
|
||||
\begin{enumerate}
|
||||
\item Assign a predictive score (i.e., compute likelihood). In this step, unfairness can be caused by using protected features, biased data, a proxy, \dots
|
||||
\item Classify the score based on some thresholds. In this step, unfairness can be caused by the choice of the threshold.
|
||||
\item Make the decision. In this step, unfairness can be caused by how the value is used.
|
||||
\end{enumerate}
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.8\linewidth]{./img/decision_anatomy.png}
|
||||
\end{figure}
|
||||
\end{remark}
|
||||
|
||||
\begin{description}
|
||||
\item[SAPMOC case]
|
||||
SAPMOC is a toy example that predicts recidivism only based on whether the defendant has a previous criminal record. Assume that:
|
||||
\begin{itemize}
|
||||
\item $80\%$ of previous offenders recidivate and the remaining do not.
|
||||
\item $20\%$ of first time offenders recidivate and the remaining do not.
|
||||
\item The training data is composed of 3000 defendants divided into 1500 blues (1000 previous offenders) and 1500 greens (500 previous offenders).
|
||||
\end{itemize}
|
||||
|
||||
Therefore, the real aggregated outcomes are:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Has record} & \textbf{No record} \\
|
||||
\midrule
|
||||
\textbf{Recidivism} & 1200 ($80\%$) & 300 ($20\%$) \\
|
||||
\textbf{No recidivism} & 300 ($20\%$) & 1200 ($80\%$) \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Assume that SAPMOC's predictions are:\\[-1.5em]
|
||||
\begin{minipage}{0.48\linewidth}
|
||||
\begin{table}[H]
|
||||
\caption{Aggregated predictions}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Has record} & \textbf{No record} \\
|
||||
\midrule
|
||||
\textbf{Recidivism} & 1500 & 0 \\
|
||||
\textbf{No recidivism} & 0 & 1500 \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
\end{minipage}
|
||||
\hfill
|
||||
\begin{minipage}{0.48\linewidth}
|
||||
\begin{table}[H]
|
||||
\caption{Group-wise confusion matrix}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|ccc|ccc}
|
||||
\toprule
|
||||
& \textbf{Pos.} & \texttt{TP} & \texttt{FP} & \textbf{Neg.} & \texttt{TN} & \texttt{FN} \\
|
||||
\midrule
|
||||
\textbf{Blues} & 1000 & 800 & 200 & 500 & 400 & 100 \\
|
||||
\textbf{Greens} & 500 & 400 & 100 & 1000 & 800 & 200 \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{table}
|
||||
\end{minipage}
|
||||
|
||||
The base rates are then computed as:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& $\textbf{Base rate}_\textbf{pos}$ $\frac{\texttt{TP}+\texttt{FN}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$
|
||||
& $\textbf{Base rate}_\textbf{neg}$ $\frac{\texttt{TN}+\texttt{FP}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $\frac{900}{1500} = 60\%$ & $\frac{600}{1500} = 40\%$ \\
|
||||
\textbf{Greens} & $\frac{600}{1500} = 40\%$ & $\frac{900}{1500} = 60\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
Note that the overall accuracy is the same for each group:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|c}
|
||||
\toprule
|
||||
& \textbf{Accuracy} $\frac{\texttt{TP}+\texttt{TN}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $80\%$ \\
|
||||
\textbf{Greens} & $80\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{description}
|
||||
\end{example}
|
||||
|
||||
\begin{description}
|
||||
\item[Fairness criteria]
|
||||
The main fairness criteria are the following:
|
||||
\begin{description}
|
||||
\item[Statistical parity] \marginnote{Statistical parity}
|
||||
Each group should have an equal proportion of positive and negative predictions.
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC does not satisfy statistical parity:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Predicted pos.} $\frac{\texttt{TP}+\texttt{FP}}{\texttt{TP}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$
|
||||
& \textbf{Predicted neg.} $\frac{\texttt{TN}+\texttt{TN}}{\texttt{FN}+\texttt{FN}+\texttt{FP}+\texttt{TN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $67\%$ & $33\%$ \\
|
||||
\textbf{Greens} & $33\%$ & $67\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Equality of opportunity/true positive rate] \marginnote{Equality of opportunity/true positive rate}
|
||||
The members sharing the same features between different groups should be treated equally (i.e., same recall).
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC does not satisfy equality of opportunity:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Recall pos.} $\frac{\texttt{TP}}{\texttt{TP}+\texttt{FN}}$
|
||||
& \textbf{Recall neg.} $\frac{\texttt{TN}}{\texttt{TN}+\texttt{FP}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $89\%$ & $67\%$ \\
|
||||
\textbf{Greens} & $67\%$ & $89\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Calibration] \marginnote{Calibration}
|
||||
The proportion of correct predictions should be equal for each class within each group (i.e., same precision).
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC satisfies calibration:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Precision pos.} $\frac{\texttt{TP}}{\texttt{TP}+\texttt{FP}}$
|
||||
& \textbf{Precision neg.} $\frac{\texttt{TN}}{\texttt{TN}+\texttt{FN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $80\%$ & $80\%$ \\
|
||||
\textbf{Greens} & $80\%$ & $80\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Conditional use error/false rate] \marginnote{Conditional use error/false rate}
|
||||
The proportion of incorrect predictions should be equal for each class within each group.
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC satisfies conditional use error/:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{False rate pos.} $\frac{\texttt{FP}}{\texttt{TP}+\texttt{FP}}$
|
||||
& \textbf{False rate neg.} $\frac{\texttt{FN}}{\texttt{TN}+\texttt{FN}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $20\%$ & $20\%$ \\
|
||||
\textbf{Greens} & $20\%$ & $20\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\item[Treatment equality] \marginnote{Treatment equality}
|
||||
The error ratio of positive and negative predictions should be equal across all groups.
|
||||
\begin{example}[SAPMOC]
|
||||
SAPMOC does not satisfy treatment equality:
|
||||
\begin{center}
|
||||
\footnotesize
|
||||
\begin{tabular}{c|cc}
|
||||
\toprule
|
||||
& \textbf{Error pos.} $\frac{\texttt{FP}}{\texttt{FN}}$
|
||||
& \textbf{Error neg.} $\frac{\texttt{FN}}{\texttt{FP}}$ \\
|
||||
\midrule
|
||||
\textbf{Blues} & $200\%$ & $50\%$ \\
|
||||
\textbf{Greens} & $50\%$ & $200\%$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{example}
|
||||
\end{description}
|
||||
|
||||
\begin{remark}
|
||||
There are many other fairness criteria that are correlated to those above.
|
||||
\end{remark}
|
||||
|
||||
\begin{remark}
|
||||
There is a conflict between individual and group fairness so that not all criteria can be satisfied at once.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
|
||||
\begin{description}
|
||||
\item[Handling different base rates] \phantom{}
|
||||
\begin{description}
|
||||
\item[Do nothing] \marginnote{Do nothing}
|
||||
Accept that different groups are actually associated to different probabilities.
|
||||
|
||||
\item[Modify the threshold for everyone] \marginnote{Modify the threshold for everyone}
|
||||
Raise (or decrease) the threshold to diminish the favorable classification for everyone (affecting more the groups with a higher base rate).
|
||||
|
||||
\item[Change the decision for everyone] \marginnote{Change the decision for everyone}
|
||||
Adopt alternative measures based on the classification results or use different thresholds depending on the group.
|
||||
|
||||
\begin{remark}
|
||||
Using different thresholds might still lead to discrimination. It makes sense in cases that require an affirmative action to increase diversity.
|
||||
\end{remark}
|
||||
\end{description}
|
||||
\end{description}
|
||||
|
||||
\begin{example}[SAPMOC II]
|
||||
SAPMOC extended to multiple features and an output in $[0, 1]$. It is possible to represent the relationship between the output score and the likelihood of recidivism as densities:
|
||||
\begin{descriptionlist}
|
||||
\item[Recidivism density]
|
||||
Function of the score such that the area under the curve between $[s', s'']$ is the number of recidivists associated to a score in that interval.
|
||||
|
||||
\item[Non-recidivism density]
|
||||
Function of the score such that the area under the curve between $[s', s'']$ is the number of non-recidivists associated to a score in that interval.
|
||||
\end{descriptionlist}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.75\linewidth]{./img/sapmoc_density.png}
|
||||
\end{figure}
|
||||
|
||||
If the same threshold is applied for both groups, SAPMOC II respects the same fairness criteria of SAPMOC.
|
||||
\end{example}
|
||||
|
||||
\begin{theorem}
|
||||
With different base rates, it is impossible to achieve all fairness criteria through thresholding.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.45\linewidth]{./img/pasmoc2_thresholds.png}
|
||||
\end{figure}
|
||||
\end{theorem}
|
||||