A privacy-safe fine-grained federated aggregation method, device, equipment, and medium

By determining the model layer priority and generating random masks in federated learning and adjusting the aggregation strategy, the security and cost issues of the federated learning framework are resolved, achieving more efficient and secure model training.

CN118944935BActive Publication Date: 2025-09-12WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411026878.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2025-09-12
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The existing federated learning framework has high computing and communication costs in practical applications, is vulnerable to Byzantine attacks and data poisoning attacks, has poor security performance, and cannot effectively solve the data silo problem in industrial applications.

Method used

By determining the priorities of different levels of the local model, assigning corresponding aggregation intervals, and generating random masks to add to the model parameters, the server is used to perform central aggregation calculations, compare the similarity between the aggregation calculation results and the model parameters, and adjust the federation aggregation strategy to reduce communication costs and improve security.

Benefits of technology

It effectively reduces the possibility of Byzantine attacks and data poisoning attacks, improves the security performance of federated learning, reduces communication costs, and eliminates the need to set up a trusted center.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944935B_ABST
    Figure CN118944935B_ABST
Patent Text Reader

Abstract

The present invention provides a privacy-safe, fine-grained federated aggregation method, apparatus, device, and medium. The privacy-safe, fine-grained federated aggregation method includes: determining the priorities of different levels of a local model, assigning corresponding aggregation intervals based on the priorities of the different levels, and training the local model according to a federated aggregation strategy; generating a random mask and adding the random mask to the model parameters of the corresponding level of the local model; uploading a parameter vector of the model parameters carrying the random mask to a server, and receiving an aggregation calculation result returned by the server; the aggregation calculation result is obtained by the server performing a central aggregation calculation on the parameter vector. The present invention can effectively reduce the possibility of being attacked by Byzantine attacks and data poisoning attacks, solving the problems of poor security and vulnerability to attacks in existing federated learning frameworks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a privacy-safe fine-grained federated aggregation method, apparatus, device, and medium. Background Art

[0002] Federated learning is a distributed machine learning approach in which model training is performed on multiple clients, while model updates are aggregated and computed on a central server. Federated learning allows model training to be performed while maintaining data decentralization, addressing several challenges related to privacy and data security. The primary advantage of federated learning is protecting the data privacy of participants. Since the original data does not need to leave the local machine, only the model parameters are transmitted to the server, mitigating the risk of data leakage. Therefore, federated learning has broad application in scenarios involving sensitive data, such as healthcare and finance.

[0003] However, the existing federated learning framework structure has high computing and communication costs in practical applications. Its security performance is not ideal when subjected to Byzantine attacks and data poisoning attacks, and it cannot effectively solve the data island problem in industrial applications.

[0004] There is currently no effective solution to the problems of poor security and vulnerability to attacks in existing federated learning frameworks. Summary of the Invention

[0005] The present invention provides a privacy-safe fine-grained federated aggregation method, apparatus, device and medium to address the defects of the prior art, such as poor security performance and vulnerability to attacks.

[0006] In a first aspect, the present invention provides a privacy-safe fine-grained federated aggregation method, comprising:

[0007] Determine priorities for different levels of local models, assign corresponding aggregation intervals according to the priorities of different levels, and train the local models according to the federated aggregation strategy;

[0008] Generate a random mask, and add the random mask to the model parameters of the corresponding level of the local model;

[0009] Uploading the parameter vector of the model parameters carrying the random mask to a server, and receiving an aggregate calculation result returned by the server; the aggregate calculation result is obtained by the server performing a central aggregate calculation on the parameter vector;

[0010] The aggregation calculation result is compared with the parameter vector of the model parameter for similarity, and the federation aggregation strategy is updated according to the comparison result.

[0011] According to the present invention, a privacy-safe fine-grained federated aggregation method is provided, which determines the priorities of different levels of local models, assigns corresponding aggregation intervals according to the priorities of different levels, and trains the local models according to the federated aggregation strategy, including:

[0012] Initializing a priority parameter of the level according to the level of the local model; the priority parameter is used to represent the priority of the corresponding level;

[0013] Determining an aggregation interval in the federation aggregation strategy according to the initialized priority parameter;

[0014] Acquire local data, train the local model according to the federated aggregation strategy, and update the local model.

[0015] According to a privacy-safe fine-grained federated aggregation method provided by the present invention, a random mask is generated and added to the model parameters of the corresponding layer of the local model, including:

[0016] Negotiate and determine a secure random number, and generate a key based on the secure random number;

[0017] Based on the key, generating the random mask by a random mask generation function;

[0018] Each client adds the random mask to the model parameters of the corresponding layer of the local model, and the sum of the random masks added by all the clients is 0.

[0019] According to a privacy-safe fine-grained federated aggregation method provided by the present invention, a secure random number is determined through negotiation, and a key is generated based on the secure random number, including:

[0020] Determining a private key between two adjacent clients from a cyclic group;

[0021] The client determines a public key based on the private key and exchanges the public keys with each other;

[0022] Each of the clients determines the secret key using a private key and a public key of another client.

[0023] According to a privacy-safe fine-grained federated aggregation method provided by the present invention, the server performs central aggregation calculation on the parameter vector, including:

[0024] The server sums all parameter vectors with the random mask to obtain a sum result;

[0025] An average calculation is performed based on the summation result to obtain the aggregate calculation result.

[0026] According to a privacy-safe fine-grained federated aggregation method provided by the present invention, the similarity between the aggregation calculation result and the parameter vector of the model parameter is compared, and the federated aggregation strategy is updated according to the comparison result, including:

[0027] Determining the Pearson correlation coefficient of the corresponding level of the local model according to the aggregate calculation result;

[0028] adjusting the aggregation interval in the federated aggregation strategy according to the Pearson correlation coefficient;

[0029] The local model is updated according to the aggregate calculation result and the model parameters of the corresponding level of the local model.

[0030] According to a privacy-safe fine-grained federated aggregation method provided by the present invention, adjusting the aggregation interval in the federated aggregation strategy according to the Pearson correlation coefficient includes:

[0031] Compare the Pearson correlation coefficient with a preset threshold interval:

[0032] If the Pearson correlation coefficient is lower than the minimum value of the threshold interval, the aggregation interval is set to infinity;

[0033] If the Pearson correlation coefficient exceeds the maximum value of the threshold interval, the aggregate calculation result of this round is discarded;

[0034] If the Pearson correlation coefficient is within the threshold range, the aggregation interval is re-determined according to the product of the Pearson correlation coefficient and the aggregation interval.

[0035] In a second aspect, the present invention further provides a privacy-safe fine-grained federated aggregation device, comprising:

[0036] a determination module, configured to determine priorities of different levels of the local model, assign corresponding aggregation intervals according to the priorities of the different levels, and train the local model according to the federated aggregation strategy;

[0037] A generation module, configured to generate a random mask and add the random mask to the model parameters of the corresponding layer of the local model;

[0038] a processing module, configured to upload the parameter vector of the model parameters carrying the random mask to a server, and receive an aggregate calculation result returned by the server; the aggregate calculation result is obtained by the server performing a central aggregate calculation on the parameter vector;

[0039] An updating module is used to compare the similarity between the aggregation calculation result and the parameter vector of the model parameter, and update the federation aggregation strategy according to the comparison result.

[0040] In a third aspect, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the privacy-secure fine-grained federated aggregation method as described in the first aspect above is implemented.

[0041] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the privacy-safe fine-grained federated aggregation method as described in the first aspect above.

