A multi-layer federated learning scheme based on sampling aggregation optimization

By employing a multi-layered scheme optimized by sampling aggregation in federated learning, and utilizing OPTICS clustering and weighted averaging algorithms, the training problem caused by device and data heterogeneity is solved, resulting in faster model convergence and higher learning accuracy.

CN116702881BActive Publication Date: 2026-07-14HUNAN UNIV OF SCI & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN UNIV OF SCI & TECH
Filing Date
2023-05-15
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Federated learning suffers from imbalances in computing power and communication efficiency due to heterogeneous equipment, and imbalances in data types and quantities due to heterogeneous data, leading to security risks and decreased learning accuracy during model training.

Method used

A multi-layer federated learning scheme based on sampling aggregation optimization is adopted. The clients are divided into different clusters using the OPTICS clustering method. In each round of training, clients are sampled from each cluster proportionally to participate in the training. The model parameters of the server and other clients are combined for training, and a weighted average algorithm is used to generate a global model.

Benefits of technology

It accelerates the model convergence process, suppresses local model bias, and improves the credibility and learning accuracy of the global aggregated model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116702881B_ABST
    Figure CN116702881B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on sampling aggregation optimization multilayer federal learning scheme, including the following steps: (1) initialization: server initializes global model, broadcast to all participating training client;(2) clustering: after first round training is carried out locally, the model parameters collected are clustered using OPTICS clustering method, and the client is divided into different clusters;(3) sampling: in each round of training, available client is extracted from each cluster according to client proportion to participate in training;(4) combined training: participating training client combines the global model sent by the server and the parameters of other clients to train;(5) aggregation and distribution: the server carries out weighted average to the parameters returned, and sends the model parameters uploaded by the participating training client except itself to the next round of participating training client.The application designs to accelerate model convergence, suppress model deviation, and improve the credibility of global aggregation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a multi-layer federated learning scheme based on sampling aggregation optimization. Background Technology

[0002] In federated learning, the server first initializes a global model and broadcasts it to all participating clients. Upon receiving the model, each client trains it locally using its local dataset and then uploads the updated results to the server. The server receives the uploaded parameters, aggregates them to obtain a global update, and stops training after several iterations. This process presents several security risks. For example, heterogeneous devices can lead to imbalances in computing power, communication, and storage efficiency among clients; heterogeneous data can cause imbalances in data types and volumes.

[0003] Federated learning is essentially a distributed machine learning technique. Traditional machine learning models trained centrally on servers suffer from security and privacy shortcomings, and federated learning emerged as an efficient privacy protection method. Federated learning utilizes decentralized data sources for training, avoiding the privacy issues associated with centralization; it also ensures the privacy and security of the original data to a certain extent by not accessing participants' private data. Specifically, the federated learning process involves participants training the model locally on the data, uploading the trained parameters to the server, and finally having the overall parameters aggregated by the cloud. This approach allows for information sharing between the client and server and effectively protects user data privacy during training. However, significant security vulnerabilities still exist in the local training and parameter transfer processes of federated learning.

[0004] Edge computing, also known as edge processing, is a networking technology that places servers near devices. It helps reduce system processing load and mitigate data transmission latency. These processes occur where sensors or devices generate data, also known as the edge.

[0005] The development of federated learning relies primarily on the following technologies:

[0006] The FedAvg algorithm combines local stochastic gradient descent (SGD) on each client with a server that performs model averaging. Multiple rounds of local model updates are performed on the client side, and the local model is uploaded to the server. Only one averaging algorithm is used for aggregation. In other words, the computational load is placed on the local client, while the server is only used for aggregation and averaging.

[0007] The FedProx algorithm adds a modified term to the client-side loss function, improving model performance and convergence. Essentially, it imposes a constraint on the difference between the local and global model weights, thereby increasing the stability and convergence of the model training.

[0008] The FedSSO algorithm is a federated learning algorithm optimized by stratified sampling. It uses a density-based clustering method to divide the total number of clients into different clusters, so that the clients in each cluster have high similarity. Then, it extracts usable clients from different clusters according to sample weights to participate in training. Therefore, all types of data participate in each round of training according to sample weights, which accelerates the convergence of the model to the global optimum. At the same time, it sets a learning rate decreasing mechanism and a local iteration round selection mechanism to ensure the convergence of the model.

