Enterprise credit assessment method based on block chain and federal learning in house transaction

By evaluating client honesty and improved consensus mechanisms in the blockchain federated learning method in the field of housing transactions, data privacy and efficiency issues in credit assessment are solved, and high-performance enterprise credit assessment is achieved.

CN119090618APending Publication Date: 2024-12-06GUILIN UNIV OF ELECTRONIC TECH +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410865358.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the field of housing transactions, the existing corporate credit evaluation model has problems such as poor data quality, risk of privacy leakage, lack of trustworthy guidance on model verification, low consensus efficiency and data heterogeneity, resulting in reduced global model performance.

Method used

Using a blockchain-based federated learning approach, the honesty of the client is evaluated through a pure data set collected by the publisher of the credit assessment task, and the improved PBFT consensus mechanism and adaptive weight aggregation strategy are designed based on the committee to ensure model security and performance.

Benefits of technology

It effectively reduces the impact of malicious clients, improves consensus efficiency and global model performance, and ensures data privacy and evaluation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090618A_ABST
    Figure CN119090618A_ABST
Patent Text Reader

Abstract

The invention discloses an enterprise credit evaluation method based on a block chain and federated learning in house transaction. The method comprises the following steps: a task issuer issues an evaluation task; the client performs model training by using local data; the task publisher evaluates client integrity according to a training result and distinguishes honest and malicious clients; selecting a committee node and a leader node from the honest client; the committee node performs cross validation by using local data, and evaluates the accuracy of the model; the leader node adaptively updates an aggregation weight based on client honesty, model accuracy and data scale, aggregates a global model and generates a block, and uploads the block after consensus by an improved PBFT protocol; and the next round of training is carried out until the global model meets the task requirement. According to the method, credible data is utilized to guide model updating, the influence of a malicious client side is reduced, a PBFT consensus mechanism is improved, the consensus efficiency is improved, aggregation weight is adaptively updated based on multiple factors, and the model quality under the condition of data heterogeneity is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of blockchain, federated learning and credit risk assessment, and in particular to an enterprise credit assessment method based on blockchain and federated learning in house transactions. Background Art

[0002] In recent years, the problem of dishonesty in the field of real estate transactions has become increasingly serious, and corporate dishonesty and default behaviors have occurred frequently. In this regard, corporate credit assessment has important research significance. It can assist real estate transaction parties in making transaction decisions, reduce disputes, and help banks effectively assess corporate credit risks and reduce loan risks. The current corporate credit assessment model is mainly carried out by assessment agencies in a centralized manner, and credit assessment and analysis of enterprises are conducted based on the collected relevant information and data. This assessment method has the following shortcomings: (1) Poor data quality. The corporate credit data provided by the applicant is relatively one-sided, and the authenticity of the data needs to be verified. (2) There is a risk of privacy leakage. In order to ensure the accuracy of the assessment, the corporate data used for the assessment is required to be as comprehensive as possible, which inevitably infringes on the privacy of some data.

[0003] The above problems can be solved to a certain extent through federated learning. As the client of federated learning, each enterprise credit data owner uses credit data to train and contribute local models in a distributed manner, and finally aggregates them into a global model through a central server. The client only needs to share the training parameters with the server, without sharing the entire original data set, so that the data demander can use the data but not see it, thus avoiding the risk of privacy data leakage. However, traditional federated learning is vulnerable to attacks from malicious clients and central servers.

[0004] Federated learning based on blockchain has become a new paradigm of trusted sharing. It uses blockchain to replace central servers to eliminate the influence of malicious servers, records the models and data in training on the chain, and uses its chain structure and consensus mechanism to ensure that the data cannot be tampered with and is traceable. It also introduces a verification mechanism to resist the threat posed by malicious client attacks. However, the combination of blockchain and federated learning is rarely involved in corporate credit assessment in the field of housing transactions. In addition, the existing blockchain-based federated learning methods have achieved decentralization and improved security, but there are still three major challenges:

[0005] (1) Model verification lacks trusted guidance. These blockchain-based federated learning malicious client solutions all use benchmark models for comparison to identify malicious models. However, the benchmark models are not necessarily completely trustworthy, and there is a lack of trusted sources for clean model updates.

[0006] (2) Consensus efficiency. Existing methods usually require multiple cross-validations of the model to enhance the robustness of the global model. These cross-validations use a large amount of network bandwidth to reach consensus between nodes. Considering the large number of learning nodes in federated learning, broadcasting consensus is very time-consuming, increasing the communication burden of the system and the delay in block generation. There is an urgent need for a more effective consensus mechanism to improve consensus efficiency while ensuring the utility of the model.

[0007] (3) Data heterogeneity leads to reduced global model performance. In actual credit assessment scenarios, the data scales used by each client participating in model training are different, and the aggregation algorithms used in existing research all allocate model aggregation weights according to the amount of data, ignoring the difference in data quality. If the data quality is good, the contribution to the global model will be great. As the iteration proceeds, local updates may diverge too much due to the heterogeneity of client data, and the difference between global optimization and local optimization objectives continues to increase, causing the aggregated model to deviate from the global optimum, thereby reducing model performance and requiring more communication rounds to reach convergence. Summary of the invention

