A Variational Approach to Privacy and Fairness
Borja Rodríguez-Gálvez, Ragnar Thobaben, Mikael Skoglund
I Introduction
Currently, many systems rely on machine learning algorithms to make decisions and draw inferences. That is, they use previously existing data in order to shape some stage of their decision or inference mechanism. Usually, this data contains private or sensitive information, e.g., the identity of the person from which a datum was collected or their membership to a minority group. Thus, an important problem occurs when the data used to train such algorithms leaks this information to the system, contributing to unfair decisions or to a privacy breach.
When the content of the private information is arbitrary and the task of the system is not defined, the problem is reduced to learning private representations of the data; i.e., representations that are informative of the data (utility), but are not informative of the private information. Then, these representations can be employed by any system with a controlled private information leakage. If the informativeness is measured by the mutual information, the problem of generating private representations is known as the privacy funnel (PF) .
When the task of the system is known, then the aim is to design strategies so that the system performs such a task efficiently while employing or leaking little sensitive information. The field of algorithmic fairness has extensively studied this problem, especially for classification tasks and categorical sensitive information, c.f., . An interesting approach is that of learning fair representations , where similarly to their private counterparts, the representations are informative of the task, but contain little sensitive information.
There is a compromise between information leakage and utility when designing private representations . Similarly, it has been shown empirically and theoretically that there is a trade-off between fairness and utility.
In this work, we investigate the trade-off between utility and privacy and between utility and fairness in terms of mutual information (details about the choice of mutual information in Appendix A). More specifically, we aim at maintaining a certain level of the information about the data (for privacy) or the task (for fairness) that is not shared by the senstive attributes, while minimizing all the other information. We name these two optimization problems the conditional privacy funnel (CPF) and the conditional fairness bottleneck (CFB) due to their similarities with the PF , the information bottleneck (IB) , and the recent conditional entropy bottleneck (CEB) .
We tackle both optimization problems with a variational approach based on their Lagrangian. For the privacy problem, we show that the minimization of the Lagrangians of the CPF and the PF is equivalent (see Appendix B-A), meaning that the proposed approach also attempts at solving the PF. Moreover, this approach improves over current variational approaches to the PF by respecting the problem’s Markov chain in the encoder distribution.
Finally, the resulting approaches for privacy and fairness can be implemented with little modification to common algorithms for representation learning like the variational autoencoder (VAE) , the -VAE , the variational information bottleneck (VIB) , or the nonlinear information bottleneck . Therefore, it facilitates the incorporation of private and fair representations in current applications (see Appendices C and D for an extended related section and a guide on how to modify these algorithms).
We demonstrate our results both in the Adult dataset and a toy dataset based on MNIST . Further experiments on the COMPAS dataset can be found in Appendix E.
II Methods
In this section we present our approach. First, we introduce the proposed models for the privacy and fairness problems. Then, we show a suitable Lagrangian formulation. Finally, we describe a variational approach to solve both problems.
Suppose we want to share some data so that third-parties can make statistical analyses and draw inferences from them. However, these data contains information about some private attributes that we want to protect. For this reason, we encode the data into the representation , forming the Markov chain , and then share .
This encoding, characterized by the conditional probability distribution , is designed so that the representation keeps a certain level of the information about the data that is not shared with the private attributes (i.e., the light gray area in Figure 1a), while minimizing the information it keeps about the private attributes (i.e., the dark gray area in Figure 1a). That is,
This formulation reassembles the privacy funnel (PF) , since both minimize the information the representation keeps about the private attributes . Nonetheless, in the PF, the encoding is designed so that the representation keeps a certain level of information about the data , disregarding if this information is also shared by the private attributes . Hence, the optimization of the PF Lagrangian may lead to representations that filter private information arbitrarily. In contrast, the CPF avoids this issue with an inherent additional constraint on the Lagrange multipliers (see Appendix B-A).
II-A2 Fairness: the conditional fairness bottleneck (CFB)
Suppose we want to use (or share) some data to draw inferences or make decisions about a task . However, these data and the task contain information about some sensitive attributes , and we do not want our inferences to be influenced by these sensitive attributes . For this reason, we encode the data into a representation and then use to draw inferences about the task . Therefore, the Markov chains and hold.
This encoding, characterized by the conditional probability distribution , is designed so that the representation keeps a certain level of the information about the task that is not shared by the sensitive attributes (i.e., the light gray area in Figure 1b), while minimizing the information it keeps about the sensitive attributes and the information about the data that is not shared with the task (i.e., the dark and darker gray areas in Figure 1b, respectively). That is,
This formulation differs from other approaches to fairness in two main points: (i) Similarly to the IB , the CFB does not only minimize the information the representation keeps about the sensitive attributes , but also the information about the data that is irrelevant for the task . That is, the CFB seeks a representation that is both fair and relevant, thus avoiding the risk of keeping nuisances and harming its generalization capability. (ii) Similarly to the CEB , the CFB aims to produce a representation that maintains a certain level of the information about the task that is not shared by the sensitive attributes . This differs from formulations that aim to keep a certain level of the information about the task , disregarding if it is also shared by the sensitive attributes .
II-B The Lagrangians of the problems
A common approach to solving optimization problems such as the CPF or the CFB is to minimize the Lagrangian of the problem. The Lagrangian is a proxy of the trade-off between the function to optimize and the constraints on the optimization search space [23, Chapter 5]. Particularly, the Lagrangians of the CPF and the CFB are, ommiting the constant term in the optimization w.r.t. , respectively,
In the following propositions, proved in Appendix B-B, we present two alternative Lagrangians that are equivalent to the original Lagrangians, are more tractable, and exhibit similar properties and structure in the privacy and fairness problems.
Minimizing is equivalent to minimizing , where and
Minimizing is equivalent to minimizing , where and
The minimization of and , by means of and , trades off the level of compression of the representation Y with the information it keeps, respectively, about the data and the task that is not shared by the sensitive attributes .
II-C The variational approach
We consider the minimization of and to solve the CPF and CFB problems. Furthermore, we assume that the probability density (or mass if is countable) functions that describe the conditional probability distribution exist and are parameterized by , i.e., .
The Markov chains of the CPF and the CFB characterize the densities and . The densities and can be inferred from the data and the density is to be designed.
The term depends on the density , which is usually intractable. Similarly, the terms and depend on the densities and , respectively, which are also usually intractable. Therefore, an exact optimization of is prohibitively computationally expensive. For this reason, we introduce the variational density approximations , , and , where the generative and inference densities are parametrized by .
Then, as previously done in, e.g., , we leverage the non-negativity of the relative entropy to bound and from above. More precisely, we bound from above and and from below, i.e.,
In practice, if we have a dataset of samples for the CPF or samples for the CFB, we minimize, respectively, the following cost functions:
where the expectation over is usually estimated with a naive Monte Carlo of a single sample.
An a posteriori interpretation of this approach is that if the encoder compresses the representation assuming that the decoder will use both and the private or sensitive attributes , then the encoder will discard the information about contained in the original data in order to generate .
The resulting cost functions for the CPF and the CFB ressemble those of the VAE , the -VAE , the VIB , or the nonlinear IB . Consider the (common) case that the decoder density is estimated with a neural network. If such a network is modified so that it receives as input both the representation and the private or sensitive attributes instead of only the representation, then the optimization of these algorithms results in private and/or fair representations (see Appendix D for the details).
III Results
In this section, we present experiments on two datasets to showcase the performance of the presented variational approach to the privacy and fairness problems. First, we show its performance in a dataset commonly used for benchmarking both tasks. Second, we show the performance on high-dimensional data on a toy dataset designed for this purpose. The encoder density is modeled with an isotropic Gaussian distribution, i.e., , where is a neural network and is the dimension of the representation. The marginal density of the representation is also modeled as an isotropic Gaussian . Finally, the decoder density, or , is modeled with a product of categorical (for discrete data) and/or isotropic Gaussians (for continuous data), e.g., if consists of a discrete variable and a continuous variable . These and additional experiments are detailed in Appendix E.
The Adult dataset (available at the UCI machine learning repository ) contains samples from the 1994 U.S. Census. Each sample comprises 15 features such as, e.g., gender, age, or income level (binary variable stating if the income level is higher than \50,000STX$ is the rest of the features.
The MNIST dataset is a collection of grayscale images of hand-written digits from to . The Colored MNIST is a modification of the former dataset where each digit is randomly colored in either red, green, or blue. We considered that the data are the digit images, the sensitive attribute is the digit’s color, and the task is digit’s number.
III-A Privacy
The proposed approach is able to control the trade-off between a private and an informative representation for both the Adult and the Colored MNIST datasets. We minimized (8) for different values of , thus controlling the trade-off between the compression and the informativeness of the representation independent of the private data (see Figures 2a and 2b). Hence, as suggested by Proposition 3, the multiplier also controls the amount of private information the representation keeps (see Figures 2e and 2f).
As an illustration, we constructed a representation with the same dimension to the digit images by minimizing (8) with (Figure 3b). The representation is both informative and private; e.g., the 2D UMAP vectors of the representation are mingled with respect to the digits’ color, as opposed to the UMAP vectors of the original images, where the vectors are clustered by the color of the digits (see Figures 3c and 3d).
Compared to other variational approaches to the PF like the [16, PPVAE] and [27, VFAE], the proposed approach performed better in terms of information leakage and accuracy of non-linear attackers (see Table I). More specifically, the leaked information is about an order of magnitude lower than the obtained in the other methods and the accuracy of a random forest attacker is below the prior probability (0.67), while the other methods allow successful attacks of 0.8 – 0.9 accuracy. An explanation for this phenomenon is that some private information is leaked to the representations of the PPVAE and the VFAE via their encoding density , which does not respect the Markov chain .
III-B Fairness
The proposed variational approach is also able to control the trade-off between fair and accurate representations. We minimized (9) for different values of , thus controlling the trade-off between the compression and the informativeness of the representations independent of the sensitive attributes (see Figures 2c and 2d). Thus, as hinted by Proposition 4, the multiplier also controls the amount of private information leaked (see Figures 2g and 2h).
Furthermore, in the Adult dataset, the Lagrange multiplier allows us to control the behavior of different utility and group fairness indicators (defined in Appendix F), namely the accuracy, the error gap, and the discrimination (or demographic parity gap). That is, the higher the value of , the higher the accuracy and the discrimination, and the lower the error gap (see Figures 4a, 4b, and 4d). The behavior of the discrimination is enforced by the minimization of , as discussed in Remark 4 from Appendix F. However, there is no clear indication of the effect of on the accuracy of adversarial predictors on the sensitive data (which is still below the prior probability of the biased training dataset) and on the equalized odds (see Figures 4e and 4c). The equalized odds are not optimized in this scenario since the resulting representation is such that as discussed in Remark 5 from Appendix F. An example where the equalized odds gap is minimized is presented in Appendix E.
The representation generated from the proposed method is more robust to non-linear adversaries (as shown in Table II by the smaller accuracy on and smaller discrimination for random forest adversaries) than the standard baseline from [7, LFR]. Compared with other state-of-the-art methods, either those employing variational inference [28, FFVAE] or adversarial training [9, CFAIR], the proposed method for generating fair representations achieves similar results (see Table II), albeit having an easier cost function and requiring to train less networks, respectively (see Appendix C).
IV Discussion
In this article, we studied the problem of mitigating private or sensitive information leakage into data-driven systems through the training data . We formalized the trade-off between the relevant information for the system that is not shared by the private or sensitive attributes and the remaining information as a constrained optimization problem. When the task of the system is unknown, the problem is referred as learning private representations and the formalization is the conditional privacy funnel (CPF); and when it is kwnon the problem is referred as learning fair representations and the formalization is the conditional fairness bottleneck (CFB).
To solve these problems, we proposed a variational approach based on the Lagrangians of the CPF and the CFB. This approach leads to a simple structure highlighting the similarities between private and fair representation learning. Moreover, in practice, private and fair representations can be learned with little modification to the implementation of common algorithms such as the VAE , the -VAE , the VIB , or the nonlinear IB . Namely, modifying the decoder neural network so it receives both the representation and the private or sensitive attributes as an input. Then, the learned representations can be fed to any algorithm of choice. For this reason, the efforts for reducing unfair decisions and privacy breaches will be small for many practitioners.
The proposed formulation has some limitations due to the non-convexity of the CPF and the CFB (see Appendix G). Moreover, the proposed approach also faces limitations due to its variational nature. In Appendix H, we reflect on these limitations and propose future directions to overcome them.
References
Appendix A Motivation of mutual information as utility and privacy/fairness metric
The main reason to choose mutual information (and conditional mutual information) as the measure of utility and privacy and/or fairness is the tractability of this metric and the fact that it allowed us to (i) draw connections between the privacy and fairness problems and (ii) derive an algorithm that could be easily incorporated to current approaches to representation learning.
Other than that, even though there are some caveats of using mutual information as a measure of privacy (see ) or fairness, this metric has several operational meanings. Namely:
Utility. The conditional mutual information (or ) is a measure of the relevance of the representation to explain (or ). This is in line with the information bottleneck and other common representation learning algorithms , .
An intuition would be that if we want to keep the average distortion smaller than a certain quantity, and we consider the distortion to be the log-loss, then we want that the (conditional) mutual information is greater than a, different, certain quantity (see e.g. [2, Section III-B]).
Privacy. The mutual information is the average cost gain by an adversary with the self-information or log-loss cost function [2, Lemma 1]. This has also been used in other works such as . Moreover, an upper bound on mutual information limits both the Bayesian and minimax risks that can be achieved in any inference based on the data; see e.g. [33, Chapter 15.3 on Fano’s method].
Fairness. As explained in Remark 3 minimizing encourages demographic parity and minimizing encourages equalized odds.
Appendix B Equivalences of the Lagrangians
In this section of the appendix, we show how minimizing the Lagrangians of the CPF and the CFB problems is equivalent to minimizing other Lagrangians. First, in B-A we show that minimizing the Lagrangian of the CPF is equivalent to minimizing the Lagrangian of the PF, meaning that the conditional probability distributions obtained using the Lagrangian of the CPF could have been obtained through the Lagrangian of the PF, too. Then, in B-B we show that minimizing the CPF and CFB Lagrangians is equivalent to minimizing the Lagrangians that are used in the variational approach we propose in this paper.
The privacy funnel is defined in a similar way to the CPF. It is an optimization problem that tries to design an encoding probability distribution such that the representation keeps a certain level of information about the data of interest , while minimizing the information it keeps about the private data . That is,
Therefore, the Lagrangian of the privacy funnel problem is
where is the Lagrange multiplier of . This multiplier controls the trade-off between the information the representations keep about the private and the original data. If , then , for which optimal values of the encoding distribution can filter private information arbitrarily. If this problem is even more pronounced. If , trivial encoding distributions like a degenerate distribution with density are minimizers of the Lagrangian. Therefore, in practice one might need to restrict to the range .
Minimizing is equivalent to minimizing , where .
If we manipulate the expression of the CPF Lagrangian we can see how the minimizing is equivalent to minimizing , where . More specifically,
where is the set of probability distributions over such that if for all , then the Markov chain holds. ∎
We note how the relationship maintains for . This showcases how the CPF poses a more restrictive problem, in the sense that as long as there are no solutions of the problem that filter private information arbitrarily.
B-B Equivalence of the Lagrangians used for the minimization
If we manipulate the expression of the CPF Lagrangian we can see how minimizing is equivalent to minimizing , where . More specifically,
where is the set of probability distributions over such that if for all , then the Markov chain holds. ∎
If we manipulate the expression of the CFB Lagrangian we can see how minimizing is equivalent to minimizing , where . More specifically,
where is the set of probability distributions over such that if for all , then the Markov chains and hold. ∎
Appendix C Extended Related Work
If the secret information is the identity of the samples or their membership to a certain group, the field of differential privacy (DP) provides a theoretical framework for defining privacy and several mechanisms able to generate privacy-preserving queries about the data and explore such data, see, e.g., . If, on the other hand, the secret information is arbitrary, variants of DP such as [35, Bounded DP] and [36, Attribute DP] or the theoretical framework introduced in are commonly adopted. The privacy funnel is a special case of the latter, when the utility and the privacy are measured with the mutual information.
The original greedy algorithm to compute the PF assumes the data is discrete or categorical and do not scale. For this reason, methods that attempt at learning non-parametric encoding densities such as and other approaches that take advantage of the scalability of deep learning emerged. For instance, and learn the representations through adversarial learning but are limited to and do not offer an information theoretic interpretation. Similar to us, in the the privacy preserving variational autoencoder (PPVAE) and the unsupervised version of the variational fair autoencoder (VFAE) they learn such representations with variational inference.
At their core, the PPVAE and the unsupervised VFAE end up minimizing the cost functions
and , where is a maximum-mean discrepancy term. Even though the resulting function to optimize is similar to ours, it is important to note that the encoding density in these works is , which does not respect the problem’s Markov chain . Therefore, the optimization search space includes representations that contain information about the private data that is not even contained in the original data . Moreover, the private data is needed to generate the representations , which is problematic since it might not be available during inference.
C-B Fairness
The field of algorithmic fairness is mainly dominated by the notions of individual fairness, where the sensitive data is the identity of the data samples, and group fairness, where is a binary variable that represents the membership of the data samples to a certain group. There are several approaches that aim at producing classifiers that ensure either of these notions of fairness; e.g., discrimination-free naive Bayes , constrained logistic regression, hinge loss, and support vector machines , or regularized logistic regression through the Wasserstein distance .
Other lines of work on algorithmic fairness are based on causal inference and data massaging , where the values of the labels of the training data are changed so that the training data is fair.
The notion of fair representations, introduced by , boosted the advances on algorithmic fairness due to the expressiveness of deep learning. These advances are mainly dominated by adversarial learning , even though there are recent variational approaches, too .
The main differences with the variational approach from are our simple cost function (which does not require to train an additional adversary discriminator) and that we discard the information that is not necessary to draw inferences about . They generate two representations, and , that contain the information about the sensitive data and the original data, respectively, without taking into account the task at hand. At inference time, the sensitive representations are corrupted with noise or discarded, and thus the non-sensitive representations from serve a similar purpose to the representations obtained with our approach. Compared to the variational fair autoencoder , our encoding density does not require the sensitive information , which might not be available during inference, thus not breaking the Markov chain .
Appendix D Modification of common algorithms to obtain private and/or fair representations
In this section of the appendix, we discuss the simple changes needed to common representation learning algorithms to implement our proposed variational approach. First, we show how common unsupervised learning algorithms can be modified to the variational approach to the CPF, thus generating private representations. Then, we show how common supervised learning algorithms can be modified to the variational approach to the CFB, thus generating fair representations.
The cost function of the -VAE and the VIB (when the target variable is the identity of the samples) is
where is a parameter that controls the trade-off between the compression of the representations and their ability to reconstruct the original data . Similarly, the VAE cost function is .
In these usupervised learning algorithms the decoding (or generative) density is parametrized with neural networks, e.g., if is discrete and if is continuous, where , and are neural networks and is the dimension of . In this work, the decoding density can also be parametrized with neural networks, e.g., if is discrete and if is continuous, where , and are neural networks. Therefore, if the decoding density neural networks from are modified so that they take the private attributes as an input, then the resulting algorithm is the one proposed in this paper.
The cost function of the VIB and the nonlinear IB is
where is a parameter that controls the trade-off between the compression of the representations and their ability to draw inferences about the task .
The argument is analogous to the one for the modifications of unsupervised learning algorithms to obtain private representations. The only modification required in these supervised learning algorithms is to modify the decoding density neural networks to receive the sensitive attributes as an input as well as the representations .
In all these works and ours, the first (or the compression) term is usually calculated assuming that the encoder density is parametrized with neural networks, e.g., , which allows the representations to be constructed using the reparametrization trick, e.g., , where , is the dimension of the representations, and is the -dimensional identity matrix. Then, the marginal density of the representations is set so that the Kullback-Leibler divergence has either a closed expression, a simple way to estimate it, or a simple upper bound, e.g., or , where are the input data samples. Moreover, the loss function applied to the output of the decoding density and the optimization algorithm, e.g., stochastic gradient descent or Adam , can remain the same in these works and ours, too.
The aforementioned modifications can also be introduced in other algorithms with cost functions with additional terms to and . For example, adding a maximum-mean discrepancy (MMD) term on the representation priors to avoid the information preference problem like in the InfoVAE ; adding an MMD term on the encoder densities to enforce privacy or fairness like in the VFAE ; or adding a total correlation penalty to the representation’s marginal to enforce disentangled representations like in the Factor-VAE, the -TCVAE, or the FFVAE , .
Appendix E Details of the experiments
In this section of the appendix, we include an additional experiment on the COMPAS dataset and describe the details of the experiments performed to validate the approach proposed in this paper. The code is at https://github.com/burklight/VariationalPrivacyFairness.
The ProPublica COMPAS dataset Available in the Kaggle website. contains samples of different attributes of criminal defendants in order to classify if they will recidivate within two years or not. These attributes include gender, age, or race. In both tasks, we followed the experimental set-up from and considered to be a binary variable stating if the defendant is African American and to be the rest of attributes. For the fairness task, we considered to be the binary variable stating if the defendant recidivated or not. Since this dataset was not previously divided between training and test set, we randomly splitted the dataset with % of the samples () for training and the rest () for testing.
Similarly to the previous experiments, the proposed approach controls the trade-off between private and informative representations and between fair and accurate representations. In Figure 5 we see how the trade-off between the compression level and the informativeness of the representations independent of the private data and between the compression level and the predictability of the representations without the sensitive data is controlled by the private and the fair representations, respectively. Moreover, we can also see how the amount of information the representations keep about the private or the sensitive data is commanded by the Lagrange multipliers and .
Compared with other variational approaches to the PF [16, PPVAE] and [27, VFAE], as happened with the Adult dataset, the proposed approach controlled better the information the representations contained about the sensitive attribute . In particular, the PPVAE contained between 0.63 and 1 bit of information about for , and the VFAE contained between 0.68 and 1 bit for . Note that 1 bit is the maximum information that can contain about , since in this scenario. With respect to membership attacks, our method was a slightly weaker to linear attackers than the PPVAE and the VFAE, allowing an accuracy in the range , compared to their respective ranges of and . That is, considering the prior probability of , the best parameter of our method conceded the attacker a accuracy that the other methods did not allow. However, once the attacker employed more sophisticated attacks, such as a random forest, our method maintained a range of , while the PPVAE and the VFAE allowed almost a perfect recovery of the group membership, with respective accuracy ranges between and and between and , as was suggested by the amount of bits of information their representations contained about . As before, this behavior can be explained due to the Markov chain violation of the encoder densities of these approaches.
Furthermore, the Lagrange multiplier also allows us to control the behavior of the accuracy, the error gap, and the discrimination for the COMPAS dataset (Figures 6a, 6d, and 6b). Moreover, in this scenario, as shown in Figures 6c and 6e, an increase of also increased the equalized odds level and the accuracy on of adversarial classifiers (even though they remained below their values obtained with the original data for all the tested). These results on the equalized odds, even though not generalizable since we have the counter-example of the Adult dataset, indicate that in some situations this quanitty can be controlled with our approach. More specifically, we believe this happens when we can guarantee that is non-negative as explained in Remark 5.
Finally, we also observe, as for the Adult dataset, how the proposed method’s representations are more robust against non-linear adversaries than the representations obtained with the baseline from [7, LFR] (see Table III). Moreover, the method performs similarly as state-of-the-art methods based on adversarial learning [9, CFAIR] and variational inference [28, FFVAE], as shown in Table III.
E-B Experimental details
In all the experiments performed, we modeled the encoding density as an isotropic Gaussian distribution, i.e., , so that , where , is a neural network, is also optimized via gradient descent but is not calculated with as an input, and where the representations have dimensions. The neural networks in each experiment were:
For the Adult dataset, was a multi-layer perceptron with a single hidden layer with 100 units and ReLU activations.
For the Colored MNIST dataset, was the convolutional neural network CNN-enc-1 for both the privacy and fairness experiments, and the convolutional neural network CNN-enc-2 for the example from Figure 3. Both architectures are described in Table IV.
For the COMPAS dataset, was a multi-layer perceptron with a single hidden layer with 100 units and ReLU activations.
Moreover, the marginal density of the representations was modeled as an isotropic Gaussian of unit variance and zero mean; i.e., .
For the Adult dataset, the decoding neural network was a multi-layer perceptron with a single hidden layer with 100 units and ReLU activations. For the fairness task, the output was 1-dimensional with a Sigmoid activation function. For the privacy task, the output was -dimensional. The input of the network was a concatenation of and .
For the Colored MNIST dataset and the fairness task, the decoding neural network was also a multi-layer perceptron with a single hidden layer with 100 units, ReLU activations, and a 1-dimensional output with a Sigmoid activation function. For the privacy task, the decoding neural network was the CNN-dec-1 for the normal experiments and the CNN-dec-2 for the example of Figure 3. The input linear layers took as an input a concatenation of and and in the convolutional layers was introduced as a bias.
For the COMPAS dataset, the decoding neural network also was a multi-layer perceptron with a single hidden layer with 100 units and ReLU activations. For the fairness task, the output was 1-dimensional with a Sigmoid activation function. For the privacy task, the output was -dimensional. The input of the network was a concatenation of and .
The hyperparameters employed in the experiments to train the encoder and decoder networks are displayed in Table V, and the optimization algorithm used was Adam . All random seeds were set to 2020.
All experiments were run with PyTorch , NumPy , and scikit-learn on a Nvidia Tesla P100 PCIE GPU of 16Gb of RAM.
The input data for the Adult and the COMPAS dataset was normalized to have 0 mean and unit variance. The input data for the Colored MNIST dataset was scaled to the range $$.
The mutual information and the conditional entropy and were calculated with the bounds from (5), (6), and (7), respectively. Since was not directly obtainable, was calculated and displayed instead. The mutual information was calculated using the mutual information neural estimator (MINE) with a moving average bias corrector with a an exponential rate of 0.1 ; the resulting information was averaged over the last 100 iterations. The neural networks employed were a 2-hidden layer multi-layer perceptron with 100 ReLU6 activation functions for all the datasets and tasks, except from the example on the Colored MNIST dataset, where the CNN-mine from Table IV was used. In all tasks the input was a concatenation of and , except from the example on the Colored MNIST dataset, where in all convolutional layers the private data was added as a bias and in all linear layers was concatenated to the input. The hyperparameters used to train the networks are displayed in Table VI.
The accuracy on and , the discrimination, and the error and equalized odds gaps were calculated using both the input data and the generated representations . They were calculated with a Logistic regression (LR) classifier and a random forest (RF) classifier with the default settings from scikit-learn . The prior displayed on the accuracy on and figures is the accuracy of a classifier that only infers the majority class of and , respectively, from the training dataset.
We implemented the algorithm as described in the original paper. We used the same neural network architecture (i.e., multi-layer perceptron with a single hidden layer with 100 units and ReLU activations) and training hyperparameters than in our method in order to provide a fair comparison. The original method was not prepared to handle other data that was not continuous, so we expanded the method assuming categorical, and Bernoulli output distributions for the non-continuous data. We studied 30 linearly equiespaced values of the hyperparameter from (10) ranging from 1 to 50.
We implemented the algorithm as described in the original paper. We used the same neural network architecture (i.e., multi-layer perceptron with a single hidden layer with 100 units and ReLU activations) and training hyperparameters than in our method in order to provide a fair comparison. We studied 30 linearly equiespaced values of the hyperparameter multiplying the MMD term ranging from to . We calculated the MMD using random kitchen sinks with and as in the original paper.
We implemented the algorithm as described in the original paper. We used 10 prototypes () and adjusted the hyperparemeters , , and so that the L-BFGS found a feasible solution in iterations with a tolerance of . We observed that different values of the hyperparameters (as noted by ) produced almost equivalent results, so we only report here the results for , , and .
We implemented the algorithm as described in the original paper. We used the same neural network architecture (i.e., multi-layer perceptron with a single hidden layer with 100 units and ReLU activations) and training hyperparameters than in our method in order to provide with a fair comparison. Since the sensitive variable has dimension 1, there was no need for an adversary discriminator and therefore the parameter was not explored. We performed experiments with different values of ranging from to as in the original paper and we observed that the value of the hyperparameter did not modify much the results, as shown in Table VII. We selected for the comparisons since the results for that were the ones with the better trade-off between accuracy and fairness.
We implemented the algorithm as described in the original paper. For the experiments in the Adult dataset, we used the same neural network architecture (i.e., multi-layer perceptron with a single hidden layer with 100 units and ReLU activations) than in our method for the encoder, decoder, and the adversarial decoders, which are equipped with a gradient reversal layer . Also, we employed the same training hyperparameters to ensure a fair comparison between the two methods. We performed experiments with different values of ranging from to as in the original paper. However, for the experiments in the COMPAS dataset, we could not obtain good results with our architecture and hyperparameters nor could we replicate their results with their architecture and hyperparameters. Hence, for this dataset, we report here the results displayed in the original paper.
Appendix F Group fairness and utility indicators
In this section of the appendix, we define and put into perspective a series of metrics, employed in this article, that indicate the predicting and group fairness quality of a classifier.
A common metric to evaluate the performance (utility) of a classifier on a dataset is its accuracy, which measures the fraction of correct classifications of on such a dataset.
The accuracy of a classifier on a dataset is
An ideally fair classifier would maintain demographic parity (or statistical parity) and accuracy parity, which, respectively, mean that (or, equivalently if is deterministic, that ) and that . In other words, if a classifier has demographic parity, it means that it gives a positive outcome with equal rate to the members of and . However, demographic parity might damage the desired utility of the classifier , [11, Corollary 3.3]. Accuracy parity, on the contrary, allows the existance of perfect classifiers . The metrics that assess the deviation of a classifier from demographic and accuracy parities are the discrimination or demographic parity gap and the error gap .
The discrimination or demographic parity gap of a classifier to the sensitive variable on a dataset is
The error gap of a classifier with respect to the sensitive variable on a dataset is
The equalized odds gap of a classifier with respect to the sensitive variable on a dataset is
In the particular case of learning fair representations, the classifier consists of two stages: an encoder and a decoder , where the intermediate variable is the fair representation of the data. Therefore:
Minimizing encourages demographic parity, since
Minimizing encourages equalized odds, since
Based on Remark 3, we note that the variational approach to the CFB and the CPF for generating private and/or fair representations encourages demographic parity, since the minimization of the Lagrangians of such problems, and , indeed minimizes .
Contrary to Remark 4 concerning the minimization of the demographic parity gap, we cannot say that the variational approach to the CFB and the CPF minimizes the equalized odds gap.
Even though , since can be negative , then is not necessarily greater than and thus there is no guarantee that minimizing will minimize as well.
Therefore, the minimization of and , which minimizes , also minimizes the equalized odds gap when and therefore . That is, the CFB and the CPF minimize the equalized odds gap when there is no synergy between and to learn about ; i.e., .
Continuing with the reflection on Remarks 3 and 5, a constrained optimization formulation a la CPF that leads to a minimization of the equalized odds gap is possible. Namely,
which minimizes the dark and darker gray areas from Figure 1a, which correspond to the sensitive and irrelevant data, respectively, except the intersection between the sensitive data , the representations , and the target , which corresponds to . In this formulation, it is ensured that the representations also maintain a certain level of the information of the target that is not shared in the sensitive data .
Appendix G Non-convexity of the CPF and the CFB
In this section of the appendix, we show how both the CPF and the CFB as defined in (1) and (2) are non-convex optimization problems.
Let , , , and be random variables. Then,
If the Markov chain holds and the distributions of and are fixed, then , , and are convex functions with respect to the density .
If, additionally, the Markov chain holds and the distributions of , , and are fixed, then and are also convex functions with respect to the density .
We start the proof leveraging [57, Theorem 2.7.4], which, in our setting, tells us that:
is a convex function of if is fixed.
is a convex function of if is fixed.
is a convex function of if is fixed.
is a convex function of if is fixed.
is a convex function of if is fixed.
Let us consider that the distributions of and are fixed and that the conditional distribution has a density . Then, the CPF optimization problem is not convex.
From Lemma 1 we know that and are convex functions with respect to for fixed and . Hence, the constraint is concave. ∎
Let us consider that the distributions of , , and are fixed and that the conditional distribution has a density . Then, the CFB optimization problem is not convex.
From Lemma 1 we know that , , and are convex functions with respect to for fixed , , and . Hence, the constraint is concave. ∎
Appendix H Limitations and future directions
The CPF (1) and the CFB (2) are non-convex optimization problems with respect to (see Appendix G). Therefore, (i) the optimal conditional distribution that minimizes the Lagrangian might not be achieved through gradient descent, and (ii) even if is achieved, it could be a sub-optimal value for (1) or (2), since the problems are not strongly dual [23, Section 5.2.3]. A possible solution could be the application of a monotonically increasing concave function to or in the CPF or CFB Lagrangians, respectively, so that or is concave (and hence the Lagrangian is convex) in the domain of interest. For some , this approach might allow to attain the desired in (1) or (2) with a specific value of the Lagrange multiplier; see for an example of this approach for the IB.
The proposed approach entails two limitations that are common in variational attempts at solving an optimization problem. Namely: (i) it approximates the decoding and the marginal distributions and (ii) it considers parametrized densities. The first issue restricts the search space of the possible encoding distributions to those distributions with a decoding and marginal distributions that follow the restrictions of the variational approximation. The second issue further limits the search space to the obtainable encoding distributions with densities with a parametrization . For this reason, richer encoding distributions and marginals, e.g., by means of normalizing flows , are a possible direction to mitigate these issues.