A Blockchain-Based AI Model Training Method

By using blockchain technology to replace centralized servers in federated learning and introducing model verification and aggregation mechanisms, the problems of single point failure and malicious node attacks in federated learning are solved, the accuracy and robustness of the model are improved, and a mechanism for retrospective accountability is provided.

CN115049056BActive Publication Date: 2025-06-17TIANJIN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210859188.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-20
Publication Date
2025-06-17
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

The single point of failure problem of centralized servers in federated learning and the possible model training failure and poisoning attacks caused by malicious nodes affect the accuracy and robustness of the model.

Method used

Blockchain technology is used to replace the centralized server of federated learning, and ensure the security and accuracy of the model by randomly assigning participant identities (model trainer, model validator and model winder) and using blockchain for model verification and aggregation.

Benefits of technology

It solves the single point of failure problem of centralized servers in federated learning, prevents attacks from malicious nodes, improves the accuracy and robustness of the model, and provides a mechanism for retrospective accountability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049056B_ABST
    Figure CN115049056B_ABST
Patent Text Reader

Abstract

The present invention discloses an AI model training method based on blockchain, including: building an original AI model according to dataset features; before the start of each round of training of the original AI model, randomly assigning the participants in the training process into three categories according to a proportion: model trainers, model verifiers, and model blockchainers; during each round of training, the model trainers and model verifiers respectively generate their respective local models for this round; the model verifiers use the locally generated local models to verify the local models generated by the model trainers; the model blockchainers aggregate all the local models passed by the model verifiers to obtain the global model for this round, and package the global model for this round, the verification results, and all the local models into the blockchain. The present invention uses blockchain to replace the centralized server of federated learning, solves the single-point failure problem of the centralized server of federated learning, and at the same time facilitates future traceability and accountability, improving the model accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and more specifically to an AI model training method based on blockchain. Background Art

[0002] At present, there are two main ways to train AI models. One is centralized learning, such as Figure 1 As shown in the figure, the model training of machine learning algorithms in artificial intelligence cannot be separated from the input of a large amount of training data. The quality and quantity of data samples directly determine the quality of the model effect. In theory, the more data there is, the more robust the trained model will be and the better the effect will be. However, with the frequent occurrence of problems such as telecommunications fraud caused by data privacy leaks, people have become more aware of personal data protection, and countries around the world have enacted strict laws and regulations to restrict companies, organizations, and individuals from collecting and disseminating user privacy information. The centralized learning method violates laws and regulations because the collected training data may involve user privacy, resulting in the inability to collect a large amount of training data and subsequent model training.

[0003] Another way is federated learning, such as Figure 2 As shown in the figure, although this method solves the problem of privacy leakage, it also leads to some other problems, such as: 1. The single point failure problem of the central server that aggregates the local model gradients of each round, such as server crashes, or malicious attacks that cause the model training to be unable to continue; 2. Since it is impossible to directly collect the user's local data, there may be malicious nodes that use dirty data (that is, non-real data or even contradictory data) to destroy the aggregation of the model; 3. Finally, there are differences in the amount of data owned by each participant, and nodes with a large number of samples may not be particularly interested in participating in federated learning.

[0004] In essence, blockchain is a shared database. The data or information stored in it has the characteristics of "decentralization", "unforgeable", "leaving traces throughout the process", "traceable", "open and transparent", and "collectively maintained".

[0005] Therefore, how to provide a blockchain-based AI model training method that uses blockchain to replace the centralized server of federated learning to solve the single point failure problem of the centralized server of federated learning, while facilitating future traceability and accountability and improving model accuracy and robustness is an issue that technicians in this field urgently need to solve. Summary of the invention

[0006] In view of this, the present invention provides an AI model training method based on blockchain, which uses blockchain to replace the centralized server of federated learning, solves the single-point failure problem of the centralized server of federated learning, and facilitates future traceability and accountability, improving the accuracy and robustness of the model. At the same time, a model verification mechanism is proposed to prevent poisoning attacks by malicious nodes and ensure the convergence speed and accuracy of the model.

[0007] To achieve the above object, the present invention adopts the following technical solutions:

[0008] An AI model training method based on blockchain, comprising:

[0009] Construct an original AI model according to the characteristics of the data set;

[0010] Before the start of each round of training of the original AI model, the participants in the training process are randomly assigned into three categories according to a ratio: model trainers, model verifiers, and model uploaders;

[0011] During each round of training, the model trainers and the model verifiers respectively obtain the global model of the previous round from the blockchain and use the local data set for training to generate their respective local models of this round;

[0012] The model verifiers use the locally generated local models to verify the local models generated by the model trainers;

[0013] The model uploaders aggregate all the local models passed by the model verifiers to obtain the global model of this round, and package the global model of this round, the verification results, and all local models into the blockchain.

[0014] Further, in the above-mentioned AI model training method based on blockchain, it further includes: after the model uploaders package the data, they also use the PoS consensus algorithm to compete for the right to record accounts, and the model uploaders who obtain the right to record accounts package the data onto the blockchain.

[0015] Further, in the above-mentioned AI model training method based on blockchain, if two or more of the model uploaders obtain the right to record accounts at the same time, the fork problem is solved based on the reputation rewards of each model uploader saved in the blockchain, and the block packaged by the model uploader with a higher reputation reward is selected as the legal block.

[0016] Further, in the above-mentioned AI model training method based on blockchain, when the data set is image data, the original AI model adopts a convolutional neural network, and the convolutional neural network includes three convolutional layers and two fully connected layers.

[0017] Further, in the above-mentioned AI model training method based on blockchain, before the start of each round of training, the distribution ratio relationship of the participants is: T > V > M, where T is the model trainer, V is the model validator, and M is the model uploader.

[0018] Further, in the above-mentioned AI model training method based on blockchain, during each round of training, the execution process of the model trainer includes:

[0019] The model trainer t i Downloads the global model Gx of the previous round from the blockchain -1 , and based on the global model G of the previous round j-1 As the training starting point, uses the local training set for training to obtain a local partial model And uses its own private key To Sign it and send it to the model validator; where Contains the local model And the reputation reward of the model trainer t i Of.

[0020] Further, in the above-mentioned AI model training method based on blockchain, during each round of training, the execution process of the model validator includes:

[0021] The model validator receives the Sent by the model trainer and uses the public key of the model trainer t i To Verify it. If the verification fails, discard it. If the verification passes, execute the following steps;

[0022] The model validator v k Downloads the global model G of the previous round from the blockchain j-1 , and based on the global model G of the previous round j-1 As the training starting point, uses the local training set for training to obtain a local partial model

[0023] Uses the local test set to calculate the accuracy of the local partial model sent by the model trainer And the local partial model obtained by its own training To obtain the accuracy of the local model trained by the model trainer And the accuracy of the local model trained by the model validator

[0024] According to the accuracies of the two, conducts a voting check on the local model trained by the model trainer;​

[0025] After the verification is completed, the model verifier v k uses its own private key to encrypt and send it to the model uploader; encapsulates the voting result, the local model trained by the model trainer, the reputation reward of the model verifier, and the reputation reward of the model trainer.

[0026] Further, in the above blockchain-based AI model training method, the process of voting and verifying the local model of the model trainer is as follows:

[0027] If the accuracy rate of the local model trained by the model trainer is not lower than the accuracy rate of the local model trained by the model verifier, that is then directly determine that the local model trained by this model trainer is legal and vote "agree";

[0028] Otherwise, excluding the above legal local models, the remaining local models trained by the model trainer are denoted as T rest , and calculate the weighted accuracy difference according to the following formula;

[0029]

[0030] Compare the difference between the accuracy rate of all the remaining local models t trained by the model trainer and the accuracy rate of the local model trained by the model verifier with the weighted accuracy difference, where t ∈ T rest , and the judgment condition is:

[0031]

[0032] If the above judgment condition is satisfied, vote "agree", otherwise, determine it as illegal and vote "reject".

[0033] Further, in the above blockchain-based AI model training method, the execution process of the model uploader includes:

[0034] The model uploader m p receives the sent by the model verifier and uses the public key of the model verifier v k to verify , and discard it if the verification fails;

