{'fraction_non_alphanumeric': 0.02586422064145763, 'fraction_numerical': 0.007924622488456259, 'mean_word_length': 4.874816715542522, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Knowledge-Enriched Distributional Model Inversion Attacks

Model inversion (MI) attacks are aimed at reconstructing training data from model parameters. Such attacks have triggered increasing concerns about privacy, especially given a growing number of online model repositories. However, existing MI attacks against deep neural networks (DNNs) have large room for performance improvement. We present a novel inversion-specific GAN that can better distill knowledge useful for performing attacks on private models from public data. In particular, we train the discriminator to differentiate not only the real and fake samples but the soft-labels provided by the target model. Moreover, unlike previous work that directly searches for a single data point to represent a target class, we propose to model a private data distribution for each target class. Our experiments show that the combination of these techniques can significantly boost the success rate of the state-of-the-art MI attacks by 150%, and generalize better to a variety of datasets and models. Our code is available at https://github.com/SCccc21/Knowledge-Enriched-DMI.


Introduction
Many attractive applications of machine learning techniques involve training models on sensitive and proprietary datasets. One major concern for these applications is that models could be subject to privacy attacks and reveal inappropriate details of the training data. One type of privacy attacks is MI attacks, aimed at recovering training data from the access to a model. The access could either be black-box or white-box. In the blackbox setting, the attacker can only make prediction queries to the model, while in the whitebox setting, the attacker has complete knowledge of the model. Given a growing number of online platforms where users can download entire models, such as Tensorflow Hub 2 and ModelDepot 3 , whitebox MI attacks have posed an increasingly serious threat to privacy.
Effective MI attacks have been mostly demonstrated on simple models, such as linear models, and low-dimensional feature space [1,2]. MI attacks are typically cast as an optimization problem that seeks for the most likely input examples corresponding to a target label under the private model. When the target model is a DNN, the underlying attack optimization problem becomes intractable and solving it via gradient methods in an unconstrained manner will end in a local minimum that contains meaningless pixel patterns. Previous MI attack models like [3] explore the idea of distilling a generic prior from potential public data via a GAN generator and using it to guide the inversion process. For instance, to attack a face recognition classifier trained on private face images, one can train a GAN with public face datasets to learn generic statistics of real face images and then solving the attack optimization over the latent space of the GAN rather than in an unconstrained ambient space.
However, there still exists a large room to improve the attack performance. For instance, the top-one identification accuracy of face images inverted from the state-of-the-art face recognition classifier is 45%. A natural question is: Is the underperformance of MI attacks against DNNs because DNNs do not memorize much about private data or it is simply an artifact of imperfect attack algorithm design? This paper shows that it is the latter.
We reveal a variety of drawbacks associated with the the current MI attacks against DNNs. Particularly, we notice that the previous state-of-the-art approach suffers from the two key limitations: 1) The information about private classifier is not sufficiently explored for distilling knowledge from public data. Previous works ignore the important role of the target classifier in adapting the knowledge distilled from the public data for training the MI attack model on the target classifier. Indeed, given a target classifier to attack, we can also use its output labels to distill which public data are more useful in inverting the target model to recover the private training examples of the given labels. 2) Prior works made a simplified one-to-one assumption in recovering a single example for a given label of the target model. However, in real scenarios, inverting a model should naturally result in a distribution of training examples corresponding to the given label. This inspires us to recover a data distribution in the MI attack in line with such a many-to-one assumption.
To address the first limitation, we propose to tailor the training objective of the GAN to the inversion task. Specifically, for the discriminator, we propose to leverage the target model to label the public dataset and train the discriminator to differentiate not only the real and fake samples but also the labels. This new training scheme will force the generator to retain image statistics that are more relevant to infer the classes of the target model, which are likely to occur in the unknown private training data. To overcome the second limitation, we propose to explicitly parameterize the private data distribution and solve the attack optimization over the distributional parameters. Moreover, this will lead us to explore a distribution in which each point with large probability mass will achieve a good attack performance. We perform experiments on various datasets and network architectures and show that such a distributional MI attack by distilling public-domain knowledge tailored for private labels can significantly improve the previous state-of-the-art attack against DNNs, even when the public data have no overlap with the private labels of the target network.
The paper is organized as follows. In Section 2 we introduce the related work on model inversion attacks. In Section 3 we describe our proposed inversion-specific GAN and distributional recovery. We assess the performance of the proposed method in Section 4 and show the extend application of the method to multi-model inversion attacks. Finally, we conclude and discuss our key findings in Section 5.

