Segmentation federal learning model training method based on heterogeneous system

By personalizing the global model and parallel training in segmentation learning, the problem of inefficient training in heterogeneous devices is solved, and efficient model training of heterogeneous systems is realized.

CN119312947AActive Publication Date: 2025-01-14BEIJING UNIV OF POSTS & TELECOMM

Patent Information

Application Number
CN202411728336.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-01-14
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

Due to its serial training method, the existing segmented learning framework has low training efficiency. When heterogeneous edge devices run the same client model, the slowest devices will slow down the training efficiency of the entire system due to differences in computing and communication resources. .

Method used

By segmenting the global model into client local model and server local model based on the device conditions of each client, and performing it in parallel in each round of training, the optimal segmentation point is determined using historical data to minimize the total training delay, dynamically adjust Batch size of small batch data, optimized calculation frequency and transmission power.

Benefits of technology

It realizes personalized segmentation that adapts to heterogeneous equipment conditions, reduces the computing burden, improves the model training efficiency of heterogeneous systems, and improves the computing efficiency of the overall system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312947A_ABST
    Figure CN119312947A_ABST
Patent Text Reader

Abstract

The invention discloses a segmentation federal learning model training method based on a heterogeneous system. The system comprises a plurality of clients, a central server and an edge server. The global model segments the client local model and the server local model based on each client device condition and deploys to corresponding clients and central servers, respectively. And in each round of training, the client performs parallel training, forwards propagates local data, outputs crushed data, transmits the crushed data to the server local model of the central server, continuously forwards propagates to obtain a loss value, and backwards propagates a gradient to update parameters of the server local model and the client local model. And each client transmits the updated model to the edge server, and the edge server and the central server complete parameter exchange of a public layer and then perform model gathering to generate a global client model and a global server model. The global client model distributes client local models to the clients according to each client break point. The method can adapt to equipment conditions of heterogeneous equipment, and the model training efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distributed systems and split federated learning, and in particular to a split federated learning model training method based on a heterogeneous system. Background Art

[0002] In the field of artificial intelligence and the Internet of Things, data communication and collaborative computing between smart devices are widely used. In this context, distributed learning architectures have emerged, especially federated learning (FL) and segmented learning (SL), which have become key ways to help resource-constrained devices achieve efficient model training. Segmented learning cleverly divides the model into two parts, the client and the server, avoiding the transmission of original data, thereby protecting user privacy, and significantly reducing the computing burden of the device, thereby improving the computing efficiency of the entire distributed system.

[0003] The current segmentation learning framework faces the problem of low training efficiency due to its serial training method. At the same time, when heterogeneous edge devices run the same client model, due to the differences in computing and communication resources of different devices, the slowest device will slow down the training efficiency of the entire system. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a segmented federated learning model training method based on a heterogeneous system, which personalizes the segmentation of the client model by adapting to the conditions of the client device, thereby reducing the computing burden of the heterogeneous device and improving the model training efficiency of the heterogeneous system.

[0005] One aspect of the present invention provides a method for training a segmented federated learning model based on a heterogeneous system, wherein the heterogeneous system includes multiple clients, a central server and an edge server; a global model is segmented into a client local model adapted to each client and a corresponding server local model based on the device condition of each client; the client local model is used to be deployed on the corresponding client, and the server local model is used to be deployed on the central server; wherein the device condition of each client includes the device storage resources, computing frequency and channel condition of the client, and the optimal segmentation point for each client to segment the global model is determined based on the device condition of each client using the historical data of the operation of the heterogeneous system with the goal of minimizing the total training delay; the training method comprises the following steps:

[0006] In each round of training, all clients execute the training of the client local model in parallel, and the client local model deployed on each client performs forward calculation using the training sample set constructed by each client local data, and outputs crushed data;

[0007] Each client transmits the crushed data and the label of the training sample set to the server local model of the central server for forward calculation, and outputs a predicted value; based on the predicted value and the label, the loss value corresponding to each client is calculated;

[0008] Calculate the gradient of the output layer of each server local model according to the loss value, back-propagate the gradient in the server local model, obtain the gradient of the crushed data and transmit it back to the corresponding client;

[0009] The client local model of each client back-propagates the gradient of the crushed data to update the parameters of the client local model;

