A federated learning method based on distribution-aware regularization

By employing a federated learning method with distribution-aware regularization, generative adversarial networks are used to augment data and measure differences in data distribution. This optimizes the model training strategy, solves the overfitting and slow convergence problems caused by heterogeneous devices, and improves the training accuracy and generalization ability of the model.

CN119988019BActive Publication Date: 2026-02-10CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510084861.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2026-02-10
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

Federated learning presents challenges such as overfitting due to heterogeneous devices, decreased training accuracy, slow convergence during the learning process, and model conflicts caused by differences in data distribution among different clients.

Method used

By employing a distribution-aware regularization method, generative adversarial networks are used to augment data for clients with mismatched computing power and dataset size. Furthermore, the difference in data distribution is measured by divergence, and combined with the aggregation of model parameters within a time window, the global model training strategy is optimized.

Benefits of technology

It mitigates the overfitting risk caused by heterogeneous devices, improves the training accuracy and convergence speed of the global model, solves the client drift problem, and enhances the generalization performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988019B_ABST
    Figure CN119988019B_ABST
Patent Text Reader

Abstract

The application belongs to the technical application field of federated learning, and particularly relates to a federated learning method based on distribution perception regularization, which comprises the following steps: in each round of federated learning, a server determines M clients participating in this training; the server obtains the data processing mode of each client according to the computing capacity and the local data volume, and each client obtains training data according to the corresponding data processing mode thereof; the server issues a global model, each client trains the global model to obtain local model parameters through the training data and uploads the local model parameters to the server; the server calculates a time window according to historical training data, collects local model parameters in the time window to obtain a new global model through aggregation; and the above operation is repeated until the maximum federated learning round is reached; and the application effectively alleviates the device heterogeneity problem among multiple clients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of federated learning technology applications, specifically involving a federated learning method based on distribution-aware regularization. Background Technology

[0002] In recent years, researchers have conducted extensive research on the field of heterogeneous devices. Based on different research focuses, these studies can be broadly categorized into three types: client selection, aggregation improvement, and asynchronous federation. Client selection research primarily addresses the limitations imposed on training models by heterogeneous devices. Methods include considering device resources and computing power when selecting clients, or adjusting model complexity and size according to client characteristics. Aggregation improvement research mainly addresses device unreliability issues by modifying aggregation methods to reduce the impact of device-related problems. Asynchronous federation research primarily alleviates the "fallback problem" in heterogeneous environments. Through asynchronous methods, servers do not need to wait for device responses, increasing the flexibility of participating devices.

[0003] Although there are various solutions to the problem of device heterogeneity in federated learning, the following issues still exist:

[0004] 1) A federated environment typically involves a large number of devices with varying computing power and dataset sizes, which increases the risk of overfitting;

[0005] 2) Due to the heterogeneity of some clients, they may train an older version of the global model, while the server has updated the global model multiple times with other clients. This obsolescence will negatively affect the training accuracy and slow down the convergence speed of the learning process.

[0006] 3) When the data distribution on different clients is significantly different, the local models trained by each client may conflict with each other when they are aggregated in the global model, which will slow down the convergence speed of the global model. Summary of the Invention

[0007] To address the above problems, this invention provides a federated learning method based on distribution-aware regularization, comprising the following steps:

[0008] S1. Initialize the historical training data of all clients, set the number of clients participating in each round of federated learning M; set the maximum number of federated learning rounds, and initialize the parameter t = 1;

[0009] S2. In the t-th round of federated learning, the server distributes the global model to all clients, and the server determines the M clients participating in this training.

[0010] S3. The server obtains the data processing method for each client based on its computing power and local data volume, and each client obtains training data according to its own corresponding data processing method;

[0011] S4. Each client participating in this training trains the global model using the training data to obtain local model parameters and uploads them to the server; during the training process, each client calculates its local loss based on the number of samples of different categories in the training data.

[0012] S5. The server calculates a time window based on historical training data, collects local model parameters within the time window, aggregates them to obtain a new global model;

