Byzantine fault-tolerant federated learning method, electronic device and storage medium

By screening and evaluating the update gradients of client nodes to determine the most credible node update gradients, the problem of large Byzantine risk detection errors in existing federated learning technology is solved, and the defense capabilities against Byzantine attacks and the robustness of the algorithm are improved. .

CN118312960BActive Publication Date: 2024-09-03BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410734862.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-03
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

Existing federated learning technology has the problems of large errors and sampling bias in Byzantine risk detection methods, making it difficult to effectively defend against Byzantine attacks.

Method used

By determining the client node set, calculate the Euclidean distance of the update gradient of each node, put the node with the largest Euclidean distance into the second set, put the remaining nodes into the first set, and filter out the best one based on the Euclidean distance evaluation value. Trusted nodes update gradients as the global model is updated.

Benefits of technology

It improves the defense capability of the deep neural network model against Byzantine attacks, improves the gradient screening and aggregation methods of the variance evaluation algorithm, enhances the robustness of the algorithm, and reduces the success rate of Byzantine node attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118312960B
    Figure CN118312960B
Patent Text Reader

Abstract

The embodiment of the present invention provides a Byzantine fault-tolerant federated learning method, electronic device and storage medium, and relates to the field of federated learning technology. The method includes: determining a client node set; obtaining an update gradient obtained by local training of each client node in the client node set based on the model parameters sent down; for each update gradient, placing the client node in the second set or the first set based on the Euclidean distance, and determining the update evaluation value of the client node corresponding to the update gradient according to the Euclidean distance; based on the Euclidean distance of the average update gradient on the second set being less than the Euclidean distance with the average update gradient on the first set, the client nodes in the first set are cyclically screened, and the average update gradient on the first set at the end of the cycle is used as the global model update gradient. The implementation method provided by the present invention enhances the defense capability of the federated learning process against Byzantine attacks.
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 Byzantine fault-tolerant federated learning method, an electronic device and a corresponding storage medium. Background Art

[0002] At present, with the rapid development of artificial intelligence technology, the application of artificial intelligence technology is becoming more and more extensive. It has been applied to many fields such as image analysis, speech recognition, text processing, intelligent recommendation, security detection, etc. Federated learning and large model technology have become the forefront of artificial intelligence technology. In the model training scenario based on federated learning, the nodes participating in the training can disrupt the model training process by forging updated data, or implant backdoors into the model, which seriously threatens the security of the model.

[0003] Although there are already Byzantine risk detection methods based on federated learning technology in the existing technology, whether based on clustering algorithms or trusted data set verification, they all have defects such as large errors and sampling bias. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a Byzantine fault-tolerant federated learning method, electronic device and storage medium, which can control the number of nodes in a trusted node set and ensure that the nodes in the trusted node set have the highest degree of data cohesion when updating data, so as to at least solve some of the problems in the background technology.

[0005] In order to achieve the above-mentioned purpose, the present invention provides a Byzantine fault-tolerant federated learning method, which includes: determining a client node set, the client node set including a plurality of client nodes; obtaining an update gradient obtained by local training of each client node in the client node set based on the issued model parameters; for each update gradient, calculating the Euclidean distance between it and the remaining update gradients, placing the client nodes corresponding to the first f update gradients with the largest Euclidean distance into a second set, and placing the remaining client nodes in the client node set into a first set; and determining the update evaluation value of the client node corresponding to the update gradient according to the Euclidean distance; wherein f is the number of malicious nodes; starting from the minimum update evaluation value among all update evaluation values, judging whether there is any client node in the first set corresponding to the minimum update evaluation value that satisfies the following conditions: the Euclidean distance between its update gradient and the average update gradient on the second set is less than the Euclidean distance with the average update gradient on the first set; if so, deleting the minimum update evaluation value and determining a new minimum update evaluation value, and repeating the above judgment; if not, the loop ends; taking the average update gradient on the first set at the end of the loop as the global model update gradient, and updating the global model in combination with the model parameters.

[0006] Optionally, the number of malicious nodes represented by f is an estimated value or an estimated value of an upper limit of the number.

[0007] Optionally, before determining the client node set, the method includes a model initialization step; the model initialization step includes: setting initialization parameters and setting counting variables.

[0008] Optionally, determining a client node set includes: randomly selecting a number of client nodes from the client nodes of the federated learning system to form the client node set. Optionally, obtaining an update gradient obtained by each client node in the client node set based on the sent model parameters after local training includes: sending the model parameters of the global model to the client nodes in the client node set; each client node uses all sample data stored locally as a training data set, and uses a stochastic gradient descent algorithm to train a local model including the sent model parameters; and receiving the model parameters of the trained local model and the corresponding update gradient from each client node.

