Machine learning integrity proof method and system based on zero-knowledge proof

By proposing a machine learning integrity proof method based on zero-knowledge proof, this paper addresses the issues of high resource consumption and expertise requirements in Machine Learning as a Service, achieving efficient task verification and result reliability, and preventing backdoor attacks.

CN117353936BActive Publication Date: 2026-11-27FUJIAN NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311304333.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-10
Publication Date
2026-11-27
Estimated Expiration
2043-10-10

AI Technical Summary

Technical Problem

Existing Machine Learning as a Service (MLAS) solutions suffer from resource overhead issues, such as the increasing scale and time required to prove the model convergence as the data volume grows. General solutions require a high level of expertise from customers and fail to effectively verify whether the model converges as expected.

Method used

Employing a machine learning integrity proof method based on zero-knowledge proof, the client generates proof keys and verification keys, the service provider makes commitments and archives them during training or prediction, and the client generates and verifies proofs through sampling challenges, ensuring the legality of task execution and the reliability of results.

Benefits of technology

It reduces the overhead of proof and verification, improves the efficiency of service providers, ensures the fairness of transactions and the reliability of results, and identifies malicious behaviors such as backdoor attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117353936B_ABST
    Figure CN117353936B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of machine learning integrity proof method and system based on zero-knowledge proof.Clients first outsource their machine learning tasks to service providers, and provide data sets and auxiliary data by the clients;Service providers perform machine learning tasks using data sets according to the requirements of the clients, and provide their commitments to the results of the tasks;After receiving the commitment, the client extracts a certain number of iterations as a challenge, and the service provider generates corresponding proofs without any effective knowledge and commitment proofs according to the challenge, respectively used to prove the legality of task execution and the legality of the challenge itself.If both proofs can pass the client's verification, the client can be sure that the service provider has honestly completed the task;Finally, the client pays and checks the results delivered by the service provider, completing the transaction process.The present application can be used to ensure the authenticity of the task execution process, the reliability of the delivered results and the fairness of the transaction, while reducing the proof and verification overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and specifically to a machine learning integrity proof method and system based on zero-knowledge proof. Background Technology

[0002] The Machine Learning as a Service (MAS) market is expanding rapidly with the application of artificial intelligence, but outsourcing tasks to service providers with zero trust can lead to serious security problems and financial losses. On the one hand, customers may be deceived during the transaction, receiving services that are not commensurate with their exorbitant prices. For example, using only partial data when training the model, falsifying results in prediction services, or even fabricating non-existent resource consumption and additional terms when charging. On the other hand, service providers, due to their lack of ability and qualifications, may disclose models or prediction results and related data before customers pay, or be subject to malicious attacks during result transmission. For example, disclosing partial prediction results or intermediate results of model training to prove workload, embedding backdoors in models or data, or being tampered with during result transmission.

[0003] Currently, researchers have made significant progress in verifiable machine learning, but several issues remain to be addressed: ① The scale and time required for proof increase with the volume of data and interactions, severely hindering service providers' efficiency and generating unacceptable additional resource and time costs; ② Current work is largely focused on specific application scenarios, such as CNN predictions, and a few general solutions still require configuration based on the characteristics of the task algorithm in actual deployment, demanding a certain level of expertise from clients; ③ Most work only proves the accuracy of the computation process without judging the results, such as whether the model converges as expected. Summary of the Invention

[0004] The purpose of this invention is to provide a machine learning integrity proof method and system based on zero-knowledge proof. This method and system can be used to ensure the authenticity of task execution, the reliability of delivery results, and the fairness of transactions, while reducing proof and verification overhead. Outsourcing their machine learning tasks to service providers Depend on Provide the dataset D and auxiliary data (aux) used for training or prediction, and generate the proof key (PK) and verification key (VK) required for subsequent processing, i.e., (PK,VK)←KeyGen(1 λ ,F), where F is the arithmetic circuit generated according to the task function (Func()), and λ is the safety parameter. according to The requirement is to use D to perform a specific machine learning task, res←Func(D,aux), and after execution... Provide its commitment to the task outcome: com←Commit(res). Upon receiving the commitment, A certain number of iterations are selected as challenge clg. Then, based on clg, a corresponding proof π without any valid knowledge is generated. p ←Prove(PK,clg,D) and Promise to Prove π c ←Certify(clg) is used to prove the legality of the task execution and the legality of the challenge itself, respectively. If π p With π c Can pass The verification, i.e., 1←Verify(VK,D,π) p And 1←Open(com,π) c ),but It can be confirmed They faithfully completed the task. After payment The delivered results are verified to complete the transaction process.