[0008] The purpose of the present invention is to address the challenges existing in the background technology, and to provide a corporate credit assessment method based on blockchain and federated learning in housing transactions, so as to construct federated learning in a decentralized manner. The pure data set collected by the publisher of the credit assessment task is used as a trusted guide to evaluate the honesty of the client and reduce the impact of malicious clients; an improved PBFT consensus mechanism based on the committee is proposed, and the consensus process is only carried out in the committee, which reduces the impact of the network scale, optimizes the PBFT protocol process, and improves the consensus efficiency. In addition, the committee node uses the local data set to cross-validate the client update and evaluate the performance of the updated model; an adaptive weight aggregation strategy is designed to adaptively update the aggregation weight based on the honesty, accuracy, and data scale of the model, and weighted aggregation is performed according to the weight, which solves the problems caused by data heterogeneity, further improves the security of the model, and ensures the performance of the model.

[0009] The present invention provides a method for evaluating corporate credit based on blockchain and federated learning in housing transactions, the method comprising the following steps:

[0010] (1) Task initialization. The task publisher publishes a credit assessment learning task, which needs to include the identity of the task publisher, the initial global model, the optimized target performance indicators, the expected processing time, the preset number of iterations, the total reward amount, and the data and resource requirements. The relevant information is packaged into a genesis block and published on the blockchain;

[0011] (2) Registration and authorization. Before executing a task, each client needs to register and authenticate on the blockchain. Only nodes that have been successfully authorized can join the training. In addition, each node generates a set of asymmetric keys (sk, pk) and broadcasts them to other nodes in the network. The public key pk is used to identify the node and address it, and the private key sk is used to digitally sign transactions in the network and participate in committee elections;

[0012] (3) Local training. Each client obtains the initial global model or the global model of the previous round from the blockchain. Update it to the local model and use local enterprise credit data D i For local training, the calculation formula is:

[0013]

[0014] in, is the local model trained by the i-th client, is based on and D i The calculated model gradient, η is the learning rate, which controls the impact of the gradient on the model;

[0015] After completion, the local model update gradient is signed with a private key and sent to the task publisher;

[0016] (4) Malicious client identification. When the client is performing local training, the task publisher also maintains a baseline model using the pure root data set it has collected. After receiving the local update from the client, it calculates the cosine similarity between the local update model gradient and the baseline model gradient, evaluates the honesty of the client, and screens out malicious clients. The remaining clients constitute the honest client set.

[0017] (5) Committee member election. A small number of honest clients are selected from the honest client set as committee nodes and leader nodes using the committee election mechanism, and the remaining clients form the aggregated client set for global model aggregation in this round;

[0018] (6) Model verification. Each client in the aggregated client set signs the trained local model parameters and sends them to the committee node. The committee node verifies the digital signature using its public key and verifies its accuracy using the local data set. It then signs the verification result and sends it to the leader node.

[0019] (7) Aggregate the global model. The leader node uses the adaptive weight aggregation strategy to aggregate the local models in the aggregated client set into a global model and generate a block based on the verification results;

[0020] (8) Consensus on the blockchain. After consensus is reached through the committee-based improved PBFT consensus protocol, the generated blocks are uploaded to the blockchain;

[0021] (9) Determine whether the model’s preset convergence conditions in the task requirements are met. If not, proceed to the next round of training. If so, terminate the training;

[0022] The malicious clients in the method described are federated training nodes in the system that attempt to disrupt the federated learning process. Their purpose is to prevent the global model from converging and reduce the accuracy of the global model. The forged local model uploaded by the malicious client is called a malicious model. Malicious clients are "semi-omniscient": malicious clients can collude with each other to forge local models, and can obtain additional background knowledge by accessing the blockchain, including historical global model updates and node historical model updates, but malicious clients cannot know the local data set of honest clients. Based on this, the following attacks can be launched, including label flipping attacks, Gaussian noise attacks, backdoor attacks, and injection of malicious data.

[0023] The roles involved in the described approach include:

[0024] Task publisher: The initiator of the enterprise credit assessment task, the owner of the pure root data set, uses the root data set to identify malicious nodes and determine whether the global model meets the task requirements;

[0025] Client: As the enterprise data owner of the credit assessment task, it uses all data to participate in model training. Generally, it is a financial institution that owns the credit data of enterprises in the housing transaction field;

[0026] Committee nodes: A small number of nodes selected from honest nodes, responsible for verifying the performance of local client updates using local test data, and also consensus nodes;

[0027] Leader node: aggregates gradients based on verification results, updates the global model and generates blocks. It is also the consensus master node;

[0028] Blockchain: uses its chain structure to store the credit data of each data owner and related information in the credit assessment process to ensure its authenticity, transparency and traceability;

[0029] The malicious client identification step specifically includes:

[0030] (1) Before issuing a credit assessment model training task, the task issuer collects a clean (no data poisoning) small training dataset D0 (called the root dataset) according to the data requirements of the training task;

[0031] (2) After the training starts, the task publisher uses the root dataset to download the global model like the client to update the model and obtain the baseline model for this round.

[0032] (3) The task publisher receives the local update gradients of each client After that, calculate its updated gradient with the baseline model The cosine similarity s between i , to determine the similarity between the direction of the local model update and the direction of the baseline model update. The calculation formula is as follows:

[0033]

[0034] The gradient update of the baseline model is obtained from a clean data set, and its update direction is credible for the global model. However, malicious nodes will send malicious gradients to redirect the update of the global model to the wrong direction in order to affect the performance of the global model. Therefore, the direction similarity with the baseline model update is used as the honest score (HS) of the local model update. The honest score is obtained by the relu clipped cosine similarity, and the calculation formula is as follows:

[0035] HS i =ReLU(s i )

[0036]

