A model training method, device and equipment

By distinguishing information storage and processing processes on the blockchain, using the first blockchain to store verified model parameters and the second blockchain to record the training process, the problem of low information query efficiency in the blockchain is solved and improved Model training speed and ensuring information security.

CN112418433BActive Publication Date: 2024-10-18LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011194536.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2024-10-18
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

In the distributed machine learning scenario based on the blockchain, the required information cannot be quickly extracted from the blockchain during the model training process, resulting in low efficiency of information query and processing, and the inability to quickly obtain the latest verified model parameters.

Method used

By reasonably dividing the blockchain into the first blockchain and the second blockchain, the first blockchain is used to store the model information of the verified artificial intelligence model and interact with the participants during the model training process, so that Participants can directly obtain the latest verified model parameters from the end of the blockchain, and the second blockchain records model training and verification process information.

Benefits of technology

It has significantly improved the information query and processing efficiency of model training based on the blockchain, accelerated the model training speed, and effectively solved the underlying ledger recording function of the blockchain to ensure information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112418433B_ABST
    Figure CN112418433B_ABST
Patent Text Reader

Abstract

The present invention discloses a model training method, device and equipment, which includes: obtaining initial model parameters from a first blockchain for recording the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed verification, performing model training according to the initial model parameters to obtain a first model, and constructing a transaction information block for showing the training and verification of the first model on a second blockchain for recording the training process information and verification process information of the artificial intelligence model; obtaining the verification result of the first model from the second blockchain; when the verification result shows that the proportion of model verification party nodes that have passed the verification of the first model reaches a set threshold, constructing a block for showing the model information of the first model on the first blockchain. In this way, the process of screening model information from the redundant information of the blockchain is effectively avoided, the information query and processing efficiency of model training based on the blockchain is significantly improved, and the speed of model training is accelerated.
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 in particular to a model training method, device and equipment. Background Art

[0002] The blockchain-based artificial intelligence model training scenario BDML (Blockchain-based Distributed Machine Learning) refers to an alliance that uses blockchain technology to collaboratively train a model in order to solve a specific artificial intelligence problem while protecting the data of each participant from being leaked.

[0003] In the basic BDML system based on Hyperedger Fabric, all transactions related to voting for model verification during model training are stored on a blockchain, which is full of redundant information. During model training, it is impossible to quickly extract the required information from the blockchain. Summary of the invention

[0004] In order to solve the above problems, the embodiments of the present invention creatively provide a model training method, device and equipment.

[0005] According to a first aspect of the present invention, there is provided a model training method, which is applied to a training node in a task participant node that uses a blockchain to train an artificial intelligence model, the task participant node also including a verification node that verifies the model trained by the training node, the method comprising: obtaining initial model parameters from a first blockchain, the first blockchain being used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed verification; performing model training according to the initial model parameters to obtain a first model; constructing a transaction information block on a second blockchain for showing training and verification of the first model, the second blockchain being used to record the training process information and verification process information of the artificial intelligence model; obtaining verification results of the first model by multiple verification nodes of the artificial intelligence model training from the second blockchain; when the verification results show that the proportion of model verification nodes that have passed the verification of the first model reaches a set threshold, constructing a block on the first blockchain for showing the model information of the first model.

[0006] According to one embodiment of the present invention, obtaining the initial model parameters from the first blockchain includes one of the following: when a task initiator node that uses blockchain to train an artificial intelligence model initiates a model training task, the initial model parameters of the first model determined by the task initiator node are read from the first blockchain; when there is a block of model information constructed by the model participant node on the first blockchain, the model parameters of the current optimal model are obtained from the first blockchain as the initial model parameters.

[0007] According to one embodiment of the present invention, the model transaction information block for showing the training and verification of the first model is constructed on the second blockchain, including: when the trainer node trains the first model, a first transaction information block for showing the model identifier, model parameters, model trainer and model status of the first model is constructed on the second blockchain; when any of the verifier nodes completes the verification of the first model, a second transaction information block for showing the verification result of the verifier node on the first model is constructed on the second blockchain.

[0008] According to one embodiment of the present invention, the method also includes: when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model is less than a set threshold, obtaining the model parameters of the artificial intelligence model trained by other participant nodes in the artificial intelligence model training from the second blockchain as correction parameters; performing model training again according to the initial model parameters and the correction parameters to obtain a second model; constructing a model transaction information block on the second blockchain for showing the training and verification of the second model; obtaining the verification results of the second model by multiple verification nodes of the artificial intelligence model training from the second blockchain; when the verification result shows that the proportion of model verification nodes that have passed the verification of the second model reaches a set threshold, constructing a block on the first blockchain for showing the model information of the second model.

