A fair federated learning method based on contribution income collaborative balance

CN117933422BActive Publication Date: 2026-10-27HEBEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410118250.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2026-10-27
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

其中,联邦双贡献评估模块从本地数据数量、质量和模型质量的角度评估参与者贡献,并将时间作为贡献值的累加权重,不仅有效评估联邦参与者的贡献,还激励参与者持续提供高质量训练;联邦贡献收益平衡算法构建双层损失函数训练客户端个性化模型,内层的局部损失使用正则化约束更新,外层的全局损失进行类似FedAvg更新,将个性化模型与全局模型的差异计为收益,通过客户端的贡献收益值动态调整聚合权重,实现参与者贡献与收益的协同平衡,并解决数据异构下全局模型性能差收敛不佳的问题

Benefits of technology

[0053]本发明的目的在于提供一种基于贡献收益协同平衡的公平联邦学习方法,该方法包括含联邦双贡献评估模块与联邦贡献收益平衡算法。其中,联邦双贡献评估模块从本地数据数量、质量和模型质量的角度评估参与者贡献,并将时间作为贡献值的累加权重,不仅有效评估联邦参与者的贡献,还激励参与者持续提供高质量训练;联邦贡献收益平衡算法构建双层损失函数训练客户端个性化模型,内层的局部损失使用正则化约束更新,外层的全局损失进行类似FedAvg更新,将个性化模型与全局模型的差异计为收益,通过客户端的贡献收益值动态调整聚合权重,实现参与者贡献与收益的协同平衡,并解决数据异构下全局模型性能差收敛不佳的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117933422B_ABST
    Figure CN117933422B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on contribution income collaborative balance fair federated learning method, including the following steps: S1. build and include federal double contribution evaluation module and federal contribution income balance algorithm federated learning framework;S2. using Dirichlet method is divided into non-independent and identically distributed data;S3. in federal double contribution evaluation module, the data contribution value is calculated by the data quantity and data quality of client, according to model loss calculation model contribution value, and join time weight and obtain final contribution value;S4. build double-layer loss function, train the individualized model of client, respectively calculate the relative entropy of individualized model and global model, and regard as income value;S5. according to the contribution value and income value of client, adjust aggregation weight, and the updated global model enters next round of training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of federated learning technology, and in particular to a fair federated learning method based on the collaborative balancing of contribution and benefit. Background Technology

[0002] Federated learning can solve the data silo problem while protecting data privacy, and has achieved good research results in fields such as industry [Liu Jing, Zhu Jiahao, Yuan Runmeng, et al. Federated Dynamic Weighted Learning Method under Non-Independent and Identically Distributed Industrial Big Data [J]. Computer Integrated Manufacturing Systems, 2023, 29(05).] and medicine. However, in practical applications, the fairness of federated learning has become a bottleneck. The article [Chen Haoyu, Li Yidong, Zhang Honglei, et al. A Review of Research on Fairness of Trustworthy Federated Learning [J]. Journal of Electronics, 2023, 51(10):2985-3010.] has two definitions of fairness in federated learning: balanced distribution fairness and distribution according to work fairness. Among them, the purpose of balanced distribution fairness is for each client to obtain the same benefit, that is, the performance of the global model is as consistent as possible in each client, without favoring certain clients. For example, the paper [Mohri M, Sivek G, Suresh A T. Agnostic federated learning[C] / / International Conference on Machine Learning.PMLR,2019:4615-4625.] improves the worst-performing client, and the paper [Li T, Sanjabi M, Beirami A, et al. Fair Resource Allocation in Federated Learning[C] / / International Conference on Learning Representations.2019.] achieves a more uniform distribution of client accuracy by adjusting the parameter q. However, in practical applications, the data of federated learning clients is mostly non-independent and identically distributed (Non-IID), which means that the data samples meet any of the conditions of non-independent or non-identically distributed sampling. Generally, this includes five cases: skewed feature distribution, skewed label distribution, same labels but different features, same features but different labels, and data skew, resulting in large differences between clients. Because the issue of varying client contributions to the global model in Non-IID scenarios was ignored, an imbalance in contributions and rewards among high-contribution participants occurred, negatively impacting their motivation. Therefore, ensuring fairness in the balance of client contributions and rewards in Non-IID scenarios is one of the key challenges facing federated learning.

