Model weight confirmation method and device based on blockchain and model fingerprint

By combining model fingerprint with blockchain, using Merkle tree and hash encryption technology, the concealment and attack resistance of model fingerprints are solved, and the secure storage and reliable traceability of model weights are achieved, and the credibility of model ownership authentication is enhanced.

CN120372704BActive Publication Date: 2025-08-29HANGZHOU JUNTONG FUTURE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510869757.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-08-29
Estimated Expiration
2045-06-26

AI Technical Summary

Technical Problem

The prior art has shortcomings in the concealment, attack resistance and error correction capabilities of model fingerprints, making it difficult to achieve secure storage and reliable traceability of model weights.

Method used

Combining model fingerprints with blockchain technology, hash encryption of the model weight summary through Merkle tree structure, and uploading them to the blockchain network for untampered recording, ensuring the uniqueness and security of the model fingerprint.

Benefits of technology

It realizes the immutability and trustworthy traceability of model fingerprints, enhances the reliability of model ownership authentication and the accuracy of content traceability, and supports efficient model verification and responsibility ownership.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372704B_ABST
    Figure CN120372704B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of machine learning, and specifically to a method and device for confirming model weight ownership based on blockchain and model fingerprints. The method compresses the model weights of each layer of the model network to obtain a model weight summary; hashes and records the generated model weight summary using a Merkle tree structure to obtain a model fingerprint record; and uploads the model fingerprint record to a blockchain network to verify the model fingerprint record. The present invention encrypts the model weights using a keyed hash encryption algorithm and constructs a model fingerprint in conjunction with a Merkle tree to generate a unique model fingerprint. The model fingerprint is then uploaded to the blockchain, combining the model fingerprint with blockchain technology to provide a secure storage environment for the model fingerprint, thereby enhancing the credibility of model ownership authentication and content traceability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning, and in particular to a method and device for confirming model weights based on blockchain and model fingerprints. Background Art

[0002] With the development of generative artificial intelligence technology, more and more application scenarios are emerging, especially in the generation of multimodal content such as text, images, audio and video. The widespread application of these technologies also brings many challenges in content traceability, verification and anti-counterfeiting, especially in terms of content authenticity and source reliability. Model fingerprints, as an important tool for model ownership authentication and historical tracing, can be achieved by directly encoding from the model weights or embedding them into part of the model output through a backdoor mode under specific input conditions. However, in the construction of the above process, there is the problem of how to achieve a model fingerprint that is concealed, resistant to cracking, and has error correction capabilities. Existing technologies have shortcomings in concealment, anti-attack capabilities, reliance on anonymity, lack of error correction mechanisms, and multimodal unification. Summary of the Invention

[0003] In order to improve the security and reliability of model traceability, model fingerprints are combined with blockchain technology. The decentralized, tamper-proof, and transparent characteristics of blockchain are utilized to provide a secure storage environment for model fingerprints, thereby enhancing the credibility of model ownership authentication and content traceability. The present invention provides a model weight confirmation method based on blockchain and model fingerprints, which includes the following steps:

[0004] Step S1: compress the model weights of each layer of the model network to obtain a model weight summary;

[0005] Step S2: Use the Merkle tree structure to hash and record the model weight summary generated each time to obtain the model fingerprint record;

[0006] Step S3: Upload the model fingerprint record to the blockchain network to verify the model fingerprint record.

[0007] Preferably, in step S1, the model weights of each layer of the model network are summarized and compressed to obtain a model weight summary, specifically:

[0008] Extract the weights of each layer of the model network; wherein the weights include all weight parameters and their associated bias terms;

[0009] Format all weight parameters and convert them into a unified data format;

[0010] Perform weighted averaging on all formatted weight parameters to obtain a compressed weight vector;

[0011] Performing dimensionality reduction processing on the compressed weight vector by principal component analysis to remove redundant information;

[0012] The model weight summary is obtained by training the autoencoder to take the dimensionality-reduced weight vector and metadata as input, compressing and decompressing them.

[0013] Preferably, in step S1, the step also includes generating the metadata while extracting the weights of each layer of the model network; wherein the metadata includes the dimension of the weight, data type, data source, and data extraction time.

[0014] Preferably, in step S2, the Merkle tree structure is used to hash and record the model weight summary generated each time to obtain a model fingerprint record, specifically:

