Membership inference attack defense method based on variational autoencoder

Through the adversarial training algorithm of variational autoencoders, the problem in the existing technology that resists member inference attacks is difficult to ensure both model performance and data privacy, and achieves the effect of reducing the attack success probability and retaining the model prediction accuracy.

CN114492596BActive Publication Date: 2024-09-27XIDIAN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210001700.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2024-09-27
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

Existing methods to resist member inference attacks are difficult to reduce the probability of training data being stolen while retaining the performance of the machine learning model, and cannot guarantee the availability of the model and the privacy of the data at the same time.

Method used

Adopting an adversarial training algorithm based on variational autoencoders, by constructing a convolutional neural network and inference attack network model, adversarial loss functions are used for adversarial training, and new data samples are generated to reduce the probability of attack success while retaining the high prediction accuracy of the model.

Benefits of technology

It effectively reduces the success probability of member inference attacks, protects the privacy of model training data, maintains the high prediction accuracy of the target machine learning model, and avoids the collapse problem of the generative adversarial network and the difficulty of maintaining Nash equilibrium.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114492596B
    Figure CN114492596B
Patent Text Reader

Abstract

The present invention discloses a member reasoning attack defense method based on variational autoencoder, which mainly solves the problem that the existing member reasoning attack defense method cannot meet the requirements of availability and privacy at the same time. The scheme is: divide the training and non-training data; construct convolutional neural network, variational autoencoder and reasoning attack network model respectively; train the convolutional neural network and reasoning attack network model with non-training data set; conduct adversarial training on variational autoencoder and trained reasoning attack network model; generate new data set by using the trained variational autoencoder; train the defense convolutional neural network with the new data set; use the new data set and training data to test the defense convolutional neural network and the trained reasoning attack network model at the same time, and output the prediction classification result and prediction attack result after adding defense. The present invention improves the prediction accuracy, reduces the success probability of member reasoning attack, and can be used to prevent the training data of machine learning models from being leaked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of machine learning security, and specifically relates to a member reasoning attack defense method, which can be used to prevent the training data of a machine learning model from being leaked. Background Art

[0002] With the rapid development of machine learning technology, the performance of machine learning models is getting better and better. More and more machine learning models are being used to serve humans, bringing great convenience to people, thanks to the improvement in the quantity and quality of training data. However, the data required for machine learning model training often contains people's private information, such as medical records, financial information, etc. Membership inference attacks, as an effective method to steal machine learning model training data, have always received widespread attention and have been implemented in various fields, such as image recognition, target detection, positioning systems, etc. Because the output results of machine learning models for training data and non-training data are quite different, membership inference attacks are to build an attack model that can identify the difference in data in machine learning models and use it to distinguish whether the input data belongs to training data. Therefore, how to resist membership inference attacks has become a hot topic in the field of machine learning and is also a very important research direction.

[0003] Many methods have been proposed to resist membership inference attacks, but existing methods to resist membership inference are difficult to reduce the probability of successful theft of machine learning model training data while retaining the performance of the machine learning model, and cannot guarantee the availability of the model and the privacy of the data at the same time. For example, the use of the top-k method can limit the number of predicted classifications output by the machine learning model, reduce the prediction accuracy, and reduce the degree of fit of the machine learning model to the training data, thereby reducing the probability of a successful attack. Although this method can resist membership inference attacks, it also greatly sacrifices the performance of the machine learning model; for example, differential privacy technology, adding noise to the training of the machine learning model to blur the training data or model parameters, can also reduce the performance of membership inference attacks, but it also has a great impact on the performance of the machine learning model.

[0004] Zhejiang University of Technology proposed a "deep model privacy protection method and device based on parameter sharing for member reasoning attacks" in the patent application document with patent application number CN202110654137.9. Its implementation steps are: the first step is to construct a target model for target recognition based on image samples, and use image samples to optimize the network parameters of the target model; the second step is to cluster the network parameters of each layer of the target model, and replace the network parameters belonging to the same class with the average value of the network parameters of the cluster to which they belong, and then optimize the network parameters to obtain a parameter-shared target model; the third step is to construct a shadow model with the same structure as the target model, and use the training image samples to optimize the network parameters of the shadow model; the fourth step is to construct an attack model for determining whether the image sample is a member sample of the target model, and use the new image samples to optimize the model parameters of the attack model; the fifth step is to use the parameter-shared enhanced target model to obtain the prediction confidence of the input test image, and input the prediction confidence into the parameter-optimized attack model, and obtain the prediction result of the attack model after calculation. Although this method achieves the purpose of protecting data privacy through parameter sharing, it does not consider whether the performance of the target model is affected, and cannot guarantee the availability of the target model.