[0003] The goal of fairness in distribution based on contribution in federated learning is to calculate the contributions of federated participants and allocate rewards commensurate with those contributions, ensuring that participants with high and low contributions receive corresponding rewards. This aligns better with the interests of participants in real-world scenarios and non-IID environments. The key to fairness in distribution based on contribution lies in achieving equitable distribution of rewards, thus providing clients with sufficient incentive to participate in federated learning. To calculate the contribution of participants in federated learning, the paper [Song T, Tong Y, Wei S. Profitallocation for federated learning[C] / / 2019IEEE International Conference on Big Data(Big Data).IEEE,2019:2577-2586.] defines a contribution index based on the Shapley value. It quantifies the contribution of data providers by considering factors such as local datasets, machine learning algorithms, and test sets. Two gradient-based methods are proposed—single-round reconstruction (OR) and multi-round reconstruction (MR). These methods approximate the model reconstruction on different dataset combinations using intermediate results from the training process, thereby measuring the contribution of horizontal federated learning. However, this method is only applicable to horizontal federated learning. The paper [Wang G, Dang CX, Zhou Z. Measure contribution of participants in federated learning[C] / / 2019IEEE international conference on big data(Big Data).IEEE,2019:2597-2604.] proposes a deletion method for horizontal federated learning and a Shapley value method for vertical federated learning to calculate the contribution of participants in federated learning. While this method can reasonably explain the contributions of multiple participants, it has a high computational cost. To address the issue of high contribution computational cost, the paper [Nishio T, Shinkuma R, Mandayam N B. Estimation of individual device contributions for incentivizing federated learning[C] / / 2020IEEE Globecom Workshops(GC Wkshps.IEEE,2020:1-6.] proposes a lightweight multi-dimensional contribution method based on stepwise computation. This method considers the improvement in global model performance when the client joins FL training as an indicator of the client's contribution, thereby reducing communication and computational overhead. However, this method requires the global model performance to improve in each iteration.

[0004] However, the article [Zhang J, Li C, Robles-Kelly A, et al. Hierarchically fairfederated learning[J]. arXiv preprint arXiv:2004.10386,2020.] points out that the Shapley value-based method is unfair in some scenarios. Therefore, it considers publicly verifiable multidimensional factors as contributions, such as data quantity, data quality, and data collection cost. Participants are divided into different levels according to their contributions and converge to different models respectively. Based on this, the article [Yang Xiuqing, Peng Changgen, Liu Hai, et al. Fair federated learning scheme based on data quality assessment[J]. Computer and Digital Engineering, 2022, 50(06).] further proposes a fair federated learning scheme based on data quantity and data quality, proving the feasibility of assessing participant contributions based on data quality.

[0005] The benefits for participants in federated learning include performance improvements and reward distribution. Incentive methods such as auction mechanisms, Stacklberg games, and contract theory are used to ensure that participants receive rewards commensurate with their contributions. While these methods have achieved their intended effects, they suffer from low fault tolerance. If a client performs poorly in the previous round, it will be at a disadvantage in the next training round, and this disadvantage will persist and accumulate over time.

[0006] Currently, federated learning's fairness in distribution based on work is more in line with reality. However, the contribution of participating clients cannot be accurately reflected by data quality assessment alone. The design of the benefit distribution and incentive mechanism also has certain flaws, making it difficult to achieve a truly effective balance between contribution and benefit. At the same time, the performance degradation caused by Non-IID data must also be considered. Summary of the Invention

[0007] The purpose of this invention is to provide a fair federated learning method based on a synergistic balance of contribution and reward. This method includes a federated dual-contribution evaluation module and a federated contribution-reward balancing algorithm. The federated dual-contribution evaluation module assesses participant contributions from the perspectives of local data quantity, quality, and model quality, using time as the cumulative weight for contribution values. This not only effectively evaluates the contributions of federated participants but also incentivizes them to continuously provide high-quality training. The federated contribution-reward balancing algorithm constructs a two-layer loss function to train a personalized client model. The inner local loss is updated using regularization constraints, while the outer global loss is updated using a FedAvg-like approach. The difference between the personalized model and the global model is counted as a reward. The aggregation weight is dynamically adjusted based on the client's contribution reward value, achieving a synergistic balance between participant contributions and rewards, and addressing the problem of poor global model performance and convergence under heterogeneous data conditions.

[0008] The technical solution adopted in this invention is:

[0009] A fair federated learning method based on collaborative balance of contribution and benefit includes the following steps:

[0010] S1: Construct a federated learning framework that includes a federated dual contribution evaluation module and a federated contribution benefit balancing algorithm;

[0011] S2: The data is divided into non-independent and identically distributed data using the Dirichlet method;

[0012] S3: The entropy weight method is used to calculate the data quality of the client, and then the model contribution value is calculated based on the model loss. The time weight is added to obtain the final contribution value.

[0013] S4: Construct a two-layer loss function, train the client's personalized model, calculate the relative entropy between the personalized model and the global model, and regard it as the profit value;

[0014] S5: Adjust the aggregate weights based on the client's contribution and revenue values, and the updated global model enters the next round of training;

[0015] Furthermore, in step S3, the entropy weight method is first used to calculate the data quality of the client, then the model contribution value is calculated based on the model loss, and a time weight is added to obtain the final contribution value, including the following steps:

[0016] 1-1) Assume client i has dataset D i There is m i Each attribute feature and n i The data quality contribution of each sample in round t is calculated using the entropy weight method. The calculation steps are as follows:

[0017] Step 1: Normalization. Attribute characteristics. in Where r = 1, 2, ..., m i It is the index of the attribute feature, c = 1, 2, ..., n i It is an index of the sample data. It is the standardized value of the attribute feature.

[0018]

[0019] Step 2: Calculate the proportion of the c-th sample under the r-th feature, which is regarded as the probability in the information entropy calculation.

[0020]

[0021] Step 3: E i (X i Let be the information entropy of the r-th attribute feature, and calculate the entropy weight of the r-th attribute feature using the information entropy.

[0022]

[0023]

[0024] Step 4: Weight the entropy of the data's attribute features Compared with the standardized value Multiply to obtain the data quality score δ for user i. i :

[0025]

[0026] Client i's data contribution in round t is:

[0027]

[0028] 1-2) The number of data points d that client i trains in round t. i The contribution calculation formula is:

[0029]

[0030] To incentivize clients to consistently provide high-quality data during training, the data contribution value considers not only the impact of current data but also the influence of historical data. The more recent the training epoch, the greater the impact of the data on the contribution value, meaning it carries a higher weight. After the update, the data contribution value for client i in epoch t is:

[0031]

[0032] in, and

[0033] 1-3) Furthermore, the local model loss reflects the model training result and the contribution of the training data to the global model; therefore, the local model loss is used to measure the model contribution of the training data. In the t-th round of training, the K clients participating in the training upload their local models to the server, and the server uses the dataset D. val The personalized model was validated by obtaining the model's loss value using the cross-entropy loss function. The average loss value is loss_avg t The formula for calculating the model contribution value of client i in round t is:

[0034]

[0035] The model contribution value is not only affected by the current loss, but also by the historical loss. The more recent the training epoch, the greater the impact on the model contribution value. After the update, the model contribution value of client i in epoch t is:

[0036]

[0037] in, and

[0038] The total contribution of client i at the end of the t-th round of training is:

[0039]

[0040] Furthermore, in step S4, a two-layer loss function is constructed, a personalized model for the client is trained, and the relative entropy between the personalized model and the global model is calculated and considered as the profit value. This includes the following steps:

[0041] 2-1) Unlike the loss function of traditional federated learning algorithms, the improved loss function is as follows:

[0042]

[0043] Where, θ i Let ω represent the personalized model for customer i, and λ be the regularization parameter controlling the strength of the personalized model. A large λ can allow customers with unreliable data to benefit from rich data aggregation, while a small λ can allow customers with sufficient data to prioritize personalization.

[0044] To avoid the case where λ=0, i.e., without personalized federated learning, clients are allowed to pursue their own models in different directions, but not far from the "reference point" ω contributed by each client. Based on this, personalized federated learning can be formulated as a two-layer problem:

[0045]

[0046] Here, the global model ω is obtained by aggregating the local models of multiple clients, and the personalized model θ of client i is... i This involves optimizing based on local data while maintaining a certain distance from the global model ω.

[0047] When federated learning training ends, the client gets a personalized model that is more suitable for the local data, rather than the same global model;

[0048] 2-2) Personalized model θ in historical training rounds iThe sum of the differences between the global model and the personalized model ω is the total reward for client i. The differences between the models are calculated using KL divergence. KL divergence (Kullback-Leibler Divergence), also known as relative entropy, measures the difference between two distributions. It is used to distinguish objects that are geometrically indistinguishable between model parameters and can accurately measure the similarity between models. Assume the global model and the personalized model for the i-th client are ω and ω', respectively. g = (x1, x2, ..., x m ), θ i = (x1, x2, ..., x m If θ is the value of t, then θ is the value of t. i Relative to ω g The formula for calculating the KL divergence is as follows:

[0049]

[0050] Where, ω(x) k ) and θ i (x k ) represents the global model ω g And the personalized model θ of the i-th customer i The k-th value, θ i and ω g The greater the difference between them, the greater the benefit of participating in this round of training. Assuming client i participates in a total of K rounds of training, the total benefit of participating in training is as follows:

[0051]

[0052] The beneficial effects of adopting the above technical solution are as follows:

[0053] The purpose of this invention is to provide a fair federated learning method based on a synergistic balance of contribution and reward. This method includes a federated dual-contribution evaluation module and a federated contribution-reward balancing algorithm. The federated dual-contribution evaluation module assesses participant contributions from the perspectives of local data quantity, quality, and model quality, using time as the cumulative weight for contribution values. This not only effectively evaluates the contributions of federated participants but also incentivizes them to continuously provide high-quality training. The federated contribution-reward balancing algorithm constructs a two-layer loss function to train a personalized client model. The inner local loss is updated using regularization constraints, while the outer global loss is updated using a FedAvg-like approach. The difference between the personalized model and the global model is counted as a reward. The aggregation weight is dynamically adjusted based on the client's contribution reward value, achieving a synergistic balance between participant contributions and rewards, and addressing the problem of poor global model performance and convergence under heterogeneous data conditions.

[0054] The proposed contribution-benefit balancing method was applied to the public datasets MNIST, EMNIST, and CIFAR-10. Experimental analysis showed that, in the two types of non-independent and identically distributed data partitioning, the proposed method can guarantee the fairness of the contribution-benefit balancing of federated learning clients while taking into account model performance. The Jain fairness index was improved by 0.02-0.08, and the model performance was improved by 1%-3%, proving that the proposed method achieves a collaborative balance of client contribution-benefit. Attached Figure Description

[0055] Figure 1 A framework diagram for a fair federated learning method based on contribution-benefit collaborative balancing;

[0056] Figure 2 A data partitioning plot for different α values ​​in Dirichlet;

[0057] Figure 3 A data partitioning diagram for different imbalances in Dirichlet;

[0058] Figure 4 A diagram showing the three data partitioning scenarios;

[0059] Figure 5 The experimental results are shown in the figure for comparison. Detailed Implementation

[0060] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0061] This invention, taking fairness in federated learning as its background and federated learning architecture as its carrier, proposes a fair federated learning method based on the collaborative balance of contribution and benefit. Its framework is as follows: Figure 1 As shown, it includes the following steps:

[0062] S1: Construct a federated learning framework that includes a federated dual contribution evaluation module and a federated contribution benefit balancing algorithm;

[0063] S2: The data is divided into non-independent and identically distributed data using the Dirichlet method;

[0064] S3: The entropy weight method is used to calculate the data quality of the client, and then the model contribution value is calculated based on the model loss. The time weight is added to obtain the final contribution value.

[0065] 1-1) Assume client i has dataset D i There is m i Each attribute feature and n i The data quality contribution of each sample in round t is calculated using the entropy weight method. The calculation steps are as follows:

[0066] Step 1: Normalization. Attribute characteristics. in Where r = 1, 2, ..., m i It is the index of the attribute feature, c = 1, 2, ..., n i It is an index of the sample data. It is the standardized value of the attribute feature.

[0067]

[0068] Step 2: Calculate the proportion of the c-th sample under the r-th feature, which is regarded as the probability in the information entropy calculation.

[0069]

[0070] Step 3: E i (X i Let be the information entropy of the r-th attribute feature, and calculate the entropy weight of the r-th attribute feature using the information entropy.

[0071]

[0072]

[0073] Step 4: Weight the entropy of the data's attribute features Compared with the standardized value Multiply to obtain the data quality score δ for user i. i :

[0074]

[0075] Client i's data contribution in round t is:

[0076]

[0077] 1-2) The number of data points d that client i trains in round t. i The contribution calculation formula is:

[0078]

[0079] To incentivize clients to consistently provide high-quality data during training, the data contribution value considers not only the impact of current data but also the influence of historical data. The more recent the training epoch, the greater the impact of the data on the contribution value, meaning it carries a higher weight. After the update, the data contribution value for client i in epoch t is:

[0080]

[0081] in, and

[0082] 1-3) Furthermore, the local model loss reflects the model training results and the contribution of the training data to the global model. Therefore, the local model loss is used to measure the model contribution of the training data.

[0083] In the t-th round, the K clients participating in the training upload their local models to the server, which uses dataset D. val The personalized model was validated by obtaining the model's loss value using the cross-entropy loss function. The average loss value is loss_avg t The formula for calculating the model contribution value of client i in round t is:

[0084]

[0085] The model contribution value is not only affected by the current loss, but also by the historical loss. The more recent the training epoch, the greater the impact on the model contribution value. After the update, the model contribution value of client i in epoch t is:

[0086]

[0087] in, and

[0088] The total contribution of client i at the end of the t-th round of training is:

[0089]

[0090] S4: Construct a two-layer loss function, train the client's personalized model, calculate the relative entropy between the personalized model and the global model, and regard it as the profit value;

[0091] 2-1) Unlike the loss function of traditional federated learning algorithms, the improved loss function is as follows:

[0092]

[0093] Where, θ i Let ω represent the personalized model for customer i, and λ be the regularization parameter controlling the strength of the personalized model. A large λ can allow customers with unreliable data to benefit from rich data aggregation, while a small λ can allow customers with sufficient data to prioritize personalization.

[0094] To avoid the case where λ=0, i.e., without personalized federated learning, clients are allowed to pursue their own models in different directions, but not far from the "reference point" ω contributed by each client. Based on this, personalized federated learning can be formulated as a two-layer problem:

[0095]

[0096] Here, the global model ω is obtained by aggregating the local models of multiple clients, and the personalized model θ of client i is... i This involves optimizing based on local data while maintaining a certain distance from the global model ω.

[0097] When federated learning training ends, the client gets a personalized model that is more suitable for the local data, rather than the same global model;

[0098] 2-2) Personalized model θ in historical training rounds i The sum of the differences between the model and the global model ω is the total reward for client i. The differences between models are calculated using KL divergence. KL divergence (Kullback-Leibler Divergence), also known as relative entropy, measures the difference between two distributions. It is used to distinguish objects that are geometrically indistinguishable between model parameters and can accurately measure the similarity between models.

[0099] Assume the global model and the personalized model for the i-th customer are ω and ω, respectively. g = (x1, x2, ..., x m ), θ i = (x1, x2, ..., x m If θ is the value of t, then θ is the value of t. i Relative to ω g The formula for calculating the KL divergence is as follows:

[0100]

[0101] Where, ω(x) k ) and θ i (x k ) represents the global model ω g And the personalized model θ of the i-th customer i The k-th value, θ i and ω g The greater the difference between them, the greater the benefit of participating in this round of training.

[0102] Assuming client i participates in a total of K rounds of training, the total reward for training is as follows:

[0103]

[0104] S5: Adjust the aggregate weights based on the client's contribution and revenue values, and the updated global model enters the next round of training.

[0105] Based on the above steps, this invention effectively addresses the fairness issue of imbalanced client contribution rewards in federated learning under non-independent and identically distributed data. It proposes a fair federated learning method based on a collaborative balance of contribution rewards, comprising a federated dual-contribution evaluation module and a federated contribution reward balancing algorithm. The federated dual-contribution evaluation module assesses participant contributions from the perspectives of local data quantity, quality, and model quality, using time as the cumulative weight for contribution values. This not only effectively evaluates the contributions of federated participants but also incentivizes them to continuously provide high-quality training. The federated contribution reward balancing algorithm constructs a two-layer loss function to train personalized client models. The inner local loss is updated using regularization constraints, while the outer global loss is updated using a FedAvg-like approach. The difference between the personalized model and the global model is counted as a reward. The aggregation weight is dynamically adjusted based on the client's contribution reward value, achieving a collaborative balance between participant contributions and rewards, and resolving the problem of poor global model performance and convergence under heterogeneous data.

[0106] Experimental verification of this invention based on a fair federated learning method that balances contribution and benefit:

[0107] 1. Test Environment

[0108] The system uses Windows 11, an Intel Core i5-124600KF CPU at 3.7GHz and an NVIDIA GeForce RTX 4070 GPU. The development environment is Python 3.11.3, and the deep learning frameworks used are PyTorch 2.1.0 and Torchvision 0.16.0.

[0109] 2. Experimental verification

[0110] Experimental Results and Analysis on Public Datasets MNIST, EMNIST, and CIFAR-10

[0111] (1) Dataset Description

[0112] This section selects the MNIST, EMNIST, and CIFAR-10 datasets as experimental datasets. The MNIST dataset is a handwritten digit recognition dataset; its input is a 28×28 image, and the output is class labels between 0 and 9, including 60,000 training samples and 10,000 test samples. The EMNIST dataset is an extended version of the MNIST handwritten digit dataset, containing a wider character set, including uppercase letters AZ, lowercase letters az, and digits 0-9; it also uses a 28×28 image as input and outputs 62 class labels. The CIFAR-10 dataset is an image dataset for object recognition, with 10 classes, each containing 6,000 32×32 color images, of which 5,000 are training samples and 1,000 are test samples.

[0113] Table 1 Dataset Features

[0114]

[0115] (2) Model parameters

[0116] This section uses a Convolutional Neural Network (CNN) for training. For the MNIST dataset, the CNN consists of two 5×5 convolutional layers (the first with 32 channels, the second with 64 channels), two 2×2 pooling layers, and one fully connected ReLU activation layer (with 512 units). For the EMNIST dataset, the CNN consists of three 5×5 convolutional layers (the first with 32 channels, the second with 32 channels, and the third with 64 channels), two 2×2 pooling layers, and one fully connected ReLU activation layer (with 256 units). For the CIFAR-10 dataset, the CNN consists of two 5×5 convolutional layers (the first with 64 channels, the second with 64 channels), two 2×2 pooling layers, and two fully connected ReLU activation layers (with 384 and 192 units respectively). Each training epoch uses the SGD (stochastic gradient descent) optimizer with a learning rate of 0.01, 100 training epochs, 5 local training epochs, and 10 local training batches.

[0117] (3) Comparative analysis of experimental results

[0118] To verify the effectiveness and fairness of the FedCBB method for non-independent and identically distributed data, the experimental results are shown in Table 2.

[0119] Table 2 Comparison of accuracy for different data partitions

[0120]

[0121] As shown in Table 2, the experimental results reveal that the proposed FedCBB algorithm achieves varying degrees of accuracy improvement compared to other methods on both Non-IID partitioning scenarios in the MNIST, EMNIST, and CIFAR-10 datasets. While the FedProx algorithm mitigates the impact of data heterogeneity by adding a proximal term to the local loss function, ensuring that client-side updates do not deviate from the global model, it does not consider model fairness, resulting in limited accuracy improvement. Although the FedMGDA+ algorithm transforms the federated problem into a multi-objective optimization problem, improving fairness without sacrificing client performance, its performance and convergence are significantly poor on the Non-IID MNIST dataset, and these issues worsen with increasing Non-IID levels. The Per-FedAvg algorithm, based on the meta-learning MAML concept, implements personalized federated learning, effectively handling non-independent and identically distributed data, and shows improved performance compared to FedProx, but still neglects fairness. In contrast, FedCBB addresses both the poor model accuracy and unfairness caused by heterogeneous data. By training local personalized models based on client contributions, it achieves both fairness and mitigates the impact of data heterogeneity. Therefore, FedCBB has a more significant advantage in federated learning.

[0122] On the MNIST dataset with α = 0.3, the proposed algorithm converged after 25 iterations with an accuracy of 96.27%. The Per-FedAvg algorithm converged after 30 iterations with an accuracy of 95.31%, and the FedProx algorithm converged after 35 iterations with an accuracy of 93.21%. Therefore, the comparison shows that the proposed algorithm has a faster convergence speed and higher accuracy, demonstrating its effectiveness. Compared to the MNIST dataset with 10 label categories, the EMNIST dataset with 62 label categories better reflects the impact of Non-IID on federated learning. Even though the accuracy of each algorithm changes significantly with increasing Non-IID (α from 0.5 to 0.3), the proposed algorithm still achieves an average accuracy improvement of 0.0187. Therefore, it can be demonstrated that the proposed algorithm not only outperforms other algorithms in performance and convergence speed on non-independent and identically distributed datasets with fewer label categories, but also has certain advantages on datasets with more label categories.

[0123] Further fairness assessment indicators were adopted using Jain's Fairness Index, which was proposed by Raj Jain in 1984. It is an index that measures the fairness of resource allocation and is used to evaluate the efficiency and fairness of resource allocation in a system.

[0124] The Jain Fairness Index is calculated using the following formula:

[0125]

[0126] Where, x i Let be the resource share obtained by the i-th user, N be the total number of users, and the fairness index J(x) ranges from [1 / N, 1]. J(x) = 1 represents the most unfair situation, where only one user receives all resources; J(x) = 1 represents the fairest situation, where all users receive the same resources. In this section, x is the ratio of a client's contribution to their reward. The larger the J value is, the closer it is to 1, indicating that more clients' contributions and rewards are matched. The comparison results are shown in Table 3.

[0127] Table 3. Comparison of Fairness of Different Data Splits

[0128]

[0129] As shown in Table 3, the experimental results reveal that the proposed FedCBB algorithm achieves higher and fairer Jain values ​​compared to other methods in both Non-IID partitioning scenarios on the MNIST, EMNIST, and CIFAR-10 datasets, with a lead of 0.02-0.08. The greater the data heterogeneity, the more difficult it is to balance the client's contribution and benefits, resulting in a smaller Jain fairness index. When α decreases from 0.5 to 0.3, FedProx, FedMGDA+, and Per-Fedavg all show a Jain value decrease of 0.03-0.04, while FedCBB demonstrates more stable fairness with only a Jain decrease of 0.01-0.02.

[0130] In summary, the proposed FedCBB algorithm outperforms FedProx, FedMGDA+, and Per-FedAvg under various Non-IID partitioning scenarios. FedCBB calculates client contributions from both local data and local loss perspectives, trains a local personalized model based on these contributions, and then assigns greater weight to high-contribution clients during the global model aggregation stage, resulting in a better-performing model. This approach also addresses the issues of balancing client contribution gains and poor model generalization and accuracy under heterogeneous data conditions.

[0131] 3. Conclusion

[0132] To address the issues of unfair participant contribution rewards and poor generalization of the global model caused by heterogeneous data, a fair federated learning method based on collaborative balancing of contribution rewards is proposed. First, to solve the problem of difficulty in evaluating client contributions, a federated dual-contribution evaluation module is proposed, calculating participant contributions from both local data and model loss perspectives, and assigning weights to historical contributions. This not only effectively calculates contributions but also incentivizes participants to continuously provide high-quality data. Second, to address the issue of different client contributions but the same rewards, a two-layer optimized loss function is designed to train personalized models more suitable for local data, and the difference between the global model and personalized models is considered as the reward for this round. Finally, a federated contribution reward balancing algorithm is proposed, dynamically adjusting to ensure equitable client contribution rewards, achieving fair global model aggregation. Experiments demonstrate that on the Dirichle-split MNIST, EMNIST, and CIFAR-10 datasets, the FedCBB method achieves a 1-3% performance improvement compared to FedProx, Per-FedAvg, and FedMGDA+ methods, with a Jain value improvement of 0.02-0.08. However, there are still shortcomings in this work. For example, training personalized models for all clients is costly, and the global model is the optimal solution for some clients, so no additional personalized training is needed. Future work should consider selectively training personalized models.

[0133] The foregoing detailed examples of the present invention are merely preferred embodiments and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the present invention should still fall within the patent coverage of the present invention.

Claims