[0009] According to the second aspect of an embodiment of the present invention, a model training method is also provided, which is applied to a verifier node in a task participant node that uses a blockchain to train an artificial intelligence model, the task participant node also includes the trainer node, and the verifier node is used to verify the model trained by the trainer node. The method includes: obtaining a first model from a second blockchain, the first model is trained by the trainer node according to the initial model parameters obtained from the first blockchain, wherein the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the verified artificial intelligence model, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model; verifying the first model; constructing a block on the second blockchain for showing the verification result of the first model, so that the trainer node determines whether to construct a block on the first blockchain for showing the model information of the first model according to the verification result.

[0010] According to one embodiment of the present invention, the verification of the first model includes: obtaining a first test result by testing the current optimal model obtained from the first blockchain based on the local data of the verifier node; testing the first model based on the local data to obtain a second test result; when the model accuracy shown by the second test result is higher than the model accuracy shown by the first test result, it is determined that the first model has been verified.

[0011] According to the third aspect of the implementation of the present invention, there is also provided a model training device, which is applied to a training node in a task participant node that uses a blockchain to train an artificial intelligence model. The task participant node also includes a verification node that verifies the model trained by the training node. The device includes: a first acquisition module, used to obtain initial model parameters from a first blockchain, and the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed the verification; a first model training module, used to perform model training according to the initial model parameters to obtain a first model; a first block generation module, used to construct a transaction information block on a second blockchain for showing the training and verification of the first model, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model; a second acquisition module, used to obtain the verification results of the first model by multiple verification nodes of the artificial intelligence model training from the second blockchain; a second block generation module, used to construct a block on the first blockchain for showing the model information of the first model when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model reaches a set threshold.

[0012] According to one embodiment of the present invention, the device also includes: a correction parameter acquisition module, which is used to obtain the model parameters of the artificial intelligence model trained by other participant nodes in the artificial intelligence model training from the second blockchain as correction parameters when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model is less than a set threshold; a second model training module, which is used to perform model training again according to the initial model parameters and the correction parameters to obtain a second model; a third block generation module, which is used to construct a model transaction information block on the second blockchain for showing the training and verification of the second model; a verification result acquisition module, which is used to obtain the verification results of the second model by multiple verification nodes of the artificial intelligence model training on the second blockchain; a fourth block generation module, which is used to construct a block on the first blockchain for showing the model information of the second model when the verification result shows that the proportion of model verification nodes that have passed the verification of the second model reaches a set threshold.

[0013] According to the fourth aspect of an embodiment of the present invention, there is also provided a model training device, which is applied to a verifier node in a task participant node that uses a blockchain to train an artificial intelligence model. The task participant node also includes the trainer node, and the verifier node is used to verify the model trained by the trainer node. The device includes: a model acquisition module, which is used to obtain a first model from a second blockchain, and the first model is obtained by training the trainer node according to the initial model parameters obtained from the first blockchain, wherein the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed the verification, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model; a verification module, which is used to verify the first model; a block generation module, which is used to construct a block on the second blockchain for showing the verification result of the first model, so that the trainer node determines whether to construct a block on the first blockchain for showing the model information of the first model according to the verification result.

[0014] According to the fifth aspect of the present invention, a device is provided, which includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call the program instructions in the memory to execute the above-mentioned model training method.

[0015] According to the sixth aspect of the present invention, a computer-readable storage medium is provided, which includes a set of computer-executable instructions, which are used to execute any of the above-mentioned model training methods when the instructions are executed.

[0016] The model training method, device and equipment of the embodiment of the present invention obtains the initial model parameters from the first blockchain used to record the initial parameters of the artificial intelligence model and the model information of the verified artificial intelligence model, performs model training according to the initial model parameters, obtains the first model, and constructs a transaction information block for showing the training and verification of the first model on the second blockchain used to record the training process information and verification process information of the artificial intelligence model; obtains the verification results of the first model by multiple verification party nodes from the second blockchain; when the verification result shows that the proportion of the model verification party nodes that have verified the first model reaches the set threshold, a block for showing the model information of the first model is constructed on the first blockchain. In this way, by reasonably distinguishing the blockchain into the first blockchain and the second blockchain, the first blockchain is used to store the model information of the verified artificial intelligence model, and interacts with the participants during the model training process, so that the participants can directly obtain the latest model parameters that have been verified from the tail end of the first blockchain during the model training process, effectively avoiding the process of filtering and screening model information from the redundant information of the blockchain, significantly improving the information query and processing efficiency of model training based on the blockchain, and accelerating the model training speed. At the same time, the second blockchain can effectively solve the underlying ledger recording function of the blockchain and ensure information security.

[0017] It should be understood that the teachings of the present invention are not required to achieve all of the beneficial effects described above, but specific technical solutions can achieve specific technical effects, and other embodiments of the present invention can also achieve beneficial effects not mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:

[0019] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0020] Figure 1 The following is a schematic diagram showing the implementation process of the model training method of the embodiment of the present invention. Figure 1 ;

[0021] Figure 2 The following is a schematic diagram showing the implementation process of the model training method of the embodiment of the present invention. Figure 2 ;

[0022] Figure 3 A schematic diagram of the composition structure of a blockchain in a specific application example of the model training method according to an embodiment of the present invention is shown;

[0023] Figure 4The following is a schematic diagram showing a specific application example implementation process of the model training method according to an embodiment of the present invention. Figure 1 ;

[0024] Figure 5 The following is a schematic diagram showing a specific application example implementation process of the model training method according to an embodiment of the present invention. Figure 2 ;

[0025] Figure 6 A schematic diagram of the information structure of a blockchain in a specific application example of the model training method according to an embodiment of the present invention is shown;

[0026] Figure 7 The schematic diagram of the structure of the model training device according to the embodiment of the present invention is shown. Figure 1 ;

[0027] Figure 8 The schematic diagram of the structure of the model training device according to the embodiment of the present invention is shown. Figure 2 ;

[0028] Fig. 9 A schematic diagram of the structure of the device according to the embodiment of the present invention is shown. DETAILED DESCRIPTION

[0029] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0030] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0031] Figure 1 The following is a schematic diagram showing the implementation process of the model training method of the embodiment of the present invention. Figure 1 .

[0032] refer to Figure 1The model training method of an embodiment of the present invention is applied to a training node in a task participant node that uses a blockchain to train an artificial intelligence model. The task participant node also includes a verification node that verifies the model trained by the training node, and at least includes the following operation procedures: operation 101, obtaining initial model parameters from a first blockchain, and the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed the verification; operation 102, performing model training according to the initial model parameters to obtain a first model; operation 103, constructing a transaction information block for showing the training and verification of the first model on a second blockchain, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model; operation 104, obtaining the verification results of the first model by multiple verification nodes of the artificial intelligence model training from the second blockchain; operation 105, when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model reaches a set threshold, constructing a block for showing the model information of the first model on the first blockchain.

[0033] In operation 101, initial model parameters are obtained from a first blockchain, where the first blockchain is used to record the initial parameters of the artificial intelligence model and model information of the verified artificial intelligence model.

[0034] In one embodiment of the present invention, obtaining initial model parameters from the first blockchain includes one of the following: when a task initiator node that uses blockchain to train an artificial intelligence model initiates a model training task, the initial model parameters of the first model determined by the task initiator node are read from the first blockchain; when there is a block of model information constructed by the model participant node on the first blockchain, the model parameters of the current optimal model are obtained from the first blockchain as the initial model parameters.

[0035] For example, the blockchain network based on Hyperledger Fabric can be divided into two levels: the main chain and the sub-chain. The main chain stores all transaction information, and the sub-chain stores the extracted key information required for model training. For example: when the task initiator uses blockchain for artificial intelligence model training, a new task is initiated, and the model structure M, initial parameters W and other information are defined, and the initial blocks of the blockchain main chain and sub-chain are stored in the blockchain network. Participant A can obtain the initial parameters W and model structure M from the end of the sub-chain, and use local data for model training.

[0036] After the model trained by participant A is tested locally, it is broadcast to other participants, who vote. If the proportion of votes in favor exceeds the set verification threshold, the model trained by participant A is considered to be verified. At this time, a block is built on the subchain to store the model information of the verified model. The model information may include model structure and model parameters, etc. Before participant A builds a new block on the subchain, there may be other participants who train models, but the trained models fail to pass verification. For models that fail to pass verification, their model parameters and voting status are only stored on the main chain. In this way, it can be ensured that the last block of the subchain stores the model information of the latest verified model. When other participants need to train the model again, they can directly obtain the model parameters of the current optimal model from the end of the subchain as the initial model parameters.

[0037] It should be noted that, in the following description of specific examples of the embodiments of the present invention, unless otherwise stated, a blockchain network based on Hyperledger Fabric is divided into a main chain and a sub-chain as an example for description. The main chain stores all transaction information, which can be equivalent to the second blockchain, and the sub-chain stores the extracted key information required for model training, which can be equivalent to the first blockchain.

