A fair federated learning method based on node contribution clustering

By using a node contribution-based clustering method, clients in federated learning are divided into multiple groups for training and aggregation. The global aggregation weights are adjusted according to the contribution, which solves the problems of model optimization conflict and contribution unfairness in federated learning, and achieves more efficient and fair model training results.

CN117196058BActive Publication Date: 2025-11-07BEIJING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310485711.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2025-11-07
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Existing federated learning methods are insufficient in terms of fairness, and cannot effectively solve problems such as model optimization conflicts between clients, malicious node sabotage, and unfair contribution rewards, resulting in unbalanced model performance and low overall efficiency.

Method used

We employ a node contribution-based clustering method, grouping clients with similar contributions for training and aggregation. We evaluate the contribution of each client using the Shapley value, and adjust the grouping and global aggregation weights based on the contribution. We design a fair reward mechanism to ensure that the model performance of each group matches its contribution.

Benefits of technology

It effectively alleviates optimization conflicts between clients, reduces the impact of malicious nodes, achieves fairness among clients and improves model performance, thereby increasing overall training efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117196058B_ABST
    Figure CN117196058B_ABST
Patent Text Reader

Abstract

The application provides a fair federated learning method based on node contribution clustering. First, grouping is performed according to the actual contribution degree of each client in federated learning, and clients with similar contribution are divided into the same group. In each iteration, first, intra-group aggregation is performed among the clients in each group, then the small group model update parameters obtained by the intra-group aggregation are uploaded to the server side, and the server side performs global aggregation on the models between different groups. After a period of global aggregation, each group can basically obtain the training information of other groups. At this time, the global federated learning process can be divided into groups, and each group can train its own personalized group model, so that each group can obtain a fair return matching its own contribution.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer application, and particularly relates to a fair federated learning method based on node contribution clustering. BACKGROUND

[0002] Federated learning is a new machine learning method for training distributed data sets. Traditional machine learning methods train all data collected on a centralized server, which exposes all participating users' data to serious privacy leakage. The core idea of the basic framework of federated learning is that data owners exchange and optimize model parameters or gradients based on various encryption mechanisms without sharing original private data, and rely on a central parameter server to aggregate and maintain a global shared model. Federated learning enables participating users to train local models using local data, and only transmits model parameter updates during transmission, avoiding the transmission of original data to the central server. In this way, federated learning not only enables efficient communication and model training to provide high-quality services to participating users, but also reduces the risk of privacy leakage.

[0003] In actual scenarios, federated learning has different descriptions and definitions of fairness. According to different research objectives, existing federated learning fairness research can be divided into:

[0004] (1) The fairness goal is to make the performance of each participating client model the same (referred to as federated fair learning based on average allocation).

[0005] (2) The fairness goal is to match the performance of the participating client local model with its actual contribution in the training process (referred to as federated fair learning based on distribution according to labor).

[0006] The theory of equal distribution aims to make each client participating in federated learning have the same performance. Traditional federated learning does not consider fairness, and the aggregated model may be biased towards certain attributes or clients, especially when the training data of the clients themselves is biased. This situation can make the performance of the poor client model worse and worse, causing the performance imbalance between client models. The research goal of federated fair learning based on the theory of equal distribution is to reduce the difference between clients while maintaining reasonable average performance, and to ensure the fairness of federated learning at a smaller cost through algorithm optimization and other methods. The research goal of the theory of equal distribution is to reduce the performance difference between federated learning clients and promote the final model of each participant to have the same performance, while also needing to balance between model accuracy and fairness. Representative methods are model optimization methods in the local training stage and aggregation rule modification in the global aggregation stage. However, in actual situations, the method of improving the performance of devices with poor performance by increasing their importance to improve their model performance so that all devices have the same performance cannot solve all fairness problems in federated learning. This method does not take into account the high-contribution clients and may potentially sideline high-quality client model optimization and performance, resulting in high-contribution clients not being treated fairly and ultimately may not be willing to share data and participate in federated learning.

[0007] The theory of distribution according to labor aims to match the final performance of participating clients with their actual contribution in federated learning. In actual heterogeneous data scenarios, some participants may promote the global optimization process, while some participants may harm the global optimization process, resulting in a large difference in model contribution and performance between different clients. In this case, if the idea of equal distribution theory is still used to make each client have the same performance, it is unfair to clients who contribute more in the training process, which will greatly harm their motivation to participate in federated learning. Therefore, the research goal of federated fair learning based on the theory of distribution according to labor is for participating clients to ultimately obtain a reward that matches their actual contribution in federated learning. The research goal of the theory of distribution according to labor is for participating clients to obtain a reward in federated learning that matches their actual contribution. Representative methods include contribution evaluation mechanisms, fair reward mechanisms, and the design of incentive mechanisms. However, in actual situations, the method of the theory of distribution according to labor cannot solve all fairness problems in federated learning, as this method will make good clients better and better, resulting in a larger performance gap between clients. In addition, in the current research on contribution evaluation and reward mechanisms, the initial evaluation has a too large impact on the overall effect. If a client does not receive a good evaluation in the previous round of evaluation, it will be at a disadvantage in the next round of training, and this disadvantage will continue and accumulate round by round.