[0015] The leaf nodes of the Merkle tree are set to represent the hash value of each model weight summary. The model weight summary is , and split it into n parts , the hash value of each part is H i , i is the index of the model weight summary;

[0016] The model weights are hashed according to the following formula:

[0017]

[0018] In the above formula, K represents the key, Represents the input, i.e., the i-th part of the model weight summary, ⊕ represents the bitwise XOR operation, opad represents the outer padding, which consists of 64 bytes of 0x5C, ipad represents the inner padding, which consists of 64 bytes of 0x36, Hash() represents the hash function, Indicates a concatenation operation;

[0019] According to the following formula, the adjacent hash values ​​are combined in pairs to generate the hash value of the new parent node.

[0020]

[0021] Repeat the above process until a unique root hash value H is finally obtained. root , which is recorded as the model fingerprint.

[0022] Preferably, in step S3, the model fingerprint record is uploaded to the blockchain network, thereby verifying the model fingerprint record, specifically:

[0023] Select a suitable blockchain network, encode the model fingerprint record as part of the blockchain transaction, broadcast it to the blockchain network, and generate a uniqueness function for the model fingerprint record on the blockchain network;

[0024] The model fingerprint record transaction of the node in the blockchain network is verified, and when the verification is successful, the model fingerprint record of the node is added to other nodes in the blockchain network.

[0025] The present invention also provides a model weight confirmation device based on blockchain and model fingerprint, which includes the following modules:

[0026] The model weight summary generation module is used to compress the model weights of each layer of the model network to obtain the model weight summary;

[0027] The model fingerprint record generation module is used to use the Merkle tree structure to hash and record the model weight summary generated each time to obtain the model fingerprint record;

[0028] The chain-up and verification module is used to upload the model fingerprint record to the blockchain network, thereby verifying the model fingerprint record.

[0029] Preferably, the model weight summary generation module is used to compress the model weights of each layer of the model network to obtain a model weight summary, specifically:

[0030] Extract the weights of each layer of the model network; wherein the weights include all weight parameters and their associated bias terms;

[0031] Format all weight parameters and convert them into a unified data format;

[0032] Perform weighted averaging on all formatted weight parameters to obtain a compressed weight vector;

[0033] Performing dimensionality reduction processing on the compressed weight vector by principal component analysis to remove redundant information;

[0034] The model weight summary is obtained by training the autoencoder to take the dimensionality-reduced weight vector and metadata as input, compressing and decompressing them.

[0035] Preferably, the model weight summary generation module also generates the metadata while extracting the weights of each layer of the model network; wherein the metadata includes the dimension of the weight, data type, data source, and data extraction time.

[0036] Preferably, the model fingerprint record generation module is used to use a Merkle tree structure to hash and record the model weight summary generated each time to obtain a model fingerprint record, specifically:

[0037] The leaf nodes of the Merkle tree are set to represent the hash value of each model weight summary. The model weight summary is , and split it into n parts , the hash value of each part is H i , i is the index of the model weight summary;

[0038] The model weights are hashed according to the following formula:

[0039]

[0040] In the above formula, K represents the key, Represents the input, i.e., the i-th part of the model weight summary, ⊕ represents the bitwise XOR operation, opad represents the outer padding, which consists of 64 bytes of 0x5C, ipad represents the inner padding, which consists of 64 bytes of 0x36, Hash() represents the hash function, Indicates a concatenation operation;

[0041] According to the following formula, the adjacent hash values ​​are combined in pairs to generate the hash value of the new parent node.

[0042]

[0043] Repeat the above process until a unique root hash value H is finally obtained. root , which is recorded as the model fingerprint.

[0044] Preferably, the chain-up and verification module is used to upload the model fingerprint record to the blockchain network, thereby verifying the model fingerprint record, specifically:

[0045] Select a suitable blockchain network, encode the model fingerprint record as part of the blockchain transaction, broadcast it to the blockchain network, and generate a uniqueness function for the model fingerprint record on the blockchain network;

[0046] The model fingerprint record transaction of the node in the blockchain network is verified, and when the verification is successful, the model fingerprint record of the node is added to other nodes in the blockchain network.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] First, the present invention encrypts the model weights through a keyed hash encryption algorithm, and combines the Merkle tree to construct a model fingerprint to generate a unique model fingerprint. The model fingerprint is uploaded to the blockchain to achieve tamper-proof records. This process integrates multiple technologies such as model weights, keys, hash encryption and blockchain to ensure the uniqueness and security of the fingerprint.

[0049] Second, the present invention combines model fingerprints with blockchain, utilizing the decentralized, tamper-proof and transparent characteristics of blockchain to provide a secure storage environment for model fingerprints, thereby enhancing the credibility of model ownership authentication and content traceability. By storing model fingerprints on the blockchain, any modification or use of the model can be recorded and verified in real time, ensuring that the source and history of each generated content can be traced, and building an efficient and reliable traceability method to meet multiple technical functional requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:

[0051] Figure 1 This is a flow chart of the model weight confirmation method based on blockchain and model fingerprint provided by the present invention.

[0052] Figure 2 It is the process of generating model fingerprint records.

[0053] Figure 3 This is a structural diagram of the model weight confirmation device based on blockchain and model fingerprint provided by the present invention. DETAILED DESCRIPTION

[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. It will be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0055] The terms "comprise," "comprising," and "having," and any variations thereof, as used herein, are intended to cover non-exclusive inclusions. For example, a process, method, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0056] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0057] See also Figure 1 As shown, the present invention provides a model weight confirmation method based on blockchain and model fingerprint, which includes the following steps:

[0058] Step S1: Summarize and compress the model weights of each layer of the model network to obtain a model weight summary. This step simplifies the calculation of the model fingerprint and summarizes and compresses the model weights of each layer of the model network to reduce the amount of data and improve subsequent processing efficiency.

[0059] Furthermore, in step S1, the model weights of each layer of the model network are summarized and compressed to obtain a model weight summary, specifically:

[0060] Extract the weights of each layer of the model , where W i Represents the network weight of the i-th layer of the model, and the weight includes all weight parameters and their related bias terms to ensure the integrity and accuracy of the data; specifically, the weight parameters in the deep learning model are extracted layer by layer to ensure that the extracted content completely covers the core parameters and related bias terms of each layer, thereby ensuring the integrity and accuracy of the data in the subsequent processing process. For various neural network layers in the deep learning model (such as convolutional layers, fully connected layers, etc.), it is necessary to extract the network weight W after training. i The network weights of each layer should include the following two parts: core parameters, such as convolution kernel weights and fully connected layer weights, which are the key manifestation of the model's learning ability; bias, which is used to adjust the neuron output and is an important supplement to the model's expressiveness;

[0061] Format all weight parameters, i.e. ,in Indicates that the original extracted weight parameter set W is uniformly converted into a standardized data format structure, thereby converting all weight parameters into a unified data format for subsequent processing; the extracted weight parameters are converted into a unified data format to facilitate subsequent compression, dimensionality reduction, and fingerprint generation processes; since the weights of different network layers differ in dimension and structure, they need to be standardized; specifically, the Reshape or Flatten operation can be used to uniformly convert the weights of each network layer into a one-dimensional vector or a two-dimensional matrix in a unified format, thereby constructing a weight set with consistent structure and easy processing; the above process ensures the comparability and compatibility of cross-layer weights in subsequent processing;

[0062] All weight parameters of the formatted data are weighted averaged to achieve dimensionality compression and generate a more compact weight vector representation. This helps reduce data redundancy and improve the efficiency of subsequent feature extraction and fingerprint generation. Preferably, the average pooling downsampling method can be used to perform regional aggregation on the weight matrix after data format conversion to reduce the dimension while retaining the main feature information. The process of the above downsampling method is as follows: , thus obtaining the compressed weight vector; among them, Represents the compressed weight vector, Downsample() represents the weighted average calculation;

[0063] In order to further compress the data size and remove redundant information, the compressed weight vector is subjected to dimensionality reduction processing through principal component analysis (PCA) to remove redundant information and achieve effective dimensionality reduction. PCA is a classic linear dimensionality reduction method that can extract the most representative principal components from high-dimensional data, while reducing the dimensionality and retaining the main variation information in the original data to the maximum extent. Specifically, let the input be the downsampled weight vector W of multiple models or multiple layers downsample , project it into a low-dimensional subspace through PCA, and output the weight representation W after dimensionality reduction PCA , the above dimensionality reduction process can be expressed as: , where W downsample Represents the weight vector set after weighted average downsampling, W PCA represents the low-dimensional feature representation obtained after PCA dimensionality reduction, and PCA() represents principal component analysis. The above process not only improves data processing efficiency, but also provides a more compact and discriminative feature basis for subsequent tasks such as model fingerprint extraction and similarity measurement.