[0010] After all client local models are updated, all updated client local models are transmitted to the edge server;

[0011] The network layer in the global model that contains the corresponding segmentation point position of all clients in the global model is set as a common layer; the edge server collects the parameters related to the common layer in all updated client local models, and the central server collects the parameters related to the common layer in all server local models after back propagation, and the parameters of the common layer collected by both sides are exchanged; the edge server aggregates all client local models after information exchange to obtain a global client model; the central server aggregates all server local models after information exchange to obtain a global server model;

[0012] The edge server divides the global client model into division points of the global model for each client, and distributes the client local model to the corresponding client.

[0013] In some embodiments of the present invention, the method further comprises:

[0014] In each round of training, the training sample set of each client is divided into multiple small batches of data, and the small batch gradient descent algorithm is used to iteratively update the parameters of this round of training.

[0015] In some embodiments of the present invention, the batch size of the small batch data is set as follows:

[0016] Set the minimum batch size and maximum batch size of small batch data; when dividing the training sample set each time for training, dynamically adjust the batch size between the minimum batch size and the maximum batch size according to the current computing power and channel conditions of each client; the batch size of small batch data is positively correlated with the computing power and the quality of channel conditions.

[0017] In some embodiments of the present invention, the optimal segmentation point for each client to segment the global model is determined with the goal of minimizing the total training delay, which is based on optimizing the single-round training delay of each client, and the single-round training delay of each client is:

[0018]

[0019] in, represents the forward propagation delay of the client local model, represents the amount of forward propagation calculation, f k represents the computation frequency of the client, κ k Indicates the computing density of the client;

[0020] represents the pulverized data transmission delay, bξ s (l k ) indicates the size of the crushed data, Indicates the uplink transmission rate from the client to the central server;

[0021] represents the forward propagation delay of the model on the central server, represents the computation frequency assigned by the central server to client k, κ s Indicates the computing density of the central server;

[0022] Represents the model back propagation delay on the central server;

[0023] Denotes the gradient return delay, bξ g (l k ) represents the gradient size of the crushing data;

[0024] represents the back propagation delay of the client local model;

[0025] represents the delay of transmitting the local model from the client to the edge server, ξ m (l k ) represents the client local model size, Indicates the uplink transmission rate from the client to the edge server;

[0026] represents the time delay of the edge server distributing the client local model;

[0027] N represents the number of small batches of data into which the training sample set is divided, which is obtained by dividing the training sample set by the batch size of the small batch data.

[0028] In some embodiments of the present invention, before each round of training, the method further comprises:

[0029] Based on the local model of each client determined by the optimal split point, with the goal of minimizing the total training delay, the optimal computing frequency assigned to each client by the central server, the optimal uplink and downlink transmission power from each client to the central server, and the optimal uplink and downlink transmission power from each client to the edge server are determined.

[0030] In some embodiments of the present invention, the edge server aggregates to obtain a global client model, and the central server aggregates to obtain a global server model by weighting the parameters of each layer of the model using the proportion of each client's local data volume to the total data volume of all clients as a weight to obtain the aggregated model parameters.

[0031] In some embodiments of the present invention, the method further comprises:

[0032] In a single training round, the edge server periodically sends a signal to each client to confirm the online status of each client. If no reply information is received within a preset time, the client is marked as abnormal.

[0033] For a client marked as being in an abnormal state in the current training round, the edge server gives up waiting for the client to transmit an updated client local model, and only aggregates all client local models except those in the abnormal state.

[0034] In some embodiments of the present invention, encrypted data transmission is performed between the client and the edge server and the central server.

[0035] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of any of the above methods when executed by a processor.

[0036] Another aspect of the present invention further provides a computer program product, comprising a computer program / instruction, which implements the steps of any of the above methods when executed by a processor.

[0037] The beneficial effects of the present invention are at least:

[0038] The present invention discloses a method for training a segmented federated learning model based on a heterogeneous system, the system comprising a plurality of clients, a central server and an edge server. The global model segments the client local model and the server local model based on the conditions of each client device and deploys them to the corresponding client and central server respectively. In each round of training, the clients are trained in parallel, the local data is forward propagated to output the crushed data and transmitted to the server local model of the central server, and the server local model continues to forward propagate to obtain the loss value, and then back-propagates the gradient to update the parameters of the server local model and the client local model. Each client transmits the updated model to the edge server, and the edge server and the central server complete the parameter exchange of the common layer and then perform model aggregation to generate a global client model and a global server model. The global client model distributes the client local model to the client according to each client segmentation point. The present invention performs personalized segmentation of the client model by adapting to the conditions of the client device, reduces the computational burden of the heterogeneous device, and improves the model training efficiency of the heterogeneous system.

[0039] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0040] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0042] Figure 1 This is a flow chart of a method for training a segmented federated learning model based on a heterogeneous system in one embodiment of the present invention.

[0043] Figure 2 This is a diagram of a heterogeneous segmentation federated training framework in another embodiment of the present invention.

[0044] Figure 3 This is a delay structure diagram of heterogeneous split federated training in another embodiment of the present invention.

[0045] Figure 4 This is a call relationship diagram of a resource optimization algorithm in another embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0047] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0048] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0049] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0050] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0051] Federated learning is a distributed machine learning method that allows multiple participants (such as devices or organizations) to jointly train a global model without sharing their local data. Each participant uses its own local data for model training and sends updates (such as weight adjustments) to a central server without directly transmitting data.

[0052] Split learning is a distributed learning approach that divides the model into two parts: the front end and the back end. The front end model is executed locally on the client, while the back end model runs on a central server. The client calculates the output of the front end model from the input data, and then sends that output (instead of the original data) to the server, which continues processing to generate the final prediction.

[0053] An embodiment of the present invention provides a method for training a segmented federated learning model based on a heterogeneous system, wherein the heterogeneous system includes multiple clients, a central server, and an edge server. The global model is segmented into a client local model adapted to each client and a corresponding server local model based on the device conditions of each client. The client local model is used to be deployed on the corresponding client, and the server local model is used to be deployed on the central server. The device conditions of each client include the client's device storage resources, computing frequency, and channel conditions. The optimal segmentation point for segmenting the global model of each client is determined based on the device conditions of each client using the historical data of the operation of the heterogeneous system and with the goal of minimizing the total training delay. Figure 1 As shown, the training method includes the following steps S101 to S107:

[0054] Step S101: During each round of training, all clients execute the training of the client local model in parallel. The client local model deployed on each client performs forward calculation using the training sample set constructed by each client's local data to output crushed data.

[0055] Step S102: Each client transmits the crushed data and the label of the training sample set to the server local model of the central server for forward calculation and outputs the predicted value. The loss value corresponding to each client is calculated based on the predicted value and the label.

[0056] Step S103: Calculate the gradient of the output layer of each server local model according to the loss value, back-propagate the gradient in the server local model, obtain the gradient of the crushed data and transmit it back to the corresponding client.

[0057] Step S104: The client local model of each client back-propagates the gradient of the crushed data to update the parameters of the client local model.

[0058] Step S105: After all client local models are updated, all updated client local models are transmitted to the edge server.

[0059] Step S106: The network layer in the global model that contains the corresponding split point position of all clients in the global model is set as the common layer. The edge server collects the parameters related to the common layer in all updated client local models, and the central server collects the parameters related to the common layer in all server local models after back propagation, and exchanges information on the common layer parameters collected by both sides. The edge server aggregates all client local models after information exchange to obtain a global client model. The central server aggregates all server local models after information exchange to obtain a global server model.

[0060] Step S107: The edge server divides the global client model into segments according to the segmentation points of the global model for each client, and distributes the client local model to the corresponding client.

[0061] The best segmentation point for each client to segment the global model is determined with the goal of minimizing the total training delay. During the solution process, when the best segmentation point solved by the client does not satisfy the feasible solution, the client will not be selected in the training.

[0062] Among them, shredded data is the intermediate result or feature representation generated by processing the local original data of the training sample set through the client local model. This processing helps to protect privacy while retaining useful information for model training.

[0063] The global client model is equivalent to the set of client local models, and the global server model is equivalent to the set of server local models, both of which include a common layer. The client local model and the server local model that match each other are combined into a global model.

[0064] In some embodiments of the present invention, the method further comprises:

[0065] In each round of training, the training sample set of each client is divided into multiple small batches of data, and the small batch gradient descent algorithm is used to iteratively update the parameters of this round of training.

[0066] In some embodiments of the present invention, for small batches of data, the batch size is set as follows:

[0067] Set the minimum and maximum batch sizes for mini-batch data. Each time you divide the training sample set for training, dynamically adjust the batch size between the minimum and maximum batch sizes based on the current computing power and channel conditions of each client. The batch size of mini-batch data is positively correlated with the computing power and the quality of the channel conditions.

[0068] For example, the quantized values ​​of the current computing power and channel conditions of each client in this round of training are obtained, and the batch size is calculated within the range of the minimum batch size and the maximum batch size using a linear interpolation or weighted average algorithm.

[0069] In some embodiments of the present invention, the optimal segmentation point for segmenting the global model for each client is determined with the goal of minimizing the total training delay, which is based on optimizing the single-round training delay of each client. The single-round training delay of each client is:

[0070]

[0071] in, represents the forward propagation delay of the client local model, represents the amount of forward propagation calculation, f k represents the computation frequency of the client, κ k Indicates the computing density of the client;

[0072] represents the delay of data transmission, bξ s (l k ) indicates the size of the crushed data, Indicates the uplink transmission rate from the client to the central server;

[0073] represents the forward propagation delay of the model on the central server, represents the computation frequency assigned by the central server to client k, κs Indicates the computing density of the central server;

[0074] Represents the model back propagation delay on the central server;

[0075] Denotes the gradient return delay, bξ g (l k ) represents the gradient size of crushed data;

[0076] Represents the back propagation delay of the client local model;

[0077] represents the delay of transmitting the local model from the client to the edge server, ξ m (l k ) represents the client local model size, Indicates the uplink transmission rate from the client to the edge server;

[0078] represents the time delay of edge server distributing client local model;

[0079] N represents the number of small batches of data into which the training sample set is divided, which is obtained by dividing the training sample set by the batch size of the small batch data.

[0080] Among them, F stands for forward, B stands for backward, U stands for upload, and D stands for download. m The m means model, ξ g The g in it stands for gradients and has no other special meaning.

[0081] In some embodiments of the present invention, before each round of training, the method further comprises:

[0082] Based on the local model of each client determined by the optimal split point, the optimal computing frequency assigned to each client by the central server, the optimal uplink and downlink transmission power of each client to the central server, and the optimal uplink and downlink transmission power of each client to the edge server are determined with the goal of minimizing the total training delay.

[0083] In some embodiments of the present invention, edge servers are aggregated to obtain a global client model, and central servers are aggregated to obtain a global server model by weighting the parameters of each layer of the model using the proportion of each client's local data volume to the total data volume of all clients as the weight to obtain the aggregated model parameters.

[0084] In some embodiments of the present invention, the method further comprises:

[0085] In a single training round, the edge server periodically sends a signal to each client to confirm the online status of each client. If no reply message is received within a preset time, the client is marked as abnormal.

[0086] For clients marked as abnormal in the current training round, the edge server gives up waiting for the client to transmit the updated client local model and only aggregates all client local models except those in abnormal state.

[0087] In some embodiments of the present invention, encrypted data transmission is performed between the client and the edge server and the central server.

[0088] Furthermore, the encrypted data transmission may be encrypted using a symmetric key or an asymmetric key. A hash function may also be used to verify the transmitted data to detect whether the data has been tampered with during the transmission process.

[0089] Another embodiment of the present invention provides a method for training a segmented federated learning model based on a heterogeneous system. Figure 2 As shown in the figure, the implementation of this training method is based on the HSFL (Heterogeneous Split Federated Learning) framework, which includes a group of clients k∈{1,2,…,K}, a main server (MS) and an edge server (ES), where the main server is the central server. MS is responsible for the calculation of all server-side models, and ES is responsible for the aggregation and distribution of client models. Each user has a private dataset Where: x k,i Represents the original data, y k,i Represents the corresponding label, |D k | represents the size of the data set. The data set of all users is In order to allow all resource-constrained users to participate in training, each user k∈K needs to have a suitable cutting layer l k To make full use of its equipment resources and prevent falling behind in training.