[0037] If client i’s honesty score HS i If it is 0, it proves that the gradient uploaded by the client is malicious. Client i is a malicious client and will make a negative contribution to the aggregation. Therefore, in this iteration, we choose to abandon the gradient of client i and record the malicious client. When the malicious record of a client exceeds k times, it will be removed from the network. The remaining honesty scores greater than zero are honest clients, which are added to the honest client set;

[0038] (4) After completing these tasks, the task issuer broadcasts the results and uploads them to the blockchain;

[0039] The steps of the committee election mechanism specifically include:

[0040] (1) Each client i calculates the local update based on a verifiable random function, using the hash value of the latest block on the blockchain as input, the node's private key sk i As the input private key, the output hash string h and the corresponding proof π. After the calculation is completed, the message (i, h, π) is broadcast to other nodes. The calculation formula is as follows:

[0041]

[0042] (2) After receiving the message (i, h, π), other nodes in the network use the VRF verification function and use the public key pk of the node i and proof π as input, we can verify that the hash output h is indeed generated by the public key pk i The output is generated by the node, so the output cannot be forged by an attacker. When the input random seed is consistent, the output result is only determined by the node's private key sk i Therefore, the hash output β is unique for each node. The verification formula is as follows:

[0043]

[0044] (3) Sort the clients in the honest client set divided after malicious node identification according to the size of h. Assuming that the number of committee members is m+1, the first m+1 clients are selected as committee members. The remaining honest clients constitute the aggregated client set Participate in this round of global model aggregation;

[0045] (4) Leader node election: 1) First round election: select the node with the largest h as the leader. 2) Non-first round election: select the node with the largest h as the leader. The largest one (the average accuracy of the model of client i verified by each committee node in the previous round) is used as the leader node. The remaining m nodes are committee nodes;

[0046] The adaptive weight aggregation strategy takes into account the data heterogeneity of the credit owned by each client during the actual credit assessment model training, and uses the model accuracy, honesty and data scale of each client as the basis for allocating the weight of its participation in model aggregation, so that the weight is dynamically adjusted according to the actual situation, thereby reducing deviations, ultimately improving the global model quality and accelerating global convergence.

[0047] (1) Data scale ratio. If the aggregated client set in round t There are k clients in i is the amount of data owned by the i-th aggregation client, represents the total amount of data owned by each client. Then the data size of the i-th aggregated client accounts for The calculation is as follows:

[0048]

[0049] This indicator is consistent with the weight definition in the FedAvg algorithm. However, in the actual federal credit assessment scenario, only considering the data scale as a weight cannot solve the problem of reduced global model performance caused by malicious models and low-quality models caused by data heterogeneity. Therefore, in response to the above problems, two indicators are introduced to quantify the credibility and model quality of the client. Giving a larger aggregate weight to models with high credibility and model quality is an effective way to improve the performance of the global model. To this end, the honest score of the client update gradient evaluation by the task publisher in malicious client identification is used as an indicator to quantify the credibility of the client. The election committee node uses its local data set to verify the model parameters of each client, and the obtained accuracy is used as an indicator to measure the quality of the model.

[0050] (2) Honesty ratio. HS i is the honest score obtained by the local updated gradient of the i-th aggregation client, represents the sum of the honesty of each aggregated client. Then the honesty ratio of the i-th aggregated client is The calculation is as follows:

[0051]

[0052] (3) Accuracy ratio. In order to prevent the client from providing incorrect model accuracy evaluation results, it is necessary to elect honest committee nodes for parameter verification. Assume that m committee nodes are elected. Represents the accuracy of the model update of the i-th aggregate client in the t-th round after verification by the j-th committee node, where i∈(1,2···k), j∈(1,2···m). The accuracy percentage of the i-th aggregate client The calculation is as follows:

[0053]

[0054]

[0055] Represents the average model accuracy of the i-th aggregated client tested by each committee node.

[0056] (4) Aggregation weight. The leader node calculates the aggregation weight of each aggregated client based on the above three proportion indicators. The aggregation weight of the i-th aggregated client in the tth round is for:

[0057]

[0058] stλ1+λ2+λ3=1

[0059] λ1, λ2, and λ3 are hyperparameters used to adjust the size of the factors affecting data scale, honesty, and model accuracy to reflect the importance of the three factors. The hyperparameters can be changed according to the specific learning task requirements.

[0060] Since the local models in each round of iteration are different, the elected committee nodes are different, the aggregated client sets and verification data sets are also different, so the proportion of the three indicators of each aggregated client model in each round is different, and the weight of each round of model aggregation is also different. This dynamic change in weight truly reflects the contribution of each aggregated client to the global model in each round of updates.

[0061] (5) Dynamic aggregation. The global model parameters obtained by iterative update aggregation in the tth round are calculated as follows:

[0062]

[0063] The improved PBFT consensus protocol based on the committee mentioned above only reaches consensus between the committee. During the consensus stage, the leader node acts as the master node, and the committee node acts as the slave node to execute the improved PBFT consensus protocol to put the block on the chain. Specifically, the improved PBFT consensus protocol process divides the original three-stage communication into five stages: pre-prepare, prepare, pre-broadcast, commit, and commit-broadcast, which reduces the number of communications in each stage and improves the consensus efficiency.

[0064] (1) In the pre-prepare phase, the leader node packages information such as model updates, verification results, and aggregate weights into a block and sends a pre-prepare message to other committee nodes. view indicates the current view number, d is the hash summary of the block, which can be used to determine whether the information has been tampered with, and sk p is the private key of the leader node;

[0065] (2) After receiving the pre-prepare message from the leader node, committee node i verifies the legitimacy of the message and the correctness of the message signature. If the verification passes, it enters the prepare phase. The node that passes the verification will send a prepare message to the leader node. Among them sk i represents the private key of committee node i. m is the decision of whether the committee node passes the verification after verification. After the prepare message is confirmed, it indicates entering the pre-broadcast phase (m is the number of committee nodes);

[0066] (3) In the pre-broadcast phase, the leader node will propagate the pre-broadcast message to all committee nodes. S is the set of prepare messages of each committee node in the prepare phase. After receiving the pre-broadcast message, each committee node, in addition to normal verification, must verify all prepare messages in S to confirm that the leader node has indeed received the consent of most committee nodes. If there is no pre-broadcast phase, the committee node only knows the verification result of the pre-prepare message, but cannot know the response of other committee nodes. At this time, the leader node may not actually obtain the majority of approval, but put the wrong prepare message into S to deceive other nodes;

[0067] (4) After receiving the pre-broadcast message, committee node i confirms that there are more than After a correct prepare message is sent, the commit phase will begin and the commit message will be sent. To the leader node;

[0068] (5) The leader node receives After a correct commit message is sent, a commit-broadcast message is sent To each committee node, this step is the same as the previous pre-broadcast stage;

[0069] (6) After verifying the commit-broadcast message, the committee node adds the block generated by the leader node to the local ledger and broadcasts it to all nodes in the blockchain network, and the consensus ends;

[0070] The present invention has the following beneficial effects:

[0071] The present invention applies blockchain and federated learning technology to the enterprise credit assessment scenario in housing transactions, and uses federated learning and multi-party enterprise credit data to build an enterprise credit assessment model, which fully utilizes multi-party data while ensuring the privacy of data. Blockchain technology is used as the underlying network to store the assessment process and credit data, ensuring the authenticity of the data, providing an effective regulatory traceability mechanism, and eliminating the problems of malicious servers and single point failures in traditional federated learning. The pure data set collected by the credit assessment task publisher is used as a trusted guide to evaluate the honesty of the client and reduce the impact of malicious clients; an improved PBFT consensus mechanism based on the committee is proposed, and the consensus process is only carried out in the committee, reducing the impact of the network scale, optimizing the PBFT protocol process, and improving the consensus efficiency. In addition, the committee members use local data sets to cross-validate the client updates and evaluate the performance of the updated model; an adaptive weight aggregation strategy is designed to adaptively update the aggregation weight based on the honesty, accuracy, and data scale of the model, and weighted aggregation is performed according to the weight, which solves the problems caused by data heterogeneity, further improves the security of the model, and ensures the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 is a schematic diagram of the system architecture of an embodiment of the present invention;

[0073] Figure 2 is a flow chart of malicious client identification provided by an embodiment of the present invention;

[0074] Figure 3 is a flow chart of a committee election mechanism provided by an embodiment of the present invention;

[0075] Figure 4 It is a flow chart of the committee-based improved PBFT consensus protocol provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0076] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to illustrate the present invention but are not intended to limit it.

[0077] like Figure 1 As shown, an embodiment of the present invention proposes a corporate credit assessment method based on blockchain and federated learning in housing transactions, and the method includes the following steps:

[0078] (1) Task initialization. The task publisher publishes a credit assessment learning task, which needs to include the identity of the task publisher, the initial global model, the optimized target performance indicators, the expected processing time, the preset number of iterations, the total reward amount, and the data and resource requirements. The relevant information is packaged into a genesis block and published on the blockchain;

[0079] (2) Registration and authorization. Before executing a task, each client needs to register and authenticate on the blockchain. Only nodes that have been successfully authorized can join the training. In addition, each node generates a set of asymmetric keys (sk, pk) and broadcasts them to other nodes in the network. The public key pk is used to identify the node and address it, and the private key sk is used to digitally sign transactions in the network and participate in committee elections;

[0080] (3) Local training. Each client obtains the initial global model or the global model of the previous round from the blockchain. Update it to the local model and use local enterprise credit data D i For local training, the calculation formula is:

[0081]

[0082] in, is the local model trained by the i-th client, is based on and D i The calculated model gradient, η is the learning rate, which controls the impact of the gradient on the model;

[0083] After completion, the local model update gradient is signed with a private key and sent to the task publisher;

[0084] (4) Malicious client identification. When the client is performing local training, the task publisher also maintains a baseline model using the pure root data set it has collected. After receiving the local update from the client, it calculates the cosine similarity between the local update model gradient and the baseline model gradient, evaluates the honesty of the client, and screens out malicious clients. The remaining clients constitute the honest client set.

[0085] (5) Committee member election. A small number of honest clients are selected from the honest client set as committee nodes and leader nodes using the committee election mechanism, and the remaining clients form the aggregated client set for global model aggregation in this round;

[0086] (6) Model verification. Each client in the aggregated client set signs the trained local model parameters and sends them to the committee node. The committee node verifies the digital signature using its public key and verifies its accuracy using the local data set. It then signs the verification result and sends it to the leader node.

[0087] (7) Aggregate the global model. The leader node uses the adaptive weight aggregation strategy to aggregate the local models in the aggregated client set into a global model and generate a block based on the verification results;

[0088] (8) Consensus on the blockchain. After consensus is reached through the committee-based improved PBFT consensus protocol, the generated blocks are uploaded to the blockchain;

[0089] (9) Determine whether the model’s preset convergence conditions in the task requirements are met. If not, proceed to the next round of training. If so, terminate the training;

[0090] The malicious clients in the method described are federated training nodes in the system that attempt to disrupt the federated learning process. Their purpose is to prevent the global model from converging and reduce the accuracy of the global model. The forged local model uploaded by the malicious client is called a malicious model. Malicious clients are "semi-omniscient": malicious clients can collude with each other to forge local models, and can obtain additional background knowledge by accessing the blockchain, including historical global model updates and node historical model updates, but malicious clients cannot know the local data set of honest clients. Based on this, the following attacks can be launched, including label flipping attacks, Gaussian noise attacks, backdoor attacks, and injection of malicious data.

[0091] The roles involved in the described approach include:

[0092] Task publisher: The initiator of the enterprise credit assessment task, the owner of the pure root data set, uses the root data set to identify malicious nodes and determine whether the global model meets the task requirements;

[0093] Client: As the enterprise data owner of the credit assessment task, it uses all data to participate in model training. Generally, it is a financial institution that owns the credit data of enterprises in the housing transaction field;

[0094] Committee nodes: A small number of nodes selected from honest nodes, responsible for verifying the performance of local client updates using local test data, and also consensus nodes;

[0095] Leader node: aggregates gradients based on verification results, updates the global model and generates blocks. It is also the consensus master node;

[0096] Blockchain: uses its chain structure to store the credit data of each data owner and related information in the credit assessment process to ensure its authenticity, transparency and traceability;

[0097] like Figure 2 As shown, the malicious client identification step specifically includes:

[0098] (1) Before issuing a credit assessment model training task, the task issuer collects a clean (no data poisoning) small training dataset D0 (called the root dataset) according to the data requirements of the training task;

[0099] (2) After the training starts, the task publisher uses the root dataset to download the global model like the client to update the model and obtain the baseline model for this round.

[0100] (3) The task publisher receives the local update gradients of each client After that, calculate its updated gradient with the baseline model The cosine similarity s between i , to determine the similarity between the direction of the local model update and the direction of the baseline model update. The calculation formula is as follows:

[0101]

[0102] The gradient update of the baseline model is obtained from a clean data set, and its update direction is credible for the global model. However, malicious nodes will send malicious gradients to redirect the update of the global model to the wrong direction in order to affect the performance of the global model. Therefore, the direction similarity with the baseline model update is used as the honest score (HS) of the local model update. The honest score is obtained by the relu clipped cosine similarity, and the calculation formula is as follows:

[0103] HS i =ReLU(s i )

[0104]

[0105] If client i’s honesty score HS i If it is 0, it proves that the gradient uploaded by the client is malicious. Client i is a malicious client and will make a negative contribution to the aggregation. Therefore, in this iteration, we choose to abandon the gradient of client i and record the malicious client. When the malicious record of a client exceeds k times, it will be removed from the network. The remaining honesty scores greater than zero are honest clients, which are added to the honest client set;

[0106] (4) After completing these tasks, the task issuer broadcasts the results and uploads them to the blockchain;

[0107] like Figure 3 As shown, the steps of the committee election mechanism specifically include:

[0108] (1) Each client i calculates the local update based on a verifiable random function, using the hash value of the latest block on the blockchain as input, the node's private key sk i As the input private key, the output hash string h and the corresponding proof π. After the calculation is completed, the message (i, h, π) is broadcast to other nodes. The calculation formula is as follows:

[0109]

[0110] (2) After receiving the message (i, h, π), other nodes in the network use the VRF verification function and use the public key pk of the node i and proof π as input, we can verify that the hash output h is indeed generated by the public key pk i The output is generated by the node, so the output cannot be forged by an attacker. When the input random seed is consistent, the output result is only determined by the node's private key sk i Therefore, the hash output β is unique for each node. The verification formula is as follows:

[0111]

[0112] (3) Sort the clients in the honest client set divided after malicious node identification according to the size of h. Assuming that the number of committee members is m+1, the first m+1 clients are selected as committee members. The remaining honest clients constitute the aggregated client set Participate in this round of global model aggregation;

[0113] (4) Leader node election: 1) First round election: select the node with the largest h as the leader. 2) Non-first round election: select the node with the largest h as the leader. The largest one (the average accuracy of the model of client i verified by each committee node in the previous round) is used as the leader node. The remaining m nodes are committee nodes;

[0114] The adaptive weight aggregation strategy takes into account the data heterogeneity of the credit owned by each client during the actual credit assessment model training, and uses the model accuracy, honesty and data scale of each client as the basis for allocating the weight of its participation in model aggregation, so that the weight is dynamically adjusted according to the actual situation, thereby reducing deviations, ultimately improving the global model quality and accelerating global convergence.

[0115] (1) Data scale ratio. If the aggregated client set in round t There are k clients in i is the amount of data owned by the i-th aggregation client, represents the total amount of data owned by each client. Then the data size of the i-th aggregated client accounts for The calculation is as follows:

[0116]

[0117] This indicator is consistent with the weight definition in the FedAvg algorithm. However, in the actual federal credit assessment scenario, only considering the data scale as a weight cannot solve the problem of reduced global model performance caused by malicious models and low-quality models caused by data heterogeneity. Therefore, in response to the above problems, two indicators are introduced to quantify the credibility and model quality of the client. Giving a larger aggregate weight to models with high credibility and model quality is an effective way to improve the performance of the global model. To this end, the honest score of the client update gradient evaluation by the task publisher in malicious client identification is used as an indicator to quantify the credibility of the client. The election committee node uses its local data set to verify the model parameters of each client, and the obtained accuracy is used as an indicator to measure the quality of the model.