[0008] Xu et al. proposed a Cosine Gradient Shapley Value (CGSV) method to calculate the contribution degree of the client, using the cosine similarity between the local model gradients of the client as the actual contribution, and through theoretical proof, it is concluded that the cosine similarity can effectively and accurately approximate the Shapley value. The core idea is that the participants who contribute more should be rewarded better. The contribution and reward of the participating nodes should be quantitative and suitable for the framework of federated learning. The specific method is: in the process of global aggregation, first calculate the cosine similarity between the gradient direction of each participating client update and the global model gradient direction, and measure the reputation value of different clients according to the cosine similarity. According to the reputation value, the aggregation weight of the client is determined, and according to the size of the reputation value, the amount of parameters downloaded by the client from the server in the local update stage is divided, and the client with high contribution value obtains more parameters, so as to realize the fairness of federated learning.

[0009] The Shapley value can effectively evaluate the contribution degree of individuals under ideal conditions, but the calculation of the Shapley value in the complex scenario of federated learning still needs to be studied. In practical applications, even if the same data set and participants are used, the Shapley value of the participants calculated using different models is not the same. In addition, in each iteration of federated learning, the server selects some clients for global aggregation, and if one of them is not selected, even if two clients have the same data, they may receive completely different Shapley value calculations.

[0010] In addition, the method of Shapley value is to optimize the efficiency of calculation, but it still cannot solve the problem of fairness in federated learning. 1. Optimization conflict between clients. There is a big difference in the update direction of the local model, which leads to the deviation of the local model update optimized by the client from the global model update aggregated by the server, and the difference between the final models is large. For some clients, the accuracy of the model may be significantly reduced. 2. Unfair contribution and reward mechanism. The performance of each client model should match their actual contribution in the training process. Intuitively, clients with large and high-quality data sets should be able to make higher contributions, and clients who contribute more should receive better rewards. If two clients contribute equally to the federated learning training process, they should receive the same reward. According to the actual contribution of the client, the aggregation weight is adjusted and the reward is distributed. 3. Malicious node destruction. In federated learning, clients are strangers and do not trust each other, and the global model is aggregated according to the model updates uploaded by the clients themselves, which cannot avoid the existence of selfish or malicious clients who can destroy the update process of the global model by uploading false or maliciously forged update information to obtain or destroy the update process of the global model. SUMMARY

[0011] Embodiments of the present application provide a fair federated learning method based on node contribution clustering to solve the problems existing in the prior art.

[0012] To achieve the above object, the present application adopts the following technical solutions.

[0013] A fair federated learning method based on node contribution clustering comprises:

[0014] S1 initializes the parameters and local models of all clients participating in federated calculation;

[0015] S2 trains the local model of each client participating in federated calculation through the local training data of each client, and aggregates the trained local models;

[0016] S3 evaluates each client participating in federated calculation by the Shapley value method to obtain the contribution degree of each client participating in federated calculation;

[0017] S4 clusters and groups all clients participating in federated calculation based on the contribution degree of each client participating in federated calculation;

[0018] S5 trains the local model of each group of clients respectively, aggregates the update information of the local model of each group of clients, and obtains the update parameters for updating the global model of each group of clients; during the training process, the clients in the same group share the update parameters of the global model;

[0019] S6 obtains the contribution proportion of each group by calculation, takes the contribution proportion of each group as the global aggregation weight, and globally aggregates the local model of each group of clients based on the contribution proportion of each group; after the global aggregation is completed, the updated model parameters are sent to all clients participating in federated calculation based on the contribution proportion of each group;

[0020] S7 repeats steps S2 to S6 multiple times until the intra-group model of each group can fit the corresponding distribution;

[0021] S8 terminates step S6, continues to train the intra-group model of each group by repeatedly performing steps S2 to S5 multiple times, and obtains a target model;

[0022] The target model is used to send to one or more platforms.

[0023] Preferably, step S3 comprises:

[0024] by the formula

[0025]

[0026] Calculate the Shapley value of client i participating in federated computing for each round of training of its local model; where U t Let represent the utility function in round t. This indicates that the local model for each client is on any subset, C is a configurable constant, and n represents the total number of clients participating in federated computation;

