Blockchain federated training method and related apparatus
By removing the central node from the blockchain network and adopting a distributed mechanism to enable all nodes to participate equally in federated training, the reliability problem caused by the failure of the central node is solved, higher training reliability and data security are achieved, and models suitable for practical applications are selected.
Patent Information
- Application Number
- CN202210669736.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-06-14
AI Technical Summary
In existing blockchain federated training methods, the failure of the central node can cause the federated training to be interrupted, resulting in low reliability.
In a blockchain network, by removing the central node and adopting a distributed mechanism, all nodes can participate in federated training on an equal footing. Each node trains a reference model based on local data, evaluates and optimizes the models of other nodes, and selects a target model that is suitable for itself.
This improves the reliability of federated training, avoids the impact of central node failure on the training of other nodes, ensures data security, and selects the best-performing models for practical applications.
Smart Images

Figure CN114997424B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a blockchain federated training method and related device. BACKGROUND
[0002] In recent years, artificial intelligence technology has received more and more attention and has been applied in more and more fields and industries. Artificial intelligence training usually needs to rely on a large amount of training data, so how to obtain a large amount of training data has become one of the research hotspots in the related field.
[0003] In the related art, considering that the blockchain has the characteristics of distributed processing, a scheme of performing artificial intelligence training based on nodes in the blockchain network, i.e., federated training, is proposed. At present, federated training is based on horizontal federated learning and vertical federated learning, and the sharing and updating of the model are performed through centralized parameters; that is, a center node is set in the blockchain network, and the center node centrally manages and updates the model parameters.
[0004] However, in the above federated training method, once the center node fails, the federated training will be interrupted; therefore, whether the federated training can be normally implemented depends entirely on the performance of the center node, and the reliability is low. SUMMARY
[0005] The embodiments of the present application provide a blockchain federated training method and related device, which can remove the center node and enable all nodes in the blockchain network to equally perform federated training, thereby improving the reliability of federated training.
[0006] Therefore, the first aspect of the present application provides a blockchain federated training method applied to a target node in a blockchain network, which comprises the following steps:
[0007] training a reference model based on local data and uploading the reference model to the blockchain network;
[0008] downloading a reference model uploaded by at least one node in the blockchain network as an evaluation model;
[0009] evaluating the evaluation model based on local data to obtain an evaluation result corresponding to the evaluation model, and uploading the evaluation result corresponding to the evaluation model to the blockchain network;
[0010] downloading an evaluation result and an evaluation model corresponding thereto uploaded by at least one node in the blockchain network, and taking the downloaded evaluation model as a candidate model;
[0011] determining a target model suitable for the target node based on the evaluation result corresponding to the candidate model.
[0012] Optionally, after downloading the reference model uploaded by at least one node in the blockchain network as the evaluation model, the method further comprises:
[0013] optimizing and training the evaluation model based on the local data, and uploading the evaluation model obtained after the optimization and training to the blockchain network as the reference model.
[0014] Optionally, the method further comprises:
[0015] According to the evaluation result corresponding to each evaluation model, an evaluation model that meets the optimization training condition is selected from each evaluation model as the evaluation model to be optimized;
[0016] The optimization and training of the evaluation model based on the local data, and the uploading of the evaluation model obtained after the optimization and training to the blockchain network as the reference model, comprises:
[0017] optimizing and training the evaluation model based on the local data, and uploading the evaluation model obtained after the optimization and training to the blockchain network as the reference model.
[0018] Optionally, the downloading of the reference model uploaded by at least one node in the blockchain network as the evaluation model comprises:
[0019] Downloading the reference model uploaded by each node in the blockchain network, and downloading each reference model as the evaluation model;
[0020] The evaluation of the evaluation model based on the local data, the obtaining of the evaluation result corresponding to the evaluation model, and the uploading of the evaluation result corresponding to the evaluation model to the blockchain network, comprises:
[0021] For each evaluation model, the evaluation of the evaluation model based on the local data, and the obtaining of the evaluation result corresponding to the evaluation model;
[0022] Uploading the evaluation result corresponding to each evaluation model to the blockchain network.
[0023] Optionally, the downloading of the evaluation result uploaded by at least one node in the blockchain network and the corresponding evaluation model, and the downloading of the evaluation model as the candidate model, comprises:
[0024] Downloading the evaluation result uploaded by each node in the blockchain network and the corresponding evaluation model, and downloading each evaluation model as the candidate model;
[0025] The determination of the target model suitable for the target node based on the evaluation result corresponding to the candidate model comprises:
[0026] select the target model suitable for the target node based on the evaluation result corresponding to each of the candidate models.
[0027] Optionally, the method further comprises:
[0028] select the candidate model with the optimal evaluation result as the public target model suitable for the blockchain network based on the evaluation result corresponding to each of the candidate models;
[0029] issue the public target model to the node in the blockchain network that has not evaluated the reference model.
[0030] The second aspect of the present application provides a blockchain federation training device applied to a target node in a blockchain network, the device comprising:
[0031] a model training unit configured to train a reference model based on local data and upload the reference model to the blockchain network;
[0032] a model downloading unit configured to download a reference model uploaded by at least one node in the blockchain network as an evaluation model;
[0033] a model evaluation unit configured to evaluate the evaluation model based on local data, obtain an evaluation result corresponding to the evaluation model, and upload the evaluation result corresponding to the evaluation model to the blockchain network;
[0034] an evaluation result downloading unit configured to download an evaluation result uploaded by at least one node in the blockchain network and the evaluation model corresponding thereto, and use the downloaded evaluation model as a candidate model;
[0035] a model selection unit configured to determine a target model suitable for the target node based on the evaluation result corresponding to each of the candidate models.
[0036] Optionally, the device further comprises:
[0037] an optimization training unit configured to, after downloading the reference model uploaded by at least one node in the blockchain network as the evaluation model, perform optimization training on the evaluation model based on the local data, and upload the evaluation model obtained through the optimization training to the blockchain network as the reference model.
[0038] Optionally, the model selection unit is further configured to:
[0039] select an evaluation model satisfying an optimization training condition from each of the evaluation models as a to-be-optimized evaluation model according to the evaluation result corresponding to each of the evaluation models;
[0040] The optimization training unit is specifically configured to:
[0041] The optimization training unit is specifically configured to:
[0042] The model downloading unit is specifically configured to:
[0043] The model downloading unit is specifically configured to:
[0044] The model evaluation unit is specifically configured to:
[0045] The model evaluation unit is specifically configured to:
[0046] The model evaluation unit is specifically configured to:
[0047] The evaluation result downloading unit is specifically configured to:
[0048] The evaluation result downloading unit is specifically configured to:
[0049] The model selection unit is specifically configured to:
[0050] The model selection unit is specifically configured to:
[0051] The model selection unit is specifically configured to:
[0052] The model selection unit is specifically configured to:
[0053] The model selection unit is specifically configured to:
[0054] The model selection unit is specifically configured to:
[0055] The embodiment of the present application provides a blockchain federated training method, which is applied to a target node in a blockchain network, and the method comprises the following steps: training a reference model based on local data, and uploading the reference model to the blockchain network; downloading a reference model uploaded by at least one node in the blockchain network as an evaluation model; evaluating the downloaded evaluation model based on local data, obtaining an evaluation result corresponding to the evaluation model, and uploading the evaluation result corresponding to the evaluation model to the blockchain network; downloading the evaluation result and the corresponding evaluation model uploaded by at least one node in the blockchain network, and taking the downloaded evaluation model as a candidate model; and then, determining a target model suitable for the target node based on the evaluation result corresponding to the candidate model. The above method refers to a distributed processing mechanism in the blockchain network, removes a central node, so that each node in the blockchain network can equally perform federated training, and any node failure will not affect the model training of other nodes in the blockchain network, thereby guaranteeing the reliability of the federated training. In addition, in the above method, any node in the blockchain network can obtain the model contributed by other nodes, evaluate the model contributed by other nodes by using local data, and upload the evaluation result to the blockchain network, so that other nodes in the blockchain network can refer to the evaluation result and select the optimal model suitable for itself from the models contributed by each node; in this way, in the process of federated training, the data used for transmitting the training model in the blockchain network is avoided, the security of the data is guaranteed, and each node participates in the evaluation of the model, which is beneficial to selecting the model with better performance for actual business application. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 A flowchart of a blockchain federated training method provided by the embodiment of the present application is shown;
[0057] Figure 2 An implementation architecture diagram of the blockchain federated training method provided by the embodiment of the present application is shown;
[0058] Figure 3 A structure diagram of a blockchain federated training device provided by the embodiment of the present application is shown. DETAILED DESCRIPTION
[0059] In order to enable personnel in the technical field to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0060] The terms "first", "second", "third", "fourth" and the like in the description and in the claims of the present application, and above-mentioned drawings (if any) are used to distinguish similar objects and are not necessarily used to describe a particular sequential or chronological order. It should be understood that the use of data so designated is not meant to limit the present application to the described embodiments, but rather to cover all embodiments within the scope of the present application, as encompassed by the claims. Furthermore, the terms "comprising", "having", "including", and the like, as used in the specification are used in their broadest sense and are intended to encompass the inclusion of one or more steps or units, processes, systems, products, or devices, without necessarily excluding other steps, units, processes, systems, products, or devices. The terms "comprising", "having", "including", and the like, as used in the specification are used in their broadest sense and are intended to encompass the inclusion of one or more steps or units, processes, systems, products, or devices, without necessarily excluding other steps, units, processes, systems, products, or devices.
[0061] It should be noted that the blockchain federated training method and related device provided by the present application can be used in the field of artificial intelligence, the field of blockchain or the field of finance. The above are only examples and do not limit the application field of the blockchain federated training method and related device provided by the present application.
[0062] The blockchain federated training method provided by the present application will be introduced below through method embodiments.
[0063] Referring to Figure 1 , Figure 1 The flowchart of the blockchain federated training method provided by the present application is shown. It should be noted that the blockchain federated training method provided by the present application is executed by a target node in a blockchain network, which can be any node with model training capability in the blockchain network. As shown in Figure 1 the method includes the following steps:
[0064] Step 101: training a reference model based on local data, and uploading the reference model to the blockchain network.
[0065] In the present application, the target node can obtain the training data required for training the model from the local, and then use the obtained training data to train the model to obtain a reference model that meets the training end condition set by the target node itself. The reference model can be a neural network model for realizing any function. After the target node trains the reference model, it can upload the trained reference model to the blockchain network.
[0066] It should be noted that in the embodiments of the present application, when each node in the blockchain network trains the reference model, the same type and format of training data is needed to train the reference model. For example, before the nodes in the blockchain network train the reference model, the type and format of the training data can be negotiated, so as to ensure that the training data used when training the reference model is of the negotiated data type and data format, so as to ensure that the reference model trained by the node can be used universally in the blockchain network. Step 102: Download the reference model uploaded by at least one node in the blockchain network as an evaluation model.
[0067] Since each node with model training capability in the blockchain network can perform the above step 101, and upload the reference model trained based on local data to the blockchain network, the target node can also download the reference model uploaded by other nodes from the blockchain network and use the downloaded reference model as an evaluation model; that is, the target node can download the model contributed by other nodes from the blockchain network.
[0068] It should be understood that in actual application, the target node can download only one reference model from the blockchain network as an evaluation model, or can download multiple reference models from the blockchain network as evaluation models, and the present application does not limit the number of evaluation models downloaded by the target node.
[0069] In a possible implementation, the target node can download the reference model uploaded by each node in the blockchain network, and use each downloaded reference model as an evaluation model. In order to facilitate the nodes in the blockchain network to evaluate the model more comprehensively, the target node can download all reference models uploaded by all nodes in the blockchain network, and then evaluate all reference models.
[0070] Step 103: Evaluate the evaluation model based on local data, obtain the evaluation result corresponding to the evaluation model, and upload the evaluation result corresponding to the evaluation model to the blockchain network.
[0071] After the target node downloads the evaluation model, the target node can further evaluate the downloaded evaluation model using local data to obtain the evaluation result corresponding to the evaluation model. Specifically, the target node can use the downloaded evaluation model to process the local data to obtain a prediction result, and then determine the evaluation result corresponding to the evaluation model according to the difference between the annotation result corresponding to the local data and the prediction result, and the evaluation result can be a score.
[0072] Further, the target node can upload the evaluation result corresponding to the determined evaluation model to the blockchain network, so as to share the evaluation result of the downloaded reference model with other nodes in the blockchain network, and facilitate other nodes in the blockchain network to refer to the evaluation result.
[0073] In a possible implementation, if the target node downloads the reference model uploaded by each node in the blockchain network when performing step 102, and takes each downloaded reference model as an evaluation model, the target node needs to evaluate each evaluation model based on the local data when performing step 103, to obtain an evaluation result corresponding to the evaluation model; and further, upload the evaluation result corresponding to each evaluation model to the blockchain network.
[0074] That is, the target node needs to evaluate each downloaded evaluation model based on the local data, to obtain an evaluation result corresponding to each evaluation model, and upload the determined evaluation result corresponding to each evaluation model to the blockchain network. The target node realizes comprehensive evaluation of each reference node in the blockchain network.
[0075] Optionally, in the embodiment of the present application, in order to further improve the performance of the model shared in the blockchain network, the target node can further optimize and train the downloaded evaluation model based on the local data after downloading the evaluation model from the blockchain network, and further upload the evaluation model obtained by optimization and training to the blockchain network as a reference model.
[0076] That is, the target node can perform secondary optimization and training on the reference model contributed by other nodes based on the local data, to realize transfer training, so as to further optimize the performance of the reference model contributed by other nodes; further, the target node can also upload the reference model obtained by optimization and training to the blockchain network, to support other nodes in the blockchain network to evaluate the reference model obtained by optimization and training. It should be understood that the reference model obtained by optimization and training and the reference model directly trained based on the local data of the node in step 101 will be treated equally when being evaluated.
[0077] Further, in the case that multiple evaluation models are downloaded by the target node, the target node may need to consume a large amount of processing resources to perform optimization training on each of the downloaded evaluation models. In order to reduce the processing resources consumed by the target node when performing optimization training, the target node can first perform step 103 to determine the respective evaluation results of each of the evaluation models downloaded by the target node, and then select an evaluation model that meets the optimization training condition from the evaluation models according to the respective evaluation results of the evaluation models, as an evaluation model to be optimized. Further, only the evaluation model to be optimized is subjected to optimization training, i.e., the evaluation model to be optimized is subjected to optimization training based on local data, and the evaluation model to be optimized obtained through optimization training is uploaded to the blockchain network as a reference model.
[0078] For example, after the target node determines the respective evaluation results of each of the evaluation models downloaded by the target node, the target node can select the top n (n is an integer greater than or equal to 1) evaluation models with better evaluation results from the evaluation models, as the evaluation models to be optimized. Further, only the selected evaluation models to be optimized are subjected to secondary optimization training, and the evaluation models to be optimized obtained through optimization training are uploaded to the blockchain network as reference models.
[0079] Step 104: Download the evaluation results and the corresponding evaluation models uploaded by at least one node in the blockchain network, and take the downloaded evaluation models as candidate models.
[0080] Since each node in the blockchain network that has model evaluation capability can perform the above step 103 to upload the evaluation result determined by itself for the downloaded evaluation model to the blockchain network, the target node can download the evaluation results and the corresponding evaluation models uploaded by other nodes in the blockchain network, and take the downloaded evaluation models as candidate models.
[0081] It should be understood that the evaluation results given by different nodes in the blockchain network for the same evaluation model can be different. When the target node downloads the evaluation results, if it is detected that the evaluation model corresponding to the evaluation result has been downloaded, the evaluation model can not be downloaded again. That is, it is ensured that for one evaluation model, the evaluation model is downloaded only once, but multiple evaluation results corresponding to the evaluation model can be downloaded.
[0082] In a possible implementation, to expand the range of the target node selecting a model suitable for itself and facilitate the target node to select a better target model, the target node can download the evaluation results uploaded by each node in the blockchain network respectively and the corresponding evaluation models, and take each of the downloaded evaluation models as a candidate model. That is, the target node can download all the existing evaluation models (i.e., the reference models that have been evaluated) and the corresponding evaluation results of these evaluation models from the blockchain network. It should be understood that one evaluation model usually corresponds to multiple evaluation results given by nodes, and the target node can take each of the downloaded evaluation models as a candidate model.
[0083] Step 105: determining a target model suitable for the target node based on the evaluation results corresponding to the candidate models.
[0084] After the target node downloads each candidate model and the corresponding evaluation results, the target node can determine a target model suitable for itself based on the evaluation results corresponding to each candidate model. For example, the target node can determine a comprehensive evaluation result corresponding to each candidate model according to the evaluation results corresponding to the candidate model. Then, the target node can select a candidate model with the best comprehensive evaluation result from the candidate models as a target model suitable for the actual business application of the target node.
[0085] In a possible implementation, if the target node downloads all the evaluation models in the blockchain network and the corresponding evaluation results when performing step 104, and takes all the downloaded evaluation models as candidate models, the target node can select a target model suitable for the target node based on the evaluation results corresponding to each candidate model when performing step 105. That is, the target node can select a target model most suitable for itself from all the existing evaluation models in the blockchain network, thereby ensuring the reliability of the selected target model.
[0086] Exemplarily, the target node can determine a comprehensive evaluation result corresponding to each candidate model based on the evaluation result corresponding to each candidate model. For example, for each candidate model, the target node can obtain the evaluation result corresponding to the candidate model, and the number of test samples corresponding to each evaluation result (the test sample corresponding to an evaluation result is a test sample used to determine the evaluation result). Then, the target node can configure a first weight corresponding to each evaluation result based on the number of test samples corresponding to each evaluation result, and calculate a first evaluation result corresponding to each evaluation result according to each evaluation result and the first weight corresponding to the evaluation result. In addition, the target node can also configure a second weight corresponding to the evaluation result given by the target node for the candidate model and the evaluation result given by other nodes for the candidate model. It should be understood that the target node can configure the highest second weight for the evaluation result given by the target node for the candidate model, configure a higher second weight for the evaluation result given by the node with a closer relationship with the target node for the candidate model, and configure a lower second weight for the evaluation result given by the node with a more distant relationship with the target node for the candidate model. Then, the target node can perform weighted summation processing on each evaluation result and the first evaluation result corresponding to each evaluation result based on the second weight corresponding to each evaluation result to obtain the comprehensive evaluation result corresponding to the candidate model. The target node can select the candidate model corresponding to the optimal comprehensive evaluation result as the target model applicable to the target node.
[0087] Optionally, in the embodiments of the present application, the target node can not only select the target model applicable to the target node, but also select a public target model applicable to the blockchain network. Specifically, the target node can select the candidate model corresponding to the optimal evaluation result as the public target model applicable to the blockchain network based on the evaluation result corresponding to each candidate model. Then, the target node can distribute the public target model to each node in the blockchain network that does not participate in model evaluation or model training.
[0088] Exemplarily, the target node can determine a comprehensive evaluation result corresponding to each candidate model based on the evaluation result corresponding to each candidate model. For example, for each candidate model, the target node can obtain the evaluation result corresponding to the candidate model, and the number of test samples corresponding to each evaluation result (the test sample corresponding to an evaluation result is a test sample used to determine the evaluation result). Then, the target node can configure a first weight corresponding to each evaluation result based on the number of test samples corresponding to each evaluation result, and calculate a first evaluation result corresponding to each evaluation result according to each evaluation result and the first weight corresponding to the evaluation result. In addition, the target node can also configure a second weight corresponding to the evaluation result given by the target node for the candidate model and the evaluation result given by other nodes for the candidate model. It should be understood that the target node can configure the highest second weight for the evaluation result given by the target node for the candidate model, configure a higher second weight for the evaluation result given by the node with a closer relationship with the target node for the candidate model, and configure a lower second weight for the evaluation result given by the node with a more distant relationship with the target node for the candidate model. Then, the target node can perform weighted summation processing on each evaluation result and the first evaluation result corresponding to each evaluation result based on the second weight corresponding to each evaluation result to obtain the comprehensive evaluation result corresponding to the candidate model. The target node can select the candidate model corresponding to the optimal comprehensive evaluation result as the target model applicable to the target node.
[0089] The blockchain federated training method provided in this application is applied to target nodes in a blockchain network. The method includes: training a reference model based on local data and uploading the reference model to the blockchain network; downloading a reference model uploaded by at least one node in the blockchain network as an evaluation model; evaluating the downloaded evaluation model based on local data to obtain an evaluation result corresponding to the evaluation model, and uploading the evaluation result to the blockchain network; downloading the evaluation result and its corresponding evaluation model uploaded by at least one node in the blockchain network, and using the downloaded evaluation model as a candidate model; and then, based on the evaluation result corresponding to the candidate model, determining a target model suitable for the target node. This method references the distributed processing mechanism in the blockchain network, removing the central node, allowing all nodes in the blockchain network to perform federated training equally. The failure of any node will not affect the model training of other nodes in the blockchain network, ensuring the reliability of the federated training. Furthermore, in the above method, any node in the blockchain network can obtain models contributed by other nodes, evaluate these models using its own local data, and upload the evaluation results to the blockchain network. This allows other nodes in the blockchain network to refer to the evaluation results and select the optimal model suitable for themselves from the models contributed by various nodes. In this way, during the federated training process, the data used to train the model is avoided in the blockchain network, ensuring data security. Moreover, the participation of each node in the blockchain network in evaluating the model helps each node select the best-performing model for practical business applications.
[0090] See Figure 2 , Figure 2 This is a schematic diagram illustrating the implementation architecture of the blockchain federated training method provided in this application embodiment. For example... Figure 2 As shown, in this implementation architecture, the data acquisition module 201 is used to acquire local data; the self-training model 202 is used to train the model based on the acquired local data to obtain a reference model; and the model upload module 203 is used to upload the trained reference model to the blockchain network 204. The blockchain network 204 is used to provide model sharing, network transmission, and storage functions, supporting any node in the blockchain network to download and retrieve the reference model it stores.
[0091] The model obtaining module 205 is configured to obtain reference models contributed by other nodes in the blockchain network 204 as evaluation models; the model evaluation module 206 is configured to score the obtained evaluation models based on local data; the model optimization module 207 is configured to select an evaluation model with a higher score as a to-be-optimized evaluation model; the model migration module 208 is configured to migrate the to-be-optimized evaluation model to the local; the model training module 209 is configured to optimize and train the to-be-optimized evaluation model based on local data to obtain a model with better performance; the model uploading module 210 is configured to upload the model with better performance obtained through optimization and training as a reference model to the blockchain network 204; and the model voting module 211 is configured to upload the scores given by the model evaluation module 206 to the evaluation models to the blockchain network 204.
[0092] The model voting module 212 is configured to collect the scores given by each node in the blockchain network to each reference model, and statistically calculate the comprehensive scores of each reference model; the model optimization module 213 is configured to select an optimal target model from each reference model according to the comprehensive scores of each reference model; and the model application module 214 is configured to put the selected target model into actual business application.
[0093] It should be understood that, Figure 2 The node 1, the node 2 and the node 3 in the blockchain network can be any node, and the node 1, the node 2 and the node 3 can be the same node or different nodes.
[0094] The embodiments of the present application also provide a blockchain federated training device, which is shown in Figure 3 , Figure 3 The structure diagram of the blockchain federated training device provided by the embodiments of the present application is shown in Figure 3 The blockchain federated training device comprises:
[0095] The model training unit 301 is configured to train a reference model based on local data, and upload the reference model to the blockchain network;
[0096] The model downloading unit 302 is configured to download a reference model uploaded by at least one node in the blockchain network as an evaluation model;
[0097] The model evaluation unit 303 is configured to evaluate the evaluation model based on local data, obtain an evaluation result corresponding to the evaluation model, and upload the evaluation result corresponding to the evaluation model to the blockchain network;
[0098] The evaluation result downloading unit 304 is configured to download an evaluation result uploaded by at least one node in the blockchain network and the evaluation model corresponding to the evaluation result, and download the evaluation model as a candidate model;
[0099] The model selection unit 305 is configured to determine a target model suitable for the target node based on the evaluation result corresponding to the candidate model.
[0100] Optionally, the apparatus further includes:
[0101] The optimization training unit is configured to, after uploading the reference model to at least one node in the blockchain network, optimize train the evaluation model based on the local data, and upload the evaluation model obtained through the optimization training to the blockchain network as the reference model.
[0102] Optionally, the model selection unit 305 is further configured to:
[0103] select, from each of the evaluation models, an evaluation model satisfying an optimization training condition as a to-be-optimized evaluation model, according to the evaluation result corresponding to each of the evaluation models.
[0104] The optimization training unit is configured to:
[0105] optimize train the to-be-optimized evaluation model based on the local data, and upload the to-be-optimized evaluation model obtained through the optimization training to the blockchain network as the reference model.
[0106] Optionally, the model downloading unit 302 is specifically configured to:
[0107] download the reference model uploaded by each node in the blockchain network, and use each of the downloaded reference models as the evaluation model.
[0108] The model evaluation unit 303 is specifically configured to:
[0109] evaluate, for each of the evaluation models, the evaluation model based on the local data, to obtain an evaluation result corresponding to the evaluation model.
[0110] upload, to the blockchain network, the evaluation result corresponding to each of the evaluation models.
[0111] Optionally, the evaluation result downloading unit 304 is specifically configured to:
[0112] download the evaluation result and the corresponding evaluation model uploaded by each node in the blockchain network, and use each of the downloaded evaluation models as the candidate model.
[0113] The model selection unit 305 is specifically configured to:
[0114] select the target model suitable for the target node based on the evaluation result corresponding to each of the candidate models.
[0115] Optionally, the model selection unit 305 is further configured to:
[0116] select, based on the respective evaluation results of the candidate models, a candidate model with the optimal evaluation result as the public target model applicable to the blockchain network;
[0117] issue the public target model to the nodes in the blockchain network that have not evaluated the reference model.
[0118] The above device refers to the distributed processing mechanism in the blockchain network, removes the central node, so that each node in the blockchain network can equally perform federated training, and any node failure will not affect the model training of other nodes in the blockchain network, thereby ensuring the reliability of the federated training. In addition, in the above device, any node in the blockchain network can obtain the models contributed by other nodes, evaluate the models contributed by other nodes using local data, and upload the evaluation results to the blockchain network, so that other nodes in the blockchain network can refer to the evaluation results to select the optimal model applicable to themselves from the models contributed by each node. In this way, in the process of federated training, the data used for transmitting the training model in the blockchain network is avoided, thereby ensuring the security of the data, and the evaluation of the model by each node in the blockchain network is conducive to the selection of the model with better performance by each node for actual business application.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described herein.
[0120] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0121] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment.
[0122] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0123] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), a random access memory (English full name: Random Access Memory, English abbreviation: RAM), a magnetic disk or an optical disk, and various computer program storage media.
[0124] It should be understood that in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, "A and / or B" can represent three cases: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0125] The above-described and above-described embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A blockchain federation training method, characterized in that, A target node applied to a blockchain network, the method comprises: training a reference model based on local data, and uploading the reference model to the blockchain network; downloading a reference model uploaded by at least one node in the blockchain network as an evaluation model; evaluating the evaluation model based on local data to obtain an evaluation result corresponding to the evaluation model, and uploading the evaluation result corresponding to the evaluation model to the blockchain network; downloading an evaluation result and a corresponding evaluation model uploaded by at least one node in the blockchain network, and taking the downloaded evaluation model as a candidate model; determining a target model suitable for the target node based on the evaluation result corresponding to the candidate model; after the downloading of the reference model uploaded by at least one node in the blockchain network as the evaluation model, the method further comprises: optimizing and training the evaluation model based on the local data, and uploading the evaluation model obtained by the optimization and training as the reference model to the blockchain network; the method further comprises: selecting an evaluation model meeting the optimization and training condition from each of the evaluation models as a to-be-optimized evaluation model according to the evaluation result corresponding to each of the evaluation models; the optimization and training of the evaluation model based on the local data, and uploading the to-be-optimized evaluation model obtained by the optimization and training as the reference model to the blockchain network, comprises: optimizing and training the to-be-optimized evaluation model based on the local data, and uploading the to-be-optimized evaluation model obtained by the optimization and training as the reference model to the blockchain network; the downloading of the evaluation result and the corresponding evaluation model uploaded by at least one node in the blockchain network, and taking the downloaded evaluation model as the candidate model, comprises: downloading the evaluation result and the corresponding evaluation model uploaded by each node in the blockchain network, and taking each of the downloaded evaluation models as the candidate model; the determination of the target model suitable for the target node based on the evaluation result corresponding to the candidate model, comprises: selecting the target model suitable for the target node based on the evaluation result corresponding to each of the candidate models.
2. The method of claim 1, wherein, the downloading of the reference model uploaded by at least one node in the blockchain network as the evaluation model, comprises: downloading the reference model uploaded by each node in the blockchain network, and taking each of the downloaded reference models as the evaluation model; the evaluation of the evaluation model based on the local data to obtain the evaluation result corresponding to the evaluation model, and the uploading of the evaluation result corresponding to the evaluation model to the blockchain network, comprises: evaluating the evaluation model based on the local data to obtain the evaluation result corresponding to the evaluation model for each of the evaluation models; uploading the evaluation result corresponding to each of the evaluation models to the blockchain network.
3. The method of claim 1, wherein, the method further comprises: selecting a candidate model with the optimal evaluation result as a public target model suitable for the blockchain network based on the evaluation result corresponding to each of the candidate models. The common target model is issued to a node in the blockchain network which has not evaluated the reference model.
4. A blockchain federation training apparatus, characterized by, The device is applied to a target node in a blockchain network, and the device comprises: a model training unit configured to train a reference model based on local data and upload the reference model to the blockchain network; a model downloading unit configured to download a reference model uploaded by at least one node in the blockchain network as an evaluation model; a model evaluation unit configured to evaluate the evaluation model based on local data, obtain an evaluation result corresponding to the evaluation model, and upload the evaluation result corresponding to the evaluation model to the blockchain network; an evaluation result downloading unit configured to download an evaluation result and a corresponding evaluation model uploaded by at least one node in the blockchain network, and use the downloaded evaluation model as a candidate model; a model selection unit configured to determine a target model suitable for the target node based on the evaluation result corresponding to the candidate model; The device further comprises: an optimization training unit configured to, after downloading the reference model uploaded by at least one node in the blockchain network as the evaluation model, perform optimization training on the evaluation model based on the local data, and upload the evaluation model obtained through the optimization training to the blockchain network as the reference model; The model selection unit is further configured to: select an evaluation model meeting an optimization training condition from each of the evaluation models as a to-be-optimized evaluation model according to the evaluation result corresponding to each of the evaluation models; The optimization training unit is specifically configured to: perform optimization training on the to-be-optimized evaluation model based on the local data, and upload the to-be-optimized evaluation model obtained through the optimization training to the blockchain network as the reference model; The evaluation result downloading unit is specifically configured to: download the evaluation result and the corresponding evaluation model uploaded by each node in the blockchain network, and use each of the downloaded evaluation models as the candidate model; The model selection unit is specifically configured to: select the target model suitable for the target node based on the evaluation result corresponding to each of the candidate models.
5. The apparatus of claim 4, wherein, The model downloading unit is specifically configured to: download the reference model uploaded by each node in the blockchain network, and use each of the downloaded reference models as the evaluation model; The model evaluation unit is specifically configured to: evaluate the evaluation model based on the local data for each of the evaluation models, and obtain the evaluation result corresponding to the evaluation model; upload the evaluation result corresponding to each of the evaluation models to the blockchain network.
Citation Information
Patent Citations
Safety cooperation deep learning method and device based on block chain
CN110197285A
Model evaluation method and device
CN113239635A