Image data classification method and device based on quantum-classical hybrid machine learning model of lightweight quantum circuit

CN117649560BActive Publication Date: 2026-10-30NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311721186.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2026-10-30
Estimated Expiration
2043-12-13

AI Technical Summary

Technical Problem

[0007]本发明的目的是提供一种基于轻量化量子电路的量子-经典混合机器学习模型的图像数据分类方法及装置解决现有技术中存在的计算效率低、计算复杂度高,同时图像数据分类准确性有待提高的问题

Benefits of technology

[0036]本发明的有益效果是:该种基于轻量化量子电路的量子-经典混合机器学习模型的图像数据分类方法及装置,能够降低计算复杂度,模型训练效率高,图像数据分类精度高,能够在保持模型的高性能的同时,大大降低成本。经实验仿真验证,与基于KAK的量子分类器相比,本发明能够获得高准确性的图像数据分类结果,高效且低成本,能够在参数数量大大减少的情况下,实现图像数据精度高的目的。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117649560B_ABST
    Figure CN117649560B_ABST
Patent Text Reader

Abstract

The application provides an image data classification method and device based on a quantum-classical hybrid machine learning model of a light quantum circuit, constructs a quantum-classical hybrid machine learning model based on a light quantum circuit, calculates a measurement expectation value, uses a parameter optimization module of a classical computer to optimize parameters of a quantum classifier based on a light quantum circuit and parameters of an artificial neural network of the classical computer, obtains an optimized quantum-classical hybrid machine learning model, inputs image data to be classified into the optimized quantum-classical hybrid machine learning model based on a light quantum circuit, and obtains a classification result. The application can reduce the calculation complexity, obtain a high-accuracy classification result, be efficient and low in cost, and achieve the purpose of high precision with a greatly reduced number of parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an image data classification method and apparatus based on a quantum-classical hybrid machine learning model using lightweight quantum circuits, belonging to the field of data classification technology. Background Technology

[0002] With the development of big data and artificial intelligence, machine learning plays a crucial role in many fields. However, traditional machine learning algorithms, such as classical artificial neural networks, face challenges in terms of computational efficiency and accuracy when processing large-scale and complex image data. Quantum computing, utilizing the principles of quantum mechanics, can provide more efficient solutions than classical computing for certain problems.

[0003] However, the development of quantum computers is still in its early stages, and the design of quantum algorithms and quantum circuits is often highly complex and costly. Furthermore, due to noise and errors inherent in quantum computers, the performance of quantum algorithms in practical applications often falls short of theoretical expectations.

[0004] In quantum machine learning, quantum classifiers are a common application. They utilize quantum circuits to process and classify data. However, traditional quantum classifiers typically require a large number of quantum gates and parameters, leading to high computational complexity and resource consumption.

[0005] Therefore, seeking a quantum-classical hybrid machine learning model that can combine the advantages of quantum computing with the mature technology of classical machine learning to classify image data, in order to reduce computational complexity and cost while maintaining or improving the performance of image data classification, is an important research direction in the current field of quantum machine learning.

[0006] The above-mentioned problems should be considered and solved in the process of image data classification based on quantum-classical hybrid machine learning models using lightweight quantum circuits. Summary of the Invention

[0007] The purpose of this invention is to provide an image data classification method and apparatus based on a quantum-classical hybrid machine learning model using lightweight quantum circuits, which solves the problems of low computational efficiency, high computational complexity, and insufficient accuracy in image data classification in the prior art.

[0008] The technical solution of this invention is:

[0009] An image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits includes the following steps:

[0010] S1. Construct a quantum-classical hybrid machine learning model based on lightweight quantum circuits. The quantum-classical hybrid machine learning model based on lightweight quantum circuits includes a phase encoding module for mapping the phase encoding of input image data into quantum state data, a quantum classifier based on lightweight quantum circuits, and a classical computer.

[0011] S2. Input the quantum state data into a quantum classifier based on lightweight quantum circuits to calculate the expected measurement value, and then send the expected measurement value to a classical computer.

[0012] S3. Optimize the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network of the classical computer using the parameter optimization module of the classical computer.

[0013] S4. After repeating steps S2-S3 a set number of times, the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits is obtained.

[0014] S5. Input the image data to be classified into the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits to obtain the classification results.

[0015] Furthermore, in step S1, in the phase encoding module, qubits are obtained from the input image data, and tensor networks are used to map the phase encoding of the qubits into quantum state data.

[0016] Furthermore, tensor networks employ matrix multiplication state (MPS), tree-structured neural networks (TNN), or multi-scale entangled renormalization (MERA).

[0017] Furthermore, in step S1, the classical computer includes an artificial neural network and a parameter optimization module.

