Optimized Data Pre-Processing for Discrimination Prevention

Flavio P. Calmon, Dennis Wei, Karthikeyan Natesan Ramamurthy, Kush R. Varshney

Introduction

Discrimination is the prejudicial treatment of an individual based on membership in a legally protected group such as a race or gender. Direct discrimination occurs when protected attributes are used explicitly in making decisions, which is referred to as disparate treatment in law. More pervasive nowadays is indirect discrimination, in which protected attributes are not used but reliance on variables correlated with them leads to significantly different outcomes for different groups. The latter phenomenon is termed disparate impact. Indirect discrimination may be intentional, as in the historical practice of “redlining” in the U.S. in which home mortgages were denied in zip codes populated primarily by minorities. However, the doctrine of disparate impact applies in many situations regardless of actual intent.

Supervised learning algorithms, increasingly used for decision making in applications of consequence, may at first be presumed to be fair and devoid of inherent bias, but in fact, inherit any bias or discrimination present in the data on which they are trained (Calders & Žliobaitė, 2013). Furthermore, simply removing protected variables from the data is not enough since it does nothing to address indirect discrimination and may in fact conceal it. The need for more sophisticated tools has made discrimination discovery and prevention an important research area (Pedreschi et al., 2008).

Algorithmic discrimination prevention involves modifying one or more of the following to ensure that decisions made by supervised learning methods are less biased: (a) the training data, (b) the learning algorithm, and (c) the ensuing decisions themselves. These are respectively classified as pre-processing (Hajian, 2013), in-processing (Fish et al., 2016; Zafar et al., 2016; Kamishima et al., 2011) and post-processing approaches (Hardt et al., 2016). In this paper, we focus on pre-processing since it is the most flexible in terms of the data science pipeline: it is independent of the modeling algorithm and can be integrated with data release and publishing mechanisms.

Researchers have also studied several notions of discrimination and fairness. Disparate impact is addressed by the principles of statistical parity and group fairness (Feldman et al., 2015), which seek similar outcomes for all groups. In contrast, individual fairness (Dwork et al., 2012) mandates that similar individuals be treated similarly irrespective of group membership. For classifiers and other predictive models, equal error rates for different groups are a desirable property (Hardt et al., 2016), as is calibration or lack of predictive bias in the predictions (Zhang & Neill, 2016). The tension between the last two notions is described by Kleinberg et al. (2017) and Chouldechova (2016); the work of Friedler et al. (2016) is in a similar vein. Corbett-Davies et al. (2017) discuss the cost of satisfying prevailing notions of algorithmic fairness from a public safety standpoint and discuss the trade-offs. Since the present work pertains to pre-processing and not modeling, balanced error rates and predictive bias are less relevant criteria. Instead we focus primarily on achieving group fairness while also accounting for individual fairness through a distortion constraint.

Existing pre-processing approaches include sampling or re-weighting the data to neutralize discriminatory effects (Kamiran & Calders, 2012), changing the individual data records (Hajian & Domingo-Ferrer, 2013), and using tt-closeness (Li et al., 2007) for discrimination control (Ruggieri, 2014). A common theme is the importance of balancing discrimination control against utility of the processed data. However, this prior work neither presents general and principled optimization frameworks for trading off these two criteria, nor allows connections to be made to the broader statistical learning and information theory literature via probabilistic descriptions. Another shortcoming is that individual distortion or fairness is not made explicit.

In this work, addressing gaps in the pre-processing literature, we introduce a probabilistic framework for discrimination-preventing pre-processing in supervised learning. Our aim in part is to work toward a more unified view of previously proposed concepts and methods, which may help to suggest refinements. We formulate the determination of a pre-processing transformation as an optimization problem that trades off discrimination control, data utility, and individual distortion. (Trade-offs among various fairness notions may be inherent as shown by Kleinberg et al. (2017).) While discrimination and utility are defined at the level of probability distributions, distortion is controlled on a per-sample basis, thereby limiting the effect of the transformation on individuals and ensuring a degree of individual fairness. Figure 1 illustrates the supervised learning pipeline that includes our proposed discrimination-preventing pre-processing.

Given the novelty of our formulation, we devote more effort than usual to discussing its motivations and potential variations. We state natural conditions under which the proposed optimization problem is convex. The resulting transformation is in general a randomized one. The proposed optimization problem assumes as input an estimate of the distribution of the data which, in practice, can be imprecise due to limited sample size. Accordingly, we characterize the possible degradation in discrimination and utility guarantees at test time in terms of the training sample size. As a demonstration of our framework, we apply specific instances of it to a prison recidivism risk score dataset (ProPublica, 2017) and the UCI adult dataset (Lichman, 2013). By solving the optimization problem, we show that discrimination, distortion, and utility loss can be controlled simultaneously with real data. In addition, the resulting transformations reveal intriguing demographic patterns in the data.

General Formulation

We are given a dataset consisting of nn i.i.d. samples {(Di,Xi,Yi)}i=1n\left\{(D_{i},X_{i},Y_{i})\right\}_{i=1}^{n} from a joint distribution pD,X,Yp_{D,X,Y} with domain D×X×Y\mathcal{D}\times\mathcal{X}\times\mathcal{Y}. Here DD denotes one or more discriminatory variables such as gender and race, XX denotes other non-protected variables used for decision making, and YY is an outcome random variable. For instance, YiY_{i} could represent a loan approval decision for individual ii based on demographic information DiD_{i} and credit score XiX_{i}. We focus in this paper on discrete (or discretized) and finite domains D\mathcal{D} and X\mathcal{X} and binary outcomes, i.e. Y={0,1}\mathcal{Y}=\{0,1\}. There is no restriction on the dimensions of DD and XX.