[0027] Through

[0028]

[0029] The Shapley values ​​of client i participating in the federated computation are summed in each round to obtain the contribution s of client i. i .

[0030] Preferably, step S4 includes:

[0031] S41, based on the contribution of each client participating in federated computing, uses the formula...

[0032] sim(s i ,s j )=exp(-d(s i ,s j ) 2 / 2σ 2 (3)

[0033] Calculate x for the two clients sequentially i and x j Contribution between s i and s j Based on the calculated similarity among all clients, a similarity matrix A is constructed; where d(s i ,s j ) is the distance function, and sim represents the calculation of x between two clients. i and x j Contribution between s i and s j The similarity is given by exp, which represents an exponential function with the natural constant e as the base, and σ is the scale parameter.

[0034] S42 Through Type

[0035] [usv]=svd(A) (4)

[0036] Perform singular value decomposition on the similarity matrix A; where u and v are the left and right singular vector matrices of the similarity matrix A, and s is the singular value matrix of the similarity matrix A, s = diag(σ1, σ2...σ). n );

[0037] S43 will take the singular value matrix s and find the (σ1,σ2...σ)... n) sequentially compared with a preset threshold value p, the number of values greater than the threshold value is counted as the number of groups K to be divided;

[0038] S44 according to the number of groups K completed by the division, sequentially clustering and grouping the clients to obtain the clustering and grouping results C1, C2...C K .

[0039] Preferably, step S6 comprises:

[0040] S61 by the formula

[0041]

[0042] Calculate the aggregation weight of client i in the group aggregation process, and obtain the contribution proportion of the group to which the client i belongs based on the aggregation weight of client i in the global aggregation process; wherein, F i (θ) is the local objective function of client i, p i is the global aggregation weight of client i;

[0043] S62 by the formula

[0044]

[0045] Calculate the contribution degree of each group; wherein, represents the contribution degree of the kth group, and N represents the number of clients in the kth group;

[0046] S63 based on the contribution degree of all groups Sort all groups according to the proportion of contribution degree Distribute the latest global model parameters to all clients in each group in the corresponding proportion;

[0047] S64 based on the contribution degree of each group and the update degree of the group model, by the formula

[0048]

[0049] And

[0050]

[0051] Calculate the aggregation weight p k of each group in the global aggregation process; wherein, represents the contribution proportion weight of each group, represents the model weight of each group in the training process, and α and β are parameters of and respectively, α+β=1;

[0052] S65 judges whether the contribution degree in the global aggregation process of each group is less than the preset admission threshold γ, and if so, the group is deleted;

[0053] S66 globally aggregates the local model of the client of each group based on the aggregation weight of each group in the global aggregation process.

[0054] As can be seen from the technical solutions provided by the above embodiments of the application, the fair federated learning method based on node contribution clustering provided by the application first groups the clients according to the actual contribution degree of each client in the federated learning, and divides the clients with similar contribution into the same group. In each iteration, first, intra-group aggregation is performed among the clients of each group, then the small group model update parameters obtained by the intra-group aggregation are uploaded to the server side, and the server side globally aggregates the models between different groups. After a period of global aggregation, each group can basically obtain the training information of other groups. At this time, the global federated learning process can be divided into groups, and each group can train its own personalized group model, so that each group can obtain a fair return matching its own contribution.

[0055] Additional aspects and advantages of the application will be described in the following description, which will become apparent from the description, or will be learned by practice of the application. BRIEF DESCRIPTION OF DRAWINGS

[0056] In order to more clearly illustrate the technical solutions of the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0057] Figure 1 The processing flowchart of the fair federated learning method based on node contribution clustering provided by the application;

[0058] Figure 2 The architecture diagram of the fair clustering framework of the fair federated learning method based on node contribution clustering provided by the application;

[0059] Figure 3 The flowchart of a preferred embodiment of the fair federated learning method based on node contribution clustering provided by the application. DETAILED DESCRIPTION

[0060] Embodiments of the present application are described below in the context of several examples, which are shown in the drawings, wherein like or similar designations refer to like or similar elements or elements having the same or similar function throughout the several views. The embodiments described below are merely examples, which serve to explain the present application, and are not to be construed as limiting the present application.

[0061] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a," "an," and "the" as used herein are intended to include plural forms as well. It should be further understood that the terms "comprises", "comprising", "includes", "including", "contains", "containing", "has", "having", "united", "united with", "coupled", "coupled with", "connected", "connected with", "adapted to", "adapted to" and the like used herein are intended to be open-ended and non-limiting. It should be understood that, when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intervening elements. In addition, "connected" or "coupled" as used herein can include wireless connection or coupling. The term "and / or" as used herein includes any one or more of the associated listed items, as well as all combinations of the associated listed items.