[0005] In the paper "Machine learning with membership privacy using adversarial regularization" published by Nasr at the 2018 ACM SIGSAC Conference on Computer and Communications Security, a method of using regularized adversarial training technology to resist member reasoning attacks was proposed. By designing an adversarial training algorithm, the machine learning model and the attack model are trained in game. During the training process, the performance of the machine learning model is continuously improved, while the attack performance of the attack model is also continuously enhanced. This method can ensure the performance of the machine learning model and can also effectively resist member reasoning attacks. However, this method is only applicable to large data volumes. When the data volume decreases, the resistance performance of this method will also be greatly affected. Summary of the invention

[0006] The purpose of the present invention is to address the deficiencies of the above-mentioned prior art and propose a member inference attack defense method based on variational autoencoder to retain the high prediction accuracy performance of the machine learning model while reducing the success probability of member inference attacks, protecting the privacy of model training data, and improving defense performance.

[0007] To achieve the above object, the technical solution of the present invention includes the following:

[0008] (1) Dataset division: randomly divide the existing FASHION-MNIST dataset into training set D and non-training set D', and obtain subsets D1 and D1' respectively;

[0009] (2) Construct a convolutional neural network consisting of a convolutional layer, a pooling layer, a hidden layer, and a fully connected layer, initialize the parameters of the network, and set the loss function to the cross entropy function;

[0010] (3) construct a variational autoencoder consisting of a mean encoder, a variance encoder, and a decoder, and set its loss function to be the reconstruction loss function;

[0011] (4) Construct an inference attack network model consisting of 6 fully connected layers in sequence, initialize the parameters of the network model, and set the attack loss function as:

[0012]

[0013] Among them, h* and h' are the output results of the inference attack network model, which represent the success probability and failure probability of inferring the training data respectively;

[0014] (5) Select a non-training dataset D' to train the convolutional neural network and the inference attack network model simultaneously:

[0015] (5a) Inputting the non-training data samples in the non-training data set D' into the convolutional neural network, and using its output results and the labels corresponding to the non-training data samples as the input of the inference attack network model to obtain the output results of the inference attack network model;

[0016] (5b) According to the output results of the inference attack network model, the parameters of the convolutional neural network and the inference attack network model are updated using a mini-batch gradient descent algorithm until their loss functions converge, thereby obtaining a trained convolutional neural network and inference attack network model;

[0017] (6) Perform adversarial training on the variational autoencoder and inference attack network model:

[0018] 6a) Set the adversarial loss function to:

[0019] Loss=min{L+λ*[max(maxGain+1,0)]}

[0020] Among them, maxGain is the reconstruction loss function of the variational autoencoder, maxGain is the influence factor, and maxGain is the maximum output value of the inference attack model in this training;

[0021] 6b) Obtain training sub-data x1 from the subset D1 of the training set and input it into the variational autoencoder to obtain newly generated data x*, and input x* into the trained convolutional neural network to obtain a training prediction vector V*;

[0022] 6c) Obtaining non-training sub-data x1' from the non-training subset D1' and inputting it into the trained convolutional neural network to obtain a non-training prediction vector V' of the convolutional neural network for the input data;

[0023] 6d) Input the results V* and V' of 6b) and 6c) into the trained inference attack model, respectively, and obtain the judgment result vectors h* and h' of the attack model for x* and x1' respectively;

[0024] 6e) According to the judgment result vectors h* and h', a gradient descent algorithm is used to update the model parameters of the trained inference attack model and the variational autoencoder;

[0025] 6f) Repeat 6b)-6e) above until the adversarial loss function is basically stable and the model converges, and a trained variational autoencoder is obtained;

