CN114897190A - Method, device, medium and equipment for constructing federated learning framework - Google Patents

Method, device, medium and equipment for constructing federated learning framework Download PDF

Info

Publication number
CN114897190A
CN114897190A CN202210548254.1A CN202210548254A CN114897190A CN 114897190 A CN114897190 A CN 114897190A CN 202210548254 A CN202210548254 A CN 202210548254A CN 114897190 A CN114897190 A CN 114897190A
Authority
CN
China
Prior art keywords
local
model
node
committee
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210548254.1A
Other languages
Chinese (zh)
Inventor
张海华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202210548254.1A priority Critical patent/CN114897190A/en
Publication of CN114897190A publication Critical patent/CN114897190A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The embodiment of the application discloses a method, a device, a medium and equipment for constructing a federated learning framework. Wherein, the method comprises the following steps: collecting local models and local gradients which are trained by training execution nodes through the committee nodes; wherein the local model and local gradient are signed by the training enforcement node with a private key; verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes; verifying, by the committee node, validity of the local model; and the committee nodes aggregate the verified local models to generate an aggregation model, and distribute the aggregation model to the training execution nodes for iterative training until iteration is completed. According to the technical scheme, the private secret key is used for signing the local model and the local gradient, the authenticity of a model training result is guaranteed, and the safety of a federal learning framework is improved.

Description