[0062] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as that generally understood by those skilled in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have meanings consistent with those in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless otherwise defined.

[0063] In order to facilitate the understanding of the embodiments of the present application, the following will be further explained in conjunction with the drawings by way of several specific examples, and each embodiment does not constitute a limitation on the embodiments of the present application.

[0064] The present application provides a fair clustering framework based on federal node contribution for reducing optimization conflicts between federal nodes, ensuring fairness between federal learning nodes, and improving overall performance of participants. It is used to solve the following technical problems existing in the prior art:

[0065] 1) Client model optimization conflicts. In actual federated learning, each client can generate and collect data in real time, which makes the local data sets of clients usually non-identically distributed, causing the problem of data heterogeneity; in addition, there are also differences between client devices in computing and communication capabilities, and they can dynamically participate in the training process of federated learning at any time, causing the problem of device heterogeneity. Therefore, there is a big difference in the update direction of the local model, which causes the local model update obtained by the client optimization to deviate from the global model update obtained by the server aggregation, and the difference between the final models is large. For some clients, the accuracy of the model may be significantly reduced. How to reduce the optimization conflict between clients and improve the overall performance of the client model is the focus of the research;

[0066] 2) Existence of malicious node destruction. In federated learning, clients are strangers and do not trust each other, and the global model is aggregated according to the model updates uploaded by the clients themselves, which inevitably exists selfish or malicious destruction of clients, which can obtain or destroy the update process of the global model by uploading false or maliciously forged update information; how to improve the fairness of federated learning while reducing the destruction and impact of malicious nodes and ensure the privacy between clients is the key to the research;

[0067] 3) Unfair contribution and benefit mechanism. In the process of federated learning training, the data heterogeneity and device heterogeneity between clients cause the actual contribution of each client to be different, and it is necessary to evaluate the actual contribution of each client. At the same time, a fair aggregation reward mechanism needs to be designed to adjust the aggregation weight and allocate rewards according to the actual contribution of the client, so that the performance of each client model should match their actual contribution in the training process. How to improve the fairness between federated learning nodes and ensure that each node can be treated fairly is the core of the research;

[0068] The traditional federated learning method is to evaluate the contribution of each client and then allocate a fair reward to each client. However, in actual scenarios, there may be similar performance between clients. In addition, when the conflicting gradients have a large difference in their magnitude, the model accuracy may be significantly reduced for some clients. Using gradient distance to calculate the similarity of each client may bring fatal unfairness in fairness.

[0069] In this case, the application proposes a fair clustering framework based on the contribution of federal nodes to improve the fairness among all participating nodes in federal learning. In this framework, the server groups clients with similar contribution levels for model training, and the clients participating in federal learning determine their group according to their actual contribution in the training process. In the process of federal learning, the traditional single global model is broken down, and each group first trains and aggregates the intra-group model, and then the server updates the global aggregation, and the aggregation weight of each group is determined according to the actual contribution value of the group. Through this method, the fairness among federal nodes can be effectively guaranteed, and the performance of the node computing model can be improved.

[0070] Referring to Figure 1 The application provides a fair federal learning method based on node contribution clustering, comprising the following steps:

[0071] S1, initializing the parameters and local model of each client participating in federal computing;

[0072] S2, training the local model of each client participating in federal computing through the local training data of each client, and aggregating the trained local model;

[0073] S3, evaluating each client participating in federal computing by the Shapley value method to obtain the contribution degree of each client participating in federal computing;

[0074] S4, clustering and grouping all clients participating in federal computing based on the contribution degree of each client participating in federal computing;

[0075] S5, training the local model of each group of clients respectively, aggregating the update information of the local model of each group of clients, and obtaining the update parameters for updating the global model of each group of clients; during the training process, the clients in the same group share the update parameters of the global model;

[0076] S6, calculating the contribution proportion of each group, taking the contribution proportion of each group as the global aggregation weight, and globally aggregating the local model of each group of clients based on the contribution proportion of each group; after the global aggregation is completed, the updated model parameters are sent to all clients participating in federal computing based on the contribution proportion of each group;

[0077] S7, repeating steps S2 to S6 multiple times until the local model of each group of clients can fit the corresponding distribution;

[0078] S8 no longer carries out the process of global aggregation S6, and each group will continue to train the client of each group obtained in steps S2-S5 to only carry out group update to obtain the target model.

[0079] The trained target model is used to be sent to various platforms for application, and the application scenarios include target identification, communication, etc.

