Network model training method and device, storage medium and electronic equipment

By allocating target task execution nodes, model verification nodes and federated learning nodes in network model training, and using blockchain network for weighted summing, the problems of low efficiency and low accuracy of network model training in the prior art are solved, and a more efficient and transparent training process is achieved.

CN119761460APending Publication Date: 2025-04-04CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411826177.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing network model training methods are difficult to collect data due to privacy considerations, resulting in low model accuracy, and the model training process is a black box, which cannot quickly locate problems during the training process, reducing training efficiency.

Method used

By assigning the target task execution node to the model training node to perform local network model training, using the model verification node to evaluate and sort, combining with the federated learning node to fine-tune the network model after verification of consensus, and weighted summing in the blockchain network to form a global network model.

Benefits of technology

The problem of low model accuracy due to difficulty in data acquisition is solved, and the model training efficiency is improved through the transparency of the decomposition training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761460A_ABST
    Figure CN119761460A_ABST
Patent Text Reader

Abstract

The invention relates to a network model training method and device, a storage medium and electronic equipment, and relates to the technical field of artificial intelligence. The method comprises the following steps: executing a model training task based on a first target task execution node to obtain a local network model; performing model evaluation on the local network models based on the model verification nodes to obtain a model evaluation result, and sorting the local network models based on the model evaluation result to obtain a network model after verification consensus; performing fine tuning on the network model after the verification consensus is obtained from the block chain network based on the federated learning node to obtain a trained network model, and uploading the trained network model and a corresponding model weight to the block chain network; and performing weighted summation on the trained network model and the corresponding model weight based on the block chain network to obtain a global network model. According to the invention, the data security is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of artificial intelligence technology, and in particular, to a network model training method, a network model training device, a computer-readable storage medium, and an electronic device. Background Art

[0002] The existing network model training method can be implemented based on the following scheme: first, collect the data required for model training and construct a training data set and a verification data set; second, train based on the training data set and verify based on the verification data, and then obtain a trained network model. However, this method has the following defects: on the one hand, due to privacy considerations, the data collection process is more difficult, which will lead to the problem of low accuracy of the trained model due to too little data; on the other hand, since the model training process is a black box, it is impossible to quickly locate the problems generated during the model training process, which reduces the efficiency of model training.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0004] The purpose of the present disclosure is to provide a network model training method, a network model training device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent overcoming the problems of low model training efficiency and low accuracy of model training results caused by the limitations and defects of related technologies.

[0005] According to one aspect of the present disclosure, a method for training a network model is provided, comprising:

[0006] Allocating a first target task execution node to the model training task based on the model training node, and executing the model training task based on the first target task execution node to obtain a local network model;

[0007] Performing model evaluation on the local network model based on the model verification node to obtain a model evaluation result, and sorting the local network model based on the model evaluation result to obtain a network model after consensus verification;

[0008] Based on the federated learning node, fine-tune the network model obtained from the blockchain network after the verification consensus to obtain a trained network model, and upload the trained network model and the corresponding model weights to the blockchain network;

[0009] Based on the blockchain network, a weighted sum is performed on the trained network model and the corresponding model weights to obtain a global network model, and the global network model is deployed to the model application market via the model management node.

[0010] In an exemplary embodiment of the present disclosure, allocating a first target task execution node to a model training task includes:

[0011] Parsing the model training task to obtain a network model to be trained, a training data set required for training the network model to be trained, and task computing resources required for training the network model to be trained;

[0012] Obtain node computing resources of a first candidate task execution node, and allocate a first target task execution node for the model training task from the first candidate task execution node according to the task computing resources and the node computing resources.

[0013] In an exemplary embodiment of the present disclosure, a local network model obtained from a blockchain network is subjected to model evaluation to obtain a model evaluation result, including:

[0014] Obtain the local network model uploaded by the task execution node and the model evaluation data set corresponding to the local network model;

[0015] Inputting data sample features in the model evaluation data set into the local network model to obtain sample prediction labels;

[0016] Calculating a model accuracy value of the local network model according to the sample prediction label and the actual sample label corresponding to the data sample feature;

[0017] According to the model accuracy value, a model evaluation is performed on the local network model to obtain a model evaluation result.

[0018] In an exemplary embodiment of the present disclosure, calculating the model accuracy value of the local network model according to the sample prediction label and the actual sample label corresponding to the data sample feature includes:

[0019] If the sample prediction label and the actual sample label corresponding to the data sample feature are consistent, the sample evaluation index corresponding to the data sample feature is 1; if the sample prediction label and the actual sample label corresponding to the data sample feature are inconsistent, the sample evaluation index corresponding to the data sample feature is 0;

[0020] The sum operation result of the sample evaluation index of the data sample feature is calculated, and the ratio between the total number of samples of the sample data feature and the sum operation result is calculated to obtain the model accuracy value of the local network model.

[0021] In an exemplary embodiment of the present disclosure, fine-tuning the network model obtained from the blockchain network after the verification consensus is obtained to obtain a trained network model includes:

[0022] Obtain the network model after verification consensus from the blockchain network, and obtain the local data set held by the federated learning node itself;