[0042] In a fifth aspect, the present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the privacy-safe fine-grained federated aggregation method as described in the first aspect above.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] The privacy-safe, fine-grained federated aggregation method provided by this invention compares the similarity between the aggregated computation results and the parameter vectors of the model parameters. Based on the comparison results, the federated aggregation strategy is updated, adjusting the aggregation interval and the local model. This eliminates the need for a trusted center, reducing communication costs. Furthermore, before performing the aggregated computation, the model parameters on the local model are assigned a random mask. The strong randomness of the random mask prevents the model parameters from being easily accessed by malicious actors, effectively reducing the vulnerability to Byzantine and data poisoning attacks. This addresses the poor security and vulnerability of existing federated learning frameworks. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 is a flow chart of the privacy-safe fine-grained federated aggregation method provided by the present invention;

[0047] Figure 2 This is a structural block diagram of the privacy-safe fine-grained federated aggregation device provided by the present invention;

[0048] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0049] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0050] The present invention provides a privacy-safe fine-grained federated aggregation method. Figure 1 This is a flowchart of the privacy-safe fine-grained federated aggregation method provided by the present invention. Figure 1 As shown, the method includes the following steps:

[0051] Step S101: determine the priorities of different levels of the local model, assign corresponding aggregation intervals according to the priorities of different levels, and train the local model according to the federated aggregation strategy.

[0052] Step S102: Generate a random mask and add the random mask to the model parameters of the corresponding layer of the local model.

[0053] Step S103: Upload the parameter vector of the model parameters carrying the random mask to the server, and receive the aggregate calculation result returned by the server. The aggregate calculation result is obtained by the server performing a central aggregate calculation on the parameter vector.

[0054] Step S104 : comparing the similarity between the aggregation calculation result and the parameter vector of the model parameters, and updating the federation aggregation strategy according to the comparison result.

[0055] In this method, for local models, there are certain differences in the hierarchical structure. Therefore, before performing aggregation training, the client needs to first determine the corresponding priority according to the different levels, and then assign the corresponding aggregation interval to each level based on the priority. The local model is then trained according to the federal aggregation strategy, which includes the assigned aggregation interval. Then, a random mask is generated and added to the model parameters of the corresponding level of the local model, thereby protecting the privacy information of the local model and improving the security performance of the local model. Each client participant then uploads the parameter vector of the model parameters with the random mask to the server, which performs central aggregation calculation and returns the aggregation calculation results to the client. Finally, the client compares the aggregation calculation results with the parameter vector of the model parameters, and updates the federal aggregation strategy based on the comparison results, adjusting the aggregation interval and the local model. Through the above operations, there is no need to set up a trusted center, and the communication cost is lower. Before performing the aggregate calculation, a random mask is assigned to the model parameters on the local model. Since the random mask has a strong randomness, the model parameters cannot be easily obtained by malicious objects, which can effectively reduce the possibility of Byzantine attacks and data poisoning attacks, and solve the problems of poor security performance and vulnerability to attacks in the existing federated learning framework.

[0056] In some embodiments, step S101 determines the priorities of different levels of the local model, allocates corresponding aggregation intervals according to the priorities of different levels, and trains the local model according to the federal aggregation strategy, including: initializing the priority parameters of the level according to the level of the local model; the priority parameters are used to characterize the priority of the corresponding level; determining the aggregation interval in the federal aggregation strategy based on the initialized priority parameters; obtaining local data, training the local model according to the federal aggregation strategy, and updating the local model.

[0057] For example, the client first initializes the corresponding priority parameters according to the different levels in the local model , and according to the priority parameter Set the aggregation interval in the federation aggregation policy. The specific formula is as follows:

[0058]

[0059] in, represents the aggregation interval, Indicates the level priority parameters, The closer it is to 1, the higher the priority, and vice versa; It represents the minimum aggregation time interval in the federated aggregation learning process. Then, local data is obtained and the local model is trained and updated using the local data. The specific formula is as follows:

[0060]

[0061] in, Indicates the i local models held by participants, represents the learning rate during local model training, For the sample representation, is the sample data, is the sample label, is the model prediction function, and the output is the regularized secret vector; The cross entropy loss function is used to calculate the cross entropy between the predicted label and the true label, which is used for backpropagation to adjust the local model.

