Data classification method and data security risk assessment method based on quantum classifier
Through the data classification method based on quantum classifiers, using quantum angle encoding and Hamiltonian of quantum systems, the problem of insufficient reliability and accuracy in large-scale data processing is solved, and efficient and accurate data classification is achieved.
Patent Information
- Application Number
- CN202211175431.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-09-26
AI Technical Summary
Traditional data classifiers are no longer applicable when processing large-scale data, and it is difficult to ensure the reliability and accuracy of data classification.
The data classification method based on quantum classifier is adopted to convert the data into quantum states through quantum angle encoding, and the original quantum classifier is constructed using Hamiltonian of the quantum system to train and classify through quantum circuits.
It realizes rapid classification of large-scale data, improves the reliability and accuracy of data classification, and is suitable for application scenarios such as data security risk assessment.
Smart Images

Figure CN115630705B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum technology, and specifically relates to a data classification method and a data security risk assessment method based on a quantum classifier. Background Art
[0002] Data classification is an important research direction in classical machine learning and quantum machine learning. Data classification refers to the process of distinguishing and classifying organizational data according to certain principles and methods based on their attributes or characteristics, and establishing a certain classification system and arrangement order to better manage and use organizational data. Data classification is a key part of data protection work, the basis for establishing a unified, accurate and complete data architecture, and the basis for achieving centralized, professional and standardized data management. It has important application value in data security risk assessment.
[0003] The process of data classification is usually implemented by building a data classifier. Therefore, the constructed data classifier is directly related to the reliability and accuracy of data classification. As the scale of data increases, traditional data classifiers and corresponding data classification methods are no longer suitable for the existing massive data classification requirements. Summary of the invention
[0004] One of the purposes of the present invention is to provide a data classification method based on a quantum classifier which is suitable for large-scale data classification and has high reliability and good accuracy.
[0005] A second object of the present invention is to provide a data security risk assessment method including the data classification method based on quantum classifier.
[0006] The data classification method based on quantum classifier provided by the present invention comprises the following steps:
[0007] S1. Obtain an existing classification dataset with classification labels;
[0008] S2. Construct quantum angle coding, and convert the classification data set obtained in step S1 into a quantum state through quantum angle coding as the input of the quantum classifier;
[0009] S3. Construct a primitive quantum classifier based on the Hamiltonian of the quantum system;
[0010] S4. Using the quantum state obtained in step S2 to train the original quantum classifier constructed in step S3, a quantum classifier is obtained;
[0011] S5. Using the quantum angle encoding constructed in step S2, the actual target data set to be classified is converted into a quantum state;
[0012] S6. Input the quantum state obtained in step S5 into the quantum classifier obtained in step S4, output the final result, and complete the data classification of the actual data.
[0013] The step S1 of obtaining an existing classification data set with classification labels is specifically to obtain an existing classification data set D with classification labels = {(x K ,y K )}; where D is the classification data set, x is the data in the classification data set, y is the data label in the classification data set, and K is the number of data in the classification data set.
[0014] The step S2 of constructing quantum angle coding and converting the classification data set obtained in step S1 into a quantum state through quantum angle coding as the input of the quantum classifier specifically includes the following steps:
[0015] A. Determine the number of qubits to be used;
[0016] B. Determine the initial quantum state to be |0 k >
[0017] C. Classify the kth data x in the dataset k Encoded into a series of quantum gates U(x k ), and acts on the initial quantum state determined in step B |0 k >, we get a series of quantum states |ψ in >For In the formula is the inner product symbol, k = 1, 2, ..., K, K is the number of data in the classification data set.
[0018] The quantum gate U(x k ), specifically the quantum gate U(x k ) by the quantum revolving door R z (θ) and R y (θ) combination, U(x k )=R z (x k )R y (x k ).
[0019] The Hamiltonian of the quantum system described in step S3 is used to construct an original quantum classifier, which specifically includes the following steps:
[0020] Assume the Hamiltonian H of the quantum system to be in is the Pauli Z operator, is the Pauli Y operator, is the Pauli X operator, N is the number of particles;
[0021] The unitary operator of Hamiltonian is used to describe the quantum gates used in the quantum classifier:
[0022]
[0023] Where θ β Initially, it is a random variable, which will be updated later according to the change of loss function; H is Hamiltonian; T is the depth of quantum circuit;
[0024] Then the quantum gate designed in the original quantum classifier is
[0025] The specific gate of the original quantum classifier is the quantum rotation R z (θ), R y (θ) and R x (θ), so there exists:
[0026]
[0027] Where T is the depth of the quantum circuit;
[0028] In the quantum circuit, Hadamard gate and Pauli X gate are used at the beginning of the quantum circuit to stabilize the initial quantum state, and CNOT-X gate, which is a combination of CNOT gate and Pauli X gate, is used in the middle of the quantum circuit to build an entanglement layer.
[0029] Step S4 uses the quantum state obtained in step S2 to train the original quantum classifier constructed in step S3 to obtain a quantum classifier, which specifically includes the following steps:
[0030] The quantum state obtained in step S2 is input into the original quantum classifier constructed in step S3, and the system evolution process is completed after passing through the quantum circuit to generate the output quantum state |ψ out >;
[0031] Then, the obtained output quantum state |ψ out >Perform quantum measurement to obtain classical classification information; the classical classification information includes labels obtained by quantum classifier classification
[0032] The parameters of the original quantum classifier constructed in step S3 are trained. The parameters are optimized by gradient descent during training, and the loss function is set as Where W is the number of samples, is the updated label, y k is the initial label;
[0033] After the training is completed, the optimal parameters are obtained, thus obtaining a quantum classifier.
[0034] The present invention also provides a data security risk assessment method including the data classification method based on quantum classifier, comprising the following steps:
[0035] (1) Obtain the classic data set to be risk assessed;
[0036] (2) using the data classification method based on quantum classifier to classify the classical data set to be risk assessed obtained in step (1) to obtain a classification result;
[0037] (3) grading the classification results;
[0038] (4) Based on the obtained classification results, risk assessment is performed on the classic data set to be risk assessed.
[0039] The data classification method and data security risk assessment method based on quantum classifier provided by the present invention designs a quantum classifier based on quantum computing, and realizes rapid classification of large-scale data through the designed quantum classifier, and the present invention has high reliability and good accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 The figure is a flow chart of the classification method of the present invention.
[0041] Figure 2 Schematic diagram of quantum circuit in the classification method of the present invention.
[0042] Figure 3 The figure is a schematic diagram of the method flow of the evaluation method of the present invention. DETAILED DESCRIPTION
[0043] like Figure 1 The schematic diagram of the method flow of the classification method of the present invention is shown as follows: The data classification method based on the quantum classifier provided by the present invention comprises the following steps:
[0044] S1. Obtain an existing classification data set with classification labels; specifically, obtain an existing classification data set D with classification labels = {(x K ,y K )}; where D is the classification data set, x is the data in the classification data set, y is the data label in the classification data set, and K is the number of data in the classification data set;
[0045] S2. Construct quantum angle coding, and convert the classification data set obtained in step S1 into a quantum state through quantum angle coding as the input of the quantum classifier;
[0046] If you want to use quantum computers to process classical data, you must consider how to represent the characteristics of classical data in quantum systems. In addition, you need to design a suitable mode to "load" data from classical storage into quantum computers. This process of mapping classical data into quantum computers and constructing an initial state as the input of quantum machine learning algorithms is called the quantum state preparation problem, and the specific mapping mode used in quantum state preparation is called quantum state encoding. Common types of quantum state encoding can generally include ground state encoding, amplitude encoding, angle encoding, etc.
[0047] The encoding method used in the quantum classifier of the quantum circuit designed by the present invention is quantum angle encoding, which specifically includes the following steps:
[0048] A. Determine the number of qubits to be used;
[0049] B. Determine the initial quantum state to be |0 k >
[0050] C. Classify the kth data x in the dataset k Encoded into a series of quantum gates U(x k ), and acts on the initial quantum state determined in step B |0 k >, we get a series of quantum states |ψ in > for In the formula is the inner product symbol, k=1,2,...,K, K is the number of data in the classification data set; the quantum gate U(x k ), specifically the quantum gate U(x k ) by the quantum revolving door R z (θ) and R y (θ) combination, U(x k )=R z (x k )R y (x k );
[0051] In the specific implementation, assuming that the given data point x = (x0, x1) = (0, 1), the quantum bit quantum gate U (x) corresponding to this data point is:
[0052]
[0053] R z (θ) and R y Substituting the matrix form of (θ) into the formula of quantum bit quantum gate U(x), we get
[0054]
[0055] In the formula
[0056] After simplification, the input quantum state obtained after encoding is:
[0057]
[0058] S3. Construct a primitive quantum classifier based on the Hamiltonian of the quantum system;
[0059] The design method of the quantum circuit of the quantum classifier of the present invention is derived from the quantum circuit obtained by decomposing the Hamiltonian of a set isolated quantum system;
[0060] The process of quantum state change after passing through the quantum circuit can be regarded as the process of quantum system evolution. Since there is no energy and material conversion between the quantum classifier and the outside world during the operation, the quantum system in which the quantum classifier is located is an isolated quantum system, so the Hamiltonian of the quantum system is constant. Therefore, the Hamiltonian H of the quantum system is set to in is the Pauli Z operator, is the Pauli Y operator, is the Pauli X operator, N is the number of particles;
[0061] The unitary operator of Hamiltonian is used to describe the quantum gates used in the quantum classifier:
[0062]
[0063] Where θ β Initially, it is a random variable, which will be updated later according to the change of loss function; H is Hamiltonian; T is the depth of quantum circuit;
[0064] Then the quantum gate designed in the original quantum classifier is
[0065] The specific gate of the original quantum classifier is the quantum rotation R z (θ), R y (θ) and R x (θ), so there exists:
[0066]
[0067] Where T is the depth of the quantum circuit;
[0068] In the quantum circuit, Hadamard gate and Pauli X gate are used to stabilize the initial quantum state at the beginning of the quantum circuit, and CNOT-X gate, which is a combination of CNOT gate and Pauli X gate, is used to build the entanglement layer in the middle of the quantum circuit.
[0069] If the depth of the quantum circuit is T = 1, then 4 quantum bits N = 4 are used, and the constructed quantum circuit is as follows Figure 2 As shown;
[0070] S4. Using the quantum state obtained in step S2 to train the original quantum classifier constructed in step S3 to obtain a quantum classifier; specifically comprising the following steps:
[0071] The quantum state obtained in step S2 is input into the original quantum classifier constructed in step S3, and the system evolution process is completed after passing through the quantum circuit to generate the output quantum state |ψ out >
[0072] Then, the obtained output quantum state |ψ out >Perform quantum measurement to obtain classical classification information; the classical classification information includes labels obtained by quantum classifier classification The quantum state evolves over time, and for an isolated quantum system, its evolution is unitary. In the evolution of a quantum system, quantum measurements can be used to determine the state of the system. Generally speaking, quantum measurements are irreversible. When measuring a quantum system, the measured quantum system will interact with the device by introducing it. At this point, for the original unitary evolving isolated system, its Hamiltonian is no longer Hermitian, the evolution is no longer unitary, and the system is no longer reversible.
[0073] The parameters of the original quantum classifier constructed in step S3 are trained. The parameters are optimized by gradient descent during training, and the loss function is set as Where W is the number of samples, is the updated label, y k is the initial label;
[0074] After the training is completed, the optimal parameters are obtained, thus obtaining a quantum classifier;
[0075] S5. Using the quantum angle encoding constructed in step S2, the actual target data set to be classified is converted into a quantum state;
[0076] S6. Input the quantum state obtained in step S5 into the quantum classifier obtained in step S4, output the final result, and complete the data classification of the actual data.
[0077] like Figure 3 The method flow diagram of the evaluation method of the present invention is shown as follows: the data security risk evaluation method provided by the present invention, which includes the data classification method based on the quantum classifier, comprises the following steps:
[0078] (1) Obtain the classic data set to be risk assessed;
[0079] (2) using the data classification method based on quantum classifier to classify the classical data set to be risk assessed obtained in step (1) to obtain a classification result;
[0080] (3) grading the classification results;
[0081] (4) Based on the obtained classification results, risk assessment is performed on the classic data set to be risk assessed.
[0082] The data classification method based on quantum classifier provided by the present invention can also be applied to sentiment classification analysis of news content and classification of normal data and abnormal data in the vehicle production process.
[0083] Application scenario 1: Sentiment classification analysis of news content, as follows:
[0084] Application background: News emotional information is attached to news factual information, flows with the flow of factual information, and is different from news factual information. The quantum classifier designed in this application can be used to accurately capture the emotional information generated in news facts, and classify and identify it into two aspects: negative information and positive information, providing a convenient classification basis for subsequent public opinion work.
[0085] The application steps are as follows:
[0086] S1: Get the news text content and obtain the news fact information;
[0087] S2: Encode the news information through angles and write it into an initial state that can be recognized by the quantum classifier;
[0088] S3: Classify the encoded news information using the data classification method based on the quantum classifier described in the present invention to extract the emotional results contained in the information;
[0089] S4: Match the output classification results with the news fact information.
[0090] Application scenario 2: Classification method of normal data and abnormal data in vehicle production process
[0091] Application background: The data generated in actual automobile production and application have many quality problems, and there are often data objects that do not conform to the data model or data rules. The quantum classifier designed this time can be used in the actual automobile production process to accurately classify and identify normal data and abnormal data, so as to facilitate the actual application and production of automobiles.
[0092] The application steps are as follows:
[0093] S1: Acquire data obtained during the production and use of the vehicle to obtain relevant vehicle data information;
[0094] S2: Encode the data generated during the production and use of the car through angles and write it into an initial state that can be recognized by the quantum classifier;
[0095] S3: The encoded data is classified using the data classification method based on the quantum classifier of the present invention. The data generated in the process is normal data or abnormal data (the standard for determining the data is related to the Hamiltonian setting of the isolated quantum system in the quantum classifier. In the quantum classifier designed this time, the Hamiltonian is set to:
[0096] S4: Get the classification results and match them with the data generated by the vehicle.
Claims
1. A data classification method based on a quantum classifier, comprising the following steps: S1. Obtain an existing classification dataset with classification labels; S2. Construct quantum angle coding, and convert the classification data set obtained in step S1 into a quantum state through quantum angle coding as the input of the quantum classifier; S3. Based on the Hamiltonian of the quantum system, construct an original quantum classifier; specifically, the steps include: Assume the Hamiltonian H of the quantum system to be in is the Pauli Z operator, is the Pauli Y operator, is the Pauli X operator, N is the number of particles; The unitary operator of Hamiltonian is used to describe the quantum gates used in the quantum classifier: Where θ β Initially, it is a random variable; H is the Hamiltonian; T is the depth of the quantum circuit; Then the quantum gate designed in the original quantum classifier is The specific gate of the original quantum classifier is the quantum rotation R z (θ), R y (θ) and R x (θ), so there exists: Where T is the depth of the quantum circuit; In the quantum circuit, Hadamard gate and Pauli X gate are used to stabilize the initial quantum state at the beginning of the quantum circuit, and CNOT-X gate, which is a combination of CNOT gate and Pauli X gate, is used to build the entanglement layer in the middle of the quantum circuit. S4. Using the quantum state obtained in step S2 to train the original quantum classifier constructed in step S3, a quantum classifier is obtained; S5. Using the quantum angle encoding constructed in step S2, the actual target data set to be classified is converted into a quantum state; S6. Input the quantum state obtained in step S5 into the quantum classifier obtained in step S4, output the final result, and complete the data classification of the actual data.
2. The data classification method based on quantum classifier according to claim 1 is characterized in that The step S1 of obtaining an existing classification data set with classification labels is specifically to obtain an existing classification data set D with classification labels = {(x K ,y K )}; where D is the classification data set, x is the data in the classification data set, y is the data label in the classification data set, and K is the number of data in the classification data set.
3. The data classification method based on quantum classifier according to claim 2 is characterized in that The step S2 of constructing quantum angle coding and converting the classification data set obtained in step S1 into a quantum state through quantum angle coding as the input of the quantum classifier specifically includes the following steps: A. Determine the number of qubits to be used; B. Determine the initial quantum state to be |0 k > C. Classify the kth data x in the dataset k Encoded into a series of quantum gates U(x k ), and acts on the initial quantum state determined in step B |0 k >, we get a series of quantum states |ψ in > for In the formula is the inner product symbol, k = 1, 2, ..., K, K is the number of data in the classification data set.
4. The data classification method based on quantum classifier according to claim 3 is characterized in that The quantum gate U(x k ), specifically the quantum gate U(x k ) by the quantum revolving door R z (θ) and R y (θ) combination, U(x k )=R z (x k )R y (x k ).
5. The data classification method based on quantum classifier according to claim 4 is characterized in that Step S4 uses the quantum state obtained in step S2 to train the original quantum classifier constructed in step S3 to obtain a quantum classifier, which specifically includes the following steps: The quantum state obtained in step S2 is input into the original quantum classifier constructed in step S3, and the system evolution process is completed after passing through the quantum circuit to generate the output quantum state |ψ out > Then, the obtained output quantum state |ψ out >Perform quantum measurement to obtain classical classification information; the classical classification information includes labels obtained by quantum classifier classification The parameters of the original quantum classifier constructed in step S3 are trained. The parameters are optimized by gradient descent during training, and the loss function is set as Where W is the number of samples, is the updated label, y k is the initial label; After the training is completed, the optimal parameters are obtained, thus obtaining a quantum classifier.
6. A data security risk assessment method comprising the data classification method based on quantum classifier according to any one of claims 1 to 5, characterized in that The steps include: (1) Obtain the classic data set to be risk assessed; (2) using the data classification method based on quantum classifier to classify the classical data set to be risk assessed obtained in step (1) to obtain a classification result; (3) grading the classification results; (4) Based on the obtained classification results, risk assessment is performed on the classic data set to be risk assessed.
Citation Information
Patent Citations
Method and system for mapping a dataset from a hilbert space of a given dimension to a hilbert space of a different dimension
CA3126553A1
Classification method based on machine learning framework and related device
CN114358318A