[0023] Matching a second target task execution node for executing the model fine-tuning task from the second candidate task execution node, and sending the local data set and the network model after consensus verification to the second target task execution node;

[0024] Receive the parameter adjustment result fed back by the second target task execution node after executing the model fine-tuning task, and update the network model after the consensus verification based on the parameter adjustment result to obtain the trained network model.

[0025] In an exemplary embodiment of the present disclosure, a weighted sum is performed on the trained network model and the corresponding model weights to obtain a global network model, including:

[0026] Receiving a trained network model uploaded by a federated learning node and a model weight corresponding to the trained network model; wherein the model weight is determined by the federated learning node according to the importance of a local data set held by the federated learning node;

[0027] The target parameter values ​​of the target model parameters included in the trained network model are extracted, and the target parameter values ​​and the model weights are weighted summed to obtain global parameter values, so as to update the trained network model based on the global parameter values ​​to obtain the global network model.

[0028] In an exemplary embodiment of the present disclosure, the task creator is determined in the following manner:

[0029] receiving a qualification acquisition request associated with a task creator, and determining, in response to the qualification acquisition request, whether the pledged assets of the task creator meet a preset asset condition;

[0030] If the pledged assets of the task creator meet the preset asset conditions, the historical model training tasks and / or historical model verification tasks performed by the task creator are obtained;

[0031] If there is a historical model training task and / or a historical model verification task associated with the task creator, the task creator is registered according to the information in the qualification acquisition request, and the registration success information is fed back to the task creator.

[0032] In an exemplary embodiment of the present disclosure, the network model training method further includes:

[0033] Based on the model application market, an application programming interface and a software development kit corresponding to the global network model are provided for the global network model, so that the user terminal can download the software development kit corresponding to the global network model based on the application programming interface for installation and use, and receive model performance feedback information fed back by the user terminal based on the application programming interface.

[0034] In an exemplary embodiment of the present disclosure, the network model training method further includes:

[0035] The base and the task creator receive the model performance feedback information sent by the model application market, and determine whether it is necessary to create a model training task according to the model performance feedback information;

[0036] When it is determined that a model training task needs to be created, the model training task is created according to the network model to be trained, the training data set required to train the network model to be trained, and the task computing resources required to train the network model to be trained, and the model training task is uploaded to the model training node.

[0037] According to one aspect of the present disclosure, a network model training device is provided, comprising:

[0038] A first task execution module, used to allocate a first target task execution node to the model training task based on the model training node, and execute the model training task based on the first target task execution node to obtain a local network model;

[0039] A model evaluation and sorting module is used to perform model evaluation on the local network model based on the model verification node to obtain a model evaluation result, and sort the local network model based on the model evaluation result to obtain a network model after verification consensus;

[0040] A model fine-tuning module, used to fine-tune the network model obtained from the blockchain network after the verification consensus based on the federated learning node to obtain a trained network model, and upload the trained network model and the corresponding model weights to the blockchain network;

[0041] The model deployment module is used to perform weighted summation of the trained network model and the corresponding model weights based on the blockchain network to obtain a global network model, and deploy the global network model to the model application market via the model management node.

[0042] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the network model described in any one of the above is implemented.

[0043] According to one aspect of the present disclosure, there is provided an electronic device, including:

[0044] Processor; and

[0045] A memory, configured to store executable instructions of the processor;

[0046] Wherein, the processor is configured to execute any one of the above-mentioned network model training methods by executing the executable instructions.

[0047] A network model training method provided by an embodiment of the present disclosure, on the one hand, allocates a first target task execution node to a model training task based on a model training node, and executes the model training task based on the first target task execution node to obtain a local network model; then, based on the model verification node, a model evaluation is performed on the local network model to obtain a model evaluation result, and the local network model is sorted based on the model evaluation result to obtain a network model after verification consensus; then, based on the federated learning node, the network model after verification consensus is obtained from the blockchain network is fine-tuned to obtain a trained network model, and the trained network model and the corresponding model weights are uploaded to the blockchain network; finally, based on the blockchain network, the trained network model and the corresponding model weights are sorted. The model weights are weighted summed to obtain a global network model, and the global network model is deployed to the model application market. Since the model training task can be divided into local tasks and global tasks, the problem of low accuracy of the trained model due to insufficient data, which is caused by the difficulty of data collection process due to privacy considerations in the prior art, is solved; on the other hand, since the model training task can be divided into multiple steps such as pre-training, model verification and evaluation, model fine-tuning and weighted summation, and each step is implemented based on blockchain, the problem of low model training efficiency, which is caused by the model training process being a black box, is solved in the prior art.

[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0050] Figure 1 A flowchart of a method for training a network model according to an exemplary embodiment of the present disclosure is schematically shown.

[0051] Figure 2 A diagram schematically shows an example structure of a network model training system according to an example embodiment of the present disclosure.

[0052] Figure 3 A diagram schematically shows an example scenario of a network model training system in the process of performing a model training task according to an example embodiment of the present disclosure.

[0053] Figure 4 A diagram schematically shows an example scenario of rewarding based on a smart contract according to an example embodiment of the present disclosure.