Related work
The general goal of privacy attacks against machine learning models is to gain knowledge which is not intended to be shared, such as knowledge about the training data and information about the model. Attacks can be categorized into four types according to the specific goals: model extraction, membership inference, property inference, and model inversion. Model extraction attacks [4,5,6,7] try to create a substitute model that learns the same task as the target model while performing equally good or even better. The other three kinds of attacks focus on exposing secrets about training data: membership inference attacks [8] try to determine whether a given data point is used as part of the training set; property inference attacks [9,10,11] try to extract dataset properties which are not explicitly correlated to the learning task (e.g., extracting the ratio of women and men in a patient dataset where this information is unlabeled). The goal of MI attacks is to recreate training data or sensitive attributes.
The first MI attack algorithm was proposed in [1], which follows the Maximum a Posterior (MAP) principle and constructs the input features that maximize the likelihood of observing a given model response and other possible auxiliary information. The authors applied the algorithm to attack a linear regression model that predicts medical dosage and showed that the algorithm can successfully invert genetic markers which are used as part of the input features.
Fredrikson et al. [2] applied the MAP attack idea to more complex models, including decision trees and shallow neural networks. Specifically, for neural networks with high-dimensional input features, the authors proposed to utilize gradient descent to solve the underlying attack optimization problem. Although the algorithm significantly outperforms random guessing when tested on some shallow networks and single-channel images, the reconstructions are blurry and can hardly reveal private information. Besides, the algorithm completely fails when tested on DNNs and three-channel images.
To improve the attack performance for DNNs with high-dimensional input, a two-pronged attack approach [3] was proposed which trains a GAN on public data (which could have no class intersection with private data and no labels), and then uses the GAN to search for the real examples that maximize the response to given classes. However, the resultant GAN fails to distill the private knowledge customized for the specific classes of interest in the target network, and the associated MI attack cannot recover the distribution of examples corresponding to those private classes.
The aforementioned works for attacking neural nets focused on the white-box setting and attacking a single model that is learned offline. Recent work has also looked into other attacker models. For instance, Yang el al. [12] studied the blackbox attack and proposed to train a separate model that swaps the input and output of the target model to perform MI attacks. Salem et al. [13] studied the blackbox MI attacks for online learning, where the attacker has access to the versions of the target model before and after an online update and the goal is to recover the training data used to perform the update.
Moreover, the algorithms of MI attacks resemble an orthogonal line of work on feature visualization [14,15], which also attempts to reconstruct an image that maximally activates a target network. The proposed work differs from these existing works on feature visualization in that our algorithm customizes the public-to-private knowledge distillation to train the GAN and a novel formulation is presented for data distribution synthesis which results in more realistic image recovery.

Overview of our attack
Attack model This paper focuses on the whitebox MI attack, in which the attacker has complete access to the target network T . The goal of the attacker is to discover a representative input feature x associated with a specific label y. We will use face recognition as a running example for the target network. Face recognition classifiers label an image containing a face with the label corresponding to the identity depicted in the image. The corresponding attack goal is to recover a representative face image for any given identity based on the target classifier parameters.
Existing MI attacks boil down to synthesizing the most likely input for the target network. Specifically, the following optimization problem is solved to synthesize the input for a given label y: max x log T y (x), where T y (x) is the probability of label y output by the model T given the input x. When T is a DNN and x is high-dimensional (e.g., images), the corresponding optimization becomes nonconvex and performing gradient descent easily gets stuck in local minima. The local minima might not be semantically meaningful at all. For instance, when the model input is an image, such local minima could be meaningless patterns of pixels.
The proposed proposed attack algorithm consists of two steps. The first step is to train a GAN having knowledge about the private classes of the target model from public data. Instead of training a generic GAN, we customize the training objective for both generator and discriminator so as to better distill the private-domain information about the target model from public data. In the second step, we make use of the generator learned in the first step to estimate the parameters of the private data distribution. The overall architecture of our method is shown in Figure 1.

