Robust federated learning method and system based on euclidean distance and storage medium

By employing a robust federated learning method based on Euclidean distance, and utilizing interactive computation between servers and multiplication triple encryption, the problem of high computational overhead in existing technologies is solved, achieving efficient privacy enhancement and robustness improvement.

CN118195030BActive Publication Date: 2026-11-27ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410391962.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-02
Publication Date
2026-11-27
Estimated Expiration
2044-04-02

AI Technical Summary

Technical Problem

In existing privacy-enhancing robust federated learning systems, homomorphic encryption methods have high computational overhead and cannot achieve efficient privacy enhancement through federated learning.

Method used

A robust federated learning method based on Euclidean distance is adopted. The Euclidean distance between the local gradient data of the client and the target aggregated gradient is determined by the interaction between servers. The gradient is encrypted using multiplicative triples, and the training model is updated on the client until the iteration condition is met.

Benefits of technology

It effectively prevents data poisoning attacks and model parameter theft attacks, improves the system's robustness against Byzantine faults, and avoids significant time overhead, achieving efficient privacy enhancement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118195030B_ABST
    Figure CN118195030B_ABST
Patent Text Reader

Abstract

The application relates to a robust federated learning method based on a Euclidean distance, a system and a storage medium, the method comprising the following steps: receiving, by a server, split local gradient data sent by each client; performing interactive calculation between the servers to determine the Euclidean distance between the local gradient data of each client and the target aggregation gradient in the last round of federated learning; performing gradient aggregation based on the Euclidean distance corresponding to each client to obtain a local aggregation gradient in each of the two servers, and sending the local aggregation gradient to each client; wherein the interactive calculation between the servers is encrypted by using a multiplication triple; obtaining, by each client, a target aggregation gradient according to the local aggregation gradient, and updating a local training model based on the target aggregation gradient to perform the next round of federated learning until an iteration condition is reached. The application can efficiently ensure the data security and privacy of each client, and solves the problem that efficient federated learning privacy enhancement cannot be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to a robust federated learning method, system, and storage medium based on Euclidean distance. Background Technology

[0002] With the advent of the big data era, people's lives have become inextricably linked to data, making data privacy and security issues increasingly prominent. Data is often stored in a distributed manner, and efficient use of data by various participants requires the use of privacy-preserving computing technologies to ensure the security of local private data. Federated learning is a distributed learning method for multi-party joint modeling, capable of completing multi-party joint modeling without data leaving the domain. However, federated learning systems are also vulnerable and face attacks from various malicious attackers. Therefore, building efficient, privacy-enhanced, and robust federated learning systems is essential.

[0003] Existing privacy-enhancing robust federated learning systems mainly employ homomorphic encryption as their privacy technology. However, most homomorphic encryption methods suffer from high computational overhead, making it impossible to achieve efficient privacy enhancement in federated learning.

[0004] There is currently no effective solution to the problem that related technologies cannot achieve efficient privacy enhancement in federated learning. Summary of the Invention

[0005] Therefore, it is necessary to provide a robust federated learning method, system, and storage medium based on Euclidean distance that can efficiently enhance privacy, addressing the aforementioned technical problems.

[0006] Firstly, this embodiment provides a robust federated learning method based on Euclidean distance, applied to a robust federated learning system based on Euclidean distance, the system comprising: two servers and at least two clients, each client connecting to the two servers respectively; the method comprising:

[0007] The server receives the split local gradient data sent by each client.

[0008] Interactive computation is performed between the servers to determine the Euclidean distance between the local gradient data of each client and the target aggregated gradient in the previous round of federated learning; gradient aggregation is performed based on the Euclidean distance corresponding to each client, and local aggregated gradients are obtained in the two servers respectively and sent to each client; wherein, multiplication triples are used to encrypt the interactive computation between the servers.

[0009] Each client obtains the target aggregate gradient based on the local aggregate gradient, updates the local training model based on the target aggregate gradient, and performs the next round of federated learning until the iteration condition is met.

[0010] In some embodiments, determining the Euclidean distance between each client's local gradient data and the target aggregate gradient in the previous round of federated learning includes:

[0011] Using multiplication triples, the local gradient data split in the server and the local aggregated gradient from the previous round of federated learning are encrypted and interactively calculated to obtain the Euclidean distance for each client.