[0054] Figure 5 The following is a flowchart schematically showing a method for a specific determination process of a task creator according to an exemplary embodiment of the present disclosure.

[0055] Figure 6 A diagram schematically shows an example structure of a network model to be trained according to an example embodiment of the present disclosure.

[0056] Figure 7 A diagram schematically shows an example structure of a training device for a network model according to an example embodiment of the present disclosure.

[0057] Figure 8 An electronic device for implementing a training method for a network model according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0058] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0059] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0060] Currently, artificial intelligence has become the hottest technology field in the world. However, in the process of practical application, since generative artificial intelligence requires a large amount of data for training, the public will have concerns about personal data security and privacy protection.

[0061] The decision-making process of generative AI is also often considered a "black box" operation, and this opacity may reduce the public's trust in it. Therefore, when generative AI participates in decision-making in public service scenarios, once a problem occurs, the attribution of responsibility becomes unclear, and there is a lack of a clear accountability mechanism; in addition, if the decision generated by AI is wrong, who should be held responsible has become an urgent problem to be solved.

[0062] In this example implementation, a method for training a network model is first provided, which can be run on a server, a server cluster or a cloud server, etc. Of course, those skilled in the art can also run the method disclosed herein on other platforms as required, and this is not particularly limited in this exemplary embodiment.

[0063] Specifically, refer to Figure 1 As shown, the training method of the network model may include the following steps:

[0064] Step S110. Allocate a first target task execution node for the model training task based on the model training node, and execute the model training task based on the first target task execution node to obtain a local network model;

[0065] Step S120. Perform model evaluation on the local network model based on the model verification node to obtain a model evaluation result, and sort the local network model based on the model evaluation result to obtain a network model after verification consensus;

[0066] Step S130. Fine-tune the network model obtained from the blockchain network after the verification consensus based on the federated learning node to obtain a trained network model, and upload the trained network model and the corresponding model weight to the blockchain network;

[0067] Step S140. Based on the blockchain network, weighted summation is performed on the trained network model and the corresponding model weights to obtain a global network model, and the global network model is deployed to the model application market via the model management node.

[0068] In the above network model training method, on the one hand, by allocating the first target task execution node to the model training task based on the model training node, and executing the model training task based on the first target task execution node, a local network model is obtained; then, the local network model is evaluated based on the model verification node to obtain the model evaluation result, and the local network model is sorted based on the model evaluation result to obtain the network model after the verification consensus; then, based on the federated learning node, the network model after the verification consensus is obtained from the blockchain network is fine-tuned to obtain the trained network model, and the trained network model and the corresponding model weights are uploaded to the blockchain network; finally, the trained network model and the corresponding model weights are sorted based on the blockchain network. The weighted summation is performed again to obtain the global network model, and the global network model is deployed to the model application market. Since the model training task can be divided into local tasks and global tasks, the problem of low accuracy of the trained model due to insufficient data, which is caused by the difficulty of data collection process due to privacy considerations in the prior art, is solved. On the other hand, since the model training task can be divided into multiple steps such as pre-training, model verification and evaluation, model fine-tuning and weighted summation, and each step is implemented based on blockchain, the problem of low model training efficiency, which is caused by the model training process being a black box, is solved in the prior art.

[0069] Hereinafter, the training method of the network model described in the exemplary embodiment of the present disclosure will be further explained and illustrated in conjunction with the accompanying drawings.

[0070] First, the training system of the network model recorded in the exemplary embodiment of the present disclosure is explained and illustrated. Specifically, the training system of the network model recorded in the exemplary embodiment of the present disclosure can be understood as a decentralized artificial intelligence training system; specifically, the decentralized artificial intelligence training system can use blockchain technology and artificial intelligence technology on the basis of ensuring the security and privacy of personal data used in the training process of artificial intelligence, so that developers can provide model training and / or data calculation processes in a modular manner; further, the exemplary embodiment of the present disclosure can also use a federated learning algorithm to ensure that local data is not transmitted at any stage of the model training process, and then maintain the ownership of the data in this way, so as to achieve the purpose of ensuring personal data security and privacy protection. Furthermore, the training system of the network model recorded in the exemplary embodiment of the present disclosure can also ensure that the training process of artificial intelligence meets the needs of the public, and the decision-making power is in the hands of the public organization or community; and the system can ensure that data ownership is not leaked through a federated learning algorithm, effectively maintaining user privacy and data security.

[0071] In an exemplary embodiment, referring to Figure 2 As shown, the network model training system recorded in the exemplary embodiment of the present disclosure may include a decentralized AI (Artificial Intelligence) model training node 210, a federated learning node 220 and an application platform (i.e., a model application market) 230; in the actual process of model training, an incentive mechanism can be used to ensure the security and transparency of the model training process, and a smart contract can be used to manage the specific training process and reward distribution of the model; further, in the specific model training process, it can be achieved through the following steps: 1) community members (i.e., task creators) create AI model training tasks, and execute the model training tasks through task execution nodes and then submit the training results; 2) the verifier (i.e., the model verification node) evaluates the submitted model and reaches a consensus; 3) the federated learning node uses local data to fine-tune the model and deploys the trained model to the application platform.