Our goal is to determine a randomized mapping pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} that (i) transforms the given dataset into a new dataset {(Di,X^i,Y^i)}i=1n\left\{(D_{i},\hat{X}_{i},\hat{Y}_{i})\right\}_{i=1}^{n}, which may be used to train a model, and (ii) similarly transforms data to which the model is applied, i.e. test data. Each (X^i,Y^i)(\hat{X}_{i},\hat{Y}_{i}) is drawn independently from the same domain X×Y\mathcal{X}\times\mathcal{Y} as X,YX,Y by applying pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} to the corresponding triplet (Di,Xi,Yi)(D_{i},X_{i},Y_{i}). Since DiD_{i} is retained as-is, we do not include it in the mapping to be determined. Motivation for retaining DD is discussed later in Section 3.2. For test samples, YiY_{i} is not available at the input while Y^i\hat{Y}_{i} may not be needed at the output. In this case, a reduced mapping pX^∣X,Dp_{\hat{X}|X,D} may be used, which can be obtained from pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} by marginalizing over Y^\hat{Y} and YY after weighting by pY∣X,Dp_{Y|X,D}.

It is assumed that pD,X,Yp_{D,X,Y} is known along with its marginals and conditionals. This assumption is often satisfied using the empirical distribution of {(Di,Xi,Yi)}i=1n\{(D_{i},X_{i},Y_{i})\}_{i=1}^{n}. In Section 3.2, we state a result ensuring that discrimination and utility loss continue to be controlled if the distribution used to determine pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} differs from the distribution of test samples.

We propose that the mapping pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} satisfy the properties discussed in the following three subsections.

The first objective is to limit the dependence of the transformed outcome Y^\hat{Y} on the discriminatory variables DD, as represented by the conditional distribution pY^∣Dp_{\hat{Y}|D}. We propose two alternative formulations. The first requires pY^∣Dp_{\hat{Y}|D} to be close to a target distribution pYTp_{Y_{T}} for all values of DD,

where J(⋅,⋅)J(\cdot,\cdot) denotes some distance function. The second formulation constrains pY^∣Dp_{\hat{Y}|D} to be similar for any two values of DD,

for all d1,d2∈D,y∈{0,1}.d_{1},d_{2}\in\mathcal{D},y\in\{0,1\}. The latter (2) does not require a target distribution as reference but does increase the number of constraints from O(∣D∣)O(\lvert\mathcal{D}\rvert) to O(∣D∣2)O(\lvert\mathcal{D}\rvert^{2}).

The choice of target pYTp_{Y_{T}} in (1), and distance JJ and thresholds ϵ\epsilon in (1) and (2) should be informed by societal considerations. If the application domain has a clear legal definition of disparate impact, for example the “80% rule” (EEOC, 1979), then it can be translated into a mathematical constraint. Otherwise and more generally, the instantiation of (1) should involve consultation with domain experts and stakeholders before being put into practice.

For this work, we choose JJ to be the following probability ratio measure:

The combination of (3) and (1) generalizes the extended lift criterion proposed in the literature (Pedreschi et al., 2012), while the combination of (3) and (2) generalizes selective and contrastive lift. In the numerical results in Section 4, we use both (1) and (2). For (1), we make the straightforward choice of setting pYT=pYp_{Y_{T}}=p_{Y}, the original marginal distribution of the outcome variable. We recognize however that this choice of target may run the risk of perpetuating bias in the original dataset. On the other hand, how to choose a target distribution that is “fairer” than pYp_{Y} is largely an open question; we refer the reader to Žliobaitė et al. (2011) for one such proposal, which is reminiscent of the concept of “balanced error rate” in classification (Zhao et al., 2013).

In (1) and (2), discrimination control is imposed jointly with respect to all discriminatory variables, e.g. all combinations of gender and race if DD consists of those two variables. An alternative is to take the discriminatory variables one at a time, e.g. gender without regard to race and vice-versa. The latter, which we refer to as univariate discrimination control, can be formulated similarly to (1), (2). In this work, we opt for joint discrimination control as it is more stringent than univariate. We note however that legal formulations tend to be of the univariate type.

Formulations (1) and (2) control discrimination at the level of the overall population in the dataset. It is also possible to control discrimination within segments of the population by conditioning on additional variables BB, where BB is a subset of XX and XX is a collection of features. Constraint (1) would then generalize to

for all d∈D,d\in\mathcal{D}, y∈{0,1},y\in\{0,1\}, and b∈B.b\in\mathcal{B}. Similar conditioning or “context” for discrimination has been explored before in Hajian & Domingo-Ferrer (2013) in the setting of association rule mining. As one example, BB may consist of non-discriminatory variables that are strongly correlated with the outcome YY, e.g. education level as it relates to income. One may wish to control for such variables in determining whether discrimination is present and needs to be corrected. At the same time, care must be taken so that the population segments created by conditioning on BB are large enough for statistically valid inferences to be made. For present purposes, we simply note that conditional discrimination constraints (4) can be accommodated in our framework and defer further investigation to future work.

2 Distortion Control

We assume that δ(x,y,x,y)=0\delta(x,y,x,y)=0 for all (x,y)∈X×Y(x,y)\in\mathcal{X}\times\mathcal{Y}.