[0026] (7) Input the data in the training set D into the trained variational autoencoder to obtain a new data set D*, the label of which is consistent with the label of the training set D, and input the new data set D* into the pre-trained convolutional neural network in batches, and use the batch gradient descent algorithm to train the network until the loss function of the network converges, thereby obtaining a trained defense convolutional neural network;

[0027] (8) Using the data of the new dataset D* as the input of the trained defense convolutional neural network, and outputting the predicted classification results after adding defense;

[0028] (9) The output of the defensive convolutional neural network and the labels corresponding to the data in the new dataset D* are input into the trained inference attack model, and the predicted attack results after adding defense are output.

[0029] Compared with the prior art, the present invention has the following effects:

[0030] First: Due to the use of adversarial training algorithms, the present invention enhances the attack performance of the member reasoning attack model, so that the variational autoencoder can generate new data samples that resist member reasoning attacks even when facing the strongest attack model, reducing the probability of successful attack of the attack model on the training data, and retaining the high prediction accuracy of the target machine learning model. Compared with the prior art, this method can simultaneously ensure the performance of the target machine learning model and protect the privacy of the model training data.

[0031] Second: Since the present invention uses new data to train the target model to be released, even a powerful attack model cannot obtain the original training data by attacking the target model, thereby further strengthening the protection of the training data.

[0032] Third: Using variational autoencoders to generate high-quality new data avoids the collapse problem of using generative adversarial networks and the difficulty in maintaining Nash equilibrium, reducing the difficulty and complexity of model training. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a general flow chart for the implementation of the present invention;

[0034] Figure 2 A variational autoencoder model diagram constructed in the present invention;

[0035] Figure 3 This is a sub-flow chart for adversarial training in the present invention. DETAILED DESCRIPTION

[0036] The embodiments and effects of the present invention are described in further detail below with reference to the accompanying drawings.

[0037] Reference Figure 1 , the implementation of this embodiment includes the following steps:

[0038] Step 1: Divide the data set.

[0039] 1.1) Randomly divide the existing FASHION-MNIST dataset into training set D and non-training set D', with data sample sizes of 30,000 and 30,000 respectively;

[0040] 1.2) Randomly extract half of the data from the training set D and the non-training set D', that is, 15,000 training subsets D1 and 15,000 non-training subsets D1'.

[0041] Step 2: Construct a convolutional neural network and initialize the network parameters.

[0042] 2.1) Set up 4 convolutional layers, where:

[0043] The number of convolution kernels in the first convolution layer is 32, and the size is 5*5.

[0044] The number of convolution kernels in the second convolution layer is 64, and the size is 5*5.

[0045] The number of convolution kernels in the third and fourth convolution layers is 128, and the size is 3*3.

[0046] 2.2) Set the pooling layer size to 2*2;

[0047] 2.3) Set up 3 fully connected layers, where the size of the first fully connected layer is d*1024, the size of the second fully connected layer is 1024*512, and the size of the third fully connected layer is 512*n, d is the output vector size of the last convolutional layer, and n is the final output vector size of the network;

[0048] 2.4) The convolutional layer, pooling layer, and fully connected layer are cascaded in sequence to form a convolutional neural network. That is, the structure of the convolutional neural network is:

[0049] The first convolutional layer → the second convolutional layer → the third convolutional layer → the fourth convolutional layer → the pooling layer → the first fully connected layer → the second fully connected layer → the third fully connected layer;

[0050] 2.5) The activation function uses the Relu function;

[0051] f(x)=max(0,x);

[0052] 2.6) Set the loss function of the convolutional neural network to the following cross entropy function:

[0053]

[0054] Among them, m is the number of samples, y i is the expected output value of the convolutional neural network, y′ i is the actual output value of the convolutional neural network;

[0055] 2.7) Use Gaussian initialization method to initialize the parameters of the convolutional neural network, that is, sample from a Gaussian distribution with a mean of 0 and a variance of 1 as the initial weights.

[0056] Step 3: Construct a variational autoencoder and initialize the network parameters.

[0057] Reference Figure 2 ,The specific implementation of this step is as follows:

[0058] 3.1) Establish a mean encoder composed of the first and second fully connected layers connected in sequence, where the size of the first fully connected layer is d*256, the size of the second fully connected layer is 256*2, and d is the dimension of the input data;

[0059] 3.2) Establish a variance encoder consisting of the third and fourth fully connected layers connected in sequence, where the size of the third fully connected layer is d*512 and the size of the fourth fully connected layer is 512*2;

[0060] 3.3) Establish a decoder consisting of the fifth and sixth fully connected layers connected in sequence, where the size of the fifth fully connected layer is 2*256 and the size of the sixth fully connected layer is 256*d;

[0061] 3.4) Connect the mean encoder and variance encoder to the decoder respectively, that is, connect the output of the second fully connected layer and the fourth fully connected layer to the input of the fifth fully connected layer to form a variational autoencoder. The data sample x is the input of the encoder, the mean μ and the variance δ 2 is the output of the encoder, the noise ε and μ are related to δ 2 Together they form the decoder input z = μ + ε * δ, and finally output the newly generated data x *;

[0062] 3.5) Set the loss function of the variational autoencoder to the reconstruction loss function, expressed as:

[0063] L=E[logp(X|Z)]-KL[N(μ,δ 2 )||N(0,1)]

[0064] Among them, X is the input data, μ and δ 2 are the mean and variance of the encoder output, ε is the added noise, Z is the decoder input, Z = μ + ε * δ, where the first term represents the probability of generating X under the condition that the decoder input is Z, and the second term represents the similarity between the normal distribution constructed according to the encoder output result and the standard normal distribution;

[0065] 3.6) Use Gaussian initialization method to initialize the parameters of the variational autoencoder, that is, sample from a Gaussian distribution with mean 0 and variance 1 as the initial weights.

[0066] Step 4: Build an inference attack network model and initialize various parameters of the network model.

[0067] 4.1) Set 6 fully connected layers of different sizes, where the size of the first fully connected layer is d*1024, the size of the second fully connected layer is 1024*512, the size of the third fully connected layer is 512*128, the size of the fourth fully connected layer is 128*256, the size of the fifth fully connected layer is 256*64, and the size of the sixth fully connected layer is 64*1, where d is the dimension of the input data;

[0068] 4.2) The six fully connected layers set in 4.1) are cascaded in sequence to form an inference attack network model with the structure of: the first fully connected layer → the second fully connected layer → the third fully connected layer → the fourth fully connected layer → the fifth fully connected layer → the sixth fully connected layer;

[0069] 4.3) Set the attack loss function of the inference attack network model to:

[0070]

[0071] Among them, h* and h' are the output results of the inference attack network model, which represent the success probability and failure probability of inferring the training data respectively;

[0072] 4.4) Use Gaussian initialization method to initialize the parameters of the inference attack network model, that is, sample from a Gaussian distribution with a mean of 0 and a variance of 1 as the initial weights.

[0073] Step 5: Select a non-training data set D' to train the convolutional neural network and the inference attack network model simultaneously.

[0074] 5.1) Input the non-training data samples in the non-training data set D' into the convolutional neural network, and use the output results and the labels corresponding to the non-training data samples as the input of the inference attack network model to obtain the output results of the inference attack network model;

[0075] 5.2) Based on the output results of the inference attack network model, the parameters of the convolutional neural network and the inference attack network model are updated using a small batch gradient descent algorithm:

[0076] 5.2.1) Set the learning rate α, the number of training times N, and the number of data samples m in each batch of training;

[0077] 5.2.2) Substitute the output of the inference attack network model into the attack loss function to obtain the loss error Gain i ;

[0078] 5.2.3) Calculate the loss error E i The gradient of , and update the parameters of the convolutional neural network and the inference attack network model at the same time according to the following formula:

[0079]

[0080] Among them, Gain i is the loss error of the i-th training, w Gain is the network parameter before update, w Gain ' is the updated network parameter;

[0081] 5.2.4) Repeat the operations of 5.2.2)-5.2.3) until the loss error is stable or the number of training times reaches N times. The training is completed and the trained convolutional neural network and inference attack network model are obtained.

[0082] Step 6: Perform adversarial training on the variational autoencoder and inference attack network model.

[0083] Reference Figure 3 , the specific implementation of this step is as follows:

[0084] 6.1) Set the adversarial loss function to:

[0085] Loss=min{L+λ*[max(maxGain+1,0)]}