[0013] S6. Determine if the maximum number of federated learning rounds has been reached. If yes, end the iteration; otherwise, set t = t + 1 and return to step S2.

[0014] The beneficial effects of this invention are:

[0015] This invention uses generative adversarial networks to augment data for clients with mismatched computing power and dataset size, and uses divergence to measure the difference between global and local data distributions. At the same time, it collects updated parameters within a time window during model aggregation, thus alleviating the problem of inconsistent parameters uploaded by devices. Attached Figure Description

[0016] Figure 1 This is a flowchart of the method of the present invention;

[0017] Figure 2 This is a schematic diagram of data balancing on the client side of the present invention;

[0018] Figure 3 This is a schematic diagram of divergence calculation for the client side of this invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] This invention provides a federated learning method based on distribution-aware regularization, such as... Figure 1 As shown, it includes the following steps:

[0021] S1. Initialize the historical training data of all clients, set the number of clients participating in each round of federated learning M; set the maximum number of federated learning rounds, and initialize the parameter t=1.

[0022] Specifically, the historical training data includes: the time when the client receives the global model, the time when the client uploads the local model, the transmission power when the client uploads the local model, the channel gain between the client and the server, the signal interference when the client uploads the local model, the number of local samples on the client, the number of CPU cycles required for the client to train the global model once using a local sample, and the number of model parameters of the global model.

[0023] S2. In the t-th round of federated learning, the server distributes the global model to all clients, and the server determines the M clients that will participate in this training.

[0024] S3. The server obtains the data processing method for each client based on its computing power and local data volume, and each client obtains training data according to its own corresponding data processing method.

[0025] Specifically, step S3 includes:

[0026] S31. Calculate a preliminary score based on each client's computing power and local data volume, denoted as:

[0027]

[0028] Among them, D k This represents the amount of local data on client k. m represents the computing power of client k. k This represents the initial score of client k;

[0029] In this embodiment, the computing power of client k is the time required for client k to perform one local iteration training using a local sample, specifically calculated as follows:

[0030]

[0031] Among them, f k This represents the computing resources of client k, specifically the CPU cycle frequency of client k; b k This indicates the number of CPU cycles required for client k to train a local model using a local sample. The local sample can be an image, statistical data, etc.

[0032] S32. Since the initial score may be greater than 1, the softmax function is used to normalize the initial score of each client, allowing the server to more balancedly integrate the data from each client, thereby improving the robustness and accuracy of the global model. The device score is represented as...

[0033]

[0034] Where, ε kLet k represent the device rating of client k, and N represent the total number of clients.

[0035] S33. Calculate the data threshold p based on the equipment score, expressed as:

[0036]

[0037] S34. For each client participating in this training, if its device score is greater than the data threshold, the client uses a Generative Adversarial Network (DCGAN) to augment its data and obtain training data; if its device score is not greater than the data threshold, the client randomly samples its local data to obtain training data, such as... Figure 2 As shown.

[0038] S4. Each client participating in this training obtains local model parameters by training the global model through the training data and uploads them to the server; during the training process, each client calculates the local loss based on the number of samples of different categories in the training data.

[0039] Specifically, step S4, where any client participating in this training calculates its local loss based on the number of samples of different classes in the training data, includes:

[0040] S41. Calculate the normalized vector of each class of sample for client k, denoted as:

[0041]

