System heterogeneous federated learning efficiency improvement method using multiple cost functions
By dynamically adjusting server waiting time and client participation through multiple cost functions, the problems of low communication efficiency and privacy leakage caused by system heterogeneity in federated learning are solved, achieving more efficient resource utilization and higher global model training accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2026-03-24
AI Technical Summary
Existing federated learning methods cannot effectively balance communication efficiency and resource utilization between clients and servers when facing the problem of system heterogeneity, resulting in low training efficiency and the risk of privacy data leakage.
By employing multiple cost functions to dynamically adjust server waiting time and client participation, and by constructing client idle cost and termination cost functions, we can optimize client resource utilization and communication efficiency, avoid client data transmission, and improve the global model training accuracy.
This improves the training efficiency of federated learning, reduces client resource waste and the risk of privacy data leakage, and enhances the accuracy and training efficiency of the global model.
Smart Images

Figure CN115759282B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a system heterogeneous federated learning efficiency improvement method using a multi-cost function, and belongs to the technical field of computer and information science. BACKGROUND
[0002] In recent years, the rapid development of the Internet and artificial intelligence has made machine learning and data analysis penetrate into all aspects of life. Daily use of mobile phones and computers will generate a large amount of private data, which can be used in machine learning models to greatly improve user experience. However, these data often involve user privacy, and there is a risk and responsibility in storing them on the server. At the same time, in a distributed network, compared with the traditional machine learning method of transmitting massive data to the server for training, the communication cost of user learning and generating models locally is lower and more practical. The federated learning that has emerged in recent years enables user data to carry out federated modeling without leaving the local, which can effectively protect user privacy. However, there is a problem of system heterogeneity in the process of federated learning, that is, the characteristics of the devices used by each user are different, and the amount of local data, computing performance and communication performance of each user are different. This brings challenges to the effect and cost of federated learning: when the server discards the client model that does not complete the training within the specified time, if the discarded model contains certain data characteristics, it will have a negative impact on the convergence of the global model; when the server keeps waiting until all clients complete the training, the low-efficiency clients will seriously affect the server's use of other clients' resources.
[0003] The existing federated learning method fixes the submission deadline of the parameters, mainly alleviates the data heterogeneity by improving the machine learning algorithm, and mostly ignores the more important system heterogeneity. In practical applications, the server needs to consider how to balance the amount of client data, computing performance and communication performance to ensure the training efficiency in the process of aggregating the global model. At the same time, the local training of the client needs to occupy the computing resources and communication resources of the device, even if the training is carried out at night, it may encounter communication blockage, power shortage and other sudden situations, affecting the server to aggregate the global model.
[0004] The federated learning method based on computing offloading transfers the client data to the edge server for calculation, thereby reducing the computing pressure of the client locally, but using the communication network to transmit the client data increases the risk of user privacy leakage, which goes against the original intention of federated learning to protect privacy. The federated learning method for computing resource heterogeneity determines whether to wait by judging whether the difference in the number of iterations between clients reaches a threshold, which utilizes the computing resources of the clients, but monitoring all clients generates more communication volume, which may reduce the training efficiency of federated learning. SUMMARY
[0005] The application aims to solve the problems of fixed server waiting time and ignoring communication efficiency between clients and servers in the existing federated learning method, and proposes a system heterogeneous federated learning efficiency improvement method applying multiple cost functions.
[0006] The design principle of the application is: first, set initial training parameters according to the modeling task, determine participating clients and perform federated training; second, dynamically construct client idle cost function and termination cost function according to client data volume, computing performance and communication performance, and training completion within the current server waiting time before the next round of training; then, traverse the possible values of the server waiting time, minimize the total cost of all clients to obtain the optimal waiting time, and then update the training parameters and adjust the participating clients; finally, through multiple rounds of federated training, the global model accuracy requirement is reached.
[0007] The technical scheme of the application is realized by the following steps:
[0008] Step 1, the server sets initial training parameters according to the modeling task, and sends a federated modeling request to each client.
[0009] Step 1.1, the server sets initial training parameters according to the modeling task.
[0010] Step 1.2, the idle client responds to the server, and the server generates a set of participating clients.
[0011] Step 2, the server distributes the global model to each client for training, and carries out federated modeling.
[0012] Step 2.1, participating clients can actively exit federated modeling according to their own conditions during modeling.
[0013] Step 2.2, idle clients can send a request to participate in federated modeling to the server at any time.
[0014] Step 3, after the client completes the training, the server collects the client data and performs evaluation.
[0015] Step 3.1, the client sends the performance parameters and the local model to the server.
[0016] Step 3.2, the server needs to ensure that enough parameters are collected before aggregating the model, otherwise it continues to wait.
[0017] Step 4, the server resets the training parameters according to the client computing performance and communication performance.
[0018] Step 4.1, the server sorts the total training and communication time of the clients, and selects a threshold time.
[0019] Step 4.2, calculate the idle cost and termination cost of the client according to the local data amount of the client, the calculation efficiency and the communication efficiency.
[0020] Step 4.3, traverse the possible values of the server waiting time, minimize the total cost of the participating clients to obtain the optimal waiting time.
[0021] Step 4.4, calculate the server tolerance time and the training time of each client.
[0022] Step 4.5, adjust the training rounds for the client who cannot complete the training on time.
[0023] Step 5, repeat steps 2 to 4 until the global model accuracy meets the demand, the server retains the model generated by training, and the federated modeling ends.
[0024] Advantages
[0025] Compared with the traditional federated learning method, the idle cost and termination cost function calculation method of the participating client is proposed, the fixed waiting time of the server is dynamically adjusted according to the performance of each client, the communication efficiency between the client and the server is guaranteed, the utilization of the client resources is strengthened, and the federated learning training efficiency is improved.
[0026] Compared with the federated learning method based on calculation offloading, the client data is guaranteed not to leave the local, and the risk of privacy data leakage caused by communication between devices is avoided. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 It is a schematic diagram of the federated training process of the server of the present application.
[0028] Figure 2 It is a schematic diagram of the federated training process of the client of the present application.
[0029] Figure 3 It is a schematic diagram of the training parameter adjustment method of the present application. DETAILED DESCRIPTION
[0030] In order to better illustrate the purpose and advantages of the present application, the embodiments of the method of the present application will be further described in detail below in combination with the drawings of the present application.
[0031] Step 1, the server sets the initial training parameters according to the modeling task, and sends a federated modeling request to each client.
[0032] Step 1.1, the server sets the initial waiting time T W of the server, the initial tolerance time T O , the initial training time T Ri of each client, the initial training rounds K, and the data proportion threshold H according to the federated modeling task.W , completion ratio threshold H K , model aggregation round threshold N K .
[0033] initial waiting time T W , the waiting time of the server after sending the global model and training parameters to each client, the server waits for T W to evaluate the received client data.
[0034] set tolerance time T O to ensure that the server can receive H W above the proportion of data before aggregating the global model, in this example, H W = 0.95.
[0035] The amount of computation required for different modeling tasks and the convergence of the model are different, so T Ri and K need to be set according to the actual situation, where i = {1,..., m}, m is the total number of participating clients, and the initial training time T Ri of each client is the same.
[0036] Set the model aggregation round threshold N K = f(K), to ensure the effect of global model aggregation, prevent the model of the client that has not completed N K rounds of training from affecting the convergence of the global model, in this example, N K = K / 2.
[0037] Set the completion ratio threshold H K , that is, the proportion of clients that can complete K rounds of training needs to be greater than H K , to ensure the convergence of the global model, in this example, H K = 0.8.
[0038] Step 1.2, after the server sends a federal modeling request to each client, the idle client sends a response signal to the server, and the server generates a set of participating clients Client {C1,..., C m}. The client whose computing performance and communication performance are limited is considered offline and does not send a signal to the server.
[0039] Step 2, the server distributes the global model to each client for training and conducts federal modeling.
[0040] Step 2.1, the server sends the global model and related training parameters to the clients in the set Client. During the model training process, if the client C1 is suddenly used by the user, the computing performance and communication performance are reduced, and then C1 sends an interrupt signal to the server to stop training and send the previous round of training model to the server. After receiving the interrupt signal, the server compares the current model training round of the client C1 with the threshold N K , determines whether to use it for the current round of global model aggregation, and removes the client C1 from the set Client, so that it no longer participates in the next round of training.
[0041] Step 2.2, after the user stops using the client C1, the computing performance and communication performance of the client C1 are restored to normal, and the client C1 can participate in the global model aggregation again. The client C1 sends a request signal to the server to request to join the next round of federated training. Among them, C1 can also be a client C n that has never participated in federated training. When the client has sufficient performance to carry out federated training, it can initiate a federated modeling request to the server. After receiving the request signal, the server decides whether to add the requesting client to the set Client according to the federated modeling requirements, so that the client participates in the next round of federated training.
[0042] Step 3, the server waits for T W , and then evaluates the collected client data to determine whether the collected data is sufficient to aggregate the global model.
[0043] Step 3.1, the client records the local floating point operation number and the local training time. After exceeding the server specified training time T Ri or completing the training, the client sends the local floating point operation number FLOPs i , the actual training time t ri , the data volume D i and the current model to the server.
[0044] Step 3.2, the server assigns the client with a proportional data weight according to the data volume D i , calculates the total weight of the received model of the client, and decides whether to continue waiting according to the data proportion threshold H w . If the total weight of the received model of the client does not exceed 95% of the total weight of the participating clients after waiting for T W , the server waits for T O again until enough client data is obtained to aggregate the global model.
[0045] If enough data is still not obtained after waiting for 3 T O , the server determines that the client that has not sent data has been offline, stops receiving data, and removes the offline client from the set Client, and no longer sends data to the offline client.
[0046] Step 4: The server resets the server waiting time T′ based on the client data volume, computing performance, and communication performance. W Server tolerance time T′ O Training time T′ for each client Ri At the same time, the training rounds are adjusted for clients that cannot complete K rounds of training.
[0047] Step 4.1, set set R to record the total training and communication time {t1, t2, ... t} of the m clients participating in federated modeling. m After sorting the set R, it is based on the completion rate threshold H. K Take 80% of the location time t of the set n As a threshold time t k .
[0048] Step 4.2, according to client C i Local data volume D i Computational efficiency Eff ri Communication efficiency Eff ci Calculate the client cost.
[0049] Based on the threshold time t determined in step 4.1 k In other words, whether the client has completed training is divided into client idle cost L. Tk And the cost of client termination L Fk Two parts. L Tk This refers to the cost incurred by clients that have completed training in advance not performing additional computation or communication operations, but waiting for other clients, resulting in the underutilization of their computational and communication performance; L Fk The idle cost L refers to the cost incurred when inefficient client local training is terminated early to reduce waiting time for other clients, resulting in underutilization of client data. Tk And the cost of client termination L Fk Perform summation calculations separately, see reference. Figure 3 have to:
[0050]
[0051]
[0052] Where t k -t i This indicates the idle time after the client completes computation and communication, meaning that its computational and communication performance is not effectively utilized.
[0053] According to client C i Local floating-point operands (FLOPs) i and training time tri The client computing efficiency obtained.
[0054] For the client C i Communication time t ci The client communication efficiency calculated by the amount of communication data is the same as the amount of local model parameters sent by each client to the server, and the difference in other parameters can be ignored. Therefore, the communication data is omitted, and the communication efficiency is controlled by the communication proportion coefficient θ. θ is set according to actual needs.
[0055] g i is the idle cost proportion coefficient, which controls the cost of the client that has completed training. The idle cost of the client that has completed training can be increased by increasing g i , so as to shorten the server waiting time and improve the federated learning training efficiency.
[0056] t i -t k represents the reduction of the client training time under the condition that the total time of client training and communication is reduced, but the communication time is ensured to be unchanged. represents the cost of not being able to fully utilize the client data due to the reduction of the training round caused by the shortening of the client training time.
[0057] f i is the termination cost proportion coefficient, which controls the cost of the client that has not completed training. The termination cost of the client that has not completed training can be increased by increasing f i , so that more clients can complete the specified K rounds of training, and the global model accuracy is improved.
[0058] The initial proportion coefficients g i and f i of each client are equal, and the proportion coefficients of each client can be adjusted according to actual training needs during the training process. For example, during the training process of the client, the server tests the local model of each client in the previous round of training, increases the proportion coefficient of the client that contributes more to the global model accuracy, so as to ensure that the client can complete the training and further improve the global model accuracy.
[0059] Step 4.3, traverse the possible values of the server waiting time, minimize the total cost L Wk to obtain the optimal waiting time.
[0060] L wk = L Tk + L Fk
[0061] L k and L Tk are added as the total cost L of the client according to the threshold time t Fk .Wk Participate in the comparison. Take the set R from step 4.1, t... n As the initial threshold time t k traverse up to t in sequence m Obtain the total cost set {L Wn , ..., L Wm}, find the total cost L Wk The smallest t k Update server waiting time T′ W =t k .
[0062] Step 4.4, Tolerance Time in The average total time for clients to complete training and communication is used as the new tolerance time, and the standard deviation of this total time is rounded up. Multiple simulations show that the total training and communication time for the vast majority of clients does not exceed T′. W +T′ O And the total training and communication time for all clients is within T′ W +3*T′ O Inside.
[0063] The server records client C i Total training and communication time t i Client communication time t ci For t i Compared with the actual training time t on the client side ri The difference, similarly based on T′ W With t ci Update the training time T′ for each client Ri , where i = {0, ..., m}.
[0064] t ci =t i -t ri
[0065] T′ Ri =T′ W -t ci
[0066] The training time for each client is set to the server waiting time minus the client communication time, to ensure that the server can receive the data within the waiting time after the client completes training.
[0067] Step 4.5, the server calculates client C i Training time required to complete the specified K rounds of training Where i = {0, ..., m}. For any client C i If T′ is updatedRi <T Ni Then the server cannot be in training time T. Ri The client that has completed K rounds of training adjusts the training round k′. i This ensures that the server can receive training feedback from the client during the waiting time, reducing data loss.
[0068]
[0069] Where k i With t ri For client C i The number of training rounds and the actual training time in the previous round, T′ Ri This is the updated training time. Set the threshold N. K To ensure overall training effectiveness, if k′ is updated... i <N K If the server deems the client's performance poor and severely impacts the efficiency of federated learning training, it will remove the client from the Client set.
[0070] Training rounds k′ i Rounding down ensures that all clients can complete the training, which reduces data loss caused by the server dropping clients and ensures that other clients do not have to wait too long and waste resources.
[0071] Step 5: Repeat steps 2 to 4 until the global model accuracy meets the requirements. The server retains the trained model, and the federated modeling ends.
[0072] The above detailed description further illustrates the purpose, technical solution, and beneficial effects of the invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for improving the efficiency of heterogeneous federated learning of systems using multiple cost functions, characterized in that... The method includes the following steps: Step 1: The server sets the initial training parameters according to the modeling task and sends federated modeling requests to each client. Idle clients respond to the server, and the server generates a set of participating clients. ,common One client; Step 2: The server distributes the global model to each client for training, conducting federated modeling. The total number of training rounds is [number missing]. During the modeling process, the client can actively exit or join the federated modeling based on resource usage. Step 3: In each round of training, after the client completes local training, it sends data to the server. The server collects the client's data and evaluates it to ensure that enough parameters are collected before aggregating the model; otherwise, it continues to wait. Step 4: In each round of training, the server iterates through... Set up a collection Record participants in federated modeling Total training and communication time for each client , will set After sorting, based on the completion rate threshold Take the time at the corresponding position in the set as the initial threshold time. Then iterate through the possible values of the client's waiting time { Based on the computational efficiency of all clients Communication efficiency Calculate the client idle cost The corresponding client waiting time value is Based on the local data volume of all clients Calculate the client termination cost Minimize the total cost of participating clients The optimal waiting time is obtained, and some training parameters, including the server waiting time, are then reset. Server tolerance time Training time for each client Unable to complete The client adjusts the number of training rounds during round training. ; Step 5: Repeat steps 2 to 4 until the global model accuracy meets the requirements. The server retains the trained model, and the federated modeling ends.
2. The method for improving the efficiency of heterogeneous federated learning of systems using multiple cost functions as described in claim 1, characterized in that: Using communication time in step 1 Training time and tolerance time Controls local model training and communication on the client side.
3. The method for improving the efficiency of heterogeneous federated learning of systems using multiple cost functions as described in claim 1, characterized in that: Set the data ratio threshold in step 3. Ensure the server receives Aggregate the global model after collecting the data above the specified proportion; set the proportion threshold after completion. ,ensure A certain percentage of clients can complete the process within the server's waiting time. Training rounds; setting the threshold for model aggregation rounds To prevent incomplete The client-side model trained in each round affects the convergence of the global model.
4. The method for improving the efficiency of heterogeneous federated learning of systems using multiple cost functions according to claim 1, characterized in that: In step 4, the server calculates the client idle cost in each round of training. , of which Client The computational efficiency is Communication efficiency is Calculate the client termination cost Among them, the client The amount of data is The idle cost With termination cost The calculation is as follows: in Indicates client Idle time after completing calculations and communication For the client Computational efficiency For the client Communication efficiency, The idle cost ratio coefficient controls the number of clients that have completed training. The cost, Indicates due to client The shortened training time leads to fewer training rounds, making it impossible to fully utilize the client. data The cost, To terminate the cost ratio coefficient, control the number of clients that have not completed training. The cost.
5. The method for improving the efficiency of heterogeneous federated learning of systems using multiple cost functions according to claim 4, characterized in that: In step 4, the server wait times are iterated through. The possible values of the total cost are minimized. The optimal waiting time is obtained, where .
6. The method for improving the efficiency of heterogeneous federated learning of systems using multiple cost functions according to claim 1, characterized in that: In step 4, the server tolerance time is obtained by calculating the standard deviation of client communication time. The server will wait an additional time. This ensures that the number of parameters meets the requirements when the server aggregates the global model.
7. The method for improving the efficiency of heterogeneous federated learning of systems using multiple cost functions according to claim 1, characterized in that: Calculate the client in step 4 Complete the requirements Training time required for each round of training and the updated client training time Compare and choose whether to adjust the training rounds for the client. , The range of values is ,correspond One client; Adjustments may be made based on the client's requirements. Previous training round Actual training time and updated training time The adjustment could not be completed. The client training rounds are: ,in .
Citation Information
Patent Citations
Federal learning training acceleration method for heterogeneous scene
CN113391897A
Robustness federated learning model aggregation method based on truth value discovery
CN114186237A