[0062] In some embodiments, step S102 generates a random mask and adds the random mask to the model parameters of the corresponding layer of the local model, including: negotiating to determine a secure random number and generating a key based on the secure random number; based on the key, generating a random mask through a random mask generation function; each client adds the random mask to the model parameters of the corresponding layer of the local model, and the sum of the random masks added by all clients is 0.

[0063] In this embodiment, all clients jointly negotiate a secure random number and generate a key. A random mask generation function is then used to generate a shared random number of zeros as a random mask. Each client then adds the generated random mask to the model parameters of the corresponding layer of the local model, ensuring that the sum of the random masks added by all clients is 0, thereby ensuring that the correctness of the final aggregation result is not affected. The specific formula is as follows:

[0064]

[0065] in, The parameter vector representing the model parameters with random masks, Indicates the The local model held by the participants parameter vector of layer model parameters, is a random mask generation function, Indicates the participants With the participants The negotiated key, where or ; n Indicates the number of federated aggregate learning participants.

[0066] Specifically, a secure random number is determined through negotiation, and a key is generated based on the secure random number, including: two adjacent clients determine a private key from a cyclic group; the clients determine a public key based on the private key and exchange the public keys with each other; each client determines a key using the private key and the public key of the other client.

[0067] In this embodiment, the client only uses the Diffile-Hellman key agreement protocol to agree on a random mask to generate a key with two adjacent clients. and participants From the cyclic group Randomly select your own private key, respectively and ,in or . Then, each party calculates its own public key and exchanges the public key with each other. The calculation formula is as follows:

[0068]

[0069]

[0070] in, Represents the client party The public key of Represents the client party The public key of is a cyclic group The generators in is the order of the prime cyclic group. In this embodiment, is a large prime number, set to 2 127 -1. Participants Utilize participants The public key and your own private key are used to calculate the key. The calculation formula is as follows:

[0071]

[0072] in, Indicates the participants With the participants Negotiate and determine the generated key. represents the order of the prime cyclic group, Represents the client party The public key of Indicates the participants The private key of is the order of the cyclic group. Similarly, the participants also use the participants The public key and your own private key are used to calculate the key. The calculation formula is as follows:

[0073]

[0074] in, Indicates the participants With the participants Negotiate and determine the generated key. represents the order of the prime cyclic group, Represents the client party The public key of Indicates the participants The private key of is the order of the cyclic group. From this, we can observe that:

[0075]

[0076] In some embodiments, the server performs a central aggregation calculation on the parameter vectors, including: the server sums all parameter vectors with random masks to obtain a sum result; and performs a mean calculation based on the sum result to obtain an aggregate calculation result.

[0077] For example, after receiving the parameter vector uploaded by the client, the server sums all parameter vectors with random masks. The specific formula is as follows:

[0078]

[0079] in, represents the summation result, The parameter vector representing the model parameters with random masks, Indicates the The local model held by the participants parameter vector of layer model parameters, Represents the set of participants. Then, the summation results are averaged to obtain the final aggregate calculation result of the local model. The specific formula is as follows:

[0080]

[0081] in, Indicates the result of aggregate calculation. represents the summation result, represents the set of participants, n Indicates the number of federated aggregate learning participants.

[0082] In some embodiments, step S104 uses federated distillation calculation to compare the similarity between the aggregation calculation results and the parameter vectors of the model parameters, and updates the federated aggregation strategy based on the comparison results, including: determining the Pearson correlation coefficient of the corresponding level of the local model based on the aggregation calculation results; adjusting the aggregation interval in the federated aggregation strategy based on the Pearson correlation coefficient; and updating the local model based on the aggregation calculation results and the model parameters of the corresponding level of the local model.