[0042] Wherein, p(c k () represents the normalized vector corresponding to the sample of class c on client k. N represents the number of samples of class c in the training data of client k. k This represents the total number of training data samples for client k;

[0043] S42. Calculate the KL divergence of client k based on the normalized vector, expressed as:

[0044]

[0045] Among them, KL k (p k ||q) represents the KL divergence of client k, q(c) represents the sum of normalized vectors corresponding to samples of class c, C represents the number of classes, and M represents the number of clients participating in training;

[0046] By comparing the normalized vectors of each client's samples across all classes with the sum of the normalized vectors of all participants across all classes, the server can assess the difference between each client's data and the overall dataset distribution. This assessment is crucial for optimizing the global model because it helps identify which clients' data contribute significantly to the overall model's training. Quantifying the differences between different data sources allows for a better understanding of the diversity of client data, enabling adjustments to model training strategies to ensure the model generalizes better to diverse data distributions.

[0047] S43. For example Figure 3 As shown, the local loss of client k is calculated based on KL divergence. Represented as

[0048]

[0049]

[0050] Where ω represents the initial weight parameters of the model, ω t F represents the local model updating the weight parameters in the t-th round of federated learning. k (ω) represents the initial loss function for client k, x k f represents the samples drawn from the training data of client k. k (ω;x k ) represents the initial weight parameters ω of the model in sample x. k loss function on, This represents the expected value of the prediction loss for client k on the local dataset.

[0051] S5. The server calculates a time window based on historical training data, collects local model parameters within the time window, and aggregates them to obtain a new global model.

[0052] Specifically, step S5 includes:

[0053] S51. Record the training time of each client participating in the previous federated learning round, extract the latest training time of all clients, perform DBSCAN cluster analysis, and select the maximum value of the cluster diameter as the size of the time window for the current federated learning round, i.e., calculate the time window T. t It can be represented as

[0054]

[0055] in, The diameter of the i-th cluster in the (t-1)-th round of federated learning is represented by t. a and t b Indicates clustering C i The training time for any two points in the middle. β represents the training time of client k. k This indicates the batch size of client k. N represents the time required for client k to execute a single batch. k This indicates the size of the training data for client k;

[0056] Before each round of federated learning begins, a time window is calculated, and the timing starts at the beginning of the federated learning process. The time window limits the number of clients collected during each round of federated learning aggregation. The global model aggregates the number of clients whose local model parameters are collected within that time period.

[0057] S52. Calculate the delay function S corresponding to client k participating in this training. k , represented as

[0058]

[0059] in, This represents the sum of the number of local batches collected by the server in the t-th round of federated learning, up to the time when client k returns the local model parameters. This represents the sum of the number of local batches collected by the server in the (t-1)th round of federated learning. Let represent the number of local batches used by client k to train the local model in the t-th round of federated learning, and let a represent the hyperparameter controlling the decay rate of the function (a>0).

[0060] S53. The latency of clients participating in training within a time window is measured using a delay function. The hybrid hyperparameters of client k in the current federated learning round are calculated, denoted as:

[0061]

[0062] in, This represents the hybrid hyperparameters of client k in the t-th round of federated learning;

[0063] S54. At the start of the current federated learning round, asynchronous aggregation is performed for each local model parameter collected until the time window corresponding to the current federated learning round is reached, thus obtaining the global model parameters for the current federated learning round, denoted as:

[0064]

[0065] Among them, w t-1 This represents the global model parameters after the (t-1)th round of federated learning. This represents the initial aggregation parameters for the t-th round of federated learning. This represents the global model parameters after aggregating the local model parameters of the k-th client in the t-th round of federated learning. This represents the local model parameters for the k-th client.

[0066] S6. Determine if the maximum number of federated learning rounds has been reached. If yes, end the iteration; otherwise, set t = t + 1 and return to step S2.

[0067] This invention proposes a distribution-aware regularization learning model under federated learning to alleviate the device heterogeneity problem among multiple clients. By balancing and aggregating the overall distribution of local data from different clients, the convergence direction of the global model does not deviate from the optimal direction, improving the convergence speed and generalization performance of the global model and solving the client drift problem caused by data heterogeneity.

[0068] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "setting," "connection," "fixing," "rotation," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal connection of two components or the interaction between two components. Unless otherwise explicitly limited, those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0069] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A federated learning method based on distribution-aware regularization, characterized in that, Includes the following steps: S1. Initialize the historical training data of all clients and set the number of clients participating in each round of federated learning, M; Set the maximum number of federated learning rounds and initialize the parameter t=1; S2. In the t-th round of federated learning, the server distributes the global model to all clients, and the server determines the M clients participating in this training. S3. The server obtains the data processing method for each client participating in this training based on its computing power and local data volume, and each client obtains training data according to its own corresponding data processing method; Step S3 specifically includes: S31. Calculate a preliminary score based on each client's computing power and local data volume, denoted as: Among them, D k This represents the amount of local data on client k. m represents the computing power of client k. k This represents the initial score of client k; S32. Normalize the initial score for each client to obtain the device score, denoted as: in, Let k represent the device rating of client k, and N represent the total number of clients. S33. Calculate the data threshold p based on the equipment score, expressed as: S34. For each client participating in this training, if its device score is greater than the data threshold, the client uses a generative adversarial network to perform data augmentation to obtain training data; if its device score is not greater than the data threshold, the client randomly samples local data to obtain training data. S4. Each client participating in this training obtains local model parameters by training the global model through the training data and uploads them to the server; during the training process, each client calculates the local loss based on the number of samples of different categories in the training data and performs training. S5. The server calculates a time window based on historical training data, collects local model parameters within the time window, aggregates them to obtain a new global model; Step S5 specifically includes: S51. Calculate the time window for the t-th round of federated learning. , represented as in, This represents the diameter of the i-th cluster; S52. Calculate the delay function S corresponding to client k participating in this training. k , represented as in, This represents the sum of the number of local batches collected by the server in the t-th round of federated learning, up to the time when client k returns the local model parameters. This represents the sum of the number of local batches collected by the server in the (t-1)th round of federated learning. This represents the number of local batches used by client k to train the local model in round t of federated learning. Hyperparameters representing the decay rate of the control function; S53. Calculate the hybrid hyperparameters of client k in the current federated learning round, denoted as: in, Let α represent the hybrid hyperparameters of client k in the t-th round of federated learning, and let α represent the initial hybrid hyperparameter values. S54. Start timing at the beginning of the current federated learning round, and perform asynchronous aggregation for each local model parameter collected until the timing period reaches the time window corresponding to the current federated learning round to obtain the global model parameters of the current federated learning round. S6. Determine if the maximum number of federated learning rounds has been reached. If yes, end the iteration. If not, set t=t+1 and return to step S2.