[0009] OPTICS (Ordering Points to Identify the Clustering Structure) is a density-based clustering algorithm. It defines a cluster as the largest set of points connected by density, and divides regions with sufficient density into clusters.

[0010] Distributed optimization considers how to decompose a large task into several subtasks, assign them to multiple cores, and utilize these cores to achieve parallel and rapid solution to a large problem. In other words, it uses distributed methods (i.e., through local computation and communication) to solve optimization problems.

[0011] Stratified sampling is a method of randomly selecting samples (individuals) from different strata of a population that can be divided into different subpopulations (or strata) according to a prescribed proportion. The specific procedure is as follows: divide the population into two or more independent and complete groups, and then perform simple random sampling from these two or more groups, ensuring that the samples are independent of each other.

[0012] Stochastic Gradient Descent (SGD) is a commonly used optimization algorithm in deep learning. SGD is a gradient-based optimization algorithm used to update the parameters of deep neural networks. Its basic idea is that in each iteration, a mini-batch of samples is randomly selected to calculate the gradient of the loss function, and this gradient is used to update the parameters. This randomness makes the algorithm more robust, avoids getting trapped in local minima, and also allows for faster training. Summary of the Invention

[0013] To address the aforementioned technical problems, this invention provides a multi-layer federated learning scheme that accelerates model convergence, suppresses model deviation, and improves the credibility of the globally aggregated model.

[0014] The technical solution of this invention to solve the above-mentioned technical problems is: a multi-layer federated learning scheme based on sampling aggregation optimization, comprising the following steps:

[0015] (1) Initialization: The server initializes the global model and broadcasts it to all clients participating in federated learning training;

[0016] (2) Clustering: After the client performs the first round of training locally, the OPTICS clustering method is used to cluster the collected model parameters and divide the client into different clusters;

[0017] (3) Sampling: In each round of training, available clients are sampled from each cluster according to the proportion of clients to participate in the training;

[0018] (4) Combined training: The clients participating in the training combine the global model sent by the server with the parameters of other clients to train;

[0019] (5) Aggregation and distribution: The server performs a weighted average of the returned parameters and sends the model parameters uploaded by clients participating in the training in this round other than itself to the next round of clients participating in the training.

[0020] In the aforementioned multi-layer federated learning scheme based on sampling aggregation optimization, step (1) mainly involves the server initializing the global model and broadcasting it to all clients participating in the federated learning training. The specific process is as follows:

[0021] server:

[0022] 1-1) Server Ecs initializes the global model

[0023] 1-2) Server Ecs sends data to all clients C i (i∈K, K is the total number of clients) Broadcast initialized global model θ0.

[0024] In the above-mentioned sampling aggregation optimized multi-layer federated learning scheme, the clustering stage in step (2) mainly involves the client performing the first round of training locally, and then using the OPTICS clustering method to cluster the collected model parameters, dividing the client into different clusters. The specific process is as follows:

[0025] Client:

[0026] 2-1) In the first round, client C i (0<i≤k) Receives the global model θ0 broadcast by the cloud server Ecs.

[0027] 2-2) In the t-th round, the client C selected to participate in the training i (0 < i ≤ k) Use samples from the local dataset for model training. in, For the model updated by the i-th client in round t, θ t-1 For the global model in round t-1, η t ξ is the learning rate of the updated global model in round t. i For client C i Dataset samples.

[0028] 2-3) After the first round of training is completed, the OPTICS clustering method is used to analyze the collected model parameters. Clustering is performed to divide regions with sufficient density into clusters, and clients are assigned to different clusters. Where, min_samples, x i These are the parameters for the clustering algorithm.

[0029] In the above-mentioned sampling aggregation optimized multi-layer federated learning scheme, the sampling stage in step (3) mainly involves selecting available clients from each cluster to participate in training in each round of training according to the proportion of clients. The specific process is as follows:

[0030] 3-1) In round t, according to the proportion of client C, select available clients from each cluster. Participate in training, in, Let t be the set of clients extracted from the cluster containing the q-th aggregator in round t, and β be the client training ratio.

[0031] 3-2) During this round of training, client C was selected to participate in the training. i (C i ∈S t ) Receive the latest global model parameters θ t-1 .

[0032] 3-3) During this round of training, client C was selected to participate in the training. i (C i ∈S t Model training is performed.

[0033] 3-4) During this round of training, the client C that was selected to participate in the training... i (C i ∈S t The updated model will be trained. Send to the server.

[0034] The above-mentioned sampling aggregation optimized multi-layer federated learning scheme, in step (4) combined with training, mainly involves the participating clients training the global model sent by the server and the parameters of other clients. The specific process is as follows:

[0035] server:

[0036] 4-1) In the t-th round, server Ecs sends a message to the client C that has been selected to participate in the training. i (C i ∈S t )Proceeding the global model θ t-1 All models transmitted by the clients that participated in the previous training round parameter u t-1 =∑ j∈A (G t-1,j ), v t-1 =∑ j∈A (G t-1,j )θ t-1,j Where j (j∈A) is the identifier of the remaining clients participating in the training, and θ t-1,j For each client model updated during the (t-1)th round of global training, where j∈A, G t-1 Let be the gradient of each client updated during the (t-1)th round of global training, where j∈A.

[0037] Client:

[0038] 4-2) In the t-th round, the extracted client C i (C i ∈S t ) Receive the latest global model parameters θ from server Ecs t-1 With server-side calculation parameter u t-1 and v t-1 .

[0039] 4-3) In the t-th round, client C i Add the model to be trained to its loss function With the remaining client model parameters θ t-1,j The difference between the two norms is the difference between the parameters θ of the local model to be trained and the parameters of the other client models. t-1,j Take the difference and find its 2-norm, then use the model gradient G of the remaining clients. t-1,q The gain corresponds to the weighting parameter at each position of the L2 norm, and the whole is used to form a penalty term.

[0040] 4-4) In the t-th round, each client C i Construct the loss function using the specified parameters.

[0041] , where L s (θ) is the cross-entropy loss, S t Let t be the set of clients participating in training, t be the global training round number, j be the identifiers of the remaining clients participating in training, and θ be the set of clients participating in training. t-1,j Let C be the model parameters updated for each client in round t-1 of global training, and let θ be the model parameters for each client.t-1,j and G t-1,j The result of multiplying two terms is a constant, and since these two terms are the result of the previous round of operations, the result is a constant, so it is represented by the constant C.

[0042] 4-5) During the optimization process in round t, client C i The newly constructed loss function is optimized using gradient descent.

[0043] 4-6) In the t-th round, client C i Upload the current update gradient G to server Ecs t-1,j .

[0044] The above-mentioned sampling aggregation optimization multi-layer federated learning scheme, in step (5) aggregation and distribution process, mainly involves the server performing a weighted average of the returned parameters and sending the model parameters uploaded by clients participating in the training round other than itself to the next round of clients participating in the training. The specific process is as follows:

[0045] server:

[0046] 5-1) In the t-th round, server Ecs receives data from each client C participating in the training. i (C i ∈S t Uploaded gradient G t-1,j .

[0047] 5-2) In round t, server Ecs performs a weighted average of the gradients to generate the global model: Where N is the total number of clients, K is the total number of clients in each round of training, and S... t For each round of training, ρ is the set of clients stored in the training session. k Let the weight be the weight of the k-th client. This refers to the model uploaded by the kth client participating in training in round t-1.

[0048] 5-3) In the (t+1)th round, server Ecs sends a request to the available training clients C, which are drawn from each cluster. i Send updated model θ t Client S, which participated in the previous training round t-1 All reported models parameter u t-1 v t-1 .

[0049] The beneficial effects of this invention are as follows:

[0050] 1. This invention proposes a multi-layer federated learning scheme based on sampling aggregation optimization, which challenges the traditional single-layer federated learning, breaks the limitations of the traditional single-layer federated learning, and provides new ideas for future in-depth research on federated learning in multi-layer federated learning.