[0080] In the fair federated learning method based on node contribution clustering provided by the application, a fair clustering framework based on federated node contribution is proposed, and the system architecture is as shown in Figure 1 In this framework, the server side groups the clients with similar contribution degrees for model training, and the clients participating in federated learning will determine their group according to their actual contribution in the training process. In the process of federated learning, each group first trains and aggregates the intra-group model of the group, and then updates the global aggregation by the server, and the aggregation weight of each group is determined according to the actual contribution value of the group. Through this method, the fairness between federated nodes can be effectively guaranteed, and the performance of the node calculation model can be improved. Different from the current method, the framework proposed in the application mainly includes three main innovations:

[0081] Firstly, the application proposes a fair clustering framework of federated node contribution. In the actual federated learning process, the update direction of the local model in each client is very different, and the local model update optimized by the client will deviate from the global model update aggregated by the server, which finally leads to a large difference between the models. For some clients, the accuracy of the model may be significantly reduced. To solve this problem, the application is no longer limited to the restriction of the traditional federated learning global aggregation into one model, but groups the similar clients according to the contribution degree of the participants for training, and each group trains its own intra-group model. In order to obtain useful information in other groups, the server will globally aggregate the model update information of each group. After T rounds, each group obtains enough global information, and each group will only carry out intra-group update and maintain the intra-group federated learning model. Through this method, the performance of the model trained by each group is better than that of the only global model, because it can effectively alleviate the optimization conflict between clients. In addition, the similar clients in each group are combined for training, which can also accumulate more useful knowledge.

[0082] Secondly, the node clustering grouping module. Unlike the current clustering method, the application uses the contribution degree of each client as a similarity evaluation index. After the local training of the client is completed, the clients with similar contributions are grouped and divided according to the actual contribution of the client in the participation process. The contribution degree can better reflect the relationship between the clients, so that the different clients are grouped more accurately. In addition, the application does not need to specify the number K of clusters in advance, but is calculated according to the actual contribution degree of the client. The clients in each group will share the intra-group update parameters, and the server will globally aggregate the model update information of each group in order for the other groups to obtain useful information. After T rounds, each group obtains sufficient global information, and only intra-group update is performed in each group.

[0083] Finally, the fair aggregation and distribution module. According to the actual performance of different groups in federated learning, the application designs a fair global aggregation and calculation reward mechanism. In the global aggregation mechanism, the server end will calculate the contribution proportion of different groups and take it as the global aggregation weight, so that the group with high contribution degree will obtain higher aggregation weight, and the group with low contribution degree will obtain lower aggregation weight. After the global aggregation is completed, the server end will allocate the corresponding global model update parameters to each participating group according to the actual contribution of each participating group in the training process, and the task model with corresponding performance will be rewarded through the contribution size to avoid low value or malicious participants. The group with high contribution degree will download higher distributed model parameters as the calculation reward.

[0084] In a preferred embodiment, the method flowchart is as shown in Figure 2 The specific steps are as follows:

[0085] Step 1: initialization. All clients participating in federated calculation initialize their own parameters and models.

[0086] Step 2: local training. Each client downloads the global model from the server, and then trains its own local model using its local training data set. First, the local client initializes the parameters, and then uses the stochastic gradient descent (SGD) method to train its own model. Then the update information of the trained local model is sent to the server for further verification and aggregation.

[0087] Step 3: contribution evaluation. The application uses the Shapley value to evaluate the actual contribution of each participant. The Shapley value enumerates all possible participant combinations, and takes the expected marginal gain of data value of the participant joining the federation as its contribution. The method of Shapley value is intuitive and easy to understand, and ensures the fairness of the evaluation of the individual contribution of each participant. Let D1, D2, …, D n represent the data sets owned by n participants respectively, U tLet U t represent the utility function of the t-th round, then the calculation formula of the Shapley value of the i-th client in n is as follows.

[0088]

[0089] Where C is a settable constant, and n represents the total number of all clients participating in federated calculation. Different from the traditional Shapley value calculation method, in the iteration process of each round, the model performance of each client in any subset is calculated, and the Shapley value of this round is obtained. Finally, the values of all rounds are added, that is, the final contribution degree of the client i is obtained.

[0090] Step 4: Clustering grouping. The contribution degree of each client is used as the similarity evaluation index in the present application. When the local training of the client is completed, the clients with similar contribution are grouped and divided according to the actual contribution of the client in the participation process. The contribution degree can better reflect the relationship between the clients, so that the different clients can be grouped more accurately. In addition, the present application does not need to specify the number K of clusters in advance, but calculates it according to the actual contribution degree of the client.

