Federal learning defecation vehicle attack camouflage method and device based on noise

By adding a dynamic Gaussian noise camouflage attack for malicious clients in the federated learning system, the problem of difficulty in detecting complex hitchhiking attacks with existing technology is solved, and a more effective hitchhiking effect is achieved, affecting system fairness and global model performance.

CN118740506AInactive Publication Date: 2024-10-01CHENGDU UNIVERSITY OF TECHNOLOGY

Patent Information

Application Number
CN202411027183.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing federated learning systems are difficult to detect when facing complex free-rider attacks, causing system fairness and global model convergence and accuracy to be affected.

Method used

By adding dynamic random Gaussian noise to the model parameters uploaded by the malicious client, it is disguised as participating in model updates, thereby deceiving the server, making it difficult to identify free-riding behavior, and achieving a more effective free-riding attack.

Benefits of technology

It effectively disguises the parameter update behavior of the real client, allowing malicious hitchhiking clients to gain model performance gains without being detected, affecting the convergence and accuracy of the global model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740506A_ABST
    Figure CN118740506A_ABST
Patent Text Reader

Abstract

The invention discloses a noise-based federal learning defecation vehicle attack camouflage method and device, and the method comprises the steps: initializing a first global model parameter, obtaining a second global model parameter, and enabling a server to transmit the second global model parameter to a client; the client performs updating according to the local data; the client side does not actually update local model parameters by adopting a simple defecation vehicle attack or a disguised defecation vehicle attack added with random noise, and then the client side uploads the model parameters to the server; the server aggregates the model parameters uploaded by all the clients to generate a third global model parameter as an initial model parameter of the local model of the next round of iteration; and repeating the steps until a preset number of training rounds is reached. By disguising the defecation vehicle taking attack, the malicious client can complete the attack task, avoid the detection of the server side and obtain the same reward as the normal client, so that the server is difficult to identify the defecation vehicle taking behavior, and the malicious client for taking the defecation vehicle can achieve the defecation vehicle taking attack effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and in particular to a method and device for camouflaging a federated learning free-rider attack based on noise. Background Art

[0002] Federated Learning is a distributed machine learning method that allows multiple clients to jointly train a global model without sharing their local data. This method is particularly suitable for scenarios with high data privacy and security requirements, such as healthcare, finance, and mobile devices. Federated learning distributes the model training process to each client, thereby avoiding the need to centralize data on a single server for processing and reducing the risk of data privacy leakage.

[0003] However, there are also potential security threats and challenges in the federated learning environment. One of them is the "free-rider attack". In this attack, malicious clients obtain the final global model by pretending to participate in the model update process without actually participating in the local model training. These malicious clients do not contribute any valuable updates, but enjoy the same model performance benefits as other honest clients. This behavior not only undermines the fairness of the system, but may also affect the convergence and accuracy of the global model.

[0004] In existing federated learning research, data privacy and security have been widely discussed, especially in the existing technology to deal with simple free-rider attacks have a certain detection ability. Simple free-rider attacks are easy to be detected by various machine learning models because they neither update nor perturb parameters during the attack.

[0005] In view of the limitations of simple free-rider attacks and their easy detection, the present invention proposes a noise-based free-rider disguise attack method. The main design of this method is that the malicious client pretends to participate in the model update process by adding dynamic noise, thereby enjoying the same model performance benefits as other honest clients, but in fact no actual model update is performed. This method can have a negative impact on the fairness of the system and the convergence and accuracy of the global model, thereby achieving the purpose of the attack. Since this dynamic noise-added disguise attack method is difficult to be detected by existing machine learning models, it can achieve a more effective free-rider attack effect. Summary of the invention

[0006] The purpose of the present invention is to overcome the deficiencies of the prior art and to provide a method and device for camouflaging a federated learning free-rider attack based on noise.

[0007] The objective of the present invention is achieved through the following technical solutions: In a first aspect, the present invention provides a noise-based federated learning free-rider attack camouflage method, comprising the following steps: S1. Initialize the first global model parameter, obtain the second global model parameter, and the server distributes the second global model parameter to each client; S2. The client updates the model parameters based on local data; S3, the free-riding client uses a simple free-riding attack or a disguised free-riding attack by adding random noise without actually updating the local model parameters, and then the client uploads the model parameters to the server; S4: The server aggregates the model parameters uploaded by all clients and generates third global model parameters as initial model parameters of the local model in the next round of iteration; S5. Repeat steps S1-S4 until a predetermined number of training rounds is reached.