[0012] In some embodiments, the step of performing gradient aggregation based on the Euclidean distance corresponding to each client, obtaining local aggregated gradients in both servers, and sending them to each client includes:

[0013] Based on the Euclidean distance corresponding to each client, determine the maximum Euclidean distance and the cumulative Euclidean distance of all clients;

[0014] The corresponding aggregation weight is determined based on the maximum Euclidean distance, the cumulative Euclidean distance of all clients, and the Euclidean distance corresponding to each client;

[0015] Using multiplication triples, the local gradient data and aggregated weights that have been split in the server are encrypted and then interactively calculated to obtain the local aggregated gradient, which is then sent to each of the clients.

[0016] In some of these embodiments, it also includes:

[0017] The multiplication triples are generated by a third-party server, and then split into two parts and sent to the two servers respectively.

[0018] In some of these embodiments, it also includes:

[0019] The multiplication triples are generated by a third-party server, and then split into two parts and sent to the two servers respectively.

[0020] In some of these embodiments, it also includes:

[0021] The client trains the local training model based on the local dataset to obtain the local gradient data.

[0022] Secondly, this embodiment provides a robust federated learning system based on Euclidean distance, comprising: two servers and at least two clients, each of the clients being connected to the two servers respectively;

[0023] The client is used to split the local gradient data and send it to the two servers respectively.

[0024] The server is configured to receive the split local gradient data sent by each client; perform interactive calculations to determine the Euclidean distance between the local gradient data of each client and the target aggregated gradient in the previous round of federated learning; perform gradient aggregation based on the Euclidean distance corresponding to each client, obtain the local aggregated gradient in the two servers respectively, and send it to each client; wherein, the interactive calculations between the servers are encrypted using multiplication triples.

[0025] The client is also configured to obtain the target aggregated gradient based on the local aggregated gradient, and update the local training model based on the target aggregated gradient to perform the next round of federated learning until the iteration condition is met.

[0026] In some embodiments, it also includes: a third-party server;

[0027] The third-party server is used to generate the multiplication triples and split the multiplication triples and send them to the two servers respectively.

[0028] Thirdly, this embodiment provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the robust federated learning method based on Euclidean distance described in the first aspect above.

[0029] Fourthly, this embodiment provides a storage medium storing a computer program that, when executed by a processor, implements the robust federated learning method based on Euclidean distance described in the first aspect above.

[0030] Compared with related technologies, this embodiment provides a robust federated learning method, system, and storage medium based on Euclidean distance. The method is applied to a robust federated learning system based on Euclidean distance. The system includes two servers and at least two clients, each client connecting to one of the two servers. The method receives split local gradient data sent by each client through the servers; performs interactive computation between the servers to determine the Euclidean distance between each client's local gradient data and the target aggregated gradient in the previous round of federated learning; performs gradient aggregation based on the Euclidean distance corresponding to each client, obtaining local aggregated gradients in the two servers and sending them to each client; the interactive computation between the servers is encrypted using multiplication triples; each client obtains the target aggregated gradient based on the local aggregated gradient, updates the local training model based on the target aggregated gradient, and performs the next round of federated learning until the iteration condition is met. This application utilizes gradient aggregation based on Euclidean distance and interactive computation between two servers using multiplicative triples to prevent data poisoning attacks on the client side, while efficiently ensuring data security and privacy for each client, thus solving the problem of the inability to achieve efficient privacy enhancement in federated learning.

[0031] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0032] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0033] Figure 1 This is a hardware structure block diagram of a terminal using a robust federated learning method based on Euclidean distance in one embodiment.

[0034] Figure 2 This is a schematic diagram of the structure of a robust federated learning system based on Euclidean distance in one embodiment;

[0035] Figure 3 This is a flowchart of a robust federated learning method based on Euclidean distance in one embodiment;

[0036] Figure 4 This is a flowchart of a robust federated learning method based on Euclidean distance in another embodiment;

[0037] Figure 5 This is a block diagram of a robust federated learning device based on Euclidean distance in one embodiment.

[0038] In the diagram: 102, processor; 104, memory; 106, transmission device; 108, input / output device; 10, data receiving module; 20, interactive computing module; 30, local update module. Detailed Implementation

[0039] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0040] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0041] With the advent of the big data era, people's lives have become inextricably linked to data, and the issues of data privacy and security have become increasingly prominent. Data is often stored in a distributed manner, and various parties collaborate to use data efficiently. Ensuring the security of local private data requires the use of privacy computing technologies.

[0042] Federated learning is a distributed learning method for joint modeling among multiple parties, enabling joint modeling without data leaving the domain. However, federated learning systems are also vulnerable to attacks from various malicious actors. Therefore, building efficient, privacy-enhancing, and robust federated learning systems is essential. There are typically two types of attacks: data poisoning attacks and model parameter data theft attacks. Data poisoning attacks are usually caused by malicious users within the federated learning system. Malicious actors use data with backdoors to train their local models, injecting a backdoor into the entire global model. When the model misclassifies certain data, the data poisoning attack compromises the robustness of the entire global model. Gradient data theft attacks typically occur when malicious attackers are present in the data transmission chain. By intercepting transmitted plaintext model parameters or gradient data, they can deduce the user's local real dataset, thus compromising the privacy and security of local user data.

[0043] Existing privacy-enhancing robust federated learning systems mainly employ homomorphic encryption as their privacy technology. However, most homomorphic encryption methods suffer from high computational overhead, making it impossible to achieve efficient privacy enhancement in federated learning.

[0044] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of the terminal for the robust federated learning method based on Euclidean distance in this embodiment. Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0045] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the robust federated learning method based on Euclidean distance in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0046] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0047] This embodiment provides a robust federated learning system based on Euclidean distance. Figure 2 This is a schematic diagram of the robust federated learning system based on Euclidean distance in this embodiment, as shown below. Figure 2 As shown, the system includes two servers and at least two clients, with each client connecting to one of the two servers.

[0048] The client is used to split the local gradient data and send it to the two servers separately.

[0049] The server is used to receive the split local gradient data sent by each client; perform interactive calculations to determine the Euclidean distance between each client's local gradient data and the target aggregated gradient in the previous round of federated learning; perform gradient aggregation based on the Euclidean distance corresponding to each client, obtain the local aggregated gradient in both servers, and send it to each client; wherein, the interactive calculation between the servers is encrypted using multiplication triples.

[0050] The client is also used to obtain the target aggregate gradient based on the local aggregate gradient, and update the local training model based on the target aggregate gradient to perform the next round of federated learning until the iteration condition is met.

[0051] Specifically, each client trains its local model using a local dataset, obtaining local gradient data for each round of federated learning. This local gradient data is then split and sent to servers S1 and S2 respectively. Each client's local dataset refers to private data requiring privacy protection, such as personal medical information, financial information, and behavioral information. The model is trained on a local device, and only the gradient data is shared, thus preventing the leakage of the client's personal information. Accordingly, clients include, but are not limited to, hospital medical systems, user personal terminals, and banking and financial systems.

[0052] In this embodiment, the two servers are non-colluding servers. During the federated learning aggregation process, server S1 and server S2 each initialize a global model gradient data. In subsequent federated learning iterations, server S1 and server S2 retain the aggregation result values ​​of server S1 and server S2 from the previous round.

[0053] Two servers receive the split local gradient data sent by each client. The two servers use multiplication triples for secure interaction and calculate the Euclidean distance between the local gradient data in each client and the aggregated gradient of the target in the previous round of federated learning. Since data poisoning attacks are usually caused by malicious clients in federated learning, the similarity between the local gradient data and the target aggregated gradient is determined based on this Euclidean distance, thereby identifying malicious data in the client.

[0054] The two servers interact securely using multiplicative triples, assigning different weights to clients corresponding to different Euclidean distances to prevent malicious data attacks and improve the system's robustness against Byzantine faults. Weighted gradient aggregation is performed based on the Euclidean distance for each client, resulting in local aggregated gradients between the two servers. Each server sends its local aggregated gradient to each client. Each client then uses the two obtained local aggregated gradients to determine the target aggregated gradient for the current round of federated learning, updating its local training model accordingly, and proceeding to the next round of federated learning until iteration conditions are met. These iteration conditions include, but are not limited to, preset iteration counts, preset model performance thresholds, and time constraints.