[0035] Each model uploader m p counts the local models trained by the model trainer Calculate the number of votes obtained by each local model from the votes of all the model verifiers for each local model;

[0036] If the number of legal local models trained by the model trainer is greater than or equal to the number of illegal local models, aggregate all the legal local models; otherwise, do nothing;

[0037] The model uploader m p packages the global model, voting results, and all local models of this round into a block

[0038] Furthermore, in the above-mentioned blockchain-based AI model training method, the formula for aggregating all legal local models is:

[0039]

[0040] where G j is the global model generated during the j-th round of training; is the number of training sets of the model trainer t i ; train_total is the total number of training sets of all legal model trainers; is the local model trained by t i during the j-th round of training.

[0041] As can be seen from the above technical solutions, compared with the prior art, the present invention discloses a blockchain-based AI model training method, which has the following beneficial effects:

[0042] 1. The present invention utilizes blockchain technology as the underlying architecture of federated learning, and randomly assigns each participant one of the above three identities before each algorithm iteration. This not only enables full utilization of the data of all parties for model training but also, to a certain extent, prevents attacks from malicious nodes. At the same time, due to the introduction of blockchain technology, there is no single point of failure problem because each node in the blockchain is peer-to-peer, and the offline status of a certain node will not affect the continued operation of the system.

[0043] 2. The present invention introduces a model verification algorithm based on a voting mechanism. The algorithm is targeted at model training verifiers and model trainers. Specifically, the model verifiers verify and vote on the models of the model trainers, which largely solves the poisoning attack problem existing in traditional federated learning.

[0044] 3. The present invention introduces an incentive mechanism - reputation value, rewards nodes that contribute to the system, and can also solve the fork problem in the blockchain according to the level of reputation value. This improves the motivation of each institution to participate in federated learning and encourages all parties to contribute local data to enhance the effect of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.

[0046] Figure 1 Schematic diagram of the working mode of centralized learning in the prior art provided by the present invention;

[0047] Figure 2 Schematic diagram of the working mode of federated learning in the prior art provided by the present invention;

[0048] Figure 3 Simulation experiment diagram of centralized learning, federated learning and poisoning attack provided by the present invention;

[0049] Figure 4 Flowchart of the AI model training method based on blockchain provided by the present invention;

[0050] Figure 5 Schematic diagram of the structure of the convolutional neural network provided by the present invention;

[0051] Figure 6 Schematic diagram of the verification process of the model verifier provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0053] Before the training starts, the present invention also conducted the following experiments to verify the influence degree of poisoning on the training accuracy of the model. Specifically:

[0054] In the experiment, 50,000 training sets were evenly divided into 10 parts, with 5,000 data in each part, to simulate 10 participants. Centralized learning is to collect 50,000 data to a central server for training; federated learning is that 10 participants jointly train the model; on the basis of federated learning, poisoning attack simulates that there are two malicious nodes that respectively shift the labels of 10% of the data (500 samples) backward by one label, that is, (y + 1)% 10, to simulate the poisoning attack of malicious participants, so as to destroy the aggregation of the global model and the model effect. AsFigure 3 As shown, it can be concluded that the accuracy of federated learning and centralized learning does not differ much and is within an acceptable range. However, the convergence speed of the federated learning model is slightly slower than that of centralized learning. At the same time, poisoning only 0.02% of the data (1000 out of 50000) causes the accuracy of the model to drop to 44%. This shows the necessity of guarding against poisoning attacks.

[0055] In response to this, as Figure 4 shown, an embodiment of the present invention discloses a blockchain-based AI model training method, including the following steps:

[0056] S1. Build an original AI model according to the characteristics of the dataset;

[0057] S2. Before the start of each round of training of the original AI model, randomly assign the participants in the training process into three categories in proportion: model trainers, model validators, and model blockchain uploaders;

[0058] S3. During each round of training, the model trainer and the model validator respectively obtain the global model of the previous round from the blockchain and use the local dataset for training to generate their respective local models for this round;

[0059] The model validator uses the locally generated local model to verify the local model generated by the model trainer;

