Quantum neural network privacy protection method and system for protecting input data and parameters

By combining quantum homomorphic encryption and measurement-based quantum computing models in quantum neural networks, the homomorphic encryption circuit of quantum turntables is solved, and the problems of difficulty in balancing privacy and availability and small key space in the existing technology are realized. Efficient and secure quantum machine learning privacy protection.

CN117675196BActive Publication Date: 2025-02-14CHENGDU UNIV OF INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311725097.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2025-02-14
Estimated Expiration
2043-12-15

AI Technical Summary

Technical Problem

While protecting data and parameters, existing privacy protection methods of quantum machine learning are difficult to achieve a good balance between privacy and algorithm model availability, and the key space is small and security is limited.

Method used

By combining quantum homomorphic encryption and measurement-based quantum computing models, a quantum neural network privacy protection method is designed, using homomorphic encryption circuits of quantum rotating doors such as Rz, Rx and Ry to hide model parameters and circuit design to increase the density Key space, improve security.

Benefits of technology

It realizes comprehensive privacy protection for input data and training parameters, maintains the efficiency and availability of the algorithm model, and improves the security and calculation accuracy of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117675196B_ABST
    Figure CN117675196B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of privacy protection of quantum machine learning, and discloses a privacy protection method and system for a quantum neural network for protecting input data and training parameters, including: normalizing an original sample set; dividing the sample into a test sample set and a training sample set; preparing the attribute values ​​of the test sample and the training sample set in quantum states according to angle coding or amplitude coding; and Z Operator encryption quantum state; using R z The parameter circuit, #imgabs0# circuit and #imgabs1# circuit can be hidden to construct the homomorphic encryption circuit design of Ansatz in the quantum neural network model, and the circuit design is sent to the quantum cloud server for model training; the encryption key is updated. The present invention aims to solve the privacy security problem of data and parameters of quantum neural networks in the field of quantum machine learning, without affecting the original accuracy and availability of the algorithm, and has lower complexity and higher security than other privacy protection schemes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of quantum machine learning privacy protection, and in particular, relates to a quantum neural network privacy protection method and system for protecting input data and training parameters. Background Art

[0002] Currently, machine learning is often used to discover knowledge from big data and has achieved significant success in the past decade. In the era of big data, a service model called machine learning as a service was born and widely used. Users entrust machine learning tasks to cloud servers with powerful computing power. Although this service brings convenience to people, it also brings the problem of privacy leakage. Privacy protection in machine learning has become a research hotspot, and many literatures provide different privacy protection schemes for different machine learning models.

[0003] Quantum machine learning is an emerging interdisciplinary field that explores the interaction between machine learning and quantum physics. Quantum machine learning uses the parallelism of quantum computing to process machine learning tasks, thereby accelerating the tasks. Ordinary users entrust quantum machine learning tasks to quantum cloud servers because they cannot afford expensive quantum computers, which also raises privacy issues. Therefore, the privacy protection of quantum machine learning based on cloud servers has also attracted much attention.

[0004] Privacy protection in quantum machine learning is an emerging field and has been widely studied. Most of the existing literature protects privacy through quantum homomorphic encryption, quantum differential privacy, and quantum secure multi-party computation. Each method achieves privacy protection in different ways and provides different levels of security and availability. Quantum homomorphic encryption schemes require users with simple quantum capabilities to encrypt information and require some additional quantum gates to protect privacy. This method can ensure that it is not affected by the calculation of any side of the server during training. However, most quantum homomorphic encryption schemes only consider and implement the protection of input privacy, while ignoring the protection of parameters in the circuit, which will expose the model information in the quantum neural network. In addition, their key space is too small and the security is not high. The scheme based on the differential privacy method adds additional noise to the input to protect privacy at the expense of certain availability and usability, and is simple to implement. Quantum secure multi-party computation schemes are usually based on these two technologies and blind quantum computing. Quantum secure multi-party computation encrypts the input by adding noise, quantum gates, and users with quantum capabilities to achieve the purpose of privacy protection with relatively low additional complexity and high security.

[0005] At present, the privacy protection methods of quantum machine learning are mainly divided into two aspects: quantum homomorphic encryption technology and quantum differential privacy technology:

[0006] (1) Quantum homomorphic encryption (QHE) technology plays an important role in protecting data privacy during quantum computing. Most QHE schemes require the client to have simple quantum capabilities or require additional quantum gates, but this technology can effectively protect data privacy. Fisher et al. proposed a homomorphic encryption scheme with a universal gate set. And in this scheme, any quantum computation can be performed on the encrypted qubits. However, the client can only use random operators X and Z to encrypt qubits. Subsequently, MA et al. improved the scheme. The improved protocol uses circuit-based quantum computing to design a homomorphic encryption scheme for universal gate sets. This homomorphic encryption scheme selects random operators X, Z, and T to encrypt qubits. But the encryption space is still small. In theory, the universal gate set selected by the protocol can approximate any unitary operator gate with a small enough error, but in practical applications, it is generally difficult to approximate any unitary gate. Gong et al. proposed a ciphertext retrieval scheme based on QHE, and then proposed a similar quantum homomorphic encryption scheme for the quantum k-means algorithm. This scheme only uses random operators X and Z to encrypt qubits and construct T gate circuits, which requires a trusted third party.