[0051] 2. This invention proposes a new clustering method, which uses the DBSCAN clustering algorithm for clustering and samples clients within each cluster. This solves the problem of reduced learning accuracy caused by the non-independent and identically distributed data of different nodes in federated learning, resulting in higher model accuracy.

[0052] 3. After the aggregator aggregates the parameters uploaded by the sampling client, the present invention combines the key parameters of all client models to suppress local model shifts and improve the credibility of the global aggregated model. Attached Figure Description

[0053] Figure 1 This is the overall flowchart of the present invention.

[0054] Figure 2 This is a system framework diagram of the present invention.

[0055] Figure 3 This is a schematic diagram illustrating the initialization, clustering, sampling, aggregation, and distribution processes of the present invention. Detailed Implementation

[0056] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0057] like Figure 2 As shown, Figure 2 The diagram illustrates the system framework of this invention. The system comprises two entities: a central server and users. The central server is responsible for aggregating the collected models, distributing the latest global model, and distributing the models from the previous training round to the clients participating in the training (excluding the client itself). After the first round of training, users perform clustering. In each round of training, available clients are proportionally selected from the clusters for training, and the training process incorporates the model parameters from other clients.

[0058] like Figure 1 As shown, a multi-layer federated learning scheme based on sampling aggregation optimization includes the following steps:

[0059] (1) Initialization phase: The server initializes the global model and broadcasts it to all clients participating in federated learning training.

[0060] (2) Clustering stage: After the client performs the first round of training locally, the OPTICS clustering method is used to cluster the collected model parameters and divide the client into different clusters.

[0061] (3) Sampling: In each round of training, available clients are sampled from each cluster according to the client ratio to participate in the training. The specific process is as follows:

[0062] (4) Integration phase: The clients participating in the training combine the global model sent by the server with the parameters from other clients to train.

[0063] (5) Aggregation and distribution stage: The server performs a weighted average of the returned parameters and sends the model parameters uploaded by clients participating in the training in this round other than itself to the next round of clients participating in the training.

[0064] like Figure 3 As shown, the specific processes of initialization, clustering, sampling, aggregation, and distribution are as follows:

[0065] server:

[0066] 1-1) Server Ecs initializes the global model

[0067] 1-2) Server Ecs sends data to all clients C i (i∈K, K is the total number of clients) Broadcast initialized global model θ0.

[0068] Client:

[0069] 2-1) In the first round, client C i (0<i≤k) Receives the global model θ0 broadcast by the cloud server Ecs.

[0070] 2-2) In the t-th round, the client C selected to participate in the training i (0 < i ≤ k) Use samples from the local dataset for model training. in, For the model updated by the i-th client in round t, θ t-1 For the global model in round t-1, η t ξ is the learning rate of the updated global model in round t. i For client C i Dataset samples.

[0071] 2-3) After the first round of training is completed, the OPTICS clustering method is used to analyze the collected model parameters. Clustering is performed to divide regions with sufficient density into clusters, and clients are assigned to different clusters.

[0072] Where, min_samples, x i These are the parameters for the clustering algorithm.

[0073] 3-1) In round t, according to the proportion of client C, select available clients from each cluster. Participate in training, in, Let t be the set of clients extracted from the cluster containing the q-th aggregator in round t, and β be the client training ratio.

[0074] 3-2) During this round of training, client C was selected to participate in the training. i (C i ∈S t ) Receive the latest global model parameters θ t-1 .

[0075] 3-3) During this round of training, client C was selected to participate in the training. i (C i ∈S t Model training is performed.

[0076] 3-4) During this round of training, the client C that was selected to participate in the training... i (C i ∈S t The updated model will be trained. Send to the server.

[0077] server:

[0078] 4-1) In the t-th round, server Ecs sends a message to the client C that has been selected to participate in the training. i (C i ∈S t )Proceeding the global model θ t-1 All models transmitted by the clients that participated in the previous training round parameter u t-1 =∑ j∈A (C t-1,j ), v t-1 =∑ j∈A (G t-1,j )θ t-1,j Where j (j∈A) is the identifier of the remaining clients participating in the training, and θ t-1,j For each client model updated during the (t-1)th round of global training, where j∈A, G t-1 Let be the gradient of each client updated during the (t-1)th round of global training, where j∈A.