[0055] The system provided in this embodiment, on the one hand, determines malicious data in the client based on the Euclidean distance corresponding to the client and assigns corresponding weights during gradient aggregation to prevent attacks by malicious data, thereby improving the system's robustness against Byzantine faults. On the other hand, it uses multiplication triples for interactive computation between the two servers, avoiding attacks that steal model parameter data. This achieves privacy enhancement without incurring significant time overhead, thus realizing effective privacy enhancement. As a result, the two servers jointly and securely execute robust federated learning aggregation that is tolerant of Byzantine faults, solving the problem of the inability to achieve efficient privacy enhancement in federated learning.

[0056] In some embodiments, the system further includes a third server.

[0057] The third server is used to generate multiplication triples and then split the multiplication triples and send them to the two servers respectively.

[0058] Specifically, the third-party server is a verified and trusted third party that generates a multiplication triple (a, b, c) during the online phase, where c must be equal to the product of a and b. After splitting the triple, it is sent to two servers separately, and then the process goes offline. One way to split the multiplication triple (a, b, c) is as (a1, b1, c1) and (a2, b2, c2).

[0059] This embodiment provides a robust federated learning method based on Euclidean distance, which is applied to the system described in the above embodiments. Figure 3 This is a flowchart of the robust federated learning method based on Euclidean distance in this embodiment, as shown below. Figure 3 As shown, the method includes the following steps:

[0060] Step S310: The server receives the split local gradient data sent by each client.

[0061] Specifically, each client trains its local model using a local dataset, obtaining local gradient data for each round of federated learning. This local gradient data is then split and sent to servers S1 and S2 respectively. Each client's local dataset refers to private data requiring privacy protection, such as personal medical information, financial information, and behavioral information. The model is trained on a local device, and only the gradient data is shared, thus preventing the leakage of the client's personal information. Accordingly, clients include, but are not limited to, hospital medical systems, user personal terminals, and banking and financial systems.

[0062] Step S320: Perform interactive computation between servers to determine the Euclidean distance between the local gradient data of each client and the target aggregated gradient in the previous round of federated learning; perform gradient aggregation based on the Euclidean distance corresponding to each client, obtain the local aggregated gradient in each of the two servers, and send it to each client; wherein, multiplication triples are used to encrypt the interactive computation between servers.

[0063] Specifically, two servers receive the split local gradient data sent by each client. The two servers use multiplication triples for secure interaction and calculate the Euclidean distance between the local gradient data in each client and the aggregated gradient of the target in the previous round of federated learning. Since data poisoning attacks are usually caused by malicious clients in federated learning, the similarity between the local gradient data and the target aggregated gradient is determined based on this Euclidean distance, thereby identifying malicious data in the client.

[0064] The two servers use multiplicative triples for secure interaction, assigning different weights to clients corresponding to different Euclidean distances to prevent malicious data attacks and improve the system's robustness against Byzantine faults. Weighted gradient aggregation is performed based on the Euclidean distance for each client, resulting in locally aggregated gradients between the two servers. Each server then sends its locally aggregated gradient to each client.

[0065] Step S330: For each client, obtain the target aggregate gradient based on the local aggregate gradient, update the local training model based on the target aggregate gradient, and perform the next round of federated learning until the iteration condition is met.

[0066] Specifically, each client, based on the two obtained local aggregated gradients, sums them to obtain the target aggregated gradient for this round of federated learning. The local trained model is then updated based on the target aggregated gradient to proceed to the next round of federated learning, until the iteration conditions are met. These iteration conditions include, but are not limited to, a preset number of iterations, a preset model performance threshold, and time constraints.

[0067] Through the above steps, on the one hand, malicious data in the client is identified based on the Euclidean distance corresponding to the client, and corresponding weights are assigned during gradient aggregation to prevent attacks by malicious data and improve the robustness of the system tolerating Byzantine faults. On the other hand, interactive computation between the two servers is performed using multiplication triples, avoiding attacks that steal model parameter data. Privacy enhancement is achieved without incurring significant time overhead, thus achieving efficient privacy enhancement. As a result, the two servers jointly and securely perform robust federated learning aggregation tolerating Byzantine faults, solving the problem of the inability to achieve efficient privacy enhancement in federated learning.