Building an Inversion-Specific GAN
To distill the useful knowledge about the target model from public data, we propose to adopt a discriminator that is not only able to differentiate real data from the fake, but also to discriminate between the class labels under the target network.
Suppose that the target network classifies a sample into one of K possible classes. Our discriminator D is a (K + 1)classifier [16], where the first K classes correspond to the labels of the target network and the (K +1)-th class represents fake samples. To train such a discriminator, we use the target network T to generate a soft label T (x) for each image from the public dataset.
Formally, the training loss for D has two parts: and Here p data is the distribution of public data, and p disc (y|x) is the probability that the discriminator predicts x as class y. The random noise z is sampled from N (0, I), and T k (x) is the k-th dimension of the soft label produced by the target network. The discriminator D(x) outputs the probability of x being a real sample, and therefore we have Intuitively, using the public data with soft-labels to train the discriminator encourages the generator to produce image statistics that help predict the output classes of the target model. Such image statistics are also likely to be present in the private training data. Hence, the proposed training process can potentially guide the generator to produce images that share more common characteristics with the private training data.
For training the generator, we adopt the following feature-matching loss [16] to align the generated images with the real counterparts based on the learned features f (x) encoded in an intermediate layer of the discriminator: where L entropy is an entropy regularizer [17].
The intuition of the entropy regularization term is simple. Because the target network is trained on the private data, the private data should have high confidence when fed into the target network and in turn should get low prediction entropy. In order to encourage the data distribution learned from public data to mimic the private data, we explicitly constrain the entropy in the loss function so that the generated data will have low entropy under the target network.

Distributional Recovery
Given the GAN trained above on the public data under the guidance of the target network, the second step of the MI attack tries to find the private data which achieves the maximum likelihood under the target classification network while containing realistic images. While existing works focus on generating a representative image of a given identity, there ought to be a variety of training examples corresponding to one identity -indeed, the classifier is a many-to-one mapping. To this end, we propose to recover a data distribution instead of a single point to invert the target model for a given label k of identity.
Specifically, given an identity label k, we model the private data distribution by G(z ), where G is the generator trained in the first step and z is sampled from p gen = N (µ, σ 2 ) with two learnable parameters µ and σ 2 . We then minimize the following objective function to generate the samples for the given class k from the private classifier T by estimating µ and σ: where λ i is a positive balancing hyperparameter, and Figure 2: Examples of images obtained by inverting a target face recognition model. Each row corresponds to an identity. The numbers beneath each image show high softmax scores for the corresponding identity by the evaluation classifier, demonstrating these generated images successfully attack the target model by exposing its private information.
Here the prior loss L prior penalizes unrealistic images and the identity loss L id encourages the estimated private data distribution to have high likelihood of being assigned to the given target label k under the targeted network T .
To estimate µ and σ 2 directly through the back-propagation, we adopt the reparameterization trick [18] to make L prior and L id differentiable: We can now form Monte Carlo estimates of expectations of L prior and L id as follows and optimize them with respect to σ and µ: where l ∼ N (0, I) for l = 1, . . . , L.
Once µ and σ are estimated, the distribution of the learned training examples corresponding to the label k is given implicitly by sampling from G(z ) with z ∼ N (µ, σ 2 ). Figure 2 shows some examples obtained by sampling from G(z ). These examples show a variety of face images are obtained for each identity by inverting a target face recognition model, containing variations in face poses, expressions, hairs and beards. This suggests that a natural many (faces)-toone (identity) mapping is learned through a MI attack. We can also model the distribution by multi-variant Gaussian to have further improvement. And this will be left for future work.