[0038] In operation 102, model training is performed according to initial model parameters to obtain a first model.

[0039] For example, Party A, as the training party, obtains the initial model parameters from the end of the sub-chain, and then uses Party A's local data to train the model to obtain the first model.

[0040] In operations 103 to 104, a transaction information block for showing the training and verification of the first model is constructed on the second blockchain. The second blockchain is used to record the training process information and verification process information of the artificial intelligence model, and the verification results of the first model by multiple verification nodes of the artificial intelligence model training are obtained from the second blockchain.

[0041] In one embodiment of the present invention, the following operating steps are adopted to realize the construction of a model transaction information block on the second blockchain for showing the training and verification of the first model: when the training node trains the first model, a first transaction information block for showing the model identification, model parameters, model training party and model status of the first model is constructed on the second blockchain; when any verification node completes the verification of the first model, a second transaction information block for showing the verification result of the verification node on the first model is constructed on the second blockchain.

[0042] For example, participant A obtains the initial model parameters W and model structure M provided by the task initiator from the end of the subchain, and after model training, obtains the model parameters W A1 At this time, a new block is constructed on the main chain of the blockchain and the model parameters are broadcast. The new block can include the model parameters W A1 , model training participant A, model status is pending voting, etc. Other participants can use their local test data to test the model parameters on the new block and vote on the model trained by participant A. It can be set that when the accuracy or precision of the model trained by participant A is higher than the set threshold, the model trained by participant A is voted in favor, otherwise, it is voted against. It can also be set that when the accuracy or precision of the model trained by participant A is higher than the accuracy or precision of the optimal model at the end of the current sub-chain, the model trained by participant A is voted in favor, otherwise, it is voted against. Each participant can vote according to the model parameters W A1 The result of voting on the model trained by participant A generates a new block on the main chain.

[0043] Get the model parameter W from the main chain A1 The voting result can be used to determine that the model trained by participant A has passed the verification when the proportion of votes in favor of the model trained by participant A among multiple participants in the artificial intelligence model is greater than the set approval threshold; otherwise, the verification is considered to have failed.

[0044] In operation 105 , when the verification result shows that the proportion of model verifier nodes that have verified the first model reaches a set threshold, a block showing model information of the first model is constructed on the first blockchain.

[0045] For example, it can be determined whether to build a new block on the first blockchain according to the verification results of the first model by multiple verification nodes of the artificial intelligence model training obtained from the second blockchain in operation 104. For example: if the proportion of the multiple participants of the artificial intelligence model who voted in favor of the model trained by participant A is greater than the set approval threshold, and the model trained by participant A passes the verification, then a block for showing the model trained by participant A is built on the subchain, and the block may include: the model generator is participant A, the model parameters W A1 And other information.

[0046] In one embodiment of the present invention, when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model is less than a set threshold, the model parameters of the artificial intelligence model trained by other participant nodes in the artificial intelligence model training are obtained from the second blockchain as correction parameters; according to the initial model parameters and the correction parameters, the model training is performed again to obtain a second model; a model transaction information block for showing the training and verification of the second model is constructed on the second blockchain; the verification results of the second model by multiple verification nodes of the artificial intelligence model training are obtained from the second blockchain; when the verification result shows that the proportion of model verification nodes that have passed the verification of the second model reaches a set threshold, a block for showing the model information of the second model is constructed on the first blockchain.

[0047] For example, the model trained by participant A has not passed the verification of other participants. Before generating a new block on the subchain, other participants will also perform model training and broadcast the model parameters obtained by training. Participant A can verify the model trained by other participants. When the verification results of multiple other participants on the first model trained by participant A show that the proportion of model verification party nodes that have verified the first model is less than the set threshold, it is determined that the model trained by participant A has passed the verification of other participants. At this time, participant A can obtain the model parameters trained by other participants from the subchain and perform model training again. Participant A can obtain the model parameters trained by all other participants before the new block is generated as correction parameters. It is also possible to obtain only the model parameters that participant A voted in favor of when verifying the model trained by other participants as correction parameters. At the same time, participant A can use the initial model parameters and correction parameters obtained in operation 101 to perform model training again. It is also possible to use the model parameters and correction parameters of the first model trained in operation 102 to perform model training again.

[0048] Figure 2 The following is a schematic diagram showing the implementation process of the model training method of the embodiment of the present invention. Figure 2 .