[0005] To achieve the above objectives, the technical solution of this invention is: a machine learning integrity proof method based on zero-knowledge proof, for the client. Predefine the task objective function and its proof circuit, and provide it to the service provider. Provide content including datasets and requirements; Train or predict the model as required, and commit to and archive the content during the iteration. Upon receiving the commitment, conduct dispersed sampling within its scope and... To conduct an inquiry, The corresponding proof is generated according to the agreement. Verification will be conducted; if verification passes, payment and model delivery will proceed, and the results will be delivered afterward. Use the promised content to check whether its verification matches the received content.

[0006] In one embodiment of the present invention, the service provider According to the customer The method for training the model, committing to and recording its state is as follows:

[0007] Step 1 The training function Train() is executed based on dataset D, utilizing a selected subset of data D. i Update the weights w in round i-1. i-1 As a new round of weighting w i , i.e. w i ←Train(D i ,w i-1 );

[0008] Step 2: Determine if the current state is a save round based on the pre-set save interval sp, i.e., i mod sp = 0. If so, store the current state and execute the commitment function Commit() to generate a commitment com for all weights saved up to this point in the last save. j ←Commit(id i-sp+1 ,…,id i ), where id i A unique identifier for the i-th round;

[0009] Step 3: If the difference between the mean squared errors e of two consecutive rounds is less than the threshold, i.e., |e t -e t-1 When |<η, the model converges. Let N be the current round, record the current state as the final result, and generate the last commitment.

[0010] In one embodiment of the present invention, the service provider According to the customer The challenge of generating proofs using CLG is performed as follows:

[0011] Step 1, according to Random challenge clg issued k Recalculate based on archived information

[0012] Step 2: Incorporate the last three iterations into the random challenge group;

[0013] Step 3: Execute the proof function Prove() in the circuit for each challenge to generate a proof π. p ,Right now

[0014] Step 4: Execute the commitment proof function Certify() for each challenge to generate a commitment proof π. c ,Right now

[0015] In one embodiment of the present invention, the customer The verification of commitments and proofs shall be carried out in the following steps:

[0016] Step 1 Execute the verification function Verify() to verify the challenge (0,1) ← Verify(VK,D,π) p );

[0017] Step 2, if π p Verification passed. Execute the commitment verification function Open() to verify the commitment (0,1) ← Open(com,π) c );

[0018] Step 3, if π c Verification passed. Verify whether the model is exactly convergent, i.e., the circuit output e'. t-2 、e' t-1 、e' t Satisfy |e' t -e 't-1 |<ηand|e' t-1 -e' t-2 |>η.

[0019] In one embodiment of the present invention, the service provider Deliver the model and make a commitment to the customer. The delivery model is validated by following these steps:

[0020] Step 1 Payment will be made according to the preset schedule;

[0021] Step 2 The delivery model and commitment proof are generated as πc←Certify(wN) based on the weights of the last round.

[0022] Step 3 Verify delivery result (0, 1) ← Open(com, π) c ).

[0023] In one embodiment of the present invention, the service provider The method for reasoning and predicting based on customer needs and generating proofs is as follows:

[0024] Step 1 Given a dataset D, perform the prediction task Predict(), i.e., res←Predict(D), where res is the prediction result;

[0025] Step 2 Generate a commitment com←Hash(res) consisting of hash values ​​for the result, where Hash() is the hash function;

[0026] Step 3 Generate proof π←Prove(PK, w, D) for the prediction process.

[0027] In one embodiment of the present invention, the customer The method for verifying the completeness of the prediction process and the authenticity of the delivered results is as follows:

[0028] Step 1 Verify the prediction (0, 1) ← Verify(VK, D, π);

[0029] Step 2: If the verification passes, then Payment according to the preset schedule Delivery forecast results;

[0030] Step 3 Verify the delivery result by comparing the hash value of the commitment com with the hash value com′←Hash(res).

[0031] The present invention also provides a machine learning integrity proof system based on zero-knowledge proof applied to the above-described method, comprising:

[0032] client Used to propose task requirements and datasets, verify the completeness of the task, and obtain results consistent with the verification content;

[0033] Service Provider Used to perform task requirements using provided datasets, demonstrate the integrity of the task process, and deliver task results.

[0034] Compared to existing technologies, this invention offers the following advantages: It provides a method and system for proving the integrity of machine learning-as-a-service based on zero-knowledge proofs. This method and system can efficiently verify the authenticity of the outsourced machine learning model training or prediction process and the reliability of the results for users, while protecting the intellectual property of service providers, and accurately identify malicious behaviors such as backdoor attacks. This invention can be easily applied to any machine learning task, and different efficiency optimization schemes can be set in the proof circuit. Compared to directly applying zero-knowledge proofs in each iteration, this invention utilizes random sampling to avoid unacceptably high computational and storage costs, while ensuring the integrity, reliability, and zero-knowledge nature of the solution. Attached Figure Description

[0035] Figure 1 This is a flowchart illustrating the method implementation of an embodiment of the present invention. Detailed Implementation