[0083] Pearson correlation coefficient It is a statistical method to measure the strength of the linear relationship between two variables. It is usually used to measure the correlation between two continuous variables, and its value range is between -1 and 1. Specifically, the Pearson correlation coefficient can measure the degree of linear relationship between two variables. Indicates that the two vectors are completely positively correlated and present a completely linear positive relationship; Indicates perfect negative correlation, that is, the two variables show a complete linear negative relationship; Indicates that the two vectors are linearly independent.

[0084] For example, the client determines the Pearson correlation coefficient of the corresponding level of the local model based on the aggregate calculation result of the local model. The specific formula is as follows:

[0085]

[0086] in, r represents the Pearson correlation coefficient, Indicates the i The first in the client's local model l Layer parameters, Indicates the t The first global model parameter obtained by the round aggregation process l Layer parameters, t Indicates the first t Wheel polymerization process.

[0087] Specifically, the aggregation interval in the federation aggregation strategy is adjusted according to the Pearson correlation coefficient, including: comparing the Pearson correlation coefficient with the preset threshold interval: if the Pearson correlation coefficient is lower than the minimum value of the threshold interval, the aggregation interval is set to infinity; if the Pearson correlation coefficient exceeds the maximum value of the threshold interval, the aggregation calculation result of this round is discarded; if the Pearson correlation coefficient is above the threshold interval, the aggregation interval is re-determined based on the product of the Pearson correlation coefficient and the aggregation interval.

[0088] For example, if the Pearson correlation coefficient If the value is lower than the minimum value of the threshold interval, it means that the aggregation result is close to the local model and no further aggregation calculation is required. Therefore, let the aggregation interval be ; If the Pearson correlation coefficient If the maximum value of the threshold interval is higher than the maximum value, it means that the aggregation result deviates too much from the local model, and there may be malicious nodes and Byzantine nodes in the system. Therefore, the aggregation calculation results of this round are discarded; if the Pearson correlation coefficient is Within the threshold range, according to the Pearson correlation coefficient To adjust the aggregation interval, the specific formula is as follows:

[0089]

[0090] in, represents the aggregation interval, r represents the Pearson correlation coefficient.

[0091] The client updates the local model based on the local model's parameter vector and aggregate calculation results. The specific formula is as follows:

[0092]

[0093] in, represents the local model parameters in the t+1th round of federated learning, t represents the t-th round aggregation process in the federated learning process, Represents the weight parameter of the aggregate calculation result in the local model update process, Represents the result of an aggregate calculation.

[0094] The present invention also provides a privacy-safe and fine-grained federal aggregation device. The privacy-safe and fine-grained federal aggregation device provided by the present invention is described below. The privacy-safe and fine-grained federal aggregation device described below and the privacy-safe and fine-grained federal aggregation method described above can be referenced to each other. Figure 2 This is a structural diagram of the privacy-safe fine-grained federated aggregation device provided by the present invention, such as Figure 2 As shown, the device includes:

[0095] A determination module 201 is used to determine the priorities of different levels of the local model, assign corresponding aggregation intervals according to the priorities of different levels, and train the local model according to the federated aggregation strategy;

[0096] A generating module 202 is configured to generate a random mask and add the random mask to the model parameters of the corresponding level of the local model;

[0097] Processing module 203 is used to upload the parameter vector of the model parameters carrying the random mask to the server and receive the aggregate calculation result returned by the server; the aggregate calculation result is obtained by the server performing a central aggregate calculation on the parameter vector;

[0098] The updating module 204 is configured to compare the similarity between the aggregation calculation result and the parameter vector of the model parameters, and update the federation aggregation strategy according to the comparison result.