[0049] refer to Figure 2The model training method of an embodiment of the present invention is applied to a verifier node in a task participant node that uses a blockchain to train an artificial intelligence model. The task participant node also includes a trainer node. The verifier node is used to verify the model trained by the trainer node, and at least includes the following operation process: operation 201, obtaining a first model from a second blockchain, the first model is obtained by training the trainer node according to the initial model parameters obtained from the first blockchain, wherein the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the verified artificial intelligence model, and the second blockchain is used to record the training process information and the verification process information of the artificial intelligence model; operation 202, verifying the first model; operation 203, constructing a block on the second blockchain for showing the verification result of the first model, so that the trainer node determines whether to construct a block on the first blockchain for showing the model information of the first model according to the verification result.

[0050] In operation 201, a first model is obtained from the second blockchain, and the first model is trained by a training node according to initial model parameters obtained from the first blockchain, wherein the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the verified artificial intelligence model, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model.

[0051] For example, see Figure 1 In operations 102 to 103, when participant A obtains the first model through training, a block for showing the model training process of the first model is first constructed on the main chain. For example, the model generator is participant A, and the model parameters are W A1 The model verifier can obtain relevant information of the model from the main chain, such as model parameters, and perform model verification based on the obtained model information. For example, if the model is a model that uses a neural network algorithm for speech recognition, the recognition accuracy can be verified using the local data of the model verifier.

[0052] At operation 202 , the first model is validated.

[0053] In one embodiment of the present invention, the following operating steps are used to verify the first model: obtain a first test result based on the local data of the verifier node using the current optimal model obtained from the first blockchain; test the first model based on the local data to obtain a second test result; when the model accuracy shown in the second test result is higher than the model accuracy shown in the first test result, it is determined that the first model has been verified.

[0054] In operation 203, a block for showing the verification result of the first model is constructed on the second blockchain, so that the training node determines whether to construct a block for showing the model information of the first model on the first blockchain according to the verification result.

[0055] The specific implementation details of operations 201 to 203 are as follows: Figure 1 The relevant details of operations 101 to 105 in the illustrated embodiment are similar and will not be repeated here.

[0056] Figure 3 The schematic diagram of the composition structure of the blockchain in a specific application example of the model training method according to the embodiment of the present invention is shown. Figure 4 The following is a schematic diagram showing a specific application example implementation process of the model training method according to an embodiment of the present invention. Figure 1 , Figure 5 The following is a schematic diagram showing a specific application example implementation process of the model training method according to an embodiment of the present invention. Figure 2 , Figure 6 A schematic diagram of the information structure of a blockchain in a specific application example of the model training method according to an embodiment of the present invention is shown.

[0057] refer to Figures 3 to 6 In a specific application example of an embodiment of the present invention, a blockchain network based on Hyperledger Fabric is divided into two levels: a main chain and a sub-chain. The main chain stores all transaction information, and the sub-chain stores the extracted key information required for model training.

[0058] Specifically, any participant in the blockchain can be a model trainer and obtain the current optimal model parameters from the end of the subchain. For example, participant A, as a model trainer, obtains the model parameters of the latest block from the end of the subchain and performs model training. The model training process can be referred to Figure 4 , including at least the following processes:

[0059] Operation 401: pull the latest model on the blockchain subchain. The latest model on the blockchain subchain is the current optimal model.

[0060] Operation 402: Model training is performed using the local training data of participant A.

[0061] Operation 403 : Perform local testing on the trained model parameters using local data.

[0062] Operation 404, determine whether it is better than the latest block on the subchain. If so, execute operation 405, otherwise, execute operation 408.

[0063] Operation 405, broadcasting parameters to other participants. If it is determined that the model parameters are better than the current optimal model parameters, a new block M is constructed on the main chain to broadcast the model information so that other participants can obtain the model trained by the participant from the main chain and verify the model. Block M may include information such as model type Mi, parameters Wi, generator is participant A, and model status is pending voting.

[0064] Operation 406: Determine whether other participants have voted in favor. For the specific process, please refer to the following Figure 5 If yes, then execute operation 407, otherwise, execute operation 408.

[0065] Operation 407: The subchain generates a new block. For example: Figure 3 When the model generated by participant A passes the verification of other participants, a new block i is generated. Block i may include information such as model identifier Mi, model parameters Wi, and participant A. At this time, reset the reference model parameter Wr = 0

[0066] Operation 408, update parameters. For example, participant A retrains the model by integrating the model parameters trained by other participants, for example: W = α*Wi + (1-α) * Wr, where Wi is the parameter of the model Mi obtained by participant A in this round of training, and α is a pre-set parameter comprehensive coefficient, which can be set according to actual needs. Wr is the parameter of the model trained by other participants, for example: it can be the mean of the model parameters of the models trained by all other participants, or it can be the mean of the model parameters of the models trained by participants voted in favor of participant A, or other reasonable methods can be used to update the parameters.

