Model watermark generation method and model right confirmation method based on block chain
By generating and distributing model watermarks on the blockchain, combining smart contracts and secret sharing algorithms, the problem of model ownership verification in the existing technology is solved, and efficient and secure distribution and ownership verification of the model is realized to prevent model theft and tamper.
Patent Information
- Application Number
- CN202411486022.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2024-12-31
AI Technical Summary
The existing technology lacks a unified model ownership verification and trading platform, which makes it difficult to reliably verify model ownership, the model is easily stolen and unauthorized, and the hash-based verification mechanism is easily bypassed.
Using blockchain-based model watermark generation method and model rights confirmation method, model watermarks are generated and distributed on the blockchain through smart contracts, using the decentralized and immutable characteristics of blockchain, combined with secret sharing algorithms, to realize Distribution and ownership verification of model watermarks.
Enhanced the robustness and security of model ownership verification, prevent model tampering and misappropriation, and ensure the intellectual property protection of the model.
Smart Images

Figure CN119227029A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to blockchain data processing technology, and in particular to a model watermark generation method and a model right confirmation method based on blockchain. Background Art
[0002] Model ownership verification is an important means to protect the intellectual property rights of machine learning models and prevent piracy and illegal use. With the widespread application of intelligent models, especially in the commercial field, how to effectively verify the ownership of models has become a key issue.
[0003] One of the most notable problems is the lack of a unified model ownership verification and trading platform, which makes it difficult to reliably verify model ownership. The lack of a standardized platform to record and verify model ownership also makes it difficult for model developers to prove their legal ownership of the model, making the model easy to be stolen and copied, and unauthorized use and dissemination become common.
[0004] There are studies on using model watermarks and hash values to verify model ownership. In actual use, model watermark technology usually requires an authoritative third-party entity to ensure the credibility of the verification process. The centralized setting is susceptible to negative factors such as node fraud, opacity, and single point failure, and is not suitable as a large-scale ownership management platform. However, due to the complexity and high-dimensional characteristics of the model, malicious users only need to make minor modifications to the model without affecting the model performance to bypass the ownership confirmation mechanism, which seriously affects the effectiveness of model ownership verification. Summary of the invention
[0005] Based on this, the present invention aims to propose a model watermark generation method and a model ownership confirmation method based on blockchain. By combining the model watermark and the smart contract of blockchain, the model is represented on the blockchain through watermark information to achieve efficient and secure model watermark distribution, model ownership verification and model trading.
[0006] In a first aspect, the present invention provides a model watermark generation method based on blockchain, which is executed by a smart contract deployed on the blockchain, comprising:
[0007] A model watermark generation request initiated by a receiving terminal is received, the terminal is embedded with a model, and the model watermark generation request includes watermark extraction information for extracting a watermark from the model;
[0008] The hash value of the latest block on the chain is used as a random seed to generate a random number, which is used as the model watermark of the model on the terminal.
[0009] The model watermark is returned to the terminal, and the index relationship between the model watermark and the watermark extraction information is recorded.
[0010] Furthermore, returning the model watermark to the terminal includes:
[0011] Calculate the similarity between the currently generated model watermark and other generated model watermarks, and return the currently generated model watermark to the terminal when the similarity meets the set conditions.
[0012] In a second aspect, the present invention provides a model watermark generation method based on blockchain, which is executed by a smart contract deployed on the blockchain, comprising:
[0013] Receiving a model watermark generation request initiated by a server, the server is connected to at least two terminals participating in federated learning, and coordinates at least two terminals to jointly train the model, wherein the model watermark generation request includes watermark extraction information for extracting a watermark from the model;
[0014] The hash value of the latest block on the chain is used as a random seed to generate a random number, which is used as the model watermark of the network model on the terminal.
[0015] The model watermark is returned to at least two terminals, and the index relationship between the model watermark and the watermark extraction information is recorded.
[0016] Further, returning the model watermark to at least two terminals includes:
[0017] The similarity between the currently generated model watermark and other generated model watermarks is calculated, and when the similarity meets the set conditions, the currently generated model watermark is returned to at least two terminals.
[0018] Further, returning the model watermark to at least two terminals includes:
[0019] The model watermark is divided into watermark fragments using a secret sharing algorithm, and the watermark fragments are distributed to at least two terminals so that each terminal holds a watermark fragment.
[0020] Furthermore, the watermark extraction information includes a watermark embedding method and a watermark embedding position.
[0021] In a third aspect, the present invention provides a model confirmation method, which is executed by a smart contract deployed on a blockchain, comprising:
[0022] Respond to model confirmation requests initiated by users via terminals;
[0023] Extract the latest model watermark in the model according to the watermark extraction information, verify the consistency between the latest model watermark and the initial model watermark, and generate a verification result;
[0024] Return the confirmation result to the terminal according to the verification result;
[0025] Among them, the watermark extraction information is obtained and recorded on the chain through the model watermark generation request in the model watermark generation method of the first aspect or the second aspect mentioned above, and the initial model watermark is generated by the model watermark generation method of the first aspect or the second aspect mentioned above and recorded on the chain.
[0026] Furthermore, when the terminal participates in federated learning, before extracting the latest model watermark in the model according to the watermark extraction information, the following steps are included:
[0027] Send a model confirmation request to at least one other terminal participating in federated learning;
[0028] Accept the consent confirmation information returned by at least one terminal.
[0029] Furthermore, when the terminal participates in federated learning, the latest model watermark is extracted from the network model according to the watermark extraction information, and the consistency of the latest model watermark and the initial model watermark is verified, and the verification results generated include:
[0030] Decoding watermark fragments from at least two terminals according to watermark extraction information, and solving the latest model watermark using the watermark fragments based on a secret sharing algorithm;
[0031] Verify the consistency between the latest model watermark and the initial model watermark and generate verification results.
[0032] It can be seen from the above technical solutions that the present invention has the following beneficial effects:
[0033] The present invention provides a model watermark generation method and a model right confirmation method based on blockchain. The model watermark generation method combines the model watermark technology and the blockchain platform. A decentralized smart contract randomly generates a model watermark according to a model watermark generation request initiated by a user through a terminal. The model watermark uses the hash value of the latest block on the blockchain as a random seed, so that the model embedded in the terminal is represented on the blockchain through watermark information tokenization, and the blockchain does not need to store the complete model. On the basis of the model watermark generation, the model right confirmation method responds to the user's right confirmation request by the smart contract on the chain, extracts information according to the watermark saved in the previous watermark generation stage, and generates a model watermark based on the model watermark generation request. The latest watermark is extracted from the user's model and compared with the initially generated watermark, and the user's ownership of the model is verified based on the comparison result; a further embodiment supports multi-user collaborative training of the global model, thereby sharing the ownership of the global model; the method provided by the present invention utilizes the traceability and immutability of the blockchain to enhance the reliability and security of the intelligent model management platform, and the watermark is generated based on the block hash value of the blockchain and embedded in the model, so that the ownership information can be kept intact when the model is slightly modified, thereby enhancing the robustness of the model ownership verification and effectively avoiding the model theft caused by tampering with the model and bypassing the ownership confirmation mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0035] Figure 1 This is a schematic diagram of the architecture of the interaction between a terminal and a blockchain network provided by this application;
[0036] Figure 2 This is a schematic diagram of the architecture of the interaction between a terminal, a central server and a blockchain network provided by this application;
[0037] Figure 3 This is a flow chart of a method for generating a model watermark in smart contract execution provided by an embodiment of the present application;
[0038] Figure 4 This is another flow chart of a method for generating a model watermark in smart contract execution provided by an embodiment of the present application;
[0039] Figure 5 It is a flow chart of a model confirmation method implemented in a smart contract according to an embodiment of the present application;
[0040] Figure 6 This is an interactive flow chart of a single-point user interacting with a smart contract to complete model watermark generation and confirmation of ownership, provided in an embodiment of the present application;
[0041] Figure 7 This is an interactive flow chart provided by an embodiment of the present application for a user, a central server and a smart contract to interact to complete model watermark generation and right confirmation;
[0042] Figure 8 It is a model transaction interaction flow chart provided in an embodiment of the present application;
[0043] Fig. 9 It is a schematic diagram of the structure of a model watermark generation device provided in an embodiment of the present application;
[0044] Fig.10 It is a schematic diagram of the structure of another model watermark generation device provided in an embodiment of the present application;
[0045] Fig.11 It is a schematic diagram of the structure of a model title confirmation device provided in an embodiment of the present application;
[0046] Fig.12 This is a diagram of the electronic device architecture provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] Model watermarking is a technology used to protect the intellectual property rights of machine learning models and verify model ownership. By embedding a specific "watermark" in the model, it can effectively prevent model piracy or unauthorized use, and help model developers verify the legitimacy of their models. Embedding watermarks in models is usually done during the training process of the model, embedding specific tags or specific input-output pairs (i.e., trigger sets) into the model. The watermark is not easy to detect during the normal operation of the model, but the existence of the watermark can be proved by querying the model to obtain the expected output. When a copyright dispute occurs or the ownership of the model needs to be verified, the ownership of the model can be proved by inputting these special trigger sets and verifying whether the output matches the expected value of the watermark.
[0049] The development of artificial intelligence has made the use of machine learning models mainstream, but when trained models are disseminated to the public as a digital asset, they also face threats to developers' intellectual property rights such as unauthorized malicious copying, dissemination, and use. In order to effectively detect these malicious acts of infringement, an effective model ownership verification mechanism is necessary.
[0050] The following embodiments of the present invention provide a model watermark generation method and a model ownership confirmation method based on blockchain, combining the model watermark and the smart contract of blockchain, the model is represented on the blockchain through watermark information, and the blockchain-based mechanism realizes efficient and secure model watermark distribution, model ownership verification and model transaction.
[0051] See also Figure 1 In each embodiment provided by the present invention, the user 10 can directly interact with the smart contract deployed on the blockchain network 30 through the terminal 20, that is, the smart contract can be triggered by the user 10 through the instructions or requests initiated by the terminal 20 to execute certain programs or actions. The terminal 20 can be regarded as a node deployed on the blockchain network 30, or it can be a node independent of the blockchain network 30. Through the interaction between the terminal 20 and the blockchain network 30, processes such as watermark distribution, verification, model ownership verification, and model trading are completed.
[0052] Specifically, user 10 can complete model training and / or embedding on terminal 20. The model mentioned here refers to a mathematical model constructed using machine learning, deep learning or other artificial intelligence technologies, which can automatically learn patterns from data and make predictions or decisions.
[0053] The blockchain network 30 mentioned can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0054] The user 10 interacts with the blockchain network 30 through the terminal 20 to trigger the execution of the smart contract. Such a terminal 20 includes a smart phone, a tablet computer, a laptop computer, a desktop computer, a wearable device, a smart home, a head-mounted device, a server node, an Internet of Things device, and other smart terminals with data processing capabilities.
[0055] In some embodiments, user 10 may interact with blockchain network 30 through a server, in which case model training and / or embedding will be performed on the server.
[0056] In some embodiments, multiple users 10 can collaboratively train a model through their respective terminals 20. In this case, the multiple terminals 20 are coordinated by a central server, and the users 10 can interact with the blockchain network 30 through the central server. The central server can initiate requests such as watermark generation, ownership verification, model transactions, etc. to the blockchain network 30 based on the instructions initiated by the users through each terminal, and receive the information returned after the execution of the smart contract. The information generated after the execution of the smart contract can also be sent directly to the terminal according to the terminal address.
[0057] See also Figure 2 An embodiment of the present invention provides another interactive system, in which multiple users 10 jointly train a model through their respective terminals 20. The multiple terminals 20 are coordinated by a central server 40. The user 10 can initiate an interaction request to the central server 40 through the terminal 20, and the central server 40 and the blockchain network 30 complete the interaction process according to the request information of the user 10. The user 10 can still interact directly with the blockchain network 30 through the terminal 20.
[0058] See also Figure 3 An embodiment of the present invention introduces a model watermark generation method from the perspective of a blockchain network. The blockchain network is used as the execution end, and the process of watermark generation and distribution is performed by a smart contract deployed on the blockchain network, including the following steps:
[0059] Step S310: receiving a model watermark generation request initiated by a terminal, the terminal having a model embedded therein, and the model watermark generation request including watermark extraction information for extracting a watermark from the model.
[0060] Specifically, a model watermark generation request is sent by the user directly to the smart contract on the blockchain through the terminal. The request carries the watermark extraction information for extracting the watermark. The watermark extraction information is used to extract the watermark from the trained model during subsequent ownership verification. After the watermark is generated, the user embeds it into the model during the model training process for subsequent ownership verification and model transactions.
[0061] Watermark extraction information usually includes watermark embedding method, watermark embedding position, watermark extraction matrix, weight value of specific model layer, eigenvalue, model output, etc. In addition, users can also carry some auxiliary information in the request, such as terminal address information, user information, signature information, request timestamp, etc., to prevent the request from being tampered with or forged.
[0062] Step S320. Use the hash value of the latest block on the chain as a random seed to generate a random number, and the random number is used as the model watermark of the model on the terminal.
[0063] Specifically, when the smart contract is triggered by a user's request to generate a watermark, it accesses the blockchain node to obtain the hash value of the latest block. This hash value is the result of hash calculation of the latest block generated on the blockchain network, usually a 256-bit fixed-length binary number (such as SHA-256 used by Bitcoin or Ethereum). The block hash value is unique and random. The smart contract calls the random number generation algorithm to generate a deterministic pseudo-random number as the watermark of the model.
[0064] Step S330: Return the model watermark to the terminal, and record the index relationship between the model watermark and the watermark extraction information.
[0065] Specifically, in order to accurately model the watermark corresponding to the model during the ownership verification phase, the smart contract will execute the metadata recording process. After the watermark is generated and returned to the terminal, a new metadata is recorded on the chain. The metadata reflects the index relationship between the model watermark and the watermark extraction information, such as the data pair between the watermark information and the terminal address, model identifier, watermark embedding method, and watermark embedding position. When the user initiates a model ownership verification request, the smart contract first searches for the corresponding metadata from the metadata stored on the chain according to the terminal address or model identifier, and decodes the current latest watermark from the model according to the recorded watermark embedding method and watermark embedding position, and compares the consistency with the initially generated watermark.
[0066] In a further embodiment, in order to ensure that watermarks of different models do not conflict, the smart contract will also calculate the similarity between the currently generated model watermark and other generated model watermarks before returning the watermark to the terminal. When the similarity is within the tolerance range, the two watermarks may cause the same decoding results, thereby causing ownership verification conflicts of different models. Therefore, the latest generated watermark needs to have a certain difference from other generated watermarks.
[0067] Specifically, watermarks usually exist in the form of character strings, and the similarity between watermarks can be represented by the Hamming distance, which is used to measure the number of different characters or bits between two equal-length character strings or binary numbers. Assuming the number of watermark bits is n and the bit error rate tolerance is r, in an embodiment of the present invention, the condition can be set to when the minimum Hamming distance between two watermarks is 2rn, when it is met, the currently generated watermark is returned to the terminal.
[0068] After the user receives the watermark generated by the smart contract through the terminal, it will be embedded in the locally trained model as a model ownership identifier. The type and method of watermark embedding are determined by the user, and the relevant information is carried in the request when initiating a watermark generation request to the smart contract.
[0069] The above embodiment provides a model watermark generation method based on blockchain, which is usually completed by a single user directly interacting with the blockchain network. A decentralized smart contract randomly generates a model watermark according to a model watermark generation request initiated by the user through a terminal. The model watermark uses the hash value of the latest block on the blockchain as a random seed, so that the model embedded in the terminal is represented on the blockchain through the tokenization of the watermark information, and the blockchain does not need to store the complete network model.
[0070] See also Figure 4 An embodiment of the present invention introduces another model watermark generation method from the perspective of blockchain network. The blockchain network is used as the execution end, and the watermark generation and distribution process is executed by the smart contract deployed on the blockchain network. In this embodiment, multiple terminals jointly train the model, and the central server coordinates the model training and the interaction process between each terminal and the blockchain network regarding watermark generation, including the following steps:
[0071] Step S410. Receive a model watermark generation request initiated by the server, the server is connected to at least two terminals participating in federated learning, and coordinates at least two terminals to jointly train the model. The model watermark generation request includes watermark extraction information for extracting a watermark from the model.
[0072] In this step, at least two terminals collaborate to train the model. The terminals participate in the model training through local calculations without sharing their own data, and cooperate with the central server to embed watermarks. From the perspective of the blockchain network, in the step of watermark generation request, the smart contract does not directly interact with the user at a single point, but directly interacts with the central server and receives request information from the central server. Since federated learning involves multiple terminals, the model watermark generation request initiated by the central server will carry some necessary watermark extraction information, such as watermark embedding method, watermark embedding position, watermark extraction matrix, weight value of a specific layer of the model, eigenvalue, model output, etc., as well as the terminal information participating in federated learning, including the address information of each terminal, the local model identifier corresponding to each terminal, user information, etc. In addition, similar to the user's single point interaction with the smart contract, it can also carry auxiliary information, such as user signature, request timestamp, etc.
[0073] Step S420. Use the hash value of the latest block on the chain as a random seed to generate a random number, and the random number serves as the model watermark of the network model on the terminal.
[0074] Specifically, the smart contract is triggered by a request from the central server to execute watermark generation. By accessing the blockchain node, the hash value of the latest block is obtained. This hash value is the result of hash calculation of the latest block generated on the blockchain network. It is usually a fixed-length binary number of 256 bits (such as SHA-256 used by Bitcoin or Ethereum). The block hash value is unique and random. The smart contract calls the random number generation algorithm to generate a deterministic pseudo-random number as the watermark of the model.
[0075] In a further embodiment, similar to the aforementioned embodiment, in the scenario of terminal collaborative training model, in order to ensure that the generated watermark does not conflict with the watermarks of other models, the smart contract will also calculate the similarity between the currently generated model watermark and other generated model watermarks before returning the watermark to the terminal. When the similarity is within the tolerance range, the two watermarks may cause the same decoding results, thereby causing ownership verification conflicts of different models. Therefore, the current latest generated watermark needs to have a certain difference from other generated watermarks.
[0076] Specifically, watermarks usually exist in the form of character strings, and the similarity between watermarks can be represented by the Hamming distance, which is used to measure the number of different characters or bits between two equal-length character strings or binary numbers. Assuming the number of watermark bits is n and the bit error rate tolerance is r, in an embodiment of the present invention, the condition can be set to when the minimum Hamming distance between two watermarks is 2rn, when it is met, the currently generated watermark is returned to the terminal.
[0077] In some embodiments, after the smart contract generates a complete model watermark, since the watermark needs to be embedded in the local model corresponding to each terminal, the smart contract can use a secret sharing algorithm to divide the model watermark into watermark fragments, that is, regard the watermark as a secret shared between the terminals, and use the secret sharing algorithm to randomly generate different data pairs, which are the watermark fragments.
[0078] In the case where model watermark fragments need to be generated, the watermark similarity comparison needs to be performed before the watermark fragments are generated. That is, after the smart contract generates a complete model watermark, the similarity calculation is performed first. When the set similarity tolerance conditions are met, the complete model watermark is split into watermark fragments.
[0079] Step S430: Return the model watermark to at least two terminals, and record the index relationship between the model watermark and the watermark extraction information.
[0080] In this step, the smart contract returns the generated watermark directly to each terminal without being transferred through the central server. Each terminal embeds the received watermark or watermark fragment into the locally trained model as a model ownership identifier. The type and method of watermark embedding are determined by the user, and the relevant information is carried in the request when initiating a watermark generation request to the smart contract.
[0081] When the smart contract returns watermark fragments, the fragments it sends are random, that is, there is no need to determine the relationship between the terminal and the watermark fragments in advance. It only needs to ensure that the watermark fragments received by each terminal are different. During the ownership verification phase, the smart contract needs to decode enough watermark fragments from the terminals participating in federated learning to construct a complete model watermark.
[0082] Since the terminals jointly train a global model, each terminal actually trains a local model, so users have partial ownership of the global model on their respective terminals.
[0083] In order to accurately model the watermark corresponding to the model during the ownership verification phase, the smart contract will also perform the metadata recording process. Specifically, after the watermark or watermark fragment is generated and returned to the terminal, a new metadata is recorded on the chain. The metadata reflects the index relationship between the model watermark of the global model and the watermark extraction information of each terminal, such as the data pair between the watermark information and the terminal address, model identifier, watermark embedding method, and watermark embedding position. When the user initiates a model ownership verification request, the smart contract first searches for the corresponding metadata from the metadata stored on the chain according to the terminal address or model identifier, and decodes the current latest watermark fragment from the local model of each terminal according to the recorded watermark embedding method and watermark embedding position, and constructs a complete model watermark based on the decoded watermark fragments, and then compares the consistency with the initially generated watermark.
[0084] The above embodiment provides a blockchain-based model watermark generation method in a federated learning scenario. The request is directly initiated by a central server that coordinates each terminal to the blockchain network. The decentralized smart contract randomly generates a model watermark according to the model watermark generation request, further generates watermark fragments, and returns each watermark fragment directly to each terminal. The model watermark uses the hash value of the latest block on the blockchain as a random seed, so that the global model coordinated by the terminal for training is represented on the blockchain through the tokenization of watermark information, and the blockchain does not need to store the complete model.
[0085] Based on the model watermark generation method provided in the above embodiment, the following embodiment of the present invention will introduce a model confirmation method from the perspective of the blockchain network.
[0086] See also Figure 5 An embodiment of the present invention introduces a model confirmation method from the perspective of a blockchain network, with the blockchain network as the execution end, including the following steps:
[0087] Step S510: Respond to the model authentication request initiated by the user via the terminal.
[0088] Specifically, the model confirmation request is initiated by the user directly to the smart contract on the blockchain network through the terminal. The user can actively request confirmation after completing local training and sending model updates, or the terminal can automatically initiate the confirmation request periodically.
[0089] Step S520: extract the latest model watermark from the model according to the watermark extraction information, verify the consistency between the latest model watermark and the initial model watermark, and generate a verification result.
[0090] Specifically, the smart contract reads the metadata pair corresponding to the model from the chain, obtains information such as the watermark embedding method and embedding position, extracts the watermark from the latest model based on the watermark embedding method and embedding position, and determines the initial model watermark corresponding to the model address based on the index relationship, that is, the watermark generated by the smart contract in the model watermark generation stage.
[0091] In some embodiments, when the user initiates a watermark generation request during the watermark generation phase, the user has already carried information such as the watermark embedding generation method, watermark embedding position, watermark extraction matrix, weight values of specific layers of the model, eigenvalues, model output, etc. The smart contract can determine the corresponding information of the model from the metadata in this step. For example, the network layer where the watermark is located is determined according to the watermark embedding position, and then the corresponding decoding algorithm is used to use the watermark extraction matrix or specific input / output to verify whether the current latest watermark is consistent with the initial watermark. If they are consistent, the right confirmation is successful, otherwise the right confirmation fails.
[0092] In a further embodiment, after completing the watermark verification, the smart contract will also check whether the user information in the metadata stored on the chain is consistent with the user requesting the confirmation. If they are consistent, the confirmation is successful, otherwise the confirmation fails.
[0093] Step S530: Return the authentication result to the terminal according to the verification result.
[0094] In a further embodiment, when a user participates in federated learning and collaborates with other users to train a global model, he can directly initiate a confirmation request to the smart contract through his own terminal. At this time, since the user only owns partial ownership, when he initiates the confirmation request, the smart contract needs to send a confirmation request to other terminals participating in federated learning. Only after obtaining the consent of more than a certain number of users can a sufficient number of watermark fragments be decoded, thereby constructing a complete model watermark to complete ownership verification.
[0095] Specifically, for terminals participating in federated learning, what is embedded in the local model is watermark fragments rather than the complete model watermark. When a user sends a confirmation request to the blockchain network through the terminal, the smart contract deployed on the blockchain network responds to the request and sends a model confirmation request to at least one other terminal participating in federated learning. The request can carry some auxiliary information, such as the metadata of the model, such as the model version, model update history, etc. After receiving the request, other terminals can use the auxiliary information to confirm whether the model requested for confirmation is consistent with the model they jointly trained, and return the confirmation information to the blockchain network.
[0096] After receiving more than the set amount of consent confirmation information, the smart contract decodes the watermark fragments from the terminal that agrees to confirm the ownership according to the watermark extraction information, and then uses the watermark fragments to solve the latest model watermark based on the secret sharing algorithm. The ownership verification process after decoding the watermark is similar to that of the previous embodiment and will not be repeated here.
[0097] In a further embodiment, on the basis of ownership verification, the model ownership transfer, i.e., model transaction, can be completed through interaction with the smart contract. Specifically, when the smart contract completes the confirmation of the model for the first time, it can respond to the ownership transfer request or model transaction request initiated by the user through the terminal. The model holder carries the user address of both transaction users in the ownership transfer request or model transaction request. The smart contract modifies the correspondence between the model address or user address and the watermark extraction information in the metadata stored on the chain based on this information, and the user address in the metadata is modified to the current user address to complete the model ownership transfer or transaction.
[0098] In a further embodiment, the smart contract can directly respond to the ownership transfer request or model transaction request initiated by the user through the terminal, first verify the ownership of the model, and then directly modify the metadata after the ownership is confirmed to complete the model ownership transfer or transaction.
[0099] In a further embodiment, if a user participates in federated learning through a terminal, a local model is embedded locally. When requesting ownership transfer or transaction, the user can only transfer part of the ownership he owns, but cannot transfer the entire ownership of the global model.
[0100] The following is a further introduction to the blockchain-based model watermark generation method and model ownership confirmation method provided by this application through actual application scenarios.
[0101] See also Figure 6 ,An embodiment of the present application provides a single point user to interact with a smart contract deployed on the blockchain to complete the interactive process of model watermark generation and ownership verification.
[0102] Step S610: The user initiates a watermark generation request for model N to the smart contract on the blockchain through terminal 61.
[0103] Specifically, user A carries watermark extraction information such as watermark embedding method, watermark embedding position, watermark extraction matrix, weight value of specific layer of the model, eigenvalue, model output, etc. in the watermark generation request.
[0104] Step S620. The smart contract responds to the watermark generation request and uses the hash value of the latest block on the chain as a random seed to generate a random number, which serves as the model watermark of model N on terminal 61.
[0105] Step S630. The smart contract verifies whether the model watermark of model N conflicts with other watermarks generated previously. If there is no conflict, it goes to step S640. If there is a conflict, it returns to step S620 to regenerate the watermark.
[0106] Specifically, the Hamming distance is used to represent the similarity between watermarks. Taking the feature watermark as an example, let the number of watermark bits be n and the bit error rate tolerance be r. and The Hamming distance , the ownership of the model can still be confirmed, that is, different watermarks will produce the same decoding results within the fault tolerance range, resulting in model ownership conflicts. Therefore, the Hamming distance between model watermarks can be set to meet the following minimum distance requirements, namely:
[0107]
[0108] For watermarks embedded in other ways, the fault tolerance conditions of watermark similarity can be set accordingly. When the smart contract generates a new watermark for each model, it will calculate the similarity between it and other generated watermarks. When the fault tolerance conditions are met, the newly generated watermark will be returned to the terminal.
[0109] Step S640. The smart contract returns the model watermark to the terminal 61 and records the index relationship between the model watermark and the watermark extraction information on the chain.
[0110] Step S650: The user completes the training of model N and watermark embedding on terminal 61.
[0111] Specifically, the watermark is embedded into the model in the form of a bit string. For example, the user can embed it as a feature watermark or a backdoor watermark.
[0112] When embedded as a feature watermark, the goal of watermark embedding can be expressed as:
[0113]
[0114] in, represents the symbolic function, represents the decoding matrix, represents the embedded watermark, Represents the model parameters of the watermark embedding part, where and The specific corresponding part of the model parameters is determined by the user, and sent to the blockchain network through the watermark generation request during the watermark generation phase. This goal can be achieved by optimizing the following objective function:
[0115]
[0116] in, represents the loss function of the main task of the model, Represents model parameters. In the general optimization process, minimizing the loss function can improve the performance of the model on the main task. In order to embed watermark information while ensuring the performance of the model's main task, a watermark loss is added to the objective function. represents the trade-off parameter between the two losses, The larger the value, the more important the watermark embedding is in model training.
[0117] In some embodiments, users can also embed watermarks in the form of backdoor watermarks, which is a method that embeds a trigger in the model. When the input data contains this trigger, the model will produce a specific output. Backdoor watermarking technology uses the model's sensitivity to specific inputs to set an implicit condition outside of normal tasks to verify and track model ownership. To embed watermark information in the form of backdoor watermarks, you can construct a backdoor dataset that contains samples with triggers. When these samples are input into the model, the model will output a preset specific result. This specific output behavior serves as a manifestation of the watermark, and only the owner or a specific authorized person knows the existence and characteristics of the trigger. The backdoor dataset is constructed as follows:
[0118]
[0119] in, represents the original data set, represents the specific label that the model expects to output. Represents the embedded watermark information, It is a hyperparameter used to control the proportion of watermark information in the backdoor dataset. After completing the construction of the backdoor dataset, users can embed watermarks by optimizing the following objective function:
[0120]
[0121] Step S660: The user initiates a request for confirmation of ownership of model N to the smart contract on the blockchain through terminal 61.
[0122] Step S670. The smart contract extracts the latest model watermark in the model according to the watermark extraction information, verifies the consistency between the latest model watermark and the initial model watermark, and generates a verification result.
[0123] Specifically, the smart contract reads the metadata pair corresponding to the model from the chain, obtains information such as the watermark embedding method and embedding position, extracts the watermark from the latest model based on the watermark embedding method and embedding position, and determines the initial model watermark corresponding to the model address based on the index relationship, that is, the watermark generated by the smart contract in the model watermark generation stage.
[0124] For example, when a user embeds a watermark in a feature watermarking manner, the conditions for the smart contract to extract the latest model watermark and verify ownership are as follows:
[0125]
[0126] in, represents the decoding matrix, Indicates the watermark currently decoded in the model. Represents the model parameters of the watermark embedding part, where and The user sends a watermark generation request to the blockchain network during the watermark generation phase, and the smart contract can obtain the corresponding metadata pair by querying it on the chain.
[0127] If the user embeds the watermark as a backdoor, the conditions for successful ownership verification are:
[0128]
[0129] in, Represents the model to be confirmed. Indicates the fault tolerance rate.
[0130] Step S680. The smart contract returns the title confirmation result of model N to terminal 61.
[0131] In a further embodiment, the user initiates an ownership transfer request to the smart contract through terminal 61. The smart contract can complete the above-mentioned ownership verification and, if the model is confirmed, modify the user address in the metadata about model N recorded on the chain, thereby completing the ownership transfer of model N.
[0132] The data structure of the metadata recorded by the smart contract on the chain can be expressed as follows:
[0133] See also Figure 7 ,An embodiment of the present application provides a user, a central server and a smart contract deployed on the blockchain to ,complete the interactive process of model watermark generation and ownership verification.
[0134] In this embodiment, users A, B, and C perform federated learning through terminals 71, 72, and 73 respectively, and collaboratively train the global model P. The central server interacts with the smart contract to complete the generation and distribution of model watermarks, and the users interact with the smart contract to complete the model ownership verification and ownership transfer.
[0135] Step S710. User A joins federated learning through terminal 71.
[0136] Step S720. The central server initiates a watermark generation request for model P to the smart contract.
[0137] Specifically, the model watermark generation request initiated by the central server will carry some necessary watermark extraction information, such as watermark embedding method, watermark embedding position, watermark extraction matrix, weight value, eigenvalue, model output of specific model layers, etc. It will also carry the terminal information participating in federated learning, including the address information of each terminal, the local model identifier corresponding to each terminal, user information, etc. In addition, similar to the interaction between a user's single point and a smart contract, it can also carry auxiliary information, such as user signature, request timestamp, etc.
[0138] Step S730. The smart contract responds to the watermark generation request and uses the hash value of the latest block on the chain as a random seed to generate a random number, which is used as the model watermark of model P.
[0139] Step S740. The smart contract verifies whether the watermark of model P conflicts with other watermarks generated previously. If there is no conflict, it goes to step S750. If there is a conflict, it returns to step S730 to regenerate the watermark.
[0140] The conflict detection in this embodiment is similar to that in the previous embodiment, which will not be described in detail here. Please refer to the description of watermark conflict detection in the previous embodiment.
[0141] Step S750. The smart contract splits the watermark of model P into three watermark fragments.
[0142] Specifically, since model P is coordinated and trained by three terminals through federated learning, the smart contract uses a secret sharing algorithm to split the watermark into three watermark fragments and then distributes them to terminals 71~73.
[0143] Exemplarily, the task of N terminals collaboratively training the global model is defined as:
[0144]
[0145] in, is the global model parameter, is the local data set of terminal i, represents the sum of all terminal data sets, represents the experience loss on terminal i.
[0146] The secret sharing algorithm used by smart contracts is defined as follows:
[0147] For secret information m, a specific operation can be performed on it to obtain n secret fragments and handed over to n entities for storage. When at least t entities take out their own fragments, m can be restored, but it cannot be restored in other cases. If the secret m is encoded and mapped to a number, a prime number p>m is selected to construct the following polynomial:
[0148]
[0149] Take different numbers Substituting into the above polynomial we get , and each pair Assigned to each entity separately, and when recovering the secret m, use the t group Perform the following calculation to restore the secret m.
[0150]
[0151] On this basis, after the smart contract generates a watermark, it uses the secret sharing algorithm defined above to construct a polynomial , generate unique random numbers , substituting into the polynomial to get the output , data pair There are k watermark fragments in total, which are then randomly distributed to k terminals. In this embodiment, there are 3 terminals participating in federated learning, and the smart contract will generate 3 watermark fragments.
[0152] Step S760. The smart contract returns the model watermark to terminals 71~73, and records the index relationship between the model watermark and the watermark extraction information on the chain.
[0153] Specifically, the smart contract returns the generated watermark fragments directly to each terminal without the need for transfer through the central server. When the smart contract returns watermark fragments, the fragments it sends are random, that is, there is no need to determine the relationship between the terminal and the watermark fragments in advance. It only needs to ensure that the watermark fragments received by each terminal are different. During the ownership verification stage, the smart contract needs to decode enough watermark fragments from the terminals participating in federated learning to construct a complete model watermark.
[0154] For simplicity, Figure 7 It is not shown that the smart contract returns the model watermark fragments to the terminals 72 and 73, but those skilled in the art can still clarify this process based on the description of the various embodiments of the present invention.
[0155] Exemplarily, the following Table 1 illustrates the data structure of metadata recorded on the chain:
[0156] Table 1
[0157]
[0158] Step S770. The user completes the collaborative training of the model and the embedding of watermark fragments on the terminal.
[0159] Specifically, each terminal embeds the received watermark fragments into the locally trained model as a model ownership identifier, and the type and method of watermark embedding are determined by the user.
[0160] Step S780: User A initiates a request for confirmation of ownership of model P to the smart contract through terminal 71.
[0161] Step S790. The smart contract sends a model confirmation request to users B and C participating in federated learning.
[0162] Specifically, when a user participates in federated learning and collaborates with other users to train a global model, he can directly initiate a confirmation request to the smart contract through his own terminal. At this time, since the user only owns partial ownership, when he initiates the confirmation request, the smart contract needs to send a confirmation request to other terminals participating in federated learning. Only after obtaining the consent of more than a certain number of users can a sufficient number of watermark fragments be decoded, thereby constructing a complete model watermark to complete ownership verification.
[0163] Step S7100. Users B and C send consent confirmation information to the smart contract.
[0164] Specifically, for the terminals participating in federated learning, the local model embeds watermark fragments instead of the complete model watermark. When a user sends a confirmation request to the blockchain network through the terminal, the smart contract deployed on the blockchain network responds to the request and sends a model confirmation request to at least one other terminal participating in federated learning. The request can carry some auxiliary information, such as model metadata, such as model version, model update history, etc. After receiving the request, other terminals can use the auxiliary information to confirm whether the model requested for confirmation is consistent with the model they are co-training, and return the confirmation information to the blockchain network. For the case of using a secret sharing algorithm to generate watermark fragments, the smart contract can execute the ownership verification process when more than t users agree to the confirmation.
[0165] Step S7110. The smart contract decodes at least t watermark fragments from at least t terminals, constructs the watermark and verifies it.
[0166] Specifically, the smart contract decodes the watermark fragments from the terminal that agrees to confirm the rights and solves the polynomial defined in the secret sharing algorithm. ,calculate The secret m, that is, the watermark of the model P, is obtained, and then the watermark verification process is performed. The watermark consistency verification process is similar to that in the aforementioned embodiment. Please refer to the description of using the watermark for ownership verification in the aforementioned embodiment, which will not be repeated here.
[0167] Step S7120. The smart contract returns the confirmation result to the terminal that requests confirmation.
[0168] See also Figure 8An embodiment of the present application provides a model transaction process implemented based on the model confirmation interaction process provided in the above embodiment, where user A transfers the ownership of model Q to user B.
[0169] Step S810: User A initiates a model ownership transfer request to the smart contract deployed on the blockchain through the terminal.
[0170] Specifically, the ownership transfer request is initiated by user A directly to the smart contract through terminal 81. User A, the current holder of the model, carries the user addresses of both transfer users in the ownership transfer request, and also carries basic watermark extraction information, so that the smart contract can verify the ownership of the model before responding to the model ownership transfer, and determine that the user currently requesting to transfer the model is the user who owns the model. In addition, auxiliary information can also be carried in the request, such as model version, model update history, etc.
[0171] Step S820. The smart contract responds to the request and verifies the ownership of model Q.
[0172] Specifically, the smart contract queries the metadata about model Q stored on the chain based on the information in the request to confirm the ownership of the model. The specific confirmation process can refer to the description of the model confirmation part in the above embodiments, which will not be repeated here. When the model Q is confirmed, it means that the user who currently requests to transfer ownership is the user who holds the model, and the smart contract will execute the ownership transfer action.
[0173] Step S830. The smart contract modifies the metadata corresponding to model Q stored on the chain.
[0174] Specifically, the smart contract will execute the modification of the correspondence between the user address in the metadata and the watermark extraction information. The model ownership transfer or transaction can be completed by modifying the user address in the metadata to the current user address. In this embodiment, the user address in the metadata is modified to the user address of user B. At this time, the metadata has been modified to an index relationship between model Q, user B, and the watermark.
[0175] Step S840. The smart contract returns the model ownership transfer result to the user.
[0176] Specifically, the smart contract can return the result only to user A's terminal. User A can query the result through the terminal he holds. User B can also synchronize the model ownership transfer result through his terminal and embed model Q on any terminal he holds.
[0177] In some embodiments, the smart contract may also return the model ownership transfer result to both users A and B based on the user address in the request information initiated by the user in the aforementioned step S810.
[0178] In a further embodiment, when user A or B is a node participating in federated learning, the model ownership transferred by them only represents partial ownership of the global model. At this time, the model confirmation process required to execute the ownership transfer by the smart contract still needs to request consent for confirmation from other users or terminals participating in federated learning. The confirmation can only be completed after obtaining the consent of a sufficient number of users, thereby completing the transfer of partial ownership of user A or B.
[0179] The above disclosed method can be implemented by using various forms of equipment, so the present invention also discloses a model watermark generation device and a model authentication device corresponding to the above method, and specific embodiments are given below for detailed description.
[0180] See also Fig. 9 An embodiment of the present application provides a model watermark generation device based on blockchain, which is deployed in a blockchain network and includes:
[0181] A first request receiving unit 910 is configured to receive a model watermark generation request initiated by a terminal, the terminal having a model embedded therein, the model watermark generation request including watermark extraction information for extracting a watermark from the model;
[0182] The first watermark generation unit 920 is configured to use the hash value of the latest block on the chain as a random seed to generate a random number, and the random number is used as a model watermark of the model on the terminal;
[0183] The first watermark sending storage unit 930 is configured to return the model watermark to the terminal and record the index relationship between the model watermark and the watermark extraction information.
[0184] like Fig.10 As shown, an embodiment of the present application provides a model watermark generation device based on blockchain, which is deployed in a blockchain network and includes:
[0185] The second request receiving unit 1010 is configured to receive a model watermark generation request initiated by a server, the server is connected to at least two terminals participating in federated learning, and coordinates at least two terminals to jointly train a model, and the model watermark generation request includes watermark extraction information for extracting a watermark from the model;
[0186] The second watermark generation unit 1020 is configured to use the hash value of the latest block on the chain as a random seed to generate a random number, and the random number is used as a model watermark of the network model on the terminal;
[0187] The second watermark sending storage unit 1030 is configured to return the model watermark to at least two terminals and record the index relationship between the model watermark and the watermark extraction information.
[0188] See also Fig.11An embodiment of the present application provides a blockchain-based model confirmation device, which is deployed in a blockchain network and includes:
[0189] The confirmation response unit 1110 is configured to respond to a model confirmation request initiated by a user via a terminal;
[0190] The watermark extraction and verification unit 1120 is configured to extract the latest model watermark in the model according to the watermark extraction information, verify the consistency of the latest model watermark with the initial model watermark, and generate a verification result;
[0191] The authentication sending unit 1130 is configured to return the authentication result to the terminal according to the verification result;
[0192] Among them, the watermark extraction information is obtained by the aforementioned model watermark generation device and recorded on the chain, and the initial model watermark is generated by the aforementioned model watermark generation device and recorded on the chain.
[0193] The implementation principle and technical effects of the above-mentioned device provided in the embodiment of the present application are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment.
[0194] The alliance chain system provided in the embodiment of the present application can be applied to electronic devices. Fig.12 The hardware structure diagram of this electronic device is shown in FIG. Fig.12 , the hardware structure of the electronic device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0195] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0196] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0197] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
[0198] Among them, the memory stores a program, and the processor can call the program stored in the memory, and the program is used to: implement the various processing flows of the aforementioned alliance chain in the alliance chain cross-chain interaction solution based on the underlying chain, or, implement the various processing flows of the aforementioned underlying chain in the alliance chain cross-chain interaction solution based on the underlying chain.
[0199] An embodiment of the present application also provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to: implement the various processing flows of the aforementioned alliance chain in the alliance chain cross-chain interaction scheme based on the underlying chain, or, implement the various processing flows of the aforementioned underlying chain in the alliance chain cross-chain interaction scheme based on the underlying chain.
[0200] Those skilled in the art should understand that the various steps of the above disclosed method can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented with program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0201] These computing device executable programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0202] Certain aspects of the present invention include process steps and instructions described herein in the form of algorithms. It should be noted that the process steps and instructions of the present invention can be implemented in software, firmware and / or hardware, and when implemented by software, it can be downloaded, stored on different platforms used by various operating systems and operated from the platforms.
[0203] Those skilled in the art will understand that the structures shown in the accompanying drawings are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
[0204] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "possible design" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0205] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0206] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A model watermark generation method based on blockchain, characterized in that: The method is executed by a smart contract deployed on a blockchain, comprising: Receiving a model watermark generation request initiated by a terminal, wherein the terminal has a model embedded therein, and the model watermark generation request includes watermark extraction information for extracting a watermark from the model; The hash value of the latest block on the chain is used as a random seed to generate a random number, which is used as the model watermark of the model on the terminal; The model watermark is returned to the terminal, and an index relationship between the model watermark and the watermark extraction information is recorded.
2. The method according to claim 1, characterized in that The returning the model watermark to the terminal comprises: The similarity between the currently generated model watermark and other generated model watermarks is calculated, and when the similarity meets a set condition, the currently generated model watermark is returned to the terminal.
3. A model watermark generation method based on blockchain, characterized in that: The method is executed by a smart contract deployed on a blockchain, comprising: Receiving a model watermark generation request initiated by a server, the server being connected to at least two terminals participating in federated learning, coordinating the at least two terminals to jointly train a model, the model watermark generation request including watermark extraction information for extracting a watermark from the model; The hash value of the latest block on the chain is used as a random seed to generate a random number, which is used as the model watermark of the network model on the terminal; The model watermark is returned to the at least two terminals, and an index relationship between the model watermark and the watermark extraction information is recorded.
4. The method according to claim 3, characterized in that The returning the model watermark to the at least two terminals comprises: The model watermark is divided into watermark fragments by using a secret sharing algorithm, and the watermark fragments are randomly distributed to the at least two terminals so that each terminal holds a watermark fragment.
5. A model confirmation method, characterized in that: The method is executed by a smart contract deployed on a blockchain, comprising: Respond to model confirmation requests initiated by users via terminals; Extracting the latest model watermark in the model according to the watermark extraction information, verifying the consistency of the latest model watermark with the initial model watermark, and generating a verification result; Returning the authentication result to the terminal according to the authentication result; The watermark extraction information is obtained and recorded on the chain through the model watermark generation request in the model watermark generation method according to any one of claims 1 to 4, and the initial model watermark is generated by the model watermark generation method according to any one of claims 1 to 4 and recorded on the chain.
6. The method according to claim 5, characterized in that When the terminal participates in federated learning, before extracting the latest model watermark in the model according to the watermark extraction information, the method includes: Send a model confirmation request to at least one other terminal participating in federated learning; Accept the consent confirmation information returned by the at least one terminal.
7. The method according to claim 5, characterized in that When the terminal participates in federated learning, the latest model watermark is extracted from the network model according to the watermark extraction information, and the consistency of the latest model watermark and the initial model watermark is verified, and the verification result is generated, including: Decoding watermark fragments from at least two terminals participating in federated learning according to the watermark extraction information, and solving the latest model watermark using the watermark fragments based on a secret sharing algorithm; Verify the consistency of the latest model watermark with the initial model watermark and generate a verification result.
8. A model watermark generation device based on blockchain, characterized in that: The device is deployed in a blockchain network and includes: A first request receiving unit is configured to receive a model watermark generation request initiated by a terminal, the terminal having a model embedded therein, the model watermark generation request including watermark extraction information for extracting a watermark from the model; A first watermark generation unit is configured to use the hash value of the latest block on the chain as a random seed to generate a random number, and the random number is used as a model watermark of the model on the terminal; The first watermark sending storage unit is configured to return the model watermark to the terminal and record the index relationship between the model watermark and the watermark extraction information.
9. A model watermark generation device based on blockchain, characterized in that: The device is deployed in a blockchain network and includes: A second request receiving unit is configured to receive a model watermark generation request initiated by a server, the server is connected to at least two terminals participating in federated learning, and coordinates at least two terminals to jointly train a model, the model watermark generation request includes watermark extraction information for extracting a watermark from the model; The second watermark generation unit is configured to use the hash value of the latest block on the chain as a random seed to generate a random number, and the random number is used as a model watermark of the network model on the terminal; The second watermark sending storage unit is configured to return the model watermark to at least two terminals and record the index relationship between the model watermark and the watermark extraction information.
10. A model rights confirmation device based on blockchain, characterized in that: The deployment in the blockchain network includes: A confirmation response unit, configured to respond to a model confirmation request initiated by a user via a terminal; A watermark extraction and verification unit is configured to extract the latest model watermark in the model according to the watermark extraction information, verify the consistency of the latest model watermark with the initial model watermark, and generate a verification result; The authentication sending unit is configured to return the authentication result to the terminal according to the verification result; The watermark extraction information is obtained and recorded on the chain by the model watermark generation device as described in claim 8 or 9, and the initial model watermark is generated by the model watermark generation device as described in claim 8 or 9 and recorded on the chain.
Citation Information
Cited By
Model copyright evidence obtaining and authority control method based on multi-party cooperation
CN121456855A