[0064] Autoencoder can be used to abstract and compress the fused information. Autoencoder is an unsupervised neural network structure that can map input data to a low-dimensional latent space through learning while retaining its key features. Specifically, the weight vector W after dimensionality reduction is PCA The corresponding metadata is used as a joint input and input into the trained autoencoder model for encoding to generate a compressed weight summary representation. , the above process can be expressed as , where Encoder() represents the encoder part of the autoencoder, which is used to extract low-dimensional abstract features of the input data, and the compressed weight summary represents It has higher compactness and discriminability.

[0065] Through the above process, the original high-dimensional weights are compressed into low-dimensional feature vectors with semantic expression capabilities, providing an efficient and robust representation basis for subsequent tasks such as model fingerprint generation, similarity measurement, and model recognition.

[0066] Furthermore, in step S1, it also includes generating metadata while extracting the weights of each layer of the model network; wherein the metadata includes the dimension, data type, data source, and extraction time of the weights, that is, , where d represents the dimension of the weight, t represents the data type, s represents the data source, and τ represents the extraction time. These metadata provide necessary background information for subsequent model fingerprint construction and verification.

[0067] While extracting and processing weight parameters, it is necessary to synchronously generate metadata information (Metadata) associated with them to record the context and attribute characteristics of the data. These metadata provide a structural description of the weight vector, which is helpful for subsequent tasks such as model fingerprint construction, traceability analysis, and consistency verification. Typical metadata content includes but is not limited to: dimension information d, which represents the original or reduced dimension of the weight vector; data type t, which identifies the format type of the weight data, such as float32, int8, sparse matrix, etc.; data source s, which records the model name, layer number, or training task to which the weight belongs; extraction time τ, which marks the timestamp when the weight parameter is extracted or processed to facilitate version control and traceability. These metadata not only provide background support for the structured representation of model fingerprints, but also play a key role in application scenarios such as data comparison, model consistency verification, and anomaly detection.

[0068] Step S2: Use the Merkle tree structure to hash and record the model weight summary generated each time to obtain the model fingerprint record.

[0069] In this stage, the Merkle tree structure is used to hash and record the model weight summary generated each time, thereby constructing a model fingerprint index. The Merkle tree structure can effectively ensure the integrity and non-tamperability of the model fingerprint record, and is of great significance in applications such as model authentication, version tracking, and security auditing.

[0070] Furthermore, in step S2, the Merkle tree structure is used to hash and record the model weight summary generated each time to obtain a model fingerprint record, specifically:

[0071] The leaf nodes of the Merkle tree are set to represent the hash value of each model weight summary. The model weight summary is , and split it into n parts , the hash value of each part is H i , i is the index of the model weight summary; preferably, in order to improve security, a keyed hash encryption algorithm (Hashed Message Authentication Code, HMAC) is used to encrypt the model weight summary of each layer in the model to ensure the integrity and tamper-proofness of the weight. The process is as follows Figure 2 As shown,

[0072] The model weights are hashed according to the following formula:

[0073]

[0074] In the above formula, K represents the key used to generate the hash signature. Represents the input, i.e., the i-th part of the model weight summary (i.e., the i-th model weight summary fragment), which is used as the input message m, ⊕ represents the bitwise exclusive OR operation (XOR), opad represents the outer padding, which consists of 64 bytes of 0x5C, ipad represents the inner padding, which consists of 64 bytes of 0x36, Hash() represents the hash function, such as SHA-256, Represents a concatenation operation, that is, a concatenation operation of strings or byte sequences;

[0075] After completing the hash calculation of the leaf node of the Merkle tree, the bottom-up approach is continued, and the two adjacent hash values ​​are combined in pairs to generate the corresponding parent node hash value through the hash function. The above process is continuously recursive until the unique root node hash value (MerkleRoot) is constructed. The above process can be expressed as follows:

[0076]

[0077] Among them, H i and H i+1 , are two adjacent hash values, Hi,i+1 is the hash value of the merged parent node, Hash() represents a hash function, such as SHA-256; the above process will continue until a unique root node hash value H is constructed root , which serves as a global summary of the entire model weight state and is used for subsequent integrity verification and unique identification of model fingerprints.

[0078] Root node hash value H root It is the only representation of the entire model weight summary, which has the following key features: First, integrity verification, by comparing the calculated H root Whether it is consistent with the stored value can quickly verify whether the model fingerprint has been tampered with; second, immutability, due to the anti-collision property of the hash function and the hierarchical dependency of the Merkle tree structure, any slight change in any leaf node (model weight summary fragment) will cause the final root hash value to change; third, traceability, by verifying the hash path (Merkle Path) from a leaf node to the root node to confirm whether it belongs to the original model, supporting local verification and traceability analysis; fourth, efficiency, the computational complexity of the verification process is O(logn), which is suitable for fast consistency verification of large-scale models. Therefore, the above method not only ensures the security and credibility of the model fingerprint, but also provides an accurate tracking and verification mechanism for changes in model weights. Once any change occurs in the model weight, the corresponding hash path and the final root node hash value H root will change, thereby ensuring the integrity and traceability of the model fingerprint.

[0079] Step S3: Upload the model fingerprint record to the blockchain network to verify the model fingerprint record. This process aims to upload the generated model fingerprint information to the blockchain network to ensure the uniqueness and immutability of the fingerprint record, and provide a credible basis for subsequent model verification, version traceability and responsibility attribution.

[0080] Furthermore, in step S3, the model fingerprint record is uploaded to the blockchain network to verify the model fingerprint record, specifically:

[0081] Select a suitable blockchain network that has high security, decentralization and non-tamperability to ensure the security and reliability of the model fingerprint, and set the selected blockchain network as BC. root As key data uploaded to the blockchain network BC, the process involves encoding the fingerprint data as part of the blockchain transaction and broadcasting it to all nodes in the network to achieve global consensus and permanent record. Specifically, the model fingerprint record is encoded as part of the blockchain transaction and broadcasted to the blockchain network, that is, , represents T transaction (i.e., the generated blockchain transaction), It represents the function of creating a transaction and generates a unique function for recording the model fingerprint in the blockchain network.

[0082] With the tamper-proof nature of blockchain, once the model fingerprint is successfully recorded in the blockchain network, it becomes a permanent and unchangeable on-chain record. This mechanism effectively guarantees the uniqueness and authority of the model fingerprint. Specifically, any change to the model weight or structure will result in its root hash value H root Therefore, each fingerprint hash value recorded on the chain uniquely corresponds to a specific model state, ensuring the unforgeability and verifiability of the model fingerprint. The above uniqueness can be formally expressed as follows:

[0083]

[0084] in, Represents the model fingerprint uniqueness verification function, if the root hash value H root If the model fingerprint already exists in the blockchain, true is returned, indicating that the model fingerprint has been uniquely recorded. Through this mechanism, the uniqueness of the model fingerprint can not only be trusted and verified on the chain, but also provide a solid foundation for intellectual property protection, version management, and accountability of AI models.

[0085] Nodes in the blockchain network perform consensus verification on the model fingerprint transaction T to ensure its validity, including the integrity and correctness of the fingerprint data. Once the transaction is verified, the model fingerprint will be packaged into a new block and added to the main chain of the blockchain, forming an immutable on-chain record. This process can be formally expressed as:

[0086]

[0087] Here, BC represents the current blockchain state, T represents the model fingerprint transaction to be verified, and addBlock() represents a new function that packages the transaction and adds it to the blockchain. This process ensures the formal registration of the model fingerprint on the chain, providing a trusted foundation for subsequent verification and traceability.

[0088] Once a model fingerprint is recorded on the blockchain, any third party can verify its authenticity and trace its history through on-chain data. The blockchain's transparency and immutability make model fingerprints highly verifiable and auditable. This verification and traceability process includes verifying the model fingerprint's existence on the blockchain, checking the completeness and validity of its corresponding transaction records, and tracking the historical versions and evolution of the model fingerprint.

