Federal learning framework construction method based on reverse auction and grouping aggregation optimization
By adopting a framework based on reverse auction and grouping aggregation optimization in federated learning, the model quality and convergence speed problems caused by Non-IID data distribution and device heterogeneity are solved, and an efficient and secure federated learning process is achieved.
Patent Information
- Application Number
- CN202510368748.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-27
AI Technical Summary
In the Non-IID data distribution and device heterogeneity scenarios, existing federated learning algorithms lead to poor model quality and slow model convergence. At the same time, it is difficult to ensure that participants contribute high-quality data and face security threats in an open environment.
A federated learning framework based on reverse auction and group aggregation optimization is adopted, and contribution values are recorded through blockchain, central server selects and group clients, and intermediate layer servers perform local synchronous aggregation to achieve global asynchronous aggregation, and poorly performed clients and packets are identified and excluded through dual tolerance exclusion strategies.
It effectively accelerates the convergence speed of the network model, resists malicious attacks, improves system efficiency and security, and dynamically evaluates client contribution through reputation value mechanisms.
Smart Images

Figure CN120218282A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine learning, and more specifically, relates to a method for constructing a federated learning framework based on reverse auction and grouped aggregation optimization. Background Art
[0002] In 2016, Google first proposed the concept of federated learning, aiming to solve the problem of local model updates for Android mobile phone terminal users. Subsequently, federated learning, as a distributed machine learning technology, has gradually attracted people's attention. It allows multiple participants to jointly train a machine learning model without interacting with the dataset. This machine learning solution is particularly suitable for application scenarios that require privacy protection and data security.
[0003] However, although federated learning has some advantages over machine learning, it also inevitably brings some challenging problems:
[0004] First of all, in the actual application scenarios of federated learning, there are often the following two scenario characteristics: distribution differences (Non-IID) of the dataset and device heterogeneity. The distribution differences of the dataset refer to the fact that the data of different clients come from different user groups or environments, resulting in significant non-independent and identically distributed phenomena among the data. The device heterogeneity is reflected in the fact that the devices participating in federated learning may have different hardware configurations, computing capabilities, and network conditions, which will directly affect the speed and quality of model training. These two scenario characteristics not only make the optimization directions of each client different during local model training, but may also cause some clients to become performance bottlenecks, thus affecting the efficiency and effect of the entire federated learning process.
[0005] Secondly, in an open federated learning environment, it is a difficult problem to ensure that all participants are willing and continue to contribute high-quality data and services without providing economic incentives to the participants. In addition, even if an incentive mechanism is designed, it is also necessary to consider whether the participants have obtained incentive rewards that match their performance. Unequal rewards are difficult to achieve the purpose of encouraging participants to voluntarily contribute high-quality data and services.
[0006] Finally, federated learning faces various security threats, including but not limited to malicious attacks, model poisoning and other malicious behaviors. For these potential security risks, federated learning itself does not have effective detection and defense means.
[0007] After retrieval, the Chinese patent publication number is: CN 115471303 A, and the publication date is: December 13, 2022. The name of the invention is: Federated Learning Payment Method, System and Storage Medium Based on Reverse Auction. The payment method disclosed in this patent document includes: The tenderer first publishes a value function, the maximum and minimum values of the payment that the bidder can obtain, and other information about the federated learning task. The tenderer selects the bidder through the value function and in combination with other information; When bidders receive a tender request with a value function, they will decide whether to participate in the tender according to their own situation, and the basic condition for participating in the tender is that their own utility is greater than zero; After receiving a sufficient number of tenders, the tenderer will make a selection based on the tender price and tender resources of the bidders. This patent proposes a payment incentive mechanism and contribution measurement method based on reverse auction in federated learning by combining reverse auction, which solves the payment problem of bidders. However, the focus of its research is mainly on the design of incentive mechanisms and security issues, lacking research on the problems of Non-IID data distribution and device heterogeneity in real scenarios, and these two problems greatly affect the model quality and model convergence speed of federated learning.
[0008] Regarding the above challenging problems, most of the current work and research on federated learning mainly focus on the design of incentive mechanisms and the avoidance of security risks, lacking in-depth research on these two challenging problems of Non-IID data distribution and device heterogeneity in real scenarios at the same time. These two problems also greatly affect the model quality and model convergence speed of federated learning. Summary of the Invention
[0009] 1. Problems to be Solved
[0010] The purpose of the present invention is to overcome the deficiencies that the existing federated learning algorithms have relatively poor model quality and slow model convergence speed due to Non-IID data distribution and device heterogeneity, and provide a method for constructing a federated learning framework based on reverse auction and grouped aggregation optimization, effectively solving the above problems.
[0011] 2. Technical Solutions
[0012] In order to solve the above problems, the technical solutions adopted by the present invention are as follows:
[0013] The present invention can achieve the incentive for participants in federated learning and avoid some potential security risks in federated learning in the scenarios of Non-IID data distribution and device heterogeneity. The overall framework of the present invention is divided into a blockchain area, a federated learning area, and a candidate client area. The federated learning area consists of a central server, several intermediate servers, and selected clients. Among them, the central server is also considered the publisher of the federated learning task and is responsible for aggregating the global model; the intermediate servers are responsible for collecting local models and performing local aggregation, and the selected clients are responsible for training local models using local datasets.
[0014] Specifically, the construction method steps of the federated learning framework are as follows:
[0015] Step S1, the publisher of the federated learning task initiates a federated learning task and broadcasts it to each client.
[0016] The federated learning task includes the cost budget B of the task, the expected completion time T e , the grouping capacity m, the client tolerance τ client , the grouping tolerance threshold τ group , and the time T required for the server to aggregate the model server .
[0017] Step S2, after receiving the broadcast information, interested clients submit bid applications containing information such as service quotes and training durations.
[0018] Step S3, according to the received bid applications, the publisher downloads the corresponding client contribution values from the blockchain and converts them into the comprehensive reputation values of the clients; then, based on data such as the cost budget, expected completion time, client quotes, client training durations, and client comprehensive reputation values, the publisher selects high-quality clients by combining the client selection and grouping algorithms and incorporates the high-quality clients into the federated learning framework.
[0019] Step S4, the intermediate server downloads the latest global model and sends the latest global model to the clients within the group.
[0020] Step S5, the client uses local data to train the received latest global model, generates a new local model, and sends the new local model to the intermediate server within the specified time.
[0021] Step S6, the intermediate server monitors the clients within the group, receives the new local models sent by the clients within the specified time, and synchronously aggregates them to generate a local aggregation model. Clients that do not send in time will not participate in the synchronous aggregation process, and the contribution value of this client is 0; the intermediate server sends the local aggregation model generated in this round and all the local models received in this round to the central server.
[0022] Step S7: The intermediate layer server tests the performance of all received local models, updates the client tolerance data corresponding to each client according to the changes in each model performance metric, and excludes a client from this task when the tolerance of a certain client exceeds the threshold.
[0023] Step S8: The central server receives the local aggregated model and asynchronously aggregates it with the global model generated in the previous round stored by the current server to generate a new global model. The central server tests the performance of the newly generated global model, updates the group tolerance corresponding to the group of the local aggregated model according to the changes in the performance metrics of the new global model, and excludes the group from this task when the group tolerance exceeds the threshold. In addition, according to the difference in the performance metrics of the new global model and the local model parameter update vector, the central server updates the contribution value data of the clients within the group.
[0024] Step S9: Repeat the operations in steps S4 - S8 above until the model accuracy reaches the standard or the task budget is exhausted. Then, pay service fees to each client according to the actual number of training times of the client, and record the contribution value data of each client in the blockchain.
[0025] Furthermore, for a federated learning task, its publisher needs to specify information such as the cost budget B, the expected completion time T e , the group capacity m, etc.
[0026] Furthermore, the method for selecting clients is as follows:
[0027] Step 1: Remove clients with a comprehensive reputation value that is not positive, and these clients are not included in the selection range.
[0028] Step 2: Take client i as an example, its service quote is bid i , and the comprehensive reputation value is rep i . Compare the quote and the comprehensive reputation value of the client, denoted as cp i = bid i / rep i , representing the cost performance of client i. The smaller cp i , the higher the cost performance of client i. Sort in non - decreasing order according to the cp value to obtain the sequence cp1 ≤ cp2 ≤... ≤ cp i ≤... ≤ cp n .
[0029] Step 3: Calculate the time required for a client to complete one round of model training tasks, and its time size is the time required for the client to train the local model plus the time required for the server to aggregate the model.
[0030] Taking client i as an example, the time required for it to train the local model is The time required for the server to aggregate the model is T server , and let the time for client i to complete one round of model training task be t i , then
[0031] Step 4: According to the cost performance sequence in Step 2, select from the corresponding Client 1 in turn, and add this client to the selected client set.
[0032] Step 5: According to the time for the client to complete one round of model training task (i.e., according to the magnitude), sort all the clients in the selected client set in non-descending order, and select m clients in turn to form a group until all the clients are selected. If the number of clients in the last group is less than m, then keep the current number. Here, m is the maximum number of clients that each group can accommodate.
[0033] Step 6: Calculate the maximum model training time in each group in turn, and record it as the group training time. Assume that the current group is J, and the group training time of this group is
[0034]
[0035] Here, t i is the time for client i to complete one round of model training task, is the specified model training duration for the group, and no local models sent by the client will be accepted beyond this duration.
[0036] Step 7: Calculate the number of executable times count e of each client i within the task expected completion time T i :
[0037]
[0038] Step 8: Calculate the budget B cur that the currently selected client needs to consume within the expected completion time. Assume that there are already k clients selected into the selected client set U s , then the formula for the current consumed budget B cur is If B cur ≤B, it means that the budget has not been consumed completely, and more clients can be selected, and continue to execute Steps 4 - 8; otherwise, if B cur >B, it means that the budget has been exceeded. At this time, exclude the last selected client, and the selection and grouping process ends. Here, B is the cost budget for this federated learning task.
[0039] Further, assume that it is currently the t-th round of federated learning. In this round, client i (i ∈ J) within group J generates a local model from local data and uploads it to the intermediate server, where represents the parameters of the local model generated by client i in the t-th round, and f(·) is regarded as a function mapping relationship, which is used to represent the machine learning model.
[0040] The intermediate server synchronously aggregates the received local models to generate a local aggregated model and sends the local aggregated model to the central server as well as the local models of the clients
[0041] The intermediate server asynchronously aggregates the local aggregated model with the global model of the previous round to generate a new global model
[0042] The calculation method of the contribution value is as follows:
[0043] Step 1, the central server tests the model performance metric loss of the new global model t+1 , loss t+1 represents the loss value metric of the new global model generated in the t-th round on the test dataset. Similarly, the global model in the previous round also has a corresponding performance metric loss t .
[0044] Step 2, denote Δloss t as the change in the loss value of the global model at the beginning and end of the t-th round. Then Δloss t = loss t - loss t+1 . If Δloss t > 0, it indicates that group J plays a positive role in the completion of the federated learning task, and vice versa.
[0045] Step 3, the central server calculates the update vector of the new global model. This update vector is the difference between the global model parameters at the beginning and end of the t-th round, that is
[0046] Step 4, the central server calculates the model update vector of client i (i ∈ J) within group J. This update vector is the difference between the global model parameters at the end of the t-th round and the new local model parameters generated by client i, that is
[0047] Step 5, calculate the local model update vector at the t-th round on the update vector of the global model the magnitude of the projection value That is
[0048] Step 6, client i (i ∈ J) proportionally allocates the Δloss generated in the t-th round according to the magnitude of the projection value t , regarded as the contribution value corresponding to client i in the t-th round That is
[0049] Step 7, repeat the above steps 1 - 6. When the federated learning task is completed, accumulate the contribution values of each round to obtain the total contribution value of the client in a federated learning task. Taking client i as an example, its total contribution value in a federated learning task is
[0050] Furthermore, the comprehensive reputation value is jointly determined by the direct reputation value of the client by the task publisher, the similarity between publishers, and the interaction graph between the publisher and the client.
[0051] Furthermore, when there are more than one publisher, different publishers can recommend high-quality clients to each other. In each federated learning task, there is only one task publisher. At this time, the remaining task publishers can only provide recommendation opinions, and these publishers providing recommendation opinions are called recommenders.
[0052] Let the current task publisher be p, the recommender be k, and the client be u. The calculation method of the comprehensive reputation value is as follows:
[0053] Step 1, calculate the direct reputation value of the current task publisher p for the client u, and the formula is:
[0054]
[0055] where represents the magnitude of the contribution value of client u in the t-th federated learning task, and decay(·) is a decay function;
[0056] Step 2, calculate the similarity sim between the publisher p and the recommender k p,k :
[0057]
[0058] sim p,k = modulated(sim, p,k )
[0059]
[0060] Among them, P represents the set of clients that have collaborated with publisher p, and K represents the set of clients that have collaborated with recommender k; represents the average of the direct reputation values of all clients that have collaborated with publisher p, represents the average of the direct reputation values of all clients that have collaborated with recommender k; sim, p,k is the unprocessed similarity data; modulated(·) is a function for processing the magnitude of similarity, and a and b are parameters.
[0061] Step 3: Construct a graph G=(V, E) based on the historical cooperation relationship between the publisher and the clients. The vertex set V includes the publisher and the clients; the edge set E = E1 ∪ E2. E1 is the set of directed edges, <pub i , cli j > ∈ E1 represents the direct reputation evaluation of client j by publisher i, and its weight is the direct reputation evaluation value of publisher i for client j E2 is the set of undirected edges, (pub i , pub j ) ∈ E2 represents that there is a similarity between publisher i and publisher j, and its weight is the similarity sim between publisher i and publisher j i,j .
[0062] Step 4: Generate an adjacency matrix A based on graph G. Its size is (x + n) * (x + n), where x is the total number of publishers and recommenders, and n is the total number of clients. The elements A in the matrix i,j are calculated as follows:
[0063]
[0064] Among them, pub i represents publisher i, cli j represents client j, and pub p is the publisher p of the current task; if publisher i has a direct reputation evaluation for client j (i.e., ), and publisher i is the current task publisher p (the relationship in the graph indicates that there is no undirected edge between i and p, i.e., ); at this time, A ij is the direct reputation value of publisher i for client j; if publisher i has a direct reputation evaluation for client j, and publisher i is not the current task publisher p (the relationship in the graph indicates that there is an undirected edge between i and p, i.e., (pub i , pub p ) ∈ E2), at this time Aij is the direct reputation value of publisher i for client j multiplied by the similarity between publisher i and publisher p; in other cases, A ij is 0.
[0065] Step 5: According to the HITS algorithm, generate two column vectors a and h with all initial values of 1, substitute the adjacency matrix A into the algorithm, and continuously update the above column vectors until convergence or reaching the preset maximum number of iterations. Finally, the authority vector a = [0, 0,..., 0, rep1, rep2, rep3,..., rep n , and [rep1, rep2, rep3,..., rep n corresponds to the comprehensive reputation value data of the client; the hub vector h has no practical significance in the present invention here.
[0066] Furthermore, in order to identify and exclude clients and groups with poor performance or potential threats, and to mitigate the impact of the staleness of asynchronous updates on model convergence, the present application proposes a double tolerance exclusion strategy, including a client exclusion strategy and a group exclusion strategy. The task publisher needs to declare in advance the tolerance threshold τ client for clients and the tolerance threshold τ group for groups before the task starts.
[0067] Assume that the current is the t-th round, there is an intermediate layer server, the group it belongs to is J, and there are several clients in this group. Client i (i ∈ J) generates a new local model through local data and uploads it to the intermediate layer server. The intermediate layer server synchronously aggregates the received local models to generate a local aggregated model and sends the local aggregated model to the central server The intermediate layer server aggregates the local aggregated model asynchronously with the global model of the previous round
[0068] Further, the client exclusion strategy is specifically as follows:
[0069] Step 1: Initialize the corresponding client tolerance for all clients. Taking client i as an example, τ i = 0;
[0070] Step 2: The intermediate layer server tests the performance metrics of the local aggregated model denotes the loss value metric of the new local aggregated model generated in the t-th round on the test dataset. Since the round attribute is not emphasized here, can be abbreviated as lossmid ;
[0071] Step 3. The intermediate server tests the performance metrics of all local models received For i ∈ J, denotes the new local model generated by the client at the t-th round The loss value metric on the test dataset. Since the round attribute is not emphasized here, it can be abbreviated as loss i .
[0072] Step 4. Calculate the loss value difference Δloss of the local model corresponding to client i i , that is, Δloss i = loss mid - loss i ; If Δloss i < 0, it indicates that client i plays a positive role in completing the federated learning task, otherwise it plays a negative role;
[0073] Step 5. Update the client tolerance. Taking client i as an example, its update formula is as follows:
[0074]
[0075] Step 6. The intermediate server detects whether the client tolerance exceeds the threshold, that is, if τ i > τ client , at this time, client i is excluded from the federated learning task.
[0076] Furthermore, the grouping exclusion strategy is specifically as follows:
[0077] Step 1. Initialize the corresponding grouping tolerance for all groups. Taking group J as an example, τ J = 0;
[0078] Step 2. The central server tests the model performance metrics of the new global model loss t+1 , loss t+1 denotes the loss value metric of the new global model generated at the t-th round on the test dataset; Similarly, the new global model in the previous round also has the corresponding performance metric loss t ;
[0079] Step 3. Calculate the loss value difference Δloss of the global model corresponding to group J J , that is, Δloss J = loss t - loss i, if Δloss J > 0, it indicates that group J plays a positive role in the completion of the federated learning task, and vice versa;
[0080] Step 4, update the group tolerance. Taking group J as an example, its update formula is as follows:
[0081]
[0082] τ J = max{0, τ J - Δloss J}
[0083] where β(0 ≤ β ≤ 1) is a parameter used to adjust the update range of the group tolerance.
[0084] Step 5, the central server detects whether the group tolerance exceeds the threshold, that is, if τ J > τ group , at this time, group J is excluded from the federated learning task.
[0085] 3. Beneficial effects
[0086] Compared with the prior art, the beneficial effects of the present invention are:
[0087] (1) The method for constructing a federated learning framework based on reverse auction and group aggregation optimization of the present invention builds a three-layer federated learning framework of a central server-edge server-client. In this framework, the central server selects high-quality clients through the client selection and grouping algorithm and groups them to participate in the federated learning task, and is responsible for global asynchronous aggregation, global model performance auditing and contribution value calculation during the subsequent training process; the selected clients, as participants, use their own local datasets to train the model, and the intermediate layer server is responsible for local synchronous aggregation, local model performance auditing and model transfer functions. This framework can effectively accelerate the convergence speed of the network model and resist malicious attacks by malicious nodes.
[0088] (2) The method for constructing a federated learning framework based on reverse auction and grouped aggregation optimization in the present invention can effectively measure the contribution of each client as a participant in the federated learning task by adding a reputation value attribute to each client. This method can not only identify which clients provide valuable data and computing resources, but also help identify those clients that may have a negative impact on the federated learning task due to various reasons (including but not limited to malicious behavior, differences in data distribution sets, performance limitations of devices, etc.). For the former, their comprehensive reputation values are often higher and they are more likely to be selected by the central server to participate in the federated learning task; for the latter, their comprehensive reputation values are often lower, which reflects that their positive role in the federated learning task is limited or even harmful. By introducing the mechanism of reputation value, the dynamic evaluation of the client contribution degree can be realized, and the efficiency and security of the whole system can be improved.
[0089] (3) The method for constructing a federated learning framework based on reverse auction and grouped aggregation optimization in the present invention uses an incentive mechanism based on the reverse auction theory to ensure that the selected clients are rewarded by the incentive mechanism and ensure that the behavior of the clients participating in the federated learning is in line with their individual interests. Secondly, the client selection and grouping algorithm based on the reverse auction theory can select high-quality clients by combining the comprehensive reputation value, service quotation and model training duration of each client with a limited budget and time, and group them according to the model training duration to participate in the federated learning task. Finally, during the operation of the federated learning task, the double tolerance exclusion strategy can timely exclude the clients and groups with poor performance or potential threats. The three operate crosswise to form an efficient grouped federated learning framework.
[0090] (4) The method for constructing a federated learning framework based on reverse auction and grouped aggregation optimization in the present invention adopts a synchronous aggregation scheme within the group and an asynchronous aggregation scheme between groups in the grouped aggregation optimization federated learning framework. Synchronous aggregation within the group can make full use of the advantages of parallel computing to accelerate the update speed of the local model, while asynchronous aggregation between groups allows the central server to directly update the global model and accelerate the convergence speed of the global model. Problems such as low resource utilization in the synchronous federated learning framework and model consistency challenges in the asynchronous federated learning can be easily addressed in this framework. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Figure 1 is the federated learning framework diagram of the present invention;
[0092] Figure 2 is the flowchart of the method for constructing the federated learning framework of the present invention; DETAILED DESCRIPTION OF THE INVENTION
[0093] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0094] Most of the current work and research on federated learning mainly focus on the design of incentive mechanisms and the avoidance of security risks, lacking in-depth research on the two challenging problems of Non-IID data distribution and device heterogeneity in real-world scenarios. These two problems also significantly affect the model quality and model convergence speed of federated learning. To address the above issues, this embodiment provides a method for constructing a federated learning framework, with the aim of: analyzing the real federated learning scenario, adopting a hierarchical synchronous-asynchronous aggregation scheme, optimizing the training process of federated learning tasks, enabling the entire federated learning framework to better handle scenarios of Non-IID data distribution differences and device heterogeneity. At the same time, combined with data such as comprehensive reputation values, high-quality clients are selected through the client selection and grouping algorithm to participate in federated learning, avoiding malicious attacks by malicious clients, and providing rewards to the selected clients through an incentive mechanism. In addition, through a dual tolerance exclusion strategy, clients and groups with poor performance or potential threats can be identified and excluded.
[0095] Combined Figure 1 , the main components and their functions of the federated learning framework with grouped aggregation optimization in this embodiment are as follows:
[0096] Blockchain: Responsible for recording the contribution value information of the selected clients in the federated learning task and providing a service for the task publisher to query the historical contribution values of the clients.
[0097] Competitive clients: Composed of several clients, these clients will receive the federated learning tasks published by the task publisher, formulate bidding strategies that suit themselves, and submit bids.
[0098] Federated learning framework: Composed of three parts, which is an important part of this application, including a central server, an intermediate layer server, and a client group. The specific functions of the three are as follows:
[0099] 1. Central server: Acts as the task publisher of federated learning, responsible for task publishing and client selection. It is also responsible for the asynchronous aggregation of the model and the calculation of client contribution values in the federated learning task.
[0100] 2. Intermediate layer server: Responsible for broadcasting the global model to the clients within the group it belongs to, aggregating the local models locally, and detecting the performance of the local models and excluding clients with poor performance.
[0101] 3. Client group: Composed of several clients, the clients train local models through local datasets and upload the local models to the intermediate layer server.
[0102] Combined Figure 2 , in this embodiment, the client configuration is shown in Table 1.
[0103] Table 1 Client Configuration Table
[0104] NO. Size BidPrice TrainingTime Reputation cp 0 3197 3.197 38.45 min 1.337 2.39 1 2125 2.125 25.8 min 0.031 69.58 2 2570 2.57 31.02 min 0.081 31.64 3 4151 4.151 50 min 0.671 6.18 4 2826 2.826 34.11 min 0.094 29.99 5 1053 1.053 12.75 min 0.011 92.9 6 965 0.965 11.9 min 0.017 54.91 7 2778 2.778 33.64 min 0.46 6.03 8 2435 2.435 29.45 min -0.016 -152.18 9 3771 3.771 45.46 min 0.576 6.535 10 2385 2.385 28.97 min 1.24 1.92 11 1831 1.831 22.07 min 0.119 152.91 12 4287 4.287 51.63 min 0.717 5.97 13 3378 3.378 40.7 min 0.405 8.33 14 1475 1.475 18.02 min 0.147 10.01 15 3772 3.772 45.45 min 0.59 6.38 16 689 6.89 8.36 min 0.019 35.34 17 968 9.68 11.9 min 0.015 64.53 18 2902 2.902 35.11 min 1.458 1.99 19 2442 2.442 29.51 min 1.562 1.56
[0105] The construction method of the federated learning framework based on reverse auction and grouped aggregation optimization in this embodiment includes the following steps:
[0106] 1. Task publishing: The task publisher of federated learning initiates a federated learning task and broadcasts the cost budget B = 5000, the expected completion time T e = 5000 minutes, the group capacity m = 4, the client tolerance τ client = 0.05, the group tolerance threshold τ group = 0.1, and the time T server = 10 required for the server to aggregate the model together to each client.
[0107] 2. Bidding response: It is assumed that there are 20 clients. Each client obtains a random number of data samples from the Cifar dataset. Taking client i as an example, the number of data samples it obtains is size i . After receiving the broadcast information, for the clients interested in participating, they will formulate their own bidding strategies and bid to the task initiator. The bidding information includes the offer bid i for their own services and the model training duration The specific data is shown in Table 1
[0108] 3. Reputation evaluation: The task publisher downloads the contribution value data of the corresponding client from the blockchain according to the received bidding information and converts it into the comprehensive reputation value data of the client. Taking client i as an example, the comprehensive reputation value of i is expressed as rep i , the initial value of the direct reputation value of each client is 1, and the initial value of the similarity between publishers is 0.
[0109] 4. Client selection: The task publisher screens a number of interested clients through the client selection and grouping algorithm, groups the high-quality clients, and incorporates them into the entire hierarchical federated learning framework.
[0110] 5. Model Download: The intermediate server downloads the latest version of the global model from the central server.
[0111] 6. Model Synchronization: The intermediate server sends the latest global model to each client in the group. Excluded clients will not receive the new global model.
[0112] 7. Local Training: After each client receives the latest global model, it uses the local dataset to train the model and generates a new local model.
[0113] 8. Model Upload: The client sends the new local model to the intermediate server.
[0114] 9. Local Aggregation: The intermediate server listens to the clients in the group. After receiving the local models sent by the clients in the group within the specified time, it performs synchronous aggregation and generates a local aggregation model. The contribution of clients that fail to submit on time or whose submission fails is regarded as 0 this time.
[0115] 10. Model Upload: The intermediate server sends the local aggregation model and the local models of the clients to the central server.
[0116] 11. Client Quality Monitoring: The intermediate server respectively performs performance detection on the local models of the received clients, updates the tolerance data of the corresponding clients according to the changes in the performance indicators of the local models. If the tolerance of a client exceeds the threshold at this time, the client is excluded from the group.
[0117] 12. Global Aggregation: After receiving the local aggregation model, the central server asynchronously aggregates the previous round of global model stored in the central server at this time with the received local aggregation model to obtain a new global model.
[0118] 13. Group Quality Monitoring and Contribution Value Calculation: The intermediate server performs performance detection on the generated new global model, updates the tolerance data of the corresponding group according to the changes in the performance indicators of the new global model. If the tolerance of a group exceeds the threshold at this time, the group is excluded from the federated learning task. The central server calculates the client contribution value according to the difference in the performance indicators of the new global model and the local model parameter update vector.
[0119] 14. Loop Iteration: Repeat the above steps 5 - 13 until the model accuracy reaches 80% or the task budget B is exhausted.
[0120] 15. Pay Fees and Data Uplink: Pay the service fees to the client according to the actual number of training times; the client reputation value data is shown in Table 1, and record the contribution value data information on the chain to ensure the immutability of the contribution value information.
[0121] Although embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for constructing a federated learning framework based on reverse auction and group aggregation optimization, characterized by: The steps include: S1. The publisher publishes and broadcasts the federated learning task; S2. The client submits a bidding application; S3, the publisher downloads the client contribution value and converts it into a comprehensive reputation value, and selects the client to be included in the federated learning framework; S4: The middle-tier server downloads the latest global model and sends it to the clients in the group. S5, the client trains the local model and sends the new local model to the middle-tier server at the specified time; S6. The middle-layer server synchronizes and aggregates to generate a local aggregation model, and sends the local aggregation model and the local model trained by the client to the central server; S7, the middle-tier server tests the local model performance and updates the client tolerance, excluding clients that exceed the client tolerance threshold; S8. The central server asynchronously aggregates to generate a new global model, tests the global model performance and updates the group tolerance, excludes groups that exceed the group tolerance threshold, and pays the service fee and records the contribution value in the blockchain when the model accuracy meets the standard or the budget is exhausted. Otherwise, return to step S4 and repeat the operations of steps S4 to S8.
2. The method for constructing a federated learning framework according to claim 1, characterized in that: The federated learning task in step S1 includes the task cost budget B, expected completion time T e , packet capacity m, client tolerance τ client , group tolerance threshold τ group And the time required for the server aggregation model T server .
3. The method for constructing a federated learning framework according to claim 2, characterized in that: The client selection method is as follows: Step S3.1, remove clients whose comprehensive reputation values are not positive, and these clients are not included in the selection range; Step S3.2: Taking client i as an example, its service quotation bid i , the comprehensive reputation value is rep i , compare the client's quotation with the comprehensive reputation value, recorded as cp i =bid i / rep i , which represents the cost performance of client i. According to the cost performance value, the sequence cp1≤cp2≤...≤cp is obtained by sorting in non-descending order. i ≤...≤cp n , select client No. 1 corresponding to cp1 in turn, and add the client to the selected client set U s ; Step S3.3: Calculate the time required for each client to complete a round of model training, and then determine the number of times each client can execute the task within the expected completion time and the budget required to consume, and determine the current budget B. cur ≤ cost budget B, more clients can be selected and step S3.2 can be executed; the current budget B can be determined. cur > When the cost budget is B, the budget is exceeded, and the client set U is excluded s The last client is selected, and the client selection ends.
4. The method for constructing a federated learning framework according to claim 3, characterized in that: In step S3.3, the method for grouping the selected clients is as follows: The time required for the client to complete a round of model training tasks is the time required for the client to train the local model plus the time required for the server to aggregate the model, denoted as t i , according to t i , sort all clients in the selected client set in non-descending order, select m clients in turn to form a group, until all clients are selected, if the last group has less than m clients, keep the current number, where m is the maximum number of clients that each group can accommodate.
5. The method for constructing a federated learning framework according to claim 4, characterized in that: The maximum model training time in each group is calculated in turn and recorded as the group training time. When the group training time is exceeded, the local model sent by the client is no longer received.
6. The method for constructing a federated learning framework according to any one of claims 1 to 5, characterized in that: The contribution value is calculated as follows: Step 1: The central server tests the model performance index of the new global model. The change in the loss value of the global model at the beginning and end of the tth round is Δloss t , if Δloss t >0, it indicates that the group J plays a positive role in the completion of the federated learning task, otherwise it plays a negative role; Step 2: The central server calculates the update vector of the new global model Step 3: The central server calculates the model update vector of client i in group J Step 4: Calculate the update vector of the local model in the global model update vector at the tth round The projection value on Right now Step 5: Client i distributes the Δloss generated in round t in proportion to the size of the projection value t , regarded as the contribution value of client i in round t Right now Step 6: Repeat steps 1 to 5 above. When the federated learning task is completed, accumulate the contribution value of each round to obtain the total contribution value of the client in a federated learning task.
7. The method for constructing a federated learning framework according to any one of claims 1 to 5, characterized in that: The comprehensive reputation value is determined by the direct reputation value of the task publisher to the client, the similarity between publishers, and the interaction graph between publishers and clients. When there is more than one publisher, different publishers can recommend high-quality clients to each other. In each federated learning task, there is only one task publisher. At this time, the remaining task publishers can only provide recommendations. These publishers who provide recommendations are called recommenders.
8. The method for constructing a federated learning framework according to claim 7, characterized in that: The current task publisher is p, the recommender is k, and the client is u. The calculation method of the comprehensive reputation value is as follows: Step 1: Calculate the direct reputation value of the current task publisher p to the client u. The formula is: in, represents the contribution value of client u in the t-th federated learning task, and decay(·) is the decay function; Step 2: Calculate the similarity sim between publisher p and recommender k p,k : sim p,k =modulated(sim’ p,k ) Where P represents the set of clients that have cooperated with publisher p; K represents the set of clients that have cooperated with recommender k; represents the average direct reputation value of all clients that have cooperated with publisher p, represents the average direct reputation value of all clients that have cooperated with recommender k; sim' p,k is the unprocessed similarity data; modulated(·) is a function for processing the similarity size, a and b are parameters; Step 3: Construct a graph G = (V, E) based on the historical cooperation relationship between the publisher and the client, where the point set V includes the publisher and the client; E is the edge set; E = E1∪E2, E1 is a directed edge set, <pub i ,cli j >∈E1 represents the direct reputation evaluation of publisher i on client j, and its weight is the direct reputation evaluation value of publisher i on client j E2 is an undirected edge set, (pub i ,pub j )∈E2 indicates that there is a similarity relationship between publisher i and publisher j, and its weight is the similarity sim between publisher i and publisher j. i,j ; Step 4: Generate an adjacency matrix A based on graph G, whose size is (x+n)*(x+n), where x is the total number of publishers and recommenders, and n is the total number of clients. The element A in the matrix i,j The calculation formula is as follows: Among them, pub i Indicates publisher i, cli j represents client j, pub p The publisher p of the current task; Step 5: Generate two column vectors a and h with all initial values 1 according to the HITS algorithm, substitute the adjacency matrix A into the algorithm, and continuously update the column vectors until convergence or the preset maximum number of iterations is reached. Finally, the authoritative vector a = [0, 0, ..., 0, rep1, rep 12 ,rep3,...,rep n ], and [rep1,rep2,rep3,...,rep n ]The corresponding client’s comprehensive reputation value data.
9. The method for constructing a federated learning framework according to any one of claims 1 to 5, characterized in that: A dual tolerance exclusion strategy is also adopted, including client exclusion strategy and group exclusion strategy.
10. The method for constructing a federated learning framework according to claim 9, characterized in that: in: The client exclusion policy is as follows: Step 1: Initialize the corresponding client tolerance for all clients. Taking client i as an example, τ o =0; Step 2: Test the performance indicators of the local aggregation model on the middle-tier server Represents the new local aggregation model generated in round t The loss value indicator on the test data set, since the round attribute is not emphasized here, Abbreviated as loss mod ; Step 3: The middle-tier server tests the performance indicators of all received local models Represents the new local model generated by the client in round t The loss value indicator on the test data set, since the round attribute is not emphasized here, Abbreviated as loss o ; Step 4: Calculate the loss difference Δloss of the local model corresponding to client i o , that is, Δloss i =loss mod -loss i ; If Δloss i <0, it indicates that client i plays a positive role in the completion of the federated learning task, otherwise it plays a negative role; Step 5: Update the client tolerance. Taking client i as an example, the update formula is as follows: Step 6: The middle-tier server detects whether the client tolerance exceeds the threshold. i >τ client , at this time, client i is excluded from the federated learning task; The group exclusion strategy is as follows: Step 1: Initialize the corresponding group tolerance for all groups. Take group J as an example, τ J =0; Step 2: The central server tests the new global model Model performance indicator loss t+1 , loss t+1 Represents the new global model generated for round t The loss value indicator on the test data set; similarly, the new global model in the previous round There is also a corresponding performance indicator loss t ; Step 3: Calculate the loss difference Δloss of the global model corresponding to group J J , that is, Δloss J =loss t -loss i , if Δloss J >0, it indicates that group J plays a positive role in the completion of the federated learning task, otherwise it plays a negative role; Step 4: Update the group tolerance. Taking group J as an example, the update formula is as follows: t J =max{0,τ J -Δloss J } Among them, β (0≤β≤1) is a parameter used to adjust the update amplitude of the group tolerance; Step 5: The central server detects whether the packet tolerance exceeds the threshold. J >τ group , at this time, group J is excluded from the federated learning task.
Citation Information
Patent Citations
Federal learning payment method and system based on reverse auction, and storage medium
CN115471303A