2. The federated learning method based on distribution-aware regularization according to claim 1, characterized in that, Step S4: Each client participating in this training calculates its local loss based on the number of samples of different classes in the training data, including: S41. Calculate the normalized vector of each class of sample for client k, denoted as: Wherein, p(c k () represents the normalized vector corresponding to the sample of class c on client k. N represents the number of samples of class c in the training data of client k. k This represents the total number of training data samples for client k; S42. Calculate the KL divergence of client k based on the normalized vector, expressed as: Among them, KL k (p k ||q) represents the KL divergence of client k. q(c) represents the sum of the normalized vectors corresponding to samples of class c, where C represents the number of classes; S43. Calculate the local loss of client k based on the KL divergence.

3. The federated learning method based on distribution-aware regularization according to claim 2, characterized in that, Localized loss Represented as in, Indicates the initial weight parameters of the model. This indicates that the local model updates the weight parameters in the t-th round of federated learning. Let the initial loss function of client k be denoted as . This represents the sample drawn from the training data of client k. These are the initial weight parameters of the model. In the sample loss function on, This represents the expected value of the prediction loss for client k on the local dataset.

4. The federated learning method based on distribution-aware regularization according to claim 1, characterized in that, The polymerization process in step S54 is represented as follows: Among them, w t-1 This represents the global model parameters after the (t-1)th round of federated learning. Denotes the initial aggregation parameters for the t-th round of federated learning. This represents the global model parameters after aggregating the local model parameters of the k-th client in the t-th round of federated learning. This represents the local model parameters for the k-th client.

Citation Information

Patent Citations

  • Federal learning method for non-independent identically distributed and unbalanced data set

    CN117829270A

  • Heterogeneous data federal learning method based on improved aggregation algorithm

    CN118821909A