[0086] Among them, maxGain is the reconstruction loss function of the variational autoencoder, maxGain is the influence factor, and maxGain is the maximum output value of the inference attack model in this training;

[0087] 6.2) Obtain training sub-data x1 from the subset D1 of the training set and input it into the variational autoencoder to obtain newly generated data x*, and input x* into the trained convolutional neural network to obtain the training prediction vector V*;

[0088] 6.3) Obtain non-training sub-data x1' from the non-training subset D1', input it into the trained convolutional neural network, and obtain the non-training prediction vector V' of the convolutional neural network for the input data;

[0089] 6.4) Input the results V* and V' of 6.2) and 6.3) into the trained inference attack model, and obtain the judgment result vectors h* and h' of the attack model for x* and x1' respectively;

[0090] 6.5) According to the judgment result vectors h* and h', the gradient descent algorithm is used to update the model parameters of the trained inference attack model and variational autoencoder:

[0091] 6.5.1) Set the learning rate α, the number of training times N, and the number of data samples in each batch of training input m;

[0092] 6.5.2) Substitute the judgment result vectors h* and h' into the adversarial loss function to obtain the loss error Loss i ;

[0093] 6.5.3) Calculate the loss error Loss i The gradient of , and update the parameters of the inference attack model and the variational autoencoder at the same time. The parameter update formula is as follows:

[0094]

[0095] Among them, Loss i is the loss error of the i-th training, w Loss is the network parameter before update, w Loss ' is the updated network parameters.

[0096] 6.5.4) Repeat the steps 6.5.2) to 6.5.3) until the number of training times reaches N times;

[0097] 6.6) Repeat 6.2)-6.5) above until the adversarial loss function is basically stable and the model converges to obtain a trained variational autoencoder.

[0098] Step 7: Train a single convolutional neural network to obtain a defensive convolutional neural network.

[0099] 7.1) Input the data in the training set D into the trained variational autoencoder to obtain a new data set D*, the label of which is consistent with the label of the training set D;

[0100] 7.2) Input the new dataset D* into the pre-trained convolutional neural network in batches, and use the batch gradient descent algorithm to train the network:

[0101] 7.2.1) Set the learning rate α, the number of training times N, and the number of data samples m in each batch of training iterations;

[0102] 7.2.2) Input the data samples in the m new data set D* into the convolutional neural network in sequence to obtain the output result;

[0103] 7.2.3) Substitute the output result of 7.2.2) into the cross entropy function to get the loss error loss i ;

[0104] 7.2.4) Calculate the loss error E i The gradient of the network parameters is updated to obtain the updated network parameters w loss ':

[0105]

[0106] Among them, loss i is the loss error of the i-th training, w loss is the network parameter before updating;

[0107] 7.2.5) Repeat the operations of 7.2.2)-7.2.1) until the loss error remains stable or the number of training times reaches N times, and a trained defensive convolutional neural network is obtained.

[0108] Step 8: Use the data of the new dataset D* as the input of the trained defense convolutional neural network and output the predicted classification results after adding defense.

[0109] Step 9: Input the output of the defense convolutional neural network and the labels corresponding to the data in the new data set D* into the trained inference attack model, and output the predicted attack results after adding defense.

[0110] The effect of the present invention can be further illustrated by the following simulation experiment.

[0111] 1. Simulation experiment conditions:

[0112] The simulation experiment running environment is: the processor is Interl(R)Core(TM)i5-5200 CPU@2.20GHz, the memory is 4.00GB, the hard disk is 457G, the operating system is Windows 10, the programming environment is Python 3.8, and the programming software is PyCharm Edition 2020.1.2x64.

[0113] The data sets used in the simulation are FASHION-MNIST data set, CIFAR-10 data set, and CIFAR-100 data set.

[0114] 2. Simulation content and results analysis:

[0115] Simulation content: Under the above simulation experimental conditions, the Min-Max method with good performance in the present invention and the existing member reasoning attack defense method is used to classify the images of the three data sets before and after defense, and the classification accuracy and attack accuracy of the two methods are compared. The results are shown in Table 1:

[0116] Table 1 Classification accuracy and attack precision of the present invention and the existing Min-Max method

[0117]