[0091] Step 5: In-group aggregation. The present application is no longer limited to the restriction of traditional federated learning global aggregation into one model, but groups the participants according to their contribution degree and trains each group's model. The clients in each group share the in-group update parameters. In order to obtain useful information in other groups, the server globally aggregates the model update information of each group.

[0092] Step 6: Global update. In order to enable each group to obtain useful information in other groups, after several periods of local training, the server globally aggregates the in-group model of each cluster by performing global aggregation. Then the server calculates the global model update information by aggregating the in-group model parameters of each group. More importantly, the present application considers the actual situation of different groups and designs a fair aggregation and distribution mechanism in the global update stage. In the global aggregation mechanism, the server calculates the contribution proportion of different groups and uses it as the global aggregation weight, so that the group with high contribution degree will obtain higher aggregation weight, and the group with low contribution degree will obtain lower aggregation weight. After the global aggregation is completed, the server will also distribute the global model parameters and rewards matched with each group to the groups according to the actual contribution of each group.

[0093] It is worth noting that these steps will iterate T rounds until the intra-group model of each group can fit the corresponding distribution, and then each group can train the intra-group federated learning model in its own group without further global aggregation process of all groups. Breaking the limitation of traditional single global model, each group trains its own intra-group model. The present application considers that each group's trained model is better than only having a unique global model because it can alleviate the optimization conflict between clients and prevent the model accuracy of some clients from being significantly reduced. In addition, more useful knowledge can be accumulated within the group because each client in the group has similar performance.

[0094] Specifically, in the fair clustering framework based on federated nodes, there is a big difference in the update direction of the local model, which causes the local model update obtained by client optimization to deviate from the global model update obtained by server aggregation, and the difference between the final models is large. For some clients, the accuracy of the model may be significantly reduced. The present application is no longer limited to the limitation of traditional federated learning global aggregation into one model, but trains each group according to the contribution degree of the participants, and each group trains its own intra-group model. In order to obtain useful information within other groups, the server will globally aggregate the model update information of each group. After T rounds, each group obtains enough global information, and only intra-group update within each group is performed. Finally, each group's trained model is better than only having a unique global model because it can alleviate the optimization conflict between clients and prevent the model accuracy of some clients from being significantly reduced. In addition, more useful knowledge can be accumulated by training similar clients within each group.

[0095] The present application introduces a similarity threshold λ as a settable coefficient, which represents the similarity degree of different client models in federated learning. If the similarity of two clients is greater than the threshold, it means that the two client models are similar enough. In order to reduce the number of client model upload and download and server model aggregation, and improve communication efficiency, the present application combines similar clients for processing, and uploads the parameters of the combined two clients to the server as their parameters in the model aggregation process.

[0096] In the node clustering grouping module, i.e. the above step S4, the goal is to divide similar clients into the same group and perform model aggregation and update of the clients within the group. Due to the complexity of the federated learning scenario, the data, device computing power and model contribution of the clients in the training process are different, causing the difference between the clients to be usually large, and the model optimization process often conflicts with each other, thereby greatly affecting the performance of some clients. Therefore, grouping similar clients can greatly avoid the optimization conflict between clients. The present application designs a clustering grouping method for client contribution degree according to the characteristics of federated learning, and the specific sub-steps are as follows.

[0097] S41. First, according to the contribution degree of each participant obtained in the contribution evaluation stage, the similarity of the contribution degrees s i and s j between two clients x i and x j is calculated in turn.

[0098] sim(s i ,s j )=exp(-d(s i ,s j ) 2 / 2σ 2 ) (3)

[0099] wherein d(s i ,s j ) is a distance function, sim represents the calculation of the similarity of the contribution degrees s i and s j between two clients x i and x j , exp represents the exponential function with the natural constant e as the base, and σ is a scale parameter. According to the calculation of the similarity between the clients, a similarity matrix A is established.

[0100] S42. Singular value (Singular Value Decomposition, SVD) decomposition is performed on the similarity matrix A

[0101] [u s v]=svd(A) (4)

[0102] wherein u and v are the left and right singular vector matrices of the similarity matrix A, and s is the singular value matrix of the similarity matrix A, s=diag(σ1,σ2...σ n ).

[0103] S43. The number of clusters of the group is determined. (σ1,σ2...σ n ) in the singular value matrix s is compared with the threshold value ρ in turn, and the number of values greater than the threshold value is counted as the number K of groups to be divided.

[0104] S44. According to the determined number K of groups, the clients are clustered in turn, and then the final clustering results C1,C2...C K are output.

[0105] Compared with the existing federated learning clustering method, the existing method is a comparison of a single indicator, such as the similarity of the client dataset or the similarity of the gradient in the training process. The single indicator cannot reflect the contribution degree of the client in federated learning, nor can it discover the possible malicious node destruction. The classification of the present application is based on the actual contribution of the client, which can better reflect the actual performance of the client in the training process. In addition, the present application does not need to specify the number of clusters K in advance, but is calculated according to the actual contribution degree of the client. The clients in each group will share the intra-group update parameters, and in order to obtain useful information in other groups, the server will globally aggregate the model update information of each group. After T rounds, each group obtains enough global information, and only intra-group update in each group is performed.

[0106] In the fair aggregation distribution module, i.e. the above step S6, each node participating in federated learning can obtain a computing return corresponding to its contribution. In order to better realize the fairness of federated learning, the aggregation weight of each client in the global aggregation process should be matched with the actual contribution of each client in the federated learning process.

[0107]

[0108] where F i (θ) is the local objective function of client i, p i is the global aggregation weight of client i, p i is higher, the higher the weight in global aggregation.

[0109] Then the contribution degree of each group is calculated by the formula

[0110]

[0111] The contribution degree of each group is calculated by the formula , where k represents the contribution degree of the kth group, and N represents the number of clients in the kth group.

[0112] Next, the server side sorts all groups based on the contribution degree Sort all groups according to the proportion of the contribution degree, and distribute the latest global model parameters to all clients in each group in the corresponding proportion. Sort all groups according to the proportion of the contribution degree, and distribute the latest global model parameters to all clients in each group in the corresponding proportion.

[0113] In the fair aggregation distribution mechanism of the present application, the intra-group aggregation is first performed in each group to obtain the update information of the intra-group model, and the kth cluster updates the updated intra-group model update parameter θ kto the server side. Then, the server side calculates the contribution proportion of different groups and takes it as the global aggregation weight, so that the group with high contribution will get higher aggregation weight, and the group with low contribution will get lower aggregation weight. The specific calculation method is as follows:

[0114] Based on the contribution degree of each group and the updating degree of the group model, the aggregation weight p of each group in the global aggregation process is calculated by the formula

[0115]

[0116] And

[0117]

[0118] k

[0119] Wherein, p k represents the weight of each group k in the global aggregation process, and θ represents the parameter of the global model, represents the contribution proportion weight of each group, represents the model weight of each group in the training process, and α and β are parameters of and , α+β=1.

[0120] In order to prevent the influence of low contribution or malicious group on the whole federated learning training process, the application introduces a global aggregation admission threshold γ as a settable coefficient, which represents the minimum contribution that each group needs to make for global aggregation. It can also be used to identify and delete malicious participants in federated learning. If a group publishes malicious information, its contribution value will be very low. Before each round of global aggregation process, the contribution value of each cluster is compared with the threshold γ. The group with contribution value less than γ indicates that the group may have small contribution to the whole federated learning or the group broadcasts malicious update information. Therefore, the group will be excluded from the next round, and the deleted group will not be added back later.

[0121] After the server side completes the aggregation and update, the server side will allocate the corresponding global model update parameters to each participating group according to its actual contribution in the training process, and reward the task model with corresponding performance by contribution size to avoid low value or malicious participants. The group with high contribution will download higher distributed model parameters as the calculation reward. Specifically, the contribution of each group is the average contribution of each client in the group.

[0122] ​In summary, the application provides a fair federated learning method based on node contribution clustering, which considers the client heterogeneity problem in federated learning, and designs a fair clustering method based on federated node contribution to improve the fairness between federated learning clients. The application first groups according to the actual contribution degree of each client in federated learning, and divides the clients with similar contribution into the same group. In each iteration, first, intra-group aggregation is performed among the clients in each group, and then the group model update parameters obtained by intra-group aggregation are uploaded to the server side, and the server side performs global aggregation on the models between different groups. After a period of global aggregation, each group can basically obtain the training information of other groups. At this time, the global federated learning process can be divided into groups, and each group can train its own personalized group model, so that each group can obtain a fair return matching its own contribution.

[0123] An efficient federated learning node clustering grouping method is innovatively designed. The classification basis of the application is the actual contribution of the client, which can better reflect the actual performance of the client in the training process. In addition, for the federated node clustering method, the application does not need to specify the clustering cluster K in advance, but calculates it according to the actual contribution degree of the client, and the clients in each cluster share the intra-group update parameters.