Experiment
In this section, we will evaluate our proposed attack in terms of the performance to recover a representative input from a target model. The baseline that we will compare against is the generative MI attack (GMI) proposed in [3], which achieved the state-of-the-art result for attacking DNNs.

Experimental setting
Dataset. We study attacks against models built for different prediction tasks, including face recognition, digit classification, object classification, and disease prediction. images per person. We use aligned versions of above face datasets, and crop the images at the center and resize them to 64 × 64 so as to remove most background. For digit classification, we use the MNIST handwritten digit data [20]. For object classification, we adopt the CIFAR-10 dataset [21]. For disease prediction, we use the Chest X-ray Database [22] (ChestX-ray8).
Models. Following the settings in [3], we implement several different target networks with varied complexities. Some of the networks are adapted from existing ones by adjusting the number of outputs of their last fully connected layer to our tasks. For the face recognition task, we use three different network architectures: (1) VGG16 adapted from [23]; (2) ResNet-152 adapted from [24]; (3) face.evoLve adpated from [25]. For digit classification on MNIST, we use a network which consists of 3 convolutional layers and 2 pooling layers. For object classification, we use VGG16. For the disease prediction on ChestX-ray8, we use Resnet-18 adapted from [24].
Attack Implementation. We split each dataset into two disjoint parts: one part used as the private dataset to train the target network and the other as a public dataset. The public data, throughout the experiments, do not have class intersection with the private training data of the target network. Therefore, the public dataset in our experiment only helps the adversary to gain knowledge about features generic to all classes and does not provide information about private, class-specific features for training the target network. For CelebA, we use 30,027 images of 1000 identities as private set and randomly choose 30,000 images of other identities as public set to train GAN. For MNIST and CIFAR10, we use all of the images with label 0, 1, 2, 3, 4 as private set and rest images with label 5, 6, 7, 8, 9 as public set. For ChestX-ray8, we use 10,000 images with label "Atelectasis", "Cardiomegaly", "Effusion", "Infiltration", "Mass", "Nodule", "Pneumonia" as private set and 10,000 images belongs to other 7 classes as public set. We train the target networks using the SGD optimizer with the learning rate 10 −2 , batch size 64, momentum 0.9 and weight decay 10 −4 . For training GANs, we use the Adam optimizer with the learning rate 0.004, batch size 64, β 1 = 0.5 and β 2 = 0.999 as [26]. The weight for entropy regularization term is λ h = 1e−4. For the step of distributional recovery, we set λ i = 100; the distribution is initialized with µ = 0, σ = 1 and optimized for 1500 iterations.
Evaluation Protocol. For our proposed attack, we draw 5 random samples of and generate corresponding images G(σ + µ). For the baseline attack, we re-start the attack for 5 times with random initialization. To evaluate the reconstruction of a representative input, we compute the average of attack performance on the 5 reconstructed images.
Evaluation Metrics. Evaluating the MI attack performance requires gauging the amount of private information about a target label leaked through the synthesized images. We conduct both qualitative evaluation through visual inspection as well as quantitative evaluation. The quantitative metrics that we use to evaluate the attack performance largely follow the existing literature [3], including attack accuracy and K-nearest neighbor feature distance. They are generally aimed at measuring the semantic similarity between private data and reconstructions. In addition, we incorporate a metric for image quality, namely, Fréchet Inception Distance (FID) [27], as part of our evaluation. The metrics are expounded as follows.
• Attack Accuracy (Attack Acc). We build an evaluation classifier that predicts the identity based on the input reconstructed image. If the evaluation classifier achieves high accuracy, the reconstructed image is considered to expose private information about the target label. It is shown in [3] that the reconstructed images may overfit the target network; in other words, reconstructed images could be meaningless pixel patterns but achieve high prediction accuracy when evaluated with the target network. Hence, the evaluation classifier should be different from the target network. Moreover, the evaluation classifier should achieve high performance, because we are using it as a proxy for a human observer or an oracle to judge whether a reconstruction captures sensitive information. The attack accuracy is measured by the prediction accuracy of the evaluation classifier on reconstructed images. For all the face image datasets, we use the model in [25] as our evaluation classifier, which is pretrained on MS-Celeb-1M [28] and fine-tuned on the training set of the target networks. For MNIST, we train a new evaluation classifier which consists of 5 convolutional layers and 2 pooling layers on all of the 10 digits. For ChestX-ray8, the evaluation classifier is adapted from [23]. For CIFAR10, we use ResNet-18 adapted from [24].
• K-Nearest Neighbor Distance (KNN Dist). KNN Dist is the shortest feature distance from a reconstructed image to the real private training images for a given class. The feature distance is measured by the l 2 distance between two images when projected onto the feature space, i.e., the output of the penultimate layer of the evaluation classifier.
• FID. FID score measures feature distances between real and fake images, and lower FID values indicate better image quality and diversity. We found that reconstructed images which the evaluation classifier predicts into the target label tend to achieve lower FID scores. Hence, the FID score and attack accuracy are correlated with one another. To make FID a complementary metric to attack accuracy, we only calculate the FID score of those reconstructions which are successfully recognized as the target class by the evaluation classifier. The idea of this FID score is to measure how much more detailed information is leaked from a reconstruction that can successfully recover the semantics.

