Grouping federal learning method based on lottery theory and differential privacy
Through the grouping federated learning method based on lottery theory and differential privacy, the large computing and communication overhead and privacy threats of edge clients are solved, efficient training and security of federated learning models are achieved, and model performance is improved.
Patent Information
- Application Number
- CN202411160020.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-22
AI Technical Summary
When deploying on resource-constrained edge clients, existing federated learning solutions face problems such as non-independent distribution of client data, high computing and communication overhead, and privacy threats.
Adopt a grouping federated learning method based on lottery theory and differential privacy, random pruning and grouping of the initial global model of the client through the server, dynamically adjust the pruning rate, disperse the pruning process, reduce the calculation and communication overhead, and design differential privacy Budget allocation policy to ensure privacy and security.
It effectively reduces the computing and communication overhead of the client, improves the convergence and performance of the federated learning model, and ensures the security of data privacy.
Smart Images

Figure CN119066708A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computers, and more specifically, relates to a group federated learning method based on lottery theory and differential privacy. Background Art
[0002] As countries strengthen data protection regulations, companies face stricter legal requirements when processing user data, forming "data islands". Federated learning provides a solution for cross-institutional data cooperation, which enables distributed clients to cooperate in training deep learning models while saving original data locally. For example, financial institutions, medical institutions, e-commerce platforms, and surveillance security in smart city scenarios all have massive amounts of private data. Specifically, financial institutions and medical institutions can jointly analyze the economic benefits of medical insurance through federated learning; surveillance videos and images between different factories can be used to establish smarter fire recognition models through federated learning. However, existing federated learning solutions face three difficulties when deployed on resource-constrained edge clients: the client data is more non-independent and identically distributed, making it difficult to aggregate the model; federated learning has too much computational and communication overhead on edge clients; and federated learning faces privacy threats such as member reasoning and reconstruction attacks. Summary of the invention
[0003] In view of the above defects or improvement needs of the prior art, the present invention provides a group federated learning method based on lottery theory and differential privacy, which aims to reduce the computing and communication overhead of the client while ensuring the performance and security of the federated learning model.
[0004] To achieve the above object, according to a first aspect of the present invention, a group federated learning method based on lottery theory and differential privacy is provided, comprising:
[0005] S1, the server sends the initial global model M0 to all clients, and each client randomly prunes M0 to adaptively adjust the pruning rate so that the local training time of each client is less than the time threshold, and returns the pruning rate to the server;
[0006] S2, the server groups all clients according to the pruning rate of each client, under the preset constraints, with the goal of minimizing the class data imbalance of all client groups; the preset constraints include: the pruning rate of any client n is less than the upper limit of the pruning rate of the client group to which it belongs, and the client group The upper limit of the pruning rate increases in sequence, and the number of training samples in the data set of any client n is not less than the number threshold;
[0007] S3, in order Perform iterative pruning-parameter initialization operation based on lottery theory; where for the i-th client group The iterative pruning-parameter initialization operation based on lottery theory includes:
[0008] A1, the server will use the current global model W i Issued to Each client in performs τ rounds of federated learning based on differential privacy to obtain the updated W i ;
[0009] A2, the server uses a single pruning rate p r For the updated W i Perform unstructured pruning. If the pruning rate reaches The target pruning rate is , then structured pruning and parameter initialization are performed to obtain W i+1 ; Otherwise return to A1;
[0010] S4, the server will W k+1 It is sent to all clients for global federated learning training based on differential privacy to obtain the final global model.
[0011] According to a second aspect of the present invention, there is provided an electronic device, comprising: a computer-readable storage medium and a processor;
[0012] The computer-readable storage medium is used to store executable instructions;
[0013] The processor is used to read the executable instructions stored in the computer-readable storage medium and execute the method as described in the first aspect.
[0014] According to a third aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method described in the first aspect.
[0015] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0016] The method provided by the present invention groups clients based on client data distribution and computing power, reduces the computational overhead of clients with weak computing power, ensures the convergence of the federated learning model and reduces the training time; and disperses the lottery theory pruning process to each client group of the federated learning, and each client group only performs one pruning stage, which effectively reduces the client's computational overhead and communication overhead; in addition, the present invention designs a dynamic adjustment strategy for the pruning rate. The framework designs a differential privacy budget allocation strategy according to the dynamic adjustment of the pruning rate, thereby ensuring the privacy security of the system. In summary, the method provided by the present invention can effectively improve the model performance of federated learning and reduce computational and communication overheads under the premise of non-independent and identically distributed data and protecting client privacy. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 One of the flow charts of the group federated learning method based on lottery theory and differential privacy provided in an embodiment of the present invention;
[0018] Figure 2 The second flowchart of the group federated learning method based on lottery theory and differential privacy provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0020] The embodiment of the present invention provides a group federated learning method based on lottery theory and differential privacy, such as Figure 1 As shown, including:
[0021] S1, the server sends the initial global model M0 to all clients, and each client randomly prunes M0 to adaptively adjust the pruning rate so that the local training time of each client is less than the time threshold, and returns the pruning rate to the server;
[0022] Specifically, in step S1, the server sends the global model M0 to each client, and the client uses a small amount of data to train the model locally to measure the local training time; the server determines the upper limit threshold of the single-round training time according to the training time of all clients; the client performs random pruning according to the training time threshold to adaptively set the pruning rate, and reduces the training time of federated learning by reducing the local training time of the client, thereby ensuring the convergence of federated learning and reducing the training time;
[0023] The client receives the upper limit of the single-round training time set by the server. If the training time currently measured by the client exceeds the upper limit, the pruning rate is increased and random structured pruning is performed locally to reduce the model, and the training time is remeasured. The above process is repeated until the training time is less than the upper limit. The pruning rate at this time is the adaptive pruning rate.
[0024] The server sends the initial global model M0 to all clients. For any client n, use the local dataset D n A batch of training M0 is used to record the training time of a batch, and the local training time of client n can be calculated as follows:
[0025]
[0026] Among them, r represents the number of local training rounds, π represents the training time of a batch, and q n represents the number of training samples in the client n dataset, and b represents the batch size of local training. and the number of local training sets q n Upload to the server. In particular, the hardware configuration of some clients may not be sufficient for training, and a training timeout message is sent to the server.
[0027] The server calculates the time difference between sending the model and receiving the message returned by the client, and obtains the communication time of client n as So the single round of federated learning time for client n is The server sets the maximum time threshold T for a single round of federated learning on the client, and and time threshold T are sent to all clients respectively.
[0028] Client n performs random structured pruning locally to estimate the adaptive pruning rate. Specifically, client n trains a batch computation locally Gradually increase the pruning rate until the The adaptive pruning rate p is obtained when n . Then all clients send the adaptive pruning rates to the server.
[0029] S2, the server groups all clients according to the pruning rate of each client, under the preset constraints, with the goal of minimizing the class data imbalance of all client groups; the preset constraints include: the pruning rate of any client n is less than the upper limit of the pruning rate of the client group to which it belongs, and the client group The upper limit of the pruning rate increases in sequence, and the number of training samples in the data set of any client n is not less than the number threshold;
[0030] Specifically, the server groups the clients according to the client data distribution and pruning rate. The server sets the number of groups, the upper limit of the pruning rate of each group, and the lower limit of the number of client group data sets to group the clients. The constraints are that the selected client pruning rate is less than the upper limit of the pruning rate of each group and the number of client group data sets is greater than the lower limit, and the client group The upper limit of the pruning rate increases sequentially. Under this constraint, the class imbalance index (QCID) of the divided client group is minimized.
[0031] The client grouping problem is transformed into the following optimization objective:
[0032]
[0033]
[0034] Among them, the dataset D of client n n There are B category label data, using vector α n =[α (n,1) , α (n,2) , ..., α (n,b) , ..., α (n,B) ] indicates D n The data label distribution, α (n,b) ≥0 and Indicates a client group that has been divided. represents the class data imbalance of the client group, n and n′ represent the client group The two clients in q n Indicates D n The number of training samples in , p M Indicates the client group The upper limit of the pruning rate, q represents the client group The lower limit of the number of data set samples, p n represents the pruning rate of client n, q n′ Indicates D n` The number of training samples in a n' Represents the data label distribution of client n'. The more evenly the data class distribution of the client combination is and the number of data sets reaches a certain scale, the faster the federated learning model can converge. At the same time, in order to make the training time of each client group similar to improve the training efficiency, the optimization goal is to minimize The constraints are the pruning rate and number of datasets per group, and the client group The upper limit of the pruning rate increases in sequence.
[0035] Solving the above optimization problem will yield the client grouping set It is understandable that existing methods may be used to solve the above optimization problem, such as simulated annealing algorithm, genetic algorithm, particle swarm optimization algorithm, etc.
[0036] It is understandable that since the upper limit of the pruning rate of each group of clients increases in sequence, middle, has the lowest upper limit of pruning rate, that is, the strongest computing and communication capabilities. The pruning rate is the highest.
[0037] S3, in order Perform iterative pruning-parameter initialization operation based on lottery theory; where for the i-th client group The iterative pruning-parameter initialization operation includes:
[0038] A1, the server will use the current global model W i Issued to Each client in performs τ rounds of federated learning based on differential privacy to obtain the updated W i That is, the server will use the current global model W i Issued to Each client in the training set adds noise to the training set and returns it to the server for aggregation. The server then sends W i Update to the aggregated model and perform the above operations of sending, training, adding noise, returning and aggregating again until the preset training round τ is reached;
[0039] A2, the server uses a single pruning rate p r For the updated W i Perform unstructured pruning. If the pruning rate reaches The target pruning rate is , then structured pruning and parameter initialization are performed to obtain W i+1 ; otherwise return A1.
[0040] Specifically, the client group with low pruning rate first participates in structured iterative pruning based on lottery theory. The server first initializes a single pruning rate. After a certain number of rounds of federated learning training, the global model is pruned according to the single pruning rate. The iterative pruning process continues until the global model reaches the target pruning rate of the group, and then the model parameters are reset to the initialization state, and the next client group is switched to participate in pruning in ascending order of pruning rate.
[0041] In the example, the first client group has the lowest pruning rate, i.e., it has the strongest computing and communication capabilities. In this order, the client groups participate in an “iterative pruning-parameter initialization” phase based on the lottery theory.
[0042] like Figure 2 As shown, in the i-th “iterative pruning-parameter initialization” phase based on lottery theory, the client group participating in pruning is This phase includes:
[0043] Server to Client Group Send the current global model W i After training, the client adds noise and returns it to the server. The server aggregates the models returned by each client and converts them into W i Update to the aggregated model and perform the above operations of sending, training, adding noise, returning and aggregating again until the preset training round τ is reached; the server uses the lottery theory to calculate the unstructured pruning rate of a single iteration as p rPerform unstructured pruning on it, and then send it to each client separately, repeat the above process until the global model reaches the target pruning rate of the client group. Then, the server aggregates each model and performs structured pruning and parameter initialization on it based on the lottery theory, that is, reorganize the unstructured pruning mask into a structured pruning mask. After structured pruning, reset the model parameters and obtain W i+1 According to W i+1 , for the next client group Perform the above-mentioned “iterative pruning-parameter initialization” operation.
[0044] Preferably, in the iterative pruning-parameter initialization operation, after returning to execute the first training round in A1, it also includes:
[0045] Determine W after pruning i Is the global accuracy lower than the accuracy threshold? If so, lower p r , otherwise keep p r constant.
[0046] Specifically, during the above-mentioned iterative pruning-parameter initialization operation, the server performs global model pruning once after a certain number of rounds of federated learning training. If the model accuracy drops by more than a threshold after pruning, the single-iteration pruning rate is reduced.
[0047] In the above process, the client locally trains the model W i , according to the privacy budget p Add noise and upload the updated model and local model accuracy. The server aggregates the updates and calculates the global accuracy. Then it sends the model down to start the next round of federated learning.
[0048] After every τ rounds of federated training, the server prunes at a rate of p r For the global model W i Pruning: If the global accuracy of the model drops too much after one pruning, reduce the iterative pruning rate p r , repeat the pruning process until the global model reaches the target pruning rate Get the pruned global model W i+1 According to the lottery pruning process, the server initializes the global model W i+1 Parameters, distribute the model to the client group And start the next pruning phase.
[0049] It is understandable that the server is based on the pruning rate p r For the global model W iAfter pruning, it needs to be returned to each client of the client group. After each client trains and adds noise and returns it to the server again, the server can determine the global accuracy of the model. Therefore, the above judgment operation is performed after returning to execute the first training round in A1.
[0050] Preferably, in the iterative pruning-parameter initialization operation, the differential privacy noise added in each round of training is calculated according to the differential privacy budget parameter e p Sure;
[0051] in, e0 is the preset global differential privacy budget, p i is the current global model pruning rate, p i+1 is the target pruning rate for the client group.
[0052] Specifically, in the above pruning process, in order to ensure that the client's local training model produces model updates, the client adds differential privacy noise to the model update to protect data privacy security, and the privacy budget is negatively correlated with the single iteration pruning rate.
[0053] Since the single-round pruning rate p in the federated learning pruning process r It is adjusted dynamically, so privacy security is guaranteed by calculating the remaining number of training rounds and adaptively allocating the differential privacy budget.
[0054] That is, in order to achieve the target pruning rate, more federated learning rounds are required, so the remaining differential privacy budget is dynamically distributed evenly to the remaining rounds. During the federated learning pruning process in step S3, whenever the global model parameters are reset, the client's private data information is no longer retained in the model parameters, so the differential privacy budget of the client group is also reset.
[0055] In a round of federated learning training, the single-round iterative pruning rate is p r , the estimated number of training rounds required is Differential privacy budget parameters per round Since the single iteration pruning rate p in operation S2 r may decrease, so the remaining number of training rounds r and the differential privacy budget parameter e per round p Need to be based on p r Dynamically adjust to ensure the privacy of client data.
[0056] S4, the server will W k+1 It is sent to all clients for global federated learning training based on differential privacy to obtain the final global model.
[0057] Specifically, after pruning is completed, the pruned structure-sparse global model W is obtained.k+1 , the server sends it to all clients for global federated learning training based on differential privacy to fine-tune the model W k , all clients participate in fine-tuning training, train for a fixed number of rounds r, complete the entire training process, and obtain the final global model. That is, the server will structure the sparse global model W k+1 Sent to all clients, all of which participate in federated learning training fine-tuning and reset the differential privacy budget.
[0058] It can be understood that the above global federated learning training based on differential privacy means that each client sends the model W to the user. k+1 After training and adding differential privacy noise, it is returned to the server.
[0059] Preferably, in step S4, the differential privacy budget parameter e in each round of training is p ` is a fixed value.
[0060] Specifically, all clients participate in a fixed number of federated learning training rounds, using a fixed differential privacy budget in each round.
[0061] In the federated learning fine-tuning training of S4, since the server resets the model parameters during the pruning phase, the differential privacy parameters of the client need to be reset. All clients participate in a fixed number of federated learning trainings, using a fixed differential privacy budget for each round, and the differential privacy parameters for each round are set to
[0062] It is understandable that when the above method is used for medical image recognition, the private data set of each client is the medical image, and accordingly, the final global model obtained in step S4 can be directly used for medical image recognition. When the above method is used for video surveillance, the private data set of the client is the surveillance image collected by the surveillance device connected to it, and accordingly, the final global model obtained in step S4 can be directly used for surveillance image recognition.
[0063] An embodiment of the present invention provides an electronic device, including: a computer-readable storage medium and a processor;
[0064] The computer-readable storage medium is used to store executable instructions;
[0065] The processor is used to read the executable instructions stored in the computer-readable storage medium and execute the method described in any of the above embodiments.
[0066] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method described in any of the above embodiments.
[0067] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A group federated learning method based on lottery theory and differential privacy, characterized in that: include: S1, the server sends the initial global model M0 to all clients, and each client randomly prunes M to adaptively adjust the pruning rate so that the local training time of each client is less than the time threshold, and returns the pruning rate to the server; S2, the server groups all clients according to the pruning rate of each client, under the preset constraints, with the goal of minimizing the class data imbalance of all client groups; the preset constraints include: the pruning rate of any client n is less than the upper limit of the pruning rate of the client group to which it belongs, and the client group The upper limit of the pruning rate increases in sequence, and the number of training samples in the data set of any client n is not less than the number threshold; S3, in order Perform iterative pruning-parameter initialization operation based on lottery theory; where for the i-th client group The iterative pruning-parameter initialization operation based on lottery theory includes: A1, the server will use the current global model W i Issued to Each client in performs τ rounds of federated learning based on differential privacy to obtain the updated W i ; A2, the server uses a single pruning rate p r For the updated W i Perform unstructured pruning. If the pruning rate reaches The target pruning rate is , then structured pruning and parameter initialization are performed to obtain W i+1 ; Otherwise return to A1; S4, the server will W k+1 It is sent to all clients for global federated learning training based on differential privacy to obtain the final global model.
2. The method according to claim 1, characterized in that In the iterative pruning-parameter initialization operation, after returning to execute the first training round in A1, it also includes: Determine W after pruning i Is the global accuracy lower than the accuracy threshold? If so, lower p r , otherwise keep p r constant.
3. The method according to claim 1 or 2, characterized in that In the iterative pruning-parameter initialization operation, the differential privacy noise added in each round of training is calculated based on the differential privacy budget parameter e p Sure; in, e0 is the preset global differential privacy budget, p i is the current global model pruning rate, p i+1 is the target pruning rate.
4. The method according to claim 1 or 2, characterized in that: In step S4, the differential privacy budget parameter e in each round of training is p ` is a fixed value.
5. The method according to claim 1, characterized in that In the iterative pruning-parameter initialization operation, when the client uploads the trained and noise-added model to the server, the accuracy of the model is also uploaded to the server.
6. The method according to claim 1, characterized in that In step S1, for any client n, the time threshold is the difference between the client single-round federated learning time threshold and the communication time of the client n.
7. An electronic device, characterized in that: include: A computer readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is used to read the executable instructions stored in the computer-readable storage medium and execute the method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Efficient personalized federal learning system and method
CN114492847A
Method for protecting user data privacy and resisting hostile attackers under federated learning
CN116502223A
Federal learning-based privacy protection active caching method in mobile edge computing
CN117041939A
Chain federated learning method based on grouping and weight self-optimization
CN117436542A
Efficient federated learning system and method based on channel pruning
CN117592538A
