A method for sharing seismic data models based on blockchain and federated learning
By combining blockchain and federated learning technologies, the difficulties in data sharing and system instability in the seismic exploration industry have been resolved. This has enabled the sharing of seismic models and local privacy protection, improved model performance and system robustness, and provided a decentralized incentive mechanism and an efficient data sharing platform.
Patent Information
- Application Number
- CN202211391993.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-08
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-11-08
AI Technical Summary
In the traditional seismic exploration industry, there are serious data barriers, difficulties in data sharing, unstable federated learning systems, a lack of incentive mechanisms, limited blockchain storage capacity, low transaction throughput, low indexing efficiency, limited business scenarios, and vulnerability to malicious node attacks.
By combining blockchain and federated learning technologies, an earthquake data model sharing method is adopted. A consensus protocol based on proof-of-stake is used to incentivize participants. A main block and micro block structure is used to accelerate model sharing and traceability, thereby realizing a decentralized model sharing platform. A PKI key management system is used for identity verification and malicious node screening. Docker and Kubernetes technologies are used to deploy a distributed cluster for model training.
It enables the sharing of earthquake models and the protection of local privacy data, improves model performance and system robustness, prevents malicious attacks, increases participation in model training and overall performance, and enhances the traceability and efficiency of data model sharing.
Smart Images