Result
Comparison with previous state-of-the-art. We compare our attack with the baseline for attacking various models built on the same dataset, namely, CelebA. The models include VGG16, ResNet152, and face.evolve, which have increased complexity. Among these models, face.evolve achieves state-of-the-art face recognition performance. The results for attacking these models are shown in Table 1, showing that our approach significantly improves the GMI on all the target models. Notably, our approach also enjoys lower performance variance across different target identities compared with the GMI. The performance improvement achieved by our attack is further corroborated by Figure 3, which exhibits ground truth private images and corresponding reconstructions given by our attack and the GMI. We can see that our reconstructions can mostly better preserve the facial features of a given identity than the baseline. Since both our approach and the GMI are based on a GAN trained over public data, a natural question is whether these two approaches simply memorize the public data and output a public examples similar to the target identity? To answer this question, we also exhibit the nearest neighbors in the public dataset for each of the target images in Figure 3. We calculate the nearest neighbors based on the distance between deep feature representations extracted from the evaluation classifier in order to capture the perceptual similarity between two images [29]. Comparison between the nearest neighbors and our generated samples shows that both GMI and our approach do not simply "memorize" the similar images in the public domain; instead, they attempt to synthesize new images that expose sensitive attributes while remaining realistic. And the third and last rows demonstrate the reconstructions produced by the GMI attack and our attack, respectively.
Moreover, we examine the performance of the proposed attack for recovering some implicit attributes of the private images, such as gender, age, hair style, among others. Table 2 shows that our attack also outperforms GMI in terms of recovering the implicit attributes.   Table 2: Comparison of implicit attributes recovering between GMI and our proposed method. Attack accuracy is measured by an attributes classifier trained on CelebA. Table 3 compares the attack performance of our attack and the GMI on various datasets. We can see that our method outperforms the GMI by a large margin. One interesting finding is that, when attacking digit recognition model trained on MNIST, GMI generates images that can be successfully recognized as the target digits by the target classifier but cannot be predicted into the target digits by the evaluation classifier and the average attack accuracy is close to 0. As shown in Figure 4, when attacking digit "0," GMI tends to generate "6" because it only sees "6" in the public data. However, the generated samples can achieve high prediction accuracy under the target network, because it is trained to only predict 0-4, while having low prediction accuracy under the evaluation classifier which can predict all ten digits. In contrast, our attack can successfully reconstruct "0" even though it also only sees 5-9 in the public data. This demonstrates that our customized training of GAN can indeed help retain those features in the public data that are more likely to appear in private data.  Cross-dataset experiment. We study the effect of distribution shift between public and private data on the attack performance. We train our GAN on Flickr-Faces-HQ Dataset (FFHQ) [30] and FaceScrub [31] to attack the target network VGG16 trained on CelebA. The attack results are presented in Table 4, which shows that both GMI and our attack suffer from a performance drop while ours still outperforms GMI. We notice that the performance drop on FaceSrub is larger than that on FFHQ. One possible reason is that images in FaceScrub have much lower resolution  Table 4: Attack performance comparison where there is large distributional shift between public and private data.
A → B represents the setting when the target network is trained on dataset B and the GAN is trained on dataset A to distill a generic prior for reconstructions. ↑ and ↓ respectively symbolize that higher and lower scores give better attack performance.
Ablation study. We proposed a couple of ideas to improve the GMI attack in [3], including (1) soft-label discrimination (SD), which enables the discriminator to differentiate soft-labels produced by the target network, (2) entropy minimization (EM), which minimizes the prediction entropy of images produced by the generator, and (3) distributional recovery (DR), which explicitly models and estimates the private data distribution. Note that EM can only be combined with our SD. This is because a canonical discriminator only performs real vs. fake classification and minimizing the entropy of the prediction outputs in this case would not encourage the embedding to retain features that are more likely to appear in private data. We have shown that the combination of all these ideas can lead to significant attack performance improvement over the GMI. Here, we conduct an ablation study to investigate the improvement introduced by each individual idea as well as any reasonable combinations of these ideas.    Table 6 shows the result of our method under the Multi-Target attack setting. We attack all possible combinations of the three target models used in the experiment shown in Table 1.
It is clear from Table 6 that the attack performance increases considerably under Multi-Target setting with both GMI and our approach. For example, When IR152 or face.evolve are jointly utilized with VGG16, their attack accuracy increased by 9% and 11% receptively over their accuracies under single-target setting, even though VGG16 yields a weaker attack accuracy. Moreover, increasing the number of target models to three models further improved the attack performance. By attacking multiple target models jointly, our approach achieves an attacking accuracy of over 0.9 in these experiments, which marks a significant milestone for multi-target model inversion attack.