[0089] The above operations can be achieved through the following functions:

[0090]

[0091] Among them, verify() represents the function used to verify the authenticity and consistency of the model fingerprint, and trace() represents the function used to trace the historical change path of the model fingerprint on the blockchain.

[0092] See also Figure 3 As shown, the present invention provides a model weight confirmation device based on blockchain and model fingerprint, which includes the following modules:

[0093] The model weight summary generation module is used to compress the model weights of each layer of the model network to obtain the model weight summary;

[0094] The model fingerprint record generation module is used to use the Merkle tree structure to hash and record the model weight summary generated each time to obtain the model fingerprint record;

[0095] The chain-up and verification module is used to upload the model fingerprint record to the blockchain network to verify the model fingerprint record.

[0096] Furthermore, the model weight summary generation module is used to compress the model weights of each layer of the model network to obtain a model weight summary, specifically:

[0097] Extract the weights of each layer of the model; the weights include all weight parameters and their associated bias terms;

[0098] Format all weight parameters and convert them into a unified data format;

[0099] Perform weighted averaging on all formatted weight parameters to obtain a compressed weight vector;

[0100] The compressed weight vector is subjected to dimensionality reduction processing through principal component analysis to remove redundant information;

[0101] The model weight summary is obtained by training the autoencoder to take the dimensionality-reduced weight vector and metadata as input, compressing and decompressing them.

[0102] Furthermore, the model weight summary generation module also generates metadata while extracting the weights of each layer of the model network; the metadata includes the dimension of the weight, data type, data source, and data extraction time.

[0103] Furthermore, the model fingerprint record generation module is used to use the Merkle tree structure to hash and record the model weight summary generated each time to obtain a model fingerprint record, specifically:

[0104] The leaf nodes of the Merkle tree are set to represent the hash value of each model weight summary. The model weight summary is , and split it into n parts , the hash value of each part is H i , i is the index of the model weight summary;

[0105] The model weights are hashed according to the following formula:

[0106]

[0107] In the above formula, K represents the key, Represents the input, i.e., the i-th part of the model weight summary, ⊕ represents the bitwise XOR operation, opad represents the outer padding, which consists of 64 bytes of 0x5C, ipad represents the inner padding, which consists of 64 bytes of 0x36, Hash() represents the hash function, Indicates a concatenation operation;

[0108] According to the following formula, the adjacent hash values ​​are combined in pairs to generate the hash value of the new parent node.

[0109]

[0110] Repeat the above process until a unique root hash value H is finally obtained. root , which is recorded as the model fingerprint.

[0111] Furthermore, the chain-up and verification module is used to upload the model fingerprint record to the blockchain network, thereby verifying the model fingerprint record, specifically:

[0112] Select a suitable blockchain network, encode the model fingerprint record as part of the blockchain transaction, broadcast it to the blockchain network, and generate a unique function for the model fingerprint record in the blockchain network;

[0113] Verify the model fingerprint record transaction of the node in the blockchain network. When the verification is successful, the model fingerprint record of the node is added to other nodes in the blockchain network.

[0114] The operation and effect of the model weight confirmation device based on blockchain and model fingerprint of the present invention are corresponding to and consistent with the above-mentioned model weight confirmation method based on blockchain and model fingerprint. The model weight confirmation device based on blockchain and model fingerprint will not be repeated here.

[0115] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using a general-purpose hardware platform, or alternatively, through a combination of hardware and software. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it, and other embodiments may also be used. Although the present invention has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. The model weight confirmation method based on blockchain and model fingerprint is characterized by: The method comprises the following steps: Step S1: compress the model weights of each layer of the model network to obtain a model weight summary; Step S2: Use the Merkle tree structure to hash and record the model weight summary generated each time to obtain the model fingerprint record, specifically: The leaf nodes of the Merkle tree are set to represent the hash value of each model weight summary. The model weight summary is , and split it into n parts , the hash value of each part is Hi, i is the index of the model weight summary; The model weights are hashed according to the following formula: In the above formula, K represents the key, Represents the input, i.e., the i-th part of the model weight summary, ⊕ represents the bitwise XOR operation, opad represents the outer padding, which consists of 64 bytes of 0x5C, ipad represents the inner padding, which consists of 64 bytes of 0x36, Hash() represents the hash function, Indicates a concatenation operation; According to the following formula, the adjacent hash values ​​are combined in pairs to generate the hash value of the new parent node. Repeat the above process until a unique root hash value Hroot is finally obtained, which is used as the model fingerprint record; Step S3: Upload the model fingerprint record to the blockchain network to verify the model fingerprint record.