[0072] In an example embodiment, in the process of actual application, in the training system of the network model recorded above, the following different roles may be included: Task creator: define the required model and submit the model task to the platform; Model training node: develop or fine-tune the model required by the task creator (that is, select the target model task execution node and execute the model training task based on the target model task execution node); Model verification node: evaluate the model submitted by the model training node; Model management node: The model management node can be used to deploy and manage the global network model in the application market, and then provide the infrastructure for the secure and scalable execution of the global network model in the model application market, and access it through the application program interface and SDK (Software Development Kit), ensuring that the model is kept up to date, monitoring its performance, and promoting integration with the application. Further, the functions that need to be performed by each component recorded above can be specifically as follows:

[0073] First, for model training nodes, they can support traditional machine learning model training modes and large model training modes, and optimize the model directly on the user's device using their own data or public data; at the same time, in order to maximize the generalization ability and performance of the final training model, community members are encouraged to contribute various public or local data, and use the power of a wider community to join the blockchain network in the process of actual application; further, by utilizing the blockchain network, the continuous participation of contributors can be ensured, and rewards can be given based on the quantifiable impact of their data on the improved model;

[0074] Secondly, for federated learning nodes, they can make full use of the federated learning method to enable thousands of participants to collaborate in training a global model, maintaining data sovereignty by ensuring that local data is not transmitted at any stage of the training process; further, by allowing participants to upload the weights of the model trained based on their unique local data, and then aggregating these weights to build an optimal global model, thereby enhancing its generalization ability and performance;

[0075] Furthermore, for the AI ​​application market (also known as the model application market), in the actual application process, after the model is trained and fine-tuned through the AI ​​training network and the federated learning node, it can be hosted on the platform; in the actual application process, the platform is a comprehensive environment for deploying models, and these models can be accessed in the blockchain network of virtual machines (VMs); further, the platform can execute and reason about complex models, providing real-time, scalable and secure solutions. In the process of model training, the example diagram of the model training scenario executed by the network model training system can be referred to Figure 3 shown.

[0076] Further, in Figure 3 In the model training scenario diagram shown, first, the task creator creates a model training task, and the training node trains the model training task to obtain a local network model; secondly, these nodes submit their models to the validator, and the validator evaluates each submitted model and proposes a score; at the same time, the validator reaches a consensus on these scores to determine the ranking of the submitted models; then, the consensus model can be assigned to the federated learning node, which uses local data to fine-tune and improve the model, and finally forms a global model after federated learning; in the actual application process, the federated learning node allows participants to upload the weights of the model trained according to their unique local data, and then these weights will be aggregated to establish an optimal global model, thereby enhancing its generalization ability and performance. Furthermore, the consensus model or global model can be deployed and hosted in the AI ​​application market, providing interfaces for various applications. The decentralized AI training environment training nodes, validators and federated learning nodes need corresponding pledges to participate in the system and receive rewards based on their performance. Furthermore, the blockchain network plays a key role in reward distribution. In the actual application process, the blockchain network can ensure that participants can safely lock their pledges and create an environment of trust and transparency. At the same time, the process incentivizes participation by distributing rewards based on contributions, thereby encouraging better public participation. For a specific example of the reward process, please refer to Figure 4 As shown in the figure; by using smart contracts, the system automates the reward process, making it efficient and fair; moreover, this automation not only reduces the possibility of human error, but also ensures the timely and fair distribution of rewards. Finally, the AI ​​training system is integrated with the blockchain system, and poisoning attacks can be resisted without the need for complex encryption protocols; that is, in the process of practical application, a proof-of-stake mechanism can be used to ensure robust security and consensus within the network; this system combines the incentives of participants with the integrity of the network, thereby enhancing the fault tolerance of the model, so that some participants who behave dishonestly or cannot reach consensus will face the risk of losing their staked assets; and this economic incentive mechanism promotes honest behavior and ensures the security and reliability of the network.

[0077] The following will explain and illustrate the specific process of determining the task creator. Figure 5 As shown, the specific process of determining the task creator may include the following steps:

[0078] Step S510. Receive a qualification acquisition request associated with a task creator, and in response to the qualification acquisition request, determine whether the pledged assets of the task creator meet preset asset conditions;

[0079] Step S520. If the pledged assets of the task creator meet the preset asset conditions, the historical model training tasks and / or historical model verification tasks performed by the task creator are obtained; otherwise, the task creator is not registered;

[0080] Step S530. If there is a historical model training task and / or a historical model verification task associated with the task creator, the task creator is registered according to the information in the qualification acquisition request, and the registration success information is fed back to the task creator.

[0081] Below, step S510-step S530 will be explained and illustrated. Specifically, in the process of actual application, since the creation of model training tasks is the primary stage of the model training cycle; therefore, it is necessary to first create the model training task through the task creator; at the same time, when creating the model training task, the task creator first defines the network model to be trained and submits the model training task to the model training node; in the process of actual application, any user who meets the standards is eligible to become a task creator; however, to obtain the qualifications of a task creator, you first need to pledge certain assets; at the same time, you also need to have successfully trained other models or verified other models before creating the model training task, and record them on the blockchain as evidence; at the same time, the assets recorded here may include but are not limited to data assets or virtual assets.

