Towards Measuring Membership Privacy
Yunhui Long Vincent Bindschaedler Carl A. Gunter
cs.CR

 

This work was supported in part by NSF CNS grants 13-30491 and 14-08944. The views expressed are those of the authors only.



  University of Illinois at Urbana-Champaign

ylong4@illinois.edu



	University of Illinois at Urbana-Champaign

bindsch2@illinois.edu



	University of Illinois at Urbana-Champaign

cgunter@illinois.edu


Machine learning models are increasingly made available to the masses through public query interfaces. Recent academic work has demonstrated that malicious users who can query such models are able to infer sensitive information about records within the training data. Differential privacy can thwart such attacks, but not all models can be readily trained to achieve this guarantee or to achieve it with acceptable utility loss. As a result, if a model is trained without differential privacy guarantee, little is known or can be said about the privacy risk of releasing it.

In this work, we investigate and analyze membership attacks to understand why and how they succeed. Based on this understanding, we propose Differential Training Privacy (DTP), an empirical metric to estimate the privacy risk of publishing a classier when methods such as differential privacy cannot be applied. DTP is a measure on a classier with respect to its training dataset, and we show that calculating DTP is efficient in many practical cases. We empirically validate DTP using state-of-the-art machine learning models such as neural networks trained on real-world datasets. Our results show that DTP is highly predictive of the success of membership attacks and therefore reducing DTP also reduces the privacy risk. We advocate for DTP to be used as part of the decision-making process when considering publishing a classifier. To this end, we also suggest adopting the DTP-1 hypothesis: if a classifier has a DTP value above 1, it should not be published. 






























plain
plain

Towards Measuring Membership Privacy
    Carl A. Gunter
    December 30, 2023  File: 
====================================








§ INTRODUCTION



Machine learning models are widely used to extract useful information from large datasets and support many popular Internet services. Companies like Amazon <cit.>, Google <cit.>, and Microsoft <cit.> have started to provide Machine Learning-as-a-Service (MLaaS). Data owners upload their data and obtain black-box access to a classification model which can be queried through an API.

Recent academic work has pointed out several security and privacy issues with this MLaaS paradigm. Models can be stolen or reverse engineered <cit.>, sensitive population-level information can be inferred <cit.>; even the corresponding training datasets can be targeted by inference attacks. In particular, Shokri et al. <cit.> propose a membership attack to infer sensitive information about individuals whose data records are part of the training dataset.

Membership attacks are not new or specific to MLaaS and are known credible threats in various contexts such as in Genome-Wide Association Studies (GWAS) <cit.>. In principle, membership attacks are easily thwarted by ensuring that the model is trained using a differentially private process. Unfortunately, it is not always feasible to use a learning algorithm that satisfies differential privacy. Some classification models cannot readily be trained in this way, or doing so may come at the cost of an unacceptable utility loss.

This issue is exacerbated by the fact that if a classification model is trained without differential privacy, then little is known about its membership privacy risk; there is a gap in our ability to analyze the risk. At the same time, there is no reason to believe that all classification algorithms leak the exact same amount about their training datasets — a model that is badly overfitted has the potential to leak more than one which is not. Yet there is currently no framework or principled way to measure this in practice.

In this paper, we investigate why and how membership inference attacks succeed. We derive a general attack framework and perform experiments on state-of-the-art classifiers trained on real-world datasets. Our goal is to design a metric which reflects membership privacy risk and can easily be calculated on a classifier.

We identify a simple measure called Differential Training Privacy (DTP) which quantifies the risk of membership inference of a record with respect to a classifier and its training data; the higher the DTP value, the higher the risk. We extend DTP to a metric over the classifier, by computing the DTP value of all records in the training dataset and taking the maximum—the worst case risk. DTP is not a substitute for a differentially private learning algorithm. Rather DTP provides an objective basis for decision making. For example, when two classifiers exhibit similar performance, it is preferable to publish the one with the lowest DTP.

Informally, given a classifier 𝒜(T) trained on a dataset T, the membership leakage of a record t ∈ T is quantified by comparing that classifier's predictions to those of a classifier trained without record t, i.e., 𝒜(T∖{t}). We assume black-box access, so an adversary can only learn information by querying the classifier. In this setting, membership attacks are predicated on distinguishing whether the classifier was trained on T or T∖{t}. This is what DTP measures. Differences in predictions can occur for any query, but we initially focus on direct attacks which expect the maximum difference to be observed when querying features of t.

We provide experimental validation of direct attacks on both traditional classifiers such as naive Bayes and logistic regression and state-of-the-art models such as neural networks trained on two real-world datasets: a purchase dataset containing the shopping history of 300,000 individuals, and the popular UCI Adult dataset. Specifically, we perform several membership inference attacks on these classifiers, including the most effective attack known. Results suggest that DTP is a powerful predictor of the accuracy of direct attacks. Concretely, for neural networks learned on the purchase dataset, the Pearson correlation coefficient of the maximum membership attack accuracy with DTP is 0.8936. For classifiers with DTP-values under 0.5, none of the attacks we performed ever inferred membership status of any individual with accuracy greater than 66.5% (baseline: 50%). By comparison our attacks almost always have over 90% accuracy when DTP is larger than 4. 

Although we do not know of any practical indirect attacks—which query the classifier for features other than those of t—we cannot exclude the possibility that such attacks may outperform direct ones. In fact, we produce a counter-example that this is indeed possible. We explore whether this situation occurs for known classification algorithms and derive a set of theoretical results, including a simple criterion (for classifiers) called training stability. For algorithms which satisfy training stability, the direct attack is always superior to any indirect attack. 

Contributions.

We propose Differential Training Privacy (DTP) to quantify membership inference risk of publishing a classifier. DTP is used to inform the decision of whether to release a classifier when techniques to achieve differential privacy cannot be employed. We advocate for the DTP-1 hypothesis: if a classifier has a DTP value above 1, it should not be published. We test this hypothesis by designing effective attacks on records with DTP greater than 1 based on different classifiers and datasets. 

We present a general membership attack framework and evaluate three types of attacks on several classifiers trained on two real-world datasets, including the most effective attack known prior to this work—which we improve upon. Our empirical study of the relationship between the accuracy of membership attacks and DTP, reveals the latter to be a powerful predictor of the former.

We establish training stability as an important desideratum for classifiers, and prove that naive Bayes, random decision trees, and linear statistical queries satisfy it but k-NN does not. 




§ PROBLEM STATEMENT


Consider a data owner with a dataset D. We assume that the dataset is divided into multiple classes and each record in the dataset consists of a class label and a vector of features. We also assume that the data owner randomly partitions the dataset into a training set and a validation set. A machine learning model is trained on the training set. The model captures the correlations between the features and the class labels. It takes a feature vector as input and outputs a vector of probabilities for each class. 

Suppose the data owner wants to make the model available for public queries. That is, he intends to allow anyone to submit a feature vector and get predictions from the model. In this paper, we want to estimate the membership inference risk of releasing the model based on simple measurements and theoretical analysis. Specifically, given a machine learning model, we want to answer the following questions: Is there a privacy risk if the model is open to public queries? Are certain models riskier than others? Which records have higher privacy risks?

We consider the privacy risk in the setting of membership privacy. The privacy risk of a record is estimated by the adversary's ability to infer whether the record is a part of the training set. We estimate this risk under the assumption that the machine learning models are trained by trusted parties. That is, we expect the parties training and releasing the model have the goal of protecting the training set to the extent this is practical and will therefore not be motivated to create a covert channel by embedding private information into the model's predictions. Under this assumption, we inspect the risk of accidental privacy leakage—the risk that a machine learning algoirthm would accidentally learn too much information about an individual record during the training process.  

To estimate privacy risk under a strong adversary, we assume that the adversary knows all the records in D, the size of the training set sampled from D, and the machine learning algorithm used to train the model. We assume the training set to be uniformly sampled from D. Therefore, each record in D is equally likely to be included in the training set, and the adversary does not know which records are included. The goal of the adversary is to perform a membership inference attack by querying the machine learning model. That is, given a particular target record t ∈ D, he wants to infer whether t is used to train the model he queries.  



Notations.
Let T be the training set of the model. Since T is randomly sampled from D, we call D the candidate set for T.


We define X^m to be a set of all possible features and Y to be the set of all possible class labels: {y_1, y_2, …, y_k}. Each record 𝐳∈ D can be divided into two parts: the feature vector 𝐱∈ X^m and the class label y ∈ Y. Let  be the classification algorithm and c = (T) be the output classifier. We assume that for each query 𝐱, c(𝐱) returns a vector of conditional probability of all class labels y ∈{y_1, y_2, …, y_k} given feature vector 𝐱. We use p_c(y |𝐱) to represent the conditional probability of class label y given feature 𝐱, predicted by classifier c. That is, c(𝐱) = (_c(y_1 |𝐱), _c(y_2 |𝐱), …, _c(y_k |𝐱)).
For classifiers that do not directly provide predicted probabilities, these can be obtained through normalization over the class labels.


In membership inferences, the adversary wants to infer whether a specific record t = (𝐱^(t), y^(t)) ∈ D is part of the training set T. We call t the target record of the attack. 