[0090] By k The layer segmentation global model W is the client model deployed on the user device and the server-side model deployed on MS To allow all users to collaborate with MS to complete parallel model training. When all users have completed the training task, ES and MS will complete the model aggregation together for the next round of training. Specifically, the workflow of HSFL can be divided into three stages. Let the training task require A training rounds, and the set of all training rounds is A. In training round a, the workflow is as follows:

[0091] 1. Forward propagation stage:

[0092] At this stage, users perform forward propagation using private datasets in parallel, which consists of the following three steps:

[0093] 1-i Client forward calculation: HSFL uses a small batch gradient descent method, using a small batch of data B for each training k ={X k ,y k} to iterate. Each user executes the client model in parallel using small batches of data Get the model output S k ,Right now Where f() represents the network function of the model.

[0094] 1-ii Crushing data transmission: After completing the client forward calculation, the client will S k and the corresponding label y k Transmit to MS.

[0095] 1-iii Server-side forward calculation: MS uses S k As the input of the server-side model, complete the rest of the forward propagation and get the model's prediction value Then combine the label y k Calculate the average loss for this mini-batch Where b is the mini-batch size and H() represents the cross entropy loss function.

[0096] 2. Back propagation stage:

[0097] At this stage, the MS and the user use the calculated loss to update the model parameters, similar to the forward propagation, which also has three steps:

[0098] 2-i Server-side reverse calculation: Given the loss l(B k ; W k,a ), calculate the gradient MS uses η as the learning rate to update the server-side model

[0099] 2-ii Gradient transmission: After the server-side model completes back propagation, the crushed data S is obtained k The gradient is then sent back to the corresponding client.

[0100] 2-iii Client reverse calculation: The client updates the client model after receiving the feedback gradient

[0101] The above forward propagation and back propagation will be repeated N times, exhausting all the mini-batch data of the dataset to ensure that the local dataset is fully utilized.

[0102] 3. Synchronous aggregation stage:

[0103] In the HSFL framework, different clients can choose their own cutting layers, resulting in different model parameters for each user. Synchronous aggregation exchanges common layer parameters through an additional communication step, aggregates local updates from different clients, and generates a new global model, ensuring that no matter what cutting layer the client chooses, the updates on the common layer of the aggregated global model are consistent.

[0104] In this phase, ES and MS collaborate to aggregate these updated models to form new global client and server models as the initial models for the next round of training. This phase is also divided into three steps:

[0105] 3-i Client model upload: After all users complete their respective training, they upload the updated model to ES. In order to achieve synchronous aggregation, this step may cause waiting idle time between users.

[0106] 3-ii Federated aggregation: ES and MS are responsible for the federated aggregation of all client models and server models to obtain a global model for the next round of training. Due to different cutting layers, the client models and server models of different users are heterogeneous, and the FedAvg method cannot be used directly. Therefore, L com Represents the common layer of the client model and the server model. ES and MS need to exchange their respective L com The parameters of the heterogeneous model are used to complete the homogeneous model, and then the local data volume of the user is calculated according to the proportion of the local data volume of the user. The weights are used for weighted averaging to obtain a new round of global client and server models.

[0107] 3-iii Model distribution: After the aggregation is completed, ES will distribute the corresponding client model according to the user's cutting layer. This round of training is over.

[0108] like Figure 3 As shown in the figure, the training latency of HSFL (Heterogeneous Split Federated Learning) consists of:

[0109] 1-i: The forward propagation delay of the client model is:

[0110] in, represents the amount of computation required for forward propagation (FLOPs), which is consistent with the number of cut layers l k Related. k , κ k They represent the user's computing frequency and computing density respectively.

[0111] 1-ii: The transmission delay of crushed data is:

[0112] Among them, bξ s (l k ) represents the size of the crushed data (bits), Indicates the uplink transmission rate from user to MS.

[0113] 1-iii: The forward propagation delay of the server-side model is:

[0114] in, represents the computation frequency assigned by MS to user k, κ s represents the calculated density of MS.

[0115] 2-i: The back propagation delay of the server-side model is:

[0116] 2-ii: Gradient return delay is:

[0117] Among them, bξ g (l k ) represents the gradient size of the crushed data.

[0118] 2-iii: The back propagation delay of the client model is:

[0119] 3-i: Client model upload delay

[0120] Among them, ξ m (l k ) represents the client model size (bits), Indicates the uplink transmission rate from the user to the ES.

[0121] 3-ii: Since the aggregation calculation only involves a simple method of summing and averaging, its delay is ignored. At the same time, it is assumed that the communication between ES and MS can be carried out efficiently through the power grid, so the delay of Lp transmission can also be ignored.

[0122] 3-iii: Client model distribution delay is:

[0123] Among them, F stands for forward, B stands for backward, U stands for upload, and D stands for download. m The m means model, ξ g The g in it stands for gradients and has no other special meaning.

[0124] In summary, the total delay of HSFL in each training round is:

[0125]

[0126] Therefore, the total delay of a training task in the HSFL framework is According to the above analysis of the delay of training tasks, at the computing level, the cutting layer and computing power will directly affect the computing load and computing speed respectively, and thus affect the training delay. At the transmission level, the number of wireless channels allocated to the client and the transmission power also determine the transmission delay of the intermediate data (crushed data and gradients).

[0127] Therefore, the total delay can be expressed as a function of the following variables:

[0128] Cutting layer allocation: l = {l1,l2,...,l K};

[0129] MS calculates frequency allocation:

[0130] Communication resource allocation: Each element represents the uplink / downlink transmission power allocated to the user to the MS or ES.

[0131] Therefore, the objective function based on the total delay can be obtained:

[0132]

[0133] Among them, C1 limits the selection range of the cutting layer; C2 and C3 indicate that the MS computing frequency allocation cannot exceed the MS's maximum computing frequency; C4 and C5 indicate the transmission power limit.

[0134] For this NP-hard (non-deterministic polynomial difficulty) optimization problem, the user's storage resources remain basically unchanged during a training session, indicating that the maximum model size that the customer can store is determined, so the cut layer l can be fixed at the beginning of training. Correspondingly, the user's communication capability will change with the change of channel quality during the training process, considering that the wireless environment is generally a quasi-static flat fading channel, that is, the channel gain remains basically unchanged in a short period of time but changes on a longer time scale. At the same time, the MS's computational frequency allocation F will also change with the communication resources P. Therefore, the original problem can be decomposed into two sub-problems P for a long time scale and a short time scale L and P S , respectively optimize l and F, P. The calling relationship of the resource optimization algorithm is as follows Figure 4 shown.

[0135] The specific steps of the algorithm to solve this problem are shown in the flowchart: Before training begins, solve the long time scale problem and obtain the optimal cutting layer l * Then, use this as a basis to continue solving short time scale problems in each round of training.

[0136] Among them, the long time scale problem is expressed as follows:

[0137]

[0138] One of the difficulties in this problem is how to reasonably handle the random variables that dynamically change during the training process, the user equipment calculation frequency f and the channel condition G, and estimate the total training delay together with the optimization variables. In addition, HSFL allows users to select different cutting layers, resulting in a huge solution space for the combination of cutting layers. In order to solve these problems, this embodiment adopts a genetic algorithm (GA) based on the idea of ​​sample average approximation (SAA) to solve the optimal cutting layer selection in the system. SAA uses the historical data samples of f and G to calculate the delay of each round To approximate the average round delay T a GA is more efficient in finding The smallest cutting layer is selected as l. Therefore, P L The objective function can be expressed as

[0139]

[0140] The algorithm's solution steps are as follows:

[0141] First, assume that the data for f and G satisfy normal distributions with their respective means and variances. Then we can use P S The algorithm in , solves F and P when l, f and G are known. Then, use s (sufficiently large) samples of f and G to calculate the single-round delay and use their mean to approximate the expected value Specifically expressed as Among them, T(l,F s ,P s ; G s ,f s ) represents the optimal single-round delay under sample s. Finally, GA is used to find l * .

[0142] Specifically, the algorithm changes the fitness function to Since GA generally optimizes towards individuals with higher fitness, a minus sign is added before the function to represent minimizing the delay. More specifically, a population containing P individuals (representing the selection of the cutting layer) is initialized, where individual l p The fitness is expressed as Then iterate several times to find the best individual. When the fitness of the best individual does not change significantly for g generations, it is considered that l is found. * .

