Federated learning aggregation method, system, device, and storage medium based on multi-objective optimization
By introducing multi-objective optimization of sample size matching degree and time-weighted penalty coefficient into federated learning, the problems of slow aggregation speed and insufficient time fairness in heterogeneous data and device environments are solved, achieving faster model convergence and more efficient overall process.
Patent Information
- Application Number
- CN202611694322.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-30
- Publication Date
- 2026-11-27
AI Technical Summary
Existing federated learning suffers from slow aggregation speed and insufficient time fairness in heterogeneous data and device environments. This is especially true when there are significant differences in the performance of heterogeneous data and devices, which leads to significant oscillations in model parameters, slow convergence, and a drag on the overall process.
A federated learning aggregation method based on multi-objective optimization is adopted. By calculating the sample size matching degree and the time-weighted penalty coefficient, a multi-objective optimization problem is constructed. The third-generation non-dominated sorting genetic algorithm is used to optimize the aggregation weight, balance the sample size matching degree and time fairness, and realize the weighted aggregation of model parameters.
It significantly improves the efficiency and robustness of federated learning, reduces parameter fluctuations during model iteration, accelerates model convergence, balances the contributions of devices with different performance levels, and improves overall aggregation efficiency and system stability.
Smart Images

Figure QLYQS_1 
Figure QLYQS_4 
Figure QLYQS_7
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning technology, specifically to a federated learning aggregation method, system, apparatus, and storage medium based on multi-objective optimization. Background Technology
[0002] Against the backdrop of rapid development in information technology, data privacy and security are receiving increasing attention. Federated learning, as an emerging distributed machine learning paradigm, can protect local data privacy in multi-party collaboration and has been widely applied in various fields such as finance and the Internet of Things.
[0003] However, as application complexity increases, the limitations in heterogeneous data and device environments become increasingly apparent: 1. The aggregation speed is slow. In real-world scenarios, local model data is often highly heterogeneous, with distribution differences reaching 30%-50%. This algorithm only uses data volume as weight and does not consider the matching degree between the samples and the global distribution, resulting in significant oscillations in model parameters and slow convergence after aggregation.
[0004] 2. Lack of consideration for time fairness. Device performance and network conditions vary significantly in federated learning; upload times for low-power devices can be 5-10 times longer than for high-performance servers. If the same or simple data weighting method is still used without distinguishing local model upload latency, not only will fast local models have to wait for slow devices for extended periods, but the overall aggregation process will also be slowed down, model convergence time will be prolonged, and the number of iterations required to reach the target performance will increase. Summary of the Invention
[0005] This invention provides a federated learning aggregation method, system, apparatus, and storage medium based on multi-objective optimization.
[0006] The technical solution of this invention is as follows: The federated learning aggregation method based on multi-objective optimization includes the following steps: S1. The global model receives the local model parameters and datasets obtained after training the local model. It averages the feature mean of each local model dataset to obtain the global data feature mean. Based on the feature value of each sample in each local model dataset and the global data feature mean, it calculates the sample size matching degree of each local model dataset.
[0007] S2. Obtain the upload time of each local model, set a time threshold, and calculate the weighted penalty coefficient for each local model upload based on the upload time of each local model and the time threshold.
[0008] S3. Through a multi-objective optimization mechanism that minimizes the sample size matching degree and maximizes the time-weighted penalty coefficient, a set of non-dominated solutions is obtained, and the optimal solution is obtained as the final aggregation weight of each local model parameter. Based on the final aggregation weight, the local model parameters are weighted and aggregated to obtain the global parameters of federated learning, which are then distributed to each local model.
[0009] In S1, the sample size matching degree of each local model dataset is calculated based on the feature value of the i-th sample in the local model dataset and the mean feature value of the global data. The specific operation is as follows: , n is the number of samples in the local model; Let be the feature value of the i-th sample in the local model dataset; This represents the mean of the global data features.
[0010] In S2, a weighted penalty coefficient is calculated based on the upload time and time threshold of each local model. The specific operation is as follows: , in, This is the weighted penalty coefficient. t is the penalty factor, t is the upload time of each local model, and T is the time threshold.
[0011] In S3, the minimum sample size matching degree is calculated using the following formula: , in, To minimize the sample size matching function, where N is the number of local models, Aggregate weights for the local model. The ideal weight.
[0012] In S3, the time-weighted penalty is maximized using the following formula: , in, To maximize the time-weighted penalty function, N is the number of local models. Aggregate weights for the local model. The upload time for the i-th local model.
[0013] In S3, weighted aggregation is performed on the local model parameters based on the final aggregated weights to obtain the global parameters for federated learning, specifically: , in, These are global parameters. For the i-th local model parameter, Aggregate weights for local models, where N is the number of local models.
[0014] In S2, the time threshold is set to the median upload time of all local models.
[0015] A federated learning aggregation system based on multi-objective optimization, used to implement the aforementioned federated learning aggregation method based on multi-objective optimization, is characterized by comprising: The sample size matching degree calculation module receives the local model parameters and datasets obtained after training the local model. It averages the feature mean of each local model dataset to obtain the global data feature mean. Based on the feature value of each sample in each local model dataset and the global data feature mean, it calculates the sample size matching degree of each local model dataset. The weighted penalty coefficient calculation module obtains the upload time of each local model, sets a time threshold, and calculates the weighted penalty coefficient for each local model upload based on the upload time of each local model and the time threshold. The multi-objective optimization module obtains a set of non-dominated solutions through a multi-objective optimization mechanism that minimizes the sample size matching degree and maximizes the time-weighted penalty coefficient. The optimal solution is then used as the final aggregation weight for the parameters of each local model. Based on the final aggregation weight, the local model parameters are weighted and aggregated to obtain the global parameters for federated learning, which are then distributed to each local model.
[0016] A federated learning aggregation device based on multi-objective optimization includes a processor and a memory, wherein the processor implements the above-described federated learning aggregation method based on multi-objective optimization when executing a computer program stored in the memory.
[0017] A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the above-described federated learning aggregation method based on multi-objective optimization.
[0018] The beneficial effects of this invention are as follows: This method significantly improves the efficiency of federated learning. By introducing sample size matching and optimizing the aggregation weights accordingly, it effectively reduces fluctuations during parameter iteration and accelerates model convergence.
[0019] Secondly, this invention enhances time fairness. By designing an upload time penalty mechanism, lower aggregation weights are assigned to local models with higher latency, preventing slow local models from excessively dragging down the overall progress. This balances the contributions of devices with different performance levels, improving overall aggregation efficiency and system robustness.
[0020] This method also boasts excellent flexibility and compatibility. Building upon existing technologies, it focuses on multi-objective optimization and improvement of the aggregation strategy, ensuring seamless integration into existing federated learning systems. It adapts to different data distributions and local model performance scenarios without significant modifications, demonstrating strong practicality and widespread applicability. Detailed Implementation
[0021] This embodiment provides a federated learning aggregation method based on multi-objective optimization, which is described in detail below: This method relies on the standard federated learning architecture, consisting of a global model and multiple local models, used for training local data and uploading model parameters, following the basic process logic of federated learning: "local training - parameter upload - parameter aggregation - global model distribution".
[0022] Local models directly call local datasets, such as customer transaction data shards in financial risk control scenarios and device sensor data in industrial IoT scenarios. Following the default batching rules of the FedAvg algorithm, and based on the local model's computational resource and training efficiency requirements, the dataset is divided into fixed-size batches, typically 32, 64, or 128.
[0023] The local model adopts the basic machine learning models specified by the FedAvg algorithm, such as multilayer perceptron (MLP) and convolutional neural network (CNN), and is compatible with the original FedAvg implementation. It uses pre-divided batch data to train the local model.
[0024] The training process strictly follows FedAvg's parameter update logic: the model prediction results are calculated through forward propagation, combined with a loss function such as cross-entropy loss, the gradient is solved through backpropagation, and the local model parameters are updated using stochastic gradient descent and its variant optimizers. This step is consistent with FedAvg, ensuring that the focus is solely on improving the aggregation strategy.
[0025] The federated learning aggregation method based on multi-objective optimization includes the following steps: S1. The global model receives the local model parameters and datasets obtained after training the local model. It averages the feature mean of each local model dataset to obtain the global data feature mean. Based on the feature value of each sample in each local model dataset and the global data feature mean, it calculates the sample size matching degree of each local model dataset.
[0026] After the local model completes its training, the trained model parameters are directly uploaded to the global model via network communication protocol without any encryption or obfuscation, maintaining the simplicity of the FedAvg original parameter upload process.
[0027] The global model directly receives raw model parameters uploaded from various local models through the network listening module, without the need for additional operations such as decryption or decoding. This perfectly matches the FedAvg raw parameter receiving logic, ensuring process simplicity and compatibility.
[0028] The specific steps to quantify the sample size matching degree between the local model dataset and the global model data distribution are as follows: , n is the number of samples in the local model; Let be the feature value of the i-th sample in the local model dataset; This represents the mean of the global data features.
[0029] Taking the MNIST dataset as an example, this formula accurately reflects the differences between the features of different local model data and the global data. The traditional FedAvg algorithm simply relies on a weighted average based on the amount of data, without fully considering the adaptability of the sample distribution, which can easily lead to large fluctuations in the aggregated model parameters during iteration. This invention, by incorporating the calculation of sample size matching, makes the model parameters more stable during iteration, reduces unnecessary oscillations, and thus accelerates the model convergence speed, achieving the target accuracy in relatively fewer iterations.
[0030] S2. Obtain the upload time of each local model, set a time threshold, and calculate the weighted penalty coefficient for each local model upload based on the upload time of each local model and the time threshold.
[0031] The global model configures a timestamp module for each local model upload request to accurately record the start and end times of parameter uploads, and calculates the local model upload time t by using the time difference.
[0032] The weighted penalty coefficient is calculated as follows: , in, This is the weighted penalty coefficient. t is the penalty factor, t is the upload time of each local model, and T is the time threshold.
[0033] Specifically, the time threshold is set to the median upload time for all local models.
[0034] In practical applications, such as federated learning systems that include edge computing devices and high-performance servers, the time it takes for edge devices to upload parameters can be several times longer than that of the servers due to limitations in computing power and network conditions. This mechanism reduces the weight of local models that take longer to upload during aggregation, while the weight of locally uploaded models remains unaffected or is relatively increased. This effectively prevents slow local models from excessively dragging down the overall aggregation progress, balances the contributions of local models with different performance levels during the aggregation process, improves time fairness, and ensures the efficient operation of the entire federated learning system.
[0035] By employing a time-fairness weighted penalty mechanism, the contributions of each local model in the aggregation process are effectively balanced, preventing a few slow local models from slowing down the overall aggregation progress and significantly improving the overall aggregation efficiency of the system.
[0036] S3. Through a multi-objective optimization mechanism that minimizes the sample size matching degree and maximizes the time-weighted penalty coefficient, a set of non-dominated solutions is obtained, and the optimal solution is obtained as the final aggregation weight of each local model parameter. Based on the final aggregation weight, the local model parameters are weighted and aggregated to obtain the global parameters of federated learning, which are then distributed to each local model.
[0037] A multi-objective optimization problem is constructed by taking sample size matching degree and time fairness (weighted penalty coefficient) as the two core optimization objectives. Specifically: Minimizing the sample size matching degree is calculated using the following formula: , in, To minimize the sample size matching function, where N is the number of local models, Aggregate weights for the local model. The ideal weight.
[0038] The time-weighted penalty is maximized and calculated using the following formula: , in, To maximize the time-weighted penalty function, N is the number of local models. Aggregate weights for the local model. The upload time for the i-th local model.
[0039] The negative sign is used to convert "maximizing fairness" into the "minimizing" objective function form adapted by this method.
[0040] The global model strictly follows the process of the third-generation non-dominated sorting genetic algorithm, treating the solutions to the multi-objective optimization problem of each local model's parameters as individuals in a population for iterative multi-objective optimization. After several generations of evolution, a set of non-dominated solutions is obtained.
[0041] From the non-dominated solutions, the optimal solution is selected based on actual business needs (such as prioritizing sample matching or time fairness), and the aggregation weights of each local model are determined. This ensures a reasonable balance between sample size fit and time fairness.
[0042] The global model performs a weighted aggregation based on the model parameters uploaded from the local model. The specific calculation formula is as follows: , in, These are global parameters. For the i-th local model parameter, Aggregate weights for local models, where N is the number of local models.
[0043] The global model completes the aggregation to obtain global parameters. Then, it is distributed to all local models via network communication protocols.
[0044] Specifically, this invention constructs a multi-objective optimization problem by using sample size matching degree and time fairness as optimization objectives, and solves it using a third-generation non-dominated sorting genetic algorithm. The third-generation non-dominated sorting genetic algorithm finds the optimal trade-off solution among multiple objectives through operations such as non-dominated sorting and crowding calculation.
[0045] Furthermore, after receiving global parameters, the local model constructs a complete global model that can be directly used for the next round of local model training or termination judgment.
[0046] As a further optimization, after receiving the global parameters, the global parameters are filled into the corresponding positions according to the preset model structure to generate a complete global model object. After obtaining the new global model, the value of the communication round variable is incremented by 1 to update the federated learning iteration progress and provide a basis for termination judgment.
[0047] The specific steps for termination judgment are as follows: compare with the preset maximum number of rounds. If the current round is greater than or equal to the maximum number of rounds, it is judged as "yes", the result is output, the optimal solution set is extracted, and the output is saved according to the preset format; if the current round is less than or equal to the maximum number of rounds, it is judged as "no", and it is determined whether the current communication round has reached the preset maximum round threshold, and then it is decided whether the federated learning process should continue to iterate or terminate and output the result.
[0048] Specifically, if the result is "no", the global model is obtained and broadcast to the local models participating in federated learning via network communication protocol. After receiving the data, the local models use it as input for the next round of local model training module. The process then returns to the local model selection module to start a new round of iteration.
[0049] The newly generated global model is distributed to the local model group (or selected local models) to provide a benchmark model for the next round of local model training, thus maintaining the iterative closed loop of federated learning.
[0050] In this invention, the model parameters of the local model are optimized, and a suitable solution is selected from the non-dominated solutions as the aggregation weight allocation scheme. This multi-objective optimization method avoids the problem of getting trapped in local optima by considering only a single objective. It comprehensively considers multiple factors affecting the aggregation effect, enabling the model to converge to the ideal state more quickly during training, thereby improving the overall aggregation speed and reducing the number of iterations required to achieve a specific accuracy.
[0051] A federated learning aggregation system based on multi-objective optimization, used to implement the aforementioned federated learning aggregation method based on multi-objective optimization, is characterized by comprising: The sample size matching degree calculation module receives the local model parameters and datasets obtained after training the local model. It averages the feature mean of each local model dataset to obtain the global data feature mean. Based on the feature value of each sample in each local model dataset and the global data feature mean, it calculates the sample size matching degree of each local model dataset. The weighted penalty coefficient calculation module obtains the upload time of each local model, sets a time threshold, and calculates the weighted penalty coefficient for each local model upload based on the upload time of each local model and the time threshold. The multi-objective optimization module obtains a set of non-dominated solutions through a multi-objective optimization mechanism that minimizes the sample size matching degree and maximizes the time-weighted penalty coefficient. The optimal solution is then used as the final aggregation weight for the parameters of each local model. Based on the final aggregation weight, the local model parameters are weighted and aggregated to obtain the global parameters for federated learning, which are then distributed to each local model.
[0052] A federated learning aggregation device based on multi-objective optimization includes a processor and a memory, wherein the processor implements the above-described federated learning aggregation method based on multi-objective optimization when executing a computer program stored in the memory.
[0053] A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the above-described federated learning aggregation method based on multi-objective optimization.
[0054] In different application scenarios, such as when the degree of data heterogeneity varies or the performance of local models differs significantly, the method of this invention can flexibly adjust the aggregation weight allocation according to the actual data characteristics and the status of local models. Through the synergistic effect of sample size matching degree, weighted penalty coefficient and multi-objective optimization, it can achieve better aggregation results, fully demonstrating the flexibility and adaptability of the method of this invention in different environments.
Claims
1. A federated learning aggregation method based on multi-objective optimization, characterized in that, Includes the following steps: S1. The global model receives the local model parameters and datasets obtained after training the local model. It averages the feature mean of each local model dataset to obtain the global data feature mean. It calculates the sample size matching degree of each local model dataset based on the feature value of each sample in each local model dataset and the global data feature mean. S2. Obtain the upload time of each local model, set the time threshold, and calculate the weighted penalty coefficient for each local model upload based on the upload time of each local model and the time threshold. S3. Through a multi-objective optimization mechanism that minimizes the sample size matching degree and maximizes the time-weighted penalty coefficient, a set of non-dominated solutions is obtained, and the optimal solution is obtained as the final aggregation weight of each local model parameter. Based on the final aggregation weight, the local model parameters are weighted and aggregated to obtain the global parameters of federated learning, which are then distributed to each local model.
2. The federated learning aggregation method based on multi-objective optimization according to claim 1, characterized in that, In S1, the sample size matching degree of each local model dataset is calculated based on the feature value of the i-th sample in the local model dataset and the mean feature value of the global data. The specific operation is as follows: , n is the number of samples in the local model; Let be the feature value of the i-th sample in the local model dataset; This represents the mean of the global data features.
3. The federated learning aggregation method based on multi-objective optimization according to claim 1, characterized in that, In S2, a weighted penalty coefficient is calculated based on the upload time and time threshold of each local model. The specific operation is as follows: , in, This is the weighted penalty coefficient. t is the penalty factor, t is the upload time of each local model, and T is the time threshold.
4. The federated learning aggregation method based on multi-objective optimization according to claim 1, characterized in that, In S3, the minimum sample size matching degree is calculated using the following formula: , in, To minimize the sample size matching function, where N is the number of local models, Aggregate weights for the local model. The ideal weight.
5. The federated learning aggregation method based on multi-objective optimization according to claim 1, characterized in that, In S3, the time-weighted penalty is maximized using the following formula: , in, To maximize the time-weighted penalty function, N is the number of local models. Aggregate weights for the local model. The upload time for the i-th local model.
6. The federated learning aggregation method based on multi-objective optimization according to claim 1, characterized in that, In S3, weighted aggregation is performed on the local model parameters based on the final aggregated weights to obtain the global parameters for federated learning, specifically: , in, These are global parameters. For the i-th local model parameter, Aggregate weights for local models, where N is the number of local models.
7. The federated learning aggregation method based on multi-objective optimization according to claim 1, characterized in that, In S2, the time threshold is set to the median upload time of all local models.
8. A federated learning aggregation system based on multi-objective optimization, used to implement the federated learning aggregation method based on multi-objective optimization as described in any one of claims 1-7, characterized in that, include: The sample size matching degree calculation module receives the local model parameters and datasets obtained after training the local model. It averages the feature mean of each local model dataset to obtain the global data feature mean. Based on the feature value of each sample in each local model dataset and the global data feature mean, it calculates the sample size matching degree of each local model dataset. The weighted penalty coefficient calculation module obtains the upload time of each local model, sets a time threshold, and calculates the weighted penalty coefficient for each local model upload based on the upload time of each local model and the time threshold. The multi-objective optimization module obtains a set of non-dominated solutions through a multi-objective optimization mechanism that minimizes the sample size matching degree and maximizes the time-weighted penalty coefficient. The optimal solution is then used as the final aggregation weight for the parameters of each local model. Based on the final aggregation weight, the local model parameters are weighted and aggregated to obtain the global parameters for federated learning, which are then distributed to each local model.
9. A federated learning aggregation device based on multi-objective optimization, characterized in that, It includes a processor and a memory, wherein the processor, when executing a computer program stored in the memory, implements the federated learning aggregation method based on multi-objective optimization as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, Used to store computer programs, wherein the computer programs, when executed by a processor, implement the federated learning aggregation method based on multi-objective optimization as described in any one of claims 1-7.
