Model weight confirmation method and device based on block chain 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 immutable record of model weights and trustworthy content traceability are realized.
Patent Information
- Application Number
- CN202510869757.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-26
AI Technical Summary
The prior art has shortcomings in the concealment, attack resistance and error correction capabilities of model fingerprints, making it difficult to effectively realize model ownership authentication and content traceability.
Combining model fingerprints with blockchain technology, hash encryption of the model weight summary through the Merkle tree structure, and uploading them to the blockchain network to achieve tamper-free model fingerprint recording.
It improves the security and reliability of model traceability, ensures the credibility of model ownership authentication, and provides an efficient content traceability mechanism.
Smart Images

Figure CN120372704A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning, and particularly to a method and apparatus for model weight confirmation based on blockchain and model fingerprinting. Background Art
[0002] With the development of generative artificial intelligence technology, more and more application scenarios have emerged, especially in the generation of multi-modal content such as text, images, audio, and video. The widespread application of these technologies has also brought many challenges in content traceability, verification, and anti-counterfeiting, especially in terms of the authenticity and source reliability of content. As an important tool for model ownership authentication and historical traceability, model fingerprinting can be achieved by directly encoding from model weights or embedding into part of the model output through a backdoor mode under specific input conditions. However, in the process of constructing the above, there are problems in how to achieve a model fingerprint that is concealed, anti-cracked, and has an error correction ability. The existing technologies have deficiencies in terms of concealment, anti-attack ability, dependence on concealment, lack of error correction mechanism, and multi-modal unity. Summary of the Invention
[0003] In order to improve the security and reliability of model traceability, the model fingerprint is combined with blockchain technology, and the characteristics of decentralization, immutability, and transparency of blockchain are used to provide a secure storage environment for the model fingerprint, enhancing the credibility of model ownership authentication and content traceability. The present invention provides a method for model weight confirmation based on blockchain and model fingerprinting, and the method includes the following steps: Step S1: Perform digest compression on the model weights of each layer of the model to obtain a model weight digest; Step S2: Use the Merkle tree structure to perform hash encryption and recording on the model weight digest generated each time to obtain a model fingerprint record; Step S3: Upload the model fingerprint record to the blockchain network to verify the model fingerprint record.
[0004] Preferably, in step S1, performing digest compression on the model weights of each layer of the model to obtain a model weight digest specifically includes: Extract the weights of each layer of the model; wherein, the weights include all weight parameters and their related bias terms; Perform formatting processing on all weight parameters to convert all weight parameters into a unified data format; Perform weighted average on the formatted weight parameters to obtain a compressed weight vector; Perform dimensionality reduction processing on the compressed weight vector through principal component analysis to eliminate redundant information; Use a trained autoencoder to take the dimensionality-reduced weight vector and metadata as inputs, perform compression and decompression, and obtain a model weight digest.
[0005] Preferably, in step S1, while extracting the weights of each layer of the network of the extraction model, the metadata is generated; wherein, the metadata includes the dimension, data type, data source, and data extraction time of the weights.
[0006] Preferably, in step S2, a Merkle tree structure is used to perform hash encryption and recording on the model weight summary generated each time to obtain a model fingerprint record, specifically: It is set that the leaf nodes of the Merkle tree represent the hash values of each model weight summary, and the model weight summary is , and it is divided into n parts , and the hash value of each part is H i , where i is the index of the model weight summary; According to the following formula, the model weights are hashed and encrypted,
[0007] In the above formula, K represents the key, represents the input, that is, the i-th part of the model weight summary, ⊕ represents the bitwise exclusive OR 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, represents the 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,
[0008] Repeat the above process until the unique root hash value H root is finally obtained, and this is used as the model fingerprint record.
[0009] Preferably, 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 a part of the blockchain transaction, broadcast it to the blockchain network in this way, and generate the uniqueness function of the model fingerprint record in the blockchain network; Verify the model fingerprint record transaction of the nodes in the blockchain network. When the verification is successful, add the model fingerprint record of the nodes to other nodes in the blockchain network.
[0010] The present invention also provides a model weight confirmation device based on blockchain and model fingerprint, and the device includes the following modules: The model weight summary generation module is used to perform summary compression on the model weights of each layer of the network to obtain a model weight summary; The model fingerprint record generation module is used to perform hash encryption and recording on the model weight summary generated each time by using the Merkle tree structure to obtain a model fingerprint record; The blockchain uploading and verification module is used to upload the model fingerprint record to the blockchain network, so as to verify the model fingerprint record.
[0011] Preferably, the model weight summary generation module is used to perform summary compression on the model weights of each layer of the network to obtain a model weight summary. Specifically: Extract the weights of each layer of the network; among them, the weights include all weight parameters and their related bias terms; Perform formatting processing on all weight parameters, and convert all weight parameters into a unified data format; Perform weighted averaging on all formatted weight parameters to obtain a compressed weight vector; Perform dimensionality reduction processing on the compressed weight vector through principal component analysis to eliminate redundant information; Use the trained autoencoder to take the dimensionality-reduced weight vector and metadata as inputs, perform compression and decompression, and obtain a model weight summary.
[0012] Preferably, the model weight summary generation module also generates the metadata while extracting the weights of each layer of the network; among them, the metadata includes the dimension, data type, data source, and data extraction time of the weights.
[0013] Preferably, the model fingerprint record generation module is used to perform hash encryption and recording on the model weight summary generated each time by using the Merkle tree structure to obtain a model fingerprint record. Specifically: Set the leaf nodes of the Merkle tree to represent the hash values of each model weight summary, and the model weight summary is and divide it into n parts The hash value of each part is H i , where i is the index of the model weight summary; According to the following formula, the model weights are hashed and encrypted,
[0014] In the above formula, K represents the key, represents the input, that is, the i-th part of the model weight summary, ⊕ represents the bitwise exclusive OR 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, and Hash() represents the hash function. Represents a concatenation operation; According to the following formula, pair up adjacent hash values to generate the hash value of the new parent node,
[0015] Repeat the above process until finally obtaining the unique root hash value H root , which is used as the model fingerprint record.
[0016] Preferably, the on-chain and verification module is used to upload the model fingerprint record to the blockchain network for verifying the model fingerprint record. Specifically: Select a suitable blockchain network, encode the model fingerprint record as a part of the blockchain transaction, broadcast it to the blockchain network accordingly, and generate the uniqueness function of the model fingerprint record in the blockchain network; Verify the model fingerprint record transactions of the nodes in the blockchain network. After successful verification, add the model fingerprint records of the nodes to other nodes in the blockchain network.
[0017] Compared with the prior art, the present invention has the following beneficial effects: First, the present invention encrypts the model weights through a hash encryption algorithm with a key, and constructs a model fingerprint in combination with the Merkle tree to generate a unique model fingerprint. This model fingerprint is uploaded to the blockchain to achieve an immutable record. This process combines multiple technologies such as the model weights, key, hash encryption, and blockchain to ensure the uniqueness and security of the fingerprint.
[0018] Second, the present invention combines the model fingerprint with the blockchain and utilizes the characteristics of decentralization, immutability, and transparency of the blockchain to provide a secure storage environment for the model fingerprint, enhancing the credibility of model ownership authentication and content traceability; by storing the model fingerprint 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 are traceable, and constructing an efficient and reliable tracing method to meet multiple technical function requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. Among them:
[0020] Figure 1 is the flowchart of the model weight confirmation method based on blockchain and model fingerprint provided by the present invention.
[0021] Figure 2 It is the process of generating model fingerprint records.
[0022] Figure 3 It is a structural diagram of the model weight confirmation device based on blockchain and model fingerprint provided by the present invention. DETAILED DESCRIPTION
[0023] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. It is 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 the 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.
[0024] The terms "include" and "have" and any variations thereof in the present invention are intended to cover non-exclusive inclusions. For example, a process, method, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0025] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0026] 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: 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 the efficiency of subsequent processing.
[0027] 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: Extract the weights of each layer of the model , where W iDenote the network weights of the i-th layer of the model, and the weights include all weight parameters and their associated bias terms to ensure data integrity and accuracy. Specifically, extract the weight parameters in the deep learning model layer by layer to ensure that the extracted content completely covers the core parameters and related bias terms of each layer, thereby ensuring data integrity and accuracy during subsequent processing. For various neural network layers in the deep learning model (such as convolutional layers, fully connected layers, etc.), extract the network weights W after training is completed. i The network weights of each layer should include the following two parts: core parameters, such as convolutional kernel weights, fully connected layer weights, etc., which are the key manifestations of the model's learning ability; bias terms, which are used to translate and adjust the neuron outputs and are important supplements to the model's expressive ability. Perform formatting processing on all weight parameters, that is , where denotes converting the original extracted weight parameter set W into a standardized data format structure, thereby converting all weight parameters into a unified data format for subsequent processing. Convert the extracted weight parameters into a unified data format to facilitate subsequent processing such as compression, dimensionality reduction, and fingerprint generation. Since the weights of different network layers vary in dimension and structure, standardization conversion is required. Specifically, Reshape or Flatten operations can be used to convert the weights of each network layer into a one-dimensional vector or a two-dimensional matrix of a unified format, thereby constructing a weight set with a consistent structure and easy to process. The above process ensures the comparability and compatibility of cross-layer weights during subsequent processing. Perform weighted average processing on all formatted weight parameters to achieve dimensionality compression and generate a more compact weight vector representation, which helps reduce data redundancy and improve the efficiency of subsequent feature extraction and fingerprint generation. Preferably, the downsampling method of average pooling can be used to perform regional aggregation on the weight matrix after data format conversion, reducing dimensions while retaining the main feature information. The process of the above downsampling method is: , thus obtaining the compressed weight vector; where denotes the compressed weight vector, and Downsample() denotes weighted average calculation. To further compress the data scale and remove redundant information, perform dimensionality reduction processing on the compressed weight vector through Principal Component Analysis (PCA) to eliminate redundant information for effective dimensionality reduction. PCA is a classic linear dimensionality reduction method that can extract the most representative principal components from high-dimensional data, retaining the main variation information in the original data to the greatest extent while reducing dimensions. Specifically, let the input be the downsampled weight vectors W of multiple models or multiple layers. downsample, project it into a low-dimensional subspace through PCA, and the output is the weight representation W after dimensionality reduction PCA , the above dimensionality reduction process can be expressed as: , where W downsample represents the set of weight vectors after weighted average downsampling, and W PCA represents the low-dimensional feature representation obtained by PCA dimensionality reduction, and PCA() represents principal component analysis; the above process not only improves the data processing efficiency, but also provides a more compact and discriminative feature basis for subsequent tasks such as model fingerprint extraction and similarity measurement.
[0028] An autoencoder can be used to perform feature abstraction and compressed representation on the fused information. An autoencoder is an unsupervised neural network structure that can learn to map input data to a low-dimensional latent space while retaining its key features. Specifically, the dimensionality-reduced weight vector W PCA and the corresponding metadata Metadata are used as joint inputs and input into the trained autoencoder model for encoding processing 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 the low-dimensional abstract features of the input data, and the compressed weight summary representation has higher compactness and discriminability.
[0029] Through the above process, the original high-dimensional weights are compressed into low-dimensional feature vectors with semantic expression ability, providing an efficient and robust representation basis for subsequent tasks such as model fingerprint generation, similarity measurement, and model recognition.
[0030] Further, in step S1, it also includes generating metadata while extracting the weights of each layer of the model network; among them, the metadata includes the dimension, data type, data source, and extraction time of the weights, that is , where d represents the dimension of the weights, 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.
[0031] While extracting and processing the weight parameters, it is necessary to synchronously generate associated metadata information (Metadata) for recording the context and attribute characteristics of the data. These metadata provide a structural description of the weight vector and contribute to 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 parameters are extracted or processed, facilitating version control and traceability. These metadata not only provide background support for the structured representation of the model fingerprint but also play a key role in application scenarios such as data comparison, model consistency verification, and anomaly detection.
[0032] Step S2: Use the Merkle tree structure to perform hash encryption and recording on the model weight summary generated each time to obtain the model fingerprint record.
[0033] In this stage, the Merkle tree structure is used to perform hash recording on the model weight summary generated each time, thereby constructing the model fingerprint index. The Merkle tree structure can effectively ensure the integrity and immutability of the model fingerprint record and is of great significance in applications such as model authentication, version tracking, and security auditing.
[0034] Furthermore, in step S2, use the Merkle tree structure to perform hash encryption and recording on the model weight summary generated each time to obtain the model fingerprint record. Specifically: Set the leaf nodes of the Merkle tree to represent the hash values of each model weight summary. The model weight summary is and it is divided into n parts The hash value of each part is H i , where i is the index of the model weight summary; preferably, 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 anti-tampering of the weights. The process is as Figure 2 shown, According to the following formula, the model weights are hash encrypted,
[0035] In the above formula, K represents the key used to generate the hash signature, Denote the input as the i-th part of the model weight summary (i.e., the i-th model weight summary fragment), which serves 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, and Hash() represents a hash function, such as SHA-256. Denote the concatenation operation, i.e., the operation of concatenating strings or byte sequences. After calculating the hashes of the leaf nodes of the Merkle tree, continue in a bottom-up manner to pairwise combine adjacent two hash values and generate the hash value of its corresponding parent node through the hash function. The above process is continuously recursive until a unique root node hash value (MerkleRoot) is constructed. The above process can be expressed as follows:
[0036] Among them, H i and H i+1 are two adjacent hash values, and H i,i+1 is the merged parent node hash value. Hash() represents a hash function, such as SHA-256. The above process will continue until a unique root node hash value H root is constructed, which serves as the global summary of the entire model weight state for subsequent integrity verification and unique identification of the model fingerprint.
[0037] The root node hash value H root is the unique representation of the entire model weight summary and has the following key features: First, integrity verification. By comparing whether the calculated H root is consistent with the stored value, it can quickly verify whether the model fingerprint has been tampered with. Second, non-tamperability. Due to the collision resistance of the hash function and the hierarchical dependence of the Merkle tree structure, any minor change in any leaf node (model weight summary fragment) will cause a change in the final root hash value. Third, traceability. It can confirm whether it belongs to the original model by verifying the hash path (Merkle Path) from a certain leaf node to the root node, supporting local verification and traceability analysis. Fourth, efficiency. The computational complexity of the verification process is O(logn), which is suitable for fast consistency checking 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 model weight changes. Once any change occurs in the model weight, its corresponding hash path and the final root node hash value H root will change, thus realizing the integrity guarantee and traceability support for the model fingerprint.
[0038] Step S3: Upload the model fingerprint record to the blockchain network for verification. This process aims to upload the generated model fingerprint information to the blockchain network to ensure the uniqueness and immutability of the fingerprint record, providing a trustworthy basis for subsequent model verification, version traceability, and liability attribution.
[0039] Further, in Step S3, the model fingerprint record is uploaded to the blockchain network for verification, specifically as follows: Select a suitable blockchain network with the characteristics of high security, decentralization, and immutability to ensure the security and reliability of the model fingerprint, and set the selected blockchain network as BC. Upload the generated root hash value H of the model fingerprint root as key data to the blockchain network BC. This process involves encoding the fingerprint data as part of a blockchain transaction and broadcasting it to all network nodes to achieve global consensus and permanent recording. Specifically, encode the model fingerprint record as part of a blockchain transaction and broadcast it to the blockchain network, that is , representing transaction T (i.e., the generated blockchain transaction), representing the function to create the transaction, and generating a uniqueness function for the model fingerprint record in the blockchain network.
[0040] Relying on the immutable feature of the 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 weights or structure will cause its root hash value H root to change, thus generating a new fingerprint record. Therefore, each fingerprint hash value on the chain uniquely corresponds to a specific model state, ensuring the non-forgeability and verifiability of the model fingerprint. The above uniqueness can be formally represented as follows:
[0041] where represents the model fingerprint uniqueness verification function. If the root hash value H root already exists in the blockchain, it returns true, indicating that the model fingerprint has been uniquely recorded. Through the above mechanism, the uniqueness of the model fingerprint can not only be verifiably trusted on the chain but also provide a solid foundation for the intellectual property protection, version management, and liability attribution of AI models.
[0042] 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 passes the verification, 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 represented as:
[0043] Among them, 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 trustworthy basis for subsequent verification and traceability.
[0044] Once the model fingerprint is recorded in the blockchain, any third party can verify its authenticity and trace its history through the data on the chain. The public transparency and immutability of the blockchain make the model fingerprint highly verifiable and auditable. The specific operations for the above verification and traceability include: verifying whether the model fingerprint actually exists on the blockchain, checking whether its corresponding transaction records are complete and valid, and tracing the historical versions and evolution paths corresponding to the model fingerprint.
[0045] The above operations can be implemented through the following functions:
[0046] Among them, verify() represents a function used to verify the authenticity and consistency of the model fingerprint, and trace() represents a function used to trace the historical change path of the model fingerprint on the blockchain.
[0047] Please refer to Figure 3 As shown, the present invention provides a model weight rights confirmation device based on the blockchain and model fingerprint. The device includes the following modules: A model weight summary generation module, which is used to perform summary compression on the model weights of each layer of the model to obtain a model weight summary; A model fingerprint record generation module, which is used to perform hash encryption and recording on the model weight summary generated each time by using the Merkle tree structure to obtain a model fingerprint record; An on-chain and verification module, which is used to upload the model fingerprint record to the blockchain network to verify the model fingerprint record.
[0048] Furthermore, the model weight summary generation module is used to perform summary compression on the model weights of each layer of the model to obtain a model weight summary. Specifically: Extract the weights of each layer of the model; among them, the weights include all weight parameters and their related bias terms; Perform formatting processing on all weight parameters to convert all weight parameters into a unified data format; Perform weighted averaging on the formatted weight parameters to obtain a compressed weight vector; Perform dimensionality reduction processing on the compressed weight vector through principal component analysis to eliminate redundant information; The weight vector and metadata after dimensionality reduction processing are used as inputs for training the autoencoder to perform compression and decompression, obtaining the model weight summary.
[0049] Furthermore, the model weight summary generation module also generates metadata while extracting the weights of each layer of the model network; among them, the metadata includes the dimension, data type, data source, and data extraction time of the weights.
[0050] Furthermore, the model fingerprint record generation module is used to perform hash encryption and recording on the model weight summary generated each time using the Merkle tree structure, obtaining the model fingerprint record, specifically: It is set that the leaf nodes of the Merkle tree represent the hash values of each model weight summary, and the model weight summary is and it is divided into n parts The hash value of each part is H i , where i is the index of the model weight summary; According to the following formula, the model weight is hashed and encrypted,
[0051] In the above formula, K represents the key, represents the input, that is, the i-th part of the model weight summary, ⊕ represents the bitwise exclusive OR 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, represents the 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,
[0052] Repeat the above process until the final unique root hash value H root is obtained, and this is used as the model fingerprint record.
[0053] Furthermore, the on-chain and verification module is used to upload the model fingerprint record to the blockchain network to verify the model fingerprint record, specifically: Select a suitable blockchain network, encode the model fingerprint record as a part of the blockchain transaction, broadcast it to the blockchain network in this way, and generate the uniqueness function of the model fingerprint record in the blockchain network; Verify the model fingerprint record transactions of the nodes in the blockchain network. When the verification is successful, add the model fingerprint record of the node to other nodes in the blockchain network.
[0054] The model weight confirmation device based on blockchain and model fingerprint of the present invention corresponds to the operation and effect of the above-mentioned model weight confirmation method based on blockchain and model fingerprint, and the description of the model weight confirmation device based on blockchain and model fingerprint will not be repeated here.
[0055] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of adding a necessary general hardware platform, and of course, it can also be implemented by a combination of hardware and software. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0056] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, not to limit them, and other embodiments can also be adopted; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for determining the rights of model weights based on blockchain and model fingerprints, characterized in that, The method includes the following steps: Step S1: Perform summary compression on the model weights of each layer of the model to obtain a model weight summary; Step S2: Use the Merkle tree structure to perform hash encryption and recording on the model weight summary generated each time to obtain a 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, wherein in Step S1, performing summary compression on the model weights of each layer of the model to obtain a model weight summary is specifically as follows: Extract the weights of each layer of the model; wherein, the weights include all weight parameters and their related bias terms; Perform formatting processing on all weight parameters to convert all weight parameters into a unified data format; Perform weighted averaging on the formatted weight parameters to obtain a compressed weight vector; Perform dimensionality reduction processing on the compressed weight vector through principal component analysis to eliminate redundant information; Use the trained autoencoder to take the dimensionality-reduced weight vector and metadata as inputs for compression and decompression to obtain a model weight summary.
3. The method according to claim 2, wherein in Step S1, it further includes generating the metadata while extracting the weights of each layer of the model; wherein, the metadata includes the dimension, data type, data source, and data extraction time of the weights.
4. The method according to claim 1, wherein in Step S2, using the Merkle tree structure to perform hash encryption and recording on the model weight summary generated each time to obtain a model fingerprint record is specifically as follows: Set the leaf nodes of the Merkle tree to represent the hash values of each model weight summary, where the model weight summary is , and split it into n parts , and the hash value of each part is H i , where i is the index of the model weight summary; Perform hash encryption on the model weights according to the following formula, In the above formula, K represents the key, represents the input, that is, the i-th part of the model weight summary, ⊕ represents the bitwise exclusive OR 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, represents the concatenation operation; According to the following formula, combine the adjacent hash values in pairs to generate the hash value of the new parent node, Repeat the above process until the final unique root hash value H is obtained root , which is used as the model fingerprint record 5. The method according to claim 1, wherein in Step S3, uploading the model fingerprint record to the blockchain network to verify the model fingerprint record is specifically as follows: Select a suitable blockchain network, encode the model fingerprint record as a part of the blockchain transaction, broadcast it to the blockchain network accordingly, and generate a uniqueness function of the model fingerprint record in the blockchain network; Verify the model fingerprint record transaction of the nodes in the blockchain network. When the verification is successful, add the model fingerprint record of the node to other nodes in the blockchain network.
6. A model weight confirmation device based on blockchain and model fingerprint, wherein a model weight summary generation module, configured to perform summary compression on the model weights of each layer of the model to obtain a model weight summary; a model fingerprint record generation module, configured to use the Merkle tree structure to perform hash encryption and recording on the model weight summary generated each time to obtain a model fingerprint record; a blockchain uploading and verification module, configured to upload the model fingerprint record to the blockchain network to verify the model fingerprint record.
7. The device according to claim 6, wherein The model weight summary generation module is used to perform summary compression on the model weights of each layer of the network to obtain a model weight summary, specifically as follows: Extract the weights of each layer of the network; wherein, the weights include all weight parameters and their associated bias terms; Perform formatting processing on all weight parameters to convert all weight parameters into a unified data format; Perform weighted averaging on all formatted weight parameters to obtain a compressed weight vector; Perform dimensionality reduction processing on the compressed weight vector through principal component analysis to eliminate redundant information; Use the trained autoencoder to take the dimensionality-reduced weight vector and metadata as inputs, perform compression and decompression, and obtain the model weight summary.
8. The device according to claim 7, wherein The model weight summary generation module also generates the metadata while extracting the weights of each layer of the network; wherein, the metadata includes the dimension, data type, data source, and data extraction time of the weights.
9. The device according to claim 6, wherein The model fingerprint record generation module is used to perform hash encryption and recording on the model weight summary generated each time using the Merkle tree structure to obtain a model fingerprint record, specifically as follows: Set the leaf nodes of the Merkle tree to represent the hash values of each model weight summary, where the model weight summary is , and divide it into n parts , and the hash value of each part is H i , where i is the index of the model weight summary; Perform hash encryption on the model weights 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 exclusive OR 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, represents the concatenation operation; According to the following formula, combine adjacent hash values in pairs to generate the hash value of the new parent node Repeat the above process until the final unique root hash value H is obtained root , which is used as the model fingerprint record 10. The device according to claim 6, wherein The uploading and verification module is used to upload the model fingerprint record to the blockchain network to verify the model fingerprint record, specifically as follows: Select a suitable blockchain network, encode the model fingerprint record as a part of the blockchain transaction, broadcast it to the blockchain network accordingly, and generate the uniqueness function of the model fingerprint record in the blockchain network; Verify the model fingerprint record transaction of the nodes in the blockchain network, and when the verification is successful, add the model fingerprint record of the node to other nodes in the blockchain network.
Citation Information
Patent Citations
Trusted collaboration model and data model, and metadata storage and metadata collaborative verification algorithm
CN109194486A
Digital archive system based on block chain
CN118350047A
Model distributed identity auditing method based on zero-knowledge proof
CN119363349A
Gradient aggregation federal learning method based on combination of zero knowledge proof and block chain technology
CN119420489A
Software copyright management system based on smart contract
CN119903491A
Cited By
System for generating software code right authentication certificate, verification system and method
CN120611364A
Digital authentication method and system based on industrial production data
CN120934770A
A digital authentication method and system based on industrial production data
CN120934770B
Social network dynamic credibility evaluation method and system based on block chain fingerprints
CN121117487A
Social network dynamic credibility assessment method and system based on blockchain fingerprint
CN121117487B