[0082] The following will be combined Figure 2-Figure 5 right Figure 1 The training method of the network model shown in is further explained and illustrated. Specifically:

[0083] In step S110, a first target task execution node is allocated to the model training task based on the model training node, and the model training task is executed based on the first target task execution node to obtain a local network model.

[0084] In this example embodiment, first, a first target task execution node is assigned to the model training task; specifically, this can be achieved in the following manner: the model training task is parsed to obtain the network model to be trained, the training data set required for training the network model to be trained, and the task computing resources required for training the network model to be trained; the node computing resources of the first candidate task execution node are obtained, and according to the task computing resources and the node computing resources, the first target task execution node is assigned to the model training task from the first candidate task execution node. Specifically, the network model to be trained recorded here can be a deep neural network model or a decision tree model; at the same time, the deep neural network model recorded here can be, for example, a large language model or other large models, etc., and this example does not impose any special restrictions on this; the model structure of the decision tree model recorded here can be specifically referred to. Figure 6 As shown; at the same time, the training data set recorded here can be public data; that is, the training data set can be obtained from a web page or data in a public manner; the task computing resources recorded here refer to the memory resources, bandwidth resources and computing power required to execute the model training task, etc., and this example does not impose special restrictions on this; at the same time, the first alternative task execution node recorded here refers to the computing node set in the model training node, and each computing node has different computing capabilities; in the actual application process, the corresponding first target task execution node can be matched according to the actual situation, and this example does not impose special restrictions on this.

[0085] Secondly, after matching the first target task execution node, the corresponding training data set and the network model to be trained can be sent to the first target task execution node, and the model training task is executed based on the first target task execution node to obtain a local network model.

[0086] In step S120, a model evaluation is performed on the local network model based on the model verification node to obtain a model evaluation result, and the local network model is sorted based on the model evaluation result to obtain a network model after consensus verification.

[0087] In this example embodiment, first, a model evaluation is performed on the local network model; specifically, it can be implemented in the following manner: obtain the local network model uploaded by the task execution node, and the model evaluation data set corresponding to the local network model; input the data sample features in the model evaluation data set into the local network model to obtain the sample prediction label; calculate the model accuracy value of the local network model according to the sample prediction label and the actual sample label corresponding to the data sample feature; perform model evaluation on the local network model according to the model accuracy value to obtain the model evaluation result. Among them, the specific calculation process of the model accuracy value can be implemented in the following manner: if the sample prediction label and the actual sample label corresponding to the data sample feature are consistent, the sample evaluation index corresponding to the data sample feature is 1; if the sample prediction label and the actual sample label corresponding to the data sample feature are inconsistent, the sample evaluation index corresponding to the data sample feature is 0; calculate the sum operation result of the sample evaluation index of the data sample feature, and calculate the ratio between the total sample amount of the sample data feature and the sum operation result to obtain the model accuracy value of the local network model.

[0088] The following will further explain and illustrate the specific calculation process of the model accuracy value. Specifically, in the actual application process, if there is a set of selected model verification nodes, represented by V j ∈V, each model verification node is equipped with a model evaluation dataset D provided by the task creator eval , the model evaluation data set consists of data pairs (x i ,y i ), where x i represents the characteristics of the i-th sample in the model evaluation data set (that is, the data sample characteristics), and y i is the corresponding true label (that is, the actual sample label); at the same time, the model trained by the specified training node (that is, the first target task execution node) is called (also known as the local network model); where The main goal of the task is to predict labels for the determined samples; at the same time, D eval Each data sample x contained in i The sample prediction label is Furthermore, in order to evaluate D eval Upper θ p t The performance of a task can be expressed using the general evaluation indicator eval. Here, taking accuracy as an example, its calculation method can be shown in the following formula (1):

[0089]

[0090] In the above formula (1), 1 represents the indicator function. If the predicted label and the true label y i If they are consistent, it returns 1, otherwise it returns 0. Function | D eval | represents the total number of samples in the model evaluation dataset; model Each predicted label of the task must be related to its eval The corresponding true label y in | i On this basis, the calculated measurement results can be quantitatively measured The label prediction effect of the task in the entire evaluation dataset (that is, determining the accuracy of the sample prediction label).

[0091] Secondly, after obtaining the model evaluation results, the local network models can be sorted based on the model evaluation results to obtain the network model after the verification consensus; wherein, the network model after the verification consensus can include model 1, model 2, model 3, ..., model M, etc., the model in the front has a higher accuracy, and M is the number of models. It should be noted here that after obtaining the network model after the verification consensus, it can be directly uploaded to the blockchain network without further fine-tuning, and then deployed to the model application market through the model management node.

[0092] In step S130, the network model obtained after the verification consensus is obtained from the blockchain network is fine-tuned based on the federated learning node to obtain a trained network model, and the trained network model and the corresponding model weights are uploaded to the blockchain network.