[0036] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.

[0037] This invention utilizes the basic idea of ​​sampling inspection to reduce the overhead of proof and verification, allowing service providers to... It can generate proof at a lower cost, allowing customers to... It enables more convenient and accurate verification of task results, meeting the needs of both parties and protecting their interests. Training tasks require only three rounds of communication to complete training, verification, and delivery, while prediction tasks require only two rounds of communication to complete prediction, verification, and delivery. After a series of pre-settings, to Provide datasets and requirements, etc.; Model training or prediction is performed as required, and the work content is committed to and recorded to a certain extent during the iteration, so as to reduce the overhead of subsequent proof process for sampling sample retrieval and location with minimal storage overhead. Upon receiving the commitment, conduct reasonably dispersed sampling within its scope. To conduct an inquiry, The corresponding proof will be generated according to the agreement. Verification will be conducted; if verification passes, payment and model delivery will proceed, and the results will be delivered afterward. The verification can be checked against the received content using the promised content. In fact, for long-term benefit, service providers are unlikely to send erroneous results (i.e., compiled results inconsistent with the verified content) after the verification is completed. Therefore, post-delivery verification only requires simple design to prevent attackers from tampering with the communication.

[0038] Based on the above ideas, this invention provides a machine learning-as-a-service integrity proof method based on zero-knowledge proof, such as... Figure 1 As shown. Customer Outsourcing their machine learning tasks to service providers Depend on Provide the dataset D used for training or prediction and the auxiliary data aux to generate the keys required thereafter. according to The requirement is to use D to perform a specific machine learning task res←Func(D, aux), and after execution... Provide its commitment to the task outcome: com←Commit(res). Upon receiving the commitment, A certain number of iterations are selected as challenge clg. Then, based on clg, a corresponding proof π without any valid knowledge is generated. p ←Prove(PK, clg, D) and π c ←Certify(clg) is used to prove the legality of the task execution and the legality of the challenge itself, respectively. If π p With π c Can pass The verification, i.e., 1←Verify(VK, D, π) p And 1←Open(com, π) c ),but It can be confirmed They faithfully completed the task. After payment The delivered results are verified to complete the transaction process.

[0039] In this embodiment, for the training task, the service provider According to the customer The method for training the model, committing to and recording its state is as follows:

[0040] Step 1 Perform the training task based on dataset D. i ←Train(D i w i-1 This means continuously iterating and updating the weights;

[0041] Step 2: Determine if the current state is a save round based on the pre-set save interval sp, i.e., i mod sp = 0. If so, store the current state and generate a commitment (com) for all weights saved up to this point in the last save. j ←Commit(id i-sp+1 , ..., id i ), where id i A unique identifier for the i-th round;

[0042] Step 3: If the average squared error e of two consecutive rounds i The difference is less than the threshold, i.e., |e t -e t-1 | < η, that is, the model has converged, the current state is recorded as the final result and the last commitment is generated.

[0043] In this embodiment, the service provider According to the customer The challenge generates a proof, which is performed by following these steps:

[0044] Step 1, according to Random challenge clg issued k Recalculate based on archived information

[0045] Step 2: Incorporate the last three iterations into the random challenge group;

[0046] Step 3: Generate a proof for each challenge in the circuit, i.e.

[0047] Step 4: Generate a proof of commitment for each challenge, i.e.

[0048] In this embodiment, the customer The verification of commitments and proofs shall be carried out in the following steps:

[0049] Step 1 Verify challenge (0, 1) ← Verify(VK, D, π)p );

[0050] Step 2, if π p Verification passed. Verify commitment (0, 1) ← Open (com, π) c );

[0051] Step 3, if π c Verification passed. Verify whether the model is exactly convergent, i.e., the circuit output e′. t-2 、e′ t-1 、e′ t Satisfy |e′ t -e ′t-1 |<eta and |e′ t-1 -e′ t-2 |>η.

[0052] In this embodiment, the service provider Deliver the model and make a commitment to the customer. The delivery model is validated by following these steps:

[0053] Step 1 Payment will be made according to the preset schedule;

[0054] Step 2 Delivery model and commitment proof, commitment proof is π c ←Certify(w N );

[0055] Step 3 Verify delivery result (0, 1) ← Open (com, π) c ).

[0056] In this embodiment, for the prediction task, the service provider The method for reasoning and predicting based on customer needs and generating proofs is performed as follows:

[0057] Step 1 Perform the prediction task res←Predict(D) based on dataset D;

[0058] Step 2 Generate a commitment consisting of hash values ​​for the result: com←Hask(res);

[0059] Step 3 Generate a proof π←Prove(PK, w, D) for the prediction process.

[0060] In this embodiment, the customer The method for verifying the completeness of the prediction process and the authenticity of the delivered results is as follows:

[0061] Step 1 Verify the prediction (0, 1) ← Verify(VK, D, π);