[0099] When this device is in use, for the local model, there are certain differences in the hierarchical structure. Therefore, before performing aggregation training, the determination module 201 needs to first determine the corresponding priority according to the different hierarchies, and then assign the corresponding aggregation interval to each hierarchical level according to the priority. The local model is then trained according to the federal aggregation strategy, which includes the assigned aggregation interval. Then, the generation module 202 generates a random mask and adds the random mask to the model parameters of the corresponding level of the local model, thereby protecting the privacy information of the local model and improving the security performance of the local model. Each processing module 203 then uploads the parameter vector of the model parameters with the random mask to the server, which performs central aggregation calculation and returns the aggregation calculation results to the client. Finally, the update module 204 performs a similarity comparison between the aggregation calculation results and the parameter vector of the model parameters, and updates the federal aggregation strategy based on the comparison results, and adjusts the aggregation interval and the local model. Through the above process, there is no need to set up a trusted center, and the communication cost is lower. Before performing the aggregate calculation, a random mask is assigned to the model parameters on the local model. Since the random mask has a strong randomness, the model parameters cannot be easily obtained by malicious objects, which can effectively reduce the possibility of Byzantine attacks and data poisoning attacks, and solve the problems of poor security performance and vulnerability to attacks in the existing federated learning framework.

[0100] Figure 3 An example of a physical structure diagram of an electronic device is shown below. Figure 3 As shown, the electronic device may include: a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other via the communication bus 304. The processor 301 may call the logic instructions in the memory 303 to execute the privacy-safe fine-grained federated aggregation method, which includes:

[0101] Determine the priorities of different levels of the local model, assign corresponding aggregation intervals according to the priorities of different levels, and train the local model according to the federated aggregation strategy;

[0102] Generate a random mask and add it to the model parameters of the corresponding layer of the local model;

[0103] Upload the parameter vector of the model parameters with random masks to the server and receive the aggregate calculation results returned by the server; the aggregate calculation results are obtained by the server performing central aggregate calculation on the parameter vector;

[0104] Compare the similarity between the aggregation calculation results and the parameter vector of the model parameters, and update the federation aggregation strategy based on the comparison results.

[0105] Furthermore, the logic instructions in the aforementioned memory 303 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0106] In another aspect, the present invention further provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the privacy-safe fine-grained federated aggregation method provided by the above methods, which includes:

[0107] Determine the priorities of different levels of the local model, assign corresponding aggregation intervals according to the priorities of different levels, and train the local model according to the federated aggregation strategy;

[0108] Generate a random mask and add it to the model parameters of the corresponding layer of the local model;

[0109] Upload the parameter vector of the model parameters with random masks to the server and receive the aggregate calculation results returned by the server; the aggregate calculation results are obtained by the server performing central aggregate calculation on the parameter vector;

[0110] Compare the similarity between the aggregation calculation results and the parameter vector of the model parameters, and update the federation aggregation strategy based on the comparison results.

[0111] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the privacy-safe fine-grained federated aggregation method provided by the above methods, the method comprising:

[0112] Determine the priorities of different levels of the local model, assign corresponding aggregation intervals according to the priorities of different levels, and train the local model according to the federated aggregation strategy;

[0113] Generate a random mask and add it to the model parameters of the corresponding layer of the local model;

[0114] Upload the parameter vector of the model parameters with random masks to the server and receive the aggregate calculation results returned by the server; the aggregate calculation results are obtained by the server performing central aggregate calculation on the parameter vector;

[0115] Compare the similarity between the aggregation calculation results and the parameter vector of the model parameters, and update the federation aggregation strategy based on the comparison results.

[0116] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0117] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A privacy-safe fine-grained federated aggregation method, characterized by: include: Determine priorities for different levels of local models, assign corresponding aggregation intervals according to the priorities of different levels, and train the local models according to the federated aggregation strategy; Generate a random mask, and add the random mask to the model parameters of the corresponding level of the local model; Uploading the parameter vector of the model parameters carrying the random mask to a server, and receiving an aggregate calculation result returned by the server; the aggregate calculation result is obtained by the server performing a central aggregate calculation on the parameter vector; Comparing the similarity between the aggregation calculation result and the parameter vector of the model parameter, and updating the federation aggregation strategy according to the comparison result; Comparing the similarity between the aggregation calculation result and the parameter vector of the model parameter, and updating the federation aggregation strategy according to the comparison result, including: Determining the Pearson correlation coefficient of the corresponding level of the local model according to the aggregate calculation result; adjusting the aggregation interval in the federated aggregation strategy according to the Pearson correlation coefficient; The local model is updated according to the aggregate calculation result and the model parameters of the corresponding level of the local model.

