System and method for detecting security vulnerabilities based on federated learning
By simulating attacks and comparing results, the security performance of the federated learning system was tested, which solved the problem of insufficient defense against replay attacks and improved the system's security.
Patent Information
- Application Number
- CN202111369304.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2041-11-18
AI Technical Summary
Federated learning systems are vulnerable to replay attacks, and there is a lack of effective defenses in existing technologies.
By simulating the training process of the federated learning system under test, training nodes are randomly selected for simulated attacks. A pre-trained replay attack model is used to prevent the federated model from converging or to make it converge to a bad local minimum. The simulation results are then compared to determine the system's security performance.
By understanding in advance the extent to which the federated learning system defends against replay attacks, timely improvements and enhancements can be made to improve the system's security performance.
Smart Images

Figure CN114021152B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of security detection technology for federated learning systems, and in particular to a method and device for detecting system security vulnerabilities based on federated learning. Background Technology
[0002] In the era of big data, the importance of data is increasingly prominent. More data often means better and stronger models, which can play a greater role and generate higher economic benefits. However, data silos are a common problem in production practice. Federated learning solves this problem. Instead of centralizing all data to a single node to train machine learning models, federated learning allows each node with data to train a local model. Each node shares its local model parameters in each iteration, and the central node aggregates all the model parameters to obtain a current global model. When the model converges, the central node obtains the final global model. Federated learning helps multiple participants build shared, high-performance models while meeting user privacy and data confidentiality requirements. However, with the development of federated learning, models also face numerous security risks. Due to the distributed structure of federated learning and the communication between nodes and the central node, traditional network attack methods such as replay attacks can become new ways to poison models. Currently, federated learning has relatively few defenses against replay attacks, making systems based on federated learning vulnerable to such attacks. Summary of the Invention
[0003] To at least partially overcome the problem of federated learning systems being vulnerable to replay attacks in related technologies, this application provides a system security vulnerability detection method and device based on federated learning.
[0004] The proposed solution is as follows:
[0005] According to a first aspect of the embodiments of this application, a system security vulnerability detection method based on federated learning is provided, comprising:
[0006] Simulates the federated model training process of the federated learning system to be tested;
[0007] During the training process of the federated model, training nodes of the federated model are randomly selected for simulated attacks.
[0008] Simulations were performed on the federated model before and after the simulated attack, and the simulation results were compared to generate comparison results.
[0009] The security performance of the federated learning system under test is determined based on the comparison results.
[0010] Preferably, in one feasible implementation of this application, the step of randomly selecting training nodes of the federated model for simulated attacks includes:
[0011] A pre-trained replay attack model is used to simulate attacks on the training nodes of the federated model.
[0012] Preferably, in one achievable manner according to this application, the replay attack model is used to prevent the federated model from converging, or to cause the federated model to converge to a bad local minimum.
[0013] Preferably, in one achievable manner according to this application, the replay attack model prevents the federated model from converging by controlling at least one training node of the federated model, or causes the federated model to converge to a bad local minimum.
[0014] Preferably, in one achievable method of this application, the method further includes: calculating the proportion of the number of attacked training nodes to the total number of training nodes and the number of times each attacked training node is attacked as the attack intensity of the federated model.
[0015] Preferably, in one feasible implementation of this application, determining the security performance of the federated learning system to be tested based on the comparison result includes:
[0016] The security performance of the federated learning system under test is determined based on the attack strength of the federated model and the comparison results.
[0017] Preferably, in one feasible implementation of this application, the step of randomly selecting training nodes of the federated model for simulated attacks includes:
[0018] Randomly select training nodes of the federated model for control;
[0019] The controlled local training nodes receive the model parameters for the current round sent by the central node and decrypt them;
[0020] This enables the controlled local training nodes to train local models using the decrypted model parameters and local data.
[0021] This causes the controlled local training nodes to update the decrypted model parameters.
[0022] The controlled local training nodes encrypt and update the model parameters and send them to the central node.
[0023] According to a first aspect of the embodiments of this application, a system security vulnerability detection device based on federated learning is provided, comprising:
[0024] The simulation module is used to simulate the federated model training process of the federated learning system to be tested.
[0025] The selection module is used to randomly select training nodes of the federated model during the training process of the federated model to simulate attacks.
[0026] The simulation module is used to simulate the federated model before and after the simulated attack, and compare the simulation results to generate comparison results.
[0027] The judgment module is used to judge the security performance of the federated learning system to be tested based on the comparison results.
[0028] The technical solution provided in this application can include the following beneficial effects: The system security vulnerability detection method based on federated learning in this application includes: simulating the federated model training process of the federated learning system to be tested; randomly selecting training nodes of the federated model during the federated model training process to simulate attacks; simulating the federated model before and after the simulated attack, and comparing the simulation results to generate comparison results; and judging the security performance of the federated learning system to be tested based on the comparison results. In this application, randomly selecting training nodes of the federated model during the model training process of the federated learning system to be tested to simulate attacks to evaluate the security performance of the federated learning system to be tested allows for early understanding of the degree of defense against replay attacks, thereby enabling timely improvements and enhancements.
[0029] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0030] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0031] Figure 1 This is a flowchart illustrating a system security vulnerability detection method based on federated learning, provided in one embodiment of this application.
[0032] Figure 2 This is a schematic diagram of the process of randomly selecting training nodes of a federated model to simulate an attack in a system security vulnerability detection method based on federated learning provided in one embodiment of this application;
[0033] Figure 3 This is a simulation result of a federated model of a high-security federated learning system provided in one embodiment of this application;
[0034] Figure 4 This is a simulation result of a federated model of another high-security federated learning system provided in one embodiment of this application;
[0035] Figure 5 This is a simulation result of a federated model of another high-security federated learning system provided in one embodiment of this application;
[0036] Figure 6 This is a simulation result of a federated model of a low-security federated learning system provided in one embodiment of this application;
[0037] Figure 7 This is a simulation result of a federated model of another low-security federated learning system provided in one embodiment of this application;
[0038] Figure 8 This is a simulation result of a federated model of another low-security federated learning system provided in one embodiment of this application;
[0039] Figure 9 This is a schematic diagram of the structure of a system security vulnerability detection device based on federated learning, provided in one embodiment of this application.
[0040] Figure labeling: Simulation module-21; Selection module-22; Simulation module-23; Judgment module-24. Detailed Implementation
[0041] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0042] A system security vulnerability detection method based on federated learning includes:
[0043] S11: Simulates the federated model training process of the federated learning system to be tested;
[0044] The training process for federated models generally includes:
[0045] 1. Each node sends model parameters to the central node;
[0046]
[0047] 2. The central node aggregates the parameters, for example, using a federated weighted average algorithm, to obtain the current federated model;
[0048]
[0049] 3. The central node sends the aggregated parameters to each node, and each node updates the model locally based on the parameters, where η t Let be the learning rate at t epochs, λ be a regularization parameter to prevent overfitting, and B be the learning rate. t This represents an example of training data (x) in a gradient batch of size b. i ,y i ), where ▽l represents the gradient of the loss function.
[0050] 4. Repeat the above three steps until the model converges or reaches the maximum number of training iterations. At this point, the central node obtains a final federated model.
[0051] P c →G Fed
[0052] 5. The central node sends the final federated model to each node.
[0053]
[0054] Among them, the nodes are: P1, P2, LP n Central node: P c Local dataset: D1, D2, LD n Global dataset: D = D1∪D2∪LD n Local model at round t: Global model at round t: G t Local parameters at round t: Global parameter at round t: ω t Final model: G Fed G Sum .
[0055] S12: During the training of the federated model, randomly select training nodes of the federated model to perform simulated attacks;
[0056] Federated learning structures present security risks, with model poisoning attacks targeting model parameters becoming increasingly frequent. Current mainstream security defenses employ differential privacy and homomorphic encryption to encrypt or perturb model parameters, enabling encrypted transmission between nodes and the central node. However, these methods cannot defend against replay attacks. In this embodiment, at least one node of the federated model is randomly selected for a replay attack to detect whether the system has a security vulnerability related to replay attacks in federated learning systems.
[0057] In this embodiment, a simulated attack is performed on the training nodes of the federated model based on a pre-trained replay attack model.
[0058] The replay attack model prevents the federated model from converging by controlling at least one training node of the federated model, or causes the federated model to converge to a bad local minimum.
[0059] Define a replay attack model in federated learning:
[0060]
[0061]
[0062]
[0063] RI = α, RI ∈ [1…n]
[0064] Here, α represents the parameter, RR stands for Reply Range, indicating the proportion of attacked training nodes among all training nodes in federated learning. RI stands for Reply Intensity, indicating the number of times a particular attacked training node is attacked in federated learning.
[0065] Randomly select training nodes of the federated model to conduct simulated attacks, referring to... Figure 2 ,include:
[0066] S121: Randomly select training nodes of the federated model for control;
[0067] S122: Enable each controlled local training node to receive the model parameters for the current round sent by the central node and decrypt them;
[0068] S123: Enable the controlled local training nodes to train local models using the decrypted model parameters and local data;
[0069] S124: Update the decrypted model parameters at each controlled local training node;
[0070] S125: Encrypt and update the model parameters of each controlled local training node and send them to the central node.
[0071] Preferably, in this embodiment, the proportion of the number of attacked training nodes to the total number of training nodes and the number of times each attacked training node is attacked are also counted as the attack intensity of the federated model.
[0072] S13: Simulate the federation model before and after the simulated attack, and compare the simulation results to generate comparison results;
[0073] S14: Determine the security performance of the federated learning system under test based on the comparison results.
[0074] Specifically, the security performance of the federated learning system under test is determined based on the attack strength of the federated model and the comparison results.
[0075] Preferably, the framework used in this embodiment is TensorFlow Federated (TFF), the experimental environment is 18.04.1-Ubuntu, Intel(R) Xeon(R) CPU E5-2678v3@2.50GH, 2.50GHz RAM 64.0GB, and the dataset is MNIST.
[0076] In this embodiment, with 10 training nodes in the federated model, simulation diagrams of federated learning systems with high and low security performance are provided as examples.
[0077] Simulation results of the federated model of a high-security federated learning system (refer to) Figures 3-5 .
[0078] Figure 2 This is a normal federated learning process, without any replay attacks, i.e., the simulation results of the federated model before it was subjected to a simulated attack.
[0079] Figure 3 The simulation results show that one out of ten nodes was subjected to a replay attack.
[0080] Figure 4 The simulation results show that one out of ten nodes was subjected to ten replay attacks.
[0081] Comparing the results of the three experiments reveals no significant differences. In all three experiments, the local data quality of the simulated training nodes (including the attacked training node) was relatively good and average. The replay attack did not amplify the impact of the attacked training node on the global model because the data quality of the attacked training node was good, thus not causing a significant negative impact on the global model. Therefore, it can be seen that the federated learning system has high security performance.
[0082] Simulation results of federated model of low-security federated learning system (refer to) Figures 6-8 .
[0083] Figure 6 This is a normal federated learning process, without any replay attacks, i.e., the simulation results of the federated model before the simulated attack.
[0084] Figure 7 The simulation results show that 2 out of 10 nodes were subjected to two replay attacks.
[0085] Figure 8 The simulation results show that 2 out of 10 nodes were subjected to 10 replay attacks.
[0086] Comparing the results of the three experiments reveals that the data quality of the attacked training node is low. With other nodes unchanged, the experimental results are shown in the figure above. It can be seen that the accuracy of the global model has changed to varying degrees. This indicates that the impact of the attacked training node has been amplified to the global model, affecting the convergence and performance of the global model. In other words, the federated learning system has a security vulnerability that can be exploited by replay attacks, and the security performance of the federated learning system is low.
[0087] The system security vulnerability detection method based on federated learning in this embodiment includes: simulating the federated model training process of the federated learning system to be tested; randomly selecting training nodes of the federated model during the training process to simulate attacks; performing simulations on the federated model before and after the simulated attacks, and comparing the simulation results to generate comparison results; and judging the security performance of the federated learning system to be tested based on the comparison results. In this application, randomly selecting training nodes of the federated model during the model training process of the federated learning system to be tested to simulate attacks to evaluate the security performance of the federated learning system to be tested allows for early understanding of the system's defense level against replay attacks, thus enabling timely improvements and enhancements.
[0088] A system security vulnerability detection device based on federated learning, referring to Figure 9 ,include:
[0089] Simulation module 21 is used to simulate the federated model training process of the federated learning system to be tested;
[0090] Module 22 is selected to randomly select training nodes of the federated model for simulated attacks during the training process of the federated model.
[0091] Simulation module 23 is used to simulate the federation model before and after the simulated attack, and compare the simulation results to generate comparison results.
[0092] The judgment module 24 is used to judge the security performance of the federated learning system to be tested based on the comparison results.
[0093] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0094] It should be noted that in the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means at least two.
[0095] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0096] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0097] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0098] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0099] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0100] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0101] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A system security vulnerability detection method based on federated learning, characterized in that, The method comprises the following steps: simulate a federated model training process of a to-be-detected federated learning system; in the federated model training process, randomly select a training node of the federated model to perform a simulation attack; simulate the federated model before being subjected to the simulation attack and the federated model after being subjected to the simulation attack respectively, and compare simulation results to generate a comparison result; determine the security performance of the to-be-detected federated learning system according to the comparison result; the simulation attack on the training node of the federated model comprises the following steps: perform a simulation attack on the training node of the federated model based on a pre-trained replay attack model; the replay attack model is used to prevent the federated model from converging or make the federated model converge at a bad local minimum value; further comprising: counting the proportion of the number of attacked training nodes to the total number of training nodes and the attack times of each attacked training node as the attack strength of the federated model; determining the security performance of the to-be-detected federated learning system according to the comparison result comprises: determine the security performance of the to-be-detected federated learning system according to the attack strength of the federated model and the comparison result.
2. The method of claim 1, wherein, The replay attack model prevents the federated model from converging or makes the federated model converge at a bad local minimum value by controlling at least one training node of the federated model.
3. The method of claim 1, wherein, the simulation attack on the training node of the federated model comprises the following steps: randomly select a training node of the federated model to perform control; make each controlled local training node receive model parameters of the current round sent by a center node and decrypt the model parameters; make each controlled local training node train a local model using the decrypted model parameters and local data; make each controlled local training node update the decrypted model parameters; make each controlled local training node encrypt the updated model parameters and send the model parameters to the center node.
4. A system security vulnerability detection device based on federated learning, characterized by, The method comprises the following steps: a simulation module is configured to simulate a federated model training process of a to-be-detected federated learning system; a selection module is configured to randomly select a training node of the federated model to perform a simulation attack in the federated model training process; a simulation module is configured to simulate the federated model before being subjected to the simulation attack and the federated model after being subjected to the simulation attack respectively, and compare simulation results to generate a comparison result; a determination module is configured to determine the security performance of the to-be-detected federated learning system according to the comparison result; the simulation attack on the training node of the federated model comprises the following steps: perform a simulation attack on the training node of the federated model based on a pre-trained replay attack model; the replay attack model is used to prevent the federated model from converging or make the federated model converge at a bad local minimum value; further comprising: counting the proportion of the number of attacked training nodes to the total number of training nodes and the attack times of each attacked training node as the attack strength of the federated model; determining the security performance of the to-be-detected federated learning system according to the comparison result comprises: determine the security performance of the to-be-detected federated learning system according to the attack strength of the federated model and the comparison result.
Citation Information
Patent Citations
Model training method under federated learning network and related equipment thereof
CN111814985A
Federation learning poisoning attack detection method, device and equipment
CN112528281A
Method and device for jointly updating model
CN113657611A