[0118] Classification accuracy indicates the classification performance of the target model before and after adding the defense method, that is, the usability of the method. The higher the classification accuracy, the stronger the usability. The calculation formula of classification accuracy is: Among them, T c Indicates the number of samples with consistent classification results and data sample labels, F c Indicates the number of samples whose classification results are inconsistent with the data sample labels.

[0119] Attack accuracy indicates the performance of the target model in resisting attacks before and after adding the defense method, that is, the privacy of the method. The closer the attack accuracy is to 0.5, the stronger the privacy is. The calculation formula of attack accuracy is: Among them, T a Indicates the number of samples with consistent classification results and data sample labels, F a Indicates the number of samples whose classification results are inconsistent with the data sample labels.

[0120] If the classification accuracy decreases less before and after adding the defense method, it means that the scheme can retain the high prediction accuracy performance of the machine learning model; if the attack accuracy is close to 50% before and after adding the defense method, it means that the scheme has successfully resisted the member reasoning attack and successfully protected the privacy of the training data.

[0121] It can be seen from the results in Table 1 that the method of the present invention only sacrifices 4% to 6% of the classification accuracy to greatly reduce the attack accuracy to nearly 50%, which proves that the method of the present invention successfully retains the high prediction accuracy performance of the machine learning model, while reducing the success probability of member reasoning attacks and protecting the privacy of model training data.

Claims

1. A method for defending against member inference attacks based on variational autoencoders, characterized in that: include: (1) Dataset division: randomly divide the existing FASHION-MNIST dataset into training set D and non-training set D', and obtain subsets D1 and D1' respectively; (2) Construct a convolutional neural network consisting of a convolutional layer, a pooling layer, a hidden layer, and a fully connected layer, initialize the parameters of the network, and set the loss function to the cross entropy function; (3) construct a variational autoencoder consisting of a mean encoder, a variance encoder, and a decoder, and set its loss function to be the reconstruction loss function; (4) Construct an inference attack network model consisting of 6 fully connected layers in sequence, initialize the parameters of the network model, and set the attack loss function as: Among them, h* and h' are the output results of the inference attack network model, which represent the success probability and failure probability of inferring the training data respectively; (5) Select a non-training dataset D' to train the convolutional neural network and the inference attack network model simultaneously: (5a) Inputting the non-training data samples in the non-training data set D' into the convolutional neural network, and using its output results and the labels corresponding to the non-training data samples as the input of the inference attack network model to obtain the output results of the inference attack network model; (5b) According to the output results of the inference attack network model, the parameters of the convolutional neural network and the inference attack network model are updated using a mini-batch gradient descent algorithm until their loss functions converge, thereby obtaining a trained convolutional neural network and inference attack network model; (6) Perform adversarial training on the variational autoencoder and inference attack network model: 6a) Set the adversarial loss function to: Loss=min{L+λ*[max(maxGain+1,0)]} Among them, maxGain is the reconstruction loss function of the variational autoencoder, maxGain is the influence factor, and maxGain is the maximum output value of the inference attack model in this training; 6b) Obtain training sub-data x1 from the subset D1 of the training set and input it into the variational autoencoder to obtain newly generated data x*, and input x* into the trained convolutional neural network to obtain a training prediction vector V*; 6c) Obtaining non-training sub-data x1' from the non-training subset D1' and inputting it into the trained convolutional neural network to obtain a non-training prediction vector V' of the convolutional neural network for the input data; 6d) Input the results V* and V' of 6b) and 6c) into the trained inference attack model, respectively, and obtain the judgment result vectors h* and h' of the attack model for x* and x1' respectively; 6e) According to the judgment result vectors h* and h', a gradient descent algorithm is used to update the model parameters of the trained inference attack model and the variational autoencoder; 6f) Repeat 6b)-6e) above until the adversarial loss function is basically stable and the model converges, and a trained variational autoencoder is obtained; (7) Input the data in the training set D into the trained variational autoencoder to obtain a new data set D*, the label of which is consistent with the label of the training set D, and input the new data set D* into the pre-trained convolutional neural network in batches, and use the batch gradient descent algorithm to train the network until the loss function of the network converges, thereby obtaining a trained defense convolutional neural network; (8) Using the data of the new dataset D* as the input of the trained defense convolutional neural network, and outputting the predicted classification results after adding defense; (9) The output of the defensive convolutional neural network and the labels corresponding to the data in the new dataset D* are input into the trained inference attack model, and the predicted attack results after adding defense are output.