2. The method according to claim 1, characterized in that In step S1, the model weights of each layer of the model network are summarized and compressed to obtain the model weight summary, which is specifically: Extract the weights of each layer of the model network; wherein the weights include all weight parameters and their associated bias terms; Format all weight parameters and convert them into a unified data format; Perform weighted averaging on all formatted weight parameters to obtain a compressed weight vector; Performing dimensionality reduction processing on the compressed weight vector by principal component analysis to remove redundant information; The model weight summary is obtained by training the autoencoder to take the dimensionality-reduced weight vector and metadata as input, compressing and decompressing them.

3. The method according to claim 2, characterized in that In step S1, it also includes generating the metadata while extracting the weights of each layer of the model network; wherein the metadata includes the dimension of the weight, data type, data source, and data extraction time.

4. The method according to claim 1, wherein In step S3, the model fingerprint record is uploaded to the blockchain network to verify the model fingerprint record, specifically: Select a suitable blockchain network, encode the model fingerprint record as part of the blockchain transaction, broadcast it to the blockchain network, and generate a uniqueness function for the model fingerprint record on the blockchain network; The model fingerprint record transaction of the node in the blockchain network is verified, and when the verification is successful, the model fingerprint record of the node is added to other nodes in the blockchain network.

5. The model weight confirmation device based on blockchain and model fingerprint is characterized by: The model weight summary generation module is used to compress the model weights of each layer of the model network to obtain the model weight summary; The model fingerprint record generation module is used to use the Merkle tree structure to hash and record the model weight summary generated each time to obtain the model fingerprint record, specifically: The leaf nodes of the Merkle tree are set to represent the hash value of each model weight summary. The model weight summary is , and split it into n parts , the hash value of each part is Hi, i is the index of the model weight summary; The model weights are hashed according to the following formula: In the above formula, K represents the key, Represents the input, i.e., the i-th part of the model weight summary, ⊕ represents the bitwise XOR operation, opad represents the outer padding, which consists of 64 bytes of 0x5C, ipad represents the inner padding, which consists of 64 bytes of 0x36, Hash() represents the hash function, Indicates a concatenation operation; According to the following formula, the adjacent hash values ​​are combined in pairs to generate the hash value of the new parent node. Repeat the above process until a unique root hash value Hroot is finally obtained, which is used as the model fingerprint record; The chain-up and verification module is used to upload the model fingerprint record to the blockchain network, thereby verifying the model fingerprint record.

6. The device according to claim 5, characterized in that The model weight summary generation module is used to compress the model weight of each layer of the model network to obtain a model weight summary, specifically: Extract the weights of each layer of the model network; wherein the weights include all weight parameters and their associated bias terms; Format all weight parameters and convert them into a unified data format; Perform weighted averaging on all formatted weight parameters to obtain a compressed weight vector; Performing dimensionality reduction processing on the compressed weight vector by principal component analysis to remove redundant information; The model weight summary is obtained by training the autoencoder to take the dimensionality-reduced weight vector and metadata as input, compressing and decompressing them.

7. The device according to claim 6, characterized in that The model weight summary generation module also generates the metadata while extracting the weight of each layer of the model network; wherein the metadata includes the dimension of the weight, data type, data source, and data extraction time.

8. The device according to claim 5, characterized in that The chain-up and verification module is used to upload the model fingerprint record to the blockchain network, thereby verifying the model fingerprint record, specifically: Select a suitable blockchain network, encode the model fingerprint record as part of the blockchain transaction, broadcast it to the blockchain network, and generate a uniqueness function for the model fingerprint record on the blockchain network; The model fingerprint record transaction of the node in the blockchain network is verified, and when the verification is successful, the model fingerprint record of the node is added to other nodes in the blockchain network.

Citation Information

Patent Citations

  • Model distributed identity auditing method based on zero-knowledge proof

    CN119363349A

  • Software copyright management system based on smart contract

    CN119903491A