A LLEVIATING
P RIVACY
A TTACKS
VIA
C AUSAL
L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
Machine learning models, especially deep neural networks have been shown to reveal membership information of inputs in the training data.
Such membership inference attacks are a serious privacy concern, for example, patients providing medical records to build a model that detects HIV would not want their identity to be leaked.
Further, we show that the attack accuracy ampliﬁes when the model is used to predict samples that come from a different distribution than the training set, which is often the case in real world applications.
Therefore, we propose the use of causal learning approaches where a model learns the causal relationship between the input features and the outcome.
An ideal causal model is known to be invariant to the training distribution and hence generalizes well to shifts between samples from the same distribution and across different distributions.
First, we prove that models learned using causal structure provide stronger differential privacy guarantees than associational models under reasonable assumptions.
Next, we show that causal models trained on sufﬁciently large samples are robust to membership inference attacks across different distributions of datasets and those trained on smaller sample sizes always have lower attack accuracy than corresponding associational models.
Finally, we conﬁrm our theoretical claims with experimental evaluation on 4 datasets with moderately complex Bayesian networks.
We observe that neural network-based associational models exhibit upto 80% attack accuracy under different test distributions and sample sizes whereas causal models exhibit attack accuracy close to a random guess.
Our results conﬁrm the value of the generalizability of causal models in reducing susceptibility to privacy attacks.
I NTRODUCTION
Machine learning algorithms, especially deep neural networks (DNNs) have found diverse applications in various ﬁelds such as healthcare (Esteva et al., 2019), gaming (Mnih et al., 2013), and ﬁnance (Tsantekidis et al., 2017; Fischer & Krauss, 2018).
However, a line of recent research has shown that deep learning algorithms are susceptible to privacy attacks that leak information about the training dataset (Fredrikson et al., 2015;
Rahman et al., 2018; Song & Shmatikov, 2018; Hayes et al., 2017).
Particularly, one such attack called membership inference reveals whether a particular data sample was present in the training dataset (Shokri et al., 2017).
The privacy risks due to membership inference elevate when the DNNs are trained on sensitive data such as in healthcare applications.
For example, patients providing medical records to build a model that detects HIV would not want to reveal their participation in the training dataset.
Membership inference attacks are shown to exploit overﬁtting of the model on the training dataset (Yeom et al., 2018).
Existing defenses propose the use of generalization techniques such as adding learning rate decay, dropout or using adversarial regularization techniques (Nasr et al., 2018b;
Salem et al., 2018).
All these approaches assume that the test data is from the same distribution as the training dataset.
In practice, a model trained using data from one distribution is often used on a (slightly) different distribution.
For example, hospitals in one region may train a model to detect HIV and share it with hospitals in different regions.
However, generalizing to a new context is a challenge for any machine learning model.
We extend the scope of membership privacy to different distributions and show that the risk from membership attack increases further on DNNs as the test distribution is changed.
That is, the abiltity of an adversary to distinguish a member from a non-member improves with change in test distributions.
To alleviate privacy attacks, we propose using models that depend on the causal relationship between input features and the output.
Causal learning has been extensively used to guarantee fairness and explainability properties of the predicted output (Kusner et al., 2017; Nabi & Shpitser, 2018; Datta et al., 2016).
However, the connection of causal learning to privacy is yet unexplored.
To the best of our knowledge, we provide the ﬁrst analysis of privacy beneﬁts of causal models.
By deﬁnition, causal relationships are invariant across input distributions (Peters et al., 2016), and hence make the predictions of causal models independent of the observed data distribution, let alone the observed dataset.
Hence, causal models generalize better even with change in the distributions.
In this paper, we show that the generalizability property of causal models directly ensures better privacy guarantees for the input data.
Concretely, we prove that with reasonable assumptions, a causal model always provides stronger (i.e., smaller (cid:15) value) differential privacy guarantees than a corresponding associational model trained on the same features and the same amount of added noise to the training dataset.
Consequently, we show that membership inference attacks are ineffective (equivalent to a random guess) on causal models trained on inﬁnite samples.
Empirical attack accuracies on four different datasets conﬁrm our theoretical claims.
We ﬁnd that 60 K training samples are sufﬁcient to reduce the attack accuracy of a causal model to a random guess.
In contrast, membership attack accuracy for neural network-based associational models increase as test distributions are changed.
The attack accuracy reaches nearly 80% when the target associational model is trained on 60 K training samples and used to predict test data that belong to a different distribution than the training data.
Our results show that causal learning approaches are a promising direction for training models on sensitive data.
Section 2 describes the properties of causal models.
Section 3 proves the connections of causality to differential privacy and robustness to membership attacks.
Section 4 provides empirical results.
To summarize, we make the following contributions:
• For the same amount of added noise, models learned using causal structure provide stronger (cid:15)
-differential privacy guarantees than corresponding associational models.
• Causal models are provably more robust to membership inference attacks than typical associational models such as neural networks.
• We simulate practical settings where
the test distribution may not be the same as the training distribution and ﬁnd that the membership inference attack accuracy of causal models is close to a “random guess” (i.e., 50%) while associational models exhibit upto 80% attack accuracy.
P ROPERTIES OF C AUSAL M ODELS
Causal models are shown to generalize well since the output of these models depend only on the causal relationship between the input features and the outcomes instead of the associations between them.
From prior work, we know that the causal relationship between the features is invariant to the their distribution (Peters et al., 2016).
Using this property, we study its effects on the privacy of data.
B ACKGROUND : C AUSAL M ODEL
Intuitively, a causal model identiﬁes a subset of features that have a causal relationship with the outcome and learns a function from the subset to the outcome.
To construct a causal model, one may use a structural causal graph based on domain knowledge that deﬁnes causal features as parents of the outcome under the graph.
Alternatively, one may exploit the strong relevance property from
Pellet & Elisseeff (2008), use score-based learning algorithms (Scutari, 2009) or recent methods for learning invariant relationships from training datasets from different distributions (Peters et al., 2016;
Bengio et al., 2019), or learn based on a combination of randomized experiments and observed data.
Note that this is different from training probabilistic graphical models, wherein an edge conveys an associational relationship.
Further details on causal models are in Pearl (2009); Peters et al.
For ease of exposition, we assume the structural causal graph framework throughout.
Consider data from a distribution ( X , Y ) ∼ P where X is a k -dimensional vector and Y ∈ { 0 , 1 } .
Our goal is to learn a function h ( X ) that predicts Y .
Figure 1 shows causal graphs that denote the different relationships between X and Y .
Nodes of the graph represent variables and a directed edge represents a direct causal relationship from a source to target node.
Denote X pa ⊆ X , the parents of Y in the causal graph.
Figure 1a shows the scenario where X contains variables X S0 that are correlated to X pa in P , but not necessarily connected to either X pa or Y .
These correlations may change in the future, thus a generalizable model should not include these features.
Similarly, Figure 1b shows parents and children of X pa .
The d-separation principle states that a node is independent of its ancestors conditioned on all its parents (Pearl, 2009).
Thus, Y is independent of X S1 and X S2 conditional on X pa .
Therefore, including them in a model does not add predictive value (and further, avoids problems when the relationships between X S1 and X S2 may also change).
Finally, for completeness, the exhaustive set of variables to include is known as the causal Markov Blanket 1 ,
X C which includes Y ’s parents, ( X pa ), children ( Y ch ) and parents of children.
Conditioned on its
Markov blanket (Figure 1c), Y is independent of all other variables in the causal graph.
When Y has no descendants in the graph, then the effective Markov blanket includes only its parents, X pa .
[Figure]
The key insight is that building a model for predicting Y using the Markov Blanket X C ensures that the model generalizes to other distributions of X , and also to changes in other causal relationships between X , as long as the causal relationship of X C to Y is stable.
We call such a model as a causal model, the features in ( X C ) as the causal features , and assume that all the causal features for Y are observed.
In contrast, we call a model that uses all available features as an associational model.
2. G ENERALIZATION TO NEW DISTRIBUTIONS
We state the generalization property of causal models and show how it results in a stronger differential privacy guarantee.
We ﬁrst deﬁne
In-distribution and Out-of-distribution generalization error.
Throughout, L ( ., . ) refers to the loss on a single input and L P ( ., . )
=
E P L ( ., . ) refers to the expected value of the loss over a distribution P ( X , Y ) .
We refer f : X → Y as the ground-truth labeling function and h : X → Y as the hypothesis function or simply the model.
Then, L ( h , h (cid:48) ) is any loss function quantifying the difference between two models h and h (cid:48) .
Deﬁnition 1.
In-Distribution Generalization Error ( IDE ) .
Consider a dataset S ∼ P ( X , Y ) .
Then for a model h : X → Y trained on S , the in-distribution generalization error is given by:
[Equation]
Deﬁnition 2.
Out-of-Distribution Generalization Error ( ODE ).
Consider a dataset S sampled from a distribution P ( X , Y ) .
Then for a model h : X → Y trained on S , the out-of-distribution generalization error with respect to another distribution P ∗ ( X , Y ) is given by:
[Equation]
Deﬁnition 3.
Discrepancy Distance ( disc L ) (Def. 4 in Mansour et al.
Let H be a set of hypotheses, h : X → Y .
Let L :
Y × Y → R + deﬁne a loss function over Y for any such hypothesis h .
Then the discrepancy distance disc L over any two distributions P ( X , Y ) and P ∗ ( X , Y ) is given by:
[Equation]
Intuitively, the term disc L ( P , P ∗ ) denotes the distance between the two distributions.
Higher the distance, higher is the chance of an error when transferring h from one distribution to another.
Now, we will state the theorem on the generalization property of causal models.
Theorem 1.
Consider a structural causal graph G that connects X to Y , and causal features X C where X C is a Markov Blanket of Y under G .
Let P ( X , Y ) and P ∗ ( X , Y ) be two distributions with arbitrary
P ( X ) and P ∗ ( X ) such that the causal relationship between X C and Y is preserved, which implies that P ( Y | X C ) = P ∗ ( Y | X C ) .
Let f : X C → Y be the resultant invariant labelling function such that y =
f ( X C ) .
Further, assume that H C represents the set of causal models h c : X C → Y that use all causal features and H A represent the set of associational models h a : X → Y that may use all available features, such that H C ⊆ H A and f ∈ H C .
Then, for any symmetric loss function L that obeys the triangle inequality, the upper bound of ODE from a dataset S ∼ P ( X , Y ) to P ∗ (called ODE - Bound ) for a causal model h c ∈ H C is less than or equal to the upper bound ODE - Bound of an associational model h a ∈ H A , with probability at least (1 − δ ) 2 .
[Equation]
Proof.
As an example, consider a colored MNIST data distribution P where the classiﬁcation task is to detect whether a digit is greater than 5 , and where all digits above 5 are colored with the same color.
Then, under a suitably expressive class of models, the loss-minimizing associational model may use only the color feature to obtain zero error, while the loss-minimizing causal model will still use the shape (causal) features to obtain zero error.
On any new P ∗ that does not follow the same correlation of digits with color, we expect that the loss-minimizing associational model will have higher error than the loss-minimizing causal model.
Formally, since P ( Y | X C ) =
P ∗ ( Y | X C ) , the optimal causal model that minimizes loss over P is the same as the loss-minimizing model over P ∗ .
That is, h OPTc , P = h OPTc , P ∗ .
However, for some associational models, h OPTa , P (cid:54) = h OPTa , P ∗ and thus there is an additional loss term when generalizing to data from P ∗ .
The rest of the proof follows from triangle inequality of the loss function and the standard bounds for IDE from past work.
Detailed proof is in Appendix Section A.1.
Corollary 1.
Consider a causal model h c : X C → Y and an associational model h a : X → Y trained on a dataset S ∼ P .
Let ( x , y ) ∈ S and ( x (cid:48) , y (cid:48) ) / ∈ S be two input instances such that they share the same true labelling function y = f
( x c ) and y (cid:48) = f ( x (cid:48) c ) . Then, the worst-case generalization error for a causal model on any such x (cid:48) is less than or equal to that for an associational model.
[Proof in Appendix Section A.2]
[Equation]
M AIN R ESULT : P RIVACY G UARANTEES WITH C AUSALITY
We now present our main result on the privacy guarantees and attack robustness of causal models.
3. D IFFERENTIAL P RIVACY G UARANTEES
Differential privacy (Dwork et al., 2014) provides one of the strongest notion of privacy guarantees to hide the participation of an individual sample in the dataset.
To state informally, it ensures that the presence or absence of a single data point in the input dataset does not change the output by much.
Deﬁnition 4 (Differential Privacy) .
A mechanism M with domain I and range O satisﬁes (cid:15) -differential privacy if for any two datasets d, d (cid:48) ∈ I that differ only in one input and for a set S ⊆ O , the following holds:
[Equation]
Based on the generalization property, we show that causal models provide stronger differential privacy guarantees than corresponding associational models.
The standard approach to designing a differentially private algorithm is by calculating the sensitivity of that algorithm and adding noise proportional to the sensitivity.
Sensitivity captures the change in the output of an algorithm due to the change in a single data point in the input.
Higher the sensitivity, larger is the amount of noise required to make an algorithm differentially private with reasonable (cid:15) guarantees.
We ﬁrst provide the formal deﬁnition of sensitivity and then show that the sensitivity of causal models is lower than or equal to associational models.
Deﬁnition 5 (Sensitivity (From Def.
3.1 in Dwork et al.
Let F be a function that maps a dataset to a vector in R d .
Let S , S (cid:48) be two datasets such that S (cid:48) differs from S in one data point.
Then the l 1 -sensitivity of a function F is deﬁned as: ∆
[Equation]
Lemma 1.
Let S be a dataset over ( X , Y ) values, such that y ( i ) =
f ( x ( i ) c ) ∀ ( x ( i ) , y ( i ) )
∈ S , where f is the true labelling function over the causal features X C .
Consider a neighboring dataset S (cid:48) such that S (cid:48) =
S \ ( x , y ) + ( x (cid:48) , y (cid:48) ) where ( x , y ) ∈ S , ( x (cid:48) , y (cid:48) ) / ∈ S , and ( x (cid:48) , y (cid:48) ) shares the same causal labelling function y (cid:48)
=
f ( x (cid:48) c ) .
Let a model h be speciﬁed by a set of parameters θ ∈ Ω ⊆ R n .
Let h minS ( x ; θ S ) be a model learnt using S as training data and h minS (cid:48)
( x ; θ S (cid:48) ) be the model learnt using S (cid:48) as training data.
Then, the sensitivity of a causal learning function F c that outputs learnt empirical hypothesis h min c , S ← F c ( S ) and h min c , S (cid:48) ← F c ( S (cid:48) ) is lower than or equal to the sensitivity of an associational learning function F a that outputs h mina , S ← F a ( S ) and h mina , S (cid:48) ← F a ( S (cid:48) ) using a loss function L that is strongly convex over Ω , symmetric and obeys the triangle inequality,
[Equation]
(6) where the maximum is over all such datasets S and S (cid:48) .
Proof.
We can write the empirical loss minimizers for the datasets S and S (cid:48) as:
[Equation]
From Corollary 1, for x (cid:48) / ∈ S and x ∈ S , we have:
[Equation]
Since x ∈ S and x (cid:48) ∈ S (cid:48) and | S − S (cid:48)
| = 1 the above is true for any S and S (cid:48) , [Equation]
[Equation]
Since L is a strongly convex function over Ω , and since H C ⊆ H
A ⇒ Ω C ⊆ Ω A , h minc , S and h minc , S (cid:48) that minimize L S ( h , f ) and L S (cid:48)
( h , f ) respectively should also be closer to each other than h min a , S and h mina , S (cid:48)
(Boyd & Vandenberghe, 2004) (using Eqn. 9).
[Equation]
[Table]
Hence, sensitivity of a causal model is lower than an associational model i.e., ∆ F c ≤ ∆ F a .
Theorem 2.
Let ˆ F c and ˆ F a be the differentially private algorithms corresponding to causal learning and associational learning algorithms F c and F a respectively.
Let ˆ F c and ˆ F a provide (cid:15) c
-DP and (cid:15) a -DP guarantees respectively.
Then, for noise sampled from the same distribution, Lap ( Z ) for both algorithms, we have (cid:15) c ≤ (cid:15) a .
Proof.
According to the Def. 3.3 of Laplace mechanism from Dwork et al.
(2014), we have,
[Equation]
[Equation]
The noise is added to the output of the learning algorithm i.e., the model parameters.
Since K is sampled from the same noise distribution,
[Equation]
[Equation]
From Lemma 1, ∆ F c ≤ ∆ F a and hence (cid:15) c ≤ (cid:15) a .
While we prove the general result above, our central claim comparing differential privacy for causal and associational models also holds true for models developed using recent work (Papernot et al., 2017) that provides a tighter data-dependent differential privacy guarantee.
The key idea is to produce an output label based on voting from M teacher models, each trained on a disjoint subset of the training data.
We state the theorem below and provide the proof in Appendix B. Given datasets from different domains, the below theorem provides a constructive proof to generate a differentially private causal algorithm, following the method from Papernot et al.
Theorem 3.
Let D be a dataset generated from possibly a mixture of different distributions P ( X , Y ) such that P ( Y | X C ) remains the same.
Let n j be the votes for the jth class from M teacher models.
Let M be the mechanism that produces a noisy max, arg max j { n j + Lap (2 /γ ) } .
Then the privacy budget (cid:15) for a causal model is lower than that for the associational model with the same accuracy.
3. R OBUSTNESS TO M EMBERSHIP A TTACKS
Deep learning models have shown to memorize or overﬁt on the training data during the learning process (Carlini et al., 2018).
Such overﬁtted models are susceptible to membership inference attacks that can accurately predict whether a target input belongs to the training dataset or not (Shokri et al., 2017).
There are multiple variants of the attack depending on the information accessible to the adversary.
An adversary with access to a black-box model only sees the conﬁdence scores for the predicted output whereas one with the white-box has access to the model parameters and observe the output at each layer in the model (Nasr et al., 2018a).
In the black-box setting, a membership attack is possible whenever the distribution of output scores for training data is different from the test data, and has been connected to model overﬁtting (Yeom et al., 2018).
For the white-box setting, if an adversary knows the true label for the target input, then they may guess the input to be a member of the training set whenever the loss is lower, and vice-versa.
Alternatively, if the adversary knows the distribution of the training inputs, they may learn a “shadow” model based on synthetic inputs and use the shadow model’s output to build a membership classiﬁer for any new input (Salem et al., 2018).
Most of the existing membership inference attacks have been demonstrated for test inputs from the same data distribution as the training set.
When test inputs are expected from the same distribution, methods to reduce overﬁtting (such as adversarial regularization) can help reduce privacy risks (Nasr et al., 2018b).
However, in practice, this is seldom the case.
For instance, in our example of a model trained to detect HIV, the test inputs may come from different hospitals.
Models trained to reduce the generalization error for a speciﬁc test distribution are still susceptible to membership inference when the distribution of features is changed.
This is due to the problem of covariate shift that introduces a domain adaptation error term (Mansour et al., 2009).
That is, the loss-minimizing model that predicts
Y changes with a different distribution, and thus allows the adversary to detect differences in losses for the test versus training datasets.
As we show below, causal models alleviate the risk of membership inference attacks.
From Yeom et al.
(2018), we ﬁrst deﬁne a membership attack as:
Deﬁnition 6.
Let model h be trained on a dataset S ( X , Y ) of size N .
Let A be an adversary with access to h and a input X .
The advantage of an adversary in membership inference is the difference between true and false positive rate in guessing whether the the input belongs to the training set.
[Equation]
where b = 1 if the input is in the training set and 0 otherwise.
Lemma 2.
[From Yeom et al.
Let M be a (cid:15)
-differentially private mechanism based on a model h .
The membership advantage for an adversary is bounded by exp( (cid:15) ) − 1 .
Theorem 4.
Given a structural causal network that connects X to Y , let S ∼ P ( X , Y ) be a dataset sampled from P , and let P ∗ be any distribution such that P ( Y | X C )
=
P ∗ ( Y | X C ) .
Then, a causal model h c trained on S yields lower membership advantage than an associational model h
a even when the test dataset is from a different distribution P ∗ .
Proof.
From Theorem 2 above, we can construct an (cid:15) c -DP mechanism based on a causal model, and a (cid:15) a -DP mechanism based on an associational model, where (cid:15) c ≤ (cid:15) a .
Further, this construction works for different input distributions.
From Lemma 2, the membership advantage of an adversary A is,
[Equation]
A [Equation] Thus, worst case advantage for a causal model is always lower than that of an associational model.
Corollary 2.
Let h minc , S be a causal model trained using empirical risk minimization on a dataset
S ∼ P ( X , Y ) with sample size N .
As N → ∞ , membership advantage Adv ( A , h minc , S ) → 0 .
The proof is the based on the result from Theorem 1 that h OPTc , P = h OPTc , P ∗ for a causal model.
Crucially, membership advantage does not go to zero as N → ∞ for associational models, since h OPTa , P (cid:54) =
h OPTa , P ∗ in general.
Detailed proof is in Appendix Section C.
Attribute Inference attacks.
We prove similar results on the beneﬁts of causal models for attribute inference attacks in Appendix Section D.
I MPLEMENTATION AND E VALUATION
[Table]
Benchmark Datasets.
To avoid errors in learning causal structure from data, we perform evaluation on datasets for which the causal structure and the true conditional probabilities of the variables are known [Figure] from prior research.
We select 4 Bayesian network datasets— Child, Sachs, Alarm and Water that range from 230-10k parameters (Table 1) (bnl).
Nodes represent the number of input features and arcs denote the causal connections between these features in the network.
Each causal connection is speciﬁed using a conditional probability table
P ( X i | Parents ( X i )) ; we consider these probability values as the parameters in our models.
To create a prediction task, we select a variable in each of these networks as the output Y .
The number of classes in Table 1 denote all the possible values for an output variable.
For example, the variable BP (blood pressure) in the alarm dataset takes 3 values i.e, LOW, NORMAL, HIGH .
The causal model uses only parents of Y whereas the associational model (DNN) uses all nodes except Y as features.
Implementation.
We sample data using the causal structure and probabilities from the Bayesian network, and use a 60:40% split for train-test datasets.
We learn a causal model and a deep neural network (DNN) on each training dataset.
We implement the attacker model to perform membership inference attack using the output conﬁdences of both these models, based on past work (Salem et al., 2018).
The input features for the attacker model comprises of the output conﬁdences from the target model, and the output is membership prediction (member / non-member) in the training dataset of the target model.
In both the train and the test data for the attacker model, the number of members and non-members are equal.
The creation of the attacker dataset is described in Figure 4 in Appendix.
Note that the attack accuracies reported are an upper bound since we assume that the adversary has white-box access to the ML model.
To train the causal model, we use the bnlearn library in R language that supports maximum likelihood estimation of the parameters in Y ’s conditional probability table.
For prediction, we use the parents method to predict the class of any speciﬁc variable.
To train the DNN model and the attacker model, we build custom estimators in Python using Tensorﬂow v1.2 ten.
The DNN model is a multilayer perceptron (MLP) with 3 hidden layers of 128, 512 and 128 nodes respectively.
The learning rate is set to 0.0001 and the model is trained for 10000 steps.
The attacker model has 2 hidden layers withnodes each, a learning rate of 0.001, and is trained for 5000 steps.
Both models use Adam optimizer,
ReLU for the activation function, and cross entropy as the loss function.
We chose these parameters to ensure model convergence.
4. E XPERIMENTAL S ETUP
We evaluate the DNN and the causal model sample sizes ranging from 1K to 1M dataset sizes.
We refer Test 1 as the test dataset which is drawn from the same distribution as the training data and Test 2 is generated from a completely different distribution except for the relationship of the output class to its parents.
To generate Test 2, we alter the true probabilities Pr( X ) uniformly at random (later, we consider adding noise to the original value).
Our goal with generating Test 2 is to capture the realistic behaviour of shift in distribution for input features.
We refer the causal and DNN model as the target on which the attack is perpetrated.
4. R ESULTS
We present results on the accuracy of target models (causal and DNN models) and the membership attack accuracy for different dataset sizes and test distributions.
Accuracy comparison of DNN and Causal models.
Figure 2a shows the target model accuracy comparison for the DNN and the causal model trained on the Child dataset with XrayReport as the output variable.
We report the accuracy of the target models only for a single run since in practice the attacker would have access to the outputs of only a single model.
We observe that the DNN model [Figure] has a large difference between the train and the test accuracy (both Test 1 and Test 2) for smaller dataset sizes (1K and 2K).
This indicates that the model overﬁts on the training data for these dataset sizes.
However, after 10 K samples, the model converges such that the train and Test 1 dataset have the same accuracy.
The accuracy for the Test 2 distribution stabilizes for a total dataset size of 10 K samples.
In contrast, for the causal model, the train and Test 1 accuracy are similar for the causal model even on smaller dataset sizes.
However, after convergence at around 10 K samples, the gap between the accuracy of train and Test 2 dataset is the same for both the DNN and the causal model.
Figure 3a shows the accuracy comparison for all four datasets with similar results.
Attack Accuracy comparison of DNN and Causal models.
A naive attacker classiﬁer would predict all the samples to be members and therefore achieve 0.5 prediction accuracy.
Thus, we consider 0.5 as the baseline attack accuracy which is equal to a random guess.
Figure 2b shows the attack accuracy comparison for Test 1 (same distribution) and Test 2 (different distribution) datasets.
Attack accuracy of the Test 1 dataset for the causal model is slightly above a random guess for smaller dataset sizes, and then converges to 0.5.
In comparison, attack accuracy for the DNN on Test 1 dataset is over 0.6 for smaller samples sizes and reaches 0.5 after 10K datapoints.
This conﬁrms past work that an overﬁtted DNN is susceptible to membership inference attacks even for test data generated from the same distribution as the training data (Yeom et al., 2018).
On Test 2, the attack accuracy is always higher for the DNN than the causal model, indicating our main result that associational models “overﬁt” to the training distribution, in addition to the training dataset.
Membership inference accuracy for DNNs is as high as 0.8 for total dataset size of 50K while that of causal models is below 0.6.
Further, attack accuracy for DNN increases with sample size whereas attack accuracy for the causal model reduces to 0.5 for total dataset size over 100k even when the gap between the train and test accuracies is the same as DNNs ( as shown in Figure 2a).
These results show that causal models generalize better than DNNs across input distributions.
Figure 3b shows a similar result for all four datasets.
The attack accuracy for DNNs and the causal model is close to 0.5 for the Testdataset while for the Test 2 dataset the attack accuracy is signiﬁcantly higher for DNNs than causal model.
This empirically conﬁrms our claim that in general, causal models are robust to membership inference attacks across test distributions as compared to associational models.
Attack Accuracy for Different Test Distributions.
To understand the change in attack accuracy as
Pr( X ) changes, we also generate test data from different distributions by adding varying amount of noise to the true probabilities.
We range the noise value between 0 to 2 and add it to the individual probabilities which are then normalized to sum up to 1.
Figure 2c shows the comparison of attack accuracy for the causal model and the DNN on the child dataset for a total sample size of 100K samples.
We observe that the attack accuracy increases with increase in the noise values for the DNN.
Even for a small amount of noise, attack accuracies increase sharply.
In contrast, attack accuracies stay close to 0.5 for the causal model, demonstrating the robustness to membership attacks.
Results with learnt causal model.
Finally, we perform experiments to understand the effect of privacy guarantees on causal structures learned from data that might be different from the true causal structure.
We evaluate the attack accuracy for learned causal models on the Sachs, Child and
Alarm dataset 2 .
For these datasets, a simple hill-climbing algorithm returned the true causal parents.
Hence, we evaluated attack accuracy for models with hand-crafted errors in learning the structure i.e., misestimation of causal parents, see Figure 3c.
Speciﬁcally, we include two non-causal features as parents of the output variable along with the true causal features.
The attack risk increases as a learnt model deviates from the true causal structure, however it still exhibits lower attack accuracy than the corresponding associational model.
Table 2 in Appendix gives a ﬁne-grained analysis.
R ELATED W ORK
Privacy attacks and defenses on ML models.
Shokri et al.
(2017) demonstrate the ﬁrst membership inference attacks on black box neural network models with access only to the conﬁdence values.
Similar attacks have been shown on several other models such as GANs (Hayes et al., 2017), text prediction generative models (Carlini et al., 2018; Song & Shmatikov, 2018) and federated learning models (Nasr et al., 2018b).
However, prior research does not focus on the severity of these attacks with change in the distribution of the test dataset.
We discussed in Section 2 that existing defenses based on regularization (Nasr et al., 2018b) are not practical when models are evaluated on test inputs from different distributions.
Another line of defense is to add differentially private noise while training the model.
However, the (cid:15) values necessary to mitigate membership inference attacks in deep neural networks require addition of large amount of noise that degrades the accuracy of the output model (Rahman et al., 2018).
Thus, there is a trade-off between privacy and utility when using differential privacy for neural networks.
In contrast, we show that causal models require lower amount of noise to achieve the same (cid:15) differential privacy guarantees and hence retain accuracy closer to the original model.
Further, as training sample sizes become sufﬁciently large, as shown in Section 4, causal models are, by deﬁnition, robust to membership inference attacks across distributions.
Causal learning and privacy.
There is a substantial literature on learning causal models from data; for a review see (Peters et al., 2017; Pearl, 2009).
Kusner et al.
(2015) proposed a method to privately reveal parameters from a causal learning algorithm, using the framework of differential privacy.
Instead of a speciﬁc causal algorithm, our focus is on the privacy beneﬁts of causal models for general predictive tasks.
While recent work applies causal models to study properties of machine learning models such as providing explanations (Datta et al., 2016) or fairness (Kusner et al., 2017), the relation of causality to privacy is yet unexplored.
With this paper, we present the ﬁrst result which shows the privacy beneﬁts of causal models.
C ONCLUSION AND F UTURE W ORK
We conclude that causal learning is a promising approach to train models which are robust to privacy attacks such as membership inference and model inversion.
As our future work, we want to relax our assumption of a known causal structure and investigate the privacy guarantees of causal models where the causal features and the relationship between them is not known apriori (Peters et al., 2017)
A G ENERALIZATION P ROPERTIES OF C AUSAL M ODEL A. G ENERALIZATION OVER D IFFERENT D ISTRIBUTIONS
Theorem 1.
Consider a structural causal graph G that connects X to Y , and causal features X C where X C is a Markov Blanket of Y under G .
Let P ( X , Y ) and P ∗ ( X , Y ) be two distributions with arbitrary
P ( X ) and P ∗ ( X ) such that the causal relationship between X C and Y is preserved, which implies that P ( Y | X C ) = P ∗ ( Y | X C ) .
Let f : X C → Y be the resultant invariant labelling function such that y =
f ( X C ) .
Further, assume that H C represents the set of causal models h c : X C → Y that use all causal features and H A represent the set of associational models h a : X → Y that may use all available features, such that H C ⊆ H A and f ∈ H C .
Then, for any symmetric loss function L that obeys the triangle inequality, the upper bound of ODE from a dataset S ∼ P ( X , Y ) to P ∗ (called ODE - Bound ) for a causal model h c ∈ H C is less than or equal to the upper bound ODE - Bound of an associational model h a ∈ H A , with probability at least (1 − δ ) 2 .
[Equation]
Proof.
Consider a model h : X → Y belonging to a set of models H , that was trained on S ∼ P ( X , Y ) . From Def.
2 we write,
[Equation]
where the last equation is to due to Def.1 of the in-distribution generalization error.
Let us denote the optimal loss-minimizing hypotheses over H for P and P ∗ as h OPTP and h OPTP ∗ .
[Equation]
[Equation]
Using the triangle inequality of the loss function, we can write:
[Equation]
[Equation]
And,
[Equation]
Thus, combining Eq. 15, 17 and 18, we obtain,
[Equation]
where the last inequality is due to the deﬁnition of discrepancy distance (Deﬁnition 3).
Equationdivides the out-of-distribution generalization error of a hypothesis h in four parts:
IDE P ( h , f ) denotes the in-distribution error of h .
This can be bounded by typical generalization bounds, such as the uniform error bound that depends only on the VC dimension and sample size of S (Shalev-Shwartz & Ben-David, 2014).
Using a uniform error bound based on the VC dimension, we obtain, with probability at least 1 − δ ,
[Equation]
Since H C ⊆ H A , VC-dimension of causal models is not greater than that of associational models.
Thus,
[Equation]
disc L , H ( P , P ∗ ) denotes the distance between the two distributions.
Given two distributions, the discrepancy distance does not depend on h , but only on the hypothesis class H . 3.
L P ∗ ( h OPTP ∗ , f ) and L P ( h OPTP , f ) measure the error due to the true labeling function f being outside the hypothesis class H . 4.
L P ∗ ( h OPTP , h OPTP ∗ ) denotes the loss (or difference) between the loss-minimizing function over P and the loss-minimizing hypothesis over P ∗ .
We next consider two classes of models, H C that contains models that uses all causal features ( X C ) from a Markov Blanket over the structural causal graph, and H A that contains associational models that may use all or a subset of all available features.
Below we show that for a given distribution P and another distribution P ∗ such that P ( Y | X C ) =
P ∗ ( Y | X C ) , the last term L P ( h OPTP , h OPTP ∗ ) of Equationvanishes for a causal model but may remain non-zero for an associational model.
Causal Model.
Given a structural causal network, let us construct a model using all variables X C in
Y ’s Markov Blanket.
By property of the structural causal network, X C includes all parents of Y and thus there are no backdoor paths, using Rule 2 of do-calculus from Pearl (2009):
[Equation]
where the last equality is since data from P ∗ also shares the same causal graph, ( Y is independent of X (cid:54) C given X C in P ∗ ).
Since the conditional distribution of Y given X C features is the same across P and P ∗ , and the true labelling function f ∈ H C , the loss-minimizing models should also be the same.
Deﬁning h OPTc , P = arg min h c ∈H C L P ( h c , f ) and h OPTc , P ∗ =
arg min h c ∈H C L P ∗ ( h c , f ) , we obtain,
[Equation]
And therefore, the term L P ∗ ( h OPTc , P , h OPTc , P ∗ ) = 0 . Also, L P ( h OPTc , P , f ) = L P ∗ ( h OPTc , P ∗ , f ) = 0 .
Associational Model.
In contrast, an associational model may use a subset of X , X S ⊆ X , that may not include all variables in the Markov Blanket, or may include the Markov Blanket but also include other extraneous variables. Let the set of such models be H AS .
Note that we only consider H AS to be the set of models for which L P ( h OPTas , P , f ) =
{+L P ∗ ( h OPTas , P ∗ , f ) = 
+}
(otherwise, the loss bound for a model from H AS is trivially larger). This can happen when a feature x i / ∈ X C does not belong to the Markov Blanket under the causal graph, but belongs to the associational Markov Blanket under the probability distribution over P or P ∗ . Then, by deﬁnition of f , f / ∈ H AS .
Thus, h OPTas , P (cid:54) =
f (cid:54) =
h OPTas , P ∗ . Further, the loss-minimizing hypotheses h OPTas , P and h OPTas , P ∗ depend on the different distributions P ( Y | X S = x s ) and P ∗ ( Y | X S = x s ) and thus not necessarily equal.
Hence, h OPTa , P (cid:54) =
h OPTa , P ∗ .
For the other subset of associational models, since X C ⊆ X , it is possible that an associational model includes only the causal features of Y .
Therefore, in general, L P ( h OPTa , P , h OPTa , P ∗ ) ≥ 0 .
Loss Bounds.
Hence, using Eq. 23, we write equation 19 for a causal model as:
[Equation]
Using Eqns.
20 and 21, we obtain, with probability at least 1 − δ :
[Equation]
Similarly, for an associational model, we obtain, with probability at least 1 − δ :
[Equation]
Finally, using Deﬁnition 3 for discrepancy distance, we can state H C ⊆
H
A ⇒ disc L , H C ( P , P ∗
[Equation]
≤ disc L , H A ( P , P ∗ ) .
Therefore, from Eq. 24 and 28, we claim with probability (1 − δ ) 2 ,
[Equation]
A. G ENERALIZATION OVER A S INGLE D ATAPOINT
Corollary 1.
Consider a causal model h c : X C → Y and an associational model h a : X → Y trained on a dataset S ∼ P .
Let ( x , y ) ∈ S and ( x (cid:48) , y (cid:48) ) / ∈ S be two input instances such that they share the same true labelling function y = f
( x c ) and y (cid:48) = f ( x (cid:48) c ) . Then, the worst-case generalization error for a causal model on any such x (cid:48) is less than or equal to that for an associational model.
[Proof in Appendix Section A.2]
[Equation]
Proof.
Using the triangle inequality for the loss function, we obtain,
[Equation]
Combining the two inequalities,
[Equation] [Equation]
where dist ( x , x (cid:48) )
=
max h , h (cid:48) ∈H | L x (cid:48) ( h , h [Equation] ) − L x
[Equation]
h
[Equation] h [Equation] ) | , analogous to the disc L for distributions.
For a causal model, we know that h OPTc , P = h OPTc , P ∗ .
Further, from Theorem 1 proof, L x ( h OPTc , P , f ) = L x ( h OPTa , P , f ) = 0 and same for P ∗ and loss on x (cid:48) .
Hence,
[Equation]
[Equation]
34) where dist H C ( x , x (cid:48) ) ≤ dist H A ( x , x (cid:48) ) since H C ⊆ H A .
Next, we show that these bounds are tight.
That is, there exists an associational model h a whose generalization error on x (cid:48) is exactly the RHS on Eqn.
34 and thus higher than the bound for any causal model.
Below we prove by constructing one such h a .
For simplicity in construction, let us select H C
= { h OPTc , P , h OPTc , P ∗ } and H A
= { h OPTc , P , h OPTc , P ∗ , h OPTa , P , h OPTa , P ∗ } .
Thus dist H C ( x , x (cid:48) )
= 0 whereas dist H A ( x , x (cid:48) ) ≥ 0 .
We obtain the ODE -generalization bound for a causal model,
[Equation]
Let us now construct an associational model, h † a , such that:
[Equation]
A simple construction for the above equalities is to select P and P ∗ , and correspondingly x † and x (cid:48)† such that L x † ( h OPTa , P , f )
=
{+L x (cid:48)† ( h OPTa , P ∗ , f ) = 
 and L x (cid:48)† ( h OPTa , P , h OPTa+} , P ∗ ) > 0 .
Further, h † a can be selected such that L x (cid:48)† ( h † a , h OPTP )
=
and L x † ( h † a , h OPTP ) = 0 .
Then, using Eqn. 36,
[Equation]
(37) where the last equality comes from Eqn. 35.
Combining Eqns.
37 and 33, we obtain,
[Equation]
f ) (38) where the maximum is over x ∈ S and x (cid:48) / ∈ S such that y (cid:48) =
f ( x (cid:48) c ) .
B D IFFERENTIAL P RIVACY G UARANTEES WITH T IGHTER D ATA - DEPENDENT B OUNDS
In this section we provide the differential privacy guarantee of a causal model based on a recent method (Papernot et al., 2017) that provides tighter data-dependent bounds.
We ﬁrst present a Lemma on generalization of causal models and then prove the main result.
As a consequence of Theorem 1, another generalization property of causal models is that the models trained on data from two different distributions P ( X ) and P ∗ ( X ) are likely to output the same value for a new input.
Lemma 3.
Under the conditions of Theorem 1, let h c,P be a causal model trained on distribution
P and let h c,P ∗ be a model trained on P ∗ .
Similarly, let h a,P and h a,P ∗ be correlational models trained on P and P ∗ respectively.
Assume that the correlational and causal models report the same accuracy α .
Then for any new data input x ,
[Equation]
As the size of the training sample N → ∞ , the LHS → 1 .
Proof.
Let h OPTa,P = arg min h ∈H A L P ( h, f ) and similarly let h OPTa,P ∗ =
arg min h ∈H A L P ∗ ( h, f ) be the loss-minimizing hypotheses under these two distributions, where H is the set of hypotheses.
We can analogously deﬁne h OPTc,P and h OPTc,P ∗ .
For a causal model, we know from Theorem 1 that h OPTc,P = h OPTc,P ∗ .
As N → ∞ , each of models on P and P ∗ approach their loss-minimizing functions.
Then, for any input x ,
[Equation]
Under ﬁnite samples, let the accuracy of each model be α .
Then for any new input, the causal models predict the same output if they both match h minc,P = h minc,P ∗ or both do not match.
The probability of this event can be captured by the accuracy of the models: α 2 if both models match h minc,P , and (1 − α ) 2 if they do not.
[Equation]
For correlational models, h OPT a,P (cid:54) =
h OPT a,P ∗ for some x .
For those x , assuming the same accuracy α ,
[Equation]
Since 2 α (1 − α ) ≤ α 2 + (1 − α ) 2 ∀ α ∈ [0 , 1] , we have
Pr( h c,P = h c,P ∗ ) ≥ Pr ( h a,P = h a,P ∗ )
Based on the above generalization property, we now show that causal models provide stronger differential privacy guarantees than corresponding associational models.
We utilize the subsample and aggregate technique (Dwork et al., 2014) that was extended for machine learning in Hamm et al.
(2016) and Papernot et al.
(2017), for constructing a differentiably private model.
The framework considers M arbitrary teacher models that are trained on a separate subsample of the dataset without replacement.
Then, a student model is trained on some auxiliary unlabeled data with the (pseudo) labels generated from a majority vote of the teachers.
Differential privacy can be achieved by either perturbing the number of votes for each class (Papernot et al., 2017), or perturbing the learnt parameters of the student model (Hamm et al., 2016).
For any new input, the output of the model is a majority vote on the predicted labels from the M models.
The privacy guarantees are better if a larger number of teacher models agree on each input, since by deﬁnition the majority decision could not have been changed by modifying a single data point (or a single teacher’s vote).
Since causal models generalize to new distributions, intuitively we expect causal models trained on separate samples to agree more.
Below we show that for a ﬁxed amount of noise, a causal model is (cid:15) c
-DP compared to (cid:15) -DP for a associational model, where (cid:15) c ≤ (cid:15) .
Theorem 3.
Let D be a dataset generated from possibly a mixture of different distributions P ( X , Y ) such that P ( Y | X C ) remains the same.
Let n j be the votes for the jth class from M teacher models.
Let M be the mechanism that produces a noisy max, arg max j { n j + Lap (2 /γ ) } .
Then the privacy budget (cid:15) for a causal model is lower than that for the associational model with the same accuracy.
Proof.
Consider a change in a single input example ( x, y ) , leading to a new D (cid:48) dataset.
Since sub-datasets are sampled without replacement, only a single teacher model can change in D (cid:48) .
Let n (cid:48)
j be the vote counts for each class under D (cid:48) .
Because the change in a single input can only affect one model’s vote, | n j − n (cid:48)
j | ≤ 1 .
Let the noise added to each class be r j ∼ Lap (2 /γ ) .
Let the majority class (class with the highest votes) using data from D be i and the class with the second largest votes be j .
Let us consider the minimum noise r ∗ required for class i to be the majority output under M over D .
Then,
[Equation]
For i to have the maximum votes using M over D (cid:48) too, we need,
[Equation]
In the worst case, n (cid:48) i
= n i − 1 and n (cid:48)
j = n j + 1 for some j .
Thus, we need,
[Equation]
which shows that r i > r ∗ +2 .
Note that r ∗ > r j − ( n i − n j ) .
We have two cases:
CASE I: The noise r j < n i − n j , and therefore r ∗ < 0 .
Writing Pr( i | D (cid:48) ) to denote the probability that class i is chosen as the majority class under D (cid:48) ,
[Equation]
where the equations on the right are due to Laplace c.d.f.
Using the above equation, we can write:
[Equation]
for some (cid:15) > 0 .
As P ( i | D ) =
P ( r i ≥ r ∗ ) increases, the ratio decreases and thus the effective privacy budget ( (cid:15) ) decreases.
Thus, a model with a lower r ∗ (effectively higher | r ∗ | ) will exhibit the lowest (cid:15) .
Below, we show that | r ∗ | is higher for a causal model, and thus P ( r i ≥ r ∗ ) is higher.
Intuitively, | r ∗ | is higher when there is more consensus between the M teacher models since | r ∗ | is the difference between the votes for the highest voted class with the votes for the second-highest class.
Let us consider two causal teacher models h 1 c and h 2 c , and two associational teacher models, h 1 and h 2 .
From Lemma 3, for any new x , and for same accuracies of the models, there is more consensus among causal models.
[Equation]
Hence r ∗ c ≤ r ∗ .
From Equation 47, (cid:15) c ≤ (cid:15) .
CASE II: The noise r j > = n i − n j , and therefore r ∗ > = 0 .
Following the steps above, we obtain:
[Equation]
Thus, the ratio does not depend on r ∗ .
[Equation]
Under CASE II when the noise is higher to the differences in votes between the highest and second highest voted class, causal models provide the same privacy budget as associational models.
Thus, overall, (cid:15) c ≤ (cid:15) .
C I NFINITE S AMPLE ROBUSTNESS TO MEMBERSHIP INFERENCE ATTACKS
Corollary 2.
Let h minc , S be a causal model trained using empirical risk minimization on a dataset
S ∼ P ( X , Y ) with sample size N .
As N → ∞ , membership advantage Adv ( A , h min c , S ) → 0 .
Proof.
h minc , S can be obtained by empirical risk minimization.
[Equation]
As | S | = N → ∞ , h minc , S → h OPTc , P .
Suppose now that there exists another S (cid:48) of the same size such that
S (cid:48) ∼ P ∗ .
Then as | S (cid:48) | → ∞ , h minc , S (cid:48)
→ h OPTc , P ∗ .
From Theorem 1, h OPTc , P = h OPTc , P ∗ .
Thus,
[Equation]
Equation 53 implies that as N → ∞ , the learnt h minc , S does not depend on the training set, as long as the training set is sampled from any distribution P ∗ such that P ( Y | X C )
=
P ∗ ( Y | X C ) .
That is, being the global minimizer over distributions, h minc , S = h OPTc , P does not depend on its training set.
Therefore, h minc , S ( x ) is independent of whether x is in the training set.
[Equation]
[Equation]
where the second last equality follows since any function of h minc , S is independent of the training dataset.
D R OBUSTNESS TO A TTRIBUTE I NFERENCE A TTACKS
In addition to revealing membership in the training set, a model may also reveal the value of individual sensitive features of a test input, given partial knowledge of its features.
For instance, given a training dataset of HIV patients, an adversary may infer other attributes of a person (e.g., genetic information) given that they know their demographics and other public features.
As another example, it can be possible to infer a person’s face based on hill climb on the output score for a face detection model (Fredrikson et al., 2015).
Model inversion is not always due to a fault in learning: a model may learn a true, generalizable relationship between features and the outcome, but still be vulnerable to a model inversion attack.
This is because given (k-1) features and the true outcome label, it is possible to guess the kth feature by brute-force search on output scores generated by the model.
However, inversion based on learning correlations between features, e.g., using some demographics to predict disease, can be alleviated by causal models, since a feature will not be included in a model unless it directly affects the outcome.
Deﬁnition 7 (From Yeom et al.
Let h be a model trained on a dataset D (X,Y).
Let A be an adversary with access to h, and a partial test input x
A ⊂ x .
The attribute advantage of the adversary is the difference between true and false positive rates in guessing the value of a sensitive feature x s / ∈ x A .
For a binary x s ,
Adv
[Equation]
A ,
[Equation]
Theorem 5.
Given a dataset D ( X, Y ) of size N and a structural causal network that connects X to
Y , a causal model h c makes it impossible to infer non-causal features.
Proof.
The proof follows trivially from deﬁnition of a causal model.
h c includes only causal features during training.
Thus, h ( x ) is independent of all features not in X c .
[Equation]
[Equation]
E E XPERIMENTS E. D ATASET D ISTRIBUTION
The target model is trained using the synthetic training and test data generated using the bnlearn library.
We ﬁrst divide the total dataset into training and test dataset in a 60:40 ratio.
Further, the output of the trained model for each of the training and test dataset is again divided into 50:50 ratio.
The training set for the attacker model consists of conﬁdence values of the target model for the training as well as the test dataset.
The relation is explained in Figure 4.
Note that the attacker model is trained on the conﬁdence output of the target models.
E. F INE - GRAINED ATTACK ANALYSIS OF
MODELS . We expand the evaluation of the attack accuracy for a learnt causal model on the Sachs dataset and Akt outcome.
We increment the non-causal features to the learned model in addition to the true causal features.
Table 2 shows the attack and prediction accuracy for this model when trained with the true causal, learned causal model with 1 and 2 non-causal features, and the results for the corresponding DNN model.
[Table]