There are two approaches that an adversary can take to perform a membership inference attack on a target record t. He can launch a direct attack by querying the features of the target record 𝐱^(t). Or, he can perform an indirect attack by querying some feature vector 𝐱≠𝐱^(t). Intuitively, a direct attack should have better performance than an indirect attack because querying the features of t should give more information about t compared to querying other features. In this paper, we first study the membership privacy risk under this assumption. In section <ref>, we test this assumption by analyzing some commonly used classifiers. 




§ BACKGROUND ON MEMBERSHIP ATTACKS



In this section, we briefly review the membership attacks proposed in prior work <cit.>. In a membership attack, an adversary is given black-box access to a target classifier (T) and wants to infer whether a particular record t is included in the training set T. 

The membership attack proposed by Shokri et al. <cit.> is a direct attack. The adversary queries the target record t and uses the target classifiers' predictions on t to infer the membership status of t. The authors transform the membership attack into a classification task. For each record t, there are two possible classes: class label “in” represents that the record is in the training set, and class label “out” represents that the record is not in the training set. The features in the membership classification task are the original attributes of t and the target classifier's predictions on t. The adversary trains an attack classifier for the membership classification task and uses it to infer the membership of a target record. 



To create training sets for the membership classification task, the authors introduce “shadow” training techniques. Concretely, the adversary trains multiple “shadow models” using the same machine learning algorithm  on records sampled from the same population as T. These shadow models are used to simulate the behavior of the target model and generate a set of training records with labeled membership information. Specifically, the adversary queries each shadow model with two sets of records: the training set of the shadow model and a disjoint test set. For each record, a new feature vector is generated by concatenating the record's original attributes with the shadow classifier's predictions on that record. A new class label is created to reflect membership, i.e., “in” for records in the training set, “out” for records in the test set. 

Using the labeled dataset, the adversary trains a neural network as “attack” classifier and uses it to infer the membership of a target record t, given black-box access to a classifier (T).

In this paper, we reproduce this membership attack and design two new membership attacks based on shadow training techniques. One of the new membership attacks has much better performance compared to the attack proposed in <cit.>. We use these attacks to validate DTP's ability to measure the membership privacy risk of a target record t with respect to a classifier (T).






























§ MEASURING MEMBERSHIP PRIVACY




 §.§ Understanding Membership Attacks


In a membership attack on a classifier c = (T), an adversary tries to infer whether a target record t = (𝐱^(t), y^(t)) is in the training set of c. The adversary can submit any query 𝐱 and analyze the returned results 𝐪 = c(𝐱). With some background knowledge about the behavior of the classification algorithm and the candidate dataset D, an adversary can estimate the following two conditional probabilities: [ t ∈ T | c(𝐱) = 𝐪] and [t ∉ T | c(𝐱) = 𝐪], which he uses to infer whether t is a member of the training set.

The accuracy of a membership attack depends on two properties. First, it depends on the adversary's ability in correctly estimating [ t ∈ T | c(𝐱) = 𝐪] and [t ∉ T | c(𝐱) = 𝐪]. An adversary with a stronger background knowledge has more accurate estimates and thus obtains higher accuracy. Second, it depends on the properties of the target record t, the training dataset T, and the classification algorithm . Intuitively, a membership attack will have higher accuracy on overfitted classifiers because these capture statistical peculiarities of the training dataset that do not generalize to the whole population. Also, outliers may be more vulnerable to membership attacks. 

Based on this intuition, we want to estimate the membership attacks risk by measuring the generalizability of a classifier. Specifically, we calculate the maximum change in a classifier's predictions when the target record is removed from the training set.



 §.§ Differential Training Privacy

We propose a measure of membership privacy risk of a target record t with respect to classification algorithm  and training set T.


  
A record t ∈ T is ϵ-differentially training private (ϵ-DTP) with respect to classification algorithm  and training set T, if for all 𝐱∈ X^m and y ∈ Y, we have 

    p_(T)(y |𝐱) ≤e^ϵ p_(T ∖{t})(y |𝐱)

and 

    p_(T)(y |𝐱) ≥e^-ϵ p_(T ∖{t})(y |𝐱).



That is, the target record t is DTP with algorithm  and training set T if the predicted conditional probability of any class label y given any feature vector 𝐱 does not change much when t is removed from T. By definition, a record t with low DTP only has a small influence on the output of the classifier (T). Since a classifier's output is also influenced by other factors such as random initialization and unexpected records in the training set, from the adversary's perspective, the small influence by t is indistinguishable from the influence by other uncertain factors. Therefore, records with low DTP are less vulnerable to membership inference attacks. 

Unlike differential privacy <cit.>, DTP is a local property related to the training set. Therefore, DTP is experimentally measurable given a target record t, a training set T, and a classification algorithm . We use the following definition of DTP metric to quantify the privacy risk of the target record t. 


(DTP Metric).
Given classification algorithm , training set T, and target record t, the differential training privacy metric _,T(t) is the least ϵ such that t is ϵ-DTP with  and T.


In practice, _,T(t) is calculated as the maximum ratio between the predictions given by (T) and (T ∖{t}) for all 𝐱∈ X^m and for all y ∈ Y. That is,

_,T(t) = 

  𝐱 ∈X^m,  y ∈Y 
 
maxϵ_t^(𝐱,y),

where

ϵ_t^(𝐱,y) = max( p_(T)(y |𝐱)/p_(T ∖{t})(y |𝐱),  p_(T ∖{t})(y |𝐱)/p_(T)(y |𝐱)).


_,T(t) can be naively measured by brute force over all 𝐱∈ X^m and all y ∈ Y. However, considering the potentially large size of X^m, this approach is neither practical nor efficient. Therefore, we propose pointwise differential training privacy (PDTP) as a relaxation of DTP.

 
(Pointwise Differential Training Privacy). 
A record t ∈ T is ϵ-pointwise differentially training private (ϵ-PDTP) with respect to classification algorithm  and training dataset T, if for all y ∈ Y, we have 

    p_(T)(y |𝐱^(t)) ≤e^ϵ p_(T ∖{t})(y |𝐱^(t))

and 

    p_(T)(y |𝐱^(t)) ≥e^-ϵ p_A(T ∖{t})(y |𝐱^(t)).



Similarly we propose the following definition for the metric (, T):

(PDTP Metric).
Given classification algorithm , training set T, and target record t ∈ T, the pointwise differential training privacy metric _,T(t) is the least ϵ such that t is ϵ-PDTP with  and T.


PDTP is a relaxation of DTP which bounds the change of the classifier's response on a single query 𝐱^(t), when t is removed from the training set. Because of this, PDTP can be efficiently calculated given any classification algorithm , training set T, and target record t by training an alternative classifier (T ∖{t}). This process is similar to the leave-one-out (LOO) cross-validation technique used in machine learning <cit.>. Since LOO is a core technique for evaluating a machine learning model, there is considerable experience with both learning algorithms for which its calculation is easier and optimizations to improve this performance. 

The measurement _,T(t) is useful for two different reasons: First, _,T(t) is a lower bound of _,T(t). When _,T(t) cannot be efficiently calculated, data owners can use _,T(t) as an optimistic estimation of a classifier's privacy risk. If a target record 
t has high  with  and T, releasing the classifier (T) brings high privacy risks for t. Therefore, PDTP can be used as an indicator of membership privacy risk. Second, PDTP reflects the performance of a direct membership attack. When the adversary uses c(𝐱^(t)) to infer the membership of t, it is sufficient to bound the change of c(𝐱^(t)) when t is removed from the training set of c. Since we assume direct membership attacks have better performance than indirect ones, _,T(t) is a good estimation of membership privacy risk of t. In Section <ref>, we demonstrate the usefulness of PDTP measurements by showing their correlations with the performance of different types of direct membership attacks. 




§ CASE STUDIES



DTP measures the sensitivity of a target record t on the predictions of a classifier (T). Intuitively, the larger t's influence on the predictions of (T) is, the more these predictions leak about t. This, in turn, makes t more vulnerable to membership inference attacks. However, to use DTP to calculate the membership risk, we still need to answer the following: How do we use PDTP to estimate the risk of membership attacks? How accurate are these estimations? What values of PDTP indicate a potential privacy risk?

In this section, we answer these three questions through a series of experiments on direct membership attacks. 

To demonstrate 's effectiveness in measuring risks of membership attacks, we study the performance of three types of direct membership attacks on different datasets and classification algorithms. We find that, when a membership inference attack is effective, i.e., the attack accuracy is greater than 0.7, _,T(t) is highly correlated with the attack's accuracy on t, and the correlation is higher for attacks with higher accuracy. 

To identify high-risk records, we use the DTP-1 hypothesis: if a classifier has a DTP value above 1, it should not be published. Since PDTP is a lower bound for DTP, we use PDTP measurements to identify records that do not satisfy DTP-1 criterion and demonstrate effective membership attacks on these records. 



 §.§ Datasets


We first introduce datasets used in the experiments.

UCI Adult Dataset (Adult). The dataset <cit.> contains 48,842 records extracted from the 1994 Census Database. Each record has 14 attributes with demographic information such as age, gender, and education. The class attribute is the income class of the individual: >50K or <=50K. The classification task is to predict an individual's income class based on his demographic information. We use all the features except the final weight (fnlwgt) attribute, which is a weight on the Current Population Survey (CPS) file used for accurate populations estimates. We randomly sample 2,000 records as candidate set D, and 1,000 records out of D as training set. 

