Federal learning energy efficiency optimization method in mobile edge computing network
By optimizing the local training times and communication energy allocation of the client in the mobile edge computing network, the energy efficiency problem of federated learning under heterogeneous data and energy constraints is solved, and more efficient energy use and model training are achieved.
Patent Information
- Application Number
- CN202410731225.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-17
AI Technical Summary
In the mobile edge computing network, when the client data is heterogeneous and the energy is limited, the local training times and communication energy of the client are not optimized during the federated learning process, resulting in excessive energy loss and low energy efficiency.
By adjusting the local training times and communication energy allocation, combined with model initialization, loss function calculation and global model convergence analysis, the client's local training times and calculation frequency are optimized to reduce energy consumption and improve training efficiency.
It effectively reduces the communication energy consumption between the device and the server, improves the model convergence speed and overall training efficiency, and improves energy usage efficiency. It is suitable for federated learning environments with heterogeneous data.
Smart Images

Figure CN118657230A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication network technology, and in particular to a method for optimizing energy efficiency of federated learning in a mobile edge computing network. Background Art
[0002] At present, IoT devices such as smartphones, drones, and wearable medical devices are generating and storing a large amount of data, and using machine learning technology to learn the collected data to obtain powerful prediction models. However, this data is usually scattered among various clients, and it is difficult for clients with insufficient data to train a model with good performance on their own. In traditional machine learning, model training is mainly completed through centralized machine learning methods, which cannot be directly applied to IoT devices. On the one hand, centralized machine learning methods require each client to send all its data to a central server, which completes the model training. The high communication cost and transmission delay generated when uploading data will bring a great burden to IoT devices with unsatisfactory channel environments and energy constraints, and it is difficult to meet the low-latency task requirements. On the other hand, this data usually contains potential sensitive information, and the process of uploading data information may lead to serious privacy leakage risks, such as data eavesdropping and abuse of users' personal data.
[0003] Federated Learning (FL) is an artificial intelligence learning framework that was created to address the data privacy protection issues faced in the practical application of artificial intelligence. Its core goal is to enable multiple clients to achieve collaborative learning without directly exchanging data, and to establish a shared, globally effective machine learning model. Under the federated learning framework, the client first trains the local model on its own, then encrypts the parameters of the local model and uploads them to the central server. The server securely aggregates the parameters of each local model, obtains the global model parameters and sends them to each client. This iterative process is repeated until the global model reaches the target accuracy. In this process, the client uploads and downloads the parameters of the model, and the data always remains locally, which can well protect the client's data privacy.
[0004] In a mobile edge computing network, the client is a wireless terminal, so the computing power and battery power are limited. The client in the mobile edge computing network participates in the iterative process of federated learning, which generates high computing and communication overhead, aggravates the energy consumption of such clients, and affects the user experience. It is necessary to improve the accuracy of the global model of federated learning as much as possible under limited energy overhead to achieve energy efficiency optimization. In addition, the differences in wireless terminals in the mobile edge computing network also produce certain data heterogeneity, which has a certain impact on the iterative training speed and accuracy of the global model of federated learning. Therefore, how to improve the energy efficiency of training the global model based on heterogeneous data is very important for the federated learning process of the mobile edge computing network.
[0005] In real-world scenarios, there are still many problems in achieving collaborative training for all clients. Data heterogeneity is one of the key issues. Data heterogeneity means that the data of different clients are non-independent and identically distributed (Non-IID), and their data sets have significant differences in size and class distribution. Studies have shown that heterogeneous training data will cause the accuracy of the global model obtained by federated learning to drop significantly. There are many methods to solve the problem of data heterogeneity that causes the performance of the model to drop, such as personalized federated learning.
[0006] However, under conditions where client resources are limited, such as in mobile edge computing networks, the design of a federated learning system requires not only considering the impact of data heterogeneity on the entire model, but also the relationship between the system's computing energy consumption and communication energy consumption and the global model accuracy, that is, energy efficiency.
[0007] Therefore, the technical problem to be solved by the present invention is: how to solve the problem that in the scenario where client data is heterogeneous and energy is limited, the number of local training times and communication energy of the client are not optimized during the federated learning of heterogeneous data, resulting in excessive energy loss and low energy efficiency. Summary of the invention
[0008] The purpose of this application is to provide a method for optimizing the energy efficiency of federated learning in a mobile edge computing network, jointly designing the number of local training times, local computing frequency allocation, and communication energy allocation to achieve energy efficiency optimization of federated learning of heterogeneous data. This method solves the problem that in the scenario where the client data is heterogeneous and energy is limited, the number of local training times and communication energy of the client are not optimized during the federated learning process, resulting in excessive energy loss and low energy efficiency.
[0009] To achieve the above-mentioned purpose, the present application provides a method for optimizing energy efficiency of federated learning in a mobile edge computing network, the method comprising: inputting local training client parameters and performing model initialization; after the model initialization is completed, calculating the number of local training times of each client according to the data heterogeneity of each client; performing local model training respectively according to the number of local training times of each client to obtain model parameters after local model training; performing global model aggregation according to the model parameters after local model training to obtain global model parameters; testing the global model according to the global model parameters, and if there is a client that does not achieve the expected accuracy or does not reach the maximum number of iterations of federated learning, starting the next round of iteration of federated learning; otherwise, each client stops local model training and the federated learning process ends.
[0010] As described above, the method for optimizing energy efficiency of federated learning in a mobile edge computing network, wherein the initialization of the model includes determining the learning tasks of the federated learning, and determining the machine learning model to be constructed according to the learning tasks.
[0011] In the above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network, according to the heterogeneity of each client, calculating the number of local training times of each client includes:
[0012] Determine the loss function during local training;
[0013] Compute the convergence of the global model;
[0014] The number of local training times for each client is determined based on the impact of the client on the convergence of the global model.
[0015] In the above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network, the convergence of calculating the global model includes:
[0016] Calculate the difference between the distributed gradient descent global model and the centralized gradient descent model;
[0017] According to the difference between the distributed gradient descent global model and the centralized gradient descent model, the convergence upper bound of the global model is derived.
[0018] In the above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network, determining the number of local training times of each client according to the influence of the client on the convergence of the global model includes:
[0019] Define the optimization problem and optimization variables. The optimization variables are the number of local trainings of each client and the frequency of client training.
[0020] The optimization problem is divided into two sub-problems, the two sub-problems are optimized, and the values of the optimization variables of the two sub-problems are obtained.
[0021] The above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network, wherein the optimization problem is:
[0022]
[0023] Where YH represents the optimization problem; a and b are the parameters of the upper bound of the global model convergence; g(Δτ k ) represents the difference between the distributed gradient descent global model and the centralized gradient descent model: N represents the total number of clients; γ n (Δτ n,k , f n ) represents the n,k The computational energy consumed by all clients during local training within the range; Δτ n,k Indicates the number of local training times of the nth client; f n Indicates the task calculation frequency of the nth client; P n,k S represents the power transmitted by the nth client in the kth round; n Indicates the size of the model parameters of the nth client; C n Indicates the channel bandwidth from the nth client to the server.
[0024] As described above, the energy efficiency optimization method of federated learning in the mobile edge computing network, where the convergence upper bound of the global model is expressed as F(τ k )-F(w * )express;
[0025]
[0026] Among them, a and b are the parameters of the upper bound of the global model convergence, g(Δτ k ) represents the difference between the distributed gradient descent global model and the centralized gradient descent model.
[0027] In the above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network, the calculation formula of the global model parameters is:
[0028]
[0029] Among them, w k represents the global model parameters; S n is the size of the model parameters of the nth client; S is the sum of the sizes of the model parameters of all clients; N is the total number of clients; w n,k Complete the model parameters of the k-th local model training for client n.
[0030] As described above, the energy efficiency optimization method of federated learning in the mobile edge computing network, wherein the loss function of the global model is expressed as:
[0031]
[0032] Among them, f(w k ) represents the loss function of the global model; h n (w n,k ) represents the loss function of client n completing the k-th local model training.
[0033] In the above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network, the loss function in the training process is determined as follows:
[0034]
[0035] in, represents the loss function during training; w represents the model training parameters of local training; F n (w) is the loss function that satisfies the Lipschitz condition and convexity condition; represents the local model parameters of the nth client in the t-1th round in the kth iteration; μ represents the penalty term coefficient.
[0036] The beneficial effects achieved by this application are as follows:
[0037] (1) This application is aimed at mobile devices participating in federated learning model training as clients. This application reduces the consumption of communication between the device and the server by adjusting the number of local training times. This not only reduces the energy consumption during the transmission process, but also ensures the model convergence speed, thereby improving the overall training efficiency.
[0038] (2) This application takes into account the diversity and heterogeneity of client device data and improves the training process in terms of the model. This optimization helps to more efficiently utilize the computing resources of each participant, reduce redundant computing, and thus improve energy efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For those skilled in the art, other drawings can also be obtained based on these drawings.
[0040] Figure 1 This is a flowchart of a method for optimizing energy efficiency of federated learning in a mobile edge computing network according to an embodiment of the present application.
[0041] Figure 2 This is a flow chart of a method for calculating the number of local training times of each client according to an embodiment of the present application.
[0042] Figure 3 This is a flow chart of a method for calculating the convergence of a global model according to an embodiment of the present application.
[0043] Figure 4 This is a flow chart of a method for determining the number of local training times for each client according to an embodiment of the present application.
[0044] Figure 5 This is a flowchart of an implementation of an edge federated learning energy efficiency improvement algorithm for heterogeneous data in an embodiment of the present application.
[0045] Figure 6 This is a flow chart for optimizing the energy efficiency of an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0047] like Figure 1 As shown, the present application provides a method for optimizing energy efficiency of federated learning in a mobile edge computing network, the method comprising the following steps:
[0048] Step S1, input local training client parameters and perform model initialization.
[0049] Specifically, before the federated learning begins, the server and the client first initialize the model and input the local training client parameters. The input local training client parameters include the initialization model parameters, learning rate, initial mini-batch value, and the maximum number of iterations of the federated learning.
[0050] As a specific embodiment of the present invention, the set n = {1, 2, ..., N} represents all clients of federated learning. Assume that client k has a local data set D n , the local data set is Non-IID (non-independent and identically distributed), that is, each local data set has a different distribution and size. k = {1, 2, ..., K} represents the iteration round of federated learning. The number of iterations of the federated learning is not the optimization variable of the optimization problem, but the system has a limit on the number of iterations for executing tasks; represents the local model parameters of client n in the tth round of the kth iteration.
[0051] As a specific embodiment of the present invention, when k=1, the server completes the model initialization. The model initialization includes determining the learning task of federated learning and determining the machine learning model to be constructed according to the learning task. After completing the model parameter initialization, the initialized model parameter w 0 , learning rate η, and mini-batch value are sent to each client. The size (or value) of the mini-batch is a hyperparameter that determines the number of samples used in each parameter update. Choosing an appropriate mini-batch size is very important for the training effect, convergence speed, and utilization of computing resources of the model.
[0052] Step S2: After the model is initialized, the number of local training times of each client is calculated according to the data heterogeneity of each client.
[0053] Specifically, the server calculates the number of local training times for each client according to the heterogeneity of each client.
[0054] As a specific embodiment of the present invention, after the initialization of the model is completed, in order to compensate for the problem of poor effect of the global model caused by the heterogeneity of client data, the server calculates the number of local training times of each client according to the heterogeneity of each client, and distributes the calculation results to each client.
[0055] like Figure 2 As shown, according to the heterogeneity of each client, the calculation of the number of local training times of each client includes:
[0056] Step S210, determining the loss function in the local training process.
[0057] Among them, the loss function in the training process is determined as follows:
[0058]
[0059] in, represents the loss function during the training process; w represents the optimization variable; the optimization variable w is the model training parameter of the local training in this round. n (w) is the loss function that satisfies the Lipschitz condition and convexity condition; represents the local model parameters of the nth client in the t-1th round of the kth iteration; the minimization rule adds a penalty term, μ represents the penalty term coefficient, indicating the degree of participation of the penalty term in the expression, and the penalty term can solve the problem of data heterogeneity by limiting the local update to be closer to the global model. In the calculation of the number of local training times, the convergence of the global model needs to be calculated first, and its convergence is expressed as F(τ k )-F(w * ) indicates; symbol express The square of the norm.
[0060] Step S220, calculating the convergence of the global model.
[0061] As a specific embodiment of the present invention, a vector τ is defined k =[τ 1,k , τ 2,k , τ 3,k , τ 4,k , ..., τ N,k ], as the vector of the number of local training times of the client. Assume τ 1,k <τ 2,k <τ 3,k <τ 4,k <…<τ n,k , τ 0,k = 0. Define a vector Δτ k =[Δτ 1,k , Δτ 2,k , Δτ 3,k , Δτ 4,k , ..., Δτ n,k ], where Δτ n,k =τ n,k -τ n-1,k .
[0062] As a specific embodiment of the present invention, a set M={D1, D2, ..., D N}; D1 in set M means all participants τ 1,k The client set of rounds; Set D2 is all the clients participating in τ 2,k The client set for round training. Take any element D n ∈M, meaning to participate in τ n,k The set of clients for training rounds.
[0063] like Figure 3 As shown, step S220 includes the following steps:
[0064] Step S221, calculating the difference between the distributed gradient descent global model and the centralized gradient descent model.
[0065] Specifically, using Δτ k Vector, calculate the difference (gap) between the distributed gradient descent global model and the centralized gradient descent model. Vector Δτ k =[Δτ 1,k , Δτ 2,k , Δτ 3,k , Δτ 4,k , ..., Δτ n,k ], Δτ n,k=τ n,k -τ n-1,k .
[0066] Among them, the calculation formula for the difference between the distributed gradient descent global model and the centralized gradient descent model is as follows:
[0067]
[0068] Among them, g(Δτ k ) represents the difference between the distributed gradient descent global model and the centralized gradient descent model; N represents the total number of clients; η represents the learning rate; β satisfies the local loss function F n (w) is Lipschitz smooth; β represents the loss function F n The smoothness of (w); the loss function F n (w) satisfies the Lipschitz smoothness condition; β satisfies For any n and any w, define δ n for The upper bound of The norm of the difference between the gradient of the global loss function and the gradient of the loss function of the nth client; δ i for The upper bound of ; μ represents the penalty term coefficient; P and Q are parameters, which are two parameters in deriving the difference between the central gradient descent model and the distributed gradient descent global model. Δτ i,k is the vector Δτ k The nth element of is the number of local training times of the nth client.
[0069] Step S222, deriving the convergence upper bound of the global model based on the difference between the distributed gradient descent global model and the centralized gradient descent model.
[0070] Specifically, the convergence upper bound of the global model is expressed as F(τ k )-F(w * )express.
[0071]
[0072] Among them, a and b are the parameters of the upper bound of the global model convergence, g(Δτ k ) is the variable Δτ k The function of g(Δτ k ) represents the difference between the distributed gradient descent global model and the centralized gradient descent model.
[0073] Step S230, determining the number of local training times for each client according to the impact of the client on the convergence of the global model.
[0074] Specifically, due to the heterogeneity of the clients, the number of local training times for each client will be determined based on the impact of the client on the convergence of the global model. Since the number of local training times for the clients is not necessarily the same, when the optimization problem is solved to obtain a τ 1,k When τ 1,k The value of is τ k The smallest vector means that all clients need to train at least τ 1,k rounds, so D1 in the set M means all participants τ 1,k Similarly, due to the solution of the optimization problem, τ 2,k , set D2 is all the participants τ 2,k The client set of round training. So take any element D n ∈M, meaning to participate in τ n,k The set of clients for training rounds.
[0075] like Figure 4 As shown, step S230 includes the following steps:
[0076] Step S231, defining the optimization problem and optimization variables.
[0077] The optimization variables are the number of local training times of each client and the frequency of client training.
[0078] The optimization problem is:
[0079]
[0080] Where YH represents the optimization problem; a and b are the parameters of the upper bound of the global model convergence; γ n Indicated in Δτ n,k When training locally within the range, D n The computational energy consumed by all clients in the set; Δτ n,k Indicates the number of local training times of the nth client; f n Indicates the task calculation frequency of the nth client; P n,k S represents the power transmitted by the nth client in the kth round; n Indicates the size of the model parameters of the nth client; C n represents the channel bandwidth from the nth client to the server; f represents the task calculation frequency of the client; τ k Indicates the number of local training times of the client; P k Indicates the power transmitted by the client.
[0081] As a specific embodiment of the present invention, the optimization problem is constrained as follows:
[0082] First constraint: Constraint Represents the limit on the entire local training time, represents the cumulative client computing time of the kth round of local training, T cal Indicates the maximum limit of local training time. The number of local training times can be limited by a local training time.
[0083] The second constraint, Indicates that the communication duration of the entire system is limited. represents the cumulative client communication time of the kth round of local training, T com Indicates the maximum communication duration limit; thereby limiting the number of global iterations.
[0084] The third constraint, constraint 0 <f n,k ≤f n,max , 0 <P n <P n,max , τ n,k ≥0 is the constraint of the three optimization variables of the optimization objective; f n,k represents the task calculation frequency of the kth round of local training on the nth client; f n,max Indicates the maximum allowed value of the calculation frequency of the nth client task; P n,max Indicates the maximum power allowed for the transmission of the nth client; P n represents the power transmitted by the nth client; τ n,k Indicates the kth local training number of the nth client.
[0085] Step S232, dividing the optimization problem into two sub-problems, optimizing the two sub-problems, and obtaining the values of the optimization variables of the two sub-problems.
[0086] Specifically, the optimization problem is divided into two sub-problems according to the local training part and the system communication part. The two sub-problems are respectively the first sub-problem and the second sub-problem.
[0087] As a specific embodiment of the present invention, the optimization goal of the first sub-problem is as follows:
[0088]
[0089] Where Z1 represents the first subproblem; a and b are the parameters of the upper bound of the global model convergence; γ n (Δτ n,k , f n ) represents the n,k When training locally within the range, D n The local training computation energy loss of all clients in the set; Δτ n,k Indicates the number of local training times of the nth client; f nIndicates the task calculation frequency of the nth client.
[0090] For each client, define a vector f = [f1, f2, f3, f4, ..., f n ] is the task calculation frequency for the nth client participating in federated learning. Definition is the coefficient between power and frequency. Define t n The time required for the nth client to execute one round is the total time required for the client to calculate the Kth round of local training. then
[0091] The calculation formula for the energy loss of the k-th round of local training of all clients is:
[0092]
[0093] in, represents the energy consumption of the k-th round of local training for all clients; represents the sum of the computation time of the nth client in the kth round of local training; Represents the coefficient between power and frequency; f n Indicates the task calculation frequency of the nth client.
[0094] The calculation formula for the local training calculation energy loss of all clients in all training rounds is as follows:
[0095]
[0096] Among them, γ n (Δτ n,k , f n ) represents the n,k When training locally within the range, D n The local training computation energy loss of all clients in the set (that is, the computation energy consumed by all clients). Δτ n,k Represents the number of local training times of the nth client; define π n is a unit of work, and defines The time for client n to complete one unit of work; Represents the coefficient between power and frequency; f n Indicates the task calculation frequency of the nth client.
[0097] As a specific embodiment of the present invention, the optimization goal of the second sub-problem is as follows:
[0098]
[0099] Among them, Z2 represents the second sub-problem; P n,k S represents the power transmitted by the nth client in the kth round; n Indicates the size of the model parameters of the nth client; C n Indicates the channel bandwidth from the nth client to the server; Indicates the minimum value of P k (The power transmitted by the client).
[0100] The client's communication data includes the power transmitted by the client, etc. n is the size of the model parameter of the nth client, and the transmission power vector of N clients at the kth global aggregation is defined as P k , represents the power P transmitted by each client k = {P 1,k , P 2,k , P 3,k , P 4,k ,…,P n,k}.
[0101] Among them, the calculation formula for the communication energy loss of the kth round of local training of all clients is:
[0102]
[0103] in, represents the communication energy loss of all clients in the kth round of local training; P n,k represents the power transmitted by client n after completing the kth local model training; C n is the channel bandwidth from client n to the server, which is a function of the transmit power; S n Indicates the size of the model parameters of the nth client.
[0104] It should be explained that the first sub-problem is to optimize the local training part of the system, which is τ k and f are convex functions, so we can directly use KKT conditions to solve it. The second sub-problem is to optimize the communication part of the system, and we can directly use the method of taking the derivative and finding the maximum value to get the optimal value.
[0105] As a specific embodiment of the present invention, in the local model training module, each client uses the optimization method of mini-batch stochastic gradient descent (MGD) to update the parameter vector The MGD method divides the local dataset Dn into batches B and performs k local iterations.
[0106]
[0107] in, represents the gradient of the loss function of the local model training completed by client n in the t-1th round in the kth iteration; η represents the learning rate.
[0108] As a specific embodiment of the present invention, the system energy loss is calculated based on the communication energy loss and the local training calculation energy loss. The system energy loss is the sum of the communication energy loss and the local training calculation energy loss. It should be explained that the accuracy of the global model needs to meet the preset requirements. The accuracy of the global model generally refers to the accuracy of the model in the prediction or classification task.
[0109] This application considers the data heterogeneity problem of federated learning, analyzes the convergence bound of the global model, takes the number of local training times of the client as the optimization variable, and considers reducing the system energy loss problem, and solves the optimization problem of this application through the KKT condition. The entire system can save system energy on the premise that the global model meets the accuracy requirements. Reducing system energy loss will improve energy efficiency or energy utilization efficiency to a certain extent.
[0110] Step S3, performing local model training respectively according to the number of local training times of each client, and obtaining model parameters after local model training.
[0111] Specifically, each client performs local model training on each client according to the calculated number of local training times, obtains model parameters after local model training, and uploads the obtained model parameters to the server.
[0112] Step S4, performing global model aggregation according to the model parameters after local model training to obtain global model parameters.
[0113] Specifically, the server performs global model aggregation based on the model parameters after local model training to obtain the global model parameters.
[0114] As a specific embodiment of the present invention, in the global model aggregation module, define w n,k The model parameters for the kth local model training completed for client n, w k is a global model parameter. Definition
[0115] As a specific embodiment of the present invention, the calculation formula of the global model parameter is:
[0116]
[0117] Among them, w k represents the global model parameters; S n is the size of the model parameters of the nth client; S is the sum of the sizes of the model parameters of all clients; N is the total number of clients.
[0118] As a specific embodiment of the present invention, the loss function of the global model is expressed as:
[0119]
[0120] Among them, f(w k ) represents the loss function of the global model; h n (w n,k ) represents the loss function of client n completing the k-th local model training.
[0121] Step S5, testing the global model according to the global model parameters. If a client fails to achieve the expected accuracy or fails to reach the maximum number of iterations of federated learning, the next iteration of federated learning is started; otherwise, each client stops local model training and the federated learning process ends.
[0122] The purpose of the present invention is to solve the problem that in the process of federated learning of heterogeneous data, the number of local training times and communication energy of the client are not optimized, resulting in excessive energy loss and low energy efficiency in the scenario where the client data is heterogeneous and energy is limited. By finding the convergence bound of the global model and adjusting the number of local training times and transmitter power of the client, the energy loss can be reduced and the energy efficiency of the entire system can be improved.
[0123] As a specific embodiment of the present invention, a scenario assumption is made: the set n = {1, 2, ..., N} represents all clients of federated learning, and the local data set of client n is D n , the number of local iterations of local model training is t, and the learning rate is η. Let k = {1, 2, ..., K} represent the number of parameter uploads for federated learning.
[0124] like Figure 5 As shown, the implementation process of the edge federated learning energy efficiency improvement algorithm for heterogeneous data in the embodiment of the present application includes the following process steps:
[0125] Step 101: The process starts;
[0126] Among them, the process begins by first determining all clients and servers participating in federated learning;
[0127] Step 102: Model initialization;
[0128] Among them, the model initialization needs to initialize the model parameters ω 0 , learning rate η, mini-batch value, number of local iterations, and maximum iteration round K of federated learning;
[0129] Step 103: Calculate the number of local training times of the client at the server end;
[0130] Step 104: Each client performs local model training;
[0131] Step 105: The client uploads parameters to the server;
[0132] Step 106: Determine whether the global model has reached a preset convergence accuracy or a maximum number of iterations;
[0133] Step 107: If the preset accuracy is not reached and the number of iterations is less than the maximum number of iterations, the number of iterations is increased by 1;
[0134] Step 108: The process ends.
[0135] In step 103, the server needs to solve the optimization problem to solve the number of local trainings of the client, the training frequency of the client and the transmitter power.
[0136] like Figure 6 The figure shows the energy efficiency optimization implementation process of the embodiment of the present application, and the specific process is as follows:
[0137] Step 202: Use the result of step 102 or the result after local training as input.
[0138] Step 203: Optimize the problem according to the pre-construction.
[0139] Step 204: Solve the optimization problem using KKT conditions.
[0140] Step 205: Output the obtained result.
[0141] Steps 103, 104, 105 and 106 are continuously iterated until all clients reach convergence accuracy or the maximum number of iterations is reached.
[0142] The present application also provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the address mapping method of the large-capacity solid-state hard disk. The computer storage medium contains one or more program instructions, and the one or more program instructions are used by the processor to execute a method for optimizing energy efficiency of federated learning in a mobile edge computing network.
[0143] The embodiments disclosed in the present invention provide a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed on a computer, the computer executes the above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network.
[0144] An embodiment of the present invention provides a processor for processing the above-mentioned method for optimizing energy efficiency of federated learning in a mobile edge computing network.
[0145] In the embodiment of the present invention, the processor may be an integrated circuit chip having the ability to process signals. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0146] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.
[0147] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0148] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DRRAM).
[0149] The beneficial effects achieved by this application are as follows:
[0150] (1) This application is aimed at mobile devices participating in the training process of federated learning models as clients. The method of this application reduces the consumption of communication between the device and the server by adjusting the number of local training times. This not only reduces the energy consumption during the transmission process, but also ensures the model convergence speed, thereby improving the overall training efficiency.
[0151] (2) This application takes into account the diversity and heterogeneity of client device data and improves the training process in terms of the model. This optimization helps to more efficiently utilize the computing resources of each participant, reduce redundant computing, and thus improve energy efficiency.
[0152] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.
[0153] In the description of the present application, the word "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in the present application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0154] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for optimizing energy efficiency of federated learning in mobile edge computing networks, It is characterized in that The method includes: Enter the local training client parameters and perform model initialization; After the model is initialized, the number of local training times for each client is calculated based on the data heterogeneity of each client. According to the number of local training times of each client, local model training is performed respectively to obtain model parameters after local model training; According to the model parameters after local model training, global model aggregation is performed to obtain global model parameters; The global model is tested according to the global model parameters. If a client fails to achieve the expected accuracy or the maximum number of iterations of federated learning, the next round of iteration of federated learning will be started; otherwise, each client stops local model training and the federated learning process ends.
2. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 1, It is characterized in that Model initialization includes determining the learning tasks of federated learning and determining the machine learning model that needs to be built based on the learning tasks.
3. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 1, It is characterized in that According to the heterogeneity of each client, the calculation of the number of local training times of each client includes: Determine the loss function during local training; Compute the convergence of the global model; The number of local training times for each client is determined based on the impact of the client on the convergence of the global model.
4. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 3, It is characterized in that Computing the convergence of the global model involves: Calculate the difference between the distributed gradient descent global model and the centralized gradient descent model; According to the difference between the distributed gradient descent global model and the centralized gradient descent model, the convergence upper bound of the global model is derived.
5. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 3, It is characterized in that Based on the impact of the client on the convergence of the global model, the number of local training times for each client is determined as follows: Define the optimization problem and optimization variables. The optimization variables are the number of local trainings of each client and the frequency of client training. The optimization problem is divided into two sub-problems, the two sub-problems are optimized, and the values of the optimization variables of the two sub-problems are obtained.
6. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 5, It is characterized in that The optimization problem is: Where YH represents the optimization problem; a and b are the parameters of the upper bound of the global model convergence; g(Δτ k ) represents the difference between the distributed gradient descent global model and the centralized gradient descent model: N represents the total number of clients; γ n (Δτ n,k , f n ) represents the n,k The computational energy consumed by all clients during local training within the range; Δτ n,k Indicates the number of local training times of the nth client; f n Indicates the task calculation frequency of the nth client; P n,k S represents the power transmitted by the nth client in the kth round; n Indicates the size of the model parameters of the nth client; C n Indicates the channel bandwidth from the nth client to the server.
7. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 4, It is characterized in that The convergence upper bound of the global model is expressed as F(τ k )-F(w * )express; Among them, a and b are the parameters of the upper bound of the global model convergence, g(Δτ k ) represents the difference between the distributed gradient descent global model and the centralized gradient descent model.
8. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 1, It is characterized in that The calculation formula of the global model parameters is: Among them, w k represents the global model parameters; S n is the size of the model parameters of the nth client; S is the sum of the sizes of the model parameters of all clients; N is the total number of clients; W n,k Complete the model parameters of the k-th local model training for client n.
9. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 8, It is characterized in that The loss function of the global model is expressed as: Among them, f(w k ) represents the loss function of the global model; h n (w n,k ) represents the loss function of client n completing the k-th local model training.
10. The method for optimizing energy efficiency of federated learning in a mobile edge computing network according to claim 3, It is characterized in that The loss function during training is determined as follows: in, represents the loss function during training; w represents the model training parameters of local training; F n (w) is the loss function that satisfies the Lipschitz condition and convexity condition; represents the local model parameters of the nth client in the t-1th round in the kth iteration; μ represents the penalty term coefficient.
Citation Information
Cited By
Federal learning acceleration method and device, server and medium
CN120124715A
A method, device, server, and medium for accelerating federated learning
CN120124715B