Constraint (5) is formulated with pointwise conditioning on (D,X,Y)=(d,x,y)(D,X,Y)=(d,x,y) in order to promote individual fairness. It ensures that distortion is controlled for every combination of (d,x,y)(d,x,y), i.e. every individual in the original dataset, and more importantly, every individual to which a model is later applied. By way of contrast, an average-case measure in which an expectation is also taken over D,X,YD,X,Y may result in high distortion for certain (d,x,y)(d,x,y), likely those with low probability. Equation (5) also allows the level of control cd,x,yc_{d,x,y} to depend on (d,x,y)(d,x,y) if desired. We also note that (5) is a property of the mapping pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y}, and does not depend on the assumed distribution pD,X,Y.p_{D,X,Y}.

The expectation over X^,Y^\hat{X},\hat{Y} in (5) encompasses several cases depending on the choices of the metric δ\delta and thresholds cd,x,yc_{d,x,y}. If cd,x,y=0c_{d,x,y}=0, then no mappings with nonzero distortion are allowed for individuals with original values (d,x,y)(d,x,y). If cd,x,y>0c_{d,x,y}>0, then certain mappings may still be disallowed by assigning them infinite distortion. Mappings with finite distortion are permissible subject to the budget cd,x,yc_{d,x,y}. Lastly, if δ\delta is binary-valued (perhaps achieved by thresholding a multi-valued distortion function), it can be seen as classifying mappings into desirable (δ=0\delta=0) and undesirable ones (δ=1\delta=1). Here, (5) reduces to a bound on the conditional probability of an undesirable mapping, i.e.

3 Utility Preservation

In addition to constraints on individual distortions, we also require that the distribution of (X^,Y^)(\hat{X},\hat{Y}) be statistically close to the distribution of (X,Y)(X,Y). This is to ensure that a model learned from the transformed dataset (when averaged over the discriminatory variables DD) is not too different from one learned from the original dataset, e.g. a bank’s existing policy for approving loans. For a given dissimilarity measure Δ\Delta between probability distributions (e.g. KL-divergence), we require that Δ(pX^,Y^,pX,Y)\Delta\left(p_{\hat{X},\hat{Y}},p_{X,Y}\right) be small.

4 Optimization Formulation

Putting together the considerations from the three previous subsections, we arrive at the optimization problem below for determining a randomized transformation pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} mapping each sample (Di,Xi,Yi)(D_{i},X_{i},Y_{i}) to (X^i,Y^i)(\hat{X}_{i},\hat{Y}_{i}):

We choose to minimize the utility loss Δ\Delta subject to constraints on individual distortion (5) and discrimination, where we have used (1) for concreteness, since it is more natural to place bounds on the latter two.

The distortion constraints (5) are an essential component of the problem formulation (7). Without (5) and assuming that pYT=pYp_{Y_{T}}=p_{Y}, it is possible to achieve perfect utility and non-discrimination simply by sampling (X^i,Y^i)(\hat{X}_{i},\hat{Y}_{i}) from the original distribution pX,Yp_{X,Y} independently of any inputs, i.e. pX^,Y^∣X,Y,D(x^,y^∣x,y,d)=pX^,Y^(x^,y^)=pX,Y(x^,y^)p_{\hat{X},\hat{Y}|X,Y,D}(\hat{x},\hat{y}|x,y,d)=p_{\hat{X},\hat{Y}}(\hat{x},\hat{y})=p_{X,Y}(\hat{x},\hat{y}). Then Δ(pX^,Y^,pX,Y)=0\Delta\left(p_{\hat{X},\hat{Y}},p_{X,Y}\right)=0, and pY^∣D(y∣d)=pY^(y)=pY(y)=pYT(y)p_{\hat{Y}|D}(y|d)=p_{\hat{Y}}(y)=p_{Y}(y)=p_{Y_{T}}(y) for all d∈Dd\in\mathcal{D}. This solution however is clearly objectionable from the viewpoint of individual fairness, especially for individuals to whom a subsequent model is applied since it amounts to discarding an individual’s data and replacing it with a random sample from the population pX,Yp_{X,Y}. Constraint (5) seeks to prevent such gross deviations from occurring.

Theoretical Properties

We first discuss conditions under which (7) is a convex or quasiconvex optimization problem. Considering first the objective function, the distribution pX,Yp_{X,Y} is a given quantity while

is seen to be a linear function of the mapping pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y}, i.e. the optimization variable. Hence if the statistical dissimilarity Δ(⋅,⋅)\Delta(\cdot,\cdot) is convex in its first argument with the second fixed, then Δ(pX^,Y^,pX,Y)\Delta(p_{\hat{X},\hat{Y}},p_{X,Y}) is a convex function of pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y} by the affine composition property (Boyd & Vandenberghe, 2004). This condition is satisfied for example by all ff-divergences (Csiszár & Shields, 2004), which are jointly convex in both arguments, and by all Bregman divergences (Banerjee et al., 2005). If instead Δ(⋅,⋅)\Delta(\cdot,\cdot) is only quasiconvex in its first argument, a similar composition property implies that Δ(pX^,Y^,pX,Y)\Delta(p_{\hat{X},\hat{Y}},p_{X,Y}) is a quasiconvex function of pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y} (Boyd & Vandenberghe, 2004).

For discrimination constraint (1), the target distribution pYTp_{Y_{T}} is assumed to be given. The conditional distribution pY^∣Dp_{\hat{Y}|D} can be related to pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y} as follows:

Since pX,Y∣Dp_{X,Y|D} is given, pY^∣Dp_{\hat{Y}|D} is a linear function of pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y}. Hence by the same composition property as above, (1) is a convex constraint, i.e. specifies a convex set, if the distance function J(⋅,⋅)J(\cdot,\cdot) is quasiconvex in its first argument.

If constraint (2) is used instead of (1), then both arguments of JJ are linear functions of pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y}. Hence (2) is convex if JJ is jointly quasiconvex in both arguments.