Method, device, medium and equipment for constructing federated learning framework
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, a device, a medium and equipment for constructing a federated learning framework.
Background
With the rapid development of artificial intelligence technology, advanced machine learning technologies such as federal learning are widely applied to the fields of image recognition, voice recognition, smart cities, disease diagnosis and the like. Therefore, designing a safe federal learning framework to ensure the correctness of the training process is a problem to be solved urgently.
The current federal learning framework signs the local model mainly by a shared key, and a central server such as a cloud server is responsible for distributing, aggregating and updating the model ultimately used for data analysis tasks. Each participant receives an initial model distributed by the cloud, local data is used for training each participant, the updated local gradient, namely model parameters, is used for obtaining a digital abstract through a Hash algorithm, a shared secret key is used for encrypting the digital abstract to obtain a digital signature, and then the digital signature, an electronic file original text and a public key of a signature certificate are added together for packaging to form a local gradient with the signature and the local gradient is transmitted back to the cloud. The cloud decrypts the digital signature by using the public key for the data from each participant to obtain a digital abstract; and (3) obtaining a new digital abstract again from the original text by adopting the same hash algorithm, comparing the two digital abstracts, if the two digital abstracts are matched, indicating that the electronic file with the digital signature is successfully transmitted, and then aggregating to form a new model and issuing the new model. This process is repeated.
However, prior to model aggregation, each participant signs the gradient using a shared key, and the correctness of the local model cannot be guaranteed. Therefore, the current federal learning framework is difficult to meet the safety requirements of practical applications.
Disclosure of Invention
The embodiment of the application provides a method, a device, a medium and equipment for constructing a federated learning framework, which can ensure the authenticity of a model training result and improve the safety of the federated learning framework by using a private key to sign a local model and a local gradient.
In a first aspect, an embodiment of the present application provides a method for constructing a federated learning framework, where the method includes:
collecting local models and local gradients which are trained by training execution nodes through the committee nodes; wherein the local model and local gradient are signed by the training enforcement node with a private key;
verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes;
verifying, by the committee node, validity of the local model;
and the committee nodes aggregate the verified local models to generate an aggregation model, and distribute the aggregation model to the training execution nodes for iterative training until iteration is completed.
In a second aspect, an embodiment of the present application provides a device for constructing a bang learning frame, where the device includes:
the local parameter collection module is used for collecting a local model and a local gradient which are trained by the training execution node through the committee node; wherein the local model and local gradient are signed by the training enforcement node with a private key;
the signature verification module is used for verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes;
a local model validation module for validating the local model by the committee node;
and the model aggregation distribution module is used for aggregating the local models passing the verification by the committee node to generate an aggregation model, distributing the aggregation model to the training execution node for iterative training until the iteration is completed.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for constructing a federated learning framework as described in the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable by the processor, where the processor, when executing the computer program, implements the method for constructing the federal learning framework according to an embodiment of the present application.
According to the technical scheme provided by the embodiment of the application, the local model and the local gradient are signed by using the private key, the authenticity of a model training result is guaranteed, and the safety of a federal learning framework is improved.
Drawings
FIG. 1 is a flowchart of a method for constructing a federated learning framework provided in an embodiment of the present application;
FIG. 2 is a flowchart of a method for constructing a federated learning framework in a second embodiment of the present invention;
fig. 3 is a structural block diagram of a device for constructing a federated learning framework according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a method for constructing a federated learning framework provided in an embodiment of the present application, where the embodiment is applicable to a scenario in which a federated learning framework is used for model training, and the method may be executed by a device for constructing a federated learning framework provided in an embodiment of the present application, where the device may be implemented by software and/or hardware, and may be integrated in an electronic device.
As shown in fig. 1, the method for constructing the federal learning framework includes:
s110, collecting local models and local gradients which are well trained by training execution nodes through the committee nodes; wherein the local model and local gradient are signed by the training enforcement node with a private key.
Wherein the method is performed by a blockchain system comprising committee nodes and common nodes.
The execution main body of the scheme, the blockchain system, may be the whole system formed by all blockchain nodes. The system comprises committee nodes and common nodes. The blockchain may be a distributed ledger that stores all transactions and states throughout the network. Wherein, the committee node can be selected by the common node according to the trust value. Committee nodes may be used for nodes that perform global model aggregation and validation. The election rule may include that election may be performed according to the performance of each node, for example, since the committee node needs to perform relatively comprehensive work and has a relatively high performance requirement, election may be performed based on the performance level. The regular node may be a lower performance blockchain node.
The local model may be a training model distributed to the training enforcement nodes in federated learning. Each training enforcement node independently trains the local model with its own private data. A training performing node may be a node that possesses local data and is capable of individual training. The local gradient may be a training result of the training executive node being trained with local data through the local model. Accordingly, federated learning may be considered a distributed machine learning framework that does not centrally collect training data for a model, but rather distributes the training model to multiple data owners for individual training, while generating a final model through intermediate gradient aggregation in an iterative fashion.
The signature can be an asymmetric encryption technology, the data can not be falsified in the whole system through a private key signature mode of each training execution node, and the identities of both sides of a transaction are guaranteed to be real and reliable.
In this embodiment, optionally, before collecting, by the committee node, the local model and the local gradient trained by the training executive node, the method further includes: if an election triggering event of a committee node is detected, acquiring a node trust value of each node in a block chain; and replacing the committee members according to the comparison result of the node trust values.
Wherein the committee would collaborate to aggregate and validate models in lieu of a central server. In the committee set-up phase, initial committee nodes are composed of the first workers in the blockchain system who successfully generated blocks in different rounds. And collecting and verifying the local gradient by the initial committee node, aggregating the successfully verified local models to generate an aggregation model, and then distributing the aggregation model to the training execution nodes. And the training execution node verifies the deviation degree of the local data recognition result of the aggregation model and the local model. The election triggering event can be triggered by the blockchain worker actively initiating voting to select and broadcast the committee when the committee trust value is considered too low.
The confidence value may be determined according to a degree of deviation of the recognition result of the test data by the aggregation model and the local model. For example, the recognition rate of a local model is 90% after test data training, and only 50% of the aggregated model is used, then the trust value of the committee node is reduced, when the trust value of a certain node of the committee is too low, the committee is kicked out, and a new committee node with a higher trust value is selected from all block chain links to replace the node. The local identification rate may be the prediction capability of the local model on the test data, and the aggregate model identification rate may be the prediction capability of the aggregate model on the test data.
In this embodiment, the reliability of the committee nodes is measured by the trust values, and a continuously replaced trust committee is established, so that the credibility of the committee can be improved, and the security of the system can be improved.
In this embodiment, optionally, before collecting, by the committee node, the local model and the local gradient trained by the training executive node, the method further includes: and constructing a system architecture of the block chain system-based federal learning framework.
The system architecture may be an abstract description of the overall structure and components of the blockchain system. For example, in this embodiment, the system architecture is mainly composed of participants, workers, a block chain-based committee, and users. Where participants may be entities defined as the same in a traditional federal learning model. Participants contribute their local training data and collaboratively train a global machine learning model. The worker may be a miner similar to those in a normal blockchain system, who processes transactions, including updating the relevant signatures of the model, for verification and auditing. A committee may be composed of a group of consignees, which are essentially workers in a blockchain. In fact, the same node in the blockchain can assume both the trustee and worker roles on the physical machine. In addition to performing mining tasks, the delegates in the committee also perform global model aggregation and validation based on the gradients collected from the participants. Users may be clients of the framework who may issue various learning tasks and request well-trained models for practical applications.
In this embodiment, by improving the system architecture of the blockchain, the roles of the nodes in the blockchain network and the mutual conversion of the node roles are described in detail, and the method is more suitable for the federal learning framework.
In this embodiment, optionally, after constructing the system architecture of the block chain system-based federal learning framework, the method further includes: based on the system architecture of the federal learning framework, a committee node distributes training models to all common nodes, and training execution nodes with data train the local parts of the models to obtain local models and local gradients.
The committee node can distribute the training model to each common node in a network communication mode.
In the embodiment, the committee replaces the central server to perform model aggregation and verification, so that the credibility of the system is further improved.
And S120, verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes.
Wherein any node may be any of all common nodes and committee nodes in the blockchain. Verifying the signature of the local model may be determining whether the local model is maliciously altered from the signature of the local model. The verification result may be that the local model is normal or tampered with by a malicious attacker.
In this embodiment, by verifying the signature of the local model, the integrity and authenticity of the local model in the whole training process can be ensured, and malicious attack is avoided.
S130, verifying the validity of the local model through the committee node.
Wherein, verifying the validity of the local model may be verifying whether the collected training result data is correct through a committee node. The committee node may verify that the collected training result data is correct using the average of the training result data. If the deviation between a certain collected training result data and the average value is larger than the preset value, the data is considered to be incorrect. For example, if the parameters sent by three training enforcement nodes are collected as 1, 2, and 3, i take the average value of 2 as the aggregation parameter, and if one node sent as-1, it may be discarded because it apparently is not correct.
In the embodiment, by verifying the validity of the local model, the correctness of the use data when the committee carries out model aggregation can be ensured.
And S140, the committee nodes aggregate the verified local models to generate an aggregate model, and distribute the aggregate model to the training execution nodes for iterative training until iteration is completed.
Wherein, the aggregation model can be to aggregate the local models together, so as to make the classification performance thereof better. An iteration may be an activity that repeats a feedback process, typically with the goal of approaching a desired goal or result. Each iteration of the process is referred to as an "iteration," and the result of each iteration is used as the initial value for the next iteration. In this example, the iterative training may be that the committee node repeatedly collects and verifies the local gradients and performs aggregation to generate an aggregation model, and then distributes the aggregation model to the training execution nodes. And verifying the deviation degree of the identification result of the aggregation model and the local model on the local data by the training execution node until the aggregation model meets the identification rate requirement.
In this embodiment, optionally, the committee node aggregates the verified local models to generate an aggregate model, including: counting the number of local models and local gradients which are valid for verification by each committee node; and if the statistical quantity of each committee node exceeds a threshold value theta, performing gradient aggregation on the local model to generate the aggregation model.
In this embodiment, the minimum number of active participant signatures required to generate an aggregate model update is determined by predefining a threshold θ. Model aggregation is triggered when each committee node verifies that the signatures of at least θ participants are valid. The problem of liquidity of the training execution nodes is solved, meanwhile, an attacker trying to forge effective updating of the aggregation model needs to control keys of theta training execution nodes, and effectiveness of the aggregation model is further guaranteed.
In this embodiment, optionally, distributing the aggregation model to the training execution node for iterative training until iteration is completed, where the iterative training includes: and if the result of verifying the aggregation model by the training execution node by using the local data meets the requirement of the recognition rate, determining that the iteration is finished.
Where the local data may be training data that participants contribute to their local. The recognition rate may be a predictive capability for the local data.
In this case, the identification rate of the result of verifying the aggregation model by using the local data is determined to be completed iteratively, so that the aggregation model can be ensured to meet the requirement of the identification rate.
According to the technical scheme provided by the embodiment of the application, the local model and the local gradient are signed by using the private key, and the correctness of the training process is ensured to improve the safety of the federal learning framework.
Example two
Fig. 2 is a flowchart of a method for constructing a federated learning framework in a second embodiment of the present invention, and the present embodiment is optimized based on the foregoing embodiment. The concrete optimization is as follows: when the local model signature verification result is synchronously recorded in all the blockchain nodes, the method further comprises the following steps: performing data reconstruction on data in the block chain system to obtain a data bidirectional jump chain of the block chain system, wherein the data bidirectional jump chain is a chain structure comprising a common block and an anchor block; the anchor block includes a hash value of a previous block in the chain structure and a signature of a future block.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
s210, collecting local models and local gradients which are well trained by training execution nodes through the committee nodes; wherein the local model and local gradient are signed by the training enforcement node with a private key.
S220, verifying the signature of the local model by any node in the block chain.
And S230, reconstructing the data structure in the block chain system to obtain a data bidirectional jump chain of the block chain system, and synchronously recording verification results in all block chain nodes. The data bidirectional jump chain is a chain structure comprising a common block and an anchor block; the anchor block includes hash values of previous blocks in the chain structure and hash values of future blocks provided by the chameleon hash function.
The data structure may be a storage manner of data. For example, in this embodiment, the data structure in the blockchain system that does not modify the blockchain system may be an ordered and reverse-linked unidirectional transaction blockchain table constructed based on hash pointers. The bidirectional skip chain may be a novel block chain structure, including a chain structure of normal blocks and anchor blocks. The anchor block includes the hash value of the previous block in the chain structure and the hash value of the future block provided by the chameleon hash function. And constructing a backward link for a future block by using the hash value provided by the chameleon hash function, namely calculating and storing the hash of the following block in the chameleon hash mode when the following block is not generated. The hash function may be a function that converts an input string with an arbitrary length into a string with a fixed length, and the converted string can be easily calculated from an original string, and the original string is difficult to restore from the converted string. The chameleon hash function can be that a 'back door' or a 'private key' is set manually, so that a person who owns the private key can perform hash calculation on other information to obtain the same character string.
In the present embodiment, the data structure of the block chain is reconstructed into the bidirectional skip chain, and the backward link is increased to reduce the complexity of searching the gradient or the global model, so that an auditor can quickly find the gradient or the global model needing auditing.
S240, verifying the validity of the local model through the committee node;
and S250, the committee nodes aggregate the verified local models to generate an aggregation model, and distribute the aggregation model to the training execution nodes to perform iterative training until iteration is completed.
According to the scheme, the data structure of the block chain is reconstructed into the bidirectional jump chain, the complexity of searching for the gradient or the global model is reduced by increasing the backward link, and an auditor can quickly find the gradient or the global model needing auditing.
EXAMPLE III
Fig. 3 is a structural block diagram of a device for constructing a federated learning framework provided in the third embodiment of the present invention, where the device is capable of executing a method for constructing a federated learning framework provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects of the execution method. The apparatus is configured in a blockchain system comprising committee nodes and common nodes; as shown in fig. 3, the apparatus may include:
a local parameter collecting module 310, configured to collect, through the committee node, a local model and a local gradient that are trained by the training execution node; wherein the local model and local gradient are signed by the training enforcement node with a private key;
the signature verification module 320 is configured to verify the signature of the local model by any node in the blockchain and synchronously record a verification result in all the blockchain nodes;
a local model verification module 330 for verifying the validity of the local model by the committee node;
and a model aggregation distribution module 340, configured to aggregate the verified local models by the committee node to generate an aggregation model, and distribute the aggregation model to the training execution node for iterative training until iteration is completed.
On the basis of the above technical solutions, optionally, the model aggregation and distribution module includes:
the quantity counting unit is used for counting the counting quantity of the local model and the local gradient which are effective for verification by each committee node;
and the model aggregation unit is used for performing gradient aggregation on the local model to generate the aggregation model if the statistical quantity of each committee node exceeds a threshold theta.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the committee replacement module is used for acquiring a node trust value of each node in the block chain if an election triggering event of a committee node is detected; and replacing the committee members according to the comparison result of the node trust values.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the data reconstruction module is used for reconstructing a data structure in the block chain system to obtain a data bidirectional jump chain of the block chain system, wherein the data bidirectional jump chain is a chain structure comprising a common block and an anchor block; the anchor block includes hash values of previous blocks in the chain structure and hash values of future blocks provided by the chameleon hash function.
On the basis of the above technical solutions, optionally, the apparatus further includes:
and the system architecture construction module is used for constructing the system architecture of the block chain system-based federated learning framework.
On the basis of the above technical solutions, optionally, the model aggregation and distribution module further includes:
and the model distribution unit is used for distributing training models to all common nodes by committee nodes based on the system architecture of the federal learning framework, so that training execution nodes with data can train the local parts of the models to obtain local models and local gradients.
On the basis of the above technical solutions, optionally, the model aggregation and distribution module further includes:
and the iteration completion determining unit is used for determining that the iteration is completed if the result of verifying the aggregation model by the training execution node by using the local data meets the requirement of the recognition rate.
The product can execute the method for constructing the federal learning framework provided by the embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method.
Example four
A fourth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for constructing the federal learning framework provided in all the embodiments of the present invention:
collecting local models and local gradients which are trained by training execution nodes through the committee nodes; wherein the local model and local gradient are signed by the training enforcement node with a private key;
verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes;
verifying, by the committee node, validity of the local model;
and the committee nodes aggregate the verified local models to generate an aggregation model, and distribute the aggregation model to the training execution nodes for iterative training until iteration is completed.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
EXAMPLE five
The fifth embodiment of the application provides electronic equipment. Fig. 4 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application. As shown in fig. 4, the present embodiment provides an electronic device 400, which includes: one or more processors 420; the storage device 410 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the method for constructing the federal learning framework provided in this embodiment of the present application, where the method includes:
collecting local models and local gradients which are trained by training execution nodes through the committee nodes; wherein the local model and local gradient are signed by the training enforcement node with a private key;
verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes;
verifying, by the committee node, validity of the local model;
and the committee nodes aggregate the verified local models to generate an aggregation model, and distribute the aggregation model to the training execution nodes for iterative training until iteration is completed.
Of course, those skilled in the art will appreciate that processor 420 may also implement the technical solution of the method for constructing the federal learning framework provided in any of the embodiments of the present application.
The electronic device 400 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of the processors 420 in the electronic device may be one or more, and one processor 420 is taken as an example in fig. 4; the processor 420, the storage device 410, the input device 430, and the output device 440 in the electronic apparatus may be connected by a bus or other means, and are exemplified by a bus 450 in fig. 4.
The storage device 410 is a computer-readable storage medium, and can be used to store software programs, computer-executable programs, and module units, such as program instructions corresponding to the method for constructing the federal learning framework in the embodiment of the present application.
The storage device 410 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 410 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 410 may further include memory located remotely from processor 420, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 430 may be used to receive input numbers, character information, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. The output device 440 may include a display screen, speakers, or other electronic equipment.
The electronic equipment provided by the embodiment of the application can be used for timely and effectively communicating each node through the arrangement of the agent nodes, and the safety of the block chain nodes can be ensured while the instantaneity and the accuracy of data information interaction are ensured.
The device, the medium and the electronic device for constructing the federal learning framework provided in the embodiments can execute the method for constructing the federal learning framework provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the above embodiments, reference may be made to the method for constructing the federal learning framework provided in any of the embodiments of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. The construction method of the federated learning framework is characterized in that the method is executed by a block chain system, and the block chain system comprises committee nodes and common nodes; the method comprises the following steps:
collecting local models and local gradients which are trained by training execution nodes through the committee nodes; wherein the local model and local gradient are signed by the training enforcement node with a private key;
verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes;
verifying, by the committee node, validity of the local model;
and the committee nodes aggregate the verified local models to generate an aggregation model, and distribute the aggregation model to the training execution nodes for iterative training until iteration is completed.
2. The method of claim 1, wherein the committee node aggregates the validated local models to generate an aggregate model, comprising:
counting the number of local models and local gradients which are valid for verification by each committee node;
and if the statistical quantity of each committee node exceeds a threshold value theta, performing gradient aggregation on the local model to generate the aggregation model.
3. The method of claim 1, wherein prior to collecting, by the committee node, the local model and local gradients that were trained by the performing node, the method further comprises:
if an election triggering event of a committee node is detected, acquiring a node trust value of each node in a block chain;
and replacing the committee members according to the comparison result of the node trust values.
4. The method of claim 1, further comprising:
reconstructing a data structure in the block chain system to obtain a data bidirectional jump chain of the block chain system, wherein the data bidirectional jump chain is a chain structure comprising a common block and an anchor block; the anchor block includes hash values of previous blocks in the chain structure and hash values of future blocks provided by the chameleon hash function.
5. The method of claim 1, wherein prior to collecting, by the committee node, the local model and local gradients that were trained by the performing node, the method further comprises:
and constructing a system architecture of the block chain system-based federal learning framework.
6. The method of claim 5, wherein after building the system architecture of the blockchain system-based federated learning framework, the method further comprises:
based on the system architecture of the federal learning framework, a committee node distributes training models to all common nodes, and training execution nodes with data train the local parts of the models to obtain local models and local gradients.
7. The method of claim 1, wherein distributing the aggregated model to the training execution nodes for iterative training until iteration is complete comprises:
and if the result of verifying the aggregation model by the training execution node by using the local data meets the requirement of the recognition rate, determining that the iteration is finished.
8. The construction device of the federated learning framework is characterized in that the device is configured in a block chain system, and the block chain system comprises committee nodes and common nodes; the method comprises the following steps:
the local parameter collection module is used for collecting a local model and a local gradient which are trained by the training execution node through the committee node; wherein the local model and local gradient are signed by the training enforcement node with a private key;
the signature verification module is used for verifying the signature of the local model by any node in the block chain and synchronously recording the verification result in all the block chain nodes;
a local model validation module for validating the local model by the committee node;
and the model aggregation distribution module is used for aggregating the local models passing the verification by the committee node to generate an aggregation model, distributing the aggregation model to the training execution node for iterative training until the iteration is completed.
9. A computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the method of constructing a federal learning framework as claimed in any of claims 1-7.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of building the federated learning framework as recited in any of claims 1-7 when executing the computer program.
CN202210548254.1A 2022-05-18 2022-05-18 Method, device, medium and equipment for constructing federated learning framework Pending CN114897190A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210548254.1A CN114897190A (en) 2022-05-18 2022-05-18 Method, device, medium and equipment for constructing federated learning framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210548254.1A CN114897190A (en) 2022-05-18 2022-05-18 Method, device, medium and equipment for constructing federated learning framework