[0079] Client:

[0080] 4-2) In the t-th round, the extracted client C i (C i ∈S t ) Receive the latest global model parameters θ from server Ecs t-1With server-side calculation parameter u t-1 and v t-1 .

[0081] 4-3) In the t-th round, client C i Add the model to be trained to its loss function With the remaining client model parameters θ t-1,j The difference between the two norms is the difference between the parameters θ of the local model to be trained and the parameters of the other client models. t-1,j Take the difference and find its 2-norm, then use the model gradient G of the remaining clients. t-1,q The gain corresponds to the weighting parameter at each position of the L2 norm, and the whole is used to form a penalty term.

[0082] 4-4) In the t-th round, each client C i Construct the loss function using the specified parameters.

[0083]

[0084] , where L s (θ) is the cross-entropy loss, S t Let t be the set of clients participating in training, t be the global training round number, j be the identifiers of the remaining clients participating in training, and θ be the set of clients participating in training. t-1,j Let C be the model parameters updated for each client in round t-1 of global training, and let θ be the model parameters for each client. t-1,j and C t-1,j The result of multiplying two terms is a constant, and since these two terms are the result of the previous round of operations, the result is a constant, so it is represented by the constant C.

[0085] 4-5) During the optimization process in round t, client C i The newly constructed loss function is optimized using gradient descent.

[0086] 4-6) In the t-th round, client C i Upload the current update gradient G to server Ecs t-1,j .

[0087] server:

[0088] 5-1) In the t-th round, server Ecs receives data from each client C participating in the training. i (C i ∈S t Uploaded gradient G t-1,j .

[0089] 5-2) In round t, server Ecs performs a weighted average of the gradients to generate the global model: Where N is the total number of clients, K is the total number of clients in each round of training, and S... tFor each round of training, ρ is the set of clients stored in the training session. k Let the weight be the weight of the k-th client. This refers to the model uploaded by the kth client participating in training in round t-1.

[0090] 5-3) In the (t+1)th round, server Ecs sends a request to the available training clients C, which are drawn from each cluster. i Send updated model θ t Client S, which participated in the previous training round t-1 All reported models parameter u t-1 v t-1 .

Claims

1. A multi-layer federated learning scheme based on sampling aggregation optimization, characterized in that, Includes the following steps: (1) Initialization: The server initializes the global model and broadcasts it to all clients participating in federated learning training; (2) Clustering: After the client performs the first round of training locally, the OPTICS clustering method is used to cluster the collected model parameters and divide the client into different clusters; (3) Sampling: In each round of training, available clients are sampled from each cluster according to the proportion of clients to participate in the training; (4) Combined training: The clients participating in the training combine the global model sent by the server with the parameters of other clients to train; (5) Aggregation and distribution: The server performs a weighted average of the returned parameters and sends the model parameters uploaded by clients participating in the training in this round other than itself to the next round of clients participating in the training. The specific process of step (4) is as follows: server: 4-1) In the t-th round, server Ecs sends a message to the client C that has been selected to participate in the training. i (C i ∈S t )Proceeding the global model θ t-1 All models transmitted by the clients that participated in the previous training round parameter u t-1 =∑ j∈A (G t-1,j ), v t-1 =Σ j∈A (G t-1,j )θ t-1,j Where j (j∈A) is the identifier of the remaining clients participating in the training, and θ t-1,j For each client model updated during the (t-1)th round of global training, where j∈A, G t-1 Let A be the gradient updated for each client during the (t-1)th round of global training, where j∈A; Client: 4-2) In the t-th round, the extracted client C i (C i ∈S t Receive the latest global model parameters θ from server Ecs t-1 With server-side calculation parameter u t-1 and v t-1 ; 4-3) In the t-th round, client C i Add the model to be trained to its loss function With the remaining client model parameters θ t-1,j The difference between the two norms is the difference between the parameters θ of the local model to be trained and the parameters θ of the other client models. t-1,j Take the difference and find its 2-norm, then use the model gradient G of the remaining client. t-1,q The gain corresponds to the weighting parameter at each position of the L2 norm, and the whole is used to form a penalty term; 4-4) In the t-th round, each client C i Construct the loss function using the specified parameters. , where L s (θ) is the cross-entropy loss, S t Let t be the set of clients participating in training, t be the global training round number, j be the identifiers of the remaining clients participating in training, and θ be the set of clients participating in training. t-1,j Let C be the model parameters updated for each client in round t-1 of global training, and let θ be the model parameters for each client. t-1,j and G t-1,j The result of multiplying two terms is a constant, and since these two terms are the result of the previous round of operations, the result is a constant, so it is represented by the constant C; 4-5) During the optimization process in round t, client C i The newly constructed loss function is optimized using gradient descent. 4-6) In the t-th round, client C i Upload the current update gradient G to server Ecs t-1,j .