Purchase Dataset (Purchase). Similar to the purchase dataset in <cit.>, we construct a dataset containing user's purchase history based on Kaggle's “acquire valued shoppers” challenge. The original contains the user's transaction histories, including product category, product brand, purchase quantity, purchase amount, etc. We pre-process the dataset by constructing one record for each customer. We use the product category attribute in the original dataset to create 836 binary feature attributes. Each feature attribute is a product category (e.g., sparkling water), and the value of the attribute is true if and only if the corresponding customer has purchased this product in the past year. We cluster the dataset into 10 clusters using k-means based on Weka's implementation <cit.>. Each cluster represents a type of consumer buying behavior. We use the cluster index of each record as its class label. The classification task is to predict a consumer's buying behavior based on products he has purchased. We randomly sample 2,000 records as candidate set D, and 1,000 records out of D as training set. 



 §.§ Machine Learning Models


We study the performance of membership attack and PDTP measurements on three different machine learning models. 

Neural Networks (NN). We build a fully connected neural network with one hidden layer of 64 units and a  layer. We use  as the activation function and negative log-likelihood criterion as the classification criterion. We use a learning rate of 0.01 for both datasets. 
The maximum epoch of training is set to 100 for the adult dataset and 30 for the purchase dataset. When preprocessing the adult dataset, we convert categorical attributes into binary attributes and normalize all the numerical attributes. 

Naive Bayes Classifiers (NB). We build a Naive Bayes classifier <cit.> to predict the class label based on Bayes Theorem under the assumption of conditional independence. We use Laplace smoothing <cit.> to smooth the categorical attributes in the dataset. 

Logistic Regressions (LR). We build a logistic regression model using Weka's implementation of Logistic model trees <cit.>. 





  
Binning the Predictions. We limit the precision of the model outputs using data binning technique with a bin size of 0.01. Since the outputs of the classifiers are probabilities in the range of [0,1], we divide this range into 100 bins of the same size. Instead of returning the original output of a classifier, we make the model return the center of the bin to which the original output belongs. For example, if a classifier predicts a class label to have 0 probability given a feature vector, the output of the classifier would be 0.005, which is the center of the first bin. This binning technique prevents models from leaking private information that does not significantly contribute to their accuracy. It also prevents PDTP measurements from getting unreasonably large due to close-to-zero denominators.



 §.§ Attacks


Given a target classifier c = (T) and a target record t, a membership attack distinguishes between the following hypotheses:

    H_0:   t ∉ T          and          H_1:   t ∈ T  .









In all of the following attacks, we assume that the adversary gets the target classifier's prediction on the target record c(𝐱^(t)) = (_c(y_1 |𝐱^(t)), _c(y_2 |𝐱^(t)), …, _c(y_k |𝐱^(t))), and tries to launch a membership attack on t using this information. We also assume the adversary is powerful enough to know the size of training set T and has access to the candidate dataset D and the classification algorithm  based on Kerckhoffs's principle. 

Let q_i = _c(y_i |𝐱^(t)) (1 ≤ i ≤ k). Here, q_i represents the class probability for class label y_i predicted by the target classifier given the features of the target record. Therefore, the vector 𝐪 = c(𝐱^(t)) = (q_1, q_2, …, q_k) can be viewed as a probability distribution over all the possible class labels. 

Untargeted Attacks. We reproduce the membership attack of <cit.> on a neural network model learned on the purchase dataset. This attack converts the membership inference problem into a classification task with two class labels: class label “in” represents hypothesis H_1 (t ∈ T), and class label “out” represents hypothesis H_0 (t ∉ T). Concretely, the attack consists of two steps:

Step 1: Training Shadow Classiffiers. The adversary trains shadow classifiers to simulate the behavior of the target classifier (T). First, he samples M shadow datasets T_1, T_2, …, T_M of the same size as the target dataset T. Then, he trains M shadow classifiers (T_1), (T_2), …, (T_M) using the same classification algorithm as the target classifier (T). In experiments, we take M=20.

Step 2: Building the Attack Classifier. The adversary uses the shadow classifiers to label each record in the candidate dataset D according to Algorithm <ref>. The algorithm takes the shadow classifiers and the candidate dataset as input and outputs a dataset D_ attack, which serves as the training set for the attack classifier. 

boxruled


In experiments, the attack classifier is a fully connected neural network with one hidden layer of 32 units and a  layer. We use  as activation function and negative log-likelihood criterion as classification criterion. We set the learning rate to 0.01 and the maximum epochs of training to 30 iterations. 

Step 3: Launching the Attack. Given a target record t, the adversary constructs a new feacture vector by concatenating the original feature vector 𝐱^(t), the original class label y^(t), and the target model's prediction on the target record c(𝐱^(t)). That is,

    𝐟_ attack^(t) = (𝐱^(t),y^(t), c(𝐱^(t)) ).


The adversary queries the attack classifier with the new feature vector and gets a prediction consisting of two probabilities: p_ in is the probability of class label “in”, and p_ out is the probability of class label “out”. The advesary accepts hypothesis H_1 if, and only if, p_ in > p_ out. 

We call this type of attack an untargeted attack because the attack classifier obtained from step 2 can be used to attack all the records in the candidate dataset. Therefore, when the adversary tries to attack multiple records, he only needs to run step 1 and step 2 once. Step 3 of the attack, which needs to be repeated on each targeted record, has much lower computational overhead. Although this attack is more efficient when the adversary wants to find out any vulnerable records, it has lower accuracy compared to some of the targeted attacks. 

Distance-Based Targeted Attacks. When the adversary has a specific target record in mind, he can design attacks tuned to perform well only on the target record. We call this type of attacks targeted attacks. In a distance-based targeted attack, an adversary uses shadow models to estimate the average predictions of classifiers satisfying hypothesis H_0, and those of classifiers satisfying hypothesis H_1. Then he calculates the distance between c(𝐱) and the two average predictions and accept the hypothesis under which the average predictions are closer to c(𝐱). Concretely:



Step 1: Training Shadow Classifiers.
Let n = | T |. The adversary uniformly samples M datasets T'_1, T'_2, …, T'_M of size n-1 from D ∖{t}, and takes T_j = T'_j ⋃{t} for all 1 ≤ j ≤ M. The adversary trains a pair of shadow classifiers (T_j), (T'_j) for all 1 ≤ j ≤ M, and gets their predictions on the target record:

    𝐩^ in_j = ( _(T_j)(y_1 |𝐱), _(T_j)(y_2 |𝐱), …, _(T_j)(y_k |𝐱) ),

and

    𝐩^ out_j = ( _(T'_j)(y_1 |𝐱), _(T'_j)(y_2 |𝐱), …, _(T'_j)(y_k |𝐱) ).

Take 𝐩_ in = 1/M∑_j=1^M𝐩^ in_j and 𝐩_ out = 1/M∑_j=1^M𝐩^ out_j. Like the query result 𝐪, 𝐩_ in and 𝐩_ out can be viewed as two probability distributions over all the possible class labels. 



Step 2: Comparing KL-Divergence.
The KL-Divergence <cit.> between two distributions P and Q is defined to be

    PQ = ∑_i p_i logp_i/q_i.

The adversary infers the membership of t by comparing 𝐪's KL-Divergence to 𝐩_ in and 𝐩_ out, and accepts hypothesis H_1 if, and only if, 𝐪𝐩_ out > 𝐪𝐩_ in.

In the experiment, we take M = 5. That is, for each target record t, we sample 5 datasets and train 10 shadow classifiers. 5 of the shadow classifiers are trained with t in the training set, and the other 5 are trained without t in the training set. 

Frequency-Based Targeted Attacks. In a frequency-based targeted attack, the adversary trains the same shadow models as in the distance-based membership attack. However, instead of calculating the average of the predictions, the adversary counts the frequency that the predictions of classifiers satisfying hypothesis H_0 fall into the same bins as c(𝐱) as well as the frequency that the predictions of classifiers satisfying hypothesis H_1 fall into the same bins as c(𝐱). The adversary accepts the hypothesis under which predictions more often fall into the same bin as c(𝐱). 

The first step of a frequency-based targeted attack is the same as the distance-based targeted attack. The adversary trains 2m shadow classifiers, m of which with t in training set. In the second step, for 1 ≤ i ≤ k, the adversary calculates o_i^in as the number of shadow models that are trained with t in training set and gives the same predicted probability on class label y_i as the target dataset. Similarly, o_i^out is calculated as the number of shadow models that are trained without t in the training set and gives the same predicted probability on class label y_i as the target dataset.

Finally the adversary estimates the following ratio:

    [ t ∈ T | c(𝐱) = 𝐪]/[ t ∉ T | c(𝐱) = 𝐪] = ∏_i = 1^ko_i^ in/o_i^ out.

The adversary accepts hypothesis H_1 iff [ t ∈ T | c(𝐱) = 𝐪]/[ t ∉ T | c(𝐱) = 𝐪] > 1. 

Like for the distance-based membership attack, we take M=5 in the experiment and train 10 shadow models for each target record. 







 §.§ Evaluation Metrics




Multiple Iterations of Attacks. 
To evaluate their performance, we run 100 iterations of each membership attack. In each iteration, we partition the candidate set into two equal-sized parts: D_1 and D_2. First, we use D_1 as training set and D_2 as test set. A target classifier (D_1) is trained on the training set and available for public queries. We randomly select 100 records out of D as the adversary's target records. For each target record t, we run a targeted attack with (D_1) as target classifier. In each membership attack, the goal of the adversary is to predict whether t ∈ D_1 by querying (D_1). Then, we switch the role of D_1 and D_2, and use D_2 as the training set and D_1 as test set. We then repeat the membership attack with (D_2) as target classifier. This process ensures that the target record occurs once in the training set and once in the test set in each iteration so that the baseline accuracy is always 0.5. Since we can only calculate PDTP of a record t when t is in the training set, we measure the PDTP of t as _,D_1(t) if t ∈ D_1 and as _,D_2(t) if t ∈ D_2. Hence, in each iteration, we launch two membership attacks and get one PDTP measurement for each record in D based on definition <ref>. We repeat this process for 100 iterations. Ideally, one should calculate a record's average PDTP over 100 PDTP measurements. However, PDTP measurements over multiple datasets contain redundant information. As shown in figure <ref>, average PDTP taken over 10 measurements has approximately the same correlation with performance of membership inference attacks as average PDTP taken over 100 measurements. Therefore, to save time, we only take PDTP measurements in the first 10 iterations. For each target record, we use the average of its 10 PDTP measurements to estimate its overall membership risk.

Per-Target Attack Accuracy. 
We want to analyze the privacy risk of each record in D separately. That is, instead of looking at the membership attack accuracy on each training set, we are interested in the overall attack accuracy on a single record over the 200 membership attacks. Therefore, we propose per-target attack accuracy on a record t as the adversary's proportion of correct membership inference on t over all the attacks performed on t. For example, in the experiment, we launch 200 membership attacks on each record in D. Therefore, the per-target attack accuracy of a record is the number of correct membership inferences on that record divided by 200. 





 §.§ Results



Comparison of Different Attacks.
First, we compare the performance of three membership attacks on neural networks trained on the purchase dataset. We train 200 neural network models over different training sets sampled from the same candidate set and use them as the target classifiers for membership attacks. All the target classifiers are overfitted to their training sets. The average training accuracy of all the target classifiers is 1, and the average test accuracy of all the target classifiers is 0.6434.

Figures <ref>, <ref>, and <ref> show the per-target accuracy and average PDTP of each target record under three types membership attacks. Each point represents one target record in the candidate set. The horizontal axis is the average PDTP measurement of that target over 10 iterations of PDTP measurements. The vertical axis is the per-target accuracy of that target over 200 repetitions of membership attacks. A point's position on the horizontal axis shows its membership privacy risk estimated by PDTP. According to PDTP measurements, points on the right part of the figures have higher membership privacy risks compared to points on the left part of the figures. A point's position on the vertical axis shows its actual membership privacy risk under a given membership attack. Points on the top part of the figures are more vulnerable to the attack because the attack has higher accuracy on these records. 

For each attack, we calculate the Pearson correlation coefficient between average PDTP and the per-target attack accuracy. We also calculate the p-value for testing the hypothesis of no correlation against the alternative hypothesis that there is a correlation between average PDTP and per-target attack accuracy. Table <ref> shows the performance of each membership attack and their correlation coefficients with average PDTP. The performance of all three attacks has statistically significant correlations with the average PDTP. Figure <ref> shows the accuracy of three types of membership attacks and their correlations with PDTP (ρ). We observe that attacks with higher accuracy also have higher correlation PDTP measurements. This correlation demonstrates PDTP's ability to identify potential membership privacy risks effectively. 

Overall, distance-based targeted attacks have the highest accuracy. They outperform the untargeted attacks in the previous work <cit.> by approximately 19%. However, some records are more vulnerable to some types of membership attacks. For example, one record in the purchase dataset is immune to distance-based membership attacks which only achieve baseline accuracy, whereas the untargeted attack achieves accuracy of 0.94. This example demonstrates the insufficiency of estimating privacy risks based on one type of attack. Even a strong attack may fail to identify some of the vulnerabilities that can be used by other attacks. Figure <ref> shows the maximum per-target accuracy among three membership attacks. The Pearson correlation coefficient between the maximum accuracy and PDTP measurements is 0.8936. This is very strong correlation. Among all records with PDTP greater than 1, 84.62% of them have maximum per-target accuracy higher than 0.8, and all of them have maximum per-target accuracy higher than 0.6. This result supports the DTP-1 hypothesis that classifiers with DTP above 1 should not be published.



Privacy Risks of Different Models and Datasets.
To compare the privacy risks of different datasets and classifiers, we use PDTP measurements on NN, NB, and LR classifiers learned on the adult and purchase datasets. We use distance-based membership attack because it has higher overall accuracy. Table <ref> shows the performance of each target model, the per-target accuracy of membership attacks, and its correlation with PDTP measurements. 



The results of membership attacks on NB and LR models trained on the purchase dataset are shown in Figure <ref> and Figure <ref>. Both of the two classifiers have records with PDTP higher than 1, and most of these records are vulnerable to distance-based membership attacks. The accuracy of the attacks is highly correlated with PDTP measurements. 



The results of membership attacks on NN, NB, and LR models trained on the adult dataset are shown in Figure <ref>, Figure <ref>, and Figure <ref>. Unlike the purchase dataset, the adult dataset has fewer classes and features which help improve the generalizability of models learned on this dataset. The training and test accuracy reflects good generalizability of all three models learned on the adult dataset. The distance-based membership attacks also have worse performance on the adult dataset, indicating better membership privacy. However, even if the average PDTP measurement is relatively low for all three models, the PDTP for some records is greater than 1 with the neural network model learned on the adult dataset indicating high membership privacy risk. This risk is also reflected by the high per-target accuracy of distance-based membership attack on some of the records with high PDTP. Therefore, good generalizability is not always sufficient for protecting membership privacy. It is possible that a model is not overfitted on the training set, but still captures some private information of some records in the training set. However, this privacy risk can be discovered by measuring PDTP for each record in the training set. 

For NB and LR models trained on the adult dataset, we did not find any records with PDTP greater than 1, and the per-target attack accuracy of the distance-based attack is smaller than 70% for all target records. This result shows that state-of-art membership inference attacks do not work well on these models, and the PDTP measurements do not indicate high privacy risk for any of the records. The correlations between PDTP measurements and per-target attack accuracy is lower compared to attacks with better performance.

Multiple PDTP Measurements.
In the previous experiments, for each target t, we use the average of 10 PDTP measurements on t to estimate the PDTP of t over all the target classifiers. To study how the number of PDTP measurements influence our estimation of the membership privacy risk of t, we take the Naive Bayes classifier trained on the purchase dataset as the target model perform a distance-based membership attack. We gradually increase the number of PDTP measurements from 1 to 100 and calculate the average PDTP's correlation with the accuracy of membership attacks. Figure <ref> shows that the correlation between average PDTP and accuracy of membership attacks increases as we increase the number of PDTP measurements. The correlation coefficient stabilizes after around 10 measurements. 







§ PROTECTIONS AGAINST INDIRECT MEMBERSHIP ATTACKS



In this section, we investigate the risk of indirect membership attacks where the adversary queries the classifier for features other than the target record.



 §.§ Risk


In the previous experiments, we assume that the best way of doing a membership attack is to launch a direct attack by querying the target record. However, is it possible that, for some classifier c, there exists a query 𝐱≠𝐱^(t) so that c(𝐱) leaks more private information than c(𝐱^(t))? That is, can an indirect membership attack outperform any direct membership attacks? Although it is hard to design a good indirect membership attack for classifiers discussed in Section <ref>, this risk of indirect membership attacks can be demonstrated with a carefully designed classifier that encodes membership information of one specific record. 

Let c = (T) be a classifier learned on a training set T with machine learning algorithm . Instead of releasing c, we construct a classifier c^* as follows: 

    c^*(𝐱) = 
    	
    	c(𝐱)          𝐱≠0
    1         𝐱 = 0     t ∈ T 
    0         𝐱 = 0     t ∉ T.


Assume 𝐱^(t)≠0, apparently, an indirect membership attack with query 𝐱 = 0 gives more information about the target t compared to a direct membership attack with query 𝐱^(t). This example shows that for some classifiers, indirect attacks can outperform direct attacks for some records. Therefore, a record can have high membership privacy risk even if its PDTP measurement is low. 

Clearly, c^* is not representative of a real-life machine learning model, especially when the model is trained by the data owner who wants to protect against privacy leakage. However, to achieve a stronger privacy guarantee, we need to study the potential risk of indirect membership attacks and prevent models from leaking “side channel” information about records in their training sets.



 §.§ Training Stability



To protect against indirect membership attacks, we need a way of calculating _,T(t) without the need of brute forcing the whole feature space X^m. Since we can already efficiently calculate _,T(t), a natural approach is to bound _,T(t) based on _,T(t). We call this property training stability. 


(Training Stability)
A classification algorithm  is δ-training stable on dataset T if there exists a constant δ > 1, so that for all t ∈ T with p_A(T ∖{t})(y^(t)|𝐱^(t)) > 0 and  p_A(T)(y^(t)|𝐱^(t)) > 0, for all 𝐱∈ X^m, for all y ∈ Y, let

γ_t = max(δ,p_(T)(y^(t) |𝐱^(t))/p_A(T ∖{t})(y^(t) |𝐱^(t)), p_(T ∖{t})(y^(t) |𝐱^(t))/p_A(T)(y^(t) |𝐱^(t))),

we have 

p_(T)(y |𝐱) ≤γ_t p_A(D ∖{t})(y |𝐱),

and

p_(T)(y |𝐱) ≥γ_t^-1p_A(D ∖{t})(y |𝐱).



Given an algorithm that is δ-training stable on T, for all t ∈ T, the ratio between the predictions of two classifiers (T) and (T ∖{t}) is bounded either by the ratio between their predictions on the query (𝐱^(t), y^(t)) or by a parameter δ.

If an algorithm  is δ-training stable on T, _, T(t) can be calculated by measuring _,T(t), which is much more efficient.



If a record t ∈ T is ϵ-PDTP with classification algorithm  and dataset T, and  is δ-training stable on T, we have t
is ϵ'-DTP with  and T, where ϵ' = max(ϵ, lnδ).



See Appendix <ref>.


On the one hand, δ-training stability is a desirable property from a privacy perspective because it reduces the computational cost of estimating the influence of an individual record on the learned classifier. On the other hand, δ-training stability is also a metaphor of learning in real life. For example, If a professor explains an example question in class, he expects the students to do well on similar questions in the exam. If the exam contains a question that is the same as the example question explained in class, most students are expected to answer it correctly. Similarly, suppose we have a classifier (T ∖{t}) and an additional record t. By adding t into the training dataset, we expect the classifier to have better performance on t or records similar to t. This can be viewed as a metaphor of learning in real life. 



 §.§ Training Stability of Classifiers

With the aforementioned intuitions in mind, we study the training stability of some commonly used classifiers. However, due to the complexity and variability of different machine learning algorithms, we cannot cover all well-known classifiers in this section. Table <ref> shows the training stability of some commonly used classifiers. 

Bayes Inference Classifiers. 
For a Bayes inference classifier (T), the prediction p_(T)(y |𝐱) is given by the conditional probability of class label y given feature vector 𝐱 in the training dataset T. 



Bayes inference algorithm is δ-training stable for δ = 4/3 on any training dataset.


See Appendix <ref>.


Naive Bayes Classifiers. 

Naive Bayes classifiers make predictions using Bayes theorem and assume conditional independence <cit.>. 



Let T be a training dataset with m features and n examples. Let y_min be the least supported class label in T.  Let n_y_min be the number of examples with class label y_min.  Naive Bayes algorithm is δ-training stable for 

δ= (n_y_min/n_y_min - 1)^m-1 n/n - 1.



See Appendix <ref>.


If T is a large training dataset, there would be a large number of training examples with class label y_min. Therefore, δ would be close to 1 for a large dataset T, and the maximum ratio between predictions of (T) and (T ∖{t}) is determined by the ratio between their predictions on the query (𝐱^(t), y^(t)).

Naive Bayes classification is often used with Laplace smoothing <cit.>. When conditional probabilities are estimated from the training dataset, a small constant is added to both the numerator and denominator to get a "smoothed" version of the prediction. The constant is determined by the number of possible values for each attribute. Suppose each attribute in 𝐱 has at most v possible values. When calculating the conditional probability of an attribute given the class label, the numerator is increased by 1, and the denominator is increased by v. Therefore, naive Bayes classification algorithm with Laplace smoothing is δ-training stable with a slightly different δ compared to the original naive Bayes classification.


Let T be a training dataset with m features and n examples. Suppose each element in the feature vector has at most v possible values. Let y_min be the least supported class label in T.  Let n_y_min be the number of examples with class label y_min.  Naive Bayes with Laplace smoothing is δ-training stable on T for 

δ= (n_y_min + v/n_y_min)^m-1 n/n - 1.



Linear Statistical Queries Classifiers. 
Linear statistical queries (LSQ) classifiers are proposed as a generalization framework for naive Bayes, Bayesian network, and Markov models <cit.>. 

Let χ : X^m→{0,1} be a feature function that maps a feature vector into a binary value. This representation is useful for features depending on more than one element in 𝐱 (for example, χ(𝐱) = 1 iff x_1 =1 and x_2 = 1). A statistical query P̂_[χ, y]^T gives the probability of all the examples with feature χ(𝐱) = 1 and class label y in the training dataset. 

A linear statistical queries (LSQ) classifier is a linear discriminator over the feature space, with coefficients calculated by statistical queries. For the convenience of discussion, we review the following definition of LSQ classifier for binary classification:

Let 𝒳 be a class of features. Let f_[χ, y] be a function that depends only on the values P̂_[χ,y]^T for χ∈𝒳. A linear statistical queries (LSQ) hypothesis predicts y ∈{0,1} given 𝐱∈ X^m  when 

y = y ∈{0,1}max ∑_χ∈𝒳 f_[χ,y](P̂_[χ,y]^T)χ(𝐱).



We define a family of log coefficient functions ℱ_log that contains all the functions f_[χ,y] that calculate the log of a probability or conditional probability in the training dataset. For example, suppose  is a naive Bayes classification algorithm with m feature attributes.  can be written as an LSQ classification algorithm with m features: χ_0 ≡ 1, and χ_j = x_j for 1 ≤ j ≤ m, where

f_[χ_0,y](P̂_[χ_0,y]^T) = logP̂_[1,y]^T,

and for 1 ≤ j ≤ m,

f_[χ_j,y](P̂_[χ_j,y]^T) = logP̂_[x_j,y]^TP̂_[1,y]^T.

f_[χ_0,y] is a log function of the prior probability of y, and f_[χ_j,y] is a log function of the conditional probability of x_j given y. Therefore, the coefficient functions for naive Bayes belong to the family of log coefficient functions. Similarly, log coefficient functions are also used in Bayes network and Markov model. 

When f_[χ,y]∈ℱ_log, the sum of f_[χ,y] is equivalent to the product of the corresponding probabilities. Therefore, in addition to returning the most likely label, an LSQ classifier (T) is also a probabilistic classifier that returns the following predicted probability:

    p_(T)(y |𝐱)    = e^χ∈𝒳∑ f_[χ,y]({P̂_[χ,y]^T})χ(𝐱)
       =∏_χ∈𝒳 e^f_[χ,y]({P̂_[χ,y]^T})χ(𝐱).


Each term e^f_[χ,l]({P̂_[χ,l]^T})χ(𝐱) in Equation (<ref>) is equivalent to calculating a probability or a conditional probability in the training dataset T using Bayes inference, therefore is 4/3-training stable according to proposition <ref>. Consequently, we have the following proposition for LSQ probabilistic classification algorithms:


If  is an LSQ probabilistic classification algorithm with f_[χ,y]∈ℱ_log for all χ∈𝒳, y ∈ Y,  is δ-training stable on any training dataset with δ = (4/3)^|𝒳|. 


For naive Bayes classification algorithm, since each attribute is an independent feature, with M-1 feature attributes, |𝒳| equals M . Compared to proposition <ref>, proposition <ref> provides a looser but more generalized bound on δ-training stability for naive Bayes classification algorithm. This bound does not depend on the records in the training dataset T. For Bayesian network and Markov models, |𝒳| equals to the layer of dependencies in the network. |𝒳| gets larger when the network structure gets more complicated.



Decision Trees.
Some decision trees, such as ID3 and C4.5, construct the structure of the tree by calculating information gain of each potential partition of attributes<cit.>. This approach makes achieving δ-training stability difficult because when an example is removed from the training dataset, it is hard to predict its influence on the structure of the tree. For example, removing one example may change the splitting point with the highest information gain, so that the structure of (T) and (T ∖{t}) are completely different. 

However, when the structure of a decision tree is independent of its training dataset, its prediction is equivalent to the conditional probability of y given a subset of attributes determined by the leaves of the tree. Therefore, a single decision tree with structure independent of its training dataset is 4/3-training stable. 

A random decision tree classifier is a classifier constructed by aggregating K randomly generated decision trees with structures independent of the training dataset<cit.>. Random decision trees have better privacy properties because the structure of the trees do not leak private information about the training set. Previous work has shown that a large amount of noise is needed to make ID3 differentially private while it is more practical to achieve differential privacy for a random decision tree <cit.>.

If the predictions of the random decision tree classifier is aggregated in a way that preserves the training stability, the random decision tree classifier is also training stable.


Let _K be a random decision tree classification algorithm with K randomly generated decision trees. Given a query (𝐱,y), let _1(y |𝐱), _2(y |𝐱), …, _K(y |𝐱) be the predictions given by each random decision tree. _K is ( 4/3)-training stable, if it computes the prediction as follows:

_(T)(y |𝐱) = e^1/K∑_j = 1^Klog(_j(y |𝐱)).



See appendix <ref>.


k-Nearest Neighbors.
k-nearest neighbors (k-NN) classification<cit.> is an instance-based learning algorithm. Instead of constructing a model from the training dataset, all examples in the training dataset are saved and all computations are deferred until classification. When responding to a query (𝐱,y), predictions are made by approximating locally from a few examples close to  the query. Unlike the aforementioned classifiers, k-NN is not training stable for any δ.

For simplification, suppose  is a 1-nearest neighbor classification algorithm. Let (𝐱^(t), y^(t)), (𝐱_1,y_1) and  (𝐱_2, y_2)  be three examples in a training dataset. (𝐱_1,y_1) is the nearest neighbor of (𝐱^(t), y^(t)) when t itself is not in the training dataset. Let (𝐱', y') be a point whose nearest neighbor in the training dataset is (𝐱^(t), y^(t)) and second nearest neighbor is (𝐱_2, y_2). Suppose y^(t) = y_1=y' ≠ y_2. When t ∈ T, the classifier (T) will predict the class label as y^(t) for both features 𝐱^(t) and 𝐱'. When t is removed from the training dataset, the classifier (T ∖{t}) will still predict the class label as y^(t) for feature 𝐱^(t) because of point (𝐱_1,y_1). However, (T ∖{t}) will predict the class label for 𝐱' as y_2 since it is closest to (𝐱_2, y_2) when (𝐱^(t), y^(t)) is removed. Consequently, when t is removed from the training dataset, the prediction for t remains unchanged, but the prediction for a neighboring point (𝐱',y') is greatly influenced. If we calculate the probability given by the classifier, we have 

p_(T)(y' |𝐱') = 1  and   p_(T ∖{t})(y' |𝐱') = 0,

while

p_(T)(y^(t) |𝐱^(t))/p_(T ∖{t})(y^(t) |𝐱^(t)) = 1.

As k increases, the probability of the aforementioned case drops. However, there is always a possibility that, when an exampled t is removed from the training dataset T, for some queries (𝐱,y), the prediction p_(T)(y |𝐱) drops from 1 to 0, while the prediction p_(T)(y^(t)|𝐱^(t)) remains unchanged. Therefore, k-nearest neighbors classification algorithm is not training stable.s



 §.§ An Upper Bound on DTP

For non-training stable classifiers or classifiers with unknown training stability, the DTP metric cannot be directly calculated based on PDTP measurements. However, it is still possible to estimate an upper bound for DTP based on Lipschitz conditions. 

Given a classification algorithm , the set of possible classifiers learned by  can be abstracted as a class of functions {C_u, u ∈𝒰}, where u ∈𝒰 is a d-dimensional vector that specifies the trainable parameters in the classifier and 𝒰⊆ℝ^d.  Without loss of generality, we assume that C_u maps a feature vector 𝐱 to a vector of predicted log probabilities of each class labels y ∈ Y. That is, C_u(𝐱) = (log p_(T)(y_1 |𝐱), log p_(T)(y_2 |𝐱), …, log p_(T)(y_k |𝐱) ). 

We assume that for all 𝐱∈ X^m, C_u(𝐱) is L-Lipschitz bounded under infinity norm with respect to u. That is, | C_u(𝐱) - C_u'(𝐱) |_∞≤ L | u - u' |_∞. Based on Lipschitz condition, to calculate (,T), it is enough to measure the change of model parameters when one training example is removed. 

Let u_T be the model parameters learned on dataset T and u_T ∖{t} be the parameters learned on T ∖{t}. The following theorem gives an upper bound of (,T):
 

If (T) is an L-Lipschitz bounded classifier, then _,T(t) is upper bounded by L ·max_t ∈ T| u_T - u_T ∖{t}|_∞.



See Appendix <ref>.








§ RELATED WORK


Works on re-identification attacks <cit.> have demonstrated the privacy risks of releasing anonymized datasets. Releasing highly-reidentifiable datasets allows an attacker to infer sensitive attributes of individuals in these datasets. In these studies, the researchers collect background knowledge containing nonsensitive attributes from external sources, and use them to re-identify records with sensitive attributes in the anonymized datasets. In DTP, we make similar assumptions on the background knowledge, but instead of publishing the anonymized dataset, we assume that only the classification model learned on the dataset is published. We demonstrate that publishing a classification model learned from a highly-reidentifiable dataset can also bring high privacy risks. 

To protect against re-identification, syntactic privacy metrics like k-anonymity <cit.>, l-diversity <cit.>, and t-closeness <cit.> purports to measure the privacy risk of an anonymized dataset. These metrics reflect properties of a dataset, whereas DTP reflects the property of the combination of a classification algorithm and a dataset. 

Differential privacy (DP) <cit.>  guarantees privacy protection against an attacker with precise knowledge about the input dataset and all the entities in the universe except for the target individual. Follow-up works on DP try to relax the background knowledge by building more realistic background knowledge models <cit.>. Most of these relaxations can be unified under the framework of membership privacy <cit.>, which shows that protecting private information is equivalent to preventing an attacker from knowing whether an individual is included in the input dataset. Specifically, DP is shown to be equivalent to membership privacy with mutually independent distributions. Other extensions on DP enhances protections on outliers in a data set while relaxes protections on the remaining examples <cit.>. Similar to DP, these privacy definitions cannot be directly calculated given a data set and an algorithm. DTP is different with them in terms that it can also be used as a privacy metric. 

DP has been widely applied to complete privacy preserving machine learning tasks with different machine learning algorithms such as regression <cit.>, SVM <cit.>, principal component analysis <cit.>, empirical risk minimization <cit.>, and deep learning <cit.>. These privacy-preserving machine learning algorithms achieve DP by adding noises to either the objective function or the output parameters. A non-randomized machine learning algorithm cannot be ϵ-DP or ϵ-PMP for any ϵ. DTP gives a possible way to measure the privacy risk of these non-randomized machine learning algorithms. 

Attacks on machine learning models have shown the possibility of inferring sensitive information about a model's training set with black-box access to the model. For example, model inversion attacks <cit.> and naive attacks <cit.> infer sensitive attributes of a record based on the model's predictions on that record; membership inference attacks <cit.> infer whether a record is included in the training set of the model. Moreover, if the adversary colludes with the party that provides the training algorithm, he can embed sensitive information, including membership information, in the predictions of the models <cit.>. All these attacks can be summarized under the framework in <cit.>. DTP extends this line of work by studying the unintentional leakage of membership information. We emprically estimate the risk of membership inference attacks under the assumption that the adversary only has black-box access to the model and does not control the training algorithm. 

The connections between DP and overfitting is first pointed by the paper on the reusable hold out method <cit.>. The paper applies DP on the validation dataset to make it possible for the validation dataset to be reused, without the risk of overfitting. This demonstrates the possibility of using privacy preserving techniques to prevent overfitting. DTP makes this connection from the opposite direction: using cross validation techniques in overfitting prevention to measure the privacy risks. 



§ REDUCING DTP


According to the DTP-1 hypothesis, it is unsafe to release a classifier if any record in its training set has DTP greater than 1. However, what should the data owner do if only a small number of records in the training dataset violate this hypothesis? It is unsafe to release the classifier since it contains records vulnerable to membership inference attacks using techniques like those in Section <ref>. But it is natural to ask: Can removing high-risk records from the training set mitigate the membership privacy risk? The interesting answer is sometimes yes and sometimes no!

Let us consider a specific example of how removing high-risk records can influence DTP. The examples in Section <ref> are not ideal because the classifiers trained on the adult dataset already have low privacy risks, while the classifiers trained on the purchased dataset are so risky that they are unlikely to be mitigated by simple mechanisms. We therefore consider a fresh example that fails to satisfy DTP-1, but not by much. To do this we train a naive Bayes classifier on the 2013 American Community Survey (ACS) dataset. This dataset has similar attributes as the adult dataset since the adult dataset was sampled and cleaned from the 1994 Census dataset. We restrict to four attributes: Age (AGEP), Marital Status (MAR), Race (RAC1P), and Gender (SEX). As we did with the adult dataset, we use the salary class (>50K or ≤ 50K) as the class attribute. We use all 1.6 million records as our training set. The DTP of the full dataset is 3.09, indicating vulnerability to membership inference attacks.

To reduce the DTP in the dataset, we perform the following simple experiment: First, we measure DTP of each record in the training set and sort all the records in the decreasing order of their DTP measurements. Intuitively, the records are sorted in the decreasing order of their (initial) privacy risks. Next, we remove these high-risk records from the training set one at a time. After each record is removed, we re-calculate the DTP of all records remaining in the training set and estimate the resulting privacy risk as the highest DTP in this reduced training set. Figure <ref>

shows the change of maximum DTP in the training set when these high-risk records are removed. Removing the record with the highest risk reduces the highest DTP in training set from 3.09 to 0.65, greatly reducing the classifier's vulnerability to membership attacks and achieving DTP-1. However, one must not get greedy and think that removing the next individual will reduce the risk even further. Doing this takes the DTP back to around 3. Why? Because, unlike the first individual removed, this second record apparently is needed to decrease another record's influence on the target classifier. Indeed, removing further individuals appears to lead to collections of individuals that rely on each other to keep DTP down. Their successive removal creates the sawtooth pattern seen in Figure <ref>. Based on this observation, we recommend removing high-risk examples as a way of reducing DTP and mitigating against membership attacks when only a few examples in the training set have high privacy risks. Better understanding of how to reduce DTP is a promising target for future research.




§ DISCUSSION


In this section, we discuss a few interesting points related to DTP.

Difference between DTP and DP.

When feasible, using differential privacy during training is a good strategy to mitigate the risk of publishing the model.

However, there are cases when differential privacy cannot be used; either because there is no appropriate training mechanism or because the data owner cannot afford to add noise to their models (e.g., in the medical domain). 
Therefore, we need a strategy to estimate the privacy risk of the model when no privacy protections are added. 
Note that even when differential privacy is used, DTP can still be used to estimate the privacy risks before applying differential privacy. With the DTP measurements, the data owner can understand how much he benefits from using differential private mechanisms. This information helps balance the trade-off between utility and privacy.

Unlike DP, DTP is a privacy metric instead of a privacy protection mechanism. When a machine learning model does not satisfy differential privacy for any ϵ, little is known about its privacy risk. However, the metric _,T(t) outputs a value of ϵ for any target record t and any any classifier (T). 

Difference between DTP and Membership Attacks.
In Section <ref>, we show that DTP measurements correlate with the accuracy of different membership attacks. However, the measurement of DTP cannot be replaced by running a series of membership attacks. First, it is computationally inefficient to simulate all possible membership attacks. Moreover, no matter how much computational power a data owner has, there may always exist an adversary with superior computational capability. Second, we cannot rule out the possibility that the adversary knows a stronger a membership attack than the data owner. As demonstrated in section <ref>, a record immune to the distance-based membership attack can be vulnerable to another attack—even a weaker one, overall. Therefore, using a general privacy metric like DTP to estimate membership privacy is preferable.

Privacy Risks of Non-Training Stable Classifiers.
In Section <ref>, we prove that naive Bayes, random decision trees, and linear statistical queries satisfy training stability but k-NN provably does not. However, we do not know whether classifiers such as neural networks and SVMs are training stable. We leave the task of investigating this question for future work.

Remark that although measuring DTP is computationally infeasible for non-training stable models, this does not mean that DTP metrics are useless for these models. Indeed, as shown in Section <ref> PDTP measurements have high correlations with direct membership attacks. The drawback for non-training stable algorithms is their potential vulnerability to indirect membership attacks. As future work, we plan to study indirect membership attacks and ways to mitigate them.


Although DTP doesn't provide a theoretical privacy guarantee like DP, we find that it is highly correlated with the performance of state-of-the-art membership inference techniques. Unlike DP, which bounds the change in the probability of observing an output when a record is removed, DTP bounds the magnitude of the difference caused by removal of a record. In practice, if the magnitude of this difference is small, it is indistinguishable from the difference caused by other uncertain factors from the adversary's perspective. When attacking machine learning models, these are at least two sources of uncertainty.

First, in models like neural networks, some parameters such as weights are initialized randomly. Different initialization states may cause the model to be converged to different local optimals, so models trained on the same dataset can give slightly different predictions on the same record. If a record's DTP is small enough to be indistinguishable from the difference caused by random initialization, the record has little privacy risk. Figure <ref> shows the variation in model prediction caused by random initialization. In the experiment, we train 100 neural network models on the same training set with 10000 records uniformly sampled from the UCI Adult dataset. We calculate each model's prediction on two individuals and plot the histogram of the predicted probability that the individual has annual salary greater than 50K. 



Second, besides the target record, the adversary is also uncertain about what other records are included in the training dataset. The occurrence of unexpected training records can introduce small variations in the model's predcitions. If a record's DTP is small enough to be indistinguishable from the variation caused by random sampling, the target has little privacy risk. Figure <ref> shows the variation in model prediction caused by random sampling. In the experiment, we train 100 classifiers on 100 different training datasets uniformly sampled from the same population. We calculate each model's prediction on two individuals and plot the histogram of the predicted probability that the individual has annual salary greater than 50K. 








§ OPEN QUESTIONS


Experimental results suggest that DTP is a good predictor of the performance of state-of-art membership inference attacks. However, it remains an open question if records with low DTP are always safe from membership inference attacks. In this section, we discuss two potential privacy risks for low-DTP records.


DTP-1 Hypothesis.
In this paper, we use the DTP-1 hypothesis as guidance to identify records and classifiers with high privacy risk. By experimenting with state-of-art membership inference attacks on machine learning models, we find that when a training record only has a very small influence on the prediction of a classifier, this small influence is likely to be indistinguishable from the variation in prediction due to random sampling of the training records or random initialization of the weight vectors before training. We use DTP-1 hypothesis as a rule-of-thumb for determining whether the influence of a training record is smaller than the influence of other factors unknown to the adversary, such as randomization in the training algorithm and existence of unexpected records in the training set. However, in practice, even when DTP is smaller than 1, the influence of these uncertain factors can be smaller than the influence of the training record. Therefore, satisfying the DTP-1 hypothesis cannot guarantee that records with DTP smaller than 1 have no privacy risks. With a better understanding on the adversary's background knowledge and the influence of randomness in machine learning algorithms, it may be possible to determine a finer threshold for a safe DTP.


Risk of Indirect Attacks and Multiple Queries.
PDTP measures the privacy risk of directly querying the target record. Based on experimental validations, we find that training records with low PDTP are less likely to be vulnerable to direct attacks. However, models that are not training stable have a potential of leaking the record's membership information through other queries, and an adversary may use this information to perform an indirect attack. Although we do not know of any practical indirect attacks, it remains an open question to analyze the training stability of some machine learning models and to design indirect attacks for models that are not training stable.

Another challenge is to analyze the risk of allowing an adversary to get predictions of multiple queries from the same machine leanrning model. DTP measures the privacy risk for a single query. However, if an adversary is allowed to query the target model multiple times, he may accumulate more information about the target record t. We leave for future work the study of how this accumulation of information can be used to design stronger membership inference attacks. Specifically, there are two open questions: (1) How do we select multiple queries whose results indicate the membership of a target record? (2) How do we estimate an upper bound on the accuracy of membership inference when an adversary can submit unlimited number of queries to the model?




§ CONCLUSIONS


In this work, we propose differential training privacy (DTP) as an empirical metric to estimate the privacy risk of publishing a classifier. DTP estimates the privacy risk of a training record by measuring its influence on the predictions of machine learning models. A large DTP indicates that the record's influence is strong enough to indicate its presence in the training dataset. We measure DTP of popular machine learning models including neural networks, Naive Bayes, and logistic regressions. We compare these measurements with the accuracy of different types of membership inference attacks, including the most effective one in prior works. Experimental results demontrate that DTP is both efficient and effective in estimating privacy risks. Specifically, our attacks have at most 66.5% accuracy (baseline: 50%) on classifiers with DTP-values under 0.5 and almost always over 90% accuracy on classifiers with DTP larger than 4. Based on these results, we propose DTP-1 hypothesis as a rule-of-thumb criterion for publishing a classifier: if a classifier has a DTP value above 1, it should not be published. 

Although DTP has a high correlation with the accuracy of a membership attack, it provides no guarantee about a record's privacy protection. Specifically, we propose two potential privacy leakages for records with low DTP. First, a low-DTP record is vulnerable to membership inferences when the model's predictions on it are unlikely to be influenced by other records or random initializations. Second, the membership of a low-DTP record might be leaked by indirect queries or the combination of multiple queries. This observation can serve as a new direction for designing stronger membership inference attacks and defenses. 

acm








§ PROOFS





Since (,T) is ϵ-PDTP, for all t ∈ T, we have

	p_(T)(y^(t) |𝐱^(t)) ≤e^ϵ p_(T ∖{t})(y^(t) |𝐱^(t))

and

	p_(T)(y^(t) |𝐱^(t)) ≥e^-ϵ p_(T ∖{t})(y^(t) |𝐱^(t)).

Since  is δ-training stable on T, for γ = max(δ, e^ϵ), we have

p_(T)(y |𝐱) ≤γp_(T ∖{t})(y |𝐱)

and

p_(T)(y |𝐱) ≥γ^-1 p_(T ∖{t})(y |𝐱).

Let ϵ ' = ln(γ) = max(ln(δ), ϵ), then

p_(T)(y |𝐱) ≤e^ϵ' p_(T ∖{t})(y |𝐱)

and

p_(T)(y |𝐱) ≥e^-ϵ' p_(T ∖{t})(y |𝐱).

Therefore, (,T) is ϵ '-DTP.



Let T' = T ∖{t}.  Let (T)  and (T') be two Naive Bayes classification models separately learned on dataset T and T', and N be the number of records in T. We use n_𝐱, y to represent the number of records with the feature vector 𝐱 and the class label y, and use n_𝐱 to represent the number of records in T with feature vector 𝐱.
For all 𝐱∈ X^m, for all y ∈ Y, so that n_𝐱,y > 1 and n_𝐱 > 1, we have

p_(T)(y |𝐱) = n_𝐱,y/n_𝐱.

When 𝐱≠𝐱^(t),

    p_(T ∖{t})(y |𝐱) = p_(T)(y |𝐱).

When 𝐱 = 𝐱^(t) and y ≠ y^(t),

p_(T ∖{t})(y |𝐱^(t)) = n_𝐱^(t),y/n_𝐱^(t) - 1.

Therefore,

    p_(T)(y |𝐱^(t))/p_(T ∖{t})(y |𝐱^(t)) = n_𝐱^(t) - 1/n_𝐱^(t) < 1.

When 𝐱 = 𝐱^(t) and y = y^(t),

p_(T ∖{t})(y^(t) |𝐱^(t)) = n_𝐱^(t),y^(t) - 1/n_𝐱^(t) - 1.

Therefore,


p_(T)(y^(t) |𝐱^(t))/p_(T ∖{t})(y^(t) |𝐱^(t)) 
   = n_𝐱^(t),y^(t)/n_𝐱^(t) (n_𝐱^(t),y^(t)-1/n_𝐱^(t)-1)^-1 

   = n_𝐱^(t),y^(t)n_𝐱^(t) - n_𝐱^(t),y^(t)/n_𝐱^(t),y^(t)n_𝐱^(t) - n_𝐱^(t).



Since

n_𝐱^(t),y^(t) ≤n_𝐱^(t),

we have

    p_(T)(y^(t)|𝐱^(t))/p_(T ∖{t})(y^(t)|𝐱^(t))≥ 1.


From equations <ref>, <ref>, and <ref>, we have for all 𝐱∈ X^m, for all y ∈ Y,

p_(T)(y |𝐱)/p_(T ∖{t})(y |𝐱) ≤p_(T)(y^(t) |𝐱^(t))/p_(T ∖{t})(y^(t) |𝐱^(t)). 
Therefore, it suffices to prove

p_(T)(y |𝐱)/p_(T ∖{t})(y |𝐱) ≥(max( 4/3, p_(T)(y^(t) |𝐱^(t))/p_(T ∖{t})(y^(t) |𝐱^(t))))^-1,

which is equivalent to

n_𝐱^(t)/n_𝐱^(t) -1  ≤max(4/3, n_𝐱^(t),y^(t)/n_𝐱^(t),y^(t) - 1n_𝐱^(t) - 1/n_𝐱^(t)).

Let a = n_𝐱^(t),y^(t) and b = n_𝐱^(t). Then a < b.
By solving

b/b-1 > b-1/ba/a-1,

we get

b > a + √(4a(a-1))/2.

Let b^* = ⌈ a + √(4a(a-1))/2⌉, then b^*_min = 4. Since b/b-1 is a decreasing function of b, when b/b-1 > b-1/ba/a-1, we have

b/b-1 ≤b^*_min/b^*_min-1 = 4/3.

Therefore,

n_𝐱^(t)/n_𝐱^(t) -1  ≤max(4/3, n_𝐱^(t),y^(t)/n_𝐱^(t),y^(t) - 1n_𝐱^(t) - 1/n_𝐱^(t)).

Bayes inference algorithm is 4/3-training stable.



Let T' = T ∖{t}. Let (T)  and (T') be two Bayesian classification models separately learned on dataset T and T', and N be the number of records in T.  For simplification, we use (x_i | y) and '(x_i | y) to represent the conditional probability that the i-th feature equals to x_i given the class label equals y in T and T', and use (y) and '(y) to represent probability that the class label equals y in T and T'. We use n_x_i, y to represent the number of records with the i-th feature x_i and the class label y, and use n_y to represent the number of records in T with label y.

According to the conditional independence assumption of Naive Bayes, we have

    (y |𝐱)/'(y |𝐱) = ∏_i=1^m(x_i | y) (y)/∏_i=1^m'(x_i | y) '(y) = ∏_i=1^m(x_i | y)/'(x_i | y)(y)/'(y).


First, we prove that

    (y^(t)|𝐱^(t))/'(y^(t)|𝐱^(t))≥ 1.

Since '(y^(t)|𝐱^(t)) > 0, based on Equation <ref>, we have '(x^(t)_i | y^(t)) > 0, and '(y) > 0.

    (x^(t)_i | y^(t))/'(x^(t)_i | y^(t))
    =    n_x^(t)_i, y^(t)(n_y^(t)-1)/n_y^(t)(n_x^(t)_i, y^(t)-1)
    
    =    n_x^(t)_i, y^(t)n_y^(t) - n_x^(t)_i, y^(t)/n_x^(t)_i, y^(t)n_y^(t) - n_y^(t).

Since

    n_x^(t)_i, y^(t)≤ n_y^(t),

we have

    (x_i^(t)| y^(t))/'(x_i^(t)| y^(t))≥ 1.

Similarly

    (y)/'(y) =    (y^(t))/'(y^(t))
    =    n_y^(t)N - n_y^(t)/n_y^(t)N - N≥ 1.

Therefore,

    (y^(t)|𝐱^(t))/'(y^(t)|𝐱^(t))
    = ∏_i=1^m(x_i^(t)| y )/'(x_i^(t)| y)(y^(t))/'(y^(t))≥ 1.


Next, we prove that Naive Bayes classification algorithm is δ-training stable on T, for

    δ = (n_y_min/n_y_min - 1)^m-1n/n - 1.

We start with the case when y ≠ y^(t).
Since, n_x_i, y and n_y does not change after the removal of d, we have

    (x_i | y)/'(x_i | y) = 1.

And,

    (y)/'(y)
    =    n_y/n(n_y/n-1)^-1
    = n-1/n.

Therefore, when  y ≠ y^(t)

    (y |𝐱)/'(y|𝐱)
    =    ∏_i=1^m(x_i| y)/'(x_i | y)(y|𝐱)/'(y|𝐱)
    =    n-1/n< 1.

According to equation <ref>, we have

    (y |𝐱)/'(y|𝐱)
    < (y^(t)|𝐱^(t))/'(y^(t)|𝐱^(t)).

Since

    n-1/n > (n_y_min - 1/n_y_min)^m-1n-1/n≥δ^-1,

we have

    δ^-1 < (y |𝐱)/'(y|𝐱) < (y^(t)|𝐱^(t))/'(y^(t)|𝐱^(t)).

We then consider the case when y = y^(t).

When x_i = x_i^(t),

    (x_i | y^(t))/'(x_i | y^(t)) =  (x_i^(t)| y^(t))/'(x_i^(t)| y^(t))≥ 1.

When x_i ≠ x_i^(t),

    (x_i | y^(t))/'(x_i | y^(t)) = n_y^(t)-1/n_y^(t) < 1.

According to Equation <ref>, we have

    (x_i | y^(t))/'(x_i | y^(t))  = n_y^(t)-1/n_y^(t) < (x_i^(t)| y^(t))/'(x_i^(t)| y^(t)).

Therefore,

    (y^(t)|𝐱)/'(y^(t)|𝐱)   = ∏_i=1^m(x_i | y^(t))/'(x_i | y^(t))(y^(t))/'(y^(t))
       ≤∏_i=1^m(x_i^(t)| y^(t))/'(x_i^(t)| y^(t))(y^(t))/'(y^(t))
       =  (y^(t)|𝐱^(t))/'(y^(t)|𝐱^(t)).

From Equation <ref> and <ref>, we have

    ∏_i=1^m(x_i | y^(t))/'(x_i | y^(t))≥(n_y^(t)-1/n_y^(t))^m

Since

    (y^(t))/'(y^(t)) = n_y^(t) (n-1)/n(n_y^(t) - 1) = n_y^(t)/n_y^(t) - 1n-1/n,

we have

    (y^(t)|𝐱)/'(y^(t)|𝐱)   = ∏_i=1^m(x_i | y)/'(x_i | y)(y^(t))/'(y^(t))
       ≥(n_y^(t)-1)/n_y^(t))^m-1n-1/n
       ≥δ^-1.