[0009] Optionally, the remaining client nodes in the client node set are placed into a first set, including: placing the client nodes corresponding to the updated gradient into the first set; placing the client nodes corresponding to the updated gradient with the smallest calculated number of Euclidean distances into the first set; the calculated number is equal to the total number of client nodes in the client node set minus f and then minus one; wherein f is the number of malicious nodes.

[0010] Optionally, determining the updated evaluation value of the client node corresponding to the updated gradient according to the Euclidean distance includes: obtaining all Euclidean distances between the updated gradient and the updated gradients of the client nodes in the second set; and taking the sum of all the Euclidean distances as the updated evaluation value of the client node corresponding to the updated gradient.

[0011] Optionally, the method includes: placing all update evaluation values ​​into a third set; and the operation object of deleting the minimum update evaluation value and determining a new minimum update evaluation value is the third set.

[0012] Optionally, the average update gradient on the first set at the end of the loop is used as the global model update gradient, and the global model is updated in combination with the model parameters, including: based on the global model update gradient, the model parameters are calculated using the Adam algorithm to obtain the updated parameters of the global model.

[0013] Optionally, the method is configured to be executed in a loop when the following preset conditions are met; the preset conditions include: after updating the global model in combination with the model parameters, determining that the current state of the federated learning system does not meet the training stop condition of the federated learning.

[0014] Optionally, the malicious node is a client node that has a risk of Byzantine attack.

[0015] The present invention also provides a Byzantine fault-tolerant federated learning device, which includes: a node selection module, which is used to determine a client node set, wherein the client node set includes a plurality of client nodes; a gradient acquisition module, which is used to obtain an update gradient obtained by each client node in the client node set after local training based on the sent model parameters; a distance determination module, which is used to calculate the Euclidean distance between each update gradient and the remaining update gradients, put the client nodes corresponding to the first f update gradients with the largest Euclidean distance into a second set, and put the remaining client nodes in the client node set into a first set; and determine the client node corresponding to the update gradient according to the Euclidean distance. update evaluation value; wherein f is the number of malicious nodes; a cohesion screening module, used to start from the minimum update evaluation value among all update evaluation values, and determine whether there is any client node in the first set corresponding to the minimum update evaluation value that satisfies the following conditions: the Euclidean distance between its update gradient and the average update gradient on the second set is less than the Euclidean distance between its update gradient and the average update gradient on the first set; if so, delete the minimum update evaluation value and determine a new minimum update evaluation value, and repeat the above judgment; if not, the loop ends; and a parameter updating module, used to use the average update gradient on the first set at the end of the loop as the global model update gradient, and update the global model in combination with the model parameters.

[0016] The present invention also provides an electronic device, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the aforementioned Byzantine fault-tolerant federated learning method by executing the instructions stored in the memory.

[0017] The present invention also provides a machine-readable storage medium on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned Byzantine fault-tolerant federated learning method.

[0018] The present invention also provides a computer program product, including a computer program, which implements the aforementioned Byzantine fault-tolerant federated learning method when executed by a processor.

[0019] The above technical solution has the following beneficial effects:

[0020] (1) The problem of variance assessment algorithm failing when Byzantine nodes collude is solved, which can improve the defense capability of federated learning process of deep neural network model against Byzantine attacks.

[0021] (2) The normal gradient screening method of the variance assessment algorithm was improved. Based on the node update gradient evaluation results, the results with obviously abnormal update gradient distribution were detected and eliminated. This can effectively solve the problem of Byzantine node collusion causing the ordinary variance assessment algorithm to fail in certain scenarios.

[0022] (3) The gradient aggregation method of the variance assessment algorithm is improved. Instead of using the update gradient of the node with the smallest variance and the normal node as the global model update gradient, the mean of the update gradients of the normal nodes is used as the global model update gradient, which improves the robustness of the algorithm.

[0023] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0025] Figure 1 A schematic diagram of the steps of a Byzantine fault-tolerant federated learning method according to an embodiment of the present invention is shown;

[0026] Figure 2 A schematic diagram of the implementation process of the Byzantine fault-tolerant federated learning method according to an embodiment of the present invention is schematically shown;

[0027] Figure 3 The structural diagram of a Byzantine fault-tolerant federated learning device according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION

[0028] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0029] Figure 1 The following is a schematic diagram showing the steps of the Byzantine fault-tolerant federated learning method according to an embodiment of the present invention. Figure 1 As shown, a Byzantine fault-tolerant federated learning method includes:

[0030] S01. Determine a client node set, where the client node set includes a number of client nodes;

[0031] S02, obtaining an update gradient of each client node in the client node set after local training based on the sent model parameters;

[0032] S03. For each update gradient, calculate the Euclidean distance between it and the remaining update gradients, put the client nodes corresponding to the first f update gradients with the largest Euclidean distance into the second set, and put the remaining client nodes in the client node set into the first set; and determine the update evaluation value of the client node corresponding to the update gradient according to the Euclidean distance; where f is the number of malicious nodes;

[0033] S04, starting from the minimum update evaluation value among all update evaluation values, determine whether there is any client node in the first set corresponding to the minimum update evaluation value that satisfies the following condition: the Euclidean distance between its update gradient and the average update gradient on the second set is less than the Euclidean distance between its update gradient and the average update gradient on the first set; if so, delete the minimum update evaluation value and determine a new minimum update evaluation value, and repeat the above determination; if not, the loop ends;

[0034] S05. Use the average update gradient on the first set at the end of the cycle as the global model update gradient, and update the global model in combination with the model parameters.

[0035] The Byzantine fault-tolerant federated learning method in the above implementation mode reduces the success rate of Byzantine node attacks by performing security assessment and screening on the update data of the nodes participating in the training and updating the model parameters based on the most credible update data.

[0036] In some optional implementations of the present application, the number of malicious nodes represented by f is an estimated value or an estimated value of the upper limit of the number. Since the number of malicious nodes cannot be accurately determined in advance, an estimate is required, which also leads to uncertainty in the actual value of f. The estimated value can also be preferably a conservative estimate, that is, an estimated value of the upper limit of the number of malicious nodes, which is generally a highly credible estimate, and the actual number of Byzantine nodes is likely to be less than f.

[0037] In some optional embodiments of the present application, before determining the client node set, the method includes a model initialization step; the model initialization step includes: setting initialization parameters and setting count variables. If the federated learning system is in a state before the first round of training, it may be necessary to initialize the model of the federated learning system. In the federated learning system, assuming that the federated learning parameter server is S and the total number of federated learning client nodes is The specific steps of model initialization are: the parameter server S initializes the parameters of the adopted deep neural network model, and the initialization parameters are ,in , is the total number of parameter dimensions of the global model. Set the count variable ,initialization However, it should be noted that the model initialization is not necessary. For example, after the federated learning system starts the second round of training and later, the aforementioned Byzantine fault-tolerant federated learning method can be applied, but it is no longer necessary to perform the initialization before the Byzantine fault-tolerant federated learning method.

[0038] In some optional implementations of the present application, determining the client node set includes: randomly selecting a number of client nodes from the client nodes of the federated learning system to form the client node set. When the round model parameters are sent, the parameter server S Randomly select from client nodes Client nodes, 0< ≤ , the selected federated learning client node is , where i is the client node number, 0< ≤ , all selected client nodes constitute the set For example, in When the round model parameters are sent, the parameter server S Randomly select from client nodes The selected federated learning client nodes are . Set the parameters of the global model of the deep neural network model Sent to the selected federated learning client node, starting the Round of local model training and model parameter update.

[0039] In some optional implementations of the present application, obtaining the updated gradient obtained by each client node in the client node set based on the model parameters sent locally after training includes: sending the model parameters of the global model to the client nodes in the client node set; each client node uses all sample data stored locally as a training data set, and uses a stochastic gradient descent algorithm to train the local model including the sent model parameters; and receiving the updated gradient of the local model after training from each client node. Local model training mainly includes two steps: model training and parameter uploading. Specifically, the model training steps include: During the local model training, each Use all sample data stored locally as training data sets, use the stochastic gradient descent algorithm to train the local model, and calculate the update gradient of the local model The parameter upload steps include: During the local model training, each Update the gradient of the local model Send it to the parameter server S. For other technical details not mentioned in this step, please refer to the basic principles of federated learning and will not be repeated here.

[0040] In some optional implementations of the present application, placing the remaining client nodes in the client node set into the first set includes: placing the client nodes corresponding to the updated gradient into the first set; placing the client nodes corresponding to the updated gradients with the smallest calculated number of Euclidean distances into the first set; the calculated number is equal to the total number of client nodes in the client node set minus f and then minus one; where f is the number of malicious nodes. Exemplarily, in the first When the round model parameters are updated, the parameter server S first receives the update gradients uploaded by each client node For each , the corresponding Euclidean distance is calculated by the following formula.