2. The multi-layer federated learning scheme with sampling aggregation optimization according to claim 1, characterized in that, In step (1), the initialization phase mainly involves the server initializing the global model and broadcasting it to all clients participating in federated learning training. The specific process is as follows: server: 1-1) Server Ecs initializes the global model; 1-2) Server Ecs sends data to all clients C i (i∈K, K is the total number of clients) Broadcast initialized global model θ0.

3. The multi-layer federated learning scheme with sampling aggregation optimization according to claim 1, characterized in that, In step (2), the clustering stage mainly involves the client performing the first round of training locally, and then using the OPTICS clustering method to cluster the collected model parameters, dividing the client into different clusters. The specific process is as follows: Client: 2-1) In the first round, client C i (0<i≤k) Receives the global model θ0 broadcast by the cloud server Ecs; 2-2) In the t-th round, the client C selected to participate in the training i (0 < i ≤ k) Use samples from the local dataset for model training. in, For the model updated by the i-th client in the t-th round, θ t-1 For the global model in round t-1, η t ξ is the learning rate of the updated global model in round t. i For client C i Dataset samples; 2-3) After the first round of training is completed, the OPTICS clustering method is used to analyze the collected model parameters. Clustering is performed to divide regions with sufficient density into clusters, and clients are assigned to different clusters; Where, min_samples, x i These are the parameters for the clustering algorithm.

4. The multi-layer federated learning scheme with sampling aggregation optimization according to claim 1, characterized in that, In step (3), the sampling phase mainly involves selecting available clients from each cluster to participate in training according to the client ratio in each round of training. The specific process is as follows: 3-1) In round t, according to the proportion of client C, select available clients from each cluster. Participate in training, in, Let t be the set of clients extracted from the cluster containing the q-th aggregator in round t, and β be the client training ratio. 3-2) During this round of training, client C was selected to participate in the training. i (C i ∈S t ) Receive the latest global model parameters θ t-1 ; 3-3) During this round of training, client C was selected to participate in the training. i (C i ∈S t Model training is performed. 3-4) During this round of training, the client C that was selected to participate in the training... i (C i ∈S t The updated model will be trained. Send to the server.

5. The multi-layer federated learning scheme with sampling aggregation optimization according to claim 1, characterized in that, In step (5), the aggregation and distribution process mainly involves the server performing a weighted average of the returned parameters and sending the model parameters uploaded by clients participating in the training round (excluding itself) to the next round of training clients. The specific process is as follows: server: 5-1) In the t-th round, server Ecs receives data from each client C participating in the training. i (C i ∈S t Uploaded gradient G t-1,j ; 5-2) In round t, server Ecs performs a weighted average of the gradients to generate the global model: Where N is the total number of clients, K is the total number of clients in each round of training, and S... t For each round of training, ρ is the set of clients stored in the training session. k Let the weight be the weight of the k-th client. The model uploaded by the k-th client participating in training in round t-1; 5-3) In the (t+1)th round, server Ecs sends a request to the available training clients C, which are drawn from each cluster. i Send updated model θ t Client S, which participated in the previous training round t-1 All reported models parameter u t-1 v t-1 .