[0007] (2) Quantum differential privacy (QDP) uses noise to perturb the original data to protect data privacy. However, this technology comes at the cost of accuracy and availability, and it also requires additional quantum gates. Senekane et al. demonstrated a new quantum logistic regression machine learning based on QDP. The protocol selects discrete Laplace noise as the noise mechanism and uses it to perturb the input. Du et al. designed a quantum differential private Lasso estimator to solve the sparse regression problem. Compared with the classical lasso regression algorithm, in some cases, this scheme can protect privacy and is faster than the classical algorithm. Huang et al. proposed a scheme that applies additional quantum random rotation noise to the quantum input. This scheme is able to resist adversarial attacks, and the computational complexity of the algorithm is the same as the original scheme.

[0008] Although there are studies on quantum machine learning, most of them have not received much attention, and there are few studies on privacy-preserving quantum machine learning. Under the premise of protecting data and parameter privacy, effective usability and acceptable computational and communication complexity should also be considered, which is lacking in the existing literature. This paper proposes a quantum neural network that protects the privacy of input data and training parameters. At the same time, we also balance computational complexity, usability, accuracy, and security in our scheme.

[0009] Through the above analysis, the problems and defects of the prior art are as follows:

[0010] 1. Insufficient data and parameter privacy protection:

[0011] Most existing technologies only focus on protecting data privacy, but ignore the privacy protection of training parameters, which is insufficient in many scenarios.

[0012] 2. Difficulty in balancing privacy and usability:

[0013] Although differential privacy technology protects data privacy to some extent, it is often difficult to achieve a good balance between protecting privacy and maintaining the usability of algorithm models.

[0014] 3. Small key space and limited security:

[0015] In existing privacy protection technologies, the key space is small, which limits its security, especially in the face of complex attacks. Summary of the invention

[0016] In view of the technical problems and defects in the background technology, the claims of the present invention propose a privacy protection method for quantum neural networks that protects input data and training parameters, and achieves significant technical progress after solving these problems. The following is a detailed analysis of how the present invention solves the existing technical problems and achieves technical progress:

[0017] Means for solving the problem in the present invention

[0018] 1. Simultaneous protection of data and parameters:

[0019] The present invention uses quantum encryption technology to protect the privacy of input data and training parameters at the same time, which provides unprecedented data and parameter privacy protection in the quantum field.

[0020] 2. Balance between privacy and algorithm model usability:

[0021] By utilizing the characteristics of quantum computing, the present invention can maintain the efficiency and usability of the algorithm model while protecting data privacy, achieving a better balance between privacy and usability.

[0022] 3. Increase key space and improve security:

[0023] Due to its quantum properties, quantum encryption technology provides a larger key space than traditional technology, which greatly enhances the security of the system.

[0024] Technical effects and significant progress

[0025] 1. Comprehensive privacy protection:

[0026] The present invention not only protects data privacy, but also protects training parameters, which is very important for application scenarios that need to protect the algorithm itself and data.

[0027] 2. Improve data processing efficiency and security:

[0028] Through the high efficiency of quantum computing, the present invention can quickly process complex data while protecting the security of data and parameters through quantum encryption.

[0029] 3. Wide applicability:

[0030] The present invention is applicable to a variety of data sets and tasks, including medical data processing, financial risk assessment, etc., showing broad application potential.

[0031] 4. Leverage the advancement of quantum technology:

[0032] Combining the advanced technologies of quantum computing and quantum encryption, the present invention has achieved a major technological breakthrough in the field of privacy protection.

[0033] By combining quantum computing and quantum encryption technology, the present invention not only solves the problems of the prior art in data and parameter privacy protection, the balance between privacy and algorithm model availability, and the size of the key space, but also achieves significant technological progress in data processing efficiency, security, and application applicability.

[0034] The present invention is a quantum neural network privacy protection method for protecting input data and training parameters. By combining quantum homomorphic encryption and a measurement-based quantum computing model, user data and training parameters contained in the quantum neural network can be hidden, ultimately achieving the purpose of protecting user data and parameter privacy in a cloud environment. The quantum neural network privacy protection method for protecting input data and training parameters includes:

[0035] Step 1: Data preprocessing: The client normalizes the original sample set so that the data is distributed within a uniform range.

[0036] Step 2: Sample division: the client divides the preprocessed data into a test sample set and a training sample set;

[0037] Step 3: quantum state preparation: the client prepares the attribute values ​​of the sample to be tested and the training sample set into quantum states according to angle coding or amplitude coding, and uses the quantum state as the input of the quantum algorithm.

[0038] Step 4: Quantum state encryption. The client uses random X and R Z The operator encrypts the quantum state, prepares enough encryption auxiliary qubits, and sends all the encrypted quantum states to the quantum server;