[0068] The robust federated learning method and system based on Euclidean distance in the above embodiments can be applied to fields such as healthcare, financial services, smart devices, education, and recommendation systems.

[0069] For example, the following explanation uses a healthcare scenario, where medical institutions (such as hospitals and clinics) act as clients, and each client connects to two servers:

[0070] Each medical institution (such as hospitals and clinics) collects patient medical data, such as medical records, images, and physiological indicators. This data is preprocessed locally (e.g., cleaned, standardized, and anonymized) to generate a local dataset. This data typically contains private information and cannot be directly uploaded to a central server.

[0071] In each medical institution, local gradient data is obtained by training a local training model using a local dataset. This local gradient data is then split and sent to two servers. The local training model can be initialized by the server.

[0072] Interactive computation is performed on two servers using multiplication triples. The local gradient data corresponding to each client is weighted and aggregated to obtain the local aggregated gradient of the server in this round of federated learning, and then sent to each medical institution.

[0073] Each medical institution obtains the target aggregated gradient for this round of federated learning based on the local aggregated gradients received from the two servers, and updates its local training model accordingly.

[0074] While ensuring privacy, models optimized through federated learning can be used within medical institutions for tasks such as disease diagnosis and treatment decisions. Throughout the process, data remains local, sharing only local gradient data, and is encrypted using multiplication triples, thus protecting data privacy.

[0075] In some embodiments, determining the Euclidean distance between each client's local gradient data and the target aggregated gradient in the previous round of federated learning in step S320 includes the following steps:

[0076] Step S321: Using multiplication triples, the local gradient data split in the server and the local aggregated gradient from the previous round of federated learning are encrypted and interactively calculated to obtain the Euclidean distance for each client.

[0077] Specifically, the local gradient data generated by client i during the k-th round of local model training is denoted as... Where n represents the dimension of the local gradient data. The client splits the local gradient data to obtain... and The client will split the local gradient data Send to server S1, Send to server S2.

[0078] Dis, the Euclidean distance between the client's local gradient data and the target aggregate gradient from the previous round of federated learning. i It can be represented as follows:

[0079]

[0080] Among them, Dis i The distance to the i-th client is represented by the Euclidean distance; n represents the dimension of the local gradient data. This represents the l-th dimension of the local gradient data generated by the i-th client during the k-th round of local training of the model; This represents the l-th dimension of the target aggregate gradient generated in the (k-1)th round.

[0081] Based on the above Euclidean distance calculation method, the two servers use multiplication triples to securely and interactively calculate the Euclidean distance between each client's local gradient data and the target aggregated gradient from the previous round of federated learning, in a split manner. The target aggregated gradient is obtained by adding the local aggregated gradients from the two servers. Therefore, multiplication triples are used to encrypt the split local gradient data and the local aggregated gradient from the previous round of federated learning on the servers before interactive calculation, obtaining the Euclidean distance for each client on each server. The specific calculation is as follows:

[0082] (1) Calculate the two intermediate quantities e corresponding to the m-th dimension of the local gradient data in each client i in server S1. 1im and f 1im :

[0083]

[0084]

[0085] The multiplication triple (a,b,c) is split into (a1,b1,c1) and (a2,b2,c2), and then sent to server S1 and server S2 respectively. This represents the m-th dimension of the local gradient data generated by the i-th client during the k-th round of local training of the model in server S1. This represents the m-th dimension of the local aggregated gradient generated in the (k-1)-th round in server S1; n represents the total dimension of the local gradient data and the local aggregated gradient.

[0086] (2) On server S2, calculate the two intermediate quantities e corresponding to the m-th dimension of the local gradient data in each client i. 2im and f 2im :

[0087]

[0088]

[0089] in, This represents the m-th dimension of the local gradient data generated by the i-th client during the k-th round of local training of the model in server S2. This represents the m-th dimension of the local aggregated gradient generated in the (k-1)-th round in server S2; n represents the total dimension of the local gradient data and the local aggregated gradient.

[0090] (3) Server S1 will e 1im and f 1im Send to server S2, Server S2 will e 2im and f 2im Send to server S1,

[0091] The merged intermediate variable e is calculated in servers S1 and S2. im and f im :