[0093] In this example embodiment, first, the network model after the consensus is verified is fine-tuned; specifically, this can be achieved in the following ways: obtaining the network model after the consensus is verified from the blockchain network, and obtaining the local data set held by the federated learning node itself; matching the second target task execution node that executes the model fine-tuning task from the second candidate task execution node, and sending the local data set and the network model after the consensus is verified to the second target task execution node; receiving the parameter adjustment result fed back by the second target task execution node after executing the model fine-tuning task, and updating the network model after the consensus is verified based on the parameter adjustment result to obtain the trained network model. Among them, the second alternative task execution node recorded here is a task execution node set locally at the federated learning node. Based on this method, the data leakage problem of the local data set held by each participant can be avoided, thereby further improving the security of the data; at the same time, the model weight recorded here can be determined according to the importance of the local data set to the network model; for example, if the data set is more important to the network model, the weight is greater; at the same time, the importance can be determined according to the difficulty of obtaining the data; for example, for a risk prediction model, if the participant is a bank or a third-party financial institution, the importance of the data it holds is significantly higher than that of a shopping mall or other consumer platform; in the actual application process, it can be set according to actual needs, and this example does not impose any special restrictions on this.

[0094] In step S140, the trained network model and the corresponding model weights are weighted summed based on the blockchain network to obtain a global network model, and the global network model is deployed to the model application market via the model management node.

[0095] In this example embodiment, first, the trained network model and the corresponding model weights are weighted and summed to obtain a global network model; specifically, it can be implemented in the following manner: receiving the trained network model uploaded by the federated learning node and the model weight corresponding to the trained network model; wherein the model weight is determined by the federated learning node according to the importance of the local data set held by itself; extracting the target parameter value of the target model parameter included in the trained network model, and weighted summing the target parameter value and the model weight to obtain the global parameter value; updating the trained network model based on the global parameter value to obtain the global network model. Further, after obtaining the global network model, an application program interface and a software development kit corresponding to the global network model can be provided for the global network model based on the model application market, so that the user terminal downloads the software development kit corresponding to the global network model based on the application program interface for installation and use, and receives the model performance feedback information fed back by the user terminal based on the application program interface. Wherein, the software development kit recorded here may include development kits applicable to different operating systems; the application program interface recorded here may also include interfaces applicable to different operating systems.

[0096] Finally, after obtaining the model performance feedback information, the network model can be further optimized. Specifically, this can be achieved in the following way: the task creator receives the model performance feedback information sent by the model application market, and determines whether it is necessary to create a model training task based on the model performance feedback information; when it is determined that a model training task needs to be created, the model training task is created based on the network model to be trained, the training data set required for training the network model to be trained, and the task computing resources required for training the network model to be trained, and the model training task is uploaded to the model training node.

[0097] So far, the training method of the network model recorded in the exemplary embodiment of the present disclosure has been fully realized. Based on the above-mentioned contents, it can be known that the training method of the network model recorded in the exemplary embodiment of the present disclosure uses blockchain technology and federated learning algorithms, and enables developers to provide models, data or computing resources through modular design; at the same time, the federated learning algorithm ensures that data ownership is not leaked, effectively maintaining user privacy and data security; further, an incentive mechanism can be used to ensure security and transparency, and smart contracts can be used to manage the training process and reward distribution.

[0098] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0099] The exemplary embodiment of the present disclosure also provides a training device for a network model. Specifically, refer to Figure 7 As shown, the network model training device may include a first task execution module 710, a model evaluation and ranking module 720, a model fine-tuning module 730, and a model deployment module 740. Among them:

[0100] The first task execution module 710 may be used to allocate a first target task execution node to the model training task based on the model training node, and execute the model training task based on the first target task execution node to obtain a local network model;

[0101] The model evaluation and sorting module 720 can be used to perform model evaluation on the local network model based on the model verification node to obtain the model evaluation result, and sort the local network model based on the model evaluation result to obtain the network model after the verification consensus;

[0102] The model fine-tuning module 730 can be used to fine-tune the network model obtained from the blockchain network after the verification consensus based on the federated learning node to obtain a trained network model, and upload the trained network model and the corresponding model weight to the blockchain network;

[0103] The model deployment module 740 can be used to perform weighted summation of the trained network model and the corresponding model weights based on the blockchain network to obtain a global network model, and deploy the global network model to the model application market via the model management node.

[0104] In an exemplary embodiment of the present disclosure, a first target task execution node is assigned to a model training task, including: parsing the model training task to obtain a network model to be trained, a training data set required for training the network model to be trained, and task computing resources required for training the network model to be trained; obtaining node computing resources of a first candidate task execution node, and according to the task computing resources and the node computing resources, assigning a first target task execution node to the model training task from the first candidate task execution node.

[0105] In an exemplary embodiment of the present disclosure, a local network model obtained from a blockchain network is model evaluated to obtain a model evaluation result, including: obtaining the local network model uploaded by the task execution node, and a model evaluation data set corresponding to the local network model; inputting data sample features in the model evaluation data set into the local network model to obtain sample prediction labels; calculating a model accuracy value of the local network model based on the sample prediction labels and actual sample labels corresponding to the data sample features; and performing model evaluation on the local network model based on the model accuracy value to obtain a model evaluation result.