[0118] (2) Honesty ratio. HS i is the honest score obtained by the local updated gradient of the i-th aggregation client, represents the sum of the honesty of each aggregated client. Then the honesty ratio of the i-th aggregated client is The calculation is as follows:

[0119]

[0120] (3) Accuracy ratio. In order to prevent the client from providing incorrect model accuracy evaluation results, it is necessary to elect honest committee nodes for parameter verification. Assume that m committee nodes are elected. Represents the accuracy of the model update of the i-th aggregate client in the t-th round after verification by the j-th committee node, where i∈(1,2···k), j∈(1,2···m). The accuracy percentage of the i-th aggregate client The calculation is as follows:

[0121]

[0122]

[0123] Represents the average model accuracy of the i-th aggregated client tested by each committee node.

[0124] (4) Aggregation weight. The leader node calculates the aggregation weight of each aggregated client based on the above three proportion indicators. The aggregation weight of the i-th aggregated client in the tth round is for:

[0125]

[0126] stλ1+λ2+λ3=1

[0127] λ1, λ2, and λ3 are hyperparameters used to adjust the size of the factors affecting data scale, honesty, and model accuracy to reflect the importance of the three factors. The hyperparameters can be changed according to the specific learning task requirements.

[0128] Since the local models in each round of iteration are different, the elected committee nodes are different, the aggregated client sets and verification data sets are also different, so the proportion of the three indicators of each aggregated client model in each round is different, and the weight of each round of model aggregation is also different. This dynamic change in weight truly reflects the contribution of each aggregated client to the global model in each round of updates.

[0129] (5) Dynamic aggregation. The global model parameters obtained by iterative update aggregation in the tth round are calculated as follows:

[0130] like Figure 4 As shown in the figure, the improved PBFT consensus protocol based on the committee reaches consensus only between the committee. During the consensus stage, the leader node acts as the master node and the committee node acts as the slave node to execute the improved PBFT consensus protocol to put the block on the chain. Specifically, the improved PBFT consensus protocol process divides the original three-stage communication into five stages: pre-prepare, prepare, pre-broadcast, commit, and commit-broadcast, which reduces the number of communications in each stage and improves the consensus efficiency.

[0131] (1) In the pre-prepare phase, the leader node packages information such as model updates, verification results, and aggregate weights into a block and sends a pre-prepare message to other committee nodes. view indicates the current view number, d is the hash summary of the block, which can be used to determine whether the information has been tampered with, and sk p is the private key of the leader node;

[0132] (2) After receiving the pre-prepare message from the leader node, committee node i verifies the legitimacy of the message and the correctness of the message signature. If the verification passes, it enters the prepare phase. The node that passes the verification will send a prepare message to the leader node. Among them sk i represents the private key of committee node i. m is the decision of whether the committee node passes the verification after verification. After the prepare message is confirmed, it indicates entering the pre-broadcast phase (m is the number of committee nodes);

[0133] (3) In the pre-broadcast phase, the leader node will propagate the pre-broadcast message to all committee nodes. S is the set of prepare messages of each committee node in the prepare phase. After receiving the pre-broadcast message, each committee node, in addition to normal verification, must verify all prepare messages in S to confirm that the leader node has indeed received the consent of most committee nodes. If there is no pre-broadcast phase, the committee node only knows the verification result of the pre-prepare message, but cannot know the response of other committee nodes. At this time, the leader node may not actually obtain the majority of approval, but put the wrong prepare message into S to deceive other nodes;

[0134] (4) After receiving the pre-broadcast message, committee node i confirms that there are more than After a correct prepare message is sent, the commit phase will begin and the commit message will be sent. To the leader node;

[0135] (5) The leader node receives After a correct commit message is sent, a commit-broadcast message is sent To each committee node, this step is the same as the previous pre-broadcast stage;

[0136] (6) After verifying the commit-broadcast message, the committee node adds the block generated by the leader node to the local ledger and broadcasts it to all nodes in the blockchain network, and the consensus ends.

Claims

1. A corporate credit assessment method based on blockchain and federated learning in housing transactions. It is characterized in that The following steps are involved: (1) Task initialization. The task publisher publishes a credit assessment learning task, which needs to include the identity of the task publisher, the initial global model, the optimized target performance indicators, the expected processing time, the preset number of iterations, the total reward amount, and the data and resource requirements. The relevant information is packaged into a genesis block and published on the blockchain; (2) Registration and authorization. Before executing a task, each client needs to register and authenticate on the blockchain. Only nodes that have been successfully authorized can join the training. In addition, each node generates a set of asymmetric keys (sk, pk) and broadcasts them to other nodes in the network. The public key pk is used to identify the node and address it, and the private key sk is used to digitally sign transactions in the network and participate in committee elections; (3) Local training. Each client obtains the initial global model or the global model of the previous round from the blockchain. Update it to the local model and use local enterprise credit data D i For local training, the calculation formula is: in, is the local model trained by the i-th client, is based on and D i The calculated model gradient, η is the learning rate, which controls the impact of the gradient on the model; After completion, the local model update gradient is signed with a private key and sent to the task publisher; (4) Malicious client identification. When the client is performing local training, the task publisher also trains a baseline model using the pure root data set it has collected. After receiving the local update from the client, the cosine similarity between the local update model gradient and the baseline model gradient is calculated to evaluate the honesty of the client, screen out malicious clients, and the remaining clients constitute the honest client set. (5) Committee member election. A small number of honest clients are selected from the honest client set as committee nodes and leader nodes using the committee election mechanism, and the remaining clients form the aggregated client set for global model aggregation in this round; (6) Model verification. Each client in the aggregated client set signs the trained local model parameters and sends them to the committee node. The committee node verifies the digital signature using its public key and verifies its accuracy using the local data set. It then signs the verification result and sends it to the leader node. (7) Aggregate the global model. The leader node uses the adaptive weight aggregation strategy to aggregate the local models in the aggregated client set into a global model and generate a block based on the verification results; (8) Consensus on the blockchain. After consensus is reached through the committee-based improved PBFT consensus protocol, the generated blocks are uploaded to the blockchain; (9) Determine whether the preset convergence conditions of the model in the task requirements are met. If not, proceed to the next round of training; if so, terminate the training.

2. A corporate credit assessment method based on blockchain and federated learning in a housing transaction according to claim 1 It is characterized in that The malicious clients in the method described are the federated training nodes in the system that attempt to disrupt the federated learning process. Their purpose is to prevent the global model from converging and reduce the accuracy of the global model. The forged local model uploaded by the malicious client is called a malicious model. The malicious client is "semi-omniscient": malicious clients can collude with each other to forge local models, and can obtain additional background knowledge by accessing the blockchain, including historical global model updates and node historical model updates, but the malicious client cannot know the local data set of the honest client and other information. Based on this, the following attacks can be launched, including label flipping attacks, Gaussian noise attacks, backdoor attacks, and injection of malicious data.

3. A corporate credit assessment method based on blockchain and federated learning in a housing transaction according to claim 1 It is characterized in that The roles involved in the described approach include: Task publisher: The initiator of the enterprise credit assessment task, the owner of the pure root data set, uses the root data set to identify malicious nodes and determine whether the global model meets the task requirements; Client: As the enterprise data owner of the credit assessment task, it uses all data to participate in model training. Generally, it is a financial institution that owns the credit data of enterprises in the housing transaction field; Committee nodes: A small number of nodes selected from honest nodes, responsible for verifying the performance of local client updates using local test data, and also consensus nodes; Leader node: aggregates gradients based on verification results, updates the global model and generates blocks. It is also the consensus master node; Blockchain: uses its chain structure to store the credit data of each data owner and related information in the credit assessment process to ensure its authenticity, transparency and traceability.

4. A corporate credit assessment method based on blockchain and federated learning in a housing transaction according to claim 1 It is characterized in that The malicious client identification step specifically includes: (1) Before issuing a credit assessment model training task, the task issuer collects a clean (no data poisoning) small training dataset D according to the data requirements of the training task. 0 (called the root dataset); (2) After the training starts, the task publisher uses the root dataset to download the global model like the client to update the model and obtain the baseline model for this round. (3) The task publisher receives the local update gradients of each client After that, calculate its updated gradient with the baseline model The cosine similarity s between i , to determine the similarity between the direction of the local model update and the direction of the baseline model update. The calculation formula is as follows: The gradient update of the baseline model is obtained from a clean data set, and its update direction is credible for the global model. However, malicious nodes will send malicious gradients to redirect the update of the global model to the wrong direction in order to affect the performance of the global model. Therefore, the direction similarity with the baseline model update is used as the honest score (HS) of the local model update. The honest score is obtained by the relu clipped cosine similarity, and the calculation formula is as follows: HS i =ReLU(s i ) If client i’s honesty score HS i If it is 0, it proves that the gradient uploaded by the client is malicious. Client i is a malicious client and will make a negative contribution to the aggregation. Therefore, in this iteration, we choose to abandon the gradient of client i and record the malicious client. When the malicious record of a client exceeds k times, it will be removed from the network. The remaining honesty scores greater than zero are honest clients, which are added to the honest client set; (4) After completing these tasks, the task issuer broadcasts the results and uploads them to the blockchain.

5. A corporate credit assessment method based on blockchain and federated learning in a housing transaction according to claim 1 It is characterized in that The steps of the committee election mechanism specifically include: (1) Each client i calculates the local update based on a verifiable random function, using the hash value of the latest block on the blockchain as input, the node's private key sk i As the input private key, the output hash string h and the corresponding proof π. After the calculation is completed, the message (i, h, π) is broadcast to other nodes. The calculation formula is as follows: (2) After receiving the message (i, h, π), other nodes in the network use the VRF verification function and use the public key pk of the node i and proof π as input, we can verify that the hash output h is indeed generated by the public key pk i The output is generated by the node, so the output cannot be forged by an attacker. When the input random seed is consistent, the output result is only determined by the node's private key sk i Therefore, the hash output β is unique for each node. The verification formula is as follows: (3) Sort the clients in the honest client set divided after malicious node identification according to the size of h. Assuming that the number of committee members is m+1, the first m+1 clients are selected as committee members. The remaining honest clients constitute the aggregated client set Participate in this round of global model aggregation; (4) Leader node election: 1) First round election: select the node with the largest h as the leader. 2) Non-first round election: select the node with the largest h as the leader. The largest one (the average accuracy of the model of client i verified by each committee node in the previous round) is used as the leader node. The remaining m nodes are committee nodes.