[0143] For short time scale problems P S , where F and P are still coupled, and joint solution is still very difficult. Therefore, it can be decomposed into P S-F , P S-P To optimize F and P respectively, namely:

[0144]

[0145] For P S-F , in the user single round delay, only the calculation time on the MS Related to F, when the cut layer and the corresponding P, f, G are given, the constrained single variable problem can be solved by introducing auxiliary variable simplification problem and using Lagrangian relaxation method. Specifically, P S-F It can be expressed as:

[0146]

[0147] in, It represents the value of user k's single-round delay that is independent of F and can be directly calculated and can be regarded as a constant.

[0148] To solve this maximum and minimum problem, first introduce C6: To simplify the problem to:

[0149]

[0150] Then construct the Lagrangian function:

[0151]

[0152] Given the initial F, λ, μ k , the initial objective function can be directly calculated. By taking the partial differential of L with respect to each variable, F, λ, μ are gradually iterated. k The whole process will be End, σ is a preset small value.

[0153] For P S-P In HSFL, customers will not communicate with MS and ES at the same time, and use different frequency bands. Therefore, the communication resources from user to MS and from user to ES can be optimized in the same way, that is, Therefore P S-P It can be further divided into two parts:

[0154]

[0155] To solve this type of problem, the branch and bound method is usually used. This method removes unreachable solutions by decoupling the problem and calculating the lower bounds of the subproblems, and then gradually approaches the optimal solution. In this example, the pysciopt solver with the branch and bound method is used to solve and

[0156] In summary, the present invention discloses a method for training a segmented federated learning model based on a heterogeneous system, the system comprising a plurality of clients, a central server and an edge server. The global model segments the client local model and the server local model based on the conditions of each client device and deploys them to the corresponding client and central server respectively. In each round of training, the clients are trained in parallel, the local data is forward propagated to output the crushed data and transmitted to the server local model of the central server to continue forward propagation to obtain the loss value, and then the gradient is back-propagated to update the parameters of the server local model and the client local model. Each client transmits the updated model to the edge server, and the edge server and the central server complete the parameter exchange of the common layer and then perform model aggregation to generate a global client model and a global server model. The global client model distributes the client local model to the client according to each client segmentation point. The present invention performs personalized segmentation of the client model by adapting to the conditions of the client device, thereby reducing the computational burden of the heterogeneous device and improving the model training efficiency of the heterogeneous system.

[0157] Corresponding to the above method, the present invention also provides an apparatus / system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus / system implements the steps of the method described above.

[0158] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0159] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0160] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0161] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0162] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for training a segmented federated learning model based on a heterogeneous system, characterized in that: The heterogeneous system includes multiple clients, a central server and an edge server; The global model is divided into a client local model adapted to each client and a corresponding server local model based on the device condition of each client; the client local model is used to be deployed on the corresponding client, and the server local model is used to be deployed on the central server; wherein the device condition of each client includes the device storage resources, computing frequency and channel condition of the client, and the optimal segmentation point for each client to segment the global model is determined based on the device condition of each client with the goal of minimizing the total training delay by using the historical data of the operation of the heterogeneous system; the training method comprises the following steps: In each round of training, all clients execute the training of the client local model in parallel, and the client local model deployed on each client performs forward calculation using the training sample set constructed by each client local data, and outputs crushed data; Each client transmits the crushed data and the label of the training sample set to the server local model of the central server for forward calculation, and outputs a predicted value; based on the predicted value and the label, the loss value corresponding to each client is calculated; Calculate the gradient of the output layer of each server local model according to the loss value, back-propagate the gradient in the server local model, obtain the gradient of the crushed data and transmit it back to the corresponding client; The client local model of each client back-propagates the gradient of the crushed data to update the parameters of the client local model; After all client local models are updated, all updated client local models are transmitted to the edge server; The network layer in the global model that contains the corresponding segmentation point position of all clients in the global model is set as a common layer; the edge server collects the parameters related to the common layer in all updated client local models, and the central server collects the parameters related to the common layer in all server local models after back propagation, and the parameters of the common layer collected by both sides are exchanged; the edge server aggregates all client local models after information exchange to obtain a global client model; the central server aggregates all server local models after information exchange to obtain a global server model; The edge server divides the global client model into division points of the global model for each client, and distributes the client local model to the corresponding client.