[0106] In an exemplary embodiment of the present disclosure, the model accuracy value of the local network model is calculated according to the sample prediction label and the actual sample label corresponding to the data sample feature, including: if the sample prediction label and the actual sample label corresponding to the data sample feature are consistent, the sample evaluation index corresponding to the data sample feature is 1; if the sample prediction label and the actual sample label corresponding to the data sample feature are inconsistent, the sample evaluation index corresponding to the data sample feature is 0; the sum operation result of the sample evaluation index of the data sample feature is calculated, and the ratio between the total sample volume of the sample data feature and the sum operation result is calculated to obtain the model accuracy value of the local network model.

[0107] In an exemplary embodiment of the present disclosure, the network model obtained from the blockchain network after the consensus verification is fine-tuned to obtain a trained network model, including: obtaining the network model after the consensus verification from the blockchain network, and obtaining a local data set held by the federated learning node itself; matching a second target task execution node that executes the model fine-tuning task from a second candidate task execution node, and sending the local data set and the network model after the consensus verification to the second target task execution node; receiving a parameter adjustment result fed back by the second target task execution node after executing the model fine-tuning task, and updating the network model after the consensus verification based on the parameter adjustment result to obtain a trained network model.

[0108] In an exemplary embodiment of the present disclosure, a trained network model and a corresponding model weight are weightedly summed to obtain a global network model, including: receiving a trained network model uploaded by a federated learning node and a model weight corresponding to the trained network model; wherein the model weight is determined by the federated learning node according to the importance of a local data set held by the federated learning node; extracting target parameter values ​​of target model parameters included in the trained network model, and weighted summing the target parameter value and the model weight to obtain a global parameter value; and updating the trained network model based on the global parameter value to obtain the global network model.

[0109] In an exemplary embodiment of the present disclosure, the task creator is determined in the following manner:

[0110] Receive a qualification acquisition request associated with a task creator, and in response to the qualification acquisition request, determine whether the pledged assets of the task creator meet the preset asset conditions; if the pledged assets of the task creator meet the preset asset conditions, obtain the historical model training tasks and / or historical model verification tasks performed by the task creator; if there are historical model training tasks and / or historical model verification tasks associated with the task creator, register the task creator according to the information in the qualification acquisition request, and feedback the registration success information to the task creator.

[0111] In an exemplary embodiment of the present disclosure, the network model training device further includes:

[0112] The model performance feedback information receiving module can be used to provide an application program interface and a software development kit corresponding to the global network model for the global network model based on the model application market, so that the user terminal downloads the software development kit corresponding to the global network model based on the application program interface for installation and use, and receives the model performance feedback information fed back by the user terminal based on the application program interface.

[0113] In an exemplary embodiment of the present disclosure, the network model training device further includes:

[0114] A model training task determination module can be used to receive model performance feedback information sent by the model application market based on the task creator, and determine whether a model training task needs to be created based on the model performance feedback information;

[0115] The model training task creation module can be used to create the model training task when it is determined that a model training task needs to be created, based on the network model to be trained, the training data set required to train the network model to be trained, and the task computing resources required to train the network model to be trained, and upload the model training task to the model training node.

[0116] The specific details of each module in the above-mentioned network model training device have been described in detail in the corresponding network model training method, so they will not be repeated here.

[0117] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0118] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0119] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. A person skilled in the art will appreciate that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a circuit, module, or system.

[0120] Refer to the following Figure 8 The electronic device 800 according to this embodiment of the present disclosure is described. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0121] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), and a display unit 840.

[0122] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 810 can perform the following steps: Figure 1 Step S110 shown in: Based on the model training node, a first target task execution node is assigned to the model training task, and the model training task is executed based on the first target task execution node to obtain a local network model; Step S120: Based on the model verification node, a model evaluation is performed on the local network model to obtain a model evaluation result, and the local network model is sorted based on the model evaluation result to obtain a network model after verification consensus; Step S130: Based on the federated learning node, the network model after the verification consensus is obtained from the blockchain network is fine-tuned to obtain a trained network model, and the trained network model and the corresponding model weights are uploaded to the blockchain network; Step S140: Based on the blockchain network, the trained network model and the corresponding model weights are weighted summed to obtain a global network model, and the global network model is deployed to the model application market via the model management node.

[0123] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .

[0124] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0125] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0126] The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0127] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0128] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification. According to the program product for implementing the above-mentioned method according to the implementation of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited to this. In this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device.

[0129] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0130] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0131] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0132] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0133] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0134] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the inventions invented herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not invented by the present disclosure. The specification and examples are to be considered merely exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A network model training method, characterized in that: include: Allocating a first target task execution node to the model training task based on the model training node, and executing the model training task based on the first target task execution node to obtain a local network model; Performing model evaluation on the local network model based on the model verification node to obtain a model evaluation result, and sorting the local network model based on the model evaluation result to obtain a network model after consensus verification; Based on the federated learning node, fine-tune the network model obtained from the blockchain network after the verification consensus to obtain a trained network model, and upload the trained network model and the corresponding model weights to the blockchain network; Based on the blockchain network, a weighted sum is performed on the trained network model and the corresponding model weights to obtain a global network model, and the global network model is deployed to the model application market via the model management node.