[0124] In order to improve the fairness of the federated learning process, the application proposes a fair aggregation and distribution method between clusters. The server side will allocate corresponding global aggregation weights to each group according to the different update of each group, and the small group with high contribution degree will have higher aggregation weight, so that each group will be treated fairly in the global aggregation process. When the server side completes the aggregation and update, the server side will allocate corresponding global model update parameters to each participating group according to the actual contribution of each participating group in the training process, and the small group with high contribution degree will download higher distributed model parameters as the calculation reward.

[0125] Those skilled in the art can understand that the modules or processes in the drawings are not necessarily required to implement the application.

[0126] From the above description of the embodiments, those skilled in the art can clearly understand that the application can be implemented by means of software and the necessary general hardware platform. Based on such understanding, the technical solutions of the application can be embodied in the form of a software product, which can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0127] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device or system embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be referred to the part of the method embodiments. The above-described device and system embodiments are merely illustrative, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to actual needs. Those skilled in the art can understand and implement it without creative labor.

[0128] The above describes only the preferred embodiments of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A fair federated learning method based on node contribution clustering, characterized in that, Comprise: S1 initializes the parameters and local models of all clients participating in federated computing; S2 trains the respective local models through the local training data of each client participating in federated computing, and aggregates the trained local models; S3 evaluates each client participating in federated computing through the Shapley value method to obtain the contribution degree of each client participating in federated computing; S4 clusters and groups all clients participating in federated computing based on the contribution degree of each client participating in federated computing; S5 trains the local models of each group of clients respectively, aggregates the update information of the local models of each group of clients, and obtains the update parameters for updating the global model of each group of clients; During the training process, the clients in the same group share the update parameters of the global model; S6 obtains the contribution proportion of each group by calculation, takes the contribution proportion of each group as the global aggregation weight, and globally aggregates the local models of the clients in each group based on the contribution proportion of each group; After the global aggregation is completed, the updated model parameters are sent to all clients participating in federated computing based on the contribution proportion of each group; S7 repeats steps S2 to S6 multiple times until the group model of each group can fit the corresponding distribution; S8 terminates step S6, continues to train the group model of each group by repeatedly performing steps S2 to S5 multiple times, and obtains a target model; The target model is used to send to one or more platforms.

2. The method of claim 1, wherein, Step S3 comprises: Through formula a Sharpe value of the local model of each client i trained in each round of federated computation; wherein, U t denotes the utility function of the t-th round, denotes the local model of each client on any subset, C is a settable constant, and n represents the total number of all clients participating in federated computation; Through formula The Shapley value of each round of the client i participating in federated computing is added to obtain the contribution degree s of the client i i .

3. The method of claim 2, wherein, Step S4 comprises: S41 based on the contribution degree of each client participating in federated computing, through formula sim(s i , s j ) = exp(-d(s i , s j ) 2 / 2σ 2 ) (3) The similarity of the contribution degrees s i and s j between two clients x i and x j is calculated in sequence, and a similarity matrix A is established according to the similarity between all clients obtained by calculation; in the formula, d(s i , s j ) is a distance function, sim represents the similarity of the contribution degrees s i and s j between two clients x i and x j , exp represents an exponential function with the natural constant e as the base, and σ is a scale parameter. S42 through formula [u s v]=svd(A) (4) performing singular value decomposition operation on the similarity matrix A; in which, u, v are left and right singular vector matrices of the similarity matrix A, s is a singular value matrix of the similarity matrix A, s = diag(σ1, σ2…σ n ) S43 compares (s1, s2...s n ) in the singular value matrix s with the preset threshold value p in sequence, and counts the number of values greater than the threshold value as the group number K to be divided. S44 according to the completion of the number of groups K, the client sequentially clustering grouping, clustering grouping results C1, C2 … C K .

4. The method of claim 3, wherein, Step S6 comprises: S61 through formula The aggregation weight of the computing client i in the group aggregation process, and the contribution proportion of the group to which the client i belongs is obtained based on the aggregation weight of the client i in the global aggregation process; in the formula, F i (θ) is the local objective function of the client i, p i is the global aggregation weight of the client i; S62 through formula calculating the contribution degree of each group; wherein, denotes the contribution degree of the kth group, and N denotes the number of clients in the kth group. S63 rank the groups by the contribution degree rank the groups by the contribution degree distribute the latest global model parameters to all clients in each group in a corresponding proportion S64 based on the contribution degree of each group and the update degree of the group model, through formula and The aggregation weight p of each group in the global aggregation process is calculated k ; wherein, represents the contribution proportion weight of each group, represents the model weight of each group in the training process, and α and β are parameters of and , α+β=1; S65 judges whether the contribution degree in the global aggregation process of each group is less than a preset admission threshold γ, if yes, the group is deleted; S66 globally aggregates the local models of the clients in each group based on the aggregation weight of each group in the global aggregation process.