Lastly, the distortion constraint (5) can be expanded explicitly in terms of pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y} to yield

Thus (5) is a linear constraint in pX^,Y^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y} regardless of the choice of distortion metric δ\delta.

We summarize this subsection with the following proposition.

Problem (7) is a (quasi)convex optimization if Δ(⋅,⋅)\Delta(\cdot,\cdot) is (quasi)convex and J(⋅,⋅)J(\cdot,\cdot) is quasiconvex in their respective first arguments (with the second arguments fixed). If discrimination constraint (2) is used in place of (1), then the condition on JJ is that it be jointly quasiconvex in both arguments.

2 Generalizability of Discrimination Control

We now discuss the generalizability of discrimination guarantees (1) and (2) to unseen individuals, i.e. those to whom a model is applied. Recall from Section 2 that the proposed transformation retains the discriminatory variables DD. We first consider the case where models trained on the transformed data to predict Y^\hat{Y} are allowed to depend on DD. While such models may qualify as disparate treatment, the intent and effect is to better mitigate disparate impact resulting from the model. In this respect our proposal shares the same spirit with “fair” affirmative action in Dwork et al. (2012) (fairer on account of distortion constraint (5)). Later in this subsection we consider the case where DD is suppressed at classification time.

Assuming that predictive models for Y^\hat{Y} can depend on DD, let Y~\widetilde{Y} be the output of such a model based on DD and X^\hat{X}. To remove the separate issue of model accuracy, suppose for simplicity that the model provides a good approximation to the conditional distribution of Y^\hat{Y}: pY~∣X^,D(y~∣x^,d)≈pY^∣X^,D(y~∣x^,d)p_{\widetilde{Y}|\hat{X},D}(\widetilde{y}|\hat{x},d)\approx p_{\hat{Y}|\hat{X},D}(\widetilde{y}|\hat{x},d). Then for individuals in a protected group D=dD=d, the conditional distribution of Y~\widetilde{Y} is given by

Hence the model output pY~∣Dp_{\widetilde{Y}|D} can also be controlled by (1) or (2).

On the other hand, if DD must be suppressed from the transformed data, perhaps to comply with legal requirements regarding its non-use, then a predictive model can depend only on X^\hat{X} and approximate pY^∣X^p_{\hat{Y}|\hat{X}}, i.e. pY~∣X^,D(y~∣x^,d)=pY~∣X^(y~∣x^)≈pY^∣X^(y~∣x^)p_{\widetilde{Y}|\hat{X},D}(\widetilde{y}|\hat{x},d)=p_{\widetilde{Y}|\hat{X}}(\widetilde{y}|\hat{x})\approx p_{\hat{Y}|\hat{X}}(\widetilde{y}|\hat{x}). In this case we have

which in general is not equal to pY^∣D(y~∣d)p_{\hat{Y}|D}(\widetilde{y}|d) in (8). The quantity on the right-hand side of (9) is less straightforward to control. We address this issue in the next subsection.

2.2 Suppressing the Discriminatory Variable

In many applications the discriminatory variable cannot be revealed to the classification algorithm. In this case, the train-time discrimination guarantees are preserved at apply time if the Markov relationship D→X^→Y^D\to\hat{X}\to\hat{Y} (i.e. pY^∣X^,D=pY^∣X^p_{\hat{Y}|\hat{X},D}=p_{\hat{Y}|\hat{X}}) holds since, in this case,

Thus, given that the distribution pD,X,Yp_{D,X,Y} is known, the guarantees provided during training still hold when applied to fresh samples if the additional constraint pX^,Y^∣D,X,Y=pY^∣X^pX^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y}=p_{\hat{Y}|\hat{X}}p_{\hat{X}|D,X,Y} is satisfied. We refer to (7) with the additional constraint pX^,Y^∣D,X,Y=pY^∣X^pX^∣D,X,Yp_{\hat{X},\hat{Y}|D,X,Y}=p_{\hat{Y}|\hat{X}}p_{\hat{X}|D,X,Y} as the suppressed optimization formulation (SOF). Alas, since the added constraint is non-convex, the SOF is not a convex program, despite being convex in pX^∣D,X,Yp_{\hat{X}|D,X,Y} for a fixed pY^∣X^p_{\hat{Y}|\hat{X}} and vice-versa (i.e. it is biconvex). We propose next two strategies for addressing this problem.

The first approach is to restrict pY^∣X^=pY∣Xp_{\hat{Y}|\hat{X}}=p_{Y|X} and solve (7) for pX^∣D,X,Yp_{\hat{X}|D,X,Y}. If Δ(⋅,⋅)\Delta(\cdot,\cdot) is an ff-divergence, then

where the inequality follows from convexity of ff. Since the last quantity is achieved by setting pY^∣X^=pY∣Xp_{\hat{Y}|\hat{X}}=p_{Y|X}, this choice is optimal in terms of the objective function. It may, however, render the constraints in (7) infeasible. Assuming feasibility is maintained, this approach has the added benefit that a classifier fθ(x)≈pY∣X(⋅∣x)f_{\theta}(x)\approx p_{Y|X}(\cdot|x) can be trained using the original (non-perturbed) data, and maintained for classification during apply time.

Alternatively, a solution can be found through alternating minimization: fix pY^∣X^p_{\hat{Y}|\hat{X}} and solve the SOF for pX^∣D,X,Yp_{\hat{X}|D,X,Y}, and then fix pX^∣D,X,Yp_{\hat{X}|D,X,Y} as the optimal solution and solve the SOF for pY^∣X^p_{\hat{Y}|\hat{X}}. The resulting sequence of values of the objective function is non-increasing, but may converge to a local minima.