[0041]

[0042] Will Smallest The client nodes corresponding to the updated gradients are placed in the first set In the example, client node i is also put into the first set In The largest The client nodes corresponding to the updated gradients are placed in the second set Among them is the number of malicious nodes based on the Byzantine Generals Problem among all client nodes, that is, the number of Byzantine nodes, In the aforementioned In the scenario, The option is 4900. Represents the vector The Euclidean distance of . is the total number of client nodes in the client node set. Since the Euclidean distance is used for sorting or comparison in the subsequent steps, whether or not to square it has no substantial impact on the result.

[0043] In some optional implementations of the present application, determining the updated evaluation value of the client node corresponding to the updated gradient according to the Euclidean distance includes: obtaining all Euclidean distances between the updated gradient and the updated gradients of the client nodes in the second set; and taking the sum of all the Euclidean distances as the updated evaluation value of the client node corresponding to the updated gradient. Specifically, the updated evaluation value of client node i is Calculated by the following formula:

[0044]

[0045] In order to facilitate the operation and management of the updated evaluation values, all updated evaluation values ​​can be put into the third set In the subsequent deletion of the minimum update evaluation value and determination of a new minimum update evaluation value are based on to execute.

[0046] In some embodiments of the present application, starting from the minimum update evaluation value among all update evaluation values, it is determined whether there is any client node in the first set corresponding to the minimum update evaluation value that satisfies the following conditions: the Euclidean distance between its update gradient and the average update gradient on the second set is less than the Euclidean distance between its update gradient and the average update gradient on the first set; if so, the minimum update evaluation value is deleted and a new minimum update evaluation value is determined, and the above determination is repeated; if not, the loop ends; illustratively, the steps here are used for update screening, specifically: in the first When the round model parameters are updated, the parameter server S is collected from the set Select the smallest value , calculate the set The average update gradient on , and the collection The average update gradient on .

[0047]

[0048]

[0049] in, The superscript is used only in conjunction with This distinction does not imply valuation or other meanings. There are any client nodes in , whose updated gradient and The Euclidean distance ratio is If the Euclidean distance of From the collection , and repeat this update filtering step; if the set There is no client node in , whose updated gradient and The Euclidean distance ratio is If the Euclidean distance of Assign to the global model update gradient .

[0050] In some embodiments of the present application, the average update gradient on the first set at the end of the cycle is used as the global model update gradient, and the global model is updated in combination with the model parameters, including: based on the global model update gradient, the model parameters are calculated using the Adam algorithm to obtain the updated parameters of the global model. The steps here are used for parameter update, specifically: in the first When the round model parameters are updated, the parameter server based on The Adam algorithm is used to calculate the updated parameters of the global model .

[0051] In some embodiments of the present application, the method is configured to be executed in a loop when the following preset conditions are met; the preset conditions include: after updating the global model in combination with the model parameters, it is determined that the current state of the federated learning system does not meet the training stop condition of the federated learning. The training stop condition here includes Convergence or .if Convergence or , then terminate the training process, otherwise The value of is increased by 1, and all the sub-steps of the aforementioned model parameter delivery, local model training and model parameter update are repeated to start the next round of model parameter delivery, local model training and model parameter update. is the preset training cycle threshold constant, is a positive integer greater than 1.

[0052] When the aforementioned various implementations are applied to Byzantine fault tolerance, the aforementioned malicious nodes are client nodes that are at risk of Byzantine attacks, thereby reducing the success rate of Byzantine node attacks.

[0053] Through the above implementation methods, the normal gradient screening method of the variance assessment algorithm is improved, and the results of obviously abnormal update gradient distribution are detected and eliminated based on the node update gradient evaluation results, which can effectively solve the problem of Byzantine node collusion causing the failure of the ordinary variance assessment algorithm in certain scenarios. In addition, the gradient aggregation method of the variance assessment algorithm is improved, and the update gradient of the node with the smallest variance and normal node is not used as the global model update gradient, and the update gradient mean of the normal node is used as the global model update gradient, which improves the robustness of the algorithm.