2. The method for training a segmented federated learning model based on a heterogeneous system according to claim 1, characterized in that: The method further includes: In each round of training, the training sample set of each client is divided into multiple small batches of data, and the small batch gradient descent algorithm is used to iteratively update the parameters of this round of training.

3. The method for training a segmented federated learning model based on a heterogeneous system according to claim 2 is characterized in that: For the mini-batch data the batch size is set as: Set the minimum batch size and maximum batch size of small batch data; when dividing the training sample set each time for training, dynamically adjust the batch size between the minimum batch size and the maximum batch size according to the current computing power and channel conditions of each client; the batch size of small batch data is positively correlated with the computing power and the quality of channel conditions.

4. The method for training a segmented federated learning model based on a heterogeneous system according to claim 2, characterized in that: The optimal split point for each client to split the global model is determined with the goal of minimizing the total training delay, which is based on optimizing the single-round training delay of each client. The single-round training delay of each client is: in, represents the forward propagation delay of the client local model, represents the amount of forward propagation calculation, f k represents the computation frequency of the client, κ k Indicates the computing density of the client; represents the pulverized data transmission delay, bξ s (l k ) indicates the size of the crushed data, Indicates the uplink transmission rate from the client to the central server; represents the forward propagation delay of the model on the central server, represents the computation frequency assigned by the central server to client k, κ s Indicates the computing density of the central server; Represents the model back propagation delay on the central server; Denotes the gradient return delay, bξ g (l k ) represents the gradient size of the crushing data; represents the back propagation delay of the client local model; represents the delay of transmitting the local model from the client to the edge server, ξ m (l k ) represents the client local model size, Indicates the uplink transmission rate from the client to the edge server; represents the time delay of the edge server distributing the client local model; N represents the number of small batches of data into which the training sample set is divided, which is obtained by dividing the training sample set by the batch size of the small batch data.

5. The method for training a segmented federated learning model based on a heterogeneous system according to claim 1, characterized in that: Before each round of training, the method also includes: Based on the local model of each client determined by the optimal split point, with the goal of minimizing the total training delay, the optimal computing frequency assigned to each client by the central server, the optimal uplink and downlink transmission power from each client to the central server, and the optimal uplink and downlink transmission power from each client to the edge server are determined.

6. The method for training a segmented federated learning model based on a heterogeneous system according to claim 1, characterized in that: The edge servers aggregate to obtain a global client model, and the central servers aggregate to obtain a global server model by weighting the parameters of each layer of the model using the proportion of each client's local data volume to the total data volume of all clients as a weight to obtain the aggregated model parameters.

7. The method for training a segmented federated learning model based on a heterogeneous system according to claim 1, characterized in that: The method further includes: In a single training round, the edge server periodically sends a signal to each client to confirm the online status of each client. If no reply information is received within a preset time, the client is marked as abnormal. For a client marked as being in an abnormal state in the current training round, the edge server gives up waiting for the client to transmit an updated client local model, and only aggregates all client local models except those in the abnormal state.

8. The method for training a segmented federated learning model based on a heterogeneous system according to claim 1, characterized in that: Encrypted data transmission is performed between the client and the edge server and the central server.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method as claimed in any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Federal learning training method and system based on model segmentation and resource allocation

    CN114925852A

  • Efficient communication federal learning method for semantic segmentation of small sample medical images

    CN115965782A

  • Federal segmentation learning-oriented excitation method and related equipment

    CN117455007A

  • Federal learning client resource heterogeneous method and system for edge intelligence

    CN118690873A

  • Model training method based on lossless federated learning and related equipment

    CN118734940A

Cited By

  • Batch-based parallel splitting federated learning method

    CN120196451A

  • A batch-based parallel split federated learning method

    CN120196451B

  • Non-IID data-oriented cross-client global classifier dynamic fine tuning method

    CN120373492A

  • Lung image analysis method based on adaptive cascade deep learning network

    CN120495759A

  • Semi-centralized edge federated segmentation learning method of federated learning system facing Internet of Things terminal equipment under wireless network

    CN120952109A