[0067] Each participant can also be a model verifier, for example: participant B, participant C. Participant B verifies the model Mi trained by the participant. The implementation process of model verification can be referred to Figure 5 ,like Figure 5 As shown, including at least:

[0068] Operation 501, receiving parameters of training models from other participants. For example, in operation 405, participant A broadcasts the model Mi and parameters Wi to other participants.

[0069] Operation 502, Wr is obtained by integrating the parameters of other participants and saved.

[0070] For example, participant B receives and saves the model parameters Wi of the model trained by other participant A.

[0071] Operation 503, using local test data to test the received model. For example: using the model Mi trained by participant A to test, verify whether the accuracy or precision of the model Mi is higher than the accuracy or precision of the optimal model on the latest block on the current subchain.

[0072] Operation 504, determine whether it is better than the latest block on the subchain. If so, execute operation 505, otherwise execute operation 506.

[0073] Operation 505: The vote of approval is stored in the main chain. The verification result generates a new block on the main chain. For example, the verification result of participant B on the model Mi trained by participant A is a vote of approval, generating block N. The verification result of participant C on the model Mi trained by participant A is a vote of approval, generating block O.

[0074] When the proportion of participants who voted in favor of verifying the model Mi trained by participant A reaches the set threshold, return to reference operation 407 and generate a new block on the sub-chain, for example: participant A generates a new block i on the sub-chain.

[0075] Operation 506: The negative vote is stored in the main chain.

[0076] It should be noted that for the specific information stored on the main chain and sub-chain, please refer to Figure 6 The subchain is used to store model-related information, while the main chain stores all transaction information. The relevant information of the verified model stored on the subchain can also be found on the main chain.

[0077] Therefore, the model training method, device and equipment of the embodiment of the present invention obtains the initial model parameters from the first blockchain used to record the initial parameters of the artificial intelligence model and the model information of the verified artificial intelligence model, performs model training according to the initial model parameters, obtains the first model, and constructs a transaction information block for showing the training and verification of the first model on the second blockchain used to record the training process information and verification process information of the artificial intelligence model; obtains the verification results of the first model by multiple verification party nodes from the second blockchain; when the verification result shows that the proportion of the model verification party nodes that have verified the first model reaches the set threshold, a block for showing the model information of the first model is constructed on the first blockchain. In this way, by reasonably dividing the blockchain into the first blockchain and the second blockchain, the first blockchain is used to store the model information of the verified artificial intelligence model, and interacts with the participants during the model training process, so that the participants can directly obtain the latest model parameters that have been verified from the tail end of the first blockchain during the model training process, effectively avoiding the process of filtering and screening model information from the redundant information on the blockchain, significantly improving the information query and processing efficiency of model training based on the blockchain, and accelerating the model training speed. At the same time, the second blockchain can effectively solve the underlying ledger recording function of the blockchain and ensure information security.

[0078] Similarly, based on the above model training method, an embodiment of the present invention further provides a computer-readable storage medium, which stores a program. When the program is executed by a processor, the processor performs at least the following operation steps: operation 101, obtaining initial model parameters from a first blockchain, and the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed the verification; operation 102, performing model training according to the initial model parameters to obtain a first model; operation 103, constructing a transaction information block on the second blockchain for showing the training and verification of the first model, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model; operation 104, obtaining the verification results of the first model by multiple verification nodes of the artificial intelligence model training from the second blockchain; operation 105, when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model reaches a set threshold, constructing a block on the first blockchain for showing the model information of the first model.

[0079] Further, based on the above model training method, an embodiment of the present invention also provides a model training device, Figure 7 The schematic diagram of the model training device according to the embodiment of the present invention is shown. Figure 1 The device 70 is applied to a training node in a task participant node that uses blockchain to train an artificial intelligence model. The task participant node also includes a verification node that verifies the model trained by the training node, such as Figure 7 As shown, the device 70 includes: a first acquisition module 701, used to obtain initial model parameters from a first blockchain, and the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the verified artificial intelligence model; a first model training module 702, used to perform model training according to the initial model parameters to obtain a first model; a first block generation module 703, used to construct a transaction information block on the second blockchain for showing the training and verification of the first model, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model; a second acquisition module 704, used to obtain the verification results of the first model by multiple verification nodes of the artificial intelligence model training on the second blockchain; a second block generation module 705, used to construct a block on the first blockchain for showing the model information of the first model when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model reaches a set threshold.