2. The network model training method according to claim 1, characterized in that: Assign the first target task execution node to the model training task, including: Parsing the model training task to obtain a network model to be trained, a training data set required for training the network model to be trained, and task computing resources required for training the network model to be trained; Obtain node computing resources of a first candidate task execution node, and allocate a first target task execution node for the model training task from the first candidate task execution node according to the task computing resources and the node computing resources.

3. The network model training method according to claim 1, characterized in that: Perform model evaluation on the local network model obtained from the blockchain network to obtain model evaluation results, including: Obtain the local network model uploaded by the task execution node and the model evaluation data set corresponding to the local network model; Inputting data sample features in the model evaluation data set into the local network model to obtain sample prediction labels; Calculating a model accuracy value of the local network model according to the sample prediction label and the actual sample label corresponding to the data sample feature; According to the model accuracy value, a model evaluation is performed on the local network model to obtain a model evaluation result.

4. The network model training method according to claim 3, characterized in that: Calculating the model accuracy value of the local network model according to the sample prediction label and the actual sample label corresponding to the data sample feature, including: If the sample prediction label and the actual sample label corresponding to the data sample feature are consistent, the sample evaluation index corresponding to the data sample feature is 1; if the sample prediction label and the actual sample label corresponding to the data sample feature are inconsistent, the sample evaluation index corresponding to the data sample feature is 0; The sum operation result of the sample evaluation index of the data sample feature is calculated, and the ratio between the total number of samples of the sample data feature and the sum operation result is calculated to obtain the model accuracy value of the local network model.

5. The network model training method according to claim 1, characterized in that: Fine-tuning the network model obtained from the blockchain network after the verification consensus is obtained to obtain a trained network model, including: Obtain the network model after verification consensus from the blockchain network, and obtain the local data set held by the federated learning node itself; Matching a second target task execution node for executing the model fine-tuning task from the second candidate task execution node, and sending the local data set and the network model after consensus verification to the second target task execution node; Receive the parameter adjustment result fed back by the second target task execution node after executing the model fine-tuning task, and update the network model after the consensus verification based on the parameter adjustment result to obtain the trained network model.

6. The network model training method according to claim 1, characterized in that: The trained network model and the corresponding model weights are weighted summed to obtain the global network model, including: Receiving a trained network model uploaded by a federated learning node and a model weight corresponding to the trained network model; wherein the model weight is determined by the federated learning node according to the importance of a local data set held by the federated learning node; The target parameter values ​​of the target model parameters included in the trained network model are extracted, and the target parameter values ​​and the model weights are weighted summed to obtain global parameter values, so as to update the trained network model based on the global parameter values ​​to obtain the global network model.

7. The network model training method according to claim 1, characterized in that: The task creator is determined as follows: receiving a qualification acquisition request associated with a task creator, and determining, in response to the qualification acquisition request, whether the pledged assets of the task creator meet a preset asset condition; If the pledged assets of the task creator meet the preset asset conditions, the historical model training tasks and / or historical model verification tasks performed by the task creator are obtained; If there is a historical model training task and / or a historical model verification task associated with the task creator, the task creator is registered according to the information in the qualification acquisition request, and the registration success information is fed back to the task creator.

8. The network model training method according to claim 1, characterized in that: The training method of the network model also includes: Based on the model application market, an application programming interface and a software development kit corresponding to the global network model are provided for the global network model, so that the user terminal can download the software development kit corresponding to the global network model based on the application programming interface for installation and use, and receive model performance feedback information fed back by the user terminal based on the application programming interface.

9. The network model training method according to claim 1, characterized in that: The training method of the network model also includes: The base and the task creator receive the model performance feedback information sent by the model application market, and determine whether it is necessary to create a model training task according to the model performance feedback information; When it is determined that a model training task needs to be created, the model training task is created according to the network model to be trained, the training data set required to train the network model to be trained, and the task computing resources required to train the network model to be trained, and the model training task is uploaded to the model training node.

10. A network model training device, characterized in that: include: A first task execution module, used to allocate a first target task execution node to the model training task based on the model training node, and execute the model training task based on the first target task execution node to obtain a local network model; A model evaluation and sorting module is used to perform model evaluation on the local network model based on the model verification node to obtain a model evaluation result, and sort the local network model based on the model evaluation result to obtain a network model after verification consensus; A model fine-tuning module is used to fine-tune the network model obtained from the blockchain network after the verification consensus based on the federated learning node to obtain a trained network model, and upload the trained network model and the corresponding model weights to the blockchain network; The model deployment module is used to perform weighted summation of the trained network model and the corresponding model weights based on the blockchain network to obtain a global network model, and deploy the global network model to the model application market via the model management node.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the training method of the network model described in any one of claims 1 to 9 is implemented.

12. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the training method of the network model described in any one of claims 1-9 by executing the executable instructions.

Citation Information

Cited By

  • Campus spoofing prevention and control method, system and device based on block chain and storage medium

    CN120579222A