Category distribution-aware incentive mechanism contribution evaluation method for heterogeneous federated learning
By detecting free-rider attackers through K-means clustering and data distribution similarity, and by adjusting weights using personalized category difference indices and ReLU functions, the problem of uneven client contributions caused by data heterogeneity is solved. This achieves efficient convergence and improved accuracy of the global model, making it suitable for scenarios such as drone services.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 上海霄元创新中心
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-02
AI Technical Summary
The existing federated learning incentive mechanism has failed to effectively identify and compensate for the imbalance of client contributions caused by data heterogeneity, resulting in divergence in the global model optimization direction and affecting model performance and client participation.
By detecting free-rider attackers through K-means clustering and cosine similarity of data distribution, the Personalized Category Difference Index (PCDI) is calculated to quantify data quality. The aggregation weights are then adjusted using the ReLU function to achieve fair evaluation and model-weighted aggregation of high-quality clients.
It significantly improves the robustness and security of the incentive mechanism, ensures the convergence speed and accuracy of the global model, attracts more high-quality clients to participate, and is particularly suitable for scenarios such as drone services that require on-demand data collection and model training.
Smart Images

Figure CN122133847A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of federated learning, and in particular relates to a difference-aware contribution evaluation method and system for heterogeneous data federated learning. Background Technology
[0002] Federated learning, as a distributed machine learning framework, enables joint model training among distributed clients while ensuring the privacy of local data on each participating client. For example, in the Drones-as-a-Service (DaaS) scenario, enterprises and city planners can recruit independent DaaS providers to achieve on-demand data collection and model training through federated learning. The success of federated learning heavily relies on the participation of a large number of clients, who need to provide sufficient and high-quality training data. However, participating in federated learning consumes significant time, computing, and communication resources, and a lack of fair compensation will severely hinder voluntary participation from clients. Therefore, designing incentive mechanisms is crucial for federated learning systems. To this end, researchers have proposed various incentive mechanisms for federated learning. Traditional schemes quantify client contributions based on the size of the data used for training, with the core assumption that larger datasets improve global model performance. However, recent research has shown that evaluating client contributions solely based on data size is insufficient. To overcome this limitation, recent studies have incorporated data quality into the evaluation metrics for federated learning contributions.
[0003] However, due to differences in device usage habits among different clients, data samples on terminal devices often exhibit non-independent and identically distributed characteristics. To mitigate the negative impact of data heterogeneity, some studies optimize performance by adjusting local models on the client side. These schemes constrain the update direction of local models to ensure that local optimization objectives align with global optimization objectives. However, these improved aggregation methods do not consider the inherent class imbalance problem in client data. Affected by this imbalance, different local models will optimize towards their respective local objectives, leading to divergent optimization directions. Consequently, it becomes difficult to obtain a robust global model by aggregating these divergent local models. Summary of the Invention
[0004] The purpose of this invention is to provide a difference-aware contribution evaluation method and system for heterogeneous federated learning, which can obtain a robust global model and improve the quality of client participation in federated learning.
[0005] To solve the above problems, the technical solution of the present invention is as follows: A difference-aware contribution evaluation method for heterogeneous federated learning includes the following steps: The server receives local model parameters and local data distribution information uploaded by each client. Based on the local model parameters, it performs K-means clustering to divide the clients into multiple clusters. It calculates the cosine similarity of the data distribution of each client with other clients in its cluster. If the number of clients with a cosine similarity less than a preset threshold reaches one less than the total number of clients in the cluster, the client is determined to be a free-rider and removed. Otherwise, the client is added to the set of trusted clients. For each client in the set of trusted clients, calculate its Personalized Category Difference Index (PCDI). The PCDI quantifies the degree of difference between the client's data distribution and the ideal class equilibrium distribution by using the L2 distance between the number of samples in each category and the average number of samples. Based on the data volume of each trusted client and the personalized category difference index, the contribution evaluation value of each client is calculated, wherein the contribution evaluation value is the ratio of the data volume to the personalized category difference index. The model aggregation weights are determined based on the contribution evaluation values of each trusted client. These aggregation weights are obtained by non-linearly processing the linear combination of normalized data volume and personalized category difference index using the ReLU function. The local model parameters of each trusted client are then weighted and aggregated based on these aggregation weights to update the global model.
[0006] According to an embodiment of the present invention, the cosine similarity of the data distribution is obtained by the following calculation formula: in, and They represent the client respectively. and The local data distribution vector.
[0007] According to an embodiment of the present invention, a client is defined. The counter is as follows: in, For the preset threshold, For the k-th cluster, the criteria for determining a free-rider attacker are: If the above conditions are met, then the client... attackers who hitch a ride.
[0008] According to an embodiment of the present invention, the Personalized Category Difference Index (PCDI) is calculated using the following formula: Where L is the total number of categories. For the client The average number of samples.
[0009] According to an embodiment of the present invention, the contribution assessment value is calculated using the following formula: in, For the client The amount of data.
[0010] According to an embodiment of the present invention, the aggregate weights of the model are calculated using the following formula: in, To normalize the data volume, a and b are hyperparameters, and W is the number of trusted clients. To correct the linear unit function.
[0011] According to an embodiment of the present invention, the global model is updated using the following formula: in, For the client in the t-th round of training Local model parameters, For the client The model aggregates weights in the t-th training round.
[0012] A difference-aware contribution evaluation system for heterogeneous federated learning includes: The free-rider detection module is used to receive local model parameters and local data distribution information uploaded by each client, perform K-means clustering based on the local model parameters to divide the clients into multiple clusters, calculate the cosine similarity of the data distribution of each client with other clients in its cluster, and if the number of clients with the cosine similarity less than a preset threshold reaches the total number of clients in the cluster minus one, then the client is determined to be a free-rider attacker and removed; otherwise, the client is added to the set of trusted clients. The Personalized Category Difference Measurement Module is used to calculate the Personalized Category Difference Index (PCDI) for each client in the trusted client set. The PCDI quantifies the degree of difference between the client's data distribution and the ideal class balance distribution by using the L2 distance between the number of samples in each category and the average number of samples in that client. The contribution evaluation module is used to calculate the contribution evaluation value of each client based on the data volume of each trusted client and the personalized category difference index. The contribution evaluation value is the ratio of the data volume to the personalized category difference index. The model aggregation module is used to determine the model aggregation weight based on the contribution evaluation value of each trusted client. The aggregation weight is obtained by non-linear processing of the linear combination of normalized data volume and personalized category difference index using the ReLU function. Based on the aggregation weight, the local model parameters of each trusted client are weighted and aggregated to update the global model.
[0013] Because the present invention adopts the above technical solution, it has the following advantages and positive effects compared with the prior art: This invention presents a difference-aware contribution evaluation method for heterogeneous federated learning. Through a free-rider detection mechanism based on model parameter clustering and cosine similarity of data distribution, it effectively identifies and eliminates attackers submitting spurious data distributions before contribution evaluation, significantly improving the robustness and security of the incentive mechanism. By using a personalized class difference index (PCDI) to accurately quantify the difference between the client's data class distribution and the ideal class-balanced distribution, it intuitively reflects data quality without maintaining a validation dataset, overcoming the limitations of traditional methods that rely solely on data size or loss variations. Furthermore, by fusing data size and class difference to construct a contribution evaluation function, high-quality clients with large datasets and balanced class distributions receive higher contribution evaluations, ensuring the comprehensiveness and fairness of the contribution evaluation. Finally, by using the ReLU function to dynamically adjust the aggregation weights non-linearly, it effectively alleviates the divergence in local model optimization direction caused by data heterogeneity, thereby attracting more high-quality clients to participate in federated learning. This achieves a dual improvement in global model convergence speed and final accuracy, making it particularly suitable for application scenarios such as UAV services that require on-demand data collection and model training, and where client participation requires reward incentives. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the framework of a difference-aware contribution evaluation method for heterogeneous federated learning of data in one embodiment of the present invention. Figure 2 This is a schematic diagram of a free-rider detection algorithm in one embodiment of the present invention; Figure 3 This is a schematic diagram of a contribution evaluation algorithm in one embodiment of the present invention; Figure 4 This is a schematic diagram of a model aggregation algorithm in one embodiment of the present invention; Figure 5 This is a schematic diagram comparing the contribution evaluation performance in one embodiment of the present invention. Detailed Implementation
[0015] The following detailed description, in conjunction with the accompanying drawings and specific embodiments, provides a further detailed explanation of the difference-aware contribution evaluation method and system for heterogeneous federated learning proposed in this invention.
[0016] This embodiment provides a difference-aware contribution evaluation method for heterogeneous federated learning. To encourage high-quality clients to participate in federated learning, the server typically provides rewards to clients. A fair contribution evaluation method is crucial for the equitable distribution of rewards and the efficient aggregation of models. By attracting more high-quality clients, this method can guarantee the optimal performance of the global model.
[0017] Please refer to Figure 1 This difference-aware contribution evaluation method for heterogeneous federated learning mainly includes three core modules: free-rider detection, personalized category difference measurement, and contribution evaluation, as well as determining aggregation weights based on contribution evaluation results.
[0018] Specifically, this difference-aware contribution evaluation method for heterogeneous federated learning includes the following steps: S1: The server receives the local model parameters and local data distribution information uploaded by each client, performs K-means clustering based on the local model parameters, and divides the clients into multiple clusters; calculates the cosine similarity of the data distribution of each client with other clients in its cluster. If the number of clients with a cosine similarity less than a preset threshold reaches the total number of clients in the cluster minus one, the client is determined to be a free-rider and removed; otherwise, the client is added to the set of trusted clients. S2: For each client in the set of trusted clients, calculate its Personalized Class Difference Index (PCDI). The PCDI quantifies the degree of difference between the client's data distribution and the ideal class equilibrium distribution by the L2 distance between the number of samples in each class and the average number of samples in that client. S3: Based on the data volume and personalized category difference index of each trusted client, calculate the contribution evaluation value of each client. The contribution evaluation value is the ratio of data volume to personalized category difference index. S4: Determine the model aggregation weight based on the contribution evaluation value of each trusted client. This aggregation weight is obtained by non-linear processing of the linear combination of normalized data volume and personalized category difference index using the ReLU function. Based on this aggregation weight, the local model parameters of each trusted client are weighted and aggregated to update the global model.
[0019] In step S1, clients may submit fake data distributions to boost their own utility. To address this issue, this embodiment incorporates a free-rider detection mechanism before contribution evaluation. For detailed procedures, please refer to [link / reference needed]. Figure 2 .
[0020] This free-rider detection mechanism is based on the principle that models trained on clients with similar training data distributions also follow a similar principle. Taking image classification tasks as an example, where In the t-th round of training, the goal is to... NA free-rider attacker was detected in one of the clients. Assume the first client... Local datasets for each client have There are training samples, and their local data distribution is defined as follows: ,in, Indicates the client The number of samples for each class of images in the training data satisfies and The algorithm first considers the local model parameters. Using the K-means clustering algorithm, all clients were divided into multiple clusters. After clustering is complete, it is necessary to determine the cosine similarity between clients within each cluster. The cosine similarity of the data distribution between clients is defined as follows: If the client's data distribution differs significantly from that of other clients in its cluster, i.e., the cosine similarity is less than a predefined threshold... If the condition is met, the client is marked as a free-rider attacker. The counter is defined as follows: In cluster In the middle, with the client The number of clients with significantly different cosine similarities is represented as .if So, the client It is honest and will be added to the set. Otherwise, the client They are free-rider attackers.
[0021] By using free-rider detection, a set of trustworthy clients is selected. Data size is crucial for improving the overall model quality; generally, larger datasets result in better generalization performance. However, evaluating each client's contribution solely based on data size is not the most effective approach. Furthermore, metrics based on loss reduction require maintaining a validation dataset, which is often difficult to obtain.
[0022] Therefore, in step S2, this embodiment proposes a novel indicator: the Personalized Category Difference Index (PCDI), as an effective supplementary indicator for measuring client data quality. This indicator can effectively reflect category information, and the more uniform the distribution of client data, the greater its contribution to the global model. First, the client... The average data distribution is defined as: Computing Client The function for measuring personalized category differences is defined as follows: That is, through Distance Quantization Client The difference between this dataset and an ideal class-balanced dataset with uniform label distribution.
[0023] The contribution of each client can be calculated based on the Personalized Class Difference Index (PCDI). Given the uniqueness of client-local data in federated learning, step S3 in this embodiment focuses on two key factors: data size. and Personalized Category Difference Index By integrating the two metrics mentioned above, a more comprehensive contribution assessment can be provided in scenarios with heterogeneous labels. Please see [link / reference]. Figure 3 Contribution evaluation function The definition is as follows: Based on the contribution evaluation results, the weight allocation function for step S4 in this embodiment is defined as follows: in, , The ReLU function handles negative values. The hyperparameter 'a' in the function is used for balancing. and The hyperparameter 'b' is used to adjust the aggregation weights. (Client data volume) The larger the value, the higher the individual category difference index. The smaller the value, the larger the assigned aggregation weight. In the t-th training round, the aggregation parameters are used to update the global model. Defined as: in, It is a client The model aggregates weights in the t-th training round, using a weighting algorithm. Decide, This indicates the number of winning clients in this training round. For details, please refer to [link / reference]. Figure 4 .
[0024] The above method achieves a balance between security, fairness, and model effectiveness in the federated learning incentive mechanism through a four-stage design: free-rider detection, personalized category difference measurement, contribution evaluation, and model aggregation. Specifically, this is manifested in the following ways: First, by employing a free-rider detection mechanism based on model parameter clustering and cosine similarity of data distribution, attackers submitting false data distributions can be effectively identified and eliminated before contribution evaluation, significantly improving the robustness and security of the incentive mechanism. Second, by using the personalized class difference index (PCDI) to accurately quantify the difference between the client's data class distribution and the ideal class-balanced distribution, data quality can be intuitively reflected without maintaining a validation dataset, overcoming the limitations of traditional methods that rely solely on data size or loss changes. Furthermore, by constructing a contribution evaluation function by fusing data size and class difference, high-quality clients with large data volumes and balanced class distributions receive higher contribution evaluations, ensuring the comprehensiveness and fairness of contribution evaluation. Finally, by using the ReLU function to dynamically adjust the aggregation weights non-linearly, the problem of divergent optimization directions in local models caused by data heterogeneity is effectively alleviated, thereby attracting more high-quality clients to participate in federated learning. This achieves a dual improvement in global model convergence speed and final accuracy, making it particularly suitable for application scenarios such as drone services where on-demand data collection and model training are crucial and client voluntary participation is essential.
[0025] To ensure the effectiveness of the above method, this application provides a performance evaluation experiment, the experimental setup of which is shown in the table below: Experimental description: This experiment uses four of the most commonly used learning models to evaluate the performance of the above method (referred to as FDFL): SimpleCNN, MLP, ResNet-18, and ResNet-50. These models are trained using the MNIST and CIFAR-10 datasets. MNIST is a handwritten digit dataset with 60,000 training samples and 10,000 test samples. The CIFAR-10 dataset consists of 10 categories, 50,000 training images, and 10,000 test images. All four learning models are well-established technologies, and their implementation details are not elaborated here.
[0026] To verify the performance of the contribution evaluation scheme in FDFL, the following four comparison schemes were selected for the experiment: FedAvg: This scheme is a recognized benchmark for federated learning, providing a standard reference for performance evaluation. The algorithm's aggregation weights are determined by the amount of data, which is an intuitive way to reflect client contributions.
[0027] FAIR: This approach proposes a groundbreaking federated learning framework that incorporates a quality-aware incentive mechanism. FAIR uses a loss reduction metric to quantify the quality of the client-local model and leverages historical learning data to predict the quality of the client-local model in the current round.
[0028] FedCor: This approach proactively selects clients based on relevance, which can effectively mitigate the decline in model accuracy caused by data heterogeneity and significantly improve the convergence of federated learning.
[0029] Pow-d: This scheme proposes a client selection strategy for heterogeneous data scenarios. By selecting clients with higher local losses, it mitigates the impact of data heterogeneity on convergence and improves the performance of the global model.
[0030] The four comparison schemes mentioned above are all existing technical solutions in federated learning, and their specific implementation methods will not be described here.
[0031] Using the above experimental setup I, there is one free-rider attacker in each round of training, i.e. The server's budget B is 65, and the number of iterations is 10. β The range of values is Four different learning tasks were performed using different models and datasets. Specifically, SimpleCNN and MLP models were trained on the MNIST dataset, while ResNet-18 and ResNet-50 were trained on the CIFAR-10 dataset. Experimental results are shown below. Figure 5 As shown.
[0032] Clearly, the method described in this application demonstrates superior performance across all training tasks, consistently outperforming other federated learning algorithms. β = 0 . At 5 o'clock, FDFL outperformed FAIR and FedAvg by 1.72% and 2.06%, respectively, on the SimpleCNN-MNIST task. For FedCor and Pow-d, the performance improvements were 4.02% and 6.2%, respectively. The advantages of FDFL became increasingly apparent with increasing heterogeneity and model complexity. These results demonstrate the effectiveness of the contribution evaluation method proposed in this application.
[0033] Based on the same concept, this application also provides a difference-aware contribution evaluation system for heterogeneous federated learning, including: The free-rider detection module is used to receive local model parameters and local data distribution information uploaded by each client, perform K-means clustering based on the local model parameters to divide the clients into multiple clusters, calculate the cosine similarity of the data distribution of each client with other clients in its cluster, and if the number of clients with the cosine similarity less than a preset threshold reaches the total number of clients in the cluster minus one, then the client is determined to be a free-rider attacker and removed; otherwise, the client is added to the set of trusted clients. The Personalized Category Difference Measurement Module is used to calculate the Personalized Category Difference Index (PCDI) for each client in the trusted client set. The PCDI quantifies the degree of difference between the client's data distribution and the ideal class balance distribution by using the L2 distance between the number of samples in each category and the average number of samples in that client. The contribution evaluation module is used to calculate the contribution evaluation value of each client based on the data volume of each trusted client and the personalized category difference index. The contribution evaluation value is the ratio of the data volume to the personalized category difference index. The model aggregation module is used to determine the model aggregation weight based on the contribution evaluation value of each trusted client. The aggregation weight is obtained by non-linear processing of the linear combination of normalized data volume and personalized category difference index using the ReLU function. Based on the aggregation weight, the local model parameters of each trusted client are weighted and aggregated to update the global model.
[0034] This system is used to implement the difference-aware contribution evaluation method for heterogeneous federated learning of data, and its implementation method is similar, so it will not be described in detail here.
[0035] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, if these changes fall within the scope of the claims of the present invention and their equivalents, they shall still fall within the protection scope of the present invention.
Claims
1. A difference-aware contribution evaluation method for heterogeneous federated learning, characterized in that, Includes the following steps: The server receives local model parameters and local data distribution information uploaded by each client, and performs K-means clustering based on the local model parameters to divide the clients into multiple clusters; Calculate the cosine similarity of the data distribution of each client with other clients in its cluster. If the number of clients with a cosine similarity less than a preset threshold reaches one less than the total number of clients in the cluster, then the client is determined to be a free-rider and removed. Otherwise, the client is added to the set of trusted clients. For each client in the set of trusted clients, calculate its Personalized Category Difference Index (PCDI). The PCDI quantifies the degree of difference between the client's data distribution and the ideal class equilibrium distribution by using the L2 distance between the number of samples in each category and the average number of samples. Based on the data volume of each trusted client and the personalized category difference index, the contribution evaluation value of each client is calculated, wherein the contribution evaluation value is the ratio of the data volume to the personalized category difference index. The model aggregation weights are determined based on the contribution evaluation values of each trusted client. These aggregation weights are obtained by non-linearly processing the linear combination of normalized data volume and personalized category difference index using the ReLU function. The local model parameters of each trusted client are then weighted and aggregated based on these aggregation weights to update the global model.
2. The difference-aware contribution evaluation method for heterogeneous federated learning according to claim 1, characterized in that, The cosine similarity of the data distribution is obtained using the following formula: in, and They represent the client respectively. and The local data distribution vector.
3. The difference-aware contribution evaluation method for heterogeneous federated learning as described in claim 1 defines the client. The counter is as follows: in, For the preset threshold, For the k-th cluster, the criteria for determining a free-rider attacker are: If the above conditions are met, then the client... attackers who hitch a ride.
4. The difference-aware contribution evaluation method for heterogeneous federated learning according to claim 1, characterized in that, The Personalization Category Difference Index (PCDI) is calculated using the following formula: Where L is the total number of categories. For the client The average number of samples.
5. The difference-aware contribution evaluation method for heterogeneous federated learning according to claim 1, characterized in that, The contribution assessment value is calculated using the following formula: in, For the client The amount of data.
6. The difference-aware contribution evaluation method for heterogeneous federated learning according to claim 1, characterized in that, The aggregate weights of the model are calculated using the following formula: in, To normalize the data volume, a and b are hyperparameters, and W is the number of trusted clients. To correct the linear unit function.
7. The difference-aware contribution evaluation method for heterogeneous federated learning according to claim 1, characterized in that, The global model is updated using the following formula: in, For the client in the t-th round of training Local model parameters, For the client The model aggregates weights in the t-th training round.
8. A difference-aware contribution evaluation system for heterogeneous federated learning, characterized in that, include: The free-rider detection module is used to receive local model parameters and local data distribution information uploaded by each client, and perform K-means clustering based on the local model parameters to divide the clients into multiple clusters; Calculate the cosine similarity of the data distribution of each client with other clients in its cluster. If the number of clients with a cosine similarity less than a preset threshold reaches one less than the total number of clients in the cluster, then the client is determined to be a free-rider and removed. Otherwise, the client is added to the set of trusted clients. The Personalized Category Difference Measurement Module is used to calculate the Personalized Category Difference Index (PCDI) for each client in the trusted client set. The PCDI quantifies the degree of difference between the client's data distribution and the ideal class balance distribution by using the L2 distance between the number of samples in each category and the average number of samples in that client. The contribution evaluation module is used to calculate the contribution evaluation value of each client based on the data volume of each trusted client and the personalized category difference index. The contribution evaluation value is the ratio of the data volume to the personalized category difference index. The model aggregation module is used to determine the model aggregation weight based on the contribution evaluation value of each trusted client. The aggregation weight is obtained by non-linear processing of the linear combination of normalized data volume and personalized category difference index using the ReLU function. Based on the aggregation weight, the local model parameters of each trusted client are weighted and aggregated to update the global model.