[0060] The model blockchain uploader aggregates all the local models passed by the model validators to obtain the global model of this round, and packages the global model of this round, the verification results, and all local models into the blockchain.

[0061] Next, the above steps will be further described.

[0062] Specifically, in S1, select a suitable AI algorithm model according to the characteristics of the dataset.

[0063] First, for a specific dataset, an algorithm of a model that can achieve good results in centralized learning (traditional model training, where data is collected on a central server and then model training is carried out) needs to be selected. For example, if the data features show a non-linear relationship, a linear algorithm cannot be selected for model training, as the models trained by centralized learning will not have ideal effects, and the effects of distributed model training will be even less likely to be good.

[0064] Select a suitable algorithm for image data - convolutional neural network. For the Cifar-10 dataset, Cifar-10 is a 3-channel color 3*32*32 RGB image. This dataset includes 50,000 training pictures and 10,000 test pictures. Each picture is a 32*32*3 RGB image, and the labels are divided into 10 categories including animals and vehicles, namely airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck. In the embodiment of the present invention, a simple convolutional neural network is built for training. The specific schematic diagram of the built convolutional neural network is as shown in Figure 5 (other parameters: stride = 1, padding = 1). The 32*32*3 picture data becomes 16*16*16 after the first convolution, becomes 8*8*32 after the second convolution, and becomes 4*4*64 after the third convolution. Before entering the fully connected layer, the three-dimensional matrix is flattened into one-dimensional data. After two fully connected layers, finally, a one-dimensional vector of size 10 is output and then passed through the softmax activation function to obtain the probability of classification at the corresponding position.

[0065] In a specific embodiment, in S2, before the start of this round of training, the identities of the participants are randomly assigned according to a ratio. The ratio relationship is: T > V > M, where T is the model trainer, V is the model validator, and M is the model uploader; it is ensured that the majority of nodes are model trainers, followed by model validators, and finally model uploaders. The purpose is to let more data participate in the real training, so that the model can converge faster with fewer iterations. Of course, the ratio of model validators can also be appropriately increased. The advantage of doing this is that it can overall improve the effect of preventing malicious node attacks.

[0066] Classifying the identities of the participants before each round of training has the advantage of rejecting a malicious node from "doing evil" for a long time in a certain "position", and at the same time, it can also make full use of the data of all legal nodes for model training.

[0067] In a specific embodiment, in S3, each participant completes its own task according to its identity, specifically:

[0068] S31. During each round of training, the execution process of the model trainer includes:

[0069] For all model trainers, t i ∈T, the model trainer t i downloads the global model G of the previous round from the blockchain j-1 , and based on the global model G of the previous round j-1As the training starting point, use the local training set for training to obtain the local local model and use one's own private key to sign it and send it to the model verifier; among them, contains the local model and the reputation reward of the model trainer t i Thus, the training task of the model trainer for this round is completed.

[0070] S32. During each round of training, the execution process of the model verifier includes:

[0071] 1) For all model verifiers, v k ∈V, the model verifier v k receives all the sent by all model trainers, and uses the public key of the model trainer t i to verify to ensure that the content has not been tampered with and to determine that it is sent by t i . If the verification fails, discard it; if the verification passes, execute the following steps;

[0072] 2) The model verifier v k downloads the global model G of the previous round from the blockchain j-1 , and based on the global model G of the previous round j-1 as the training starting point, use the local training set for training to obtain the local local model

[0073] 3) Use the local test set to calculate the accuracy rates of the local local model sent by the model trainer and the local local model trained by itself respectively, to obtain the accuracy rate of the local model trained by the model trainer and the accuracy rate of the local model trained by the model verifier

[0074] 4) According to the accuracy rates of the two, conduct a voting verification on the local model trained by the model trainer; because it is the same type of data set, the training set of the model verifier and the training set of the model trainer follow the same probability distribution. This verification method uses this principle to verify the local local model of the model trainer.

[0075] As Figure 6 shown, the process of conducting a voting verification on the local model of the model trainer is as follows:

[0076] If the accuracy of the local model trained by the model trainer is not lower than that of the local model trained by the model verifier, that is then directly determine that the local model trained by the model trainer is legal and vote "agree";

[0077] Otherwise, excluding the above legal local models, the remaining local models trained by the model trainer are denoted as T rest , and calculate the weighted accuracy difference according to the following formula;

[0078]

[0079] Judge the difference between the accuracy of all the remaining local models t trained by the model trainer and the accuracy of the local model trained by the model verifier, where t ∈ T rest , and the judgment condition is:

[0080]

[0081] If the above judgment condition is satisfied, vote "agree", otherwise, determine it as illegal and vote "reject".

[0082] 4) After the verification is completed, the model verifier v k uses its own private key to encrypt and send it to the model uploader to ensure that the content has not been tampered with and to confirm that it is sent by t i . If the verification fails, discard it; encapsulates the voting result, the local model trained by the model trainer, the reputation reward of the model verifier, and the reputation reward of the model trainer.

[0083] So far, the training task of the model verifier for this round is completed.

[0084] S33. The execution process of the model uploader includes:

[0085] For all model uploaders, m p ∈ M, the model uploader m p receives all the sent by the model verifiers and uses the public key of the model verifier v k to verify to ensure that the content has not been tampered with and to confirm that it is sent by the model verifier v . If the verification fails, discard it; k

[0086] Each model uploader m p p counts the local models trained by the model trainer The votes from all model verifiers are counted for each local model to obtain the number of votes received.

[0087] If the number of legal local models trained by the model trainer is greater than or equal to the number of illegal local models, then all legal local models are aggregated; otherwise, no action is taken. The comparison formula is:

[0088] count(legal) ≥ count(illegal)?

[0089] If the above formula is correct, it is used as the input for calculating G j ; otherwise, no action is taken.

[0090] That is, the local models that have received more than half of the "agree" votes are aggregated to form the global model for this round. This method is summarized as the Federated Averaging (FedAvg) algorithm. Its core idea is to allocate weights according to the ratio of the number of training sets of model trainer t i to the total number of training sets of all legal model trainers. The specific aggregation formula is as follows: where,

[0091]

[0092] G j is the global model generated during the j-th round of training; is the number of training sets of model trainer t i ; train_total is the total number of training sets of all legal model trainers; is the local model trained by t i during the j-th round of training.

[0093] The model uploader m p packs the global model, voting results, and all local models of this round into a block

[0094] In a more advantageous embodiment, S3 further includes:

[0095] After the model uploader packs the data, it also uses the Proof of Stake (PoS) consensus algorithm to compete for the right to record transactions. The model uploader that obtains the right to record transactions packs the data onto the blockchain.

[0096] If two or more model uploaders obtain the right to record transactions at the same time, the fork problem is resolved based on the reputation rewards of each model uploader saved in the blockchain, and the block packed by the model uploader with a higher reputation reward is selected as the legal block.

[0097] All key information has been uploaded to the blockchain, and the content cannot be changed. It can be traced, verified, and held accountable in the future. Moreover, the reputation value can be linked to the financial system and integrated with real-world commodities. This enhances the value of the reputation value, thereby encouraging more people to participate in the system and making the AI model perform better.

[0098] Thus, the model uploader has completed the training task in this round.

[0099] Repeat S2 - S3 until the AI model converges (the model performance cannot be further improved iteratively), and the task ends.

[0100] Define a fixed number of iterations or the difference between the global model parameters in two consecutive rounds is less than a very small positive number as the task end condition.

[0101] Next, the relevant parameter definitions involved in the embodiments of the present invention are uniformly described as shown in Table 1:

[0102] Table 1 Parameter Definition Explanation

[0103]

[0104]

