Depth gradient inversion attack method and device based on anomaly detection
By combining the anomaly detection model with the deep gradient inversion attack, the preset auxiliary data set and the real gradient are used to calculate the comprehensive loss, optimize the attack process, and solve the problems of low success rate and image distortion of the deep gradient inversion attack in the existing technology. Efficient private training data reconstruction is achieved.
Patent Information
- Application Number
- CN202310200000.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
The existing technology has a low success rate of deep gradient inversion attacks under large batches of complex data sets, and the generated images are prone to distortion and violate security model assumptions, making it difficult to reconstruct high-fidelity private training data.
By training the anomaly detection model based on the preset auxiliary data set, initializing the data to be solved and calculating the simulated gradient, combined with the real gradient to calculate the comprehensive gradient attack loss, and using the optimization algorithm to iteratively optimize the data to be solved to implement deep gradient inversion attacks and reconstruct privacy training data.
It improves the attack effect and success rate of deep gradient inversion attacks, complies with security assumptions, extracts prior knowledge from a small amount of auxiliary data sets, optimizes the attack process, reduces the distortion of generated images, and enhances the ability to reconstruct high fidelity.
Smart Images

Figure CN118568756A
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a deep gradient inversion attack method and device based on anomaly detection. Background Art
[0002] Federated learning is a distributed learning algorithm for privacy protection. Compared with traditional centralized learning, federated learning does not require clients to share their data sets, but shares the gradients generated by local training of private data on the client; with the help of federated learning, different clients can jointly train a global model without leaking their own private data. Therefore, federated learning can effectively break the problem of data silos, and it has been put into practical use in a variety of scenarios that are sensitive to privacy data, such as the financial and medical fields.
[0003] The training process of federated learning is as follows Figure 1 As shown in the figure, each client uses its own private data to train the model locally and generate gradients; then, the client sends the generated gradients to the central server. After receiving the gradient data from each client, the server aggregates the gradient data, updates the model, and distributes the model to each user.
[0004] At present, relevant research shows that sharing gradients will leak certain attributes of user training data. For example, certain attribute features in training data can be inferred through gradient information. In addition, data similar to private training data can be generated through generative models.
[0005] In 2019, Deep Leakage from Gradients (DLG) first proposed the deep gradient leakage attack, and proved through experiments that this attack can reconstruct the user's private training data to a certain extent. The attack first randomly initializes a set of unsolved data and parsing labels, generates simulated gradients through this set of unsolved data, and calculates the Euclidean distance between the simulated gradients and the true gradients. Then, the gradient descent method is used to optimize the unsolved data and the parsing labels to reduce the distance between the simulated gradients and the true gradients. Finally, the user's private training data can be reconstructed under simple data sets and simple image classification models; however, the DLG method can only implement the attack in relatively simple data sets and models. When the training batch is larger than the threshold, the global model of federated learning is complex, and the training data set is complex, the DLG method is difficult to successfully recover the training data.
[0006] Furthermore, related technologies mainly improve attack methods in terms of optimization methods, prior knowledge, mathematical analysis, etc. Among them, the IG (Inverting Gradients) method believes that the more important part of gradient information is the direction information, and replaces the distance measurement between the virtual gradient and the real gradient with the cosine distance, which achieves better results; the iDLG (improved Deep Leakage from Gradients) method can accurately calculate the label of the training sample when the number of training sample batches is 1 and the softmax function and cross entropy function are used as losses, thereby reducing the optimization space and enhancing the attack effect; the CPA (Cocktail Party Attack) method introduces the idea of blind source separation in the signal into the deep gradient inversion attack, which can effectively restore the input of the fully connected layer from the gradient, and perform feature inversion on this basis, effectively improving the attack effect. The iLRG (Instance-wise Batch Label Restoration via Gradients) method uses mathematical characteristics to approximately establish equations and can solve the number of instances in large batches of training data, greatly simplifying the label search space.
[0007] In addition, the GI (Gradient Inversion) method observes that the gradient of the BatchNorm layer in the neural network directly reveals the mean and variance distribution of the intermediate layer output, thereby using this information to enhance the data reconstruction effect. The most advanced GGL (Generative Gradient Attack) method currently uses all training set data sets to pre-train GAN (Generative Adversial Network), reducing the search space to the generation space of the generator, and can generate images that are similar and natural to the original data.
[0008] However, the related technology is difficult to successfully carry out gradient inversion attacks through the posterior probability provided by the gradient under large batches of complex data sets. In addition, the related technology relies on a large number of auxiliary data sets for training, which violates the security and privacy attributes of federated learning and is difficult to implement in practical applications. The generated images are also severely distorted and differ greatly from the original data, which needs to be solved urgently. Summary of the invention
[0009] The present application provides a deep gradient inversion attack method and device based on anomaly detection to solve the problems that related technologies rely on a large number of auxiliary data sets to perform deep gradient inversion attacks, have a low success rate, easily distort the generated images, violate security model assumptions, and are difficult to reconstruct high-fidelity privacy training data.
[0010] The first aspect of the present application provides a deep gradient inversion attack method based on anomaly detection, comprising the following steps: training an anomaly detection model based on a preset auxiliary data set; initializing the data to be solved, and calculating the simulated gradient based on the data to be solved and a preset global model; calculating the comprehensive gradient attack loss based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client; and based on the comprehensive gradient attack loss, iteratively optimizing the data to be solved using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data.
[0011] Optionally, in one embodiment of the present application, training the anomaly detection model based on the preset auxiliary data set includes: randomly selecting the anomaly detection model parameters; inputting the preset auxiliary data set and its corresponding labels as input data into the anomaly detection model for forward calculation to obtain an output result; calculating the mean square error loss between the output result and the input data, and calculating the optimization gradient of the anomaly detection model based on the mean square error loss; and optimizing the anomaly detection model parameters based on the optimization gradient.
[0012] Optionally, in one embodiment of the present application, initializing the data to be solved includes: randomly initializing a group of the data to be solved that obeys a uniform distribution, and obtaining a parsing label through an iLRG method.
[0013] Optionally, in one embodiment of the present application, the calculating the simulated gradient based on the data to be solved and the preset global model includes: inputting the data to be solved into the preset global model for forward operation to obtain a simulated output; and calculating the simulated training loss and the simulated gradient based on the simulated output and the parsed label.
[0014] Optionally, in one embodiment of the present application, the expression of the comprehensive gradient attack loss is:
[0015]
[0016] in, is the true gradient, is the simulated gradient, x′ is the data to be solved, α is the weight of the abnormal loss term, P is the abnormal detection model parameter, L anomoly (P, x′) is the abnormal loss value of the data to be solved, β is the weight of the total variation loss term, TV(x′) is the total variation loss value of the data to be solved, γ is the weight of the cosine distance loss term, is the cosine distance loss value.
[0017] The second aspect of the present application provides a deep gradient inversion attack device based on anomaly detection, including: a training module for training an anomaly detection model based on a preset auxiliary data set; a first calculation module for initializing the data to be solved, and calculating the simulated gradient based on the data to be solved and a preset global model; a second calculation module for calculating the comprehensive gradient attack loss based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client; and a reconstruction module for iteratively optimizing the data to be solved based on the comprehensive gradient attack loss using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data.
[0018] Optionally, in one embodiment of the present application, the training module includes: a selection unit, used to randomly select the anomaly detection model parameters; an output unit, used to input the preset auxiliary data set and its corresponding label as input data into the anomaly detection model for forward calculation to obtain an output result; a gradient unit, used to calculate the mean square error loss between the output result and the input data, and calculate the optimization gradient of the anomaly detection model based on the mean square error loss; an optimization unit, used to optimize the anomaly detection model parameters based on the optimization gradient.
[0019] Optionally, in one embodiment of the present application, the first calculation module includes: an initialization unit, used to randomly initialize a group of the to-be-solved data that obeys a uniform distribution, and obtain a parsing label through an iLRG method.
[0020] Optionally, in one embodiment of the present application, the first computing module further includes: an input unit, used to input the data to be solved into the preset global model for forward operation to obtain a simulated output; and a loss unit, used to calculate the simulated training loss and the simulated gradient based on the simulated output and the parsed label.
[0021] Optionally, in one embodiment of the present application, the expression of the comprehensive gradient attack loss is:
[0022]
[0023] in, is the true gradient, is the simulated gradient, x′ is the data to be solved, α is the weight of the abnormal loss term, P is the abnormal detection model parameter, L anomoly (P, x′) is the abnormal loss value of the data to be solved, β is the weight of the total variation loss term, TV(x′) is the total variation loss value of the data to be solved, γ is the weight of the cosine distance loss term, is the cosine distance loss value.
[0024] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the deep gradient inversion attack method based on anomaly detection as described in the above embodiment.
[0025] The fourth aspect embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the program is executed by a processor, it implements the above-mentioned deep gradient inversion attack method based on anomaly detection.
[0026] Therefore, the embodiments of the present application have the following beneficial effects:
[0027] The embodiments of the present application can train an anomaly detection model based on a preset auxiliary data set; initialize the data to be solved, and calculate the simulated gradient based on the data to be solved and the preset global model; calculate the comprehensive gradient attack loss based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client, and iteratively optimize the data to be solved using a preset optimization algorithm based on the comprehensive gradient attack loss to achieve a deep gradient inversion attack and reconstruct the privacy training data. The present application combines anomaly detection with a deep gradient inversion attack, and can extract prior knowledge from a small amount of auxiliary data sets through an anomaly detection model under the condition of meeting security assumptions, and introduce the reconstruction loss of anomaly detection into the attack optimization process, optimize the attack process in the form of regular regulation, and effectively improve the attack effect and success rate of the deep gradient inversion attack. As a result, the problems that the related technology relies on a large number of auxiliary data sets for deep gradient inversion attacks, has a low success rate, the generated images are prone to distortion, and violate the security model assumptions, making it difficult to reconstruct high-fidelity privacy training data, etc.
[0028] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0030] Figure 1 This is a diagram of the training process for federated learning;
[0031] Figure 2 A flowchart of a deep gradient inversion attack method based on anomaly detection provided according to an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the execution logic of a deep gradient inversion attack method based on anomaly detection provided by one embodiment of the present application;
[0033] Figure 4 A conceptual diagram of a reconstruction effect of a deep gradient inversion attack method based on anomaly detection provided by an embodiment of the present application;
[0034] Figure 5 A schematic diagram comparing the effects of reconstructing private data under a large batch of training data provided by an embodiment of the present application;
[0035] Figure 6 A schematic diagram comparing the effects of reconstructing private data in a complex data set provided by an embodiment of the present application;
[0036] Figure 7 A schematic diagram comparing the effects of privacy data reconstruction in a scenario of three-value quantization defense provided by an embodiment of the present application;
[0037] Figure 8 This is an example diagram of a deep gradient inversion attack device based on anomaly detection according to an embodiment of the present application;
[0038] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0039] Among them, 10-deep gradient inversion attack device based on anomaly detection, 100-training module, 200-first computing module, 300-second computing module, 400-reconstruction module, 901-memory, 902-processor, 903-communication interface. DETAILED DESCRIPTION
[0040] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0041] The following describes the deep gradient inversion attack method and device based on anomaly detection of the embodiment of the present application with reference to the accompanying drawings. In view of the fact that in the federated learning scenario of a large number of complex data sets mentioned in the above background technology, the posterior information contained in the gradient is insufficient, and the traditional deep gradient inversion attack is easy to fall into the gradient ambiguity trap and the local optimal solution, and it is difficult to effectively recover the data; in addition, although the GAN-based attack method uses prior knowledge to reduce the search space and improve the attack effect, it relies on a large number of auxiliary data sets, does not meet the security model assumption, and has the problem of serious distortion of the reconstructed image. The present application provides a deep gradient inversion attack method based on anomaly detection, in which the anomaly detection model is trained based on a preset auxiliary data set; the data to be solved is initialized, and the simulated gradient is calculated based on the data to be solved and the preset global model; according to the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client, the comprehensive gradient attack loss is calculated, and based on the comprehensive gradient attack loss, the preset optimization algorithm is used to iteratively optimize the data to be solved to achieve a deep gradient inversion attack and reconstruct the privacy training data. This application combines anomaly detection with deep gradient inversion attack. It can extract prior knowledge from a small amount of auxiliary data sets through anomaly detection models while meeting security assumptions, and introduce the reconstruction loss of anomaly detection into the attack optimization process, optimizing the attack process in the form of regularization, effectively improving the attack effect and success rate of deep gradient inversion attack. This solves the problems that related technologies rely on a large number of auxiliary data sets for deep gradient inversion attacks, have a low success rate, are prone to distortion in generated images, violate security model assumptions, and are difficult to reconstruct high-fidelity privacy training data.
[0042] In order to facilitate the description of a deep gradient inversion attack method based on anomaly detection proposed in an embodiment of the present application, the embodiment of the present application first makes the following assumptions about the attacker:
[0043] 1. The attacker is an honest but curious client in federated learning;
[0044] 2. The attacker holds a portion of data similar to other users, can legally synchronize and obtain the global model, and can obtain the gradient information uploaded by other users to the central server through eavesdropping or collusion;
[0045] 3. The attacker will honestly execute the federated learning process and will not conduct active attacks, but will attempt to restore the private training data of other federated learning clients through gradient information obtained through technical means such as eavesdropping or collusion.
[0046] In addition, in order to make the description more accurate and easier to understand, the embodiment of the present application first briefly explains the parameter symbols used in the deep gradient inversion attack method based on anomaly detection, as shown in Table 1:
[0047] Table 1 Parameters involved in deep gradient inversion attack and their meanings
[0048]
[0049] Specifically, Figure 2 A flowchart of a deep gradient inversion attack method based on anomaly detection provided in an embodiment of the present application.
[0050] like Figure 2 As shown, the deep gradient inversion attack method based on anomaly detection includes the following steps:
[0051] In step S201, an anomaly detection model is trained based on a preset auxiliary data set.
[0052] In an embodiment of the present application, an attacker can use a small amount of his own data set to train an anomaly detection model, so that he can use the anomaly detection method to extract prior knowledge from an appropriate amount of auxiliary data set to assist data reconstruction while complying with the security model.
[0053] Optionally, in one embodiment of the present application, an anomaly detection model is trained based on a preset auxiliary data set, including: randomly selecting anomaly detection model parameters; inputting the preset auxiliary data set and its corresponding labels as input data into the anomaly detection model for forward calculation to obtain an output result; calculating the mean square error loss between the output result and the input data, and calculating the optimization gradient of the anomaly detection model based on the mean square error loss; and optimizing the anomaly detection model parameters based on the optimization gradient.
[0054] It should be noted that, in the embodiment of the present application, the attacker can use a small amount of data set he holds to train an anomaly detection model, and the anomaly detection model can adopt an automatic encoder structure. The specific process of training the anomaly detection model in the embodiment of the present application is as follows:
[0055] 1. Randomly select model parameters during initialization;
[0056] 2. During the training process, first read in a batch of training data and its corresponding label x p ,y p , input it into the anomaly detection model for forward calculation to obtain the anomaly detection model output F(x p ; P);
[0057] 3. Calculate the mean square error loss MSE(F(x p ;P),x p ), and calculate the gradient of the training data on the anomaly detection model based on the loss
[0058] 4. Optimize the anomaly detection model parameter P according to the gradient:
[0059]
[0060] Among them, η p The learning rate to use for training the anomaly detection model.
[0061] Therefore, after multiple iterations of optimization, the above anomaly detection model can well learn the prior distribution in the image to reconstruct data that conforms to the input data distribution.
[0062] In step S202, the data to be solved is initialized, and the simulation gradient is calculated based on the data to be solved and a preset global model.
[0063] After training the anomaly detection model, further, in an embodiment of the present application, the attacker may initialize the data to be solved, and input the data to be solved into the global model to obtain a simulated output, calculate the simulated loss based on the simulated output, and thereby obtain a simulated gradient of the simulated loss to the global model.
[0064] Optionally, in one embodiment of the present application, initializing the data to be solved includes: randomly initializing a group of data to be solved that obeys a uniform distribution, and obtaining a parsing label through an iLRG method.
[0065] After training the anomaly detection model, in an embodiment of the present application, the attacker can randomly initialize a set of to-be-solved data x′ that obeys a uniform distribution, and use the iLRG method to obtain the parsing label y′, thereby providing a basis for reconstructing data that does not conform to the input data distribution.
[0066] Optionally, in one embodiment of the present application, a simulation gradient is calculated based on the data to be solved and a preset global model, including: inputting the data to be solved into the preset global model for forward operation to obtain a simulation output; and calculating a simulation training loss and a simulation gradient based on the simulation output and the parsed label.
[0067] In an embodiment of the present application, the attacker can input the data to be solved into the global model for forward operation to obtain the simulated output F(x′; W), and then calculate the simulated training loss l(F(x′; W)) of the batch based on the simulated output and the parsed label, and calculate the simulated gradient of the global model based on the simulated loss This provides important basis and guidance for the subsequent calculation of comprehensive gradient attack loss.
[0068] In step S203, the comprehensive gradient attack loss is calculated based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client.
[0069] It should be noted that, in the embodiment of the present application, before obtaining the simulated gradient, the federated learning client needs to generate the real gradient, that is, the shared gradient.
[0070] Specifically, the federated learning client reads a batch of training data x and the corresponding label y, inputs the training data x into the global model for forward operation to obtain the model output F(x; W); calculates the training loss l(F(x; W)) based on the model output and the batch label, and calculates the true gradient of the batch of training data on the global model based on the training loss
[0071] Therefore, the embodiments of the present application can calculate the cosine distance loss between the simulated gradient and the true gradient, the total variation loss and the anomaly loss of the data to be solved, and combine the trained anomaly detection model to obtain the comprehensive gradient attack loss.
[0072] Optionally, in one embodiment of the present application, the expression of the comprehensive gradient attack loss is:
[0073]
[0074] in, is the true gradient, is the simulated gradient, x′ is the data to be solved, α is the weight of the abnormal loss term, P is the anomaly detection model parameter, and L anomoly (P,x′) is the abnormal loss value of the data to be solved, β is the weight of the total variation loss term, TV(x′) is the total variation loss value of the data to be solved, γ is the weight of the cosine distance loss term, is the cosine distance loss value.
[0075] Specifically, in the embodiment of the present application, the attacker can obtain the simulated gradient according to the above Monitor the actual gradient obtained The randomly initialized data to be solved x′ and the trained anomaly detection model parameter P are used to calculate the comprehensive gradient attack loss. In the embodiment of the present application, the comprehensive gradient attack loss Loss can be obtained by adding the three losses of anomaly loss, total variation loss, and cosine distance loss. The formula of the comprehensive gradient attack loss is as follows:
[0076]
[0077] Among them, the abnormal loss is L anomoly (P,x′)=SE(P(x p ; P), x′), α is the weight of the abnormal loss term, L anomoly(P, x′) is the anomaly loss value of the data to be solved calculated by the anomaly detection model parameter P, which can describe the similarity between the data to be solved and the true distribution. When the data to be solved conforms to the true data distribution, this item is almost 0 to avoid distortion of the data to be solved during the optimization process.
[0078] The total variation loss is TV(x′)=∑ i,j ((x i,j+1 -x i,j ) 2 +(x i+1,j -x i,j ) 2 ) 2 , β is the weight of the total variation loss term, TV(x′) is the calculated total variation loss value of the data to be solved, and the total variation loss can describe the local similarity of the image data, that is, the degree of smoothness. It is a natural image prior that can remove the data to be solved, that is, the noise points in the image.
[0079] The cosine distance loss is γ is the weight of the cosine distance loss term, The cosine distance loss is the value obtained by calculating the quantized gradient and the simulated gradient. The cosine distance loss can describe the directional similarity between the simulated gradient and the true gradient. The cosine similarity is highest when the directions of the two are exactly the same, and the cosine similarity is lowest when the directions of the two are opposite.
[0080] Therefore, the embodiments of the present application can mine prior knowledge from a small amount of auxiliary data sets to compensate for the information loss of gradients while complying with the security model, can effectively get rid of the ambiguity and local optimal solution dilemma, and greatly ensure the realization of reconstructing high-fidelity original data.
[0081] In step S204, based on the comprehensive gradient attack loss, the data to be solved is iteratively optimized using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data.
[0082] Furthermore, the embodiment of the present application can calculate the gradient of the to-be-solved data and the simulation output by comprehensive gradient attack loss Loss, and optimize the to-be-solved data x′ and by using the gradient descent method: Among them, η is the learning rate, y′ is the parsed label, such as Figure 3 As shown, after multiple iterations of optimization, the data to be solved can gradually approach the user's private training data, thereby reconstructing the private training data.
[0083] The following is a comparative explanation of the privacy data reconstruction effect of the deep gradient inversion attack method based on anomaly detection proposed in this application in combination with the accompanying drawings.
[0084] Figure 4 A conceptual diagram of the reconstruction effect of the deep gradient inversion attack method based on anomaly detection. Figure 4 It can be seen that the embodiment of the present application can effectively enhance the attack effect under the condition of complying with the security model by introducing the reconstruction loss of anomaly detection into the attack optimization process.
[0085] Figure 5 This is a schematic diagram comparing the effects of reconstructing private data under large batches of training data; Figure 6 This is a schematic diagram comparing the effects of privacy data reconstruction in the case of complex data sets; Figure 7 The figure is a schematic diagram comparing the effects of privacy data reconstruction in the scenario of three-value quantization defense.
[0086] It can be understood by those skilled in the art that Figure 5 , Figure 6 as well as Figure 7 It can be seen that the deep gradient inversion attack method based on anomaly detection proposed in this application can perform gradient inversion attacks in scenarios that comply with the federated learning security model. Regardless of whether it is in large batches of training data, complex data sets or ternary quantization defense scenarios, its effect is far better than technical methods such as LG, IG and GGL. Therefore, this application can effectively use prior knowledge to enhance the reconstruction effect in scenarios where gradient information cannot provide sufficient a posteriori knowledge, so that the quality of the inverted training data is better than that of traditional deep gradient inversion attack methods.
[0087] According to the deep gradient inversion attack method based on anomaly detection proposed in the embodiment of the present application, the anomaly detection model is trained based on a preset auxiliary data set; the data to be solved is initialized, and the simulated gradient is calculated based on the data to be solved and the preset global model; the comprehensive gradient attack loss is calculated based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client, and based on the comprehensive gradient attack loss, the data to be solved is iteratively optimized using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data. The present application combines anomaly detection with a deep gradient inversion attack, and can extract prior knowledge from a small amount of auxiliary data sets through an anomaly detection model under the condition of meeting security assumptions, and introduce the reconstruction loss of anomaly detection into the attack optimization process, optimize the attack process in the form of regularization, and effectively improve the attack effect and success rate of the deep gradient inversion attack.
[0088] Secondly, the deep gradient inversion attack device based on anomaly detection proposed in an embodiment of the present application is described with reference to the accompanying drawings.
[0089] Figure 8 It is a block diagram of a deep gradient inversion attack device based on anomaly detection in an embodiment of the present application.
[0090] like Figure 8As shown, the deep gradient inversion attack device 10 based on anomaly detection includes: a training module 100, a first calculation module 200, a second calculation module 300 and a reconstruction module 400.
[0091] The training module 100 is used to train the anomaly detection model based on a preset auxiliary data set and initialize the data to be solved.
[0092] The first calculation module 200 is used to calculate the simulation gradient based on the data to be solved and the preset global model.
[0093] The second calculation module 300 is used to calculate the comprehensive gradient attack loss based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client.
[0094] The reconstruction module 400 is used to iteratively optimize the data to be solved based on the comprehensive gradient attack loss using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data.
[0095] Optionally, in one embodiment of the present application, the training module 100 includes: a selection unit, an output unit, a gradient unit and an optimization unit.
[0096] The selection unit is used to randomly select anomaly detection model parameters.
[0097] The output unit is used to input the preset auxiliary data set and its corresponding labels as input data into the anomaly detection model for forward calculation to obtain the output result.
[0098] The gradient unit is used to calculate the mean square error loss between the output result and the input data, and calculate the optimization gradient of the anomaly detection model based on the mean square error loss.
[0099] The optimization unit is used to optimize the anomaly detection model parameters based on the optimization gradient.
[0100] Optionally, in one embodiment of the present application, the first calculation module 200 includes: an initialization unit, used to randomly initialize a group of to-be-solved data that obeys a uniform distribution, and obtain a parsing label through an iLRG method.
[0101] Optionally, in one embodiment of the present application, the first calculation module 200 further includes: an input unit and a loss unit.
[0102] The input unit is used to input the data to be solved into the preset global model for forward operation to obtain the simulation output;
[0103] The loss unit is used to calculate the simulated training loss and simulated gradients based on the simulated output and parsed labels.
[0104] Optionally, in one embodiment of the present application, the expression of the comprehensive gradient attack loss is:
[0105]
[0106] in, is the true gradient, is the simulated gradient, x′ is the data to be solved, α is the weight of the abnormal loss term, P is the anomaly detection model parameter, and L anomoly (P,x′) is the abnormal loss value of the data to be solved, β is the weight of the total variation loss term, TV(x′) is the total variation loss value of the data to be solved, γ is the weight of the cosine distance loss term, is the cosine distance loss value.
[0107] It should be noted that the aforementioned explanation of the embodiment of the deep gradient inversion attack method based on anomaly detection is also applicable to the deep gradient inversion attack device based on anomaly detection in this embodiment, and will not be repeated here.
[0108] According to the deep gradient inversion attack device based on anomaly detection proposed in the embodiment of the present application, the anomaly detection model is trained based on a preset auxiliary data set; the data to be solved is initialized, and the simulated gradient is calculated based on the data to be solved and the preset global model; the comprehensive gradient attack loss is calculated based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client, and based on the comprehensive gradient attack loss, the data to be solved is iteratively optimized using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data. The present application combines anomaly detection with a deep gradient inversion attack, and can extract prior knowledge from a small amount of auxiliary data sets through an anomaly detection model under the condition of meeting security assumptions, and introduce the reconstruction loss of anomaly detection into the attack optimization process, optimize the attack process in the form of regularization, and effectively improve the attack effect and success rate of the deep gradient inversion attack.
[0109] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0110] A memory 901 , a processor 902 , and a computer program stored in the memory 901 and executable on the processor 902 .
[0111] When the processor 902 executes the program, the deep gradient inversion attack method based on anomaly detection provided in the above embodiment is implemented.
[0112] Furthermore, the electronic device further comprises:
[0113] The communication interface 903 is used for communication between the memory 901 and the processor 902 .
[0114] The memory 901 is used to store computer programs that can be executed on the processor 902 .
[0115] The memory 901 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0116] If the memory 901, the processor 902 and the communication interface 903 are implemented independently, the communication interface 903, the memory 901 and the processor 902 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0117] Optionally, in a specific implementation, if the memory 901, the processor 902 and the communication interface 903 are integrated on a chip, the memory 901, the processor 902 and the communication interface 903 can communicate with each other through an internal interface.
[0118] The processor 902 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0119] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned deep gradient inversion attack method based on anomaly detection.
[0120] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0121] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0122] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0123] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.
[0124] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0125] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0126] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0127] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A deep gradient inversion attack method based on anomaly detection, characterized in that: The following steps are involved: Train anomaly detection models based on preset auxiliary datasets; Initializing the data to be solved, and calculating the simulation gradient based on the data to be solved and a preset global model; Calculate the comprehensive gradient attack loss based on the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client, and Based on the comprehensive gradient attack loss, the data to be solved is iteratively optimized using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data.
2. The method according to claim 1, characterized in that The training of the anomaly detection model based on the preset auxiliary data set includes: Randomly selecting the anomaly detection model parameters; Input the preset auxiliary data set and its corresponding label as input data to the anomaly detection model for forward calculation to obtain an output result; Calculating the mean square error loss between the output result and the input data, and calculating the optimization gradient of the anomaly detection model based on the mean square error loss; The anomaly detection model parameters are optimized based on the optimization gradients.
3. The method according to claim 1, characterized in that The initializing the data to be solved comprises: A set of the to-be-solved data that obeys uniform distribution is randomly initialized, and the parsing labels are obtained by the iLRG method.
4. The method according to claim 3, characterized in that The calculating the simulation gradient based on the data to be solved and the preset global model includes: Inputting the data to be solved into the preset global model for forward operation to obtain simulation output; A simulated training loss and the simulated gradient are calculated based on the simulated output and the parsed label.
5. The method according to claim 1, characterized in that The expression of the comprehensive gradient attack loss is: in, is the true gradient, is the simulated gradient, x′ is the data to be solved, α is the weight of the abnormal loss term, P is the abnormal detection model parameter, L anomoly (P, x′) is the abnormal loss value of the data to be solved, β is the weight of the total variation loss term, TV(x′) is the total variation loss value of the data to be solved, γ is the weight of the cosine distance loss term, is the cosine distance loss value.
6. A deep gradient inversion attack device based on anomaly detection, characterized in that: include: A training module, used to train an anomaly detection model based on a preset auxiliary data set; A first calculation module, used for initializing the data to be solved, and calculating the simulation gradient based on the data to be solved and a preset global model; A second calculation module is used to calculate the comprehensive gradient attack loss according to the simulated gradient, the data to be solved, the trained anomaly detection model, and the real gradient generated by the federated learning client, and A reconstruction module is used to iteratively optimize the data to be solved based on the comprehensive gradient attack loss using a preset optimization algorithm to implement a deep gradient inversion attack and reconstruct the privacy training data.
7. The device according to claim 6, characterized in that The training module includes: A selection unit, used for randomly selecting the anomaly detection model parameters; An output unit, used to input the preset auxiliary data set and its corresponding label as input data into the anomaly detection model for forward calculation to obtain an output result; A gradient unit, used to calculate the mean square error loss between the output result and the input data, and calculate the optimization gradient of the anomaly detection model based on the mean square error loss; An optimization unit is used to optimize the anomaly detection model parameters based on the optimization gradient.
8. The device according to claim 6, characterized in that The expression of the comprehensive gradient attack loss is: in, is the true gradient, is the simulated gradient, x′ is the data to be solved, α is the weight of the abnormal loss term, P is the abnormal detection model parameter, L anomoly (P, x′) is the abnormal loss value of the data to be solved, β is the weight of the total variation loss term, TV(x′) is the total variation loss value of the data to be solved, γ is the weight of the cosine distance loss term, is the cosine distance loss value.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the deep gradient inversion attack method based on anomaly detection as described in any one of claims 1 to 5.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the deep gradient inversion attack method based on anomaly detection as described in any one of claims 1 to 5.
