A blockchain and federated learning based crowd-sensing incentive method
Patent Information
- Application Number
- CN202210948033.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-08-09
AI Technical Summary
群智感知的优点是数据来源及其分布具有覆盖面广、随机性强的特点,可应对大规模数据需求问题,但同时存在数据质量不齐和数据结构复杂多样给计算带来困难,用户的安全隐私问题
[0034]与现有技术相比,本发明的有益效果在于:一是通过结合信誉的反向拍卖模块,对想要参加本次任务的候选人集合进行筛选,从而去除恶意参与节点,得到更高质量的参与者集合。二是本发明考虑了参与者中可能存在搭便车行为,利用皮尔逊相关系数衡量本轮参与者上传的模型梯度与全局模型梯度的相似度,将在模型训练过程中可能存在的恶意用户从下一轮模型训练中移除。三是利用shapley值思想对参与者的全局模型贡献度进行评估,依据参与者的贡献来进行奖励分发,保证公平性,从而使得具有更高贡献的参与者能够得到更多的奖励,同时提高数据拥有方的参与积极性。
Smart Images

Figure CN115292413B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of crowd-sensing, and particularly relates to a crowd-sensing incentive method based on a blockchain and federated learning. BACKGROUND
[0002] In recent years, with the rapid development of various mobile devices and wearable devices and the popularity of Internet of Things applications, the number and market size of intelligent devices have increased in an explosive manner, providing crowd-sensing systems with more diversified and heterogeneous sensing data collection sources. Due to the wide range of activities and random distribution of intelligent crowds, this new data sensing method is more suitable for coping with high flexibility and large-scale data requirements compared with the previous Internet of Things-based sensing method. Crowd-sensing systems not only save a lot of manpower and material resources, but also provide dynamic and real-time data for sensing users participating in the sensing task. Today, crowd-sensing has been applied to environmental pollution monitoring, environmental noise maps, urban traffic conditions, and other aspects, and in the foreseeable future, it will be applied to more business scenarios.
[0003] The typical architecture of a crowd-sensing system is shown in Figure 2 , which includes three parts: sensing participants, servers, and terminal users, which are used for data collection and transmission, data processing and calculation, publishing sensing tasks and receiving task processing results, respectively. The source of data is not only intelligent machines but also crowd users participating in sensing, referred to as sensing participants. The working process of the whole system is as follows: the terminal user issues a task to the sensing participant through the network, the participant selects the task and transmits the feedback sensing data through the network, the server stores, transmits, calculates and processes the data, and sends the final processing result to the terminal user. The advantage of crowd-sensing is that the data source and its distribution have the characteristics of wide coverage and strong randomness, which can cope with large-scale data demand problems, but at the same time, the quality of data is not uniform and the structure of data is complex and diverse, which brings difficulties to calculation, and the security and privacy of users.
[0004] The federated learning can make the training data of each user not shared with other users and the server, thereby ensuring the privacy of the user, and the blockchain has the characteristics of decentralization, thereby solving the problem of relying on a trusted central server, and the inventors creatively propose a crowd-sensing incentive method combining the blockchain and federated learning.
[0005] Federal learning usually adopts a parameter server architecture, in which the client trains a local model issued by the parameter server. A typical federal learning process contains many training rounds. In each round, the client downloads a new global model from the parameter server and trains a local model with its own data. Then, the client uploads the trained model to the parameter server and aggregates a new global model. Federal learning can make the training data of each user not shared with other users and the server, thereby solving the user security and privacy problem existing in the crowd sensing scenario.
[0006] Blockchain is a kind of distributed ledger technology that is chronological, decentralized, traceable and unchangeable. The decentralized consensus mechanism, tamper-proof record and smart contract incentive of the blockchain enable trusted transactions or data records among decentralized participants without a central authority. Due to the decentralized nature of the blockchain, the idea of removing the central server can be realized, solving the security problem of federal learning relying on a trusted central server. SUMMARY
[0007] The technical problem to be solved by the present application is to overcome the problems of unguaranteed data quality, user security and privacy, and user participation enthusiasm in the crowd sensing scenario.
[0008] To solve the above problems, the present application provides a crowd sensing incentive method based on blockchain and federal learning, comprising the following steps:
[0009] S1 The crowd sensing task publisher obtains the user historical reputation evaluation value from the blockchain, and obtains the initial reputation value Re of the candidate person through an initial reputation calculation formula i ;
[0010] S2 The candidate person set who wants to participate in this task is screened through the reverse auction method combining the initial reputation value Re of the candidate person i and the candidate person's bid price, the malicious participants are removed, and a higher quality participant set is obtained;
[0011] S3 The global model is distributed to the users in the participant set;
[0012] S4 The participant uploads the local training model, the task publisher aggregates the local training model to obtain the global model after this round of iteration, compares it with the global model of the last round, if the global model after iteration reaches convergence, step S5 is executed, if it does not meet the requirement, step S3 is continued;
[0013] S5 The global model contribution of the participant is evaluated by using the shapley value idea, the reward distribution is carried out according to the contribution of the participant, and the reputation value of the participant is updated according to the reputation value update function.
[0014] S6 The task ends, and the interaction information of this task is uploaded to the blockchain.
[0015] Further, step S1 is implemented as follows:
[0016] S1.1 Obtain the historical reputation evaluation value of the user after each participation in the task from the blockchain
[0017] S1.2 The task publisher adjusts the weight adjustment coefficient a according to the time interval of the current task publication i , let the historical task publication time be t i , the historical task publication time with the nearest time interval be t1, and the historical task publication time with the farthest time interval be t n , then where ∑ i a i = 1
[0018] S1.3 Obtain the initial reputation value Re of the candidate in this crowd sensing task through the initial reputation calculation formula i , wherein the initial reputation calculation formula is If the user i participates in the sensing task for the first time, the initial reputation value Re i = 0.3
[0019] Further, step S2 is implemented as follows:
[0020] Let the task publisher give a limited budget B, and the candidate's bid price be b i , then the unit reputation bid price of the candidate is According to the unit reputation bid price from small to large, the first n candidates are selected to form a higher quality participant set N = {q1, q2, …, q n}, wherein
[0021] Further, the "task publisher aggregates the local training model to obtain the global model after this round of iteration" in step S4 is implemented as follows:
[0022] Let the current round be the tth round of training process, and the task publisher adopts the reputation weight aggregation function to aggregate the local training model uploaded by the participants, and then distribute the aggregated global gradient to the users in the participant set; wherein, is the local model gradient submitted by the participant i in the tth round of training process, is the global model gradient obtained by the task publisher in the tth round by aggregating the local model gradients submitted by the participants.
[0023] Further, before the "continue to execute step S3" in the execution of the tth round of step S4, further comprising the step of: using the Pearson correlation coefficient to measure the similarity between the model gradient uploaded by the participant in this round and the global model gradient, removing the malicious user that may exist in the model training process from the next round of model training, so as to prevent the possible free-rider behavior in the participants; The implementation is as follows:
[0024] S4.1 Calculate the relative reputation value of participant i in this round of model aggregation Wherein:
[0025] represents the similarity between the local model gradient of participant i in the tth round and the global model gradient of the current round, wherein is the Pearson correlation coefficient, is the local model gradient submitted by participant i in the tth round of training process, is the global model gradient obtained by the task publisher by aggregating the local model gradients submitted by the participants in the tth round;
[0026] S4.2 The relative reputation value of participant i in this round Compare the relative reputation value of the participant with the reputation threshold β, and count the number of times the relative reputation value of the participant is lower than the reputation threshold β. If the number of times is higher than the number of times count set by the task publisher, the participant will be removed from the next round of training process, wherein the reputation threshold
[0027] Further, step S5 is implemented as follows:
[0028] S5.1 Calculate the reputation update function of the participant Wherein λ is an adjustable reputation decay factor, λ∈[0,1], is the relative reputation value of the participant in the tth round of task;
[0029] S5.2 The contribution value measurement function of the task participant obtained by the shapley value idea is Wherein Wherein |S| is the number of participants in the subset S, v(S) is the global model gradient obtained by the local model aggregation in the current round, v(S\i) represents the global model gradient obtained by excluding the local model uploaded by participant i in the subset S, v(S)-v(S\i) represents the marginal contribution of participant i in the set S, w(|S|) is a weight coefficient;
[0030] S5.3 The reverse auction bid price provided by the participant is b j If the budget is sufficient, that is The system will reward high-reputation users, and the actual bid reward obtained by the participant is: Wherein
[0031] Further, the uploading of the interaction information of the task to the blockchain in step S6 is implemented as follows:
[0032] The task publisher uploads the information of the task to the blockchain, and the task information includes task id, task publisher id, participant id, and reputation information of the participant.
[0033] Further, in view of the possible situation of inferring the training data set through the user local model gradient, the SM2 encryption algorithm is used to realize the encryption of the user uploaded model parameter information.
[0034] Compared with the prior art, the beneficial effects of the present application are: first, by combining the reputation reverse auction module, the candidate set who wants to participate in the task is screened, so as to remove malicious participation nodes and obtain a higher quality participant set. Second, the present application considers that there may be free-riding behavior in the participants, and uses the Pearson correlation coefficient to measure the similarity between the model gradient uploaded by the participants in this round and the global model gradient, so as to remove the malicious users that may exist in the model training process from the next round of model training. Third, the global model contribution of the participants is evaluated by using the shapley value idea, and the participants are rewarded according to their contribution to ensure fairness, so that participants with higher contribution can obtain more rewards, and the participation enthusiasm of the data owner is improved. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 The present application is based on the structure schematic diagram of the crowd sensing system of the blockchain and federated learning.
[0036] Figure 2 The structure schematic diagram of the traditional crowd sensing system. DETAILED DESCRIPTION
[0037] In order to more clearly illustrate the objects, embodiments and advantages of the present application, the technical solutions of the present application will be described in detail below with reference to the drawings. Obviously, the described embodiments are part of the embodiments of the present application, and those skilled in the art can obtain other embodiments without creative labor, and all belong to the protection scope of the present application.
[0038] The overall idea of the application is that the federal learning is added to the crowd sensing to make the training data of each user not shared with other users and the server, thereby solving the user security and privacy problem existing in the crowd sensing scene. In the federal learning, all participants accept the global model, then train the model according to the local data, and only send the local model gradient obtained by training to the server, so that the participants do not need to directly share the data, thereby avoiding the user to upload the private data. However, the participants with different contributions obtain the same reward, if there is no fair and reasonable reward distribution and incentive mechanism, and only the task scheduling mechanism of the central server is used to forcibly arrange the division of labor of the federal learning participants, then the participants with self-interest as the center will lack the motivation to actively participate in the federal learning, and it is likely that the participants will upload some low-quality or meaningless model gradient. And when the client participates in the crowd sensing scene, the resources of his device, including the computing resources, the communication resources and the energy, are inevitably consumed. Therefore, in the absence of sufficient return, the client may not be willing to participate or share their model. This will lead to that the participants with high data quality or better model training do not want to participate in the crowd sensing scene.
[0039] A crowd sensing incentive method based on blockchain and federal learning includes the following steps:
[0040] 1) The crowd sensing task publisher obtains the historical reputation evaluation value of the user from the blockchain, and obtains the initial reputation value Re of the candidate person through the initial reputation calculation formula i ;
[0041] 2) The candidate person set who wants to participate in this task is screened through the reverse auction method combining the initial reputation value Re of the candidate person i and the bid price of the candidate person, the malicious participants are removed, and a higher quality participant set is obtained;
[0042] 3) The global model is distributed to the users in the participant set;
[0043] 4) The participant uploads the local training model, the task publisher aggregates the local training model, obtains the global model after this round of iteration, compares it with the global model of the last round, if the global model after iteration reaches convergence, step 5) is executed, if it does not meet, step 3) is continued;
[0044] 5) The global model contribution degree of the participant is evaluated by using the shapley value idea, the reward distribution is carried out according to the contribution of the participant, and the reputation value of the participant is updated according to the reputation value update function;
[0045] 6) Upon completion of the task, upload the interaction information of this task to the blockchain.
[0046] The initial credit calculation formula in step 1) includes:
[0047] Obtain the user's historical reputation assessment value after each task participation from the blockchain. The task publisher assigns a weight adjustment coefficient α based on the time interval between the current task publication and the current task publication. i Let the release time of the historical task be t. i The most recent historical task was published at time t1, and the oldest historical task was published at time t2. n ,but Where ∑ i α i =1; The initial reputation value Re of the candidates in this crowd perception task is obtained through the initial reputation calculation formula. i The initial credit calculation formula is as follows: If user i is participating in the perception task for the first time, then the initial reputation value Re is... i =0.3.
[0048] Step 2) incorporates reputation-based reverse auction methods, including:
[0049] Employing the reverse auction concept from game theory, and considering the candidate reputation Re... i Bidding price b with candidates i To consider users participating in this federated learning program, user reputation scores are used to indirectly reflect the data quality and reliability of candidates. A reverse auction method based on reputation is used to filter the set of candidates wanting to participate in this task, thereby removing malicious participants and obtaining a higher-quality set of participants. The task issuer provides a limited budget B, and the unit reputation bid price for a candidate is defined as... Select the top n candidates from smallest to largest to form the participant set N = {q1, q2, ..., q} n},in
[0050] Step 3) involves assigning the global model to users in the participant set, including:
[0051] Considering the possibility of free riders among participants, we save the model gradients uploaded by users for each round. By calculating the local model gradient uploaded by participant i in each round and the global model gradient in the current round convergence angle To obtain the relative reputation value of participant i in this round of model aggregation. in represents the similarity between the local model gradient submitted by participant i in the t-th round and the final global model gradient, where is the Pearson correlation coefficient, which is used to determine the relationship between the local model uploaded by the participant and the global model, the value of P(θ) is between 0 and 1, the closer to 1, the higher the similarity of the two models. Here, we introduce an adjustable reputation threshold β, which can be used to identify and remove malicious users. In the t-th round, the updated relative reputation value of the participant is compared with β, the statistical participant relative reputation value is compared with the reputation threshold β, if it is higher than the number of times count set by the task publisher, the participant will be removed from the next round of training process, where the reputation threshold
[0052] The task publisher aggregates the local training models uploaded by the participants in step 4) to obtain the updated global model, which includes:
[0053] In the t-th round of training process, the task publisher uses the reputation weight aggregation function to aggregate the local training models uploaded by the participants, and then distributes the aggregated global gradient to the users in the participant set. Where, is the local model gradient submitted by participant i in the t-th round of training process, is the global model gradient obtained by the task publisher by aggregating the local model gradients submitted by the participants in the t-th round.
[0054] In step 5), the shapley value idea is used to evaluate the global model contribution of the participants and the reputation value of the participants is updated according to the reputation value update module, which includes:
[0055] According to step 3), the relative reputation value of the participant in the t-th round of the task is The reputation update function of the participant is Where λ is an adjustable reputation decay factor, λ ∈ [0, 1]. According to step 4), in the t-th round of the task, the local model gradient uploaded by the task participant is The current round global model gradient obtained by the task publisher by aggregating the local model gradients submitted by the task participants is The task participant contribution value measurement function obtained by the shapley value idea is Where Where |S| is the number of participants in the subset S, v(S) is the global model gradient obtained by the local model aggregation in the current round, v(S\i) represents the global model gradient obtained by excluding the local model uploaded by participant i in the subset S, and v(S)-v(S\i) represents the edge contribution of participant i in the set S. According to step 2), the reverse auction bid price provided by the participant is b i If the budget is sufficient, that is The system will reward high-reputation users, and the actual bid reward obtained by the participant is: Wherein
[0056] In step 6), the interaction information of the task is uploaded and saved to the blockchain, including uploading the task information to the blockchain platform by the task publisher, wherein the present application takes Ethereum as the blockchain platform, and the task information includes task id, task publisher id, participant id, and reputation information of the participant. In view of the possibility of inferring the training data set through the user local model gradient, the sm2 encryption algorithm of the national secret is used to realize the encryption of the user uploaded model gradient information.
[0057] The present application can ensure user privacy, suppress malicious users participating in the crowd sensing scene, improve the quality of the data model uploaded by the user, and improve the enthusiasm of the data owner participating in the crowd sensing.
[0058] The above is only an embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent transformation or direct or indirect application in the related technical field using the content of the present application specification and drawings is also included in the patent protection scope of the present application.
Claims
1. A crowd-sensing incentive method based on blockchain and federated learning, characterized in that, Includes the following steps: The S1 group intelligence sensing task issuer obtains users' historical reputation assessment values from the blockchain and calculates the candidate's initial reputation value Re using the initial reputation calculation formula. i ; S2 combines the candidate's initial reputation score Re i The reverse auction method, which compares the bid prices of candidates, filters the set of candidates who want to participate in this task, removes malicious participants, and obtains a higher quality set of participants. S3 assigns the global model to users in the aforementioned set of participants; Participants in S4 upload their locally trained models. The task publisher aggregates these locally trained models to obtain the global model after this iteration. This model is then compared with the global model from the previous round. If the global model after the iteration converges, step S5 is executed; otherwise, step S3 continues. The step S4, "the task publisher aggregates the locally trained models to obtain the global model after this iteration," is implemented as follows: Let the current round be the t-th training round. The task publisher uses a reputation weight aggregation function... The local model gradients uploaded by participants are aggregated, and then the aggregated global gradients are distributed to users in the participant set; where, Let be the local model gradient submitted by participant i during the t-th round of training. The global model gradient is obtained by the task publisher in round t by aggregating the local model gradients submitted by the participants; Before "continue executing step S3" in step S4 of round t, the following steps are also included: using the Pearson correlation coefficient to measure the similarity between the model gradient uploaded by the participants in this round and the global model gradient, and removing potentially malicious users from the next round of model training, thereby preventing free-riding behavior among participants; implemented as follows: S4.1 Calculate the relative reputation value of participant i in this round of model aggregation. in: This represents the similarity between the local model gradient of participant i in round t and the global model gradient in the current round, where The Pearson correlation coefficient is... Let be the local model gradient submitted by participant i during the t-th round of training. The global model gradient is obtained by the task publisher in round t by aggregating the local model gradients submitted by the participants; S4.2 will determine the relative reputation value of participant i in this round. Compare the relative reputation scores of participants with the reputation threshold β. If the number of times the participant's performance falls below the reputation threshold β, but exceeds the count set by the task publisher, the participant will be removed from the next round of training. The reputation threshold is... S5 uses the Shapley value concept to evaluate the global model contribution of participants, distributes rewards based on the participants' contributions, and updates the participants' reputation values according to the reputation value update function. When the S6 task is completed, the interaction information of this task will be uploaded to the blockchain.
2. The crowd intelligence perception incentive method based on blockchain and federated learning according to claim 1, characterized in that, Step S1 is implemented as follows: S1.1 obtains the user's historical reputation assessment value after each task participation from the blockchain. S1.2 The task publisher assigns a weight adjustment coefficient α based on the time interval between the current task publication and the current task publication. i Let the release time of the historical task be t. i The most recent historical task was published at time t1, and the oldest historical task was published at time t2. n ,but Where ∑ i α i =1; S1.3 The initial reputation value Re of the candidates in this crowd perception task is obtained through the initial reputation calculation formula. i The initial credit calculation formula is as follows: If this is the user's first time participating in the perception task, the initial reputation value Re is... i =0.
3.
3. The crowd-sensing incentive method based on blockchain and federated learning according to claim 1, characterized in that, Step S2 is implemented as follows: Let B be the limited budget given by the task publisher, and b be the bid price of the candidates. i Then the candidate's unit reputation bid price is Based on the aforementioned unit reputation bidding prices, the top n candidates are selected from smallest to largest to form a higher-quality participant set N = {q1, q2, ..., q...} n },in q1≤q2≤…≤q n .
4. The crowd-sensing incentive method based on blockchain and federated learning according to claim 1, characterized in that, Step S5 is implemented as follows: S5.1 Calculate the participant's reputation update function Where λ is an adjustable reputation decay factor, λ∈[0,1], Let be the relative reputation value of the participants in the t-th round of the task; S5.2 The task participant contribution measurement function obtained through the Shapley value concept is as follows: in in |S| is the number of participants in subset S, v(S) is the global model gradient obtained by aggregating the local models in the current round, v(S\i) represents the global model gradient obtained by excluding the local model uploaded by participant i in subset S, v(S)-v(S\i) represents the marginal contribution of participant i in set S, and w(|S|) is the weight coefficient. S5.3 The reverse auction bid price offered by the participants is b i If the budget is sufficient, that is The system will reward users with high credit ratings; the actual bidding rewards received by participants are as follows: in 5. The crowd-sensing incentive method based on blockchain and federated learning according to claim 1, characterized in that, The step S6, "uploading the interaction information of this task to the blockchain," is implemented as follows: The task publisher uploads the task information to the blockchain. The task information includes the task ID, the task publisher ID, the participant ID, and the participant's reputation information.
6. The crowd intelligence perception incentive method based on blockchain and federated learning according to claim 5, characterized in that, It also includes the following steps: to encrypt the gradient information of the user-uploaded model by using the national cryptographic SM2 encryption algorithm to address the possibility of inferring the training dataset through the gradient of the user's local model.