[0092]

[0093]

[0094] (4) Calculate the intermediate quantity corresponding to the m-th dimension of the local gradient data in each client i on server S1. Euclidean distance D i_sum1 :

[0095]

[0096]

[0097] (5) Calculate the intermediate quantity corresponding to the m-th dimension of the local gradient data in each client i on server S2. Euclidean distance D i_sum2 :

[0098]

[0099]

[0100] (6) Server S1 interacts with server S2 to obtain the Euclidean distance D for each client.i_sum The cumulative Euclidean distance D across all clients sum :

[0101] D i_sum =D i_sum1 +D i_sum2 ;

[0102]

[0103] In this embodiment, by employing multiplication triples, privacy protection can be efficiently enhanced without incurring huge time overhead when the two servers interactively calculate the Euclidean distance corresponding to each client.

[0104] In some embodiments, step S320 involves gradient aggregation based on the Euclidean distance for each client, obtaining local aggregated gradients on both servers, and sending them to each client, including the following steps:

[0105] Step S322: Determine the maximum Euclidean distance and the cumulative Euclidean distance of all clients based on the Euclidean distance corresponding to each client.

[0106] Specifically, based on the Euclidean distances obtained for each client above, the maximum Euclidean distance D is determined. max The cumulative Euclidean distance D across all clients sum .

[0107] Step S323: Determine the corresponding aggregation weight based on the maximum Euclidean distance, the cumulative Euclidean distance of all clients, and the Euclidean distance corresponding to each client.

[0108] Specifically, the Euclidean distance for each client indicates the similarity between its local gradient data and the target aggregated gradient. Based on this, malicious clients or malicious data within clients are identified and assigned different weights accordingly. This ensures that client data with smaller Euclidean distances receives higher weights during subsequent weighted gradient aggregation, reducing the impact of malicious data on the model and improving the robustness of federated learning. The aggregation weight for each client is calculated as follows:

[0109] (1) On server S1, based on the Euclidean distance D of client i... i_sum Calculate the corresponding aggregate weight η i1 :

[0110]

[0111] (2) On server S2, based on the Euclidean distance D of client i... i_sum Calculate the corresponding aggregate weight η i2 :

[0112]

[0113] Step S324: Using multiplication triples, the local gradient data and aggregated weights split in the server are encrypted and interactively calculated to obtain the local aggregated gradient, which is then sent to each client.

[0114] Specifically, through interactive computation between two servers, weighted gradient aggregation of the local gradient data of each client is completed securely and in a split manner. The specific calculation is as follows:

[0115] (1) Calculate the two intermediate quantities p corresponding to the m-th dimension of the local gradient data in each client i in server S1. 1im and q 1i :

[0116]

[0117] q 1i =η i1 -b1;

[0118] The multiplication triple (a,b,c) is split into (a1,b1,c1) and (a2,b2,c2), and then sent to server S1 and server S2 respectively. η represents the m-th dimension of the local gradient data generated by the i-th client during the k-th round of local training of the model in server S1; i1 This represents the aggregate weight corresponding to client i in server S1.

[0119] (2) Calculate the two intermediate quantities p corresponding to the m-th dimension of the local gradient data in each client i in server S2. 2im and q 2i :

[0120]

[0121] q 2i =η i2 -b2;

[0122] in, η represents the m-th dimension of the local gradient data generated by the i-th client during the k-th round of local training of the model in server S2; i2 This represents the aggregate weight corresponding to client i in server S2.

[0123] (3) Server S1 will p 1im and q 1i Send to server S2, Server S2 will p 2im and q 2iSend to server S1, The merged intermediate variable p is calculated in servers S1 and S2. im and q i :

[0124]

[0125] q i =q 1i +q 2i .

[0126] (4) Calculate the intermediate quantity j corresponding to the m-th dimension of the local gradient data in each client i on server S1. 1im And this round of local aggregation gradient AGG m1 :

[0127]

[0128]

[0129] (5) Calculate the intermediate quantity j corresponding to the m-th dimension of the local gradient data in each client i on server S2. 2im And this round of local aggregation gradient AGG m2 :

[0130]

[0131]