3 A Note on Estimation and Discrimination

There is a close relationship between estimation and discrimination. If the discriminatory variable DD can be reliably estimated from the outcome variable YY, then it is reasonable to expect that the discrimination control constraint (1) does not hold for small values of ϵy,d\epsilon_{y,d}. We make this intuition precise in the next proposition when JJ is given in (3).

More specifically, we prove that if the advantage of estimating DD from YY over a random guess is large, then there must exist a value of dd and yy such that J(pY∣D(y∣d),pYT(y))J(p_{Y|D}(y|d),p_{Y_{T}}(y)) is also large. Thus, standard estimation methods can be used to detect the presence of discrimination: if an estimation algorithm can estimate DD from YY, then discrimination may be present. Alternatively, if discrimination control is successful, then no estimator can significantly improve upon a random guess when estimating DD from YY.

We denote the highest probability of correctly guessing DD from an observation of YY by Pc(D∣Y)P_{c}(D|Y), where

and the maximum is taken across all estimators pD^∣Yp_{\hat{D}|Y} that satisfy the Markov condition D→Y→D^D\to Y\to\hat{D}. For DD and YY defined over finite supports, this is achieved by the maximum a posteriori (MAP) estimator and, consequently,

Let pD∗p_{D}^{*} be the most likely outcome of DD, i.e. pD∗≜max⁡d∈DpD(d)p_{D}^{*}\triangleq\max_{d\in\mathcal{D}}p_{D}(d). The (multiplicative) advantage over a random guess is given by

For DD and YY defined over finite support sets, if

then for any pYTp_{Y_{T}}, there exists y∈Yy\in\mathcal{Y} and d∈Dd\in\mathcal{D} such that

We prove the contrapositive of the statement of the proposition. Assume that

where the inequality follows by noting that (16) implies pY∣D(y∣d)≤(1+ϵ)pYT(y)p_{Y|D}(y|d)\leq(1+\epsilon)p_{Y_{T}}(y) for all y∈Yy\in\mathcal{Y}, d∈Dd\in\mathcal{D}. Rearranging the terms of the last equality, we arrive at

and the result follows by observing that the left-hand side is the definition of Adv(D∣Y)\mathsf{Adv}(D|Y). ∎

4 Training and Application Considerations

The proposed optimization framework has two modes of operation (Fig. 1): train and apply. In train mode, the optimization problem (7) is solved in order to determine a mapping pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} for randomizing the training set. The randomized training set, in turn, is used to fit a classification model fθ(X^,D)f_{\theta}(\hat{X},D) that approximates pY^∣X^,Dp_{\hat{Y}|\hat{X},D}, where θ\theta are the parameters of the model. At apply time, a new data point (X,D)(X,D) is received and transformed into (X^,D)(\hat{X},D) through a randomized mapping pX^∣X,Dp_{\hat{X}|X,D}. The mapping pX^∣D,Xp_{\hat{X}|D,X} is given by marginalizing over Y,Y^Y,\hat{Y}:

Assuming that the variable DD is not suppressed, and that the marginals are known, then the utility and discrimination guarantees set during train time still hold during apply time, as discussed in Section 3.2. However, the distortion control will inevitably change, since the mapping has been marginalized over YY. More specifically, the bound on the expected distortion for each sample becomes

If the distortion control values cx,y,dc_{x,y,d} are independent of yy, then the upper-bound on distortion set during training time still holds during apply time. Otherwise, (18) provides a bound on individual distortion at apply time. The same guarantee holds for the case when DD is suppressed.

5 Robustness

We may also consider the case where the distribution pD,X,Yp_{D,X,Y} used to determine the transformation differs from the distribution qD,X,Yq_{D,X,Y} of test samples. This occurs, for example, when pD,X,Yp_{D,X,Y} is the empirical distribution computed from nn i.i.d. samples from an unknown distribution qD,X,Yq_{D,X,Y}. In this situation, discrimination control and utility are still guaranteed for samples drawn from qD,X,Yq_{D,X,Y} that are transformed using pY^,X^∣X,Y,Dp_{\hat{Y},\hat{X}|X,Y,D}, where the latter is obtained by solving (7) with pD,X,Yp_{D,X,Y}. In particular, denoting by qY^∣Dq_{\hat{Y}|D} and qX^,Y^q_{\hat{X},\hat{Y}} the corresponding distributions for Y^,X^\hat{Y},\hat{X} and DD when qD,X,Yq_{D,X,Y} is transformed using pY^,X^∣X,Y,Dp_{\hat{Y},\hat{X}|X,Y,D}, we have J(pY^∣D(y∣d),pYT(y))→J(qY^∣D(y∣d),pYT(y))J\left(p_{\hat{Y}|D}(y|d),p_{Y_{T}}(y)\right)\to J\left(q_{\hat{Y}|D}(y|d),p_{Y_{T}}(y)\right) and Δ(pX,Y,pX^,Y^)→Δ(qX,Y,qX^,Y^)\Delta\left(p_{X,Y},p_{\hat{X},\hat{Y}}\right)\to\Delta\left(q_{X,Y},q_{\hat{X},\hat{Y}}\right) for nn sufficiently large (the distortion control constraints (5) only depend on pY^,X^∣X,Y,Dp_{\hat{Y},\hat{X}|X,Y,D}). The next proposition provides an estimate of the rate of this convergence in terms of nn and assuming pY,D(y,d)p_{Y,D}(y,d) is fixed and bounded away from zero. Its proof can be found in the Appendix.