[0062] Step 2: If the verification passes, then Payment according to the preset schedule Delivery forecast results;

[0063] Step 3 Verify the delivery result by comparing the hash value of the commitment com with the hash value of the delivery result com′←Hask(res).

[0064] This invention also provides a machine learning-as-a-service integrity verification system applying the above-described method, including a client. and service providers

[0065] The customer Used to propose task requirements and datasets, verify the completeness of the task, and obtain results consistent with the verification content;

[0066] The service provider Used to perform task requirements using provided datasets, demonstrate the integrity of the task process, and deliver task results.

[0067] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0068] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0069] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0070] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0071] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A machine learning integrity proof method based on zero-knowledge proof, characterized in that, client The task objective function Func() and its proof circuit F are predefined. Func() is the computation function in the client's requirements, and F is the proof arithmetic circuit generated based on Func(). The proof key PK and the verification key VK are generated by a key generation algorithm. Generate, λ is a security parameter, client to service providers Provide the dataset D used for training or prediction, the auxiliary data aux, and the task requirements; Model training or prediction is performed based on task requirements, while content commitment and archiving are carried out during iterations; Upon receiving the commitment, conduct dispersed sampling within its scope and... To conduct an inquiry, The corresponding proof is generated according to the agreement. Verification will be conducted; if verification passes, payment and model delivery will proceed, and the results will be delivered afterward. Use commitment checks to verify consistency with the delivered content; Service Provider According to the customer The task requires training the model, committing to and recording its state, and the method is performed as follows: Step 1 According to the dataset Execute training function Select a portion of data from dataset D ,use Update # Wheel weight As a new round of weight ,Right now and calculate the first Mean squared error corresponding to round of training ; Step 2 According to the preset archiving interval Determine if the current time frame is a save round. If so, store the current state, including the first... The weights and unique identifiers of each round are assigned, and a commitment function is executed for all weights previously archived here. Generate commitments ,Right now ,in For the first The unique identifier of the wheel; Step 3: If the difference between the average squared errors of two consecutive rounds is less than the threshold, i.e. At this point, the model converges, and the current round is denoted as . Record the current state as the final result and generate the last commitment; Service Provider According to the customer Challenges The method for generating the proof is as follows: Step 1, according to Number of random challenge rounds issued Recalculate based on archived information ; Step 2: Incorporate the last three iterations of the entire training process into a random challenge group; Step 3: Execute the proof function for each challenge in the circuit. Generate proof ,Right now ; Step 4: Execute the commitment proof function for each challenge. Proof of generating commitment ,Right now ; client The verification of commitments and proofs shall be carried out in the following steps: Step 1 Execute the verification function To verify the challenge ; Step 2, if Verification passed. Execute the commitment verification function Verify commitment ; Step 3, if Verification passed. Verify whether the model is exactly convergent, i.e., the circuit output. , , satisfy and .

2. The machine learning integrity proof method based on zero-knowledge proof according to claim 1, characterized in that, Service Provider Deliver the model and make a commitment to the customer. The delivery model is validated by following these steps: Step 1 Payment will be made according to the preset schedule; Step 2 Delivery model and proof of commitment Based on the final training weights Execute the commitment proof function Certify() to generate a delivery commitment proof. ; Step 3 Utilizing the final commitment and delivery commitment certificate Execute the commitment verification function Open() to verify the delivery result. .

3. The machine learning integrity proof method based on zero-knowledge proof according to claim 1, characterized in that, Service Provider The method for inferring and predicting based on the client's task requirements and generating proofs is as follows: Step 1 According to the dataset Model weights in machine learning models Perform prediction tasks ,Right now ,in For the predicted results; Step 2 Generate a commitment consisting of hash values ​​for the result. ,in For hash functions; Step 3 Generate proof for the prediction process .

4. The machine learning integrity proof method based on zero-knowledge proof according to claim 3, characterized in that, client The method for verifying the completeness of the prediction process and the authenticity of the delivered results is as follows: Step 1 Verification of predictions ; Step 2: If the verification result obtained in Step 1 is 1, then Payment according to the preset schedule Delivery forecast results; Step 3 Perform a hash function on the actual received prediction results to obtain the hash value of the delivery result. ,when At that time, determine the received forecast results and the service provider generate The prediction results used at that time were consistent.

5. A machine learning integrity proof system based on zero-knowledge proof applied to the method of any one of claims 1-4, characterized in that, include: client It is used to propose task requirements and datasets, verify the completeness of the task, and obtain results consistent with the verification content; Service Provider It is used to perform task requirements using a provided dataset, demonstrate the integrity of the task process, and deliver task results.

Citation Information

Patent Citations

  • Auditable outsourcing machine learning service method for providing integrity verification

    CN112488227A

  • Trusted model training method based on federal learning

    CN116628504A