[0132] Servers S1 and S2 respectively put AGG m1 and AGG m2 The data is then sent to each client. In this embodiment, gradient aggregation with enhanced privacy protection is performed through interactive computation between the two servers using multiplication triples, without incurring significant time overhead.

[0133] In some of these embodiments, it also includes:

[0134] The multiplication triples are generated by a third-party server, and then split into two parts and sent to the two servers respectively.

[0135] Specifically, the third-party server is a verified and trusted third party that generates a multiplication triple (a, b, c) during the online phase, where c must be equal to the product of a and b. After splitting the triple, it is sent to two servers separately, and then the process goes offline. One way to split the multiplication triple (a, b, c) is as (a1, b1, c1) and (a2, b2, c2).

[0136] In some of these embodiments, it also includes:

[0137] In the multiple iterations of federated learning, the local aggregated gradients obtained in each round of federated learning are stored by two servers.

[0138] Specifically, during the federated learning process, server S1 and server S2 each initialize a global model gradient data set. and In subsequent iterations of federated learning, server S1 retains the aggregation result value from the previous round. Server S2 retains the value from the previous round of aggregation. in In step S324 above, the AGG obtained by server S1 and server S2 respectively m1 and AGG m2 This means that the local aggregate gradient of this round of federated learning is preserved.

[0139] In some of these embodiments, it also includes:

[0140] The client trains a local model based on a local dataset to obtain local gradient data.

[0141] Specifically, each client trains a local training model using a local dataset, obtains local gradient data for each round of federated learning, and then splits the local gradient data and sends it to server S1 and server S2 respectively.

[0142] The present embodiment will now be described and illustrated through preferred embodiments.

[0143] Figure 4 This is a flowchart of the robust federated learning method based on Euclidean distance in this embodiment. This method is applied to the system in the above embodiments, such as... Figure 4 As shown, the method includes the following steps:

[0144] In step S410, each client trains a local training model based on the local dataset to obtain local gradient data; the local gradient data is then split and sent to the two servers respectively.

[0145] Step S420: Using multiplication triples, the local gradient data split in the server and the local aggregated gradient in the previous round of federated learning are encrypted and interactively calculated to obtain the Euclidean distance between the local gradient data of each client and the target aggregated gradient in the previous round of federated learning.

[0146] Step S430: Determine the maximum Euclidean distance and the cumulative Euclidean distance of all clients based on the Euclidean distance corresponding to each client.

[0147] Step S440: Determine the corresponding aggregation weight based on the maximum Euclidean distance, the cumulative Euclidean distance of all clients, and the Euclidean distance corresponding to each client.

[0148] In step S450, multiplication triples are used to encrypt the split local gradient data and aggregated weights in the server and perform interactive calculations to obtain the local aggregated gradient, which is then sent to each client.

[0149] In step S460, in each client, the target aggregate gradient is obtained based on the local aggregate gradient, and the local training model is updated based on the target aggregate gradient to perform the next round of federated learning until the iteration condition is met.

[0150] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0151] This embodiment also provides a robust federated learning device based on Euclidean distance, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that perform a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0152] Figure 5 This is a structural block diagram of the robust federated learning device based on Euclidean distance in this embodiment. This device is applied to the system in the above embodiments, such as... Figure 5 As shown, the device includes:

[0153] The data receiving module 10 is used to receive the split local gradient data sent by each client through the server.

[0154] The interactive computation module 20 is used to perform interactive computation between servers to determine the Euclidean distance between the local gradient data of each client and the target aggregated gradient in the previous round of federated learning; gradient aggregation is performed based on the Euclidean distance corresponding to each client, local aggregated gradients are obtained in the two servers respectively, and sent to each client; wherein, multiplication triples are used to encrypt the interactive computation between servers.

[0155] The local update module 30 is used to obtain the target aggregate gradient based on the local aggregate gradient through each client, and update the local training model based on the target aggregate gradient to perform the next round of federated learning until the iteration condition is reached.

[0156] The apparatus provided in this embodiment, on the one hand, determines malicious data in the client based on the Euclidean distance corresponding to the client and assigns corresponding weights during gradient aggregation to prevent attacks by malicious data and improve the robustness of the system tolerating Byzantine faults; on the other hand, it uses multiplication triples to perform interactive calculations between the two servers, avoiding attacks that steal model parameter data. While enhancing privacy, it does not incur significant time overhead, achieving effective privacy enhancement. Thus, the two servers jointly and securely execute robust federated learning aggregation tolerating Byzantine faults, solving the problem of the inability to achieve efficient privacy enhancement in federated learning.