Let pD,X,Yp_{D,X,Y} be the empirical distribution obtained from nn i.i.d. samples that is used to determine the mapping pY^,X^∣X,Y,Dp_{\hat{Y},\hat{X}|X,Y,D}, and qD,X,Yq_{D,X,Y} be the true distribution of the data. In addition, denote by qD,X^,Y^q_{D,\hat{X},\hat{Y}} the joint distribution after applying pY^,X^∣X,Y,Dp_{\hat{Y},\hat{X}|X,Y,D} to samples from qD,X,Yq_{D,X,Y}. If for all y∈Yy\in\mathcal{Y}, d∈Dd\in\mathcal{D} we have pY,D(y,d)>0p_{Y,D}(y,d)>0, J(pY^∣D(y∣d),pYT(y))≤ϵJ\left(p_{\hat{Y}|D}(y|d),p_{Y_{T}}(y)\right)\leq\epsilon, where JJ is given in (3), and

Proposition 3 guarantees that, as long as nn is sufficiently large, the utility and discrimination control guarantees will approximately hold when pX^,Y^∣Y,X,Dp_{\hat{X},\hat{Y}|Y,X,D} is applied to fresh samples drawn from qD,X,Yq_{D,X,Y}. In particular, the utility and discrimination guarantees will converge to the ones used as parameters in the optimization at a rate that is at least Θ(1nlog⁡n)\Theta\left(\sqrt{\frac{1}{n}\log n}\right). The distortion control guarantees (5) are a property of the mapping pX^,Y^∣Y,X,Dp_{\hat{X},\hat{Y}|Y,X,D}, and do not depend on the distribution of the data.

Observe that hidden within the big-O terms in Proposition 3 are constants that depend on the probability of the least likely symbol and the alphabet size. The exact characterization of these constants can be found in the proof of the proposition in the appendix. Moreover, the upper bounds become loose if pY,D(y,d)p_{Y,D}(y,d) can be made arbitrarily small. Thus, it is necessary to assume that pY,D(y,d)p_{Y,D}(y,d) is fixed and bounded away from zero. Moreover, if the dimensionality of the support sets of D,XD,X and YY is large, and the number of samples nn is limited, then a dimensionality reduction step (e.g. clustering) may be necessary in order to assure that discrimination control and utility are adequately preserved at test time. Proposition 3 and its proof can be used to provide an explicit estimate of the required reduction. Finally, we also note that if there are insufficient samples to reliably estimate qD,X,Y(d,x,y)q_{D,X,Y}(d,x,y) for certain values (d,x,y)∈D×X×Y(d,x,y)\in\mathcal{D}\times\mathcal{X}\times\mathcal{Y}, then, for those groups (d,x)(d,x), it is statistically challenging to verify discrimination and thus control may not be meaningful.

Applications to Datasets

We apply our proposed data transformation approach to two different datasets to demonstrate its capabilities. We approximate pD,X,Yp_{D,X,Y} using the empirical distribution of (D,X,Y)(D,X,Y) in the datasets, specialize the optimization (7) according to the needs of the application, and solve (7) using a standard convex solver (Diamond & Boyd, 2016).

Recidivism refers to a person’s relapse into criminal behavior. It has been found that about two-thirds of prisoners in the US are re-arrested after release (Durose et al., 2014). It is important therefore to understand the recidivistic tendencies of incarcerated individuals who are considered for release at several points in the criminal justice system (bail hearings, parole, etc.). Automated risk scoring mechanisms have been developed for this purpose and are currently used in courtrooms in the US, in particular the proprietary COMPAS tool by Northpointe (Northpointe Inc., ).

Recently, ProPublica published an article that investigates racial bias in the COMPAS algorithm (ProPublica, 2016), releasing an accompanying dataset that includes COMPAS risk scores, recidivism records, and other relevant attributes (ProPublica, 2017). A basic finding is that the COMPAS algorithm tends to assign higher scores to African-American individuals, a reflection of the a priori higher prevalence of recidivism in this group. The article goes on to demonstrate unequal false positive and false negative rates between African-Americans and Caucasian-Americans, which has since been shown by Chouldechova (2016) to be a necessary consequence of the calibration of the model and the difference in a priori prevalence.

In this work, our interest is not in the debate surrounding the COMPAS algorithm but rather in the underlying recidivism data (ProPublica, 2017). Using the proposed data transformation approach, we demonstrate the technical feasibility of mitigating the disparate impact of recividism records on different demographic groups while also preserving utility and individual fairness. (We make no comment on the associated societal considerations.) From ProPublica’s dataset, we select severity of charge, number of prior crimes, and age category to be the decision variables (XX). The outcome variable (YY) is a binary indicator of whether the individual recidivated (re-offended), and race and gender are set to be the discriminatory variables (DD). The encoding of the decision and discrimination variables is described in Table 1. The dataset was processed to contain around 5k records.

Specific Form of Optimization. We specialize our general formulation in (7) by setting the utility measure Δ(pX,Y,pX^,Y^)\Delta(p_{X,Y},p_{\hat{X},\hat{Y}}) to be the KL divergence DKL(pX,Y∥pX^,Y^)D_{\mathsf{KL}}(p_{X,Y}\|p_{\hat{X},\hat{Y}}). For discrimination control, we use (2), with JJ given in (3), while fixing ϵy,d1,d2=ϵ\epsilon_{y,d_{1},d_{2}}=\epsilon. For the sake of simplicity, we use the expected distortion constraint in (5) with cd,x,y=cc_{d,x,y}=c uniformly. The distortion function δ\delta in (5) has the following form. Jumps of more than one category in age and prior counts are heavily discouraged by setting a high distortion penalty (10410^{4}) for such transformations. We impose the same penalty on increases in recidivism (change of YY from to 11). Both these choices are made to promote individual fairness. Furthermore, for every jump to the next category for age and prior counts, a penalty of 11 is assessed, and a similar jump incurs a penalty of 22 for charge degree. Reduction in recidivism (11 to ) has a penalty of 22. The total distortion for each individual is the sum of squares of distortions for each attribute of XX. These distortion values were chosen for demonstration purposes to be reasonable to our judgement, and can easily be tuned according to the needs of a practitioner.

