Server device, federated learning system, momentum selection method, and program
The server device in the federated learning system addresses the challenge of differentiating between honest and attacker-generated momentum by using a distance calculation unit to select only valid momentum, thereby enhancing robustness and maintaining learning accuracy.
Patent Information
- Application Number
- PCT/JP2023/020336
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-05
AI Technical Summary
In federated learning systems, existing methods struggle to distinguish between momentum output by honest clients and attackers, leading to reduced learning performance as they treat both equally, which can result in inaccurate model training or model degradation due to attacker interference.
A server device with a distance calculation unit that determines the distance between reference and client momentum vectors, allowing only momentum within a predetermined threshold to be selected and aggregated, effectively differentiating between honest and attacker-generated momentum.
This approach enhances the robustness of federated learning by reducing the impact of attackers, maintaining learning accuracy, and preventing model deterioration, even in the presence of malicious participants.
Smart Images

Figure JP2023020336_05122024_PF_FP_ABST
Abstract
Description
Server device, federated learning system, momentum selection method, and program
[0001] The present disclosure relates to a server device, a federated learning system, a momentum selection method, and a program.
[0002] Federated learning allows for learning a model that learns the characteristics of all data while ensuring data security in an environment where data is stored in a distributed manner, but learning cannot be performed successfully if there are users who do not follow the correct learning protocol (Non-Patent Documents 1 and 2).
[0003] Robustness improvement method: In the basic federated learning method called FedAvg, which consists of a server and a client, there is a method for performing federated learning by reducing the impact of attacks on the model during learning (Non-Patent Document 3).
[0004] The method of Non-Patent Document 3 will be outlined below with reference to specific algorithms, Algorithm 1 and Algorithm 2. Algorithm 1 is an algorithm for functional AGC, and Algorithm 2 is an algorithm for performing federated learning of a model while reducing the influence of an attacker using AGC. The first line of Algorithm 1 defines the input to the algorithm, which is the momentum m1,…,m, which are parameters for updating the model calculated on each of the n client devices. n , a threshold τ, a parameter v (the handling of the parameter v will be described later), and the number of learning iterations L are input.
[0005] The second line of Algorithm 1 indicates that the initial value of L is 1 and v is the aggregation result m^ from the previous round.
[0006] Line 3 of Algorithm 1 indicates that lines 4-5 are executed for l=1,...,L at each iteration.
[0007] The fourth line of Algorithm 1 is (m i -v) and (1,τ / ||m i -v||) is the smaller product ofi (where i is the index of the client device), and this formula indicates that an attacker can i Even if (>>τ) is input, τ / ||m i -v|| becomes a minimum value, (m i By keeping the product of this and v within a certain range, the information from all clients can be kept below a predetermined value, thereby reducing the impact of attacks.
[0008] Line 5 of Algorithm 1 assigns v to each client device's c1,...,c n The first v is updated by adding the average value of (m i Since the -v in (-v) is offset, the processing in line 5 is equivalent to calculating the average value while reducing the influence of the attacker.
[0009] Line 6 of Algorithm 1 indicates the end of the for statement, and line 7 of Algorithm 1 indicates that the average value v calculated while reducing the influence of an attacker is output and the process ends. The first line of Algorithm 2 defines the input to this algorithm, indicating that the inputs are the model parameter x, the learning rate η, the hyperparameter β that specifies how the learning results are handled on each client device, and the algorithm AGG described above.
[0010] The second line of Algorithm 2 defines the client device index i as an integer between 1,...,n, and the momentum m i This indicates that the initial value of is 0.
[0011] Line 3 of Algorithm 2 indicates that lines 4-12 are executed for t=1,... in each round.
[0012] The fourth line of Algorithm 2 indicates that the server device first sends the model parameters x to each client device, which enables each client device to use the model.
[0013] The fifth line of Algorithm 2 indicates that each client device (i=1, . . . , n) executes the processes of the sixth to ninth lines in parallel.
[0014] Line 6 of Algorithm 2 is where each client device calculates the gradient of the model, g i This indicates that (x) is to be calculated.
[0015] Line 7 of Algorithm 2 shows that each client device receives g proportionally divided by the hyperparameter β. i (x) and m i By Momentum m i This indicates that the
[0016] Line 8 of Algorithm 2 calculates the updated momentum m i is transmitted to the server device.
[0017] Line 9 of Algorithm 2 indicates the end of parallel processing on each client device.
[0018] Line 10 of Algorithm 2 is m1,…,m n Based on the processing in Algorithm 1 described above, we show that m^ is calculated by calculating the average value v while reducing the influence of an attacker.
[0019] Line 11 of Algorithm 2 indicates that the model parameter x is updated by subtracting m^ multiplied by the learning rate η from the model parameter x. Line 12 of Algorithm 2 indicates the end of the for statement.
[0020] H. Brendan McMahan and Eider Moore and Daniel Ramage and Seth Hampson and Blaise Aguera y Arcas, “Communication-Efficient Learning of Deep Networks from Decentralized Data”, arXiv:1602.05629v4 [cs.LG] 26 Jan 2023, https: / / arxiv.org / pdf / 1907.09693.pdfQinbin Li, Zeyi Wen, Zhaomin Wu, Sixu Hu, Naibo Wang, Yuan Li, Xu Liu, Bingsheng He, “A Survey on Federated Learning Systems: Vision, Hype and Reality for Data Privacy and Protection”, arXiv:1907.09693v7 [cs.LG] 5 Dec 2021, https: / / arxiv.org / pdf / 1602.05629.pdfSai Praneeth Karimireddy, Lie He, Martin Jaggi, “Learning from History for Byzantine Robust Optimization”, Proceedings of the 38th International Conference on Machine Learning, in Proceedings of Machine Learning Research 139:5311-5319, https: / / proceedings.mlr.press / v139 / karimireddy21a.html.
[0021] The method in Non-Patent Document 3 does not distinguish between attackers and others (hereinafter referred to as honest clients), but improves robustness by keeping information from all clients below a threshold. However, this method reduces the information from honest clients, which is information necessary to improve learning performance, and therefore reduces learning performance.
[0022] Therefore, an object of the present disclosure is to provide a server device that can distinguish between momentum output by an honest person and momentum output by an attacker in federated learning of a model.
[0023] The server device of the present disclosure includes a distance calculation unit that receives momentum, which is a vector calculated based on parameters of a model learned by each of the n client devices, calculates the distance between the reference momentum and momentum to be selected / non-selected, and selects momentum for which the calculated distance is less than a predetermined threshold τ.
[0024] According to the server device of the present disclosure, it is possible to distinguish between momentum output by an honest person and momentum output by an attacker in federated learning of a model.
[0025] A block diagram showing the device configuration of a federated learning system according to Example 1. A block diagram showing the functional configuration of a server device and a client device according to Example 1. A sequence diagram showing the operations of the server device and the client device according to Example 1. A diagram showing an example of the functional configuration of a computer.
[0026] Hereinafter, embodiments of the present disclosure will be described in detail. Note that components having the same functions are assigned the same numbers, and redundant explanations will be omitted.
[0027] The device configuration of a federated learning system according to a first embodiment will be described with reference to Figure 1. As shown in the figure, the federated learning system 1 of this embodiment includes a server device 11 and n client devices 12-1, ..., 12-n. The server device 11 and the client devices 12-1, ..., 12-n are connected wirelessly or by wire so as to be able to communicate via a network. Hereinafter, when describing processing using the client device 12, it is assumed that the processing is common to the client devices 12-1, ..., 12-n.
[0028] In the federated learning system 1 of this embodiment, each client device 12-1, ..., 12-n does not share data in federated learning, but only shares the learning gradient of the model, thereby protecting the data of users participating in the federated learning while creating a model that has learned the characteristics of all data.
[0029] For example, by utilizing emails and purchase history on personal devices, internal corporate research materials and IoT information, and hospital diagnostic information, it is possible to perform matching, automatic control, and AI medical treatment.
[0030] However, if there is an attacker among the users who does not follow the correct learning protocol, problems may arise such as the accuracy of the learned model not improving or the wrong model being learned.
[0031] Therefore, in order to realize federated learning that can perform learning correctly even in the presence of an attacker, we disclose a method called Screen, which is an improvement on the algorithm AGG in Non-Patent Document 3 mentioned above.
[0032] Screen tests each input against the condition "Are there more than α% of other inputs whose distance is less than or equal to the threshold τ?" and aggregates only the inputs that pass. This can be expressed mathematically as follows: where n is the total number of client devices 12, i and j are indexes, m is momentum, and α and τ are thresholds.
[0033] More specifically, the server device 11 of this embodiment executes the following Algorithm 1 (proposed method). The input of Algorithm 1 (proposed method) defines the input to this algorithm, and includes the momentum m1,...,m of each client device 12. n and a threshold value α and a threshold value τ related to the ratio are input.
[0034] The Output of Algorithm 1 (proposed method) defines the output of this algorithm and indicates that the aggregation result m^ is output.
[0035] The first line of Algorithm 1 (proposed method) indicates that lines 2-14 are executed for i=1,...,n.
[0036] The second line of Algorithm 1 (proposed method) is to convert m^ into m i This indicates that the update will be performed with
[0037] The third line of Algorithm 1 (proposed method) indicates that count is set to 1.
[0038] Line 4 of Algorithm 1 (proposed method) indicates that lines 5-9 are executed for j=1,...,n.
[0039] The fifth line of Algorithm 1 (proposed method) calculates the i-th momentum m i The jth momentum m j is less than a threshold value τ.
[0040] Line 6 of Algorithm 1 (proposed method) calculates the i-th momentum m i The jth momentum m j If the distance between them is less than the threshold τ, the momentum m i Momentum m j This means that the aggregate result m^ is updated by adding up the momentum of all parties other than the attacker.
[0041] Line 7 of Algorithm 1 (proposed method) calculates the i-th momentum m i The jth momentum m j is less than the threshold τ, count is incremented by 1, i.e., count indicates the number of momentums added.
[0042] Line 8 of Algorithm 1 (proposed method) indicates the end of the if statement for τ, and line 9 of Algorithm 1 (proposed method) indicates the end of the for statement for j.
[0043] Line 10 of Algorithm 1 (proposed method) shows a judgment of whether count / n exceeds α, where count / n is the ratio of the number of client devices 12 whose distance is less than the threshold τ (which can be considered honest) to the total number n of client devices 12.
[0044] Line 11 of Algorithm 1 (proposed method) indicates that if count / n exceeds α (the proportion of client devices 12 that can be considered honest is sufficiently high), m̂ is updated with m̂ / count, i.e., the average momentum of all devices other than the attacker.
[0045] Line 12 of Algorithm 1 (proposed method) shows the forced termination of the loop processing.
[0046] Line 13 of Algorithm 1 (proposed method) indicates the end of the if statement for α, and line 14 of Algorithm 1 (proposed method) indicates the end of the for statement for i.
[0047] Line 15 of Algorithm 1 (proposed method) shows the process of outputting the aggregation result m^.
[0048] The operation of each device will be described below using a method other than an algorithm. As shown in Fig. 2, the server device 11 may include a data storage unit 110, a distance calculation unit 111, an addition unit 112, and a division unit 113. The client device 12 may include a data storage unit 120 and a model update unit 121. The operation of each component will be described below with reference to Fig. 3.
[0049] <Client Device 12> <Data Storage Unit 120> The data storage unit 120 stores in advance data necessary for processing executed by the client device 12. For example, the data storage unit 120 stores initial values of the model, local learning data necessary for local learning of the model, m̂ aggregated by the server device 11, and the like.
[0050] <Model update unit 121> The model update unit 121 of each client device 12-1, ..., 12-n updates the model that is the learning target of federated learning. Note that when each client device 12-1, ..., 12-n executes processing in parallel, the parallel processing is represented using indexes i, j (i, j = 1, ..., n).
[0051] When the model is updated for the first time, the model update unit 121 initializes the model based on a predetermined initial value and learns the initialized model based on local learning data. The model update unit 121 of each client device 12-1, ..., 12-n learns the model by learning the model, and calculates the model gradient g i (x) and calculate the model gradient g i Based on (x), g is proportionally divided by the hyperparameter β. i (x) and m i The momentum m is a vector i is calculated and transmitted to the server device 11 (S121).
[0052] <Server Device 11> <Data Storage Unit 110> The data storage unit 110 stores in advance data necessary for processing executed by the server device 11. For example, the thresholds τ and α are set by a user and stored in the data storage unit 110 in advance.
[0053] <Distance Calculation Unit 111> The distance calculation unit 111 receives momentum as input, calculates the distance between the reference momentum and the momentum to be selected / non-selected, and selects momentum for which the calculated distance is less than a predetermined threshold τ (S111). Note that the processing in step S111 corresponds to the processing in line 5 of Algorithm 1 (proposed method). Note that "selection" indicates a state in which only momentum that satisfies the condition in line 6 of Algorithm 1 (proposed method) is selected to be added together.
[0054] <Adder 112> The adder 112 adds the selected momentum (S112). Note that the process of step S112 corresponds to the sixth line of Algorithm 1 (proposed method).
[0055] <Division Unit 113> When count / n exceeds a predetermined threshold α, the division unit 113 outputs the aggregation result m^ obtained by dividing the added momentum by the number of momentums added, count (S113). The processing of step S113 corresponds to line 10 (comparison with threshold), line 11 (division), and line 15 (output of aggregation result) of Algorithm 1 (proposed method).
[0056] It should be noted that previous research has shown that any arbitrary number equal to or greater than 0.5 is suitable for the threshold value α.
[0057] <Effects of the federated learning system 1 and the server device 11 of the first embodiment> Even in federated learning configured with a complex network, if an attacker participates in FL, the impact of the attack on model learning can be reduced, thereby preventing a deterioration in learning accuracy.
[0058] -If robustness is not guaranteed, an attacker can completely destroy model learning by sending large variables, but the federated learning system disclosed here makes it possible to make the impact of the attacker's sent variables equal to or less than that of an honest person, thereby preventing the destruction of model learning.
[0059] <Additional Notes> The device disclosed herein may, for example, be a single hardware entity that includes an input unit to which a keyboard or the like can be connected, an output unit to which an LCD display or the like can be connected, a communication unit to which a communication device (e.g., a communication cable) capable of communicating with an external device of the hardware entity can be connected, a CPU (which may also include a central processing unit, cache memory, registers, etc.), memories such as RAM and ROM, an external storage device such as a hard disk, and buses connecting these input unit, output unit, communication unit, CPU, RAM, ROM, and external storage device so as to enable data exchange. If necessary, the hardware entity may also be provided with a device (drive) capable of reading and writing recording media such as a CD-ROM. An example of a physical entity equipped with such hardware resources is a general-purpose computer.
[0060] The external storage device of the hardware entity stores the programs required to realize the above-mentioned functions and the data required for processing these programs (the programs may be stored in a ROM, which is a read-only storage device, for example, instead of an external storage device). Data obtained by processing these programs is stored in RAM, the external storage device, etc. as appropriate.
[0061] In a hardware entity, each program stored in an external storage device (or ROM, etc.) and the data required to process each program are loaded into memory as needed, and interpreted, executed, and processed by the CPU as appropriate, resulting in the CPU realizing a predetermined function (each component represented as a unit, means, etc.).
[0062] The present disclosure is not limited to the above-described embodiments, and modifications can be made as appropriate without departing from the spirit of the present disclosure. Furthermore, the processes described in the above embodiments may not only be executed in chronological order according to the order described, but may also be executed in parallel or individually depending on the processing capabilities of the devices that execute the processes or as needed.
[0063] As described above, when the processing functions of the hardware entities (apparatuses of the present disclosure) described in the above embodiments are realized by a computer, the processing contents of the functions that the hardware entities should have are described by a program, and the processing functions of the hardware entities are realized on the computer by executing this program.
[0064] The various processes described above can be implemented by loading a program that executes each step of the above method into the recording unit 10020 of the computer 10000 shown in Figure 4, and operating the control unit 10010, input unit 10030, output unit 10040, etc.
[0065] The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of computer-readable recording media include magnetic recording devices, optical disks, magneto-optical recording media, and semiconductor memories. Specifically, examples of magnetic recording devices include hard disk drives, flexible disks, and magnetic tapes; optical disks include DVDs (Digital Versatile Discs), DVD-RAMs (Random Access Memory), CD-ROMs (Compact Disc Read Only Memory), and CD-Rs (Recordable / Rewritable) / RWs; magneto-optical recording media include MOs (Magneto-Optical Discs), and semiconductor memories include EEP-ROMs (Electrically Erasable and Programmable-Read Only Memory).
[0066] The program may be distributed by, for example, selling, transferring, lending, etc. portable recording media such as DVDs and CD-ROMs on which the program is recorded. Furthermore, the program may be stored in a storage device of a server computer, and then transferred from the server computer to other computers via a network, thereby distributing the program.
[0067] A computer that executes such a program may first temporarily store the program recorded on a portable recording medium or transferred from a server computer in its own storage device. Then, when executing a process, the computer reads the program stored on its own recording medium and executes the process in accordance with the read program. Alternatively, the computer may read the program directly from a portable recording medium and execute the process in accordance with the program. Furthermore, the computer may execute the process in accordance with each program transferred from the server computer. Alternatively, the server computer may not transfer the program to the computer, but may instead execute the process through a so-called ASP (Application Service Provider) service, which realizes the processing function by issuing an execution instruction and obtaining the results. In this embodiment, the program includes information used for processing by a computer that is equivalent to a program (e.g., data that is not a direct instruction to the computer but has properties that define computer processing).
[0068] In addition, in this embodiment, a hardware entity is configured by executing a predetermined program on a computer, but at least a part of the processing contents may be realized by hardware.
Claims
1. A server device including a distance calculation unit that receives momentum, which is a vector calculated based on parameters of a model learned by each of n client devices, calculates the distance between a reference momentum and momentum to be selected / non-selected, and selects momentum whose calculated distance is less than a predetermined threshold τ.
2. A server device according to claim 1, comprising: an addition unit that adds the selected momentums; and a division unit that divides the added momentum by the number of momentums added, count, to output an aggregated result m^.
3. A server device according to claim 2, wherein the division unit divides the added momentum by the number of momentums added, "count", when "count / n" exceeds a predetermined threshold value α, and the threshold value α is an arbitrary number equal to or greater than 0.
5.
4. A federated learning system including a server device and n client devices, wherein the n client devices include a model update unit that calculates a momentum, which is a vector, based on parameters of a learned model and transmits the momentum to the server device, and the server device includes a distance calculation unit that receives the momentum as an input, calculates a distance between a reference momentum and a momentum to be selected / non-selected, and selects a momentum whose calculated distance is less than a predetermined threshold τ.
5. A federated learning system according to claim 4, wherein the server device includes an addition unit that adds the selected momentums, and a division unit that outputs an aggregate result m^ obtained by dividing the added momentum by the number of momentums count added.
6. An associative learning system according to claim 5, wherein the division unit divides the added momentum by the number of momentums added, "count", when "count / n" exceeds a predetermined threshold value α, and the threshold value α is an arbitrary number equal to or greater than 0.
5.
7. A momentum selection method executed by a server device, comprising the steps of: inputting momentum, which is a vector calculated based on parameters of a model learned by each of n client devices; calculating the distance between a reference momentum and momentums to be selected / non-selected; and selecting a momentum whose calculated distance is less than a predetermined threshold τ.
8. A program for causing a computer to function as the server device according to any one of claims 1 to 3.