2. The method according to claim 1, characterized in that In (2), the parameters of the convolutional neural network are initialized as follows: The number of convolutional layers is set to 4, and the number and size of convolution kernels in each convolutional layer are set to 32 and 5*5, 64 and 5*5, 128 and 3*3, and 128 and 3*3 respectively; The activation function uses the Relu function; The size of the pooling layer is set to 2*2; The number of fully connected layers is set to 3, and the sizes are set to d*1024, 1024*512, and 512*n, where d is the output vector size of the last convolutional layer and n is the final output vector size of the network; The loss function is the following cross entropy function: Among them, m is the number of samples, y i is the expected output value of the network, y i ' is the actual output value of the network.

3. The method according to claim 1, characterized in that The mean encoder, variance encoder and decoder that make up the variational autoencoder in (3) are all composed of two fully connected layers, and their reconstruction loss function is expressed as follows: L=E[logp(X|Z)]-KL[N(μ,δ 2 )||N(0,1)] Among them, X is the input data, μ is the output of the mean encoder, δ 2 is the output of the variance encoder, Z is the decoder input, Z = μ + ε * δ, ε is the added noise; the first term represents the probability of generating X under the condition that the decoder input is Z, and the second term represents the similarity between the normal distribution constructed according to the encoder output result and the standard normal distribution.

4. The method according to claim 1, characterized in that (5b) Based on the output results of the inference attack model, the network model parameters of the convolutional neural network and the inference attack model are updated using a mini-batch gradient descent algorithm as follows: (5b1) Set the learning rate α, the number of training times N, and the number of data samples in each batch of training iterations m; (5b2) Substitute the output result of the inference attack network model into the attack loss function to obtain the loss error Gain i ; (5b3) Find the loss error E i The gradient of , and update the parameters of the convolutional neural network and the inference attack network model at the same time according to the following formula: Among them, Gain i is the loss error of the i-th training, w Gain is the network parameter before update, w Gain ' is the updated network parameter; (5b4) Repeat operations (5b2)-(5b3) until the loss error remains stable or the number of training times reaches N, and the training ends.

5. The method according to claim 1, characterized in that In 6e), according to the judgment result vectors h* and h', the gradient descent algorithm is used to update the model parameters of the trained inference attack network model and the variational autoencoder, which is implemented as follows: 6e1) Set the learning rate α, the number of training times N, and the number of data samples m in each batch of training; 6e2) Substitute the judgment result vectors h* and h' into the adversarial loss function to obtain the loss error Loss i ; 6e3) Find the loss error Loss i The gradient of , and update the parameters of the inference attack model and the variational autoencoder at the same time, the parameter update formula is as follows: Among them, Loss i is the loss error of the i-th training, w Loss is the network parameter before update, w Loss ' is the updated network parameters; (6d4) Repeat steps 6e2)-6e3) until the loss error stabilizes or the number of training times reaches N, and the training ends.

6. The method according to claim 1, characterized in that In (7), the new data set D* is input into the pre-trained convolutional neural network in batches, and the batch gradient descent algorithm is used to train the network, which is implemented as follows: (7a) Set the learning rate α, the number of training times N, and the number of data samples in each batch of training iterations m; (7b) Input the data samples in the m new data set D* into the convolutional neural network in sequence to obtain the output result; (7c) Substitute the output of (7b) into the cross entropy function to obtain the loss error loss i ; (7d) Calculate the loss error E i The gradient of the network parameters is updated to obtain the updated network parameters w loss ': Among them, loss i is the loss error of the i-th training, w loss is the network parameter before updating; (7e) Repeat steps (7b) to (7d) until the loss error stabilizes or the number of training times reaches N, and the training ends.

Citation Information

Patent Citations

  • Depth model privacy protection method and device oriented to member reasoning attack and based on parameter sharing

    CN113283537A

  • Federated learning hitchhiking attack defense method based on clustering

    CN112434758A

  • Attack-less adversarial training for robust adversarial defense

    US20210192339A1