Results. We computed the optimal objective value (i.e., KL divergence) resulting from solving (7) for different values of the discrimination control parameter ϵ\epsilon, when the expected distortion constraint c=0.25c=0.25. Around ϵ=0.2\epsilon=0.2, no feasible solution can be found that also satisfies the distortion constraint. Above ϵ=0.59\epsilon=0.59, the discrimination control is loose enough to be satisfied by the original dataset with just an identity mapping (DKL(pX,Y∥pX^,Y^)=0D_{\mathsf{KL}}(p_{X,Y}\|p_{\hat{X},\hat{Y}})=0). In between, the optimal value varies as a smooth function (Fig. 2).

We set c=0.5c=0.5 and ϵ=0.1\epsilon=0.1 for the rest of the experiments. The optimal value of utility measure (KL divergence) was 0.0210.021. In order to evaluate if discrimination control was achieved as expected, we examine the dependence of the outcome variable on the discrimination variable before and after the transformation. Note that to have zero disparate impact, we would like the Y^\hat{Y} to be independent of DD, but practically it will be controlled by the discrimination control parameter ϵ\epsilon. The corresponding marginals pY∣Dp_{Y|D} and pY^∣Dp_{\hat{Y}|D} are illustrated in Table 2, where clearly Y^\hat{Y} is less dependent on DD compared to YY. In particular, since an increase in recidivism is heavily penalized, the net effect of the randomized transformation is to decrease the recidivism risk of males, and particularly African-American males.

The mapping pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} produced by the optimization (7) can reveal important insights on the nature of disparate impact and how to mitigate it. We illustrate this by exploring pX^,Y^∣X,Y,Dp_{\hat{X},\hat{Y}|X,Y,D} for the COMPAS dataset next. Fig. 3 displays the conditional mapping restricted to certain socio-demographic groups. First consider young males who are African-American (left-most plot). This group has a high recidivism rate, and hence the most prominent action of the mapping (besides identity transformation) is to change the recidivism value from 11 (recidivism) to (no recidivism). The next prominent action is to change the age category from young to middle aged (25 to 45 years). This effectively reduces the average value of Y^\hat{Y} for young African-Americans, since the mapping for young males who are African-American and do not recidivate (middle plot) is essentially the identity mapping, with the exception of changing age category to middle aged. This is expected, since increasing recidivism is heavily penalized. For young Caucasian males who recidivate, the action of the proposed transformation seems to be similar to that of young African-American males who recidivate, i.e., the outcome variable is either changed to 0, or the age category is changed to middle age. However the probabilities of the transformations are lower since Caucasian males have, according to the dataset, a lower recidivism rate.

We apply this conditional mapping on the dataset (one trial) and present the results in Fig. 4. The original percentage recidivism rates are also shown in the top panel of the plot for comparison. Because of our constraint that disallows changing the outcome to 11, a demographic group’s recidivism rate can (indirectly) increase only through changes to the decision variables (XX). We note that the average percentage change in recidivism rates across all demographics is negative when the discrimination variables are marginalized out (leftmost column). The maximum decreases in recidivism rates are observed for African-American males since they have the highest value of pY∣D(1∣d)p_{Y|D}(1|d) (cf. Table 2). Contrast this with Caucasian females (middle column), who have virtually no change in their recidivism rates since they are a priori close to the final ones (see Table 2). Another interesting observation is that middle aged Caucasian males with 1 to 3 prior counts see an increase in percentage recidivism. This is consistent with the mapping seen in Fig. 3 (middle), and is an example of the indirect introduction of positive outcome variables in a cohort as discussed above.

2 UCI Adult Data

We apply our optimization approach to the well-known UCI Adult Dataset (Lichman, 2013) as a second illustration of its capabilities. The features were categorized as discriminatory variables (DD): Race (White, Minority) and Gender (Male, Female); decision variables (XX): Age (quantized to decades) and Education (quantized to years); and response variable (YY): Income (binary). While the response variable considered here is income, the dataset could be regarded as a simplified proxy for analyzing other financial outcomes such as credit approvals.

Conclusions

We proposed a flexible, data-driven optimization framework for probabilistically transforming data in order to reduce algorithmic discrimination, and applied it to two datasets. The differences between the original and transformed datasets revealed interesting discrimination patterns, as well as corrective adjustments for controlling discrimination while preserving utility of the data. Despite being programmatically generated, the optimized transformation satisfied properties that are sensible from a socio-demographic standpoint, reducing, for example, recidivism risk for males who are African-American in the recidivism dataset, and increasing income for well-educated females in the UCI adult dataset. The flexibility of the approach allows numerous extensions using different measures and constraints for utility preservation, discrimination, and individual distortion control. Investigating such extensions, developing theoretical characterizations based on the proposed framework, and quantifying the impact of the transformations on specific supervised learning tasks will be pursued in future work.

Appendix A Proof of Proposition 3

The proposition is a consequence of the following elementary lemma.