Figure CN115687526B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the intersection of seismic exploration technology and artificial intelligence technology, in particular to the federal learning and blockchain technology in the field of artificial intelligence research, and more particularly to a seismic data model sharing method based on blockchain and federal learning. BACKGROUND
[0002] Nowadays, the traditional seismic exploration industry has serious data barriers. Due to industry competition, user privacy, data security and complex management regulations, it is difficult for all parties to actively and voluntarily share data for model training. On the other hand, due to data security considerations, strict constraints and control requirements are also put forward for the collection and processing of seismic exploration industry data. Under such legal environment, over time, it will become more and more difficult to collect and share data among different organizations. More importantly, the owners of some highly sensitive data will also strongly oppose unrestricted calculation and use of these data. In this case, the data owners only allow these data to be kept in their own hands, thereby forming isolated data islands, and the amount of data required for training artificial intelligence application models is very large. It is found that it is difficult or even impossible to meet such a scale of data, so it is often difficult to obtain high-quality and large amounts of training data.
[0003] In order to solve the above problems, federal learning technology emerges as the times require. The core idea of federal learning is "data does not move, model moves", and each party can train its own existing data set locally without having to centralize all data to a central storage point to train machine learning models. Each organization that owns a data source trains a model, and then each organization communicates with each other on their respective models, and finally a global model is obtained through model aggregation. In order to ensure user privacy and data security, the process of exchanging model information between organizations will be heavily encrypted, so that no organization can guess the privacy data content of any other organization.
[0004] However, this technology is not perfect, and it also has the following problems:
[0005] (1) The communication between the participating parties is unstable. The traditional centralized structure is prone to single point failure, which leads to abnormal model training and unstable overall system. The distributed structure is easy to be attacked by malicious nodes, which leads to data leakage.
[0006] (2) Different participating parties have different amounts of training samples. Malicious nodes may intentionally train only a small amount of sample information, which can easily lead to model training deviation, damage the performance of the entire federal learning system or model, or even cause the federal training model to fail. On the other hand, the data distribution of each participating party may not be independent and identically distributed.
[0007] (3) There is a lack of an incentive mechanism among federal learning participants, thereby encouraging participants to use more local data to participate in model training.
[0008] The emergence of blockchain technology provides a great opportunity for the further development of federated learning. The essence of blockchain can be regarded as a distributed ledger, and everyone has the right to record the ledger. The recorder can give others a look after recording, and others update their local ledger after agreeing. The ledger only allows addition, not deletion. Blockchain can also be regarded as a data structure, which is a linear linked list composed of transactions, blocks, and chains. Transactions can be regarded as changes in the state of the ledger, blocks record all transactions and state results that occur within a period of time, and chains are linked by the order of block occurrence, which is the log of the state change of the entire ledger. If the blockchain is regarded as a state machine, each transaction is an attempt to change the state, and each block generated by consensus is a confirmation of the participants' state change caused by the transactions in the block. The nodes inside the blockchain use distributed network communication, and all nodes have the same identity and the right to record the ledger, without the need for additional third-party institutions to participate, with the natural decentralization function. Nodes can reach consensus through the corresponding consensus protocol to determine the final transaction block node, and use cryptographic mechanisms to ensure that the block content is tamper-proof, traceable, and privacy-protecting. At the same time, the blockchain network has robustness and can tolerate the existence of some abnormal nodes and resist attacks by malicious nodes.
[0009] Although the blockchain has many advantages, it still has the following disadvantages:
[0010] (1) The blockchain itself cannot directly store a large amount of data, and a large amount of information in the blockchain network needs to be written into a database for storage.
[0011] (2) How to design a distributed consensus protocol according to specific business scenarios to avoid forks.
[0012] (3) The transaction throughput of the blockchain system is low.
[0013] (4) The traditional chain structure is suitable for single business scenarios, and the index efficiency is low. SUMMARY
[0014] The purpose of the present application is to overcome the shortcomings of the above-mentioned technologies, and to take the advantages of the above-mentioned technologies, that is, to combine the advantages of the two technologies of blockchain and federated learning, to provide a seismic data model sharing method based on blockchain and federated learning, to solve the problem of sharing and local privacy data protection of the seismic model in the case of multi-target monitoring by using the federated learning technology, to realize the traceability of the model, the user incentive and the decentralized mechanism by using the blockchain technology, and to combine the advantages of the two technologies to build a seismic model sharing platform without centralized nodes.
[0015] To achieve the above-mentioned purpose, the present application provides the following technical solutions:
[0016] In a first aspect, in one embodiment of the present application, a seismic data model sharing method based on blockchain and federated learning is provided, comprising the following steps:
[0017] Based on the existing shared seismic model of the data traceability blockchain, the seismic model demand side node sends a seismic model sharing request to the blockchain;
[0018] The local seismic model node retrieves the history record of the blockchain according to the seismic model request, and if the trained seismic data sharing model required by the seismic model request has been trained in the existing blockchain history record, the model cached by the node is returned to the seismic model demand side node as the result;
[0019] Based on the newly created seismic model sharing task, the model data sharing is carried out, if the multi-party data sharing model task required by the seismic model demand side node has not been trained, a new seismic model training sharing request is generated, and the local seismic model node related to the seismic model training sharing request is selected to carry out federated learning;
[0020] The model obtained by federated learning is returned to the seismic model demand side node, and the trained model result is uploaded to the blockchain.
[0021] As a further scheme of the present application, the seismic data model sharing method based on blockchain and federated learning further comprises the structure of the chain in the blockchain, the structure of the chain is to divide the original block into a main block and a micro block, and one main block and multiple micro blocks are generated in each round of competition; wherein, the main block is used for indexing and recording the model sharing training task or the model traceability, and the micro block is used for recording the sharing model weight parameter related to the main block model.
[0022] As a further scheme of the present application, each micro block contains two types of transactions, one is the transaction for updating the weight parameter of the model whose signature is passed, and the other is the transaction for the weight parameter of the model whose signature is not passed, and the first micro block generated is connected with the main block.
[0023] As a further scheme of the present application, the main block contains one of a model sharing training transaction and a model traceability transaction, and when the main block packs a transaction, the actual model sharing task is queried in the existing block chain, if the same training model exists in the existing block chain, a model traceability main block is generated, otherwise a model training main block is generated.
[0024] As a further scheme of the present application, if the multi-party data sharing model task required by the seismic model demand side node has not been trained, a new seismic model training sharing request is generated, and a seismic model traceability transaction is generated to record the retrieved main block and microblock position information about the seismic model and record them into the newly generated main block.
[0025] The final training completed microblock information corresponding to the task in the block chain is packaged to generate a new microblock connected to the newly generated main block, and the seismic model weight information in the final microblock is returned to the seismic model demand side node.
[0026] As a further scheme of the present application, in the seismic data model sharing method based on the block chain and the federated learning, when the same model as the new seismic model sharing demand is not retrieved, a seismic model sharing training task is performed, which includes the following steps:
[0027] Using Docker and K8s technology to deploy a seismic model training distributed cluster, and storing different seismic data and training local seismic model weights;
[0028] The local seismic model node is used to complete basic data storage, data cleaning, data preprocessing and other data operations, and the local seismic model node is also used to develop algorithm interfaces for different data set types, complete the test of the corresponding algorithm on the corresponding data set, adjust the corresponding hyperparameters, and provide seismic model performance for federated learning.
[0029] As a further scheme of the present application, in the seismic data model sharing method based on the block chain and the federated learning, all nodes are registered as distributed nodes by using a PKI key management architecture, and public and private key information is distributed to enter the federated block chain learning network; wherein the PKI key management architecture is composed of four parts of digital certificate, identity information public and private key, certificate authority and certificate revocation list, and is used for identity verification between different member nodes.
[0030] As a further scheme of the present application, the method for sharing the seismic data model based on the blockchain and the federated learning further comprises: a local seismic model weight training node, which performs local model training by using a local seismic data set; and the local seismic model weight training node is configured to perform seismic model training locally by using an existing local seismic data set, and transmit trained weight information to a verification seismic model weight node in communication with the local seismic model weight training node.
[0031] As a further scheme of the present application, the method for sharing the seismic data model based on the blockchain and the federated learning further comprises: a verification seismic model weight node configured to perform model parameter verification, wherein the verification seismic model weight node is configured to perform validity verification on seismic model parameters broadcast by a local seismic model training node in communication with the verification seismic model weight node, pack a verification result into a new transaction and sign the new transaction, and broadcast the new transaction to a packaged transaction block node in communication with the verification seismic model weight node, so that the packaged transaction block node completes final auditing.
[0032] As a further scheme of the present application, the method for sharing the seismic data model based on the blockchain and the federated learning further comprises: a packaged transaction block node configured to complete final seismic model weight sharing transaction aggregation and broadcast a block packaged by the packaged transaction block node; wherein the packaged transaction block node is configured to accept seismic model weight parameter transactions broadcast by a verification seismic model weight node in communication with the packaged transaction block node, broadcast the accepted transactions to other packaged transaction block nodes, accept transactions broadcast by other packaged transaction block nodes, sign a final transaction queue, and pack all transactions into a block.
[0033] As a further scheme of the present application, the method for sharing the seismic data model based on the blockchain and the federated learning further comprises: block verification, global parameter updating, and recording model training information; wherein, after determining to accept a final block, each local seismic model weight training node, verification seismic model weight node, and packaged transaction block node performs block verification, adds the block to a respective local blockchain after verifying that the block is correct, completes chaining, and updates a corresponding local global parameter model by using a corresponding federated learning weight aggregation algorithm.
[0034] In a second aspect, the present application further provides a method for sharing and tracing a seismic data model, which adopts the method for sharing the seismic data model based on the blockchain and the federated learning.
[0035] In a third aspect, the present application further provides a method for implementing a model training incentive mechanism and screening a malicious node of a system based on a proof-of-stake consensus protocol, which adopts the method for sharing the seismic data model based on the blockchain and the federated learning to implement the model training incentive mechanism and screen the malicious node of the system.
[0036] In a fourth aspect, the present application further provides a brand-new block chain structure combining a main block and a side block, which is based on the block chain and federated learning-based seismic data model sharing method.
[0037] In a fifth aspect, the present application further provides a decentralized incentive platform for an online artificial intelligence learning algorithm model based on the block chain and federated learning-based seismic data model sharing method.
[0038] In a sixth aspect, in another embodiment provided by the present application, a computer device is provided, which comprises a memory and a processor, the memory stores a computer program, and the processor loads and executes the computer program to realize the steps of the block chain and federated learning-based seismic data model sharing method.
[0039] In a seventh aspect, in still another embodiment provided by the present application, a storage medium is provided, which stores a computer program, and the computer program is loaded and executed by a processor to realize the steps of the block chain and federated learning-based seismic data model sharing method.
[0040] The technical solution provided by the present application has the following beneficial effects:
[0041] The block chain and federated learning-based seismic data model sharing method provided by the present application uses federated learning technology to realize the sharing of seismic models and the protection of local private data, uses block chain technology to realize model traceability, user incentive and decentralized mechanism, combines the advantages of the two together to make up for each other's shortcomings, and builds a seismic model sharing platform without centralized nodes.
[0042] By combining the block chain and federated learning technologies together, firstly, the block chain technology is used to provide a consensus protocol based on proof of stake for seismic model sharing, the block reward is linked with the correctness of the model of the participant, and more rewards are given to the participants who train excellent models, and the rewards are determined by the number of training samples of the participants, so that the participation problem of the participants is solved, and the participants are encouraged to train better models, the overall model performance is improved, the problem of lack of incentive mechanism for federated learning participants is solved, and the problem of block chain forking is avoided. On the other hand, the block chain has the characteristics of immutability and traceability, and is an effective tool for preventing malicious attacks in federated learning.
[0043] Each participant's instant update to its local model can be linked to the distributed ledger provided by the blockchain, so as to audit these model updates. Each model update, whether local weights or gradients, can be traced back to and associated with a single participant, which helps to detect tampering attempts and malicious model replacement. After screening out malicious nodes, they can be added to the blacklist in all nodes in the system, improving the robustness of the overall system. In addition, the weight update of the model is uploaded to the block in an encrypted manner, only the nodes registered in the system have the right to view, and the integrity of the model weight is guaranteed through the non-tamperability of the blockchain.
[0044] Finally, a new blockchain structure is adopted, which is divided into main blocks and micro blocks. The main block is mainly responsible for storing model sharing transaction requests and model traceability requests, and the micro block is connected with the main block to store the model training information or model traceability information related to the main block, so that the latest model training information can be quickly retrieved from the blockchain information when there is a new model sharing demand next time. Finally, a data model sharing platform based on federated learning and blockchain is built based on the above innovations, which can quickly publish the latest model sharing task and model traceability request on the platform.
[0045] These and other aspects of the present application will become more fully understood from the following detailed description, given by way of example only. 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 application, as claimed. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application. In the drawings:
[0047] Figure 1 The overall system flowchart of the data model sharing based on the blockchain and federated learning of the present application.
[0048] Figure 2 The chain structure schematic diagram of the blockchain and the main block and the micro block of the present application.
[0049] Figure 3 The multi-party data sharing logical architecture diagram based on the blockchain and federated learning of the present application.
[0050] Figure 4 The specific flowchart of the multi-party node local model training process of the present application.
[0051] Figure 5 The comparison diagram of model reconstruction before and after federated learning parameter aggregation in the seismic model effect schematic diagram based on federated learning and blockchain of the present application.
[0052] Figure 6 The picture reconstruction contrast chart after the federal learning model parameter aggregation in the federal learning and blockchain-based seismic model effect schematic diagram of the present application.
[0053] Figure 7 The seismic data clustering image before the federal learning parameter aggregation in the federal learning and blockchain-based seismic image clustering analysis chart of the present application.
[0054] Figure 8 The local seismic data clustering image after the parameter aggregation in the federal learning and blockchain-based seismic image clustering analysis chart of the present application.
[0055] Figure 9 The parameter setting interface of the deep learning shared model decentralization incentive platform of the present application.
[0056] Figure 10 The final training result interface of the deep learning shared model decentralization incentive platform of the present application. DETAILED DESCRIPTION
[0057] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0058] In some of the descriptions in the specification and claims of the present application and the above-mentioned drawings, a plurality of operations appearing in a specific order are included, but it should be clearly understood that these operations can be executed or in parallel without the order in which they appear in this text. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes can include more or fewer operations, and the operations can be executed in sequence or in parallel. It should be noted that the "first", "second", etc. described herein are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence. Also, "first" and "second" are different types.
[0059] The technical solutions in the exemplary embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings of the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0060] In order to solve the problem of serious data barriers in the traditional seismic exploration industry, the present application utilizes the respective advantages of the blockchain and the federated learning technology, takes the advantages and makes up the deficiencies, and by fusing the blockchain and the federated learning technology together, the present application proposes a method for sharing a seismic data model based on the combination of the blockchain and the federated learning, further proposes a new method for sharing and tracing a seismic data model, and on this basis, proposes a model training incentive mechanism based on a proof of stake (POS) consensus protocol and a method for screening malicious nodes of a system, and adopts a new blockchain structure combining a main block and a side block, and develops a decentralized incentive platform for an online artificial intelligence learning algorithm model.
[0061] The present application discloses a method for sharing a seismic data model based on the combination of the blockchain and the federated learning, first proposes a new scheme for sharing and tracing a seismic model by combining the blockchain and the federated learning, breaks the problem of data barriers that the traditional seismic exploration industry has been facing for a long time, and truly achieves the effect of not taking data out of a local place, jointly training a global seismic model and improving the performance of the overall model, so as to make bricks and tiles for the traditional seismic industry, so that the local place improves the performance of the local seismic model without sharing the respective local data and leaking privacy. Secondly, a model training incentive mechanism based on a POS consensus protocol and a method for screening malicious nodes of a system are proposed, and the number of rewards obtained by an honest node is determined by the size of the local seismic training data set. This not only encourages participants to better train the model, but also enhances the performance of the overall federated learning model, and the federated data model sharing based on the blockchain can effectively prevent the system instability caused by malicious nodes in the system or the single point failure of the centralized data center, and improve the robustness of the system. In addition, a new blockchain structure combining a main block and a side block is adopted, the efficiency of data model sharing and tracing is improved, and a decentralized incentive platform based on a deep learning shared model is developed, which can deploy a new seismic model sharing task online and perform seismic model sharing and tracing, and at the same time, the synchronization of the local seismic model node algorithm can also be completed.
[0062] Specifically, the embodiments of the present application are further described below in combination with the drawings.
[0063] Referring to Figure 1 An embodiment of the present application provides a method for sharing a seismic data model based on the blockchain and the federated learning, which specifically includes the following steps:
[0064] Based on the shared seismic model of the data tracing blockchain, a seismic model demand node sends a seismic model sharing request to the blockchain;
[0065] The local seismic model node retrieves the history record of the blockchain according to the seismic model request, and if the trained seismic data sharing model required by the seismic model request has been trained in the existing blockchain history record, the model cached by the node is returned as the result to the seismic model demand node;
[0066] Based on the newly created seismic model sharing task, the model data sharing is carried out, if the multi-party data sharing model task required by the seismic model demand node has not been trained, a new seismic model training sharing request is generated, and the local seismic model node related to the seismic model training sharing request is selected for federated learning;
[0067] The model obtained by federated learning is returned to the seismic model demand node, and the trained model result is uploaded to the blockchain.
[0068] Referring to Figure 1 As shown, Figure 1 The figure first describes the operation process of the whole system from the whole, the system is mainly divided into two main lines, one main line is the existing shared seismic model in the data traceability blockchain, the seismic model demand node sends the seismic model request that wants to share to the blockchain, the local seismic model node will be responsible for retrieving the history record of the blockchain, if the request of the trained seismic data sharing model required by the seismic model demand node has been trained in the existing blockchain history record, only the model cached by the node is returned as the result to the seismic model demand node. Another main line is to share the model data based on the new seismic model sharing task. If the multi-party data sharing model task required by the seismic model demand node has not been trained, a new seismic model training sharing request is generated, and the local seismic model node related to the request is selected for federated learning, the model obtained by federated learning is returned to the seismic model demand node, and the trained model result is uploaded to the blockchain.
[0069] The method for sharing the seismic data model based on the combination of blockchain and federated learning, specifically includes the following steps:
[0070] 1) The structure of the chain in the blockchain
[0071] The structure of the chain is to divide the original block into a main block and a micro block, and each round of competition produces a main block and multiple micro blocks; wherein, the main block is used for indexing and recording model sharing training tasks or model traceability, and the micro block is used for recording the sharing model weight parameters related to the main block model.
[0072] Wherein each micro-block contains two types of transactions, one is the model weight parameter transaction for model update whose signature is passed, and the other is the model weight parameter transaction whose signature is not passed, and the first micro-block generated is connected with the main block; the main block contains one of the model sharing training transaction and the model traceability transaction, and when the main block is packaged, the existing blockchain is queried according to the actual model sharing task, if the same training model exists in the existing blockchain, the model traceability main block is generated, otherwise the model training main block is generated.
[0073] 2) Model traceability
[0074] Firstly, when the seismic model demand side node in the system searches and finds that the seismic model involved in the new seismic model sharing request exists in the existing blockchain, at this time the system will generate a seismic model traceability transaction to record the main block and micro-block position information of the searched seismic model and record them into the newly generated main block.
[0075] Then the final training completed micro-block information corresponding to the task in the blockchain is packaged, a new micro-block is generated and connected after the newly generated main block, and the seismic model weight information in the final micro-block is returned to the seismic model demand side node.
[0076] Finally, the new main block and micro-block generated by this seismic model traceability are broadcast to other local seismic model nodes in the system, and after the verification information is correct, they are added to the existing blockchain, and the version number is marked, so that subsequent new seismic model sharing tasks can be searched according to the latest version number.
[0077] 3) Local seismic model node
[0078] When the same model as the new seismic model sharing demand is not searched in the blockchain system, at this time a new training task of the shared seismic model will be performed, and the specific steps of the seismic model sharing training are as follows:
[0079] Firstly, Docker, K8s and other technologies are used to deploy a seismic model training distributed cluster to realize the storage of different seismic data and the training of local seismic model weights. The local seismic model node can complete basic data storage, data cleaning, data preprocessing and other related data operations, and the local seismic model node can also develop various algorithm interfaces for different data set types to complete the test of corresponding algorithms on corresponding data sets and adjust the corresponding hyperparameters to provide better seismic model performance for federated learning.
[0080] 4) Node identity registration
[0081] All nodes in the system will achieve distributed node identity registration, distribute public and private key information, and enter the federal blockchain learning network by using the PKI key management architecture. The PKI key management architecture mainly consists of digital certificates, identity information public and private keys, certificate authorities, and certificate revocation lists. It is mainly used to verify the identity of different member nodes.
[0082] After identity registration and verification, the seismic model demand node will first generate a corresponding seismic model sharing transaction according to its model sharing content, and package a new main block. The microblocks generated during the local seismic model training process of the local seismic model node are connected after the main block.
[0083] For the specific process of each node device competing to generate a microblock during local seismic model training, the devices of the nodes participating in this local seismic model training are randomly initialized with three identities at the beginning of each microblock generation.
[0084] 5) Local seismic model weight training node, using local seismic data set, local model training.
[0085] This node is mainly responsible for training the seismic model using the existing local seismic data set, and transmitting the trained weight information to the verification seismic model weight node in communication with the blockchain system.
[0086] The verification seismic model weight node system is randomly assigned, and each local seismic model weight training node is randomly assigned only one verification seismic model weight node in communication with it. Similarly, the verification seismic model weight node can verify multiple local seismic model weight training nodes.
[0087] 6) Verification of seismic model weight node model parameters.
[0088] This node is mainly responsible for verifying the effectiveness of the seismic model parameters broadcast by the local seismic model training node in communication with it, and packaging the final verification result into a new transaction and signing it before broadcasting it to the packaged transaction block node in communication with it. The final audit is completed by the packaged transaction block node.
[0089] 7) Packaged transaction block node completes final seismic model weight sharing transaction summary and broadcasts its own packaged block.
[0090] This node is mainly responsible for accepting seismic model weight parameter transactions broadcast by the verification seismic model weight node in communication with it, broadcasting the transactions received by itself to other packaged transaction block nodes, and accepting transactions broadcast by other packaged transaction block nodes. Sign the final transaction queue to verify all transactions and package them into a block.
[0091] Finally, the self-packed block is broadcast to other packaged transaction block nodes, and the block broadcast by other packaged transaction block nodes is accepted, the final block right is determined according to the corresponding consensus protocol, and all packaged transaction block nodes broadcast the approved block selected by the final consensus protocol to the verification seismic model weight node in communication and the local seismic model weight training node to verify the block.
[0092] 8) Block verification, global parameter update, and record model training information.
[0093] After each local seismic model weight training node, verification seismic model weight node and packaged transaction block node determines to accept the final block, the block is verified, and after verification, it is added to the respective local blockchain, the chain is completed, and the corresponding federated learning weight aggregation algorithm is used to update the corresponding local global parameter model.
[0094] Finally, the global parameter update of the microblock ends, the operation of the following microblock is executed in the same update process, until the threshold of the model update is met, at this time the shared task ends, the latest microblock model weight information is returned to the model demand side node, and the microblock generated in this process is added to the main block of the record model sharing information request in the blockchain network, facilitating the traceability of the subsequent model.
[0095] Referring to Figure 2 The specific blockchain structure operated by the application, i.e. the basic information and transaction types contained in each type of block. For the main block, it mainly contains seismic model traceability transactions and seismic model training transactions. Among them, the seismic model traceability transaction mainly contains the content that the system generates a search transaction according to the unique identity id of the seismic model demand side node, and the transaction content includes identity ID and information such as main block microblock where the data model content is located to record the traceability of the seismic data model. The seismic model training transaction is generated when the system searches the seismic model demand side node initiated seismic data model sharing request and cannot be searched in the existing blockchain system, at this time the seismic model training transaction is generated, which mainly records the basic task content of the seismic model demand side node to share the data model, which is convenient for the local seismic model node to train the model according to the corresponding task demand combined with its corresponding local data set.
[0096] For the micro-block, the relevant transaction information related to the specific model content mainly includes valid seismic model parameter verification transactions and invalid seismic model parameter verification transactions. The valid seismic model parameter verification transactions mainly include transactions verified by the seismic model weight node, which contain the training information and parameter information of the local seismic model weight training node, and the transactions are verified by the seismic model weight node and then packaged with the signature information of the transaction out-block node.
[0097] The invalid seismic model parameter verification transactions mainly include transactions verified by the seismic model weight node, which contain the training information and parameter information of the local seismic model weight training node, and the transactions are verified by the seismic model weight node and then packaged with the signature information of the transaction out-block node.
[0098] In some embodiments of the present application, a seismic data model sharing and tracing method is also provided, which adopts the above-mentioned seismic data model sharing method based on blockchain and federated learning to share and trace the seismic data model. The seismic data model sharing and tracing method mainly includes two processes of seismic model tracing and seismic model sharing. The seismic model tracing process includes the following steps:
[0099] When the local seismic model node in the system retrieves a new seismic model sharing request existing in the existing blockchain, the system generates a seismic model tracing transaction to record the retrieved main block and micro-block position information about the seismic model in the newly generated main block;
[0100] The final training completed micro-block node information corresponding to the task in the blockchain is packaged, a new micro-block is generated and connected after the newly generated main block, and the seismic model weight in the final micro-block is returned to the seismic model demand side node;
[0101] After the new main block and micro-block generated by the tracing request are broadcast to other local seismic model nodes in the system and verified to be correct, they are added to the existing blockchain, and the version number is marked to facilitate subsequent retrieval of new seismic model sharing tasks according to the latest version number.
[0102] When no seismic model identical to the new seismic model sharing demand is retrieved in the blockchain system, a new training task of the shared seismic model will be performed, and the overall logical framework is as follows: Figure 3 The specific steps of the seismic model sharing training are as follows:
[0103] First, a distributed cluster for actual earthquake model training is deployed using technologies such as Docker and Kubernetes. Each cluster node utilizes database technologies such as MySQL and MongoDB, and open-source algorithm frameworks such as TensorFlow and PyTorch to complete corresponding data management and intelligent algorithm interfaces. This enables the storage of different earthquake data and the training of local earthquake model weights. A blockchain network is built by establishing communication connections between nodes through corresponding SSH services. On the local earthquake model cluster nodes, basic data storage, data cleaning, and data preprocessing can be performed. Various algorithm interfaces for different dataset types can also be developed locally, such as unsupervised learning algorithms like CAE, DAE, and VAE for extracting latent features and performing dimensionality reduction and clustering, or supervised learning algorithms like CNN for computer vision tasks and RNN for natural language processing. The corresponding algorithms can be tested locally on the corresponding earthquake datasets, and the hyperparameters can be adjusted to provide better model performance for federated learning.
[0104] After the deployment of local seismic model nodes using containerization technologies such as Docker, distributed node identity registration, public and private key information distribution, and entry into the federated blockchain learning network will be achieved through the use of the PKI key management architecture. The PKI key management system mainly consists of four parts: digital certificate, identity information public and private key, certificate authority, and certificate revocation list, which is mainly used to realize the identity verification between different seismic model nodes.
[0105] After identity registration and verification are completed, the earthquake data model request node will first generate the corresponding earthquake model training transaction based on its earthquake model shared content through the connected local earthquake model node, and package it to generate a new main block. The micro blocks generated during the model training process are then connected after this main block.
[0106] like Figure 4 As shown, Figure 4 This is the specific process by which local earthquake model node devices compete to generate micro-blocks during each round of earthquake model training: First, when generating micro-blocks in each round, the node devices participating in this earthquake model training will be randomly initialized with three identities, and these three identities will perform different duties.
[0107] In an embodiment of the present invention, the local earthquake model weight training node is mainly responsible for training the earthquake model using the existing local earthquake dataset. Its specific job responsibilities are as follows:
[0108] First, determine the earthquake model weight verification node and the block production node that communicate with the system for packaging earthquake model weight transactions. By default, there is only one node for each, and they are randomly assigned during system initialization.
[0109] The local seismic model weight training node performs local seismic model parameter updating, loads the latest global seismic model parameters in the current microblock, initializes as empty, obtains trained seismic model parameters by training using the local seismic training set, packs seismic model training transactions, signs the transactions with its own key, and transmits the transactions to the seismic models in communication therewith.
[0110] In the embodiments of the present application, for the verification seismic model weight node, the main responsibility is to verify the validity of the actual model parameters in the local seismic model weight training node in communication therewith, and the specific working responsibilities are as follows:
[0111] The verification seismic model weight node first determines the packed transaction block node in communication therewith, so as to facilitate subsequent transmission of the verified seismic model parameter transactions to the designated packed transaction block node.
[0112] The verification seismic model weight node arranges the model parameter transactions from different local model weight training nodes connected thereto in ascending order of the time of acceptance, and generates a final unverified seismic model parameter transaction queue.
[0113] Each verification seismic model weight node receives seismic model parameter transactions broadcasted by each other, each verification seismic model weight node locally receives a unique transaction from the local seismic model weight training node and the other verification seismic model weight nodes, and then sorts the transactions according to the time of acceptance, so that each verification seismic model weight node obtains a final unverified parameter transaction queue trained by the local seismic model weight node.
[0114] After the verification seismic model weight node obtains the final transaction queue, the verification seismic model weight node verifies the validity of the signature and the seismic model transaction parameters, and the verification method for the model parameters trained by the local seismic model weight training node is that the verification seismic model weight node first verifies the model accuracy using its own local test set, then compares the accuracy of the model trained in the local test set with the accuracy of the model trained in the test set, if the accuracy is less than a given threshold, the seismic model parameter transaction is considered valid, otherwise the transaction is considered invalid.
[0115] The final verification seismic model weight node sends the seismic model parameter transaction verified by itself to the packed seismic model parameter transaction block node associated therewith.
[0116] In the embodiments of the present application, for the packed seismic model parameter transaction block node, the main responsibility is to accept the seismic model parameter transactions transmitted by the verification seismic model weight node, verify the legality of the transactions, and pack and generate blocks, and the specific responsibilities are as follows:
[0117] The packaged seismic model parameter transaction block node will accept the to-be-audited transactions from different verification seismic model weight nodes connected thereto, arrange the accepted transactions in ascending order of time, and generate the final un-audited seismic model parameter transaction.
[0118] The packaged seismic model parameter transaction block node will broadcast the seismic model parameter transaction received by itself to other block nodes, and then the packaged seismic model parameter transaction block node will arrange the to-be-audited transactions of the verification seismic model parameter node and the broadcast transactions of other packaged seismic model parameter transaction block nodes in ascending order of time, determine the final seismic model parameter transaction queue to be audited, and divide the transactions into valid transactions and invalid transactions according to the validity of the verification transaction signature.
[0119] In the two types of transaction block packages, a random value is randomly selected to start mining, and when the packaged seismic model parameter transaction block node calculates a block that meets the corresponding difficulty value and successfully obtains the block, the block obtained by the node is propagated to other block nodes.
[0120] In the embodiments of the present application, when determining the identity of the final block, each packaged seismic model parameter transaction block node informs the verification seismic model parameter node and the packaged seismic model parameter transaction block node in communication to add the block to the block chain of their own system and wait for verification by other nodes.
[0121] At this time, after the local seismic model weight training node, the verification seismic model weight node, and the packaged seismic model parameter transaction block node determine the final block, the next step is to process the local seismic model weight training transaction verified by the verification seismic model weight node in the block, that is, the number of verifications and objections, to determine whether the weight of the local seismic model weight training transaction can be used for updating the global parameter. The local seismic model weight training transaction verified by the verification seismic model weight node is more than the local seismic model weight training transaction, which can be used for updating the global model parameter, and the corresponding local seismic model weight training reward is given, which is the number of training samples * unit reward, so as to encourage participants to use more sample data sets for training.
[0122] Global parameter updating is performed at each local seismic model node, each local model node obtains all node model parameter information of all local seismic model weight training in the corresponding local seismic model shared task in the local block chain, and each local model node adopts the FedAvg federated learning algorithm to aggregate the weights.
[0123] After the global parameter update of the microblock is completed, the operation of the subsequent microblock performs the same update process until the threshold of the model update is met, at which time the earthquake model sharing task is completed, the latest microblock model weight information is returned to the data requester, and the microblock generated in this process and the main block recording the model sharing information request are added to the blockchain network, facilitating the tracing of subsequent models.
[0124] In order to facilitate the use of the system, the blockchain + federated learning earthquake data model sharing platform is built by using the combination of Django+CSS+JS front-end and back-end frameworks, so that the updating of the latest local earthquake model node model algorithm and the publishing and tracing of the earthquake model sharing task can be conveniently performed through the interaction of the platform, and the interface is as shown in Figure 6 .
[0125] In the embodiment of the present application, for the numerical simulation result, the earthquake model sharing task uses the convolutional autoencoder earthquake data model trained by the distributed clusters to finally complete the parameter training of the global model, and finally each node can use the finally trained global model to extract the latent features of the earthquake data, and finally complete the clustering analysis of the local earthquake data set.
[0126] In the embodiment of the present application, when the local model of the distributed system node is trained, each local earthquake model node selects its own local earthquake data set, and uses the convolutional autoencoder neural network model structure specified in advance in the earthquake model training task as the shared earthquake network model this time.
[0127] As shown in the figure is the specific reconstruction diagram of the local earthquake model parameters submitted by one of the nodes when training the first microblock, the first row of pictures is the input local earthquake sample data graph, and the second row is the data graph reconstructed after the local autoencoder model training extracts features, it can be seen that only the local model training is performed, and due to the small sample size, the model cannot well extract the latent features of this type of data. Figure 6 is the reconstructed image of the node using the latest global model parameter model after aggregating all model weights, from which it can be seen that after aggregating the parameters of each node, the generalization performance of the model is obviously improved, and the reconstructed image information is obviously reduced, which indicates that the current autoencoder network can well extract the latent features of this type of earthquake data image, and the latent features extracted by the node using the trained global network are used for clustering analysis, and the model effect diagram before clustering of the client node is as shown in 7, Figure 8As shown in the diagram, the current client node performs clustering analysis on the data after using the latent features extracted by the aggregated autoencoder model. It can be clearly seen that the data features after dimensionality reduction by the autoencoder can be well used for clustering analysis. Ultimately, this enables the joint training of multi-node models without leaking local data privacy, achieving better model performance.
[0128] like Figure 7 The image shows the initialization interface for the global model parameter settings of the earthquake model platform. For global parameter settings, the number of client nodes participating in local training can be selected based on specific business needs. A specific application dataset and appropriate algorithm model can be selected based on specific business model sharing requirements. The blockchain information at the bottom displays basic information about the current blockchain system. For specific client node settings, the computing power of the client can be controlled to simulate different computing power scenarios for different applications. The amount of local training data used for training by each node can be set. Status attributes indicate whether the current client node is online or offline. Accuracy and loss indicate the accuracy and loss function obtained by each client using the final global parameters on the test set after this federated learning process. The reward is the block reward received by each client in this round of blocks, and the block height is the length of the system's blockchain at this time.
[0129] like Figure 8 The diagram illustrates the simulation of sharing this earthquake data model. It simulates a blockchain-based federated learning model sharing of the MNIST dataset, with 6 client nodes and a CNN training model. The reward for this task is 1000. The training progress is visualized, showing the training time. The rightmost side displays the accuracy of each client's training parameters on the test set, as well as the block reward for this round. Client 4 nodes are the block producers in this round, therefore their rewards are higher than other nodes.
[0130] In one embodiment, a computer device is also provided in the present invention, including at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor. The instructions are executed by the at least one processor to cause the at least one processor to perform the seismic data model sharing method based on blockchain and federated learning. When the processor executes the instructions, it implements the steps in the above-described method embodiments.
[0131] In one embodiment of the present invention, a storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method for sharing seismic data models based on blockchain and federated learning.
[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of each method can be included. Wherein, any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include at least one of non-volatile and volatile memory.
[0133] In summary, the method for sharing seismic data model based on blockchain and federated learning provided by the present application combines the two technologies of blockchain and federated learning together. Firstly, the blockchain technology is used to provide a consensus protocol based on proof of stake for sharing the seismic model, and the block reward is linked to the accuracy of the model of the participants. At the same time, more rewards are given to the participants who train the model well, and the rewards are determined by the number of training samples of the participants. In this way, on the one hand, the participation problem of the participants is solved, and on the other hand, the overall model performance is improved, the problem of lack of incentive mechanism for federated learning participants is solved, and the blockchain bifurcation is also avoided. On the other hand, the blockchain has the characteristics of immutability and traceability, and is an effective tool for preventing malicious attacks in federated learning. The real-time updates made by each participant to their local model can be linked to the distributed ledger provided by the blockchain, so that the model updates can be audited. Each model update, whether it is a local weight or a gradient, can be traced back to a single participant and associated with it, which helps to detect tampering attempts and malicious model replacement. After screening out the malicious nodes, they can be added to the blacklist of all nodes in the system, improving the robustness of the overall system. In addition, the weight update of the model is uploaded to the block in an encrypted manner, only the nodes registered in the system have the right to view, and the integrity of the model weight is guaranteed by the non-tamperability of the blockchain.
[0134] Finally, a new blockchain structure is adopted, which is divided into main blocks and micro blocks. The main blocks are mainly responsible for storing model sharing transaction requests and model traceability requests, while the micro blocks are connected to the main blocks to store the model training information or model traceability information related to the main blocks. This facilitates the quick retrieval of blockchain information and the acquisition of the latest model training information when there is a new model sharing demand next time. Finally, a data model sharing platform based on federated learning and blockchain is built based on the above innovations, which can quickly publish the latest model sharing tasks and model traceability requests on the platform.
[0135] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for sharing earthquake data models based on blockchain and federated learning, characterized in that, The method for sharing earthquake data models based on blockchain and federated learning includes the following steps: Based on the existing shared earthquake model on the data traceability blockchain, the requesting node of the shared earthquake model sends a request for the earthquake model to be shared to the blockchain; The local earthquake model node retrieves the historical records of the blockchain according to the earthquake model request. If the earthquake data sharing model requested by the earthquake model request has been trained in the existing blockchain historical records, the node returns the cached model as the result to the earthquake model requesting node. Model data sharing is carried out based on the newly established earthquake model sharing task. If the multi-party data sharing model task requested by the earthquake model demand node has not been trained, a new earthquake model training sharing request is generated, and the local earthquake model node related to the earthquake model training sharing request is selected for federated learning. The model obtained through federated learning is returned to the earthquake model requesting nodes, and the trained model results are uploaded to the blockchain; The earthquake data model sharing method based on blockchain and federated learning further includes a chain structure in the blockchain, wherein the original blocks are divided into main blocks and micro blocks, and each round of block competition produces one main block and multiple micro blocks; wherein the main block is used to index and record model sharing training tasks or model tracing, and the micro blocks are used to record shared model weight parameters related to the main block model; Each microblock contains two types of transactions: one type is transactions that verify the signature and are used to update the model weight parameters, and the other type is transactions that fail to verify the signature and are used to update the model weight parameters. The first microblock generated is connected to the main block. The main block contains one of the following: model sharing training transactions and model tracing transactions. When packaging transactions into a main block, the existing blockchain is queried based on the actual model sharing task. If the same training model exists in the existing blockchain, a model tracing main block is generated; otherwise, a model training main block is generated.
2. The earthquake data model sharing method based on blockchain and federated learning as described in claim 1, characterized in that, If the multi-party data sharing model task requested by the earthquake model requesting node has not been trained, a new earthquake model training sharing request will be generated, and an earthquake model tracing transaction will be generated to record the retrieved main block and micro block location information of the earthquake model and record it in the newly generated main block. The final trained micro-block information corresponding to the task in the blockchain is packaged to generate a new micro-block and connected to the newly generated main block. Finally, the seismic model weight information in the micro-block is returned to the seismic model requesting node.
3. The earthquake data model sharing method based on blockchain and federated learning as described in claim 1, characterized in that, In the aforementioned earthquake data model sharing method based on blockchain and federated learning, when no model matching the new earthquake model sharing requirement is found, an earthquake model sharing training task is performed. The earthquake model sharing training includes the following steps: Deploy a distributed cluster for earthquake model training using Docker and Kubernetes technologies, targeting the storage of different earthquake data and the training of local earthquake model weights; The local earthquake model node is used to perform basic data operations, including data storage, data cleaning, and data preprocessing. It is also used to develop algorithm interfaces for different dataset types, test the corresponding algorithms on the corresponding datasets, adjust the corresponding hyperparameters, and improve the performance of the earthquake model during federated learning.
4. The earthquake data model sharing method based on blockchain and federated learning as described in claim 3, characterized in that, In the earthquake data model sharing method based on blockchain and federated learning, all nodes register their distributed node identities and distribute public and private key information through a PKI key management architecture, and enter the federated blockchain learning network. The PKI key management system consists of four parts: digital certificate, identity information public and private keys, certificate authority, and certificate revocation list, which are used to verify the identities of different member nodes.
5. The earthquake data model sharing method based on blockchain and federated learning as described in claim 4, characterized in that, The earthquake data model sharing method based on blockchain and federated learning further includes: a local earthquake model weight training node, which uses a local earthquake dataset to train a local model; the local earthquake model weight training node is used to train an earthquake model locally using an existing local earthquake dataset, and transmits the trained weight information to the verification earthquake model weight node communicating with it in the blockchain system.
6. The earthquake data model sharing method based on blockchain and federated learning as described in claim 5, characterized in that, The earthquake data model sharing method based on blockchain and federated learning further includes: verifying the model parameters by verifying the earthquake model weight nodes. The earthquake model weight nodes are used to verify the validity of the earthquake model parameters broadcast by the local earthquake model training nodes that are communicating with them. After packaging the verification results into a new transaction and signing it, the transaction is broadcast to the corresponding transaction block-producing node, which then completes the final review.
7. The earthquake data model sharing method based on blockchain and federated learning as described in claim 6, characterized in that, The earthquake data model sharing method based on blockchain and federated learning further includes: the transaction block-producing node completes the final earthquake model weight sharing transaction summary and broadcasts its own packaged block; wherein, the transaction block-producing node is used to receive earthquake model weight parameter transactions broadcast by the corresponding earthquake model weight verification earthquake model weight node, broadcast the received transactions to other transaction block-producing nodes, and receive transactions broadcast by other transaction block-producing nodes, perform signature verification on the final transaction queue, and package all transactions into one block.
8. The earthquake data model sharing method based on blockchain and federated learning as described in claim 7, characterized in that, The method for sharing earthquake data models based on blockchain and federated learning also includes: block verification, global parameter update, and recording of model training information; wherein, after each local earthquake model weight training node, earthquake model weight verification node, and transaction block production node determines to accept the final block, they verify the block, add it to their respective local blockchain after verification, complete the on-chain process, and update the corresponding local global parameter model using the corresponding federated learning weight aggregation algorithm.