[0105] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0106] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for training an AI model based on blockchain, characterized in that, Including: Construct an original AI model according to the characteristics of the dataset; Before the start of each round of training of the original AI model, randomly assign the participants in the training process into three categories in proportion: model trainers, model validators, and model uploaders to the blockchain; During each round of training, the model trainers and the model validators respectively obtain the global model of the previous round from the blockchain and use the local dataset for training to generate their respective local models for this round; The model validators use the locally generated local models to verify the local models generated by the model trainers; The model uploaders aggregate all the local models passed by the model validators to obtain the global model for this round, and package the global model for this round, the verification results, and all local models to the blockchain; During each round of training, the execution process of the model trainers includes: The model trainer t i Downloads the global model G of the previous round from the blockchain j-1 , and based on the global model G of the previous round j-1 As the training starting point, uses the local training set for training to obtain a local partial model And uses its own private key To Perform a signature and send it to the model verifier; where Contains the partial model And the reputation reward of the model trainer t i ; During each round of training, the execution process of the model validators includes: The model verifier receives the sent by the model trainer i public key to verify If the verification fails, discard it. If the verification passes, execute the following steps; The model validator v k downloads the global model G of the previous round from the blockchain j-1 , and based on the global model G of the previous round j-1 as the training starting point, uses the local training set for training to obtain a local partial model Use the local test set to calculate the accuracy of the local partial models sent by the model trainer and the local partial models obtained by its own training to obtain the accuracy of the partial models trained by the model trainer and the accuracy of the partial models trained by the model verifier Vote to verify the local models trained by the model trainers according to their accuracies; After the verification is completed, the model verifier v k uses its own private key to encrypt and send it to the model uploader; contains the voting result, the local model trained by the model trainer, the reputation reward of the model verifier, and the reputation reward of the model trainer.

2. The method for training an AI model based on blockchain according to claim 1, characterized in that, It also includes: after the model uploaders package the data, they also use the PoS consensus algorithm to compete for the right to record accounts, and the model uploaders who obtain the right to record accounts package the data to the blockchain.

3. The method for training an AI model based on blockchain according to claim 2, characterized in that, If two or more of the model uploaders obtain the right to record accounts at the same time, the fork problem is solved based on the reputation rewards of each model uploader saved in the blockchain, and the block packaged by the model uploader with a higher reputation reward is selected as the legal block.

4. The method for training an AI model based on blockchain according to claim 1, characterized in that, When the dataset is image data, the original AI model uses a convolutional neural network, and the convolutional neural network includes three convolutional layers and two fully connected layers.

5. The method for training an AI model based on blockchain according to claim 1, characterized in that, Before the start of each round of training, the allocation ratio relationship of the participants is: T > V > M, where T is the model trainer, V is the model validator, and M is the model uploader to the blockchain.

6. The method for training an AI model based on blockchain according to claim 1, characterized in that, The process of voting to verify the local models of the model trainers is: If the accuracy rate of the local model trained by the model trainer is not lower than that of the local model trained by the model verifier, that is then directly determine that the local model trained by the model trainer is legal and vote "agree"; Otherwise, except for the above-mentioned legitimate local models, the remaining local models trained by the model trainer are denoted as T rest , and the weighted accuracy difference is calculated according to the following formula; Determine the difference between the accuracy of all the remaining local models t trained by the model trainer and the accuracy of the local models trained by the model verifier, and compare it with the weighted accuracy difference, where t ∈ T rest , and the judgment condition is: If the above judgment conditions are met, the vote is "agree", otherwise, it is determined to be illegal and the vote is "reject".

7. The method for training an AI model based on blockchain according to claim 1, characterized in that, The execution process of the model uploaders includes: The model uploader m p receives the sent by the model verifier, and uses the public key k of the model verifier v to verify and discards it if the verification fails; Each model uploader m p counts the local models trained by the model trainer and calculates the number of votes obtained for each local model from the votes of all the model verifiers ; If the number of legal local models trained by the model trainers is greater than or equal to the number of illegal local models, aggregate all legal local models, otherwise, do not process; The model uploader m p Packages the global model, voting results, and all local models of this round into a block 8. A blockchain-based AI model training method according to claim 7, wherein, The formula for aggregating all legal local models is: Among them, G j is the global model generated during the j-th round of training; is the number of training sets of the model trainer t i ; train_total is the total number of training sets of all legal model trainers; is the local model trained by t i during the j-th round of training.

Citation Information

Patent Citations

  • Federal learning method and system based on block chain and trusted execution environment

    CN113837761A

  • Model training method and device, electronic equipment and storage medium

    CN114169387A