6. A corporate credit assessment method based on blockchain and federated learning in a housing transaction according to claim 1 It is characterized in that The adaptive weight aggregation strategy takes into account the data heterogeneity of the credit data owned by each client during the actual credit assessment model training, and uses the model accuracy, honesty and data scale of each client as the basis for allocating the weight of its participation in model aggregation, so that the weight is dynamically adjusted according to the actual situation, thereby reducing deviations, ultimately improving the global model quality and accelerating global convergence. (1) Data scale ratio. If the aggregated client set in round t There are k clients in i is the amount of data owned by the i-th aggregation client, represents the total amount of data owned by each client. Then the data size of the i-th aggregated client accounts for The calculation is as follows: This indicator is consistent with the weight definition in the FedAvg algorithm. However, in the actual federal credit assessment scenario, only considering the data scale as a weight cannot solve the problem of reduced global model performance caused by malicious models and low-quality models caused by data heterogeneity. Therefore, in response to the above problems, two indicators are introduced to quantify the credibility and model quality of the client. Giving a larger aggregate weight to models with high credibility and model quality is an effective way to improve the performance of the global model. To this end, the honest score of the client update gradient evaluation by the task publisher in malicious client identification is used as an indicator to quantify the credibility of the client. The election committee node uses its local data set to verify the model parameters of each client, and the obtained accuracy is used as an indicator to measure the quality of the model. (2) Honesty ratio. HS i is the honest score obtained by the local updated gradient of the i-th aggregation client, represents the sum of the honesty of each aggregated client. Then the honesty ratio of the i-th aggregated client is The calculation is as follows: (3) Accuracy ratio. In order to prevent the client from providing incorrect model accuracy evaluation results, it is necessary to elect honest committee nodes for parameter verification. Assume that m committee nodes are elected. Represents the accuracy of the model update of the i-th aggregate client in the t-th round after verification by the j-th committee node, where i∈(1,2···k), j∈(1,2···m). The accuracy percentage of the i-th aggregate client The calculation is as follows: Represents the average model accuracy of the i-th aggregated client tested by each committee node. (4) Aggregation weight. The leader node calculates the aggregation weight of each aggregated client based on the above three proportion indicators. The aggregation weight of the i-th aggregated client in the tth round is for: stλ 1 +λ 2 +λ 3 =1 λ 1 ,λ 2 ,λ 3 It is a hyperparameter used to adjust the factors affecting data size, honesty and model accuracy to reflect the importance of the three factors. This hyperparameter can be changed according to the specific learning task requirements. Since the local models in each round of iteration are different, the elected committee nodes are different, the aggregated client sets and verification data sets are also different, so the proportion of the three indicators of each aggregated client model in each round is different, and the weight of each round of model aggregation is also different. This dynamic change in weight truly reflects the contribution of each aggregated client to the global model in each round of updates. (5) Dynamic aggregation. The global model parameters obtained by the iterative update aggregation in the tth round are calculated as follows:

7. A corporate credit assessment method based on blockchain and federated learning in a housing transaction according to claim 1 It is characterized in that The improved PBFT consensus protocol based on the committee mentioned above only reaches consensus between the committee. During the consensus stage, the leader node acts as the master node, and the committee node acts as the slave node to execute the improved PBFT consensus protocol to put the block on the chain. Specifically, the improved PBFT consensus protocol process divides the original three-stage communication into five stages: pre-prepare, prepare, pre-broadcast, commit, and commit-broadcast, which reduces the number of communications in each stage and improves the consensus efficiency. (1) In the pre-prepare phase, the leader node packages information such as model updates, verification results, and aggregate weights into a block and sends a pre-prepare message to other committee nodes. <pre-prepare,<view,timestamp, block>, view indicates the current view number, d is the hash summary of the block, which can be used to determine whether the information has been tampered with, sk p is the private key of the leader node; (2) After receiving the pre-prepare message from the leader node, committee node i verifies the legitimacy of the message and the correctness of the message signature. If the verification passes, it enters the prepare phase. The node that passes the verification will send a prepare message to the leader node. <prepare,<view,timestamp,d,i> ,m>sk i , where sk i represents the private key of committee node i. m is the decision of whether the committee node passes the verification after verification. After m prepared messages are confirmed, it enters the pre-broadcast phase (m is the number of committee nodes); (3) In the pre-broadcast phase, the leader node will propagate the pre-broadcast message to all committee nodes. <pre-broadcast,<view,timestamp,d,S> ,m>sk p , S is the prepare message set of each committee node in the prepare phase. After receiving the pre-broadcast message, each committee node, in addition to normal verification, must verify all prepare messages in S to confirm that the leader node has indeed received the consent of most committee nodes. If there is no pre-broadcast phase, the committee node only knows the verification result of the pre-prepare message, but cannot know the response of other committee nodes. At this time, the leader node may not actually obtain the majority of approval, but put the wrong prepare message into S to deceive other nodes; (4) After receiving the pre-broadcast message, committee node i confirms that there are more than After a correct prepare message is sent, the commit phase will begin and the commit message will be sent. <commit,<view,timestamp,d,i> , To the leader node; 5) The leader node receives After a correct commit message is sent, a commit-broadcast message is sent <commit-broadcast,<view,timestamp,d, To each committee node, this step is the same as the previous pre-broadcast stage; (6) After verifying the commit-broadcast message, the committee node adds the block generated by the leader node to the local ledger and broadcasts it to all nodes in the blockchain network, and the consensus ends.

Citation Information

Cited By

  • Identity verification method for trusted platform to support block chain

    CN119442201A

  • Intelligent evaluation method and system for enterprise credit score based on block chain

    CN120317975A

  • Block chain-driven data link credible evidence storage method and system

    CN120528650A

  • Dynamic perception credibility evaluation system and method for cross-modal federated learning

    CN120874973A