[0054] Figure 2 The following is a schematic diagram showing the implementation process of the Byzantine fault-tolerant federated learning method according to an embodiment of the present invention. Figure 2As shown in the figure, it includes the following implementation steps: The parameter server initializes the model parameters. The parameter server randomly selects the client node and sends the model parameters. The client node trains the local model based on the local sample and uploads the local model update gradient. The parameter server evaluates and screens each local update gradient to generate the updated parameters of the global model. The parameter server determines the training termination condition.

[0055] Based on the same inventive concept, the present invention also provides a Byzantine fault-tolerant federated learning device. Figure 3 The schematic diagram of the structure of the Byzantine fault-tolerant federated learning device according to the embodiment of the present invention is shown. Figure 3 As shown, the device includes: a node selection module, which is used to determine a client node set, wherein the client node set includes a plurality of client nodes; a gradient acquisition module, which is used to obtain an update gradient obtained by each client node in the client node set after local training based on the sent model parameters; a distance determination module, which is used to calculate the Euclidean distance between each update gradient and the remaining update gradients, put the client nodes corresponding to the first f update gradients with the largest Euclidean distance into the second set, and put the remaining client nodes in the client node set into the first set; and determine the update evaluation value of the client node corresponding to the update gradient according to the Euclidean distance; wherein, f is the number of malicious nodes; a cohesion screening module is used to start from the minimum update evaluation value among all update evaluation values, and determine whether there is any client node in the first set corresponding to the minimum update evaluation value that satisfies the following conditions: the Euclidean distance between its update gradient and the average update gradient on the second set is less than the Euclidean distance between its update gradient and the average update gradient on the first set; if so, delete the minimum update evaluation value and determine a new minimum update evaluation value, and repeat the above judgment; if not, the loop ends; and a parameter updating module is used to use the average update gradient on the first set at the end of the loop as the global model update gradient, and update the global model in combination with the model parameters.

[0056] In some optional implementations of the present application, the number of malicious nodes represented by f is an estimated value or an estimated value of an upper limit of the number.

[0057] In some optional implementations of the present application, before determining the client node set, the method includes a model initialization step; the model initialization step includes: setting initialization parameters and setting counting variables.

[0058] In some optional implementations of the present application, determining the client node set includes: randomly selecting a number of client nodes from the client nodes of the federated learning system to form the client node set.

[0059] Optionally, obtaining the updated gradient of each client node in the client node set after local training based on the sent model parameters includes: sending the model parameters of the global model to the client nodes in the client node set; each client node uses all sample data stored locally as a training data set, and adopts a stochastic gradient descent algorithm to train the local model including the sent model parameters; and receiving the updated gradient of the trained local model from each client node.

[0060] In some optional embodiments of the present application, the remaining client nodes in the client node set are placed into a first set, including: placing the client nodes corresponding to the updated gradient into the first set; placing the client nodes corresponding to the updated gradient with the smallest calculated number of Euclidean distances into the first set; the calculated number is equal to the total number of client nodes in the client node set minus f and then minus one; wherein f is the number of malicious nodes.

[0061] In some optional embodiments of the present application, determining the updated evaluation value of the client node corresponding to the update gradient based on the Euclidean distance includes: obtaining all Euclidean distances between the update gradient and the update gradients of the client nodes in the second set; and taking the sum of all the Euclidean distances as the updated evaluation value of the client node corresponding to the update gradient.

[0062] In some optional implementations of the present application, the device further includes: placing all update evaluation values ​​into a third set; and the operation object of deleting the minimum update evaluation value and determining a new minimum update evaluation value is the third set.

[0063] In some optional embodiments of the present application, the average update gradient on the first set at the end of the cycle is used as the global model update gradient, and the global model is updated in combination with the model parameters, including: based on the global model update gradient, the model parameters are calculated using the Adam algorithm to obtain the updated parameters of the global model.

[0064] In some optional embodiments of the present application, the device is configured to execute in a loop when the following preset conditions are met; the preset conditions include: after updating the global model in combination with the model parameters, determining that the current state of the federated learning system does not meet the training stop condition of the federated learning.

[0065] In some optional implementations of the present application, the malicious node is a client node that has a risk of Byzantine attack.

[0066] The specific definition of each functional module in the above-mentioned Byzantine fault-tolerant federated learning device can be found in the above-mentioned definition of the Byzantine fault-tolerant federated learning method, which will not be repeated here. Each module in the above-mentioned system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It also realizes the control of the number of nodes in the trusted node set, ensuring that the node update data in the trusted node set has the highest degree of cohesion, thereby effectively defending against Byzantine attacks on federated learning.