[0008] Based on the first aspect, step S1 includes: the server initializes the first global model parameter , obtain the second global model parameter , the server sets the second global model parameter Sent to I clients, where , each client i has a local dataset , local dataset Include samples.

[0009] Preferably, in step S2, the client i generates a local data set according to the local data set. Minimize the local cost function , perform E rounds of local model parameter updates, and update the global model parameters of client i in the t+1th round Upload to the server, including the following sub-steps: S11. Set the local loss function: ,in is the contribution of a single sample to the loss function, is the global model parameter of client i, is the number of samples of fair clients; S12. Calculate the gradient of the local loss function: ; S13. Use small batches of samples Perform SGD update and randomly estimate the loss function as , the corresponding stochastic gradient is ; The SGD update formula is ,in is the learning rate, is the global model parameter of client i in round t, is the updated global model parameter of client i in round t+1; S14. The client performs gradient modeling through Gaussian distribution: ,in is the full gradient, is the variance of the loss function, S is the size of the number of samples in the mini-batch, Represents the total number of samples in the distributed dataset.

[0010] Preferably, the simple free-riding attack in step S3 includes that the free-riding client directly returns the second global model parameter in each iteration: ,in , k is a dataset with a small batch size, K is the total sample data.

[0011] Preferably, the disguised free-riding attack in step S3 includes the free-riding client adding random Gaussian noise to the uploaded model parameters to disguise as the SGD update process of the fair client: ,in is Gaussian white noise, and the generation formula of Gaussian white noise is , is the square of the standard deviation of the noise, is the time-varying noise intensity function, the noise variance The calculation formula is: , is the noise intensity, is the curvature of the local loss function, is the declared sample size.

[0012] Preferably, in step S4, the server aggregates the model parameters uploaded by all clients to generate the third global model parameters: ,in is the sample number of free-riding clients.

[0013] Preferably, in step S4, the server aggregates the model parameters uploaded by all clients to generate the third global model parameters: ,in , k is a dataset with a small batch size, K is the total sample data, is the sample number of free-riding clients.

[0014] Preferably, the random Gaussian noise includes: setting a time-varying noise model so that the noise intensity function of the hitchhiking client is and the noise standard deviation decreases with time, and satisfy and , if the noise variance tends to zero, and a simple free-rider attack model is obtained; When the noise intensity function Converges to a constant , determine the constant Whether the value of is zero, if it is zero, the federated learning process follows the simple free-rider attack behavior, if it is not zero, the federated learning process follows the disguised free-rider attack behavior.

[0015] In a second aspect, the present invention further provides a noise-based federated learning free-rider attack camouflage device, which is used to implement any one of the above-mentioned noise-based federated learning free-rider attack camouflage methods, including: The server module is used to send the current global model parameters to all clients participating in the training before each round of training. After receiving the local model parameters uploaded by all clients, the server module aggregates these parameters by weighted average method to generate new global model parameters, which are used for the next round of training. The client module is used to perform several rounds of local training using local data after receiving the global model parameters sent by the server, calculate the gradient of the local model parameters, and update the model parameters. The updated model parameters are uploaded to the server after the training is completed; The free-rider attack module is used to directly return the global model parameters from the server without modifying or updating them after receiving them; or to upload the received global model parameters to the server after adding a time-varying random Gaussian noise term; the noise intensity is calculated according to the designed noise formula and dynamically adjusted over time, so that the uploaded parameters look like they have been actually trained locally; The monitoring module is used to record the parameter upload status of all clients in each round of iteration, including timestamp, client ID, uploaded parameter value and its corresponding model parameter; analyze the recorded data, including whether the convergence speed, accuracy and stability of the model decrease, so as to evaluate the attack effect of disguised free-riding.

[0016] The beneficial effects of the present invention are: 1) The present invention adds noise items to make the uploaded parameters look like they have been actually trained locally, thereby deceiving the server into participating in the aggregation process.

[0017] 2) After receiving the parameters uploaded by all clients through the server, the present invention updates the global model parameters in a weighted average manner, records and analyzes the impact of different types of free-rider attacks on the performance of the global model, and can effectively evaluate the threat of camouflage attacks with added noise to the federated learning training process.

[0018] 3) The present invention disguises the parameter update behavior of the real client by adding a free-rider disguise attack with dynamically changing noise, making it difficult for the server to identify its free-rider behavior, thereby enabling the free-rider malicious client to achieve the free-rider attack effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A step diagram of a method for camouflaging a federated learning free-rider attack based on noise according to an embodiment of the present invention; Figure 2 It is a specific flow chart of a method for camouflaging a federated learning free-rider attack based on noise according to an embodiment of the present invention; Figure 3 This is a structural diagram of a noise-based federated learning free-rider attack camouflage device according to an embodiment of the present invention; Figure 4 A computer device of a noise-based federated learning free-rider attack camouflage device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0021] For example, Figure 1 As shown, the present invention discloses a noise-based federated learning free-rider attack camouflage method, comprising: S1. Initialize the first global model parameter, obtain the second global model parameter, and the server distributes the second global model parameter to each client; S2. The client updates the model parameters based on local data; S3, the free-riding client uses a simple free-riding attack or a disguised free-riding attack by adding random noise without actually updating the local model parameters, and then the client uploads the model parameters to the server; S4: The server aggregates the model parameters uploaded by all clients and generates third global model parameters as initial model parameters of the local model in the next round of iteration; S5. Repeat steps S1-S4 until the predetermined number of training rounds is reached; repeat the above distribution, update and aggregation steps until the predetermined number of training rounds is reached. Recording and analyzing the impact of different types of free-rider attacks on the performance of the global model can effectively realize the impact of free-rider disguised attacks with added noise on the performance of the federated learning system.

[0022] Specifically, step S1 includes: the server initializes the first global model parameter , obtain the second global model parameter , the server sets the second global model parameter Sent to I clients, where , each client i has a local dataset , local dataset Include samples.

[0023] Specifically, in step S2, client i generates a local data set based on the local data set. Minimize the local cost function , perform E rounds of local model parameter updates, and update the global model parameters of client i in the t+1th round Upload to the server, including the following sub-steps: S11. Set the local loss function: ,in is the contribution of a single sample to the loss function, is the global model parameter of client i, is the number of samples of fair clients; S12. Calculate the gradient of the local loss function: ; S13. Use small batches of samples Perform SGD update and randomly estimate the loss function as , the corresponding stochastic gradient is ; The SGD update formula is ,in is the learning rate, is the global model parameter of client i in round t, is the updated global model parameter of client i in round t+1; S14. The client performs gradient modeling through Gaussian distribution: ,in is the full gradient, is the variance of the loss function, S is the size of the number of samples in the mini-batch, Represents the total number of samples in the distributed dataset.

[0024] Specifically, step S4 includes: in each iteration step, the server updates and generates the third global model parameter according to the global model parameter of the client i in the t+1th round uploaded by the client in a weighted average manner: ,in Represents the total number of samples in the distributed dataset.

[0025] By calculating the noise variance, the impact of the noise-introduced free-rider disguise attack on the federated learning training is investigated. The addition of the noise term is intended to make the uploaded parameters look like they have been actually trained locally, thereby deceiving the server into participating in the aggregation process. After the server receives the parameters uploaded by all clients, it updates the global model parameters in a weighted average manner. By recording and analyzing the impact of different types of free-rider attacks on the performance of the global model, the present invention can effectively evaluate the threat of noise-added disguise attacks to the federated learning training process.

[0026] Exemplarily, the present invention discloses a method for camouflaging a federated learning free-rider attack based on noise, and its specific flow chart is as follows: Figure 2 As shown, the simple free-riding attack in step S3 includes that the free-riding client directly returns the second global model parameter in each iteration: ,in , k is a dataset with a small batch size, K is the total sample data; the server aggregates the model parameters uploaded by all clients to generate the third global model parameters: ,in, is the sample number of free-riding clients, Represents the total number of samples in the distributed dataset.

[0027] The hitchhiking client adds random Gaussian noise to the uploaded model parameters. In the disguised hitchhiking attack, the strategy and parameter selection of noise injection have a crucial impact on the attack effect. In order to more accurately analyze the impact of the noise-based disguised hitchhiking attack on the federated learning system, the specific method and steps of noise injection are described in detail below. In each iteration, in order to disguise the real local model update process, the hitchhiking client adds Gaussian white noise to the uploaded model parameters. Gaussian white noise The formula for generating , is the square of the standard deviation of the noise, the standard deviation of the noise The choice of directly affects the effect of the camouflage free-rider attack. If the standard deviation is too small, the camouflage effect is not obvious and it is easy to be detected; if the standard deviation is too large, it will significantly affect the convergence of the global model. The selection requires multiple trials and adjustments during the spoofing process to find the best balance. This value can be set according to the specific attack strength and is used in the SGD update process disguised as a fair client: ,in is Gaussian white noise, and the generation formula of Gaussian white noise is , is the square of the standard deviation of the noise, is a time-varying noise intensity function. To avoid the server detecting fixed-pattern noise, the noise intensity function Designed to vary over time, the noise variance The calculation formula is: , is the noise intensity, is the curvature of the local loss function, For the declared number of samples, the noise intensity function The adjustment can be achieved by modifying the parameters in the formula, especially for different training stages, , , and E, etc., so that the noise intensity changes dynamically over time, disguising a more complex attack scenario. The server aggregates the model parameters uploaded by all clients to generate the third global model parameters: ,in, k is a dataset with a small batch size, K is the total sample data, is the sample number of free-riding clients.

[0028] Exemplarily, the random Gaussian noise includes: setting a time-varying noise model so that the noise intensity function of the hitchhiking client is and the noise standard deviation decreases with time, and satisfy and , in this process, the asymptotic variance tends to zero, so that a simple free-rider attack model can be gradually obtained. The change produced by this gradual process is the process in which the disguised free-rider attack disappears. From this, we can obtain the effect of the change in model effectiveness caused by the change in the free-rider attack mode. If the noise variance tends to zero, thus obtaining a simple free-rider attack model; when the noise intensity function Converges to a constant , determine the constant Whether the value of is zero, the federated learning process will follow the asymptotic behavior of simple and disguised free-rider attacks respectively. If it is zero, the federated learning process follows the simple free-rider attack behavior. If it is not zero, the federated learning process follows the disguised free-rider attack behavior.

[0029] Exemplarily, the present invention provides a noise-based federated learning free-rider attack camouflage device, the structure of which is shown in FIG. Figure 3 As shown, including: The server module is used to send the current global model parameters to all clients participating in the training before each round of training. After receiving the local model parameters uploaded by all clients, the server module aggregates these parameters by weighted average method to generate new global model parameters, which will be used for the next round of training; The client module is used to perform several rounds of local training using local data after receiving the global model parameters sent by the server, calculate the gradient of the local model parameters, and update the model parameters. The updated model parameters are uploaded to the server after the training is completed; The free-rider attack module is used to directly return the global model parameters received from the server to the server without any modification or update. Alternatively, the received global model parameters are added with a time-varying random Gaussian noise term and uploaded to the server. The noise intensity is calculated according to the designed noise formula and dynamically adjusted over time, so that the uploaded parameters look like they have been actually trained locally. The monitoring module is used to record the parameter upload status of all clients in each round of iteration, including timestamp, client ID, uploaded parameter value and its corresponding model parameter. The recorded data is analyzed, including whether the model's convergence speed, accuracy, stability and other indicators have decreased, so as to evaluate the attack effect of disguised free-riding.

[0030] For example, a computer device of a noise-based federated learning free-rider attack disguised device is as follows Figure 4As shown, it includes: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned noise-based federated learning free-rider attack disguise method. A computer-readable storage medium is also provided, on which a program is stored, and when the program is executed by the processor, the above-mentioned noise-based federated learning free-rider attack disguise method is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capability as described above, such as a hard disk or memory. The computer-readable storage medium can also be any device with data processing capability, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Further, the computer-readable storage medium can also include both an internal storage unit of any device with data processing capability and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and can also be used to temporarily store data that has been output or is to be output.

[0031] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.

Claims

1. A noise-based free-rider attack camouflage method for federated learning. It is characterized in that The following steps are involved: S1. Initialize the first global model parameter, obtain the second global model parameter, and the server distributes the second global model parameter to each client; S2. The client updates the model parameters based on local data; S3, the free-riding client uses a simple free-riding attack or a disguised free-riding attack by adding random noise without actually updating the local model parameters, and then the client uploads the model parameters to the server; S4: The server aggregates the model parameters uploaded by all clients and generates third global model parameters as initial model parameters of the local model in the next round of iteration; S5. Repeat steps S1-S4 until a predetermined number of training rounds is reached.

2. A method for camouflaging a free-rider attack in federated learning based on noise according to claim 1, Features: The step S1 includes: the server initializes the first global model parameter , obtain the second global model parameter , the server sets the second global model parameter Sent to I clients, where , each client i has a local dataset , local dataset Include samples.

3. A noise-based federated learning free-rider attack camouflage method according to claim 2, Features: In step S2, client i calculates the local data set based on the local data set. Minimize the local cost function , perform E rounds of local model parameter updates, and update the global model parameters of client i in round t+1 Upload to the server, including the following sub-steps: S11. Set the local loss function: ,in is the contribution of a single sample to the loss function, is the global model parameter of client i, is the number of samples of fair clients; S12. Calculate the gradient of the local loss function: ; S13. Use small batches of samples Perform SGD update and randomly estimate the loss function as , the corresponding stochastic gradient is ; The SGD update formula is ,in is the learning rate, is the global model parameter of client i in round t, is the updated global model parameter of client i in round t+1; S14. The client performs gradient modeling through Gaussian distribution: ,in is the full gradient, is the variance of the loss function, S is the size of the number of samples in the mini-batch, Represents the total number of samples in the distributed dataset.

4. A method for camouflaging a free-rider attack in federated learning based on noise according to claim 3, Features: The simple free-riding attack in step S3 includes that the free-riding client directly returns the second global model parameter in each iteration: ,in , k is a dataset with a small batch size, K is the total sample data.

5. According to claim 3, a noise-based federated learning free-rider attack camouflage method, Features: The disguised free-riding attack in step S3 includes: the free-riding client adds random Gaussian noise to the uploaded model parameters to disguise as the SGD update process of the fair client: ,in is Gaussian white noise, and the generation formula of Gaussian white noise is , is the square of the standard deviation of the noise, is the time-varying noise intensity function, the noise variance The calculation formula is: , is the noise intensity, is the curvature of the local loss function, is the declared sample size.

6. A method for camouflaging a free-rider attack in federated learning based on noise according to claim 4, Features: In step S4, the server aggregates the model parameters uploaded by all clients to generate the third global model parameters: ,in is the sample number of free-riding clients.

7. A method for camouflaging a free-rider attack in federated learning based on noise according to claim 5, Features: In step S4, the server aggregates the model parameters uploaded by all clients to generate the third global model parameters: ,in , k is a dataset with a small batch size, K is the total sample data, is the sample number of free-riding clients.

8. According to claim 5, a noise-based federated learning free-rider attack camouflage method, It is characterized in that The random Gaussian noise includes: setting a time-varying noise model so that the noise intensity function of the hitchhiking client and noise standard deviation decreases with time, and satisfy and , if the noise variance tends to zero, and a simple free-rider attack model is obtained; When the noise intensity function Converges to a constant , determine the constant Whether the value of is zero, if it is zero, the federated learning process follows the simple free-rider attack behavior, if it is not zero, the federated learning process follows the disguised free-rider attack behavior.

9. A noise-based federated learning free-rider attack camouflage device, used to implement a noise-based federated learning free-rider attack camouflage method according to any one of claims 1 to 8, It is characterized in that include: The server module is used to send the current global model parameters to all clients participating in the training before each round of training. After receiving the local model parameters uploaded by all clients, the server module aggregates these parameters by weighted average method to generate new global model parameters, which are used for the next round of training. The client module is used to perform several rounds of local training using local data after receiving the global model parameters sent by the server, calculate the gradient of the local model parameters, and update the model parameters. The updated model parameters are uploaded to the server after the training is completed; The free-rider attack module is used to directly return the global model parameters from the server without modifying or updating them after receiving them; or to upload the received global model parameters to the server after adding a time-varying random Gaussian noise term; the noise intensity is calculated according to the designed noise formula and dynamically adjusted over time, so that the uploaded parameters look like they have been actually trained locally; The monitoring module is used to record the parameter upload status of all clients in each round of iteration, including timestamp, client ID, uploaded parameter value and its corresponding model parameter; analyze the recorded data, including whether the convergence speed, accuracy and stability of the model decrease, so as to evaluate the attack effect of disguised free-riding.

Citation Information

Patent Citations

  • Federated learning toilet vehicle attack defense method based on block chain

    CN112714106A

Cited By

  • Federal learning defecation vehicle defense method based on test task and related equipment

    CN121052409A