[0157] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0158] This embodiment also provides a computer device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0159] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0160] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0161] Furthermore, in conjunction with the robust federated learning method based on Euclidean distance provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the robust federated learning methods based on Euclidean distance in the above embodiments.

[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0163] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0164] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0165] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or alternative to other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0166] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A robust federated learning method based on Euclidean distance, applied to a robust federated learning system based on Euclidean distance, the system comprising: Two servers and at least two clients, each client connecting to one of the two servers respectively; characterized in that the method includes: The server receives the split local gradient data sent by each client. Interactive computation is performed between the servers to determine the Euclidean distance between the local gradient data of each client and the target aggregated gradient in the previous round of federated learning; gradient aggregation is performed based on the Euclidean distance corresponding to each client, and local aggregated gradients are obtained in both servers and sent to each client; wherein, multiplication triples are used to encrypt the interactive computation between the servers; specifically including: Based on the Euclidean distance corresponding to each client, determine the maximum Euclidean distance and the cumulative Euclidean distance of all the clients. The corresponding aggregation weight is determined based on the maximum Euclidean distance, the cumulative Euclidean distance of all clients, and the Euclidean distance corresponding to each client; Using the multiplication triples, the local gradient data and aggregated weights that have been split in the server are encrypted and then interactively calculated to obtain the local aggregated gradient, which is then sent to each of the clients. Each client obtains the target aggregate gradient based on the local aggregate gradient, updates the local training model based on the target aggregate gradient, and performs the next round of federated learning until the iteration condition is met.

2. The method according to claim 1, characterized in that, Determining the Euclidean distance between the local gradient data of each client and the aggregated gradient of the target in the previous round of federated learning includes: Using the multiplication triples, the local gradient data split in the server and the local aggregated gradient from the previous round of federated learning are encrypted and then interactively calculated to obtain the Euclidean distance for each client.

3. The method according to claim 1, characterized in that, Also includes: The multiplication triples are generated by a third-party server, and then split into two parts and sent to the two servers respectively.

4. The method according to claim 1, characterized in that, Also includes: In the multiple iterations of federated learning, the local aggregated gradients obtained in each round of federated learning are retained by two servers respectively.

5. The method according to claim 1, characterized in that, Also includes: The client trains the local training model based on the local dataset to obtain the local gradient data.

6. A robust federated learning system based on Euclidean distance, characterized in that, include: Two servers and at least two clients, each client connecting to one of the two servers; The client is used to split the local gradient data and send it to the two servers respectively. The server is configured to receive the split local gradient data sent by each client; perform interactive calculations to determine the Euclidean distance between the local gradient data of each client and the target aggregated gradient in the previous round of federated learning; perform gradient aggregation based on the Euclidean distance corresponding to each client, obtain the local aggregated gradient in both servers, and send it to each client; wherein, the interactive calculations between the servers are encrypted using multiplication triples; specifically including: Based on the Euclidean distance corresponding to each client, determine the maximum Euclidean distance and the cumulative Euclidean distance of all the clients. The corresponding aggregation weight is determined based on the maximum Euclidean distance, the cumulative Euclidean distance of all clients, and the Euclidean distance corresponding to each client; Using the multiplication triples, the local gradient data and aggregated weights that have been split in the server are encrypted and then interactively calculated to obtain the local aggregated gradient, which is then sent to each of the clients. The client is also configured to obtain the target aggregated gradient based on the local aggregated gradient, and update the local training model based on the target aggregated gradient to perform the next round of federated learning until the iteration condition is met.

7. The system according to claim 6, characterized in that, Also includes: Third-party server; The third-party server is used to generate the multiplication triples and split the multiplication triples and send them to the two servers respectively.

8. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the robust federated learning method based on Euclidean distance as described in any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the robust federated learning method based on Euclidean distance as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Robustness federated learning method based on client defense

    CN117035056A

  • Privacy protection federated learning method and device, electronic equipment and storage medium

    CN117150550A