[0018] The artificial neural network obtains the image data classification result from the input measurement expectation value. The parameter optimization module optimizes the parameters of the quantum classifier based on the lightweight quantum circuit and the parameters of the artificial neural network based on the image data classification result output by the artificial neural network.

[0019] Furthermore, in step S1, the number of input neurons in the artificial neural network is n and the number of output neurons is N, and the output F of the j-th output neuron... j for:

[0020]

[0021] Where j = 1, 2, ..., N, This represents the weight of the i-th neuron in the l-th layer relative to the j-th neuron. f represents the bias of the i-th neuron in the l-th layer. i This indicates a signal transmitted from the previous or input layer.

[0022] Further, in step S2, the quantum classifier based on lightweight quantum circuits calculates the expected measurement value. Specifically, it assumes a quantum state |Ψ> composed of n qubits and a single-qubit rotating gate R. y (θ l ') or a two-qubit rotating gate YY^θ' l The equivalent rotation angle is θ k quantum circuits The whole is represented as Calculate the expected value f of the measurement of the i-th qubit in the quantum state |Ψ>. i As the output of a quantum classifier based on lightweight quantum circuits, Z needs to be defined. i As the measurement operator on the i-th qubit, and assuming Pauli I gates on the other qubits, the expected measurement value f of the i-th qubit is... i :

[0023]

[0024] in, Represents an operator on a quantum classifier based on lightweight quantum circuits, where the measurement operator Z is only present on the i-th qubit. i The other qubits all have the unit operator I: in, Represents the tensor product. Indicated by parameter θ k Defined quantum circuit: yes The conjugate transpose of . Indicates that by R y (θ l ') or YY^θ' l The overall equivalent parameter is θ k The quantum circuit part is the lightweight quantum circuit, where k represents The serial number, or l represents R y (θ l ') acts on the l-th qubit or represents YY^θ' l It acts on the l-th and l+1-th qubits.

[0025] Furthermore, lightweight quantum circuits

[0026]

[0027] Where e is the natural constant, i represents the imaginary unit, and R y (θ l ') is a revolving door around the y-axis, where θ l ' represents the angle of rotation, and l represents θ. l 'number, There is a parameter θ l The two-qubit gate, where δ is the Pauli matrix (δ... y δ yy ).

[0028] Furthermore, in step S3, the optimization algorithms used on classical computers include the approximate gradient descent algorithm (GD), the particle swarm optimization algorithm (PSO), and the quantum behavior-inspired particle swarm optimization algorithm (QPSO).

[0029] Furthermore, in step S3, when the optimization algorithm on the classical computer adopts the approximate gradient descent algorithm (GD), the approximate gradient is used as the solution to update the parameters of the artificial neural network and the quantum classifier based on lightweight quantum circuits.

[0030]

[0031] Among them, D q D represents the approximate gradient of the parameters of a quantum classifier based on lightweight quantum circuits. NN denoted by , MSE represents the approximate gradient of the artificial neural network parameters, θ represents the mean square error between the model prediction and the actual result, Δθ represents the parameters of the quantum classifier based on lightweight quantum circuits, Δθ represents the change in the parameters θ of the quantum classifier based on lightweight quantum circuits, k represents the parameters of the artificial neural network, and Δk represents the change in the parameters k of the artificial neural network.

[0032] An image data classification device based on a quantum-classical hybrid machine learning model using lightweight quantum circuits, employing any one of the above-described methods, includes a model generation module, a model training module, and an image data classification module.

[0033] Model generation module: Constructs a quantum-classical hybrid machine learning model based on lightweight quantum circuits. The quantum-classical hybrid machine learning model based on lightweight quantum circuits includes a phase encoding module for mapping the phase encoding of input image data to quantum state data, a quantum classifier based on lightweight quantum circuits, and a classical computer.

[0034] Model training module: Input quantum state data into a quantum classifier based on lightweight quantum circuits to calculate the expected measurement value, and then send the expected measurement value to a classical computer; use the parameter optimization module of the classical computer to optimize the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network of the classical computer; repeat the optimization a set number of times to obtain the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits;

[0035] Image data classification module: Input the image data to be classified into the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits to obtain the classification result.

[0036] The beneficial effects of this invention are: this image data classification method and apparatus based on a lightweight quantum circuit-based quantum-classical hybrid machine learning model can reduce computational complexity, achieve high model training efficiency, and high image data classification accuracy, while maintaining high model performance and significantly reducing costs. Experimental simulations have verified that, compared with KAK-based quantum classifiers, this invention can obtain highly accurate image data classification results, is efficient and low-cost, and achieves high image data accuracy with a significantly reduced number of parameters. Attached Figure Description

[0037] Figure 1 This is a flowchart illustrating the image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits, according to an embodiment of the present invention.

[0038] Figure 2 This is an illustrative diagram illustrating the quantum-classical hybrid machine learning model based on lightweight quantum circuits in the embodiment.

[0039] Figure 3 The following are schematic diagrams illustrating three tensor networks in the embodiments: Matrix Product State (MPS), Tree Neural Network (TNN), and Multi-Scale Entangled Renormalization (MERA). (a) is a schematic diagram illustrating the Matrix Product State (MPS), where nodes represent matrices used to describe quantum states, and the connections between nodes represent the interrelationships between different matrices; (b) is a schematic diagram illustrating the Tree Neural Network (TNN), where nodes represent tensors, and the connections between nodes represent the connections between different tensors; (c) is a schematic diagram illustrating the Multi-Scale Entangled Renormalization (MERA), where nodes represent tensors, and the connections between nodes represent the connections between different tensors.

[0040] Figure 4 In the embodiment, the parameter θ k Defined quantum circuit A schematic diagram illustrating a lightweight quantum circuit, where (a) is the parameter θ. k Defined quantum circuit (a) is an illustrative diagram, and (b) is an illustrative diagram of a lightweight quantum circuit;

[0041] Figure 5 The following are design diagrams of quantum classifiers based on three tensor networks in the embodiments: matrix multiplication state (MPS), tree network (TNN), and multi-scale entanglement renormalization (MERA). Among them, (a) is the design diagram of the quantum classifier based on matrix multiplication state (MPS), (b) is the design diagram of the quantum classifier based on tree network (TNN), and (c) is the design diagram of the quantum classifier based on multi-scale entanglement renormalization (MERA).

[0042] Figure 6 The above is a comparative diagram showing the results of the quantum classifiers based on MPS, TTN and MERA after optimization by three classical optimization algorithms: QPSO, PSO and GD. (a) is a comparative diagram showing the training classification accuracy of the quantum classifiers based on MPS, TTN and MERA, and (b) is a comparative diagram showing the testing classification accuracy of the quantum classifiers based on MPS, TTN and MERA.

[0043] Figure 7 This is a schematic diagram comparing the accuracy of image data classification methods based on lightweight quantum circuits and quantum-classical hybrid machine learning models when classifying iris flower image data with a KAK-based quantum classifier. Detailed Implementation

[0044] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0045] This embodiment provides an image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits, such as... Figure 1 This includes the following steps:

[0046] S1. Construct a quantum-classical hybrid machine learning model based on lightweight quantum circuits. This model includes a phase encoding module for mapping the phase encoding of input image data to quantum state data, a quantum classifier based on lightweight quantum circuits, and a classical computer, such as... Figure 2 .

[0047] In step S1, the phase encoding module obtains qubits from the input image data and uses a tensor network to map the phase encoding of the qubits into quantum state data. The tensor network uses a matrix product state (MPS) such as... Figure 3 (a) Tree-structured neural networks (TNNs) Figure 3 (b) Multiscale entanglement renormalization MERA, such as Figure 3 (c)

[0048] In step S1, the classical computer includes artificial neural networks and optimization algorithms.

[0049] Artificial neural networks: obtain image data classification results from the input measurement expectation value;

[0050] Optimization algorithm: Based on the image data classification results output by the artificial neural network, the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network are optimized.

[0051] In step S1, the number of input neurons in the artificial neural network is n, and the number of output neurons is N. The output F of the j-th output neuron... j for:

[0052]

[0053] Where j = 1, 2, ..., N, This represents the weight of the i-th neuron in the l-th layer relative to the j-th neuron. f represents the bias of the i-th neuron in the l-th layer. i This indicates a signal transmitted from the previous or input layer.

[0054] In step S1, in the quantum-classical hybrid machine learning model based on lightweight quantum circuits, the quantum classifier based on lightweight quantum circuits is implemented using a quantum computer, while the artificial neural network and optimization algorithm are implemented using a classical computer. After inputting quantum state data into the quantum classifier based on lightweight quantum circuits, the expected value is measured as the calculation result. This result is then input into the artificial neural network, which outputs the classification result. The classification result is compared with the data labels, and classical algorithms such as gradient descent and particle swarm optimization are used for iterative optimization to further update the parameters of both the quantum classifier based on lightweight quantum circuits and the artificial neural network.

[0055] S2. Input the quantum state data into a quantum classifier based on lightweight quantum circuits to calculate the expected measurement value, and then send the expected measurement value to a classical computer.

[0056] In step S2, the quantum classifier based on lightweight quantum circuits calculates the expected measurement value. Specifically, it assumes a quantum state |Ψ> composed of n qubits and a single-qubit rotating gate R. y (θ l ') or a two-qubit rotating gate YY^θ' l The equivalent rotation angle is θ k quantum circuits The whole is represented as Calculate the expected value f of the measurement of the i-th qubit in the quantum state |Ψ>. iAs the output of a quantum classifier based on lightweight quantum circuits, Z needs to be defined. i As the measurement operator on the i-th qubit, and assuming Pauli I gates on the other qubits, the expected measurement value f of the i-th qubit is... i :

[0057]

[0058] in, Represents an operator on a quantum classifier based on lightweight quantum circuits, where the measurement operator Z is only present on the i-th qubit. i The other qubits all have the unit operator I: in, Representing the tensor product, such as Figure 4 of (a), Indicated by parameter θ k Defined quantum circuit: yes The conjugate transpose, such as Figure 4 (b) Indicates that by R y (θ l ') or YY^θ' l The overall equivalent parameter is θ k The quantum circuit part is the lightweight quantum circuit, where k represents The serial number, or l represents R y (θ l ') acts on the l-th qubit or represents YY^θ' l It acts on the l-th and l+1-th qubits.

[0059] The expected measurement value f of the i-th qubit i In the calculation formula, firstly, the initial quantum state |Ψ> is obtained through... Perform the evolution, then perform the Z measurement on the i-th qubit, and pass the result again through... The expected value obtained after evolution is f. i Where i∈(0,n-1). As n increases, and The matrix dimension grows exponentially, making it impractical to simulate this computation using classical computers. Therefore, such calculations are typically performed on quantum computers.

[0060] S3. Optimize the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network of the classical computer using the parameter optimization module of the classical computer.

[0061] In step S3, the optimization algorithms used on classical computers include the approximate gradient descent algorithm (GD), the particle swarm optimization algorithm (PSO), and the quantum behavior-inspired particle swarm optimization algorithm (QPSO).

[0062] In step S3, a gradient-based optimization algorithm is used to optimize the parameters of the quantum circuit and the neural network. Assume the label set of the training data is L = [L0, L1, ..., L...]. N-1 We choose the mean squared error (MSE) as the loss function, and its calculation formula is as follows: Due to the expected value f i It was obtained through calculations on a quantum computer and involved quantum circuit parameters θ and the neuron's output F. j It is based on the neural network parameters k and b. The loss function MSE is based on F... j It is calculated by the square of the difference between the neuron's output F and the label set L. j Based on the expected value f i And measure the expected value f i It is based on the parameter θ, and F j This directly involves k and b, where MSE is a function containing the quantum circuit parameters θ and the neural network parameters k and b. When the optimization algorithm on a classical computer uses the approximate gradient descent (GD) algorithm, it uses an approximate gradient as the solution to update the parameters of the artificial neural network and the quantum classifier based on lightweight quantum circuits.

[0063]

[0064] Among them, D q D represents the approximate gradient of the parameters of a quantum classifier based on lightweight quantum circuits. NN denoted by , MSE represents the approximate gradient of the artificial neural network parameters, θ represents the mean square error between the model prediction and the actual result, Δθ represents the parameters of the quantum classifier based on lightweight quantum circuits, Δθ represents the change in the parameters θ of the quantum classifier based on lightweight quantum circuits, k represents the parameters of the artificial neural network, and Δk represents the change in the parameters k of the artificial neural network.

[0065] S4. After repeating steps S2-S3 a set number of times, the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits is obtained.

[0066] S5. Input the image data to be classified into the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits to obtain the classification results.

[0067] This image data classification method and apparatus based on a lightweight quantum circuit-based quantum-classical hybrid machine learning model reduces computational complexity, improves model training efficiency, and achieves high image data classification accuracy, while significantly reducing costs while maintaining high model performance. Experimental simulations demonstrate that, compared to KAK-based quantum classifiers, this invention achieves highly accurate image data classification results, is efficient and low-cost, and achieves high image data classification accuracy with a significantly reduced number of parameters.

[0068] The embodiment also provides an image data classification device based on a quantum-classical hybrid machine learning model using a lightweight quantum circuit-based quantum data classification method according to any one of the above embodiments, comprising a model generation module, a model training module, and an image data classification module.

[0069] Model generation module: Constructs a quantum-classical hybrid machine learning model based on lightweight quantum circuits. The quantum-classical hybrid machine learning model based on lightweight quantum circuits includes a phase encoding module for mapping the phase encoding of input image data to quantum state data, a quantum classifier based on lightweight quantum circuits, and a classical computer.

[0070] Model training module: Input quantum state data into a quantum classifier based on lightweight quantum circuits to calculate the expected measurement value, and then send the expected measurement value to a classical computer; use the parameter optimization module of the classical computer to optimize the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network of the classical computer; repeat the optimization a set number of times to obtain the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits;

[0071] Image data classification module: Input the image data to be classified into the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits to obtain the classification result.

[0072] In the quantum-classical hybrid machine learning model based on lightweight quantum circuits, the lightweight quantum circuits are lightweight quantum circuits based on tensor networks. The tensor networks employ matrix product state (MPS) such as... Figure 3 (a) Tree-structured neural networks (TNNs) Figure 3 (b) Multiscale entanglement renormalization MERA, such as Figure 3(c) This approach simplifies quantum circuits, effectively reducing the number and depth of circuit parameters, and lowering costs while maintaining performance. Addressing the issue of the excessive number of 15 parameters in current KAK decomposition quantum circuits, this approach optimizes the parameters by removing all unitary operators along the X and Z axes from the dual quantum unitary gates of the KAK decomposition, retaining only the Y-axis operator and the YY gate. This allows the qubit to traverse only the local Hilbert space on the Bloch sphere, thereby reducing the number of parameters.

[0073] A quantum-classical hybrid machine learning model based on lightweight quantum circuits optimizes the parameters of the quantum circuit derived from KAK decomposition, enabling the qubits to traverse only a local Hilbert space on the Bloch sphere, thus reducing the number of parameters and computational complexity in the quantum circuit. While KAK decomposition allows the entire qubit space to traverse the Bloch sphere, the mapped data in this embodiment is actually distributed along a segment of the Bloch sphere, not the entire Bloch sphere. Therefore, the optimal model parameters only need to be found within this local Hilbert space. The starting point for this lightweight design is the phase-encoded data mapping strategy, which maps the input data to the parameters of the rotating Y-gate. This results in the mapped quantum state data being distributed along a segment of the Bloch sphere's Y-axis, without involving the X and Z axes, thus narrowing the search space and reducing the number of model parameters without losing information.

[0074] The lightweight quantum circuit of this embodiment removes all unitary operator portions in the X and Z axes from the double quantum unitary gates of the KAK decomposition, retaining only the Y-axis operator and the YY gate.

[0075]

[0076] Where e is the natural constant, i represents the imaginary unit, and R y (θ l ') is a revolving door around the y-axis, where θ l ' represents the angle of rotation, and l represents θ. l 'number, There is a parameter θ l The two-qubit gate, where δ is the Pauli matrix (δ... y δ yy ).

[0077] Lightweight quantum circuits such as Figure 4 As shown in (b), based on this, and combining three tensor networks—matrix product state (MPS), tree-structured neural network (TNN), and multi-scale entangled renormalized MERA—a specific example of designing three lightweight quantum classifiers is as follows: Figure 5 . Figure 5(a) is a design diagram of a quantum classifier based on matrix product state MPS. Figure 5 (b) is a design diagram of a quantum classifier based on a tree neural network (TNN). Figure 5 (c) is a design diagram of a quantum classifier based on multiscale entanglement renormalization MERA. Figure 5 In this context, |0> is the ground state in quantum computing, representing the initial state of a qubit. y (x p ') is a revolving door around the y-axis, where x p ' represents the angle of rotation, and p represents x. p The 'R' designation is a specific type of single-qubit gate used to change the state of a qubit. y (θ l ') is a revolving door around the y-axis, where θ l ' represents the angle of rotation, and l represents θ. l The designation 'YY' indicates a specific type of single-qubit gate used to change the state of a qubit. YY is a two-qubit gate that operates on two qubits, creating entanglement between them. Specifically, it might refer to the tensor product of two Y gates. Where Y is the Pauli-Y gate. There is a parameter θ l A two-qubit gate, where the rotation angle is determined by θ. l 'Given.' 'I' represents the identity gate, which, when applied to a qubit, does not change the qubit's state. CNOT i,j This indicates that the controlled NOT gate, i.e., the CNOT gate, is implemented between qubit i and qubit j, where qubit i is the control qubit. Qubit j, as the target qubit, will undergo an X gate operation if and only if this qubit is in the |1> state. If the control qubit is in the |0> state, the target qubit is unaffected. <z>The final stage of representing the circuit involves performing Z-basis measurements on selected qubits, which provides a binary result between the computed ground states |0> and |1> for each qubit. These results can be used to determine the output of the quantum classifier.

[0078] By employing this lightweight quantum circuit design, the number of parameters is reduced by approximately two-thirds, achieving a significant reduction while maintaining the high performance and accuracy of the quantum circuit. This design, while drastically reducing the number of parameters, still maintains or even improves the original computational efficiency and classification accuracy, demonstrating a superior balance between performance and efficiency.

[0079] This image data classification method and device based on a quantum-classical hybrid machine learning model using lightweight quantum circuits can reduce the computational complexity of image data classification. By using a lightweight quantum classifier, the parameters and depth of the quantum circuit can be effectively reduced, thus effectively reducing space complexity.

[0080] This image data classification method and apparatus based on a quantum-classical hybrid machine learning model using lightweight quantum circuits processes input image data. By applying classical optimization algorithms from classical computers to optimize the parameters of the lightweight quantum classifier, the output of the lightweight quantum circuits is further processed and classified by a classical computer. This approach effectively optimizes the parameters of the lightweight quantum circuits, achieving high training accuracy in a shorter time and improving model training efficiency. Furthermore, by using lightweight quantum circuits, the cost can be significantly reduced while maintaining high model performance.

[0081] This image data classification method and device based on a lightweight quantum circuit-based quantum-classical hybrid machine learning model combines quantum computing and classical machine learning techniques to achieve efficient processing and classification of large-scale and complex data, while maintaining high accuracy and low cost. Compared to single quantum or classical models, it exhibits higher performance and has broad application prospects.

[0082] The image data classification method and apparatus based on a lightweight quantum circuit-based quantum-classical hybrid machine learning model, as described in this embodiment, are experimentally verified as follows:

[0083] Using Google's Python-based Cirq simulation platform, the Iris image dataset was used as an example for image data classification. The Iris image dataset contains 150 samples, divided into two parts: 75 samples as the training set and 75 as the test set. Phase encoding was used to map the Iris image data into quantum state data, which was then input into a quantum classifier. Three quantum classifiers were designed based on Matrix Product State (MPS), Tree Tensor Network (TTN), and Multi-scale Entanglement Renormalization Ansatz (MERA) tensor network theory. The expected value was then calculated and input as the output into a classical computer. The classical computer used Gradient Descent (GD), Particle Swarm Optimization (PSO), and Quantum Particle Swarm Optimization (QPSO) algorithms to assist in optimizing the quantum classifier parameters. Through iterative learning, efficient classification of the Iris image dataset was achieved. The specific parameters of the lightweight quantum classifier are shown in Table 1.

[0084] Table 1 Parameters of Lightweight Quantum Classifier

[0085] MPS 4 7 Iris 7 RyYY TTN 4 7 Iris 3 RyYY MERA 4 13 Iris 9 RyYYCNOT

[0086] In Table 1, Ry represents the rotation Y gate, a gate that rotates a qubit in the Y-axis direction; YY represents the double Y gate, which describes the Y-axis interaction on two qubits; CNOT represents the controlled NOT gate, a two-bit gate in which one bit controls whether the other bit performs an X (NOT) operation.

[0087] As shown in Table 1, the MERA-based quantum classifier has the most circuit parameters and the largest depth, while the TTN-based quantum classifier has the fewest circuit parameters and the smallest depth. All designs are based on rotational Y-gates and controlled gates. Figure 5 (a) is a design diagram of a quantum classifier based on matrix product state MPS. Figure 5 (b) is a design diagram of a quantum classifier based on a tree neural network (TNN). Figure 5 (c) is a design diagram of a quantum classifier based on multi-scale entanglement renormalization MERA.

[0088] After the iteration process is complete, the goal is to solve the classification problem, and the accuracy metric is used to measure the model's performance. The formula for calculating accuracy is as follows:

[0089]

[0090] in, F represents the classification output of the j-th sample. j This represents the j-th output value of the mixture model, where 0 and 1 represent the two possible classification results, namely category 0 and category 1; This represents the classification accuracy index for the j-th sample; a value of 1 indicates correct classification, while a value of 0 indicates incorrect classification. j represents the true label of the j-th sample, and N is the total number of samples; Accuracy represents the model's accuracy, calculated by dividing the number of correctly classified samples by the total number of samples, and then multiplying by 100% to obtain the percentage accuracy. Output value F j The sample is binarized (converted to 0 or 1) based on a set threshold of 0.5, and then compared with the true label to obtain an indicator of whether each sample has been correctly classified. Finally, calculate the overall accuracy. It's important to note that the output value F of the mixture model... j The range is between 0 and 1. For classification, the output values ​​F = [F0,…F0] of the mixture model need to be calculated. N-1 Quantization is performed. Here, the threshold is set to 0.5, that is, when F... j If the value is greater than 0.5, the classification result is 1; otherwise, it is 0.

[0091] Figure 6 This diagram illustrates a comparison of the results of optimizing the quantum classifiers based on MPS, TTN, and MERA using three classical optimization algorithms: Quantum Particle Swarm Optimization (QPSO), Particle Swarm Optimization (PSO), and Gradient Descent (GD). Figure 6 As shown in (a) and (b), the three quantum classifiers perform excellently on image data classification tasks, with training accuracy exceeding 96% and test accuracy exceeding 92%. Overall, the quantum classifier based on lightweight quantum circuits exhibits good performance on image data classification tasks.

[0092] Furthermore, the designed lightweight quantum classifier is compared with a KAK decomposition-based quantum classifier. For ease of comparison, both employ the MPS framework and gradient descent optimization algorithm. The KAK decomposition-based quantum classifier has 38 parameters, while the lightweight quantum classifier has only 7 parameters. Figure 7 The classification accuracy of both methods on the iris image dataset is shown. Figure 7 It can be seen that quantum classifiers based on KAK decomposition, due to their numerous parameters, can converge to high classification accuracy in fewer iterations. However, this comes at the cost of significantly increased cost and time consumption per iteration. Lightweight models not only achieve comparable accuracy but also significantly reduce time and computational resource costs. Therefore, experiments demonstrate that the lightweight design scheme in this embodiment offers lower cost and higher accuracy. Future research should focus on the application of lightweight models in the field of mobile communications.

[0093] Space complexity is typically measured by the number of parameters in a model. The space complexity of three models—classical artificial neural network, pure quantum, and the quantum-classical hybrid machine learning model used in this example—is analyzed below:

[0094] Consider a classic artificial neural network with input size z, n hidden layers of size m, and output layer size k. Based on these parameters, the total number of parameters P1 of the neural network can be expressed as:

[0095] P1=m(z+1)+m(1+m)(n-1)+k(m+1)

[0096] For a pure quantum model, it is necessary to calculate all angular parameters in the circuit. Assume the quantum circuit has a depth of n layers, each layer contains m double-quantum unitary units, and the entire circuit has k independent single-quantum rotation gates. Then, the total number of angular parameters P2 in the pure quantum model can be expressed as:

[0097] P2 = 15*m*n + k

[0098] Suppose that the quantum-classical hybrid model in this embodiment consists of a classical layer and a quantum layer, with the classical layer having size c and interacting with m qubits. In this case, the number of parameters P3 of the hybrid model can be expressed as: P3 = c(z+1) + 15*m).

[0099] The above comparison shows that, compared with classical artificial neural networks, the quantum-classical hybrid machine learning model in this embodiment demonstrates higher accuracy and superior performance with lower parameter complexity.

[0100] Figure 6 This study clearly reveals the performance of different combinations of quantum classifiers and optimization strategies on classification tasks. From... Figure 6 As can be clearly seen, all these quantum classifiers exhibit excellent performance, with accuracies exceeding 92%. This demonstrates that quantum machine learning models possess strong classification capabilities even when employing classical optimization strategies. This highlights the advantages of quantum computing. Compared to pure quantum models, the quantum-classical hybrid machine learning model in this embodiment achieves higher image data classification accuracy and improves image data classification performance while adding only a small number of parameters.

[0101] This image data classification method and apparatus based on a lightweight quantum circuit-based quantum-classical hybrid machine learning model successfully overcomes the limitations encountered by traditional quantum computing in handling complex machine learning tasks by cleverly combining the unique advantages of quantum computing with the powerful capabilities of classical machine learning algorithms. By introducing a lightweight quantum circuit design, the development cost and computational complexity of the model are effectively reduced while ensuring excellent performance. The lightweight model in this embodiment is adaptable to existing quantum computing devices, and through close cooperation with classical computers, the quantum classifier benefits from the assistance of classical optimization algorithms, significantly improving the efficiency of parameter optimization.

[0102] This image data classification method and apparatus based on a lightweight quantum circuit-based quantum-classical hybrid machine learning model was validated using an iris image dataset. It maintains high performance while significantly reducing design cost and computational complexity. Compared to existing quantum classifiers based on the KAK algorithm, the lightweight quantum classifier in this embodiment not only achieves excellent image data classification accuracy but also significantly reduces resource consumption and computation time.

[0103] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / z>

Claims

1. An image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits, characterized in that: Includes the following steps, S1. Construct a quantum-classical hybrid machine learning model based on lightweight quantum circuits. The quantum-classical hybrid machine learning model based on lightweight quantum circuits includes a phase encoding module for mapping the phase encoding of input image data into quantum state data, a quantum classifier based on lightweight quantum circuits, and a classical computer. S2. Input the quantum state data into a quantum classifier based on lightweight quantum circuits to calculate the expected measurement value, and then send the expected measurement value to a classical computer. In step S2, the quantum classifier based on lightweight quantum circuits calculates the expected measurement value. Specifically, it assumes a quantum state consisting of n qubits. and single-qubit rotating gates or two-qubit rotating gate The equivalent rotation angle is quantum circuits The whole is represented as Calculate quantum states The Middle Expected measurement value per qubit As the output of a quantum classifier based on lightweight quantum circuits; it is necessary to define As the first The measurement operator is used on one qubit, and the Pauli operator is assumed to be used on the other qubits. The door, then the number Expected measurement value per qubit : , in, This represents an operator on a quantum classifier based on lightweight quantum circuits, where the measurement operator is only present on the i-th qubit. The other qubits all have the unit operator I: ,in, Represents the tensor product. Indicates by parameters Defined quantum circuit: , yes The conjugate transpose of . Indicates by or The overall equivalent parameters are The quantum circuit part is the lightweight quantum circuit. express The serial number, or , express The effect of the On each quantum bit, or representing The effect of the and On 10 qubits; Lightweight quantum circuits : , in, It is a natural constant. Represents the imaginary unit. It is a revolving door around the y-axis, in which It is the angle of rotation. express The number, There are parameters Two-qubit gate, Pauli matrix ( , ); S3. Optimize the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network of the classical computer using the parameter optimization module of the classical computer. In step S3, the optimization algorithms used on classical computers include the approximate gradient descent algorithm GD, the particle swarm optimization algorithm PSO, and the quantum behavior-inspired particle swarm optimization algorithm QPSO. S4. After repeating steps S2-S3 a set number of times, the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits is obtained. S5. Input the image data to be classified into the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits to obtain the classification results.

2. The image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits as described in claim 1, characterized in that: In step S1, the phase encoding module obtains qubits from the input image data and uses a tensor network to map the phase encoding of the qubits into quantum state data.

3. The image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits as described in claim 2, characterized in that: Tensor networks can employ matrix multiplication states (MPS), tree-structured neural networks (TNN), or multi-scale entanglement renormalization (MERA).

4. The image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits as described in any one of claims 1-3, characterized in that: In step S1, the classical computer includes an artificial neural network and a parameter optimization module. Artificial neural networks: obtain image data classification results from the input measurement expectation value; Parameter optimization module: Based on the image data classification results output by the artificial neural network, optimize the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network.

5. The image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits as described in any one of claims 1-3, characterized in that: In step S1, the number of input neurons in the artificial neural network is With the number of output neurons being , No. The output of each output neuron for: , in, , Indicates the first The i-th neuron of the layer to the th The weights of each neuron, Indicates the first The bias of the i-th neuron in the layer. This indicates a signal transmitted from the previous or input layer.

6. The image data classification method based on a quantum-classical hybrid machine learning model using lightweight quantum circuits as described in claim 1, characterized in that: In step S3, when the optimization algorithm on the classical computer adopts the approximate gradient descent algorithm (GD), the approximate gradient is used as the solution to update the parameters of the artificial neural network and the quantum classifier based on lightweight quantum circuits. in, D represents the approximate gradient of the parameters of a quantum classifier based on lightweight quantum circuits. NN The gradient represents the approximate gradient of the artificial neural network parameters, and MSE represents the mean squared error between the model's prediction and the actual result. Let represent the parameters of a quantum classifier based on lightweight quantum circuits, and Δθ represent the parameters of the quantum classifier based on lightweight quantum circuits. The change in k represents the parameters of the artificial neural network, and Δk represents the change in the parameters k of the artificial neural network.

7. An image data classification device based on a quantum-classical hybrid machine learning model using a lightweight quantum circuit, employing the image data classification method based on a quantum-classical hybrid machine learning model according to any one of claims 1-6, characterized in that: It includes a model generation module, a model training module, and an image data classification module. Model generation module: Constructs a quantum-classical hybrid machine learning model based on lightweight quantum circuits. The quantum-classical hybrid machine learning model based on lightweight quantum circuits includes a phase encoding module for mapping the phase encoding of input image data to quantum state data, a quantum classifier based on lightweight quantum circuits, and a classical computer. Model training module: Input quantum state data into a quantum classifier based on lightweight quantum circuits to calculate the expected measurement value, and then send the expected measurement value to a classical computer; use the parameter optimization module of the classical computer to optimize the parameters of the quantum classifier based on lightweight quantum circuits and the parameters of the artificial neural network of the classical computer; repeat the optimization a set number of times to obtain the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits; Image data classification module: Input the image data to be classified into the optimized quantum-classical hybrid machine learning model based on lightweight quantum circuits to obtain the classification result.

Citation Information

Patent Citations

  • Medium-voltage circuit breaker fault diagnosis method based on deep learning and intelligent optimization

    CN113988136A

  • Image classification method of quantum neural network based on error mitigation

    CN116310473A