[0080] According to one embodiment of the present invention, the device 70 also includes: a correction parameter acquisition module, which is used to obtain the model parameters of the artificial intelligence model trained by other participating nodes in the artificial intelligence model training from the second blockchain as correction parameters when the verification result shows that the proportion of model verification nodes that have passed the verification of the first model is less than a set threshold; a second model training module, which is used to perform model training again according to the initial model parameters and the correction parameters to obtain a second model; a third block generation module, which is used to construct a model transaction information block on the second blockchain for showing the training and verification of the second model; a verification result acquisition module, which is used to obtain the verification results of the second model by multiple verification nodes of the artificial intelligence model training on the second blockchain; a fourth block generation module, which is used to construct a block on the first blockchain for showing the model information of the second model when the verification result shows that the proportion of model verification nodes that have passed the verification of the second model reaches a set threshold.

[0081] Figure 8 The schematic diagram of the model training device according to the embodiment of the present invention is shown. Figure 2 The device 80 is applied to the verification node in the task participant node for training the artificial intelligence model using blockchain. The task participant node also includes a training node. The verification node is used to verify the model trained by the training node, such as Figure 8As shown, the device 80 includes: a model acquisition module 801, used to obtain a first model from a second blockchain, the first model is trained by a training node according to initial model parameters obtained from the first blockchain, wherein the first blockchain is used to record the initial parameters of the artificial intelligence model and the model information of the verified artificial intelligence model, and the second blockchain is used to record the training process information and verification process information of the artificial intelligence model; a verification module 802, used to verify the first model; a block generation module 803, used to construct a block on the second blockchain for showing the verification result of the first model, so that the training node determines whether to construct a block on the first blockchain for showing the model information of the first model according to the verification result.

[0082] Furthermore, based on the above model training method, the embodiment of the present invention further provides a device, such as Fig. 9 As shown, the device 90 includes at least one processor 901, and at least one memory 902 and a bus 903 connected to the processor 901; wherein the processor 901 and the memory 902 communicate with each other through the bus; the processor 901 is used to call the program instructions in the memory 902 to execute the above-mentioned model training method.

[0083] It should be noted that the above description of the model training device and equipment embodiment is different from the above description of the model training device and equipment embodiment. Figures 1 to 6 The description of the method embodiment shown is similar, with the same Figures 1 to 6 The method embodiments shown in the figure have similar beneficial effects, so they are not described in detail. For technical details not disclosed in the embodiments of the model training device and equipment of the present invention, please refer to the aforementioned Figures 1 to 6 The description of the method embodiment shown in the figure can be understood, and in order to save space, it will not be repeated.

[0084] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0085] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0086] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0087] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0088] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0089] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0090] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A model training method, applied to a training node in a task participant node that uses blockchain to train an artificial intelligence model, wherein the task participant node also includes a verification node that verifies the model trained by the training node, the blockchain includes a subchain and a main chain, and the method includes: Acquire initial model parameters from a first blockchain, where the first blockchain corresponds to the subchain and is used to record the initial parameters of the artificial intelligence model and model information of the artificial intelligence model that has passed verification; Performing model training according to the initial model parameters to obtain a first model; Constructing a transaction information block for showing training and verification of the first model on a second blockchain, wherein the second blockchain corresponds to the main chain and is used to record training process information and verification process information of the artificial intelligence model; Obtaining verification results of the first model from multiple verification nodes trained by the artificial intelligence model on the second blockchain; When the verification result shows that the proportion of model verifier nodes that have verified the first model reaches a set threshold, a block for showing model information of the first model is constructed on the first blockchain.

2. According to the method of claim 1, the obtaining of initial model parameters from the first blockchain comprises one of the following: When a task initiator node that uses blockchain to perform artificial intelligence model training initiates a model training task, initial model parameters of the first model determined by the task initiator node are read from the first blockchain; When there is a block of model information constructed by the model participant node on the first blockchain, the model parameters of the current optimal model are obtained from the first blockchain as the initial model parameters.

3. According to the method of claim 1, constructing a model transaction information block on the second blockchain for showing training and verification of the first model comprises: When the training node obtains the first model through training, a first transaction information block is constructed on the second blockchain to show the model identifier, model parameters, model training party, and model status of the first model; When any of the verifier nodes completes the verification of the first model, a second transaction information block is constructed on the second blockchain to show the verification result of the first model by the verifier node.