Let p(x)p(x), q(x)q(x) and r(x)r(x) be three fixed probability mass functions with the same discrete and finite support set X\mathcal{X}, c1≜min⁡x∈Xp(x)(1−p(x))3(1+p(x))2>0c_{1}\triangleq\min_{x\in\mathcal{X}}\frac{p(x)(1-p(x))}{3(1+p(x))^{2}}>0 and pm≜min⁡xp(x)>0p_{m}\triangleq\min_{x}p(x)>0. Then if

then for all x∈Xx\in\mathcal{X} and g(τ,pm)≜3τpmg(\tau,p_{m})\triangleq\sqrt{\frac{3\tau}{p_{m}}}

We assume τ>0\tau>0, otherwise p(x)=q(x)p(x)=q(x) ∀x∈X\forall x\in\mathcal{X} and we are done. From (21) and the Data Processing Inequality for KL-divergence, for any x∈Xx\in\cal X

Let xx be fixed, and, in order to simplify notation, denote c≜p(x)c\triangleq p(x). Assuming, without loss of generality,

The Taylor series of f(α)f(\alpha) around 0 has the form

where An(c)A_{n}(c) is the Eulerian polynomial, which is positive for c>0c>0 and satisfies A1(c)=1A_{1}(c)=1 and A2(c)=(1+c)A_{2}(c)=(1+c). First, assume α≤0\alpha\leq 0. Then f(α)f(\alpha) can be lower-bounded by the first term in its Taylor series expansion since all the terms in the series are non-negative. From (25),

Now assume α≥0\alpha\geq 0. Then the Taylor series (26) becomes an alternating series, and f(α)f(\alpha) can be lower-bounded by its first two terms

The term in the l.h.s. of the first inequality satisfies

as long as α≤c(1−c)(1+c)τ\alpha\leq\frac{c(1-c)}{(1+c)\tau}. Since the lhs is larger than 1 when α>3(1−c)cτ,\alpha>\sqrt{\frac{3(1-c)c}{\tau}}, then it is a valid lower-bound for f(α)f(\alpha) in the entire interval where f(α)≤1f(\alpha)\leq 1 and α≥0\alpha\geq 0 as long as

which holds by assumption in the Lemma. Thus,

and combining the previous equation with (28)

Finally, since q(x)p(x)=exp⁡(−ατ/p(x))\frac{q(x)}{p(x)}=\exp(-\alpha\tau/p(x)), from the previous inequalities

and the result follows by further lower bounding the lhs by γ1r(x)≤p(x)\gamma_{1}r(x)\leq p(x) and upper bounding the rhs by p(x)≥γ2r(x)p(x)\geq\gamma_{2}r(x) ∎

The previous Lemma allows us to derive the result presented in Proposition 3.

Let m≜∣X∣∣Y∣D∣m\triangleq|\mathcal{X}||\mathcal{Y}|\mathcal{D}|. The distribution pD,X,Yp_{D,X,Y} is the type (Cover & Thomas, 2006)[Chap. 11] of nn observations of qD,X,Yq_{D,X,Y}. ThenOther bounds on the KL-divergence between an observed type and its distribution could be used, such as (Cover & Thomas, 2006)[Thm. 11.2.2], without changing the asymptotic result., from (Csiszár & Shields, 2004)[Corollary 2.1], for τ>0\tau>0

From the Data Processing Inequality for KL-divergence, if DKL(pD,Y^∥qD,Y^)≤DKL(pD,X,Y∥qD,X,Y)D_{\mathsf{KL}}(p_{D,\hat{Y}}\|q_{D,\hat{Y}})\leq D_{\mathsf{KL}}(p_{D,X,Y}\|q_{D,X,Y}), and, consequently,

If DKL(pD,Y^∥qD,Y^)≤τD_{\mathsf{KL}}(p_{D,\hat{Y}}\|q_{D,\hat{Y}})\leq\tau, then since 0≤DKL(pD∥qD)0\leq D_{\mathsf{KL}}(p_{D}\|q_{D}), we have

then, with probability 1−β1-\beta, for all d∈Dd\in D

Assuming that mm, and cm≜min⁡y∈Y,d∈DpD,Y^(d,y)>0c_{m}\triangleq\min_{y\in\mathcal{Y},d\in\mathcal{D}}p_{D,\hat{Y}}(d,y)>0 constant, from the proof of Lemma 1 and, more specifically, inequalities (34), as long as τ≤min⁡d,ypY^,D(y,d)(1−pY^∣D(y∣d))3(1+pY^∣D(y∣d))2\tau\leq\min_{d,y}\frac{p_{\hat{Y},D}(y,d)(1-p_{\hat{Y}|D}(y|d))}{3(1+p_{\hat{Y}|D}(y|d))^{2}},

Since for xx sufficiently small ex≈1+xe^{x}\approx 1+x, we have

For the second claim, we start by applying the triangle inequality:

Now assume DKL(pD,X,Y∥qD,X,Y)≤τD_{\mathsf{KL}}(p_{D,X,Y}\|q_{D,X,Y})\leq\tau. Then the Data Processing Inequality for KL-divergence yields DKL(pX,Y∥qX,Y)≤τD_{\mathsf{KL}}(p_{X,Y}\|q_{X,Y})\leq\tau and DKL(pX^,Y^∥qX^,Y^)≤τD_{\mathsf{KL}}(p_{\hat{X},\hat{Y}}\|q_{\hat{X},\hat{Y}})\leq\tau. In addition, from Pinsker’s inequality,

and, analogously, Δ(qX^,Y^,pX^,Y^)≤22τ\Delta\left(q_{\hat{X},\hat{Y}},p_{\hat{X},\hat{Y}}\right)\leq 2\sqrt{2\tau}. Thus (40) becomes

Selecting τ\tau as in (35), then, with probability 1−β1-\beta,

References