Publications (1)

Publication Number Publication Date
CN114897190A true CN114897190A (en) 2022-08-12

Family

ID=82724448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210548254.1A Pending CN114897190A (en) 2022-05-18 2022-05-18 Method, device, medium and equipment for constructing federated learning framework

Country Status (1)

Country Link
CN (1) CN114897190A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115795518A (en) * 2023-02-03 2023-03-14 西华大学 Block chain-based federal learning privacy protection method
TWI818708B (en) * 2022-09-02 2023-10-11 英業達股份有限公司 Method for verifying model update

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI818708B (en) * 2022-09-02 2023-10-11 英業達股份有限公司 Method for verifying model update
CN115795518A (en) * 2023-02-03 2023-03-14 西华大学 Block chain-based federal learning privacy protection method
CN115795518B (en) * 2023-02-03 2023-04-18 西华大学 Block chain-based federal learning privacy protection method

Similar Documents

Publication Publication Date Title
US11694110B2 (en) Aggregated machine learning verification for database
Diallo et al. eGov-DAO: A better government using blockchain based decentralized autonomous organization
CN110084377B (en) Method and device for constructing decision tree
US10355869B2 (en) Private blockchain transaction management and termination
CN108923909B (en) Block chain generation method and device, computer equipment and storage medium
WO2018119587A1 (en) Data processing method, device, and system, and information acquisition apparatus
KR101962686B1 (en) System and method for electronic voting
US20200394471A1 (en) Efficient database maching learning verification
CN114897190A (en) Method, device, medium and equipment for constructing federated learning framework
CN112270597A (en) Business processing and credit evaluation model training method, device, equipment and medium
CN112632629B (en) Voting management method, device, medium and electronic equipment based on block chain
KR102537774B1 (en) Systems and methods that provide specialized proof of confidential knowledge
CN114372296B (en) Block chain-based user behavior data auditing method and system
CN111556115B (en) Block chain-based data processing method, device, equipment and storage medium
CN112990921B (en) Block chain-based data processing method, device, computer and storage medium
Yao et al. Accident responsibility identification model for Internet of Vehicles based on lightweight blockchain
CN112862487A (en) Digital certificate authentication method, equipment and storage medium
CN112749827A (en) Financial information processing method, device, electronic equipment and storage medium
Javed et al. Secure message handling in vehicular energy networks using blockchain and artificially intelligent IPFS
CN112308238A (en) Analytical model training method and device, electronic equipment and storage medium
CN112069529B (en) Block chain-based volume management method and device, computer and storage medium
CN113886817A (en) Host intrusion detection method and device, electronic equipment and storage medium
Afzaal et al. Formal verification of persistence and liveness in the trust-based blockchain crowdsourcing consensus protocol
CN110837657A (en) Data processing method, client, server and storage medium
CN112926981B (en) Transaction information processing method, device and medium for block chain and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination