arXiv(opens in a new tab)Computer ScienceOct 2016Cited by 8 papers on PaperVantage

Manuscript Offprint

arXiv:1610.05820

Membership Inference Attacks Against Machine Learning Models

R. Shokri, M. Stronati, Congzheng Song, Vitaly Shmatikov

Abstract

We quantitatively investigate how machine learning models leak information about the individual data records on which they were trained. We focus on the basic membership inference attack: given a data record and black-box access to a model, determine if the record was in the model’s training dataset. To perform membership inference against a target model, we make adversarial use of machine learning and train our own inference model to recognize differences in the target model’s predictions on the inputs that it trained on versus the inputs that it did not train on.

We empirically evaluate our inference techniques on classification models trained by commercial “machine learning as a service” providers such as Google and Amazon. Using realistic datasets and classification tasks, including a hospital discharge dataset whose membership is sensitive from the privacy perspective, we show that these models can be vulnerable to membership inference attacks. We then investigate the factors that influence this leakage and evaluate mitigation strategies.

I Introduction

Machine learning is the foundation of popular Internet services such as image and speech recognition and natural language translation. Many companies also use machine learning internally, to improve marketing and advertising, recommend products and services to users, or better understand the data generated by their operations. In all of these scenarios, activities of individual users—their purchases and preferences, health data, online and offline transactions, photos they take, commands they speak into their mobile phones, locations they travel to—are used as the training data.

Internet giants such as Google and Amazon are already offering “machine learning as a service.” Any customer in possession of a dataset and a data classification task can upload this dataset to the service and pay it to construct a model. The service then makes the model available to the customer, typically as a black-box API. For example, a mobile-app maker can use such a service to analyze users’ activities and query the resulting model inside the app to promote in-app purchases to users when they are most likely to respond. Some machine-learning services also let data owners expose their models to external users for querying or even sell them.

Our contributions. We focus on the fundamental question known as membership inference: given a machine learning model and a record, determine whether this record was used as part of the model’s training dataset or not. We investigate this question in the most difficult setting, where the adversary’s access to the model is limited to black-box queries that return the model’s output on a given input. In summary, we quantify membership information leakage through the prediction outputs of machine learning models.

To answer the membership inference question, we turn machine learning against itself and train an attack model whose purpose is to distinguish the target model’s behavior on the training inputs from its behavior on the inputs that it did not encounter during training. In other words, we turn the membership inference problem into a classification problem.

Attacking black-box models such as those built by commercial “machine learning as a service” providers requires more sophistication than attacking white-box models whose structure and parameters are known to the adversary. To construct our attack models, we invented a shadow training technique. First, we create multiple “shadow models” that imitate the behavior of the target model, but for which we know the training datasets and thus the ground truth about membership in these datasets. We then train the attack model on the labeled inputs and outputs of the shadow models.

We developed several effective methods to generate training data for the shadow models. The first method uses black-box access to the target model to synthesize this data. The second method uses statistics about the population from which the target’s training dataset was drawn. The third method assumes that the adversary has access to a potentially noisy version of the target’s training dataset. The first method does not assume any prior knowledge about the distribution of the target model’s training data, while the second and third methods allow the attacker to query the target model only once before inferring whether a given record was in its training dataset.

Our inference techniques are generic and not based on any particular dataset or model type. We evaluate them against neural networks, as well as black-box models trained using Amazon ML and Google Prediction API. All of our experiments on Amazon’s and Google’s platforms were done without knowing the learning algorithms used by these services, nor the architecture of the resulting models, since Amazon and Google don’t reveal this information to the customers. For our evaluation, we use realistic classification tasks and standard model-training procedures on concrete datasets of images, retail purchases, location traces, and hospital inpatient stays. In addition to demonstrating that membership inference attacks are successful, we quantify how their success relates to the classification tasks and the standard metrics of overfitting.

Inferring information about the model’s training dataset should not be confused with techniques such as model inversion that use a model’s output on a hidden input to infer something about this input [17] or to extract features that characterize one of the model’s classes [16]. As explained in [27] and Section IX, model inversion does not produce an actual member of the model’s training dataset, nor, given a record, does it infer whether this record was in the training dataset. By contrast, the membership inference problem we study in this paper is essentially the same as the well-known problem of identifying the presence of an individual’s data in a mixed pool given some statistics about the pool [21, 29, 15, 3]. In our case, however, the goal is to infer membership given a black-box API to a model of unknown structure, as opposed to explicit statistics.

Our experimental results show that models created using machine-learning-as-a-service platforms can leak a lot of information about their training datasets. For multi-class classification models trained on 10,000-record retail transaction datasets using Google’s and Amazon’s services in default configurations, our membership inference achieves median accuracy of 94%94\% and 74%74\%, respectively. Even if we make no prior assumptions about the distribution of the target model’s training data and use fully synthetic data for our shadow models, the accuracy of membership inference against Google-trained models is 90%90\%. Our results for the Texas hospital discharge dataset (over 70% accuracy) indicate that membership inference can present a risk to health-care datasets if these datasets are used to train machine learning models and access to the resulting models is open to the public. Membership in such datasets is highly sensitive.

We discuss the root causes that make these attacks possible and quantitatively compare mitigation strategies such as limiting the model’s predictions to top kk classes, decreasing the precision of the prediction vector, increasing its entropy, or using regularization while training the model.

In summary, this paper demonstrates and quantifies the problem of machine learning models leaking information about their training datasets. To create our attack models, we developed a new shadow learning technique that works with minimal knowledge about the target model and its training dataset. Finally, we quantify how the leakage of membership information is related to model overfitting.

References (70)