[0039] Step 5: Hidden parameter quantum neural network circuit design. The client uses R z Can hide parameter circuit, Circuit and The circuit constructs the homomorphic encryption circuit design of Ansatz in the quantum neural network model, hides the key parameters and the original circuit design, and sends the circuit design to the quantum cloud server for model training;

[0040] Step six: Update the encryption key. The client updates the encryption key according to the circuit design and formula. After the server completes all quantum gate operations, the client sends the final decryption key to the server. The server decrypts and measures the quantum state, obtains the expected result and sends it to the client.

[0041] Furthermore, the quantum state encryption in step 4 specifically includes the following steps:

[0042] S401: Calculate R z Hidden parameter homomorphic encryption;

[0043] S402: Calculate R x Hidden parameter homomorphic encryption;

[0044] S403: Calculate R y Hidden parameter homomorphic encryption.

[0045] Further, the calculation of R in S401 z The hidden parameter homomorphic encryption specifically includes:

[0046] R φ (α)+R φ (β) = R φ (α+β), #(1)

[0047] Applying formula (1), we get the equation:

[0048] (X a R z (ω))|φ>≡X a R z (ω-θ+θ)|φ>≡(X a R z (ω-θ))R z (θ)|φ>,#(2)

[0049] Where a∈{0,1},ω,θ∈[0,2π]. Transforming the above equation into the following form is similar to R z Homomorphic encryption equation for (θ)

[0050] (R z (θ-ω)X a )(X a R z (ω))|φ>≡R z (θ)|φ>,#(3)

[0051] Further, in S402, R is calculated x The hidden parameter homomorphic encryption constructs R x (θ) operator, and based on R z The characteristic of hiding parameters can be used to optimize the circuit and realize R x (θ) The homomorphic encryption method of the operator hidden parameters is used to adjust the measurement angle Hidden R contains the parameter θ z (θ) quantum gate, which realizes the function of hiding the parameter θ from the quantum cloud server and modifies R z (θ) homomorphic encryption circuit, the optimized circuit uses R z The feature of hiding parameters protects the privacy of parameters and circuit design:

[0052] For ease of description, we use To represent R x (θ) is the homomorphic encryption circuit with hidden parameters, where δ 1 , are the two measurement angles sent by the client to the server. According to equations (4) and (5),

[0053] HR z (θ) = R x (θ)H,HR x (θ) = R z (θ)H, #(4)

[0054] R x (θ)≡HR z (θ)H.#(5)

[0055] For R x (θ) The designed circuit functions are as follows:

[0056]

[0057] exist and a∈{0,1},ω,γ∈[0,2π] are encryption keys. p,q,r∈{0,1} are the measurement results sent by the server to the client. is the measured angle sent by the client to the server, where h 1 ,h 2 ∈{0, 1} is randomly selected by the client;

[0058] Then, given R x The homomorphic encryption scheme of (θ) is as follows:

[0059]

[0060] This means that the circuit operates Then use the decryption key m, n and decryption function To decrypt the ciphertext (X a R z (ω))|φ>, this operation is equivalent to performing operation R on the plaintext |φ> x (θ), where the parameter θ contains the measured angle sent by the client to the server. , but the server cannot Derive θ;

[0061] Next, verify The correctness of the four encrypted quantum states X a R z (ω)|φ>,R z (α)|+>,R z (β)|+> and R z After (γ)|+> is input into the circuit, where a∈{0,1}, α, β, γ, ω∈[0,2π] is the encryption key and is kept secret from the server, the calculation process is as follows:

[0062]

[0063] let where h 1 ∈{0, 1} is randomly selected by the user. The above equation can be modified into the following form:

[0064]

[0065] let where h 2 ∈{0, 1} is randomly selected by the user, and the above equation can be modified into the following form:

[0066]

[0067]

[0068] in and

[0069] Using R z Circuit to help construct R x (θ) is a hidden parameter homomorphic encryption circuit, operator R x The parameter θ in (θ) can be kept secret from the server.

[0070] Further, the S403 calculates R y The hidden parameter homomorphic encryption specifically includes:

[0071] From formula (11), we can see that

[0072]

[0073] Rotation operator R y Can be R x and R z Combined, the following equation is easy to verify:

[0074]

[0075] According to formula (12), based on R z The property of hiding parameters can be found in R x The implicit parameter homomorphic encryption circuit structure of (θ) can also be used to construct R y (θ) is a hidden parameter homomorphic encryption circuit, which is the same as R x (θ) is different in that its first measured angle is The final output state becomes

[0076]

[0077] in and Operator R y The parameter θ in (θ) can also be kept secret from the server. The operator R x The same is true for (θ), Represents R y Hidden parameter homomorphic encryption circuit of (θ).

[0078] Furthermore, the privacy protection method of the quantum neural network for protecting input data and training parameters is tested using the Iris dataset and the MNIST dataset. An open source library Qiskit is used in the experiment. In the experiment, the amplitude coding method is used to encode classical data into quantum states, and the number of classical data inputs is set to 4 bits, that is, the number of quantum states is 2 bits. The iris dataset with four features can be used directly in the experiment, but for the high-dimensional MNIST image data, it needs to be processed by dimensionality reduction, and the direct autoencoder model based on the Tensorflow tutorial is selected to reduce the data dimension.

[0079] Another object of the present invention is to provide a quantum neural network privacy protection system for protecting input data and training parameters, wherein the quantum neural network privacy protection system for protecting input data and training parameters comprises:

[0080] The data preprocessing module is used to normalize the original sample set and divide it into a test sample set and a training sample set;

[0081] The encryption module is used to encrypt the quantum state and send all the encrypted quantum states to the quantum server;

[0082] Training module, used for model training;

[0083] The key update module is used to update the encryption key according to the circuit design and formula.

[0084] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the quantum neural network privacy protection method for protecting input data and training parameters.

[0085] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the quantum neural network privacy protection method for protecting input data and training parameters.

[0086] Another object of the present invention is to provide an information data processing terminal, which is used to implement the quantum neural network privacy protection system that protects input data and training parameters.

[0087] In combination with the above technical solutions and the technical problems solved, please analyze the advantages and positive effects of the technical solutions to be protected by the present invention from the following aspects:

[0088] First, in order to protect the privacy of data and model parameters of quantum neural networks, the present invention proposes a z (θ), R x (θ), R y (θ), CZ}, and applies the scheme to quantum neural networks. In our privacy-preserving quantum neural network, the client only needs to have simple quantum capabilities, and the encryption and decryption methods are also simple. The circuit design sent by the client to the server can be easily constructed. In other words, our invention is easy to implement. Practice has proved that the invention can effectively protect the privacy of input and model parameters, while the computational complexity is relatively low compared with other existing schemes.

[0089] Second, the present invention has higher security: it proposes a homomorphic encryption method and circuit design for hiding the parameters of the quantum rotating gate, which not only protects the privacy of the input, but also hides the parameters of the quantum rotating gate, thereby improving security.

[0090] The present invention does not reduce the accuracy and usability of the algorithm: By experimentally comparing with a quantum neural network model without privacy protection on a real data set, we found that our scheme does not reduce the accuracy of the algorithm.

[0091] The present invention has higher calculation accuracy and efficiency: the design concept of hiding part of the circuit gate to hide parameters in the present invention can reduce the influence of noise and improve the calculation accuracy and efficiency.

[0092] The privacy protection method for quantum neural networks for protecting input data and training parameters provided by the present invention has the advantages of higher security, computational accuracy, efficiency and will not reduce the accuracy and availability of the algorithm, and has broad application prospects in the privacy protection field of quantum machine learning.

[0093] Third, the privacy protection method of quantum neural network for protecting input data and training parameters provided by the present invention provides a novel solution to the privacy security problem of quantum neural network. The main technical advances of this method can be described from the following aspects:

[0094] 1. Enhance data privacy protection

[0095] Quantum state encryption: By encrypting the quantum state on the client side and decrypting it on the server side, this method ensures the security of quantum data during transmission and processing. This is especially important for processing sensitive data (such as medical information, personal identification information, etc.).

[0096] Hiding training parameters: The design of homomorphic encryption circuits allows quantum neural networks to be trained without exposing key parameters. This enhances security and privacy during model training.

[0097] 2. Ensure the integrity and security of model training

[0098] Homomorphic encryption of hidden parameters: By hiding the parameters, the method ensures that even if the quantum server is attacked, the key model parameters will not be leaked. This is crucial to ensure the integrity and security of the model.

[0099] Encrypted quantum gate operations: This method further protects the data and models during the training process by encrypting the quantum gate operations.

[0100] 3. Flexibility and adaptability

[0101] Applicable to a variety of datasets: This method is not only applicable to small-scale datasets (such as Iris), but can also be applied to more complex datasets (such as MNIST), showing its wide applicability.

[0102] Dimensionality reduction: For high-dimensional data, dimensionality reduction is performed by using autoencoders. This method can adapt complex data sets to quantum neural networks, increasing their practicality.

[0103] 4. Experimental verification and use of open source tools

[0104] Experimental verification: The effectiveness of the method has been verified by conducting experiments on the open source quantum computing platform Qiskit, which increases its practicality and credibility.

[0105] Open Source Tools: We used the open source library Qiskit to conduct experiments, demonstrating the compatibility of this method with existing quantum computing tools, making it easier for the method to be adopted and applied by the quantum computing community.

[0106] The method provided by the present invention brings significant technical progress in protecting data privacy and parameter security in quantum neural network training. By combining quantum computing and encryption technology, it provides an effective solution for processing sensitive data and building secure quantum machine learning models. BRIEF DESCRIPTION OF THE DRAWINGS

[0107] Figure 1 is a flow chart of a quantum neural network privacy protection method for protecting input data and training parameters provided by an embodiment of the present invention;

[0108] Figure 2 (a) is R provided in the embodiment of the present invention z (θ) is a homomorphic encryption circuit, (b) is an R provided by an embodiment of the present invention z (θ) is a hidden parameter homomorphic encryption circuit;

[0109] Figure 3 is R provided by the embodiment of the present invention x (θ) The structure of the homomorphic encryption circuit;