Conclusion
In this paper, we propose several techniques that can significantly improve whitebox MI attacks against DNNs. Specifically, we propose to customize the training of a GAN to better distill knowledge useful for performing inversion attacks from public data. Additionally, we propose to build an explicit parameteric model for the private data distribution and present methods to estimate its parameters. Our experiments show that the combination of the proposed techniques can lead to the state-of-the-art attack performance on various datasets, models, and even when the public data has a large distributional shift from private data. We also extend our work to a new attack setting where multiple models trained on the same private dataset are available. For future work, we will investigate the potential application of these techniques to improve the MI attack in the blackbox setting.

A Extension to Multi-Target Model Inversion Attacks
Existing MI attacks aim to extract sensitive features (or entirely construct samples) from a private dataset. So far, all previous works on MI attacks only consider a single target model. However, multiple models trained on the same private dataset are often available in a real scenario. Performing MI attack on multiple different target models that are trained on the same private dataset could be an interesting and practical problem in real-world applications. Will the attacker gain more information about this private dataset in this case?
In our experiments, we extend our attack algorithm over single-target setting to the multi-target setting by following the same attacking procedure. First, an inversion-specific GAN is built under the guidance of multiple target models, where the supervised loss of discriminator L multi_sup is a weighted combination of cross-entropy losses between the discriminator output distributions and soft labels given by different target models; supervised loss and generator loss are exactly same as under the single-target setting: where and E z∼noise log(1 − D(G(z)))} Here we use the same notation as the single-target setting. M is the number of target models, w m is the weight on the loss over the mth target model T m .
Then the learned GAN over multiple target models are applied for distributional recovery where the new identity loss is a weighted combination of identity loss over multiple target models, and prior loss remain unchanged: log T m k (G(σ l + µ)) L multi_prior = −E z ∼pgen log D(G(z )) and overall loss for distributional recovery under multi-attack setting is: In our experiments, the same set of training hyperparameters such as learning rate and weight decay are used. In addition, we set w m in (14) and (17) to 1 M so that the discriminator supervised loss and the identity loss are averaged over all target models.