[0067] In some embodiments of the present invention, an electronic device is also provided, comprising: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the aforementioned Byzantine fault-tolerant federated learning method. The control module or processor here has the functions of numerical calculation and logical operation, and it has at least a central processing unit CPU with data processing capability, a random access memory RAM, a read-only memory ROM, a variety of I / O ports and an interrupt system, etc. The processor includes a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to one or more, and the aforementioned method is implemented by adjusting the kernel parameters. The memory may include a non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory, such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory includes at least one storage chip.

[0068] In one embodiment of the present invention, a machine-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the aforementioned Byzantine fault-tolerant federated learning method.

[0069] In one embodiment of the present invention, a computer program product is provided, including a computer program, which implements the aforementioned Byzantine fault-tolerant federated learning method when executed by a processor.

[0070] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0071] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0072] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0074] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0075] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0076] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0077] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0078] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A Byzantine fault-tolerant federated learning method, characterized in that: The method includes: Determine a client node set, wherein the client node set includes a plurality of client nodes; Obtaining the update gradient obtained by each client node in the client node set based on the sent model parameters after local training, including: sending the model parameters of the global model to the client nodes in the client node set; each client node uses all sample data stored locally as a training data set, and uses a stochastic gradient descent algorithm to train a local model including the sent model parameters; receiving the update gradient corresponding to the trained local model from each client node; For each update gradient, calculate the Euclidean distance between it and the remaining update gradients, put the client nodes corresponding to the first f update gradients with the largest Euclidean distance into the second set, and put the remaining client nodes in the client node set into the first set; and determine the update evaluation value of the client node corresponding to the update gradient according to the Euclidean distance; where f is the number of malicious nodes; Starting from the minimum update evaluation value among all update evaluation values, determine whether there is any client node in the first set corresponding to the minimum update evaluation value that satisfies the following condition: the Euclidean distance between its update gradient and the average update gradient on the second set is less than the Euclidean distance between its update gradient and the average update gradient on the first set; if so, delete the minimum update evaluation value and determine a new minimum update evaluation value, and repeat the above determination; if not, the loop ends; The average update gradient on the first set at the end of the cycle is used as the global model update gradient, and the global model is updated in combination with the model parameters.

2. The method according to claim 1, characterized in that The number of malicious nodes represented by f is an estimated value or an estimated value of the upper limit of the number.

3. The method according to claim 1, characterized in that Prior to determining the set of client nodes, the method includes a model initialization step; The model initialization step includes: setting initialization parameters and setting counting variables.

4. The method according to claim 1, characterized in that: Determine the client node set, including: A number of client nodes are randomly selected from the client nodes of the federated learning system to form the client node set.

5. The method according to claim 1, characterized in that Putting the remaining client nodes in the client node set into a first set includes: Putting the client nodes corresponding to the updated gradient into the first set; Put the client nodes corresponding to the calculated updated gradients with the smallest Euclidean distance into the first set; The calculated number is equal to the total number of client nodes in the client node set minus f minus one; wherein f is the number of malicious nodes.

6. The method according to claim 1, characterized in that Determining an updated evaluation value of the client node corresponding to the updated gradient according to the Euclidean distance includes: Obtaining all Euclidean distances between the updated gradient and the updated gradients of the client nodes in the second set; The sum of all the Euclidean distances is used as the updated evaluation value of the client node corresponding to the updated gradient.

7. The method according to claim 1, characterized in that The method further comprises: placing all updated evaluation values ​​into a third set; The operation object of deleting the minimum update evaluation value and determining a new minimum update evaluation value is the third set.

8. The method according to claim 1, characterized in that The average update gradient on the first set at the end of the cycle is used as the global model update gradient, and the global model is updated in combination with the model parameters, including: Based on the global model update gradient, the model parameters are calculated using the Adam algorithm to obtain updated parameters of the global model.

9. The method according to claim 1, characterized in that: The method is configured to be executed cyclically when the following preset conditions are met; The preset condition includes: after updating the global model in combination with the model parameters, determining that the current state of the federated learning system does not meet the training stop condition of the federated learning.

10. The method according to any one of claims 1 to 9, characterized in that The malicious node is a client node that has a risk of Byzantine attack.

11. An electronic device, characterized in that: include: at least one processor; a memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the steps of the Byzantine fault-tolerant federated learning method described in any one of claims 1 to 10 by executing the instructions stored in the memory.

12. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the Byzantine fault-tolerant federated learning method described in any one of claims 1 to 10 are implemented.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the Byzantine fault-tolerant federated learning method described in any one of claims 1 to 10 are implemented.