4. The method according to claim 1, further comprising: When the verification result shows that the proportion of model verification party nodes that have passed the verification of the first model is less than a set threshold, the model parameters of the artificial intelligence model trained by other participant nodes in the artificial intelligence model training are obtained from the second blockchain as correction parameters; Performing model training again according to the initial model parameters and the revised parameters to obtain a second model; Constructing a model transaction information block on a second blockchain for showing training and verification of the second model; Obtain verification results of the second model from multiple verification nodes trained by the artificial intelligence model on the second blockchain; When the verification result shows that the proportion of model verifier nodes that have verified the second model reaches a set threshold, a block for showing model information of the second model is constructed on the first blockchain.

5. A model training method, applied to a verifier node in a task participant node that uses blockchain to train an artificial intelligence model, wherein the task participant node also includes a trainer node, and the verifier node is used to verify the model trained by the trainer node, and the blockchain includes a subchain and a main chain, and the method includes: Obtaining a first model from a second blockchain, wherein the first model is trained by the training node according to the initial model parameters obtained from the first blockchain, wherein the first blockchain corresponds to the subchain and is used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed the verification, and the second blockchain corresponds to the main chain and is used to record the training process information and the verification process information of the artificial intelligence model; verifying the first model; A block for showing the verification result of the first model is constructed on the second blockchain, so that the training node determines whether to construct a block for showing the model information of the first model on the first blockchain according to the verification result.

6. The method according to claim 5, wherein the verifying the first model comprises: Obtaining a first test result of testing based on the local data of the verifier node using the current optimal model obtained from the first blockchain; Testing the first model according to the local data to obtain a second test result; When the model accuracy shown by the second test result is higher than the model accuracy shown by the first test result, it is determined that the first model has been verified.

7. A model training device, applied to a training node in a task participant node for training an artificial intelligence model using a blockchain, wherein the task participant node also includes a verification node for verifying the model trained by the training node, the blockchain includes a subchain and a mainchain, and the device includes: A first acquisition module, used to acquire initial model parameters from a first blockchain, the first blockchain corresponding to the subchain, and used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed verification; A first model training module, used for performing model training according to the initial model parameters to obtain a first model; A first block generation module, used to construct a transaction information block for showing training and verification of the first model on a second blockchain, the second blockchain corresponding to the main chain, and used to record the training process information and verification process information of the artificial intelligence model; A second acquisition module is used to obtain verification results of the first model by multiple verification party nodes trained by the artificial intelligence model from the second blockchain; The second block generation module is used to construct a block for showing the model information of the first model on the first blockchain when the verification result shows that the proportion of model verifier nodes that have passed the verification of the first model reaches a set threshold.

8. The device according to claim 7, further comprising: A correction parameter acquisition module, configured to obtain, from the second blockchain, model parameters of the artificial intelligence model trained by other participant nodes in the artificial intelligence model training, as correction parameters, when the verification result shows that the proportion of model verification party nodes that have passed the verification of the first model is less than a set threshold; A second model training module, used for performing model training again according to the initial model parameters and the revised parameters to obtain a second model; A third block generation module, configured to construct, on a second blockchain, a model transaction information block for illustrating training and verification of the second model; A verification result acquisition module, used to obtain verification results of the second model by multiple verification party nodes trained by the artificial intelligence model from the second blockchain; The fourth block generation module is used to construct a block on the first blockchain for showing the model information of the second model when the verification result shows that the proportion of model verifier nodes that have passed the verification of the second model reaches a set threshold.

9. A model training device, applied to a verifier node in a task participant node for artificial intelligence model training using blockchain, wherein the task participant node also includes a trainer node, and the verifier node is used to verify the model trained by the trainer node, wherein the blockchain includes a subchain and a main chain, and the device includes: A model acquisition module, used to acquire a first model from a second blockchain, wherein the first model is trained by the training node according to the initial model parameters obtained from the first blockchain, wherein the first blockchain corresponds to the subchain and is used to record the initial parameters of the artificial intelligence model and the model information of the artificial intelligence model that has passed the verification, and the second blockchain corresponds to the main chain and is used to record the training process information and verification process information of the artificial intelligence model; A verification module, used for verifying the first model; A block generation module is used to construct a block on the second blockchain for showing the verification result of the first model, so that the training node determines whether to construct a block on the first blockchain for showing the model information of the first model according to the verification result.

10. A device comprising at least one processor, and at least one memory and bus connected to the processor; wherein: The processor and the memory communicate with each other via the bus; The processor is used to call the program instructions in the memory to execute the model training method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Data processing method and device based on blockchain

    CN109194508A