1. A fair federated learning method based on contribution-reward collaborative balance, the method being used to process image datasets, ensuring a collaborative balance between the client's contribution value and reward value, characterized in that: Includes the following steps: S1: Construct a federated learning framework that includes a federated dual contribution evaluation module and a federated contribution benefit balancing algorithm; S2: The data is divided into non-independent and identically distributed data using the Dirichlet method; S3: The entropy weight method is used to calculate the data quality of the client, and then the model contribution value is calculated based on the model loss. The time weight is added to obtain the final contribution value. S4: Construct a two-layer loss function, train the client's personalized model, calculate the relative entropy between the personalized model and the global model, and regard it as the profit value; S5: Adjust the aggregate weights based on the client's contribution and revenue values, and the updated global model enters the next round of training; In step S3, the entropy weight method is used to calculate the data quality of the client, then the model contribution value is calculated based on the model loss, and a time weight is added to obtain the final contribution value. This includes the following steps: 1-1) Assume client i has dataset D i There is m i Each attribute feature and n i The data quality contribution of each sample in round t is calculated using the entropy weight method. The calculation steps are as follows: Step 1: Normalization processing, attribute features in Where r = 1, 2, ..., m i It is the index of the attribute feature, c = 1, 2, ..., n i It is an index of the sample data. It is the standardized value of the attribute feature. Step 2: Calculate the proportion of the c-th sample under the r-th feature, which is regarded as the probability in the information entropy calculation. : Step 3: E i (X i Let be the information entropy of the r-th attribute feature, and calculate the entropy weight of the r-th attribute feature using the information entropy. : Step 4: Weight the entropy of the data's attribute features Compared with the standardized value Multiply to obtain the data quality score for user i. : Client i's data contribution in round t is: 1-2) The number of data points d that client i trains in round t. i The contribution calculation formula is: To incentivize clients to consistently provide high-quality data during training, the data contribution value considers not only the impact of current data but also the influence of historical data. The more recent the training epoch, the greater the impact of the data on the contribution value, meaning it carries a higher weight. After the update, the data contribution value for client i in epoch t is: in, and , 1-3) Furthermore, the local model loss reflects the model training results and the contribution of the training data to the global model. Therefore, the local model loss is used to measure the model contribution of the training data. In the t-th round, the K clients participating in the training upload their local models to the server, which uses dataset D. val The personalized model was validated by obtaining the model's loss value using the cross-entropy loss function. The average loss value is The formula for calculating the model contribution value of client i in round t is: The model contribution value is not only affected by the current loss, but also by the historical loss. The more recent the training epoch, the greater the impact on the model contribution value. After the update, the model contribution value of client i in epoch t is: in, and The total contribution of client i at the end of the t-th round of training is: .

2. The fair federated learning method based on contribution-benefit collaborative balancing according to claim 1, characterized in that: In step S4, a two-layer loss function is constructed, a personalized model for the client is trained, and the relative entropy between the personalized model and the global model is calculated and considered as the profit value. This includes the following steps: 2-1) Unlike the loss function of traditional federated learning algorithms, the improved loss function is as follows: Where, θ i Let ω represent the personalized model for customer i, and λ be the regularization parameter controlling the strength of the personalized model. A large λ can allow customers with unreliable data to benefit from rich data aggregation, while a small λ can allow customers with sufficient data to prioritize personalization. To avoid the case where λ=0, i.e., without personalized federated learning, clients are allowed to pursue their own models in different directions, but not far from the "reference point" ω contributed by each client. Based on this, personalized federated learning can be formulated as a two-layer problem: Here, the global model ω is obtained by aggregating the local models of multiple clients, and the personalized model θ of client i is... i This involves optimizing based on local data and maintaining a certain distance from the global model ω; when federated learning training ends, the client obtains a personalized model that is more suitable for the local data, rather than the same global model. 2-2) Personalized model θ in historical training rounds i The sum of the differences between the model and the global model ω is the total reward for client i. The differences between the models are calculated using KL divergence. KL divergence, also known as relative entropy, measures the difference between two distributions. It is used to distinguish objects that are geometrically indistinguishable between model parameters and can accurately measure the similarity between models. Assume the global model and the personalized model for the i-th customer are ω and ω, respectively. g = (x1, x2, ..., x m ), θ i = (x1, x2, ..., x m If θ is the value of t, then θ is the value of t. i Relative to ω g The formula for calculating the KL divergence is as follows: Where, ω(x) k ) and θ i (x k ) represents the global model ω g And the personalized model θ of the i-th customer i The k-th value, θ i and ω g The greater the difference between them, the greater the benefit of participating in this round of training; assuming client i participates in a total of K rounds of training, the total benefit of participating in training is as follows: 。