2. The privacy-safe fine-grained federated aggregation method according to claim 1, characterized in that: Determine the priorities of different levels of local models, assign corresponding aggregation intervals according to the priorities of different levels, and train the local models according to the federated aggregation strategy, including: Initializing a priority parameter of the level according to the level of the local model; the priority parameter is used to represent the priority of the corresponding level; Determining an aggregation interval in the federation aggregation strategy according to the initialized priority parameter; Acquire local data, train the local model according to the federated aggregation strategy, and update the local model.

3. The privacy-safe fine-grained federated aggregation method according to claim 1, characterized in that: Generating a random mask and adding the random mask to the model parameters of the corresponding level of the local model, including: Negotiate and determine a secure random number, and generate a key based on the secure random number; Based on the key, generating the random mask by a random mask generation function; Each client adds the random mask to the model parameters of the corresponding layer of the local model, and the sum of the random masks added by all the clients is 0.

4. The privacy-safe fine-grained federated aggregation method according to claim 3, characterized in that: Negotiating and determining a secure random number and generating a key based on the secure random number, including: Determining a private key between two adjacent clients from a cyclic group; The client determines a public key based on the private key and exchanges the public keys with each other; Each of the clients determines the secret key using a private key and a public key of another client.

5. The privacy-safe fine-grained federated aggregation method according to claim 1, characterized in that: The server performs central aggregation calculation on the parameter vector, including: The server sums all parameter vectors with the random mask to obtain a sum result; An average calculation is performed based on the summation result to obtain the aggregate calculation result.

6. The privacy-safe fine-grained federated aggregation method according to claim 1, characterized in that: Adjusting the aggregation interval in the federation aggregation strategy according to the Pearson correlation coefficient includes: Compare the Pearson correlation coefficient with a preset threshold interval: If the Pearson correlation coefficient is lower than the minimum value of the threshold interval, the aggregation interval is set to infinity; If the Pearson correlation coefficient exceeds the maximum value of the threshold interval, the aggregate calculation result of this round is discarded; If the Pearson correlation coefficient is within the threshold range, the aggregation interval is re-determined according to the product of the Pearson correlation coefficient and the aggregation interval.

7. A privacy-safe fine-grained federated aggregation device, characterized in that: include: a determination module, configured to determine priorities of different levels of the local model, assign corresponding aggregation intervals according to the priorities of the different levels, and train the local model according to the federated aggregation strategy; A generation module, configured to generate a random mask and add the random mask to the model parameters of the corresponding layer of the local model; A processing module, configured to upload the parameter vector of the model parameters carrying the random mask to a server, and receive the aggregate calculation result returned by the server; The aggregate calculation result is obtained by the server performing a central aggregate calculation on the parameter vector; An updating module, configured to compare the similarity between the aggregation calculation result and the parameter vector of the model parameter, and update the federation aggregation strategy according to the comparison result; Comparing the similarity between the aggregation calculation result and the parameter vector of the model parameter, and updating the federation aggregation strategy according to the comparison result, including: Determining the Pearson correlation coefficient of the corresponding level of the local model according to the aggregate calculation result; adjusting the aggregation interval in the federated aggregation strategy according to the Pearson correlation coefficient; The local model is updated according to the aggregate calculation result and the model parameters of the corresponding level of the local model.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the privacy-safe fine-grained federated aggregation method as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the privacy-safe fine-grained federated aggregation method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Federal learning local model parameter aggregation method

    CN115021905A

  • Federal learning privacy protection method and system, medium, equipment and terminal

    CN115883076A