Hence,

    δ^-1≤(y^(t)|𝐱)/'(y^(t)|𝐱)≤(y^(t)|𝐱^(t))/'(y^(t)|𝐱^(t)).

Let γ = max(δ,(y^(t)|𝐱^(t))/'(y^(t)|𝐱^(t))), then

    γ^-1≤(y |𝐱)/'(y|𝐱)≤γ.




Let '_1(y |𝐱), '_2(y |𝐱), …, '_k(y |𝐱) be the predictions given by each random decision tree learned on T ∖{t}. Then for 1 ≤ k ≤ K, we have

_k(y |𝐱)/'_k(y |𝐱) ≤max(4/3,_k(y^(t) |𝐱^(t))/'_K(y^(t) |𝐱^(t)))

Therefore,


_(T)(y |𝐱)/_(T ∖{t})(y |𝐱)
=    (∏_k = 1^K_k(y |𝐱)/'_k(y |𝐱) )^1/K 

≤    max(4/3, _(T)(y^(t) |𝐱^(t))/_(T ∖{t})(y^(t) |𝐱^(t)) )





According to Lipschitz condition, for all 𝐱∈ X^m, for all t ∈ T, we have

| C_u_T(𝐱) - C_u_T^-t(𝐱) |_∞ ≤L | u_T - u_T^-t |_∞ ≤ϵL.

That is, for all y ∈ Y,

| logp_(T)(y |𝐱) - logp_(T ∖{t})(y |𝐱) | ≤ϵL. 

Therefore, for all 𝐱∈ X^m, for all y ∈ Y, 

e^-ϵL ≤p_(T)(y |𝐱) /p_(T ∖{t})(y |𝐱) ≤e^ϵL .

That is, for all t ∈ T,

DTP_,T(t) ≤ϵ·L . 



