A federated learning method, device and system
By employing a mechanism of client-side detection and server-side filtering, the use of anomalous parameters is identified and avoided, thus addressing the robustness issue of federated learning systems under Byzantine attacks, ensuring the accuracy of training results, and reducing server load.
Patent Information
- Application Number
- CN202010813898.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-13
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2040-08-13
AI Technical Summary
When faced with Byzantine attacks, existing defense strategies for federated learning systems result in poor system robustness, as attackers can control clients to send malicious data, leading to incorrect training results.
The client detects the model parameters sent by the server, identifies abnormal parameters, uses local values for training, and sends alarm information to the server. After receiving the alarm signal, the server filters the training results and determines the training parameters for the next round to avoid using abnormal values.
This improves the robustness of the federated learning system, ensures the accuracy of training results, reduces the load on the server, and enhances the scalability of the system.
Smart Images

Figure CN114139713B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of machine learning, and particularly relate to a federated learning method, device and system. BACKGROUND
[0002] As a kind of machine learning technology, federated learning technology can solve the problem of data silos while protecting privacy and complying with industry data usage specifications.
[0003] The federated learning system used by federated learning includes a server and multiple clients. In the federated learning process, the server sends the model parameters of the current round of training to each client, the client performs the current round of training locally according to the model parameters of the current round of training, and sends the training result to the server; the server determines the model parameters of the next round of training according to the training results of each client, and sends them to each client for the next round of training.
[0004] However, if the federated learning system is subjected to a Byzantine attack, i.e., an attacker sends malicious data to the server by controlling one or more clients, the server will send incorrect data to all clients, causing the clients to train based on incorrect data, which is equivalent to the attacker indirectly attacking all clients.
[0005] To counter the Byzantine attack, the federated learning system usually configures a corresponding defense strategy. However, the existing defense strategy can result in poor robustness of the federated learning system. SUMMARY
[0006] Embodiments of the present application provide a federated learning method, device and system for improving the robustness of the federated learning system.
[0007] The first aspect of the embodiments of the present application provides a federated learning method applied to a federated learning system, the federated learning system including a server and multiple clients, and the same machine learning model being deployed on the multiple clients; the method comprising: a first client receiving a first value of a parameter of a machine learning model from the server, the first client being one of the multiple clients; in the case that the first value of the parameter does not satisfy a first condition, the first client performing a current round of training according to a first training data, the machine learning model and a local value of the parameter to obtain a training result of the current round of training, the first training data being data reserved on the first client; the first client sending the training result of the current round of training and alarm information to the server, the alarm information indicating that the first value of the parameter does not meet the requirements.
[0008] When the first value of the parameter meets the first condition, the first client trains the machine learning model according to the first value of the parameter; when the first value of the parameter does not meet the first condition, the first client trains the machine learning model according to the local value of the parameter. Therefore, the embodiments of the present application can identify the abnormal first value of the parameter issued by the server, thereby avoiding training the learning model by using the abnormal first value of the parameter, and the first client trains by using the local value of the parameter, which can ensure the accuracy of the training result.
[0009] In an implementation manner, the local value of the parameter is equal to the value of the parameter obtained in the last round of training.
[0010] When the first value of the parameter does not meet the first condition, the first client trains the machine learning model according to the value of the parameter obtained in the last round of training, and the training result makes the machine learning model have better performance.
[0011] In an implementation manner, the local value of the parameter is equal to the average value of the values of the parameter obtained in the two rounds of training before the current round of training.
[0012] When the first value of the parameter does not meet the first condition, the first client trains the machine learning model according to the average value of the values of the parameter obtained in the two rounds of training before the current round of training, and the training result makes the machine learning model have better performance.
[0013] In an implementation manner, the training result of the current round of training is the value of the parameter obtained in the current round of training, or the difference between the value of the parameter obtained in the current round of training and the local value of the parameter.
[0014] This implementation manner provides two forms of training results.
[0015] In an implementation manner, the training result of the current round of training is the difference between the local value of the parameter and the value of the parameter obtained in the current round of training.
[0016] This implementation manner provides another form of training result.
[0017] In an implementation manner, the training result of the current round of training is the absolute value of the difference between the value of the parameter obtained in the current round of training and the local value of the parameter.
[0018] This implementation manner provides another form of training result.
[0019] In an implementation, after the first client receives the first value of the parameter from the server, in a case where the first value of the parameter does not satisfy the first condition, before the first client performs the current round of training according to the first training data, the machine learning model and the local value of the parameter to obtain a training result of the current round of training, the method further includes: determining, by the first client, that the first value of the parameter does not satisfy the first condition according to the first training data and the machine learning model.
[0020] In this implementation, the first value of the parameter is determined by the first client to not satisfy the first condition.
[0021] In an implementation, the first client determines that the first value of the parameter does not satisfy the first condition according to the first training data and the machine learning model includes: the first client calculates a first actual value of the performance of the machine learning model according to the first training data and the first value of the parameter; and the first client determines that the first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and a first target value of the performance of the machine learning model.
[0022] The first client determines that the first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and the first target value of the performance of the machine learning model to avoid training with a value of the parameter that makes the machine learning model have a relatively poor performance, i.e., to ensure training with a value of the parameter that makes the machine learning model have a relatively good performance, thereby improving the final performance of the machine learning model.
[0023] In an implementation, the first target value of the performance of the machine learning model is a value of the performance of the machine learning model after the last round of training, or a maximum value of the performance of the machine learning model after each round of training before the current round of training.
[0024] This implementation provides multiple choices for the first target value.
[0025] In an implementation, the first condition is that a difference between the first target value of the performance of the machine learning model and the first actual value of the performance of the machine learning model is less than or equal to a first threshold value.
[0026] Based on the above first condition, training with a first value of the parameter that makes the machine learning model have a relatively poor performance can be avoided, i.e., training with a value of the parameter that makes the machine learning model have a relatively good performance is ensured, thereby improving the final performance of the machine learning model.
[0027] In an implementation, the first condition is that an absolute value of a difference between the first value of the parameter and a preset value of the parameter is less than a third threshold value.
[0028] Based on the above first condition, training with an abnormal first value of the parameter can be avoided.
[0029] In an implementation, the performance of the machine learning model includes at least one of an accuracy, a precision, a recall, and an F1 score.
[0030] The implementation provides multiple choices of the performance of the machine learning model.
[0031] In a second aspect, a federated learning method is provided. The method is applied to a federated learning system including a server and a plurality of clients. The plurality of clients are deployed with a machine learning model. The method includes: sending, by the server, a first value of a parameter of the machine learning model to the plurality of clients, the first value of the parameter being used for a current round of training of the machine learning model; receiving, by the server, training results of the current round of training of the plurality of clients; in a case where at least one of the plurality of clients further reports an alarm signal, screening, by the server, the training results from the training results of the current round of training of the plurality of clients, the alarm signal indicating that the first value of the parameter does not satisfy a first condition; and calculating, by the server, a third value of the parameter based on the screened training results, the third value of the parameter being used for a next round of training of the machine learning model.
[0032] In a case where at least one of the plurality of clients further reports an alarm signal, the server screens the training results of the current round of training of the plurality of clients, and determines the third value of the parameter for the next round of training based on the screened training results, thereby avoiding determining the third value of the parameter based on abnormal training results, and ensuring the accuracy of the third value of the parameter.
[0033] In an implementation, the training result of the current round of training is a value of the parameter obtained by the current round of training, or a difference between the value of the parameter obtained by the current round of training and a local value of the parameter.
[0034] The implementation provides two forms of the training result.
[0035] In an implementation, the training result of the current round of training is a difference between the local value of the parameter and the value of the parameter obtained by the current round of training.
[0036] The implementation provides another form of the training result.
[0037] In an implementation, the training result of the current round of training is an absolute value of a difference between the value of the parameter obtained by the current round of training and the local value of the parameter.
[0038] In an implementation, in the case that at least one of the plurality of clients also reports an alarm signal, the server filters the training results of the current round of training of the plurality of clients according to the second training data and the training results of the current round of training of the plurality of clients, to obtain training results of the current round of training of the plurality of clients that satisfy a second condition. The second training data is data reserved on the server. The second condition is that the second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model or the second difference is less than a second threshold value. The second difference is the difference between the second target value of the performance of the machine learning model and the second actual value of the performance of the machine learning model of the second client. The second client is any one of the plurality of clients.
[0039] The server filters the training results of the current round of training of the plurality of clients according to the second actual value of the performance of the machine learning model of the plurality of clients and the second target value of the performance of the machine learning model, to obtain training results of the current round of training of the plurality of clients that satisfy the second condition. In this way, the third value of the parameter determined according to the training results of the current round of training of the plurality of clients that satisfy the second condition can make the machine learning model have better performance.
[0040] In an implementation, the second target value of the performance of the machine learning model is the maximum value of the performance of the machine learning model of the plurality of clients after each round of training before the current round of training. Alternatively, the second target value of the performance of the machine learning model is the maximum value of the second actual value of the performance of the machine learning model of the plurality of clients.
[0041] This implementation provides multiple choices of the second target value of the performance.
[0042] In an implementation, the second condition is that the second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model or the second difference is less than the second threshold value. The second difference is the difference between the second target value of the performance of the machine learning model and the second actual value of the performance of the machine learning model of the second client. The second client is any one of the plurality of clients.
[0043] This implementation provides multiple choices of the second condition. In an implementation, the training results of the clients that report alarm signals all satisfy the second condition. The maximum value of the second actual value of the performance of the machine learning model calculated according to the training results of the clients that report alarm signals is greater than the maximum value of the second actual value of the performance of the machine learning model calculated according to the training results of the clients that do not report alarm signals.
[0044] The service end determines the third value of the parameter according to the training results of the clients that report the alarm signals in the filtered training results.
[0045] When only part of the clients identify that the first value of the parameter is abnormal and send the alarm signals, the service end determines the third value of the parameter according to the training results of the clients that report the alarm signals in the filtered training results. In this way, the third value of the parameter determined in this way makes the machine learning model have better performance, so that the machine learning model can converge faster.
[0046] In an implementation, the training results of the clients that report the alarm signals all satisfy the second condition; and the maximum of the second actual values of the performance of the machine learning model calculated according to the training results of the clients that report the alarm signals is less than the maximum of the second actual values of the performance of the machine learning model calculated according to the training results of the clients that do not report the alarm signals.
[0047] The service end determines the third value of the parameter according to the training results of the clients that report the alarm signals in the filtered training results.
[0048] The training results of the clients that report the alarm signals can be malicious training results sent by the attacked clients, and the second actual value of the performance of the machine learning model obtained according to the training results of the clients that do not report the alarm signals is high. Therefore, in the embodiment of the present application, the service end determines the third value of the parameter according to the training results of the clients that do not report the alarm signals in the filtered training results. In this way, the third value of the parameter determined in this way makes the machine learning model have better performance, so that the machine learning model can converge faster.
[0049] In an implementation, the training results of the clients that report the alarm signals partially satisfy the second condition.
[0050] The service end determines the third value of the parameter according to the training results of the clients that report the alarm signals in the filtered training results.
[0051] When the training results of the clients that report the alarm signals in the respective training results of the multiple clients partially satisfy the second condition, the service end determines the third value of the parameter according to the training results of the clients that report the alarm signals in the filtered training results. In this way, the third value of the parameter determined in this way makes the machine learning model have better performance, so that the machine learning model can converge faster.
[0052] In an implementation, the method further includes: if the training result of the third client is not included in the selected training result in M rounds of training including the current round of training, the server selects the training result from the training result of the other client except the third client in N rounds of training after the current round of training, the third client is any one of the plurality of clients, and M and N are positive integers.
[0053] The training result of the third client in M rounds of training performed before the current round of training is not included in the selected training result; then, the server selects the training result from the training result of the other client except the third client in N rounds of training after the current round of training, so that the server does not determine the value of the parameter by using the training result of the third client, thereby realizing special processing on the client with abnormal training result for multiple times to avoid processing the abnormal training result of the third client in each round of training.
[0054] The third aspect of the embodiment of the application provides a federated learning device applied to a federated learning system, the federated learning system including a server and a plurality of clients, and the plurality of clients being deployed with the same machine learning model; the federated learning device is included in one of the plurality of clients and includes:
[0055] The receiving unit is configured to receive the first value of the parameter of the machine learning model from the server.
[0056] The training unit is configured to, in a case where the first value of the parameter does not satisfy the first condition, perform the current round of training according to the first training data, the machine learning model and the local value of the parameter to obtain the training result of the current round of training, and the first training data is the data reserved in the first client.
[0057] The sending unit is configured to send the training result and alarm information to the server, and the alarm information indicates that the first value of the parameter does not satisfy the requirement.
[0058] In an implementation, the local value of the parameter is equal to the value of the parameter obtained in the last round of training.
[0059] In an implementation, the training result of the current round of training is the value of the parameter obtained in the current round of training, or the difference between the value of the parameter obtained in the current round of training and the local value of the parameter.
[0060] In an implementation, the federated learning device further includes a determining unit configured to determine that the first value of the parameter does not satisfy the first condition according to the first training data and the machine learning model.
[0061] In an implementation, the determining unit is configured to calculate the first actual value of the performance of the machine learning model according to the first training data and the first value of the parameter.
[0062] The first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and the first target value of the performance of the machine learning model.
[0063] In an implementation manner, the first target value of the performance of the machine learning model is a value of the performance of the machine learning model after the last round of training, or a maximum value of the performance of the machine learning model after each round of training before the current round of training.
[0064] In an implementation manner, the first condition is that a difference between the first target value of the performance of the machine learning model and the first actual value of the performance of the machine learning model is less than or equal to a first threshold value.
[0065] In an implementation manner, the performance of the machine learning model includes at least one of accuracy, precision, recall, and F1 score.
[0066] The specific implementation of each unit, the related description, and the technical effects can be referred to the description of the first aspect of the embodiment of the present application.
[0067] The fourth aspect of the embodiment of the present application provides a federated learning device applied to a federated learning system, the federated learning system including a server and a plurality of clients, and the same machine learning model being deployed on the plurality of clients; the federated learning device is included in the server and includes:
[0068] The sending unit is configured to send the first value of the parameter of the machine learning model to the plurality of clients respectively, and the first value of the parameter is used for the current round of training of the machine learning model.
[0069] The receiving unit is configured to receive training results of the current round of training of the plurality of clients respectively.
[0070] The screening unit is configured to, in a case where at least one of the plurality of clients still reports an alarm signal, screen, by the server, the training results from the training results of the current round of training of the plurality of clients respectively, and the alarm information indicates that the first value of the parameter does not satisfy the first condition.
[0071] The computing unit is configured to calculate a third value of the parameter according to the screened training results, and the third value of the parameter is used for a next round of training of the machine learning model.
[0072] In an implementation manner, the training result of the current round of training is a value of the parameter obtained by the current round of training, or a difference between the value of the parameter obtained by the current round of training and a local value of the parameter.
[0073] In an implementation, the screening unit is configured to, in a case that at least one of the plurality of clients reports an alarm signal, calculate, according to the second training data and the training result of the current round of training of each of the plurality of clients, a second actual value of the performance of the machine learning model of each of the plurality of clients, the second actual value of the performance of the machine learning model being a value of the performance of the machine learning model after the current round of training, and the second training data being data reserved on the server;
[0074] According to the second actual value of the performance of the machine learning model of each of the plurality of clients and the second target value of the performance of the machine learning model, the training result of the current round of training of each of the plurality of clients that satisfies the second condition is screened out.
[0075] In an implementation, the second target value of the performance of the machine learning model is a maximum value of the performance of the machine learning model of each of the plurality of clients after each round of training before the current round of training.
[0076] Or the second target value of the performance of the machine learning model is a maximum value of the second actual value of the performance of the machine learning model of each of the plurality of clients.
[0077] In an implementation, the second condition is that the second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model or a second difference is less than a second threshold value, the second difference being equal to a difference between the second target value of the performance of the machine learning model and the second actual value of the performance of the machine learning model of the second client, and the second client being any one of the plurality of clients.
[0078] In an implementation, the training result of the client reporting the alarm signal satisfies the second condition; and a maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client reporting the alarm signal is greater than a maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client not reporting the alarm signal.
[0079] The calculation unit is configured to determine the third value of the parameter according to the training result of the client reporting the alarm signal in the screened training result.
[0080] In an implementation, the training result of the client reporting the alarm signal satisfies the second condition; and a maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client reporting the alarm signal is less than a maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client not reporting the alarm signal.
[0081] The calculation unit is configured to determine the third value of the parameter according to the training result of the client not reporting the alarm signal in the screened training result.
[0082] In an implementation manner, the training result of the client reporting the alarm signal partially satisfies the second condition.
[0083] The computing unit is configured to determine the third value of the parameter according to the training result of the client reporting the alarm signal in the filtered training result.
[0084] In an implementation manner, the filtering unit is further configured to filter the training result from the training result of the other client than the third client in the plurality of clients when the training result of the third client is not included in the filtered training result in the M rounds of training including the current round of training, the third client being any one of the plurality of clients, and M and N being positive integers.
[0085] The specific implementation of each unit, the related description and the technical effects are described in the second aspect of the embodiments of the present application.
[0086] The fifth aspect of the embodiments of the present application provides a computer device, comprising at least one processor and a memory, the memory storing computer execution instructions executable on the processor, when the computer execution instructions are executed by the processor, the processor executes the federated learning method as described in any one of the implementation manners of the first aspect or executes the federated learning method as described in any one of the implementation manners of the second aspect.
[0087] The sixth aspect of the embodiments of the present application provides a chip or a chip system, which comprises at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is used to run a computer program or instructions to execute the federated learning method as described in any one of the implementation manners of the first aspect.
[0088] The seventh aspect of the embodiments of the present application provides a chip or a chip system, which comprises at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is used to run a computer program or instructions to execute the federated learning method as described in any one of the implementation manners of the second aspect.
[0089] The eighth aspect of the embodiments of the present application provides a computer readable storage medium storing one or more computer execution instructions, when the computer execution instructions are executed by a processor, the processor executes the federated learning method as described in any one of the implementation manners of the first aspect or the second aspect.
[0090] The ninth aspect of the embodiments of the present application provides a computer program product, the computer program product comprises computer software instructions, the computer software instructions can be loaded by a processor to implement the federated learning method in any one of the implementation manners of the first aspect or the federated learning method in any one of the implementation manners of the second aspect.
[0091] The tenth aspect of the embodiments of the present application provides a federated learning system, comprising a server and a plurality of clients, the same machine learning model is deployed on the plurality of clients;
[0092] Each of the plurality of clients is configured to execute the federated learning method in any one of the implementation manners of the first aspect.
[0093] The server is configured to execute the federated learning method in any one of the implementation manners of the second aspect.
[0094] From the above technical solutions, the embodiments of the present application have the following advantages:
[0095] The first client receives the first value of the parameter of the machine learning model from the server, and the first client is one of the plurality of clients; in the case that the first value of the parameter does not meet the first condition, the first client performs the current round of training according to the first training data, the machine learning model and the local value of the parameter to obtain the training result of the current round of training, and the first training data is the data reserved in the first client; the first client sends the training result and the alarm information to the server, and the alarm information indicates that the first value of the parameter does not meet the requirement; therefore, in the embodiments of the present application, the first value of the parameter that does not meet the condition can be identified by the client, so as to avoid using the abnormal first value of the parameter to train the learning model, and the first client uses the local value of the parameter to train, which can ensure the accuracy of the training result; in addition, the first client sends the alarm information to the server to indicate that the first value of the parameter does not meet the condition, so as to assist the server in detection, avoid the detection task being concentrated on the server, and improve the robustness of the federated learning system. BRIEF DESCRIPTION OF DRAWINGS
[0096] Figure 1 It is an architecture diagram of the federated learning system in the embodiments of the present application;
[0097] Figure 2 It is an embodiment diagram of the federated learning method provided by the embodiments of the present application;
[0098] Figure 3 It is an embodiment diagram of determining that the first value of the parameter does not meet the first condition in the embodiments of the present application;
[0099] Figure 4 It is an embodiment diagram of screening the training result in the embodiments of the present application;
[0100] Figure 5 This is a schematic diagram illustrating the accuracy of the machine learning model on the server in an embodiment of this application.
[0101] Figure 6 This is a schematic diagram illustrating the number of clients sending alarm information in each round of training in this application embodiment;
[0102] Figure 7 This is a schematic diagram of the first embodiment of the simulation results in this application;
[0103] Figure 8 This is a schematic diagram of the second embodiment of the simulation results in this application;
[0104] Figure 9 This is a schematic diagram of the structure of the first embodiment of the federated learning device in this application;
[0105] Figure 10 This is a schematic diagram of the structure of the second embodiment of the federated learning device in this application;
[0106] Figure 11 This is a schematic diagram of the structure of the computer device in the embodiments of this application;
[0107] Figure 12 This is a schematic diagram of the structure of the federated learning system in the embodiments of this application. Detailed Implementation
[0108] This application provides a federated learning method, device, and system to improve the robustness of the federated learning system.
[0109] The embodiments of this application can be applied to a federated learning system comprising multiple computer devices, each of which can be a server or a terminal device. The federated learning system can be as follows: Figure 1 As shown, the system includes a server and multiple terminal devices. One of the computer devices has a client installed, while the others have servers installed. Multiple clients and servers collaboratively train the same machine learning model. This application does not specifically limit the type of machine learning model; for example, it can be a classification model, a logistic regression model, a tree structure model, or a neural network model.
[0110] The following is based on Figure 1 The federated learning system shown is used as an example to introduce the federated learning method.
[0111] Specifically, before the first round of training, the server sends the machine learning model to be trained and the initial value of the model parameter to each client, and then each client performs the first round of training according to the local training data and sends the training result to the server. The server determines the value of the parameter of the second round of training according to the training result of each client, and sends the value of the parameter of the second round of training to each client. Each client performs the second round of training according to the local training data.
[0112] The above process is repeatedly performed until the machine learning model converges, and the training of the machine learning model is completed. The condition for the convergence of the machine learning model can be various, for example, the completion of a predetermined number of training rounds.
[0113] Based on the above description, it can be seen that interaction is needed between the client and the server during the training process. Therefore, once the attacked client appears, the attacked client may send incorrect training results to the server, causing the value of the parameter determined by the server for the next round to be incorrect, and the incorrect value of the parameter will be sent to other clients, thereby causing the training of all clients to be incorrect.
[0114] Therefore, in order to prevent this situation from occurring, and to avoid the poor robustness of the federated learning system caused by the detection of the training result by the server only, an embodiment of the present application provides a federated learning method. In the method, the client detects the model parameter issued by the server in each round of training, and trains the machine learning model using different training methods based on different detection results, so that the problem of the model parameter issued by the server can be identified in time to avoid training using incorrect model parameters. In addition, the client sends the detection result to the server, so that the server can also process the training results of each client received according to the detection result. In this way, the detection task in the training process is mainly responsible by the client, and is not concentrated in the server; and the server can also process according to the detection result of the client, so as to reduce the load of the server, avoid occupying too many resources of the server, and solve the problem of poor robustness of the existing federated learning system. The federated learning method in the embodiment of the present application will be introduced in detail below.
[0115] As shown in Figure 2 An embodiment of a federated learning method provided by the present application is applied to a federated learning system, and the federated learning system includes a server and a plurality of clients, and the same machine learning model is deployed on the plurality of clients.
[0116] It can be understood that the number of clients in the federated learning system can be adjusted according to actual needs, which is not limited in the embodiment of the present application.
[0117] As to the federated learning system and the machine learning model, reference can be made to the foregoing description. Figure 1
[0118] Based on the federated learning system, the method of the embodiments of the present application comprises:
[0119] Step 101, the server sends the first value of the parameter of the machine learning model to each of the plurality of clients.
[0120] The first value of the parameter is used for the current round of training of the machine learning model. The current round of training can also be referred to as the current round of training. If the current round of training is the first round of training in the entire training process, the first value of the parameter can also be referred to as the initial value of the model parameter.
[0121] It should be noted that the model parameter refers to all parameters contained in the machine learning model, which can specifically include weights and biases.
[0122] Correspondingly, each of the plurality of clients receives the first value of the parameter, specifically, the first client receives the first value of the parameter from the server; wherein the first client is one of the plurality of clients.
[0123] Step 102, the first client determines that the first value of the parameter does not satisfy the first condition according to the first training data and the machine learning model.
[0124] After receiving the first value of the parameter, the first client detects the first value of the parameter. There are many detection methods, and the embodiments of the present application realize the detection of the first value of the parameter by presetting the first condition and judging whether the first value of the parameter satisfies the first condition.
[0125] The specific content of the first condition can be set according to actual needs, for example, the first condition can be that the absolute value of the difference between the first value of the parameter and the preset value of the parameter is less than a third threshold. The first condition, the case of satisfying the first condition and the case of not satisfying the first condition will be described in detail in the following.
[0126] It should be understood that in the federated learning system, each client trains according to the local data of the client, so as to ensure that the local data of each client will not be leaked between the clients. Based on this, the first training data is the data reserved in the first client, which can also be understood as the local data of the first client.
[0127] It should be noted that the first value of the parameter can be determined not to satisfy the first condition by various methods, which are not limited in the embodiments of the present application. A specific method for determining that the first value of the parameter does not satisfy the first condition will be introduced in the following.
[0128] After detecting the first value of the parameter, if the first value of the parameter satisfies the first condition, the first client directly performs the current round of training according to the first training data, the machine learning model, and the first value of the parameter.
[0129] In the embodiments of the present application, step 102 is optional.
[0130] Step 103, in the case where the first value of the parameter does not satisfy the first condition, the first client performs the current round of training according to the first training data, the machine learning model, and the local value of the parameter, to obtain a training result of the current round of training.
[0131] It should be noted that the local value of the parameter can be set according to actual needs, and the embodiments of the present application do not make specific limitations thereon. Illustratively, the local value of the parameter is equal to the value of the parameter obtained in the last round of training; illustratively, the local value of the parameter is equal to the average of the values of the parameter obtained in the two rounds of training before the current round of training.
[0132] Since the training process is a relatively mature technology, it will not be described here.
[0133] After obtaining the second value of the model parameter, the first client can save the second value of the model parameter, so as to take the second value of the model parameter as the local value of the parameter in the next round of training of the current round of training.
[0134] The form of the training result can be various, and the embodiments of the present application do not make specific limitations thereon. For example, the training result of the current round of training is the value of the parameter obtained in the current round of training, or the difference between the value of the parameter obtained in the current round of training and the local value of the parameter. For example, the training result of the current round of training is the difference between the local value of the parameter and the value of the parameter obtained in the current round of training. For another example, the training result of the current round of training is the absolute value of the difference between the local value of the parameter and the value of the parameter obtained in the current round of training.
[0135] Step 104, the first client sends the training result of the current round of training and alarm information to the server, the alarm information indicating that the first value of the parameter does not satisfy the requirement.
[0136] It should be noted that if the first value of the parameter satisfies the first condition, the first client can also send alarm information at the same time of sending the training result to the server, and in this case, the value of the alarm information is different from that when the first value of the parameter does not satisfy the first condition.
[0137] The alarm information when the first value of the parameter satisfies the first condition indicates that the first value of the parameter satisfies the first condition.
[0138] The alarm information can also have various forms, which are not specifically limited in the embodiments of the present application. For example, the alarm information can represent the detection result of the first value of the parameter by using 0 and 1. Specifically, when the alarm information takes the value 1, it indicates that the first value of the parameter does not satisfy the first condition; when the alarm information takes the value 0, it indicates that the first value of the parameter satisfies the first condition.
[0139] In the embodiments of the present application, the first client detects the first value of the parameter issued by the server. When the first value of the parameter satisfies the first condition, the first client trains the machine learning model according to the first value of the parameter; when the first value of the parameter does not satisfy the first condition, the first client trains the machine learning model according to the local value of the parameter. Therefore, the embodiments of the present application can identify the abnormal first value of the parameter issued by the server, thereby avoiding training the learning model using the abnormal first value of the parameter, and the first client trains using the local value of the parameter, which can ensure the accuracy of the training result.
[0140] Similarly, in the federated learning system, the other clients in addition to the first client in the plurality of clients also send the training result to the server.
[0141] Correspondingly, the server receives the training result of the current round of training of each of the plurality of clients.
[0142] In step 105, in the case that at least one of the plurality of clients also reports the alarm signal, the server screens the training result from the training result of the current round of training of each of the plurality of clients, and the alarm information indicates that the first value of the parameter does not satisfy the first condition.
[0143] It can be understood that the detection results of the plurality of clients on the first value of the parameter include three cases; first, all of the plurality of clients detect that the first value of the parameter satisfies the first condition; second, all of the plurality of clients detect that the first value of the parameter does not satisfy the first condition; third, part of the plurality of clients detect that the first value of the parameter satisfies the first condition, and the other part of the plurality of clients detect that the first value of the parameter does not satisfy the first condition.
[0144] Correspondingly, the training results of the plurality of clients received by the server also include three cases; first, the plurality of clients send the training result at the same time, and also send the alarm signal; second, the plurality of clients only send the training result, without sending the alarm signal; third, part of the plurality of clients send the training result at the same time, and also send the alarm signal, while the other part of the plurality of clients only send the training result.
[0145] In the case that at least one of the plurality of clients reports an alarm signal, the server detects the training result of the current round of training of each of the plurality of clients to determine whether the training result of the current round of training of each of the plurality of clients is normal; in the case that none of the plurality of clients reports an alarm signal, the server does not detect the training result of the plurality of clients.
[0146] In the embodiments of the present application, the second condition can be set in advance. If the training result of the client meets the second condition, it means that the training result of the client is normal; if the training result of the client does not meet the second condition, it means that the training result of the client is abnormal or malicious.
[0147] It should be noted that the second condition can be set according to actual needs, and the embodiments of the present application do not limit this.
[0148] It should be noted that there are many methods for detecting the training result of each of the plurality of clients, and the embodiments of the present application do not limit this. For example, the training result of each of the plurality of clients can be detected according to One Class SVM algorithm, Isolation Forest algorithm, Local Outlier Factor algorithm, clustering algorithm, statistical model, Bhattacharyya distance measurement algorithm, Chow's criterion or Grubbs criterion.
[0149] In addition, other methods can also be used to detect the training result of each of the plurality of clients, and another method for detecting the training result of each of the plurality of clients will be described below.
[0150] In step 106, the server calculates a third value of the parameter according to the filtered training result, and the third value of the parameter is used for the next round of training of the machine learning model.
[0151] The next round of training is relative to the current round of training. Specifically, if the current round of training is the 5th round of training in the entire training process, the next round of training is the 6th round of training in the entire training process; if the current round of training is the 10th round of training in the entire training process, the next round of training is the 11th round of training in the entire training process.
[0152] It should be noted that there are many methods for the server to determine the third value of the parameter according to the filtered training result. For example, the server can aggregate part or all of the filtered training results according to an aggregation algorithm to obtain the third value of the parameter.
[0153] The aggregation algorithm includes but is not limited to average aggregation rule, GeoMed rule, Krum aggregation rule and Trimmed mean rule.
[0154] Since the training result of the current round of training is the value of the parameter obtained by the current round of training, or the difference between the value of the parameter obtained by the current round of training and the local value of the parameter, when the training result of the current round of training is the difference between the value of the parameter obtained by the current round of training and the local value of the parameter, and the local value of the parameter is equal to the value of the parameter obtained by the last round of training, the server can first calculate the second value of the model parameter obtained by the current round of training according to the training result and the value of the parameter obtained by the last round of training, and then aggregate according to the second value of the model parameter.
[0155] In the embodiments of the present application, when at least one of the plurality of clients also reports an alarm signal, the server will screen the training results of the respective current rounds of training of the plurality of clients, and determine the third value of the parameter of the next round of training according to the screened training results, thereby avoiding determining the third value of the parameter using abnormal training results and ensuring the accuracy of the third value of the parameter.
[0156] In summary, in the federated learning system, if the client and the server both use the above federated learning method to train the machine learning model, it can be avoided that all clients use the wrong value of the parameter for training due to the attack on a client or the attack on the server; and the server can screen the training results based on the alarm information of the client, so that the client plays a role in assisting the server to detect the training results. As can be seen, the federated learning method provided in the embodiments of the present application can improve the robustness of the federated learning system.
[0157] In addition, in the existing federated learning system, the server needs to detect the training results of the clients in each round of training, and the computational load of the server in the detection process is positively correlated with the number of clients; while in the embodiments of the present application, the server only screens the training results of the plurality of clients when at least one of the plurality of clients also reports an alarm signal, and does not screen the training results of the plurality of clients when the plurality of clients do not report an alarm signal. As can be seen, the federated learning method of the embodiments of the present application can also reduce the load of the server, so that the scalability of the federated learning system is strong.
[0158] Based on the foregoing description, there are various methods to determine that the first value of the parameter does not satisfy the first condition. As a realizable way, as shown in Figure 3 The first client determines that the first value of the parameter does not satisfy the first condition according to the first training data and the machine learning model, including:
[0159] In step 201, the first client calculates the first actual value of the performance of the machine learning model according to the first training data and the first value of the parameter.
[0160] It should be noted that there can be multiple indicators for measuring the performance of the machine learning model, and the embodiments of the present application do not make specific limitations thereon. Specifically, the performance of the machine learning model can include at least one of the accuracy, precision, recall, and F1 score. In addition, the error rate can also be used as the performance of the machine learning model to measure the performance of the machine learning model.
[0161] For different indicators of the performance of the machine learning model, the method for calculating the first actual value of the performance of the machine learning model is also different. The process of calculating the first actual value of the performance of the machine learning model is described below taking the accuracy as an example.
[0162] For example, the first training data includes 10 positive samples and 10 negative samples. The first client can predict the first training data according to the machine learning model and the first value of the parameter, and if the first client identifies 8 positive samples out of the 10 positive samples and 8 negative samples out of the 10 negative samples, the accuracy (i.e., the first performance value) of the machine learning model is 16 / 20 = 80%. Correspondingly, the error rate is 20%.
[0163] Similarly, the first client can also obtain the values of the precision, recall, and F1 score and other performances of the machine learning model according to the first training data and the first value of the parameter.
[0164] In step 202, the first client determines that the first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and the first target value of the performance of the machine learning model.
[0165] The first target value of the performance of the machine learning model is the value of the performance of the machine learning model after the last round of training, or the maximum value of the performance of the machine learning model after each round of training before the current round of training.
[0166] The last round of training is relative to the current round of training; specifically, if the current round of training is the 5th round of training in the entire training process, the last round of training is the 4th round of training in the entire training process; if the current round of training is the 10th round of training in the entire training process, the last round of training is the 9th round of training in the entire training process.
[0167] When the first target value of the performance of the machine learning model is the value of the performance of the machine learning model after the last round of training, the value of the performance of the machine learning model after the last round of training can be calculated according to the value of the parameter after the last round of training and the first training data, and the specific calculation process can be understood with reference to the process of calculating the first actual value of the performance of the machine learning model.
[0168] The first client can obtain and save the value of the performance of the machine learning model after the last round of training after the last round of training is completed; in this way, in the current round of training, the first client can directly use the saved value of the performance of the machine learning model after the last round of training as the first target value, and then execute step 202.
[0169] When the first target value is the maximum value of the performance of the machine learning model after each round of training before the current round of training, the same method can be used to obtain the value of the performance of the machine learning model after each round of training, which is not described in detail here.
[0170] The first target value of the performance of the machine learning model is described below with specific examples.
[0171] In this example, the current round of training is the 5th round of training in the entire training process, and the performance value of the machine learning model is represented by accuracy. The values of the performance of the machine learning model after the first four rounds of training are 75%, 78%, 80%, and 83%, respectively. The first target value of the performance of the machine learning model can be the value of the performance of the machine learning model after the fourth round of training, i.e., 83%, or the maximum value of the performance of the machine learning model after the first four rounds of training, i.e., 83%.
[0172] It should be noted that there are many ways for the first client to determine that the first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and the first target value of the performance of the machine learning model.
[0173] As an implementable way, the greater the first performance value, the better the performance of the machine learning model, for example, the first performance value is at least one of accuracy, precision, recall, and F1 score.
[0174] Based on this, the first client can determine that the first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and the first target value of the performance of the machine learning model.
[0175] Based on the first target value of the performance of the machine learning model being greater than the first actual value of the performance of the machine learning model by a first threshold value, the first client determines that the first value of the parameter does not satisfy the first condition.
[0176] At this time, the first condition is that the difference between the first target value of the performance of the machine learning model and the first actual value of the performance of the machine learning model is less than or equal to the first threshold value.
[0177] The first threshold value can be set according to actual needs.
[0178] For example, the performance is accuracy, and the first target value of the performance is specifically 83%, and the first threshold is 2%; when the first actual value of the performance is lower than 81%, it indicates that the first value of the parameter of the first client does not satisfy the first condition.
[0179] As an implementable manner, the smaller the value of the performance is, the better the performance of the machine learning model is, for example, the performance is error rate.
[0180] Therefore, the first client determining that the first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and the first target value of the performance of the machine learning model can include:
[0181] The first client determines that the first value of the parameter does not satisfy the first condition based on that the first target value of the performance of the machine learning model is less than the first actual value of the performance of the machine learning model by less than the first threshold.
[0182] For example, the performance is error rate, and the first target value of the performance is specifically 17%, and the first threshold is 2%; when the first actual value of the performance is higher than 19%, it indicates that the first value of the parameter of the first client does not satisfy the first condition.
[0183] In the embodiments of the present application, the first client determines that the first value of the parameter does not satisfy the first condition according to the first actual value of the performance of the machine learning model and the first target value of the performance of the machine learning model, so as to avoid training with the value of the parameter that makes the machine learning model have a relatively poor performance, that is, to ensure training with the value of the parameter that makes the machine learning model have a relatively good performance, thereby improving the final performance of the machine learning model.
[0184] Based on the foregoing description, multiple methods can be used to screen the training results of the multiple clients respectively, and one method of screening the training results of the multiple clients respectively is specifically introduced below.
[0185] Exemplarily, as shown in Figure 4 In the case that at least one of the multiple clients also reports an alarm signal, the server screens the training results from the training results of the current round of training of the multiple clients respectively, which includes:
[0186] In the case that at least one of the multiple clients also reports an alarm signal, the server screens the training results from the training results of the current round of training of the multiple clients respectively, which includes:
[0187] For each client, the second actual value of the performance of the machine learning model can be calculated according to the training result and the second training data.
[0188] The second actual value of the performance of the machine learning model is a value of the performance of the machine learning model after the current round of training, and the second training data is data reserved on the server, which can also be referred to as local data of the server.
[0189] At step 302, the server screens the training results of the plurality of clients from the current round of training according to the second actual value of the performance of the machine learning model of each of the plurality of clients and the second target value of the performance of the machine learning model, and determines the training results that meet the second condition.
[0190] It should be noted that the second target value can be set according to actual needs, and the embodiments of the present application do not make specific limitations.
[0191] For example, the second target value of the performance of the machine learning model is the maximum value of the performance of the machine learning model of each of the plurality of clients after each round of training before the current round of training. For example, the performance is the accuracy rate, the number of clients in the federated learning system is 3, and two rounds of training have been performed before the current round of training. After the first round of training, the accuracy rates of the machine learning models of the three clients are 77%, 78%, and 77%, respectively. After the first round of training, the accuracy rates of the machine learning models of the three clients are 79%, 80%, and 78%, respectively. The second target value is the maximum value of the accuracy rates of the machine learning models in the two rounds of training, that is, 80%.
[0192] For example, the second target value of the performance of the machine learning model is the maximum value of the second actual value of the performance of the machine learning model of each of the plurality of clients. For example, after the current round of training, the second actual values of the performance of the machine learning models of the plurality of clients are 83%, 84%, and 85%, respectively. The second target value can be 85%.
[0193] In addition, there are many ways to screen the training results that meet the second condition according to the second actual value of the performance of the machine learning model of each of the plurality of clients and the second target value of the performance of the machine learning model.
[0194] As one of the implementable ways, the greater the second actual value of the performance, the better the performance of the machine learning model, and at this time, the performance can be at least one of the accuracy rate, the precision rate, the recall rate, and the F1 score.
[0195] Based on this, the server determines the training results that meet the second condition from the training results of the plurality of clients according to the second performance value of the machine learning model of each of the plurality of clients and the second target performance value, including:
[0196] The second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model, or a second difference value is less than a second threshold value, the server determines that the training result of the second client satisfies the second condition, the second difference value is equal to a difference value between the second target performance value and the second performance value of the machine learning model of the second client, and the second client is any one of the plurality of clients.
[0197] At this time, the second condition is that the second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model, or the second difference value is less than the second threshold value, the second difference value is equal to a difference between the second target value of the performance of the machine learning model and the second actual value of the performance of the machine learning model of the second client, and the second client is any one of the plurality of clients.
[0198] The second threshold value can be set according to actual needs.
[0199] For example, the performance of the machine learning model of the second client is accuracy, and the second target value of the performance is specifically 85%, and the second threshold value is 2%; when the second actual value of the performance of the machine learning model of the second client is higher than 83%, it indicates that the training result of the second client satisfies the second condition.
[0200] As an implementable way, the smaller the second actual value of the performance is, the better the performance of the machine learning model is, for example, the performance is an error rate.
[0201] Therefore, the server determines the training result satisfying the second condition from the training results of the plurality of clients based on the second performance value and the second target performance value of the machine learning model of each of the plurality of clients.
[0202] The second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model, or a second difference value is less than a second threshold value, the server determines that the training result of the second client satisfies the second condition, the second difference value is equal to a difference value between the second target performance value and the second performance value of the machine learning model of the second client, and the second client is any one of the plurality of clients.
[0203] For example, the performance is an error rate, and the second target value of the performance is specifically 15%, and the second threshold value is 2%; when the second actual value of the performance is lower than 13%, it indicates that the training result of the second client satisfies the second condition.
[0204] As can be known from the foregoing description, there are also various methods for the server to calculate the third value of the parameter according to the screened training result, and three methods will be introduced in the following three examples.
[0205] First example:
[0206] In this example, the first value of the parameter is abnormal, and part of the plurality of clients identifies that the first value of the parameter is abnormal, and then trains using the local value of the parameter to obtain a training result. Finally, this part of the client sends the training result to the server while sending an alarm signal. Therefore, the training result of the client reporting the alarm signal received by the server is normal.
[0207] In this scenario, the server determines the third value of the parameter according to the training result of the client reporting the alarm signal.
[0208] Specifically, the training result of the client reporting the alarm signal in the training result of each of the plurality of clients satisfies the second condition.
[0209] The maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client reporting the alarm signal is greater than the maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client not reporting the alarm signal.
[0210] Based on the related description of step 301, the second actual value of the performance of the machine learning model of the client can be obtained according to the training result of the client. Therefore, based on the calculation result of step 301, it can be determined that the maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client reporting the alarm signal is greater than the maximum value of the second actual value of the performance of the machine learning model calculated according to the training result of the client not reporting the alarm signal.
[0211] Based on the above scenario, the server determines the third value of the parameter according to the filtered training result.
[0212] The server determines the third value of the parameter according to the training result of the client reporting the alarm signal in the filtered training result.
[0213] It should be noted that the server aggregates the training result of the client reporting the alarm signal according to the aforementioned aggregation algorithm to obtain the third value of the parameter. Specifically, the aforementioned aggregation algorithm can be understood with reference to the related description of the aggregation algorithm.
[0214] Based on the above description, when only part of the clients identify that the first value of the parameter is abnormal and send an alarm signal, the server determines the third value of the parameter according to the training result of the client reporting the alarm signal in the filtered training result. The third value of the parameter determined in this way makes the machine learning model have better performance, so as to accelerate the rapid convergence of the machine learning model.
[0215] Second example:
[0216] In this example, the first value of the parameter is normal, but part of the plurality of clients are attacked, so that this part of the clients send malicious training results to the server, which although meet the second condition, but the training results are poor, thus not conducive to the rapid convergence of the machine learning model. Moreover, this part of the clients also send alarm signals while sending malicious training results, which are used to make the server mistakenly believe that the training results carrying the alarm signals are normal, rather than malicious.
[0217] In this scenario, the server determines the third value of the parameter according to the training results of the filtered clients that do not report alarm signals.
[0218] Specifically, the training results of the clients that report alarm signals in the respective training results of the plurality of clients all meet the second condition, which is the same as the first example.
[0219] Unlike the first example, the maximum of the second actual values of the performance of the machine learning model calculated according to the training results of the clients that report alarm signals is less than the maximum of the second actual values of the performance of the machine learning model calculated according to the training results of the clients that do not report alarm signals.
[0220] Based on the related description of step 301, the second actual value of the performance of the machine learning model of the client can be obtained according to the training result of the client. Therefore, based on the calculation result of step 301, it can be determined that the maximum of the second actual values of the performance of the machine learning model calculated according to the training results of the clients that report alarm signals is less than the maximum of the second actual values of the performance of the machine learning model calculated according to the training results of the clients that do not report alarm signals.
[0221] Based on the above scenario, the server determines the third value of the parameter according to the filtered training results, which includes:
[0222] The server determines the third value of the parameter according to the training results of the clients that do not report alarm signals in the filtered training results.
[0223] Based on the foregoing description, the training results of the clients that report alarm signals may be malicious training results sent by attacked clients, and the second actual value of the performance of the machine learning model obtained according to the training results of the clients that do not report alarm signals is higher, so in the embodiments of the present application, the server determines the third value of the parameter according to the training results of the clients that do not report alarm signals in the filtered training results. The third value of the parameter determined in this way makes the machine learning model have better performance, so as to accelerate the rapid convergence of the machine learning model.
[0224] Third example:
[0225] In this example, there are attacked clients and unattacked clients in the plurality of clients, and the attacked clients and the unattacked clients send alarm signals to the server while sending the training results to the server. In this scenario, the server determines the third value of the parameter according to the training results of the clients that do not report alarm signals in the filtered training results.
[0226] Specifically, the training results of the clients that report alarm signals partially satisfy the second condition. Wherein, the training results of the clients that report alarm signals partially satisfy the second condition means that there are training results that satisfy the second condition and there are training results that do not satisfy the second condition in the training results of the clients that report alarm signals.
[0227] Based on the above scenario, the server determines the third value of the parameter according to the training results of the clients that report alarm signals in the filtered training results.
[0228] The server determines the third value of the parameter according to the training results of the clients that report alarm signals in the filtered training results.
[0229] In the embodiments of the present application, when the training results of the clients that report alarm signals in the respective training results of the plurality of clients partially satisfy the second condition, the server determines the third value of the parameter according to the training results of the clients that report alarm signals in the filtered training results. The third value of the parameter thus determined makes the machine learning model have better performance, so that the machine learning model can converge faster.
[0230] The above describes the process of detecting the first value of the parameter by the client in the training process and the process of detecting the training results of each client by the server. In addition, the federated learning method provided by the embodiments of the present application can also include the content of penalty management, that is, the server specially processes the client whose training result is abnormal for multiple times.
[0231] For example, the federated learning method provided by the embodiments of the present application further includes:
[0232] If the training results of the third client are not included in the filtered training results in M rounds of training including the current round of training, the server filters training results from the training results of the clients other than the third client in N rounds of training after the current round of training, and the third client is any one of the plurality of clients, and M and N are positive integers.
[0233] Wherein, M and N can be set according to actual needs. For example, M is 5 and N is 3; for another example, M is 3 and N is 5.
[0234] It can be understood that in the current round of training, the training result of the third client is not included in the selected training result, and the training result of the third client in the M rounds of training that have been performed is not included in the selected training result until the current round of training; then in the N rounds of training after the current round of training, the server only selects the training result from the training results of the other clients except the third client among the plurality of clients, so that the server does not determine the value of the parameter by using the training result of the third client.
[0235] In the N rounds of training, the server can still send the determined value of the parameter to the third client to enable the third client to train the machine learning model. In the N+1 round of training, the server selects the training result according to the training results of the plurality of clients including the training result of the third client.
[0236] For example, M is equal to 5 and N is 3. The current round of training is the 10th round of training in the entire training process, and the training result of the third client is not included in the selected training result in the 5th, 6th, 7th, 8th and 10th round of training, so that the training result of the third client in the 5 rounds of training that have been performed is not included in the selected training result. Then in the 11th, 12th and 13th round of training, the server only selects the training result from the training results of the other clients except the third client. In the 14th round of training, the server selects the training result according to the training results of the plurality of clients including the training result of the third client.
[0237] It should be noted that the server can only select the training result from the training results of the other clients except the third client among the plurality of clients in the N rounds of training after the current round of training. For example, if the training result of the third client is not included in the selected training result in the M rounds of training including the current round of training, the server can refuse to receive the training result of the third client in the N rounds of training after the current round of training. In addition, the server can receive the training result of the third client in the N rounds of training after the current round of training, but refuse to use the training result of the third client.
[0238] The federated learning method provided by the embodiment of the application is described above, and in order to facilitate understanding, the federated learning method is further described through an application example.
[0239] In this application example, the number of clients is 10, the convergence condition of the machine learning model is to complete 20 rounds of training, in the 3rd to 6th round of training, the 9th-12th round of training and the 15th-18th round of training, the clients numbered 6, 7, 8 and 9 are attacked, the performance value of the machine learning model is expressed by accuracy, M in the foregoing embodiment is 2, N is 20, the first threshold and the second threshold are both 3%. In the 20 rounds of training, the client and the server respectively use the federated learning method provided in the application example for training. The whole training process can refer to Figure 5 and Figure 6 . Wherein Figure 5 is an accuracy diagram of the machine learning model on the server, Figure 6 is a diagram of the number of clients sending alarm information in each round of training.
[0240] Comparing Figure 5 and Figure 6 , in the 3rd round of training, the clients numbered 6, 7, 8 and 9 are attacked, so that part of the clients send abnormal training results to the server, so the accuracy of the machine learning model in Figure 5 decreases. In the 4th round of training, 2 clients send alarm information to the server, and the server detects the training results of the 10 clients to identify the normal training results, so from the 4th round of training, the accuracy of the machine learning model in Figure 5 increases.
[0241] Since in the 3rd to 6th round of training, the clients numbered 6, 7, 8 and 9 are continuously attacked, resulting in that in the 7th round of training, Figure 5 the accuracy of the machine learning model decreases sharply. At the same time, 6 clients send alarm information to the server, and the server detects the training results of the 10 clients to identify the normal training results, so from the 7th round of training, Figure 5 the accuracy of the machine learning model increases sharply.
[0242] Since M is 2 and N is 20, the training results of the clients in 2 rounds of training do not meet the second condition and will be discarded. Based on this, in the 9th round of training, the clients numbered 6, 7, 8 and 9 are attacked again, in the 10th round of training, only one client sends alarm information, and Figure 5 the decrease amplitude of the accuracy of the machine learning model is much smaller than the decrease amplitude of the accuracy of the machine learning model in Figure 5 in the 7th round of training.
[0243] More obviously, in the 15th-18th round of training, even if the clients numbered 6, 7, 8 and 9 are attacked again, Figure 5The accuracy of the machine learning model in the system no longer decreases and finally maintains at about 90%.
[0244] Based on the above description, it can be known that the federated learning method provided by the embodiments of the present application is used as a defense strategy, which can effectively block attacks, and the performance of the machine learning model will eventually converge to a higher performance.
[0245] In addition, the embodiments of the present application also simulate the federated learning method provided by the embodiments of the present application and the two existing defense strategies, and the simulation results are shown in Figure 7 and Figure 8 .
[0246] The simulation results shown in Figure 7 correspond to the following simulation conditions: the number of clients is 10, the convergence condition of the machine learning model is to complete 20 rounds of training, in the 3rd to 6th round of training, the 9th-12th round of training and the 15th-18th round of training, 4 clients are attacked, the performance value of the machine learning model is expressed by accuracy, M in the foregoing embodiments is 2, N is 20, the first threshold and the second threshold are both 3%. In the 20 rounds of training, the client and the server respectively use the federated learning method provided by the embodiments of the present application for training.
[0247] Figure 8 The simulation results shown in correspond to the following simulation conditions: the number of clients is 10, the convergence condition of the machine learning model is to complete 20 rounds of training, in the 3rd to 6th round of training, the 9th-12th round of training and the 15th-18th round of training, 8 clients are attacked, the performance value of the machine learning model is expressed by accuracy, M in the foregoing embodiments is 2, N is 20, the first threshold and the second threshold are both 3%. In the 20 rounds of training, the client and the server respectively use the federated learning method provided by the embodiments of the present application for training.
[0248] In Figure 7 and Figure 8 , curve A represents the change of the accuracy of the machine learning model of the server when the federated learning system uses the federated learning method provided by the embodiments of the present application to defend against attacks and the clients are not attacked during the training process. Curve B represents the change of the accuracy of the machine learning model of the server when the federated learning system uses the existing first defense method to defend against attacks and the clients are attacked during the training process. Curve C represents the change of the accuracy of the machine learning model of the server when the federated learning system uses the federated learning method provided by the embodiments of the present application to defend against attacks and the clients are attacked during the training process. Curve D represents the change of the accuracy of the machine learning model of the server when the federated learning system uses the existing second defense method to defend against attacks and the clients are attacked during the training process.
[0249] As can be seen from Figure 7 , in the case that the client is attacked, the fluctuation range of the accuracy of the machine learning model is smaller when the federated learning method provided in the embodiment of the application is used to defend against the attack than when the first existing defense method and the second existing defense method are used to defend against the attack. Moreover, as the training proceeds, even if the client is attacked again, the accuracy of the machine learning model no longer fluctuates and tends to be the accuracy shown in curve A, i.e., the accuracy of the machine learning model in the case that the client is not attacked during the training process, when the federated learning method provided in the embodiment of the application is used to defend against the attack.
[0250] As can be seen from Figure 8 , the increase in the number of clients attacked leads to an increase in the fluctuation of the accuracy. Although the fluctuation range of the accuracy of the machine learning model is roughly the same when the federated learning method provided in the embodiment of the application is used to defend against the attack as when the first existing defense method and the second existing defense method are used to defend against the attack when the client is attacked again during the first few rounds of training, the accuracy of the machine learning model quickly recovers to the accuracy of the machine learning model before the attack when the federated learning method provided in the embodiment of the application is used to defend against the attack. More importantly, as the training proceeds, even if the client is attacked again, the accuracy of the machine learning model no longer fluctuates and tends to be the accuracy shown in curve A, i.e., the accuracy of the machine learning model in the case that the client is not attacked during the training process, when the federated learning method provided in the embodiment of the application is used to defend against the attack.
[0251] Please refer to Figure 9 , a structural schematic diagram of the first embodiment of the federated learning device in the embodiment of the application.
[0252] The embodiment of the application further provides an embodiment of a federated learning device, which is applied to a federated learning system, the federated learning system comprising a server and a plurality of clients, and the same machine learning model being deployed on the plurality of clients; the federated learning device being contained in one of the plurality of clients and comprising:
[0253] The receiving unit 401 is configured to receive the first value of the parameter of the machine learning model from the server.
[0254] The training unit 402 is configured to, in the case that the first value of the parameter does not satisfy the first condition, perform the current round of training according to the first training data, the machine learning model and the local value of the parameter to obtain a training result of the current round of training, the first training data being the data reserved in the first client.
[0255] The sending unit 403 is configured to send the training result and alarm information to the server, the alarm information indicating that the first value of the parameter does not meet the requirement.
[0256] In an implementation, the local value of the parameter is equal to a value of the parameter obtained in a previous round of training.
[0257] In an implementation, the training result of the current round of training is a value of the parameter obtained in the current round of training, or a difference between the value of the parameter obtained in the current round of training and the local value of the parameter.
[0258] In an implementation, the federated learning apparatus further includes a determination unit 404 configured to determine, according to the first training data and the machine learning model, that the first value of the parameter does not satisfy the first condition.
[0259] In an implementation, the determination unit 404 is configured to calculate, according to the first training data and the first value of the parameter, a first actual value of the performance of the machine learning model.
[0260] The first value of the parameter is determined not to satisfy the first condition according to the first actual value of the performance of the machine learning model and a first target value of the performance of the machine learning model.
[0261] In an implementation, the first target value of the performance of the machine learning model is a value of the performance of the machine learning model after a previous round of training, or a maximum value of the performance of the machine learning model after each round of training before the current round of training.
[0262] In an implementation, the first condition is that a difference between the first target value of the performance of the machine learning model and the first actual value of the performance of the machine learning model is less than or equal to a first threshold value.
[0263] In an implementation, the performance of the machine learning model includes at least one of accuracy, precision, recall, and F1 score.
[0264] The specific implementation, related description, and technical effects of each unit above can be referred to the description of the embodiments of the federated learning apparatus shown in the embodiments of the present application. Figures 2 to 4 The description of the embodiments of the federated learning apparatus shown in the embodiments of the present application.
[0265] Please refer to Figure 10 , the structural schematic diagram of the second embodiment of the federated learning apparatus in the embodiments of the present application.
[0266] The embodiments of the present application further provide another embodiment of a federated learning apparatus, which is applied to a federated learning system including a server and a plurality of clients, and the same machine learning model is deployed on the plurality of clients; the federated learning apparatus is included in the server and includes:
[0267] The sending unit 501 is configured to send, to the plurality of clients respectively, a first value of a parameter of the machine learning model, the first value of the parameter being used for a current round of training of the machine learning model.
[0268] The receiving unit 502 is configured to receive training results of the current round of training of the plurality of clients respectively.
[0269] The screening unit 503 is configured to, in the case that at least one of the plurality of clients also reports an alarm signal, screen the training results of the current round of training of the plurality of clients respectively by the server, the alarm information indicating that the first value of the parameter does not satisfy the first condition.
[0270] The calculating unit 504 is configured to calculate a third value of the parameter according to the screened training results, the third value of the parameter being used for the next round of training of the machine learning model.
[0271] In an implementation manner, the training result of the current round of training is a value of the parameter obtained by the current round of training, or a difference between the value of the parameter obtained by the current round of training and the local value of the parameter.
[0272] In an implementation manner, the screening unit 503 is configured to, in the case that at least one of the plurality of clients also reports an alarm signal, calculate a second actual value of the performance of the machine learning model of the plurality of clients respectively according to the second training data and the training results of the current round of training of the plurality of clients respectively, the second actual value of the performance of the machine learning model being a value of the performance of the machine learning model after the current round of training, and the second training data being data reserved in the server.
[0273] The screening unit 503 is configured to screen, according to the second actual value of the performance of the machine learning model of the plurality of clients respectively and the second target value of the performance of the machine learning model, the training results of the current round of training of the plurality of clients respectively that satisfy the second condition.
[0274] In an implementation manner, the second target value of the performance of the machine learning model is a maximum value of the performance of the machine learning model after each round of training of the plurality of clients respectively before the current round of training.
[0275] Or the second target value of the performance of the machine learning model is a maximum value of the second actual value of the performance of the machine learning model of the plurality of clients respectively.
[0276] In an implementation manner, the second condition is that the second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model or a second difference is less than a second threshold, the second difference being equal to a difference between the second target value of the performance of the machine learning model and the second actual value of the performance of the machine learning model of the second client, and the second client being any one of the plurality of clients.
[0277] In one implementation, the training results of clients that report alarm signals all satisfy the second condition; the maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that report alarm signals is greater than the maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that do not report alarm signals.
[0278] The calculation unit 504 is used to determine the third value of the parameter based on the training results of the clients that reported alarm signals in the selected training results.
[0279] In one implementation, the training results of clients that report alarm signals all satisfy the second condition; the maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that report alarm signals is less than the maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that do not report alarm signals.
[0280] The calculation unit 504 is used to determine the third value of the parameter based on the training results of the clients that did not report alarm signals in the selected training results.
[0281] In one implementation, the training results of clients that report alarm signals partially satisfy the second condition.
[0282] The calculation unit 504 is used to determine the third value of the parameter based on the training results of the clients that reported alarm signals in the selected training results.
[0283] In one implementation, the filtering unit 503 is further configured to, in the Nth training round after the current training round, filter the training results only from the training results of the other clients besides the third client in the multiple clients when the training results of the third client are not included in the filtered training results in the M rounds of training including the current training round. The third client is any one of the multiple clients, and M and N are both positive integers.
[0284] For details regarding the implementation, related explanations, and technical effects of each of the above units, please refer to the embodiments of this application. Figures 2 to 4 Description of the illustrated embodiment.
[0285] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of the computer device in the embodiments of this application.
[0286] One embodiment of the computer device in this application may include one or more processors 601, memory 602, and communication interfaces 603.
[0287] The memory 602 can be a temporary storage or a persistent storage. Further, the processor 601 can be configured to communicate with the memory 602 to execute a series of instruction operations in the memory 602 on the terminal device.
[0288] In the embodiment shown in FIG. 6, the processor 601 can execute the steps performed by the client in the embodiments shown in FIGS. 1 to 5, and details are not repeated here. Figure 2 Figure 3 In the embodiment shown in FIG. 6, the processor 601 can execute the steps performed by the client in the embodiments shown in FIGS. 1 to 5, and details are not repeated here.
[0289] Exemplarily, the processor 601 can execute the following steps:
[0290] receiving a first value of the parameter from the server, the first client being one of the plurality of clients;
[0291] in a case where the first value of the parameter does not satisfy the first condition, performing a current round of training according to the first training data, the machine learning model and the local value of the parameter to obtain a training result of the current round of training, the first training data being data reserved on the first client;
[0292] sending the training result of the current round of training and alarm information to the server, the alarm information indicating that the first value of the parameter does not satisfy the requirement.
[0293] At this time, the specific functional module division in the processor 601 can be similar to the division manner of the receiving unit, the determining unit, the training unit and the sending unit and other functional modules described in the foregoing Figure 9 embodiments, and details are not repeated here.
[0294] Exemplarily, the processor 601 can execute the following steps:
[0295] sending the first value of the parameter to the plurality of clients respectively, the first value of the parameter being used for the current round of training of the machine learning model;
[0296] receiving the training result of the current round of training of each of the plurality of clients;
[0297] in a case where at least one of the plurality of clients also reports alarm information, screening the training result from the training result of the current round of training of each of the plurality of clients, the alarm information indicating that the first value of the parameter does not satisfy the first condition;
[0298] calculating a third value of the parameter according to the screened training result, the third value of the parameter being used for a next round of training of the machine learning model.
[0299] At this time, the specific functional module division in the processor 601 can be similar to the division manner of the sending unit, the receiving unit, the first determining unit and the second determining unit and other functional modules described in the foregoing Figure 10 embodiments, and details are not repeated here.
[0300] The embodiment of the present application also provides a chip or a chip system, which comprises at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is used to run computer programs or instructions to execute the foregoing Figure 2 and Figure 3 The steps performed by the first client in the embodiment shown in the foregoing
[0301] The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0302] The embodiment of the present application also provides a first implementation of a chip or a chip system, and the chip or the chip system described in the foregoing of the present application further comprises at least one memory, and the at least one memory stores instructions. The memory can be a storage unit inside the chip, for example, a register, a cache, etc., or a storage unit of the chip (for example, a read-only memory, a random access memory, etc.).
[0303] The embodiment of the present application also provides a chip or a chip system, which comprises at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is used to run computer programs or instructions to execute the foregoing Figure 2 and Figure 4 The steps performed by the server in the embodiment shown in the foregoing
[0304] The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0305] The embodiment of the present application also provides a first implementation of a chip or a chip system, and the chip or the chip system described in the foregoing of the present application further comprises at least one memory, and the at least one memory stores instructions. The memory can be a storage unit inside the chip, for example, a register, a cache, etc., or a storage unit of the chip (for example, a read-only memory, a random access memory, etc.).
[0306] The embodiment of the present application also provides a computer storage medium, which is used to store computer software instructions for the terminal device or the server, and comprises programs designed for the server.
[0307] The terminal device can be the federated learning device described in the foregoing Figure 9 .
[0308] The server can be the federated learning device described in the foregoing Figure 10 .
[0309] The embodiment of the present application further provides a computer program product, which comprises computer software instructions, and the computer software instructions can be loaded by a processor to implement the flow in the method shown in the foregoing Figure 2 、 Figure 3 and Figure 4 .
[0310] Please refer to Figure 12 , a structural schematic diagram of the federated learning system in the embodiment of the present application.
[0311] The embodiment of the present application further provides an embodiment of a federated learning system, comprising a server 701 and a plurality of clients 702, and the same machine learning model is deployed on the plurality of clients 702.
[0312] Each of the plurality of clients 702 is configured to perform the steps performed by the first client in the foregoing embodiment.
[0313] The server 701 is configured to perform the steps performed by the server in the foregoing embodiment.
[0314] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the system, device and unit described above can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0315] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0316] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment.
[0317] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0318] The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
Claims
1. A federated learning method, characterized in that, The method is applied to a federated learning system, which includes a server and multiple clients, on which the same machine learning model is deployed; the method includes: The first client receives a first value of the parameters of the machine learning model from the server, and the first client is one of the plurality of clients; If the first value of the parameter does not meet the first condition, the first client performs this round of training based on the first training data, the machine learning model, and the local value of the parameter to obtain the training result of this round of training. The first training data is the data reserved in the first client. The first client sends the training results and alarm information of this round of training to the server, and the alarm information indicates that the first value of the parameter does not meet the first condition.
2. The method according to claim 1, characterized in that, The local value of the parameter is equal to the value of the parameter obtained in the previous training round.
3. The method according to claim 1 or 2, characterized in that, The training result of this round of training is the value of the parameter obtained in this round of training, or the difference between the value of the parameter obtained in this round of training and the local value of the parameter.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The first client determines, based on the first training data and the machine learning model, that the first value of the parameter does not satisfy the first condition.
5. The method according to claim 4, characterized in that, The first client determines, based on the first training data and the machine learning model, that the first value of the parameter does not satisfy the first condition, including: The first client calculates a first actual value of at least one performance of the machine learning model based on the first training data and the first value of the parameter; The first client determines that the first value of the parameter does not satisfy the first condition based on the first actual value of at least one performance of the machine learning model and the first target value of at least one performance of the machine learning model.
6. The method according to claim 4, characterized in that, The first target value of at least one performance of the machine learning model is the value of at least one performance of the machine learning model after the previous round of training, or the maximum value of at least one performance of the machine learning model after each round of training before the current round of training.
7. The method according to claim 5 or 6, characterized in that, The first condition is that the difference between the first target value of the performance of the machine learning model and the first actual value of the performance of the machine learning model is less than or equal to a first threshold.
8. The method according to any one of claims 4 to 6, characterized in that, The performance of the machine learning model includes at least one of accuracy, precision, recall, and F1 score.
9. A federated learning method, characterized in that, The method is applied to a federated learning system, which includes a server and multiple clients, on which machine learning models are deployed; the method includes: The server sends the first value of the parameters of the machine learning model to each of the multiple clients, and the first value of the parameters is used for the current round of training of the machine learning model; The server receives the training results of each of the multiple clients for this round of training; If at least one of the multiple clients reports an alarm message, the server filters the training results from the training results of each of the multiple clients in this round of training, and the alarm message indicates that the first value of the parameter does not meet the first condition; The server calculates a third value for the parameter based on the selected training results, and the third value of the parameter is used for the next round of training of the machine learning model.
10. The method according to claim 9, characterized in that, The training result of this round of training is the value of the parameter obtained in this round of training, or the difference between the value of the parameter obtained in this round of training and the local value of the parameter.
11. The method according to claim 9 or 10, characterized in that, When at least one of the multiple clients has reported an alarm, the server filters the training results from the training results of each of the multiple clients in this round of training, including: If at least one of the multiple clients also reports alarm information, the server calculates a second actual value of the performance of the machine learning model of each of the multiple clients based on the second training data and the training results of each client in this round of training. The second actual value of the performance of the machine learning model is the performance value of the machine learning model after this round of training. The second training data is data reserved on the server. The server selects training results that satisfy the second condition from the training results of the current training round of the multiple clients based on the second actual value of the performance of the machine learning model of each client and the second target value of the performance of the machine learning model.
12. The method according to claim 11, characterized in that, The second objective value for the performance of the machine learning model is the maximum performance of the machine learning model of each of the multiple clients after each round of training before the current round of training; Alternatively, the second objective value for the performance of the machine learning model is the maximum of the second actual values of the performance of the machine learning model for each of the plurality of clients.
13. The method according to claim 11 or 12, characterized in that, The second condition is: the second actual value of the performance of the machine learning model of the second client is greater than the second target value of the performance of the machine learning model or the second difference is less than the second threshold, the second difference is equal to the difference between the second target value of the performance of the machine learning model and the second actual value of the performance of the machine learning model of the second client, and the second client is any one of the plurality of clients.
14. The method according to any one of claims 11 to 13, characterized in that, The training results of the clients that reported alarm information all meet the second condition; The maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that have reported alarm information is greater than the maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that have not reported alarm information. The server calculates the third value of the parameter based on the selected training results, including: The server determines the third value of the parameter based on the training results of the clients that reported alarm information from the selected training results.
15. The method according to any one of claims 11 to 13, characterized in that, The training results of the clients that reported alarm information all meet the second condition; The maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that have reported alarm information is less than the maximum value of the second actual value of the performance of the machine learning model calculated based on the training results of clients that have not reported alarm information. The server calculates the third value of the parameter based on the selected training results, including: The server determines the third value of the parameter based on the training results of the clients that did not report alarm information in the selected training results.
16. The method according to any one of claims 11 to 13, characterized in that, The training results of clients that report alarm information partially meet the second condition; The server calculates the third value of the parameter based on the selected training results, including: The server determines the third value of the parameter based on the training results of the clients that reported alarm information from the selected training results.
17. The method according to any one of claims 9 to 16, characterized in that, The method further includes: If, in M training rounds including the current training round, the training results of the third client are not included in the selected training results, then in the N training rounds following the current training round, the server selects training results only from the training results of the other clients among the plurality of clients, excluding the third client. The third client is any one of the plurality of clients, and M and N are both positive integers.
18. A federated learning device, characterized in that, The method is applied to a federated learning system, which includes a server and multiple clients, on which the same machine learning model is deployed; the federated learning device is included in one of the multiple clients and includes: The receiving unit is used to receive the first value of the parameter from the server. The training unit is configured to perform this round of training based on the first training data, the machine learning model, and the local value of the parameter when the first value of the parameter does not meet the first condition, so as to obtain the training result of this round of training. The first training data is data reserved in the first client, and the first client is one of the plurality of clients. The sending unit is used to send the training results and alarm information to the server, wherein the alarm information indicates that the first value of the parameter does not meet the requirements.
19. A federated learning device, characterized in that, The method is applied to a federated learning system, which includes a server and multiple clients, on which the same machine learning model is deployed; the federated learning device is contained in the server and includes: A sending unit is used to send the first value of the parameter to each of the plurality of clients, wherein the first value of the parameter is used for the current round of training of the machine learning model; A receiving unit is used to receive the training results of each of the multiple clients in this round of training; The first determining unit is configured to, when at least one of the plurality of clients has reported an alarm message, filter the training results from the training results of the current training of each of the plurality of clients, wherein the alarm message indicates that the first value of the parameter does not meet the first condition; The second determining unit is used to calculate a third value of the parameter based on the selected training results, and the third value of the parameter is used for the next round of training of the machine learning model.
20. A computer device, characterized in that, include: At least one processor and a memory, the memory storing computer-executable instructions that can run on the processor, wherein when the computer-executable instructions are executed by the processor, the processor performs the method as described in any one of claims 1-8, or the method as described in any one of claims 9-17.
21. A computer-readable storage medium storing one or more computer-executable instructions, characterized in that, When the computer execution instructions are executed by the processor, the processor performs the method as described in any one of claims 1-17.
22. A federated learning system, characterized in that, It includes a server and multiple clients, on which the same machine learning model is deployed; Each of the plurality of clients is used to perform the method described in any one of claims 1 to 8 above; The server is used to execute the method described in any one of claims 9 to 17.
Citation Information
Cited By
Federated learning method, device and system
WO2022033579A1