[0110] Figure 4 is R provided by the embodiment of the present invention x (θ) Hidden parameter homomorphic encryption circuit structure;

[0111] Figure 5 is R provided by the embodiment of the present invention x (θ) A simple representation of the circuit with hidden parameters in ;

[0112] Figure 6 is R provided by the embodiment of the present invention y (θ) A simple representation of the circuit with hidden parameters in ;

[0113] Figure 7 It is a redesigned hidden layer homomorphic encryption circuit provided by an embodiment of the present invention;

[0114] Figure 8 It is a comparison chart of algorithm accuracy and loss results of QNN and the proposed solution on the Iris dataset provided by an embodiment of the present invention;

[0115] Fig. 9It is a comparison chart of the algorithm accuracy and loss results of the HQCNN provided by an embodiment of the present invention and the proposed solution on the MNIST data set. DETAILED DESCRIPTION

[0116] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0117] The present invention is based on the quantum neural network privacy protection method for protecting input data and training parameters. Two specific application embodiments and implementation schemes thereof are proposed below:

[0118] Application Example 1: Secure Medical Data Processing

[0119] 1. Data preprocessing and encryption:

[0120] In medical institutions (clients), patients’ medical data (such as MRI scans, blood test results) are collected and normalized.

[0121] The data is converted into a quantum state using a quantum state preparation method, and the quantum state is encrypted using homomorphic encryption.

[0122] 2. Quantum neural network training:

[0123] The encrypted quantum data is sent to the quantum server.

[0124] The quantum server uses hidden parameter quantum neural network circuits to train and process data without knowing the actual data content.

[0125] 3. Decryption and result analysis:

[0126] After the training is completed, the quantum server returns the results to the medical institution.

[0127] Medical institutions use decryption keys to decrypt the results and make disease diagnoses or treatment recommendations.

[0128] #Application value:

[0129] The privacy and security of patient data is ensured.

[0130] Taking advantage of quantum computing improves the efficiency of data processing and analysis.

[0131] Application Example 2: Security Financial Risk Assessment

[0132] 1. Financial data preprocessing and encryption:

[0133] In financial institutions (clients), customers’ financial transaction data, such as credit card transactions and stock market transaction records, are collected and normalized.

[0134] Quantum state preparation and homomorphic encryption technology are used to convert these data into encrypted quantum states.

[0135] 2. Risk assessment model training:

[0136] The encrypted quantum data is sent to the quantum server.

[0137] The server uses hidden parameter quantum neural networks to train data and assess financial risks without being able to access the actual financial data content.

[0138] 3. Decryption and application of results:

[0139] Once training is complete, the results are sent back to the financial institution.

[0140] Financial institutions use decryption keys to decrypt the results for risk assessment and decision making.

[0141] #Application value:

[0142] Protect sensitive financial data while leveraging quantum computing for efficient risk analysis.

[0143] Provides financial institutions with a powerful tool to identify and manage potential financial risks.

[0144] These two application examples demonstrate the powerful application potential of quantum neural network privacy protection methods in processing sensitive data, especially in areas where data privacy and security need to be ensured, such as healthcare and financial services. By combining quantum computing and encryption technology, this method not only improves the efficiency of data processing, but also ensures data security and privacy.

[0145] like Figure 1 As shown, the privacy protection method of a quantum neural network for protecting input data and training parameters provided by an embodiment of the present invention includes the following steps:

[0146] S101, data preprocessing, the client performs normalization processing on the original sample set so that the data is distributed within a uniform range;

[0147] S102, sample division, the client performs sample division on the preprocessed data to obtain a test sample set and a training sample set;

[0148] S103, quantum state preparation: the client performs quantum state preparation on the attribute values ​​of the sample to be tested and the training sample set according to angle coding or amplitude coding, and uses the quantum state as the input of the quantum algorithm;

[0149] S104, quantum state encryption, the client uses random X and R Z The operator encrypts the quantum state, prepares enough encryption auxiliary qubits, and sends all the encrypted quantum states to the quantum server;

[0150] S105, Hidden Parameter Quantum Neural Network Circuit Design, Client Using R z Can hide parameter circuit, Circuit and The circuit constructs the homomorphic encryption circuit design of Ansatz in the quantum neural network model, hides the key parameters and the original circuit design, and sends the circuit design to the quantum cloud server for model training;

[0151] S106, update the encryption key. The client updates the encryption key according to the circuit design and formula. After the server completes all quantum gate operations, the client sends the final decryption key to the server, which does not compromise the privacy of the input data and parameters. Then, the server decrypts and measures the quantum state, obtains the expected result and sends it to the client.

[0152] The quantum state encryption in step 4 provided in the embodiment of the present invention specifically includes the following steps:

[0153] S401: Calculate R z Hidden parameter homomorphic encryption;

[0154] S402: Calculate R x Hidden parameter homomorphic encryption;

[0155] S403: Calculate R y Hidden parameter homomorphic encryption.

[0156] In S401 provided in the embodiment of the present invention, R is calculated z The hidden parameter homomorphic encryption specifically includes:

[0157] R φ (α)+R φ (β) = R φ (α+β), #(1)

[0158] Applying formula (1), we get the equation:

[0159] (X a R z (ω))|φ>≡X a R z (ω-θ+θ)|φ>≡(X a R z (ω-θ))R z (θ)|φ>,#(2)

[0160] Where a∈{0,1},ω,θ∈[0,2π]. Transforming the above equation into the following form is similar to R z Homomorphic encryption equation for (θ)

[0161] (R z (θ-ω)X a )(X a R z (ω))|φ>≡R z (θ)|φ>,#(3)

[0162] This means that in the ciphertext (X a R z (ω))|φ> performs operation R z (θ-ω)X a This is equivalent to performing operation R on the plaintext |φ> z (θ), where operation (R z (θ-ω)X a )(X a R z (ω))|φ> can be viewed as a decryption function using the decryption key a and θ-ω and the decryption function R z (θ-ω)X a To decrypt the ciphertext R z (θ-ω)X a This property is crucial because it not only reduces the number of gates in the homomorphic encryption circuit, but also hides the parameters θ and the operations R performed on the state |φ〉 z (θ), used to encrypt the state X a R z (ω)|φ>. Figure 2 (a) and (b) are respectively R provided in the embodiments of the present invention. z (θ) homomorphic encryption circuit and hidden parameter homomorphic encryption circuit.

[0163] In S402, R is calculated according to the embodiment of the present invention. x The hidden parameter homomorphic encryption specifically includes:

[0164] Construct R x (θ) operator, and based on R z The characteristic of hiding parameters is used to optimize the circuit and realize R x (θ) operator hidden parameters homomorphic encryption method. By adjusting the measurement angle Hidden R contains the parameter θ z (θ) quantum gate, thereby realizing the function of hiding the parameter θ from the quantum cloud server and modifying R z (θ) is a homomorphic encryption circuit. The optimized circuit uses R zThe feature of hiding parameters protects the privacy of parameters and circuit design. Figure 3 is R provided by the embodiment of the present invention x (θ) is the structure of the homomorphic encryption circuit, where X a R z (θ)|φ> is the encrypted input, R z (α)|+>,R z (β)|+>,R z (γ)|+> is the encrypted auxiliary qubit. p,q,r∈{0,1} is the measurement result sent by the server to the client, δ 1 , δ 2 ∈[0, 2π] is the measured angle sent by the client to the server. M(δ 1 ) indicates the measurement basis and M(0) and M(δ 2 ) and M(δ 1 ) is similar. 1 ,h 2 ∈{0, 1} is randomly selected by the Client. Figure 4 is R provided by the embodiment of the present invention x (θ) is a hidden parameter homomorphic encryption circuit structure. The dotted line surrounds the part Figure 5 Different, the third measurement angle By adjusting the measuring angle R does not work in the circuit z Gates can protect the privacy of parameters and circuit designs. Figure 5 is R provided by the embodiment of the present invention x (θ) A simple representation of a circuit with hidden parameters in .

[0165] For ease of description, To represent R x (θ) is the homomorphic encryption circuit with hidden parameters, where δ 1 , are the two measured angles sent by the client to the server. According to equations (4) and (5),

[0166] HR z (θ) = R x (θ)H,HR x (θ) = R z (θ)H, #(4)

[0167] R x (θ)≡HR z (θ)H.#(5)

[0168] For R x (θ) The designed circuit functions are as follows:

[0169]

[0170] exist and a∈{0,1},ω,γ∈[0,2π] are encryption keys. p,q,r∈{0,1} are the measurement results sent by the server to the client. is the measured angle sent by the client to the server, where h 1 ,h 2 ∈{0, 1} is randomly chosen by the client.

[0171] Finally, given R x The homomorphic encryption scheme of (θ) is as follows:

[0172]

[0173] This means that the circuit operates Then use the decryption key m, n and decryption function To decrypt the ciphertext (X a R z (ω))|φ>, this operation is equivalent to performing operation R on the plaintext |φ> x (θ), where the parameter θ contains the measured angle sent by the client to the server. , but the server cannot Derive θ.

[0174] Next, verify The correctness of the four encrypted quantum states X a R z (ω)|φ>,R z (α)|+>,R z (β)|+> and R z After (γ)|+> is input into the circuit, where a∈{0,1}, α, β, γ, ω∈[0,2π] is the encryption key and is kept secret from the server, the calculation process is as follows:

[0175]

[0176] let where h 1 ∈{0, 1} is randomly selected by the user. The above equation can be modified into the following form:

[0177]

[0178] let where h 2 ∈{0, 1} is randomly selected by the user. The above equation can be modified into the following form:

[0179]

[0180] in and

[0181] Using R z Circuit to help construct R x (θ) is a hidden parameter homomorphic encryption circuit. From formula (5), we can see that if R z The parameter θ in (θ) is unknown to the Server, so the rotation operator R x The rotation angle in (θ) is unknown to the Server. That is, the operator R x The parameter θ in (θ) can be kept secret from the server. x The (θ) gate is often used in parameterized quantum circuits, and the parameter θ is one of the model parameters of quantum neural networks. Therefore, if we use To construct a quantum neural network, we can x The model parameters in the gate are kept secret from the server.

[0182] S403 calculation R provided in the embodiment of the present invention y The hidden parameter homomorphic encryption specifically includes:

[0183] From formula (11), we can see that

[0184]

[0185] Rotation operator R y Can be R x and R z The following equation is easy to verify:

[0186]

[0187] According to formula (12), based on R z The property of hiding parameters, we find that R x The implicit parameter homomorphic encryption circuit structure of (θ) can also be used to construct R y (θ) is a hidden parameter homomorphic encryption circuit. The circuit is similar to R x (θ) is different in that its first measured angle is The final output state becomes

[0188]

[0189] in and

[0190] Operator R yThe parameter θ in (θ) can also be kept secret from the server. The operator R x The same is true for (θ). The analysis is similar. We use Represents R y Hidden parameter homomorphic encryption circuit of (θ). Figure 6 is R provided by the embodiment of the present invention y (θ) A simple representation of a circuit with hidden parameters in .

[0191] The embodiments of the present invention are tested using the Iris dataset and the MNIST dataset to verify the effectiveness and security of the present invention. The experiment uses an open source library Qiskit. In the experiment, we use the amplitude coding method to encode the classical data into quantum states, and set the number of classical data inputs to 4 bits, that is, the number of quantum states is 2 bits. The iris dataset with four features can be used directly in the experiment, but for the high-dimensional MNIST image data, we need to perform dimensionality reduction processing on it. We choose a direct autoencoder model based on the Tensorflow tutorial to reduce the data dimension, which is a classic neural network model. That is, we use a hybrid quantum classical neural network (HQCNN) in the MNIST data experiment, which is a hybrid quantum classical algorithm.

[0192] The quantum neural network privacy protection system for protecting input data and training parameters provided by the embodiment of the present invention includes:

[0193] The data preprocessing module is used to normalize the original sample set and divide it into a test sample set and a training sample set;

[0194] The encryption module is used to encrypt the quantum state and send all the encrypted quantum states to the quantum server;

[0195] Training module, used for model training;

[0196] The key update module is used to update the encryption key according to the circuit design and formula.

[0197] The privacy protection method for a quantum neural network for protecting input data and training parameters provided in an application embodiment of the present invention is applied to a computer device, wherein the computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the privacy protection method for a quantum neural network for protecting input data and training parameters.

[0198] The quantum neural network privacy protection method for protecting input data and training parameters provided in the application embodiment of the present invention is applied to an information data processing terminal, and the information data processing terminal is used to implement the quantum neural network privacy protection system for protecting input data and training parameters.

[0199] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0200] To verify the feasibility and effectiveness of the privacy protection method for quantum neural networks that protects input data and training parameters:

[0201] Experiment (1) uses the Iris dataset and the MNIST dataset to test the proposed method in this paper, verifying the effectiveness and security of our privacy protection method. We use the amplitude coding method to encode classical data into quantum states, and set the number of classical data inputs to 4 bits, that is, the number of quantum states to 2 bits. The iris dataset with four features can be used directly in the experiment, but for the high-dimensional MNIST image data, we need to reduce its dimensionality. We choose the direct autoencoder model based on the Tensorflow tutorial to reduce the data dimension, which is a classic neural network model. That is, we use the hybrid quantum classical neural network (HQCNN) in the MNIST data experiment, which is a hybrid quantum classical algorithm.

[0202] In the experiment of the present invention, according to R z (θ) circuit, and Circuit, we redesign the circuit into a homomorphic encryption circuit with hidden circuit design and parameters, such as Figure 7 As shown, the input data and parameters θ can be protected 1 ,…,θ 10 These parameters are included in the measurement angle and updated encryption keys.

[0203] Through experiments, the original algorithm is compared with the privacy-preserving scheme proposed in this paper. Figure 8 and Fig. 9As shown in Figure 2, by comparison, it is found that the loss and accuracy of the scheme with privacy protection are similar to those of the scheme without privacy protection. In other words, our privacy protection scheme has no impact on machine learning training.

[0204] The above simulation experiments verify and apply the proposed algorithm, proving the usability and effectiveness of the algorithm. In addition, the operator set is also a universal quantum gate set. We can decompose any quantum state into a series of single-qubit rotations and two-qubit gates. Therefore, the client in our protocol only needs to prepare the ability of a single quantum state, because the circuit used to encode classical data can be decomposed, and this scheme can be used in the circuit to protect private data and parameters. In future work, we will study the feasibility of using this method to achieve privacy protection for users with low quantum capabilities and the comprehensive effect evaluation of privacy protection.

[0205] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A privacy protection method for a quantum neural network for protecting input data and training parameters, characterized in that: include: Step 1: Data preprocessing: The client normalizes the original sample set so that the data is distributed within a uniform range. Step 2: Sample division: the client divides the preprocessed data into a test sample set and a training sample set; Step 3: quantum state preparation: the client prepares the attribute values ​​of the sample to be tested and the training sample set into quantum states according to angle coding or amplitude coding, and uses the quantum state as the input of the quantum algorithm. Step 4: Quantum state encryption. The client uses random X and R Z The operator encrypts the quantum state, prepares enough encryption auxiliary qubits, and sends all the encrypted quantum states to the quantum server; Step 5: Hidden parameter quantum neural network circuit design. The client uses R z Can hide parameter circuit, Circuit and The circuit constructs the homomorphic encryption circuit design of Ansatz in the quantum neural network model, hides the key parameters and the original circuit design, and sends the circuit design to the quantum cloud server for model training; Step 6: Update the encryption key. The client updates the encryption key according to the circuit design and formula. After the server completes all quantum gate operations, the client sends the final decryption key to the server. The server decrypts and measures the quantum state, obtains the expected result and sends it to the client. The quantum state encryption in step 4 specifically includes the following steps: S401: Calculate R z Hidden parameter homomorphic encryption; S402: Calculate R x Hidden parameter homomorphic encryption; S403: Calculate R y Hidden parameter homomorphic encryption; The calculation of R in S401 z The hidden parameter homomorphic encryption specifically includes: R φ (a)+R φ (b)=R φ (a+b),#(1) Applying formula (1), we get the equation: (X a R z (ω))|φ>≡X a R z (ω-θ+θ)|φ> ≡(X a R z (ω-θ))R z (θ)|φ>,#(2) Where a∈{0,1},ω,θ∈[0,2π]; Transforming the above equation into the following form is similar to R z Homomorphic encryption equation for (θ) (R z (θ-ω)X a )(X a R z (ω))|φ>≡R z (θ)|φ>,#(3) The calculation of R in S402 x The hidden parameter homomorphic encryption constructs R x (θ) operator, and based on R z The characteristic of hiding parameters can be used to optimize the circuit and realize R x (θ) The homomorphic encryption method of the operator hidden parameters is used to adjust the measurement angle Hidden R contains the parameter θ z (θ) quantum gate, which realizes the function of hiding the parameter θ from the quantum cloud server and modifies R z (θ) homomorphic encryption circuit, the optimized circuit uses R z The feature of hiding parameters protects the privacy of parameters and circuit design: use To represent R x (θ) Homomorphic encryption circuit with hidden parameters, where δ1, are the two measurement angles sent by the client to the server. According to equations (4) and (5), HR z (θ)=R x (θ)H, HR x (θ)=R z (θ)H,#(4) R x (θ)≡HR z (i)H.#(5) For R x (θ) The designed circuit functions are as follows: exist and a∈{0,1},ω,γ∈[0,2ππ] are encryption keys; p,q,r∈{0,1} are the measurement results sent by the server to the client, is the measured angle sent by the client to the server, where h1,h2∈{0,1} is randomly chosen by the client; Then, given R x The homomorphic encryption scheme of (θ) is as follows: Next, verify The correctness of the four encrypted quantum states X a R z (ω)|φ>,R z (α)|+>,R z (β)|+> and R z After (γ)|+> is input into the circuit, where a∈{0,1}, α, β, γ, ω∈[0,2π] is the encryption key and is kept secret from the server, the calculation process is as follows: let Where h1∈{0,1} is randomly selected by the user. The above equation can be modified into the following form: let Where h2∈{0,1} is randomly selected by the user, the above equation can be modified to the following form: in and Using R z Circuit Configuration x (θ) is a hidden parameter homomorphic encryption circuit, operator R x The parameter θ in (θ) can be used to determine the server r Confidentiality; The S403 calculates R y The hidden parameter homomorphic encryption specifically includes: From formula (11), we can see that Rotation operator R y Can be R x and R z Combined, the following equation is easy to verify: According to formula (12), the final output state becomes: in and Operator R y The parameter θ in (θ) can also be kept secret from the server. The operator R x The same is true for (θ), Represents R y Hidden parameter homomorphic encryption circuit of (θ).

2. The privacy protection method for a quantum neural network for protecting input data and training parameters according to claim 1, characterized in that: The quantum neural network privacy protection method for protecting input data and training parameters is tested using the Iris dataset and the MNIST dataset.

3. A quantum neural network privacy protection system for protecting input data and training parameters according to any one of claims 1 to 2, characterized in that: The quantum neural network privacy protection system for protecting input data and training parameters includes: The data preprocessing module is used to normalize the original sample set and divide it into a test sample set and a training sample set; The encryption module is used to encrypt the quantum state and send all the encrypted quantum states to the quantum server; Training module, used for model training; The key update module is used to update the encryption key according to the circuit design and formula.

4. A computer device, characterized in that: The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the quantum neural network privacy protection method for protecting input data and training parameters as described in any one of claims 1-2.

5. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the quantum neural network privacy protection method for protecting input data and training parameters as described in any one of claims 1-2.

6. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the quantum neural network privacy protection system for protecting input data and training parameters as described in claim 3.

Citation Information

Patent Citations

  • Multi-user privacy protection machine learning method and device based on multi-key fully homomorphic encryption

    CN114844621A

  • Homomorphic encryption method, system, device and terminal for quantum convolution calculation

    CN116094686A