Data feature extraction method and device based on quantum convolutional neural network

By generating convolution kernels through quantum state encoding and quantum kernel circuits, convolution operations are performed on image data. Combined with fully connected layers and Softmax layers, the contradiction between high accuracy and low resource consumption in traditional convolutional neural networks is resolved, and efficient data feature extraction is achieved.

CN120541498BActive Publication Date: 2025-10-28HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511038408.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-10-28
Estimated Expiration
2045-07-28

AI Technical Summary

Technical Problem

Traditional convolutional neural networks cannot balance high accuracy and low resource consumption when extracting data features, while quantum computing methods rely on expensive quantum hardware resources.

Method used

Image data is converted into quantum states through quantum state encoding, a quantum kernel circuit is constructed and quantum measurement is performed, a quantum kernel matrix is ​​generated as a convolution kernel, convolution operation is performed on the image data, and feature extraction is performed by combining fully connected layers and softmax layers.

Benefits of technology

It significantly reduces reliance on quantum hardware, improves feature representation capabilities, and achieves high-precision data feature extraction while reducing resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120541498B_ABST
    Figure CN120541498B_ABST
Patent Text Reader

Abstract

This application relates to a method and apparatus for data feature extraction based on a quantum convolutional neural network. The method includes: encoding image data into quantum states to obtain quantum state data; constructing a quantum kernel circuit and mapping the quantum state data based on the quantum kernel circuit; performing quantum measurements on the final state of the quantum kernel circuit to obtain a quantum kernel matrix; and using the quantum kernel matrix as a convolution kernel to perform a convolution operation on the image data to obtain a convolutional feature map of the image data. This method can solve the problem of simultaneously achieving high accuracy and low resource consumption when extracting data features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of neural networks, and in particular to a method and apparatus for extracting data features based on quantum convolutional neural networks. Background Technology

[0002] Convolutional neural networks (CNNs) are widely used in image recognition, speech processing, and other fields. Their core idea is to use filters in convolutional layers to extract high-level, abstract feature representations from raw data. However, traditional CNNs still have limitations in feature representation capabilities when dealing with complex data. Related technologies combine quantum computing with CNNs, extracting image feature representations from raw data through the superposition and entanglement of qubits, thereby improving data representation capabilities. However, quantum algorithms typically require a large number of quantum gate operations and repeated measurements, resulting in a high dependence on quantum hardware and high resource consumption.

[0003] There is currently no effective solution to the problem that related technologies cannot achieve both high accuracy and low resource consumption when extracting data features. Summary of the Invention

[0004] Therefore, it is necessary to provide a data feature extraction method and apparatus based on quantum convolutional neural networks that can solve the problem of not being able to balance high accuracy and low resource consumption when extracting data features, in order to address the above-mentioned technical problems.

[0005] Firstly, this embodiment provides a data feature extraction method based on a quantum convolutional neural network, the method comprising:

[0006] Quantum state data is obtained by quantum state encoding of image data;

[0007] Construct a quantum core circuit and map the quantum state data based on the quantum core circuit;

[0008] The quantum core matrix is ​​obtained by performing quantum measurements on the final state of the quantum core circuit.

[0009] The quantum kernel matrix is ​​used as the convolution kernel, and the image data is convolved to obtain the convolutional feature map of the image data.

[0010] In some embodiments, constructing the quantum core circuit includes:

[0011] Multiple revolving doors are acquired sequentially, and the rotation axes corresponding to each revolving door are cyclically set in a specified order.

[0012] The target number is determined based on the preset convolution kernel stride;

[0013] The rotating doors are divided into multiple quantum gate groups according to the acquisition order of the rotating doors, and each quantum gate group includes the target number of adjacent rotating doors;

[0014] The quantum core circuit is obtained by connecting quantum gates in the same sorting position within each quantum gate group based on entanglement gates, and the sum of the target number and the number of entanglement gates is equal to the number of qubits.

[0015] In some embodiments, performing quantum measurements on the final state of the quantum core circuit to obtain the quantum core matrix includes:

[0016] Obtain the target quantum gate group after performing a quantum entanglement operation;

[0017] The target quantum gate group is measured, and the quantum core matrix is ​​obtained based on the measurement results.

[0018] In some embodiments, measuring the target quantum gate group includes:

[0019] The measurement results of the final states of each quantum gate group in the quantum core circuit are measured and sampled multiple times;

[0020] The probability distribution of the final state of the quantum gate group is obtained statistically based on the measurement results, and the quantum kernel matrix is ​​generated based on the probability distribution.

[0021] In some embodiments, mapping the quantum state data based on the quantum core circuit includes:

[0022] Based on the quantum core circuit, the quantum state data in the first dimension is transformed to obtain the quantum state data mapped to the second dimension, where the second dimension is higher than the first dimension.

[0023] In some embodiments, the process of quantum-state encoding the image data to obtain quantum-state data includes:

[0024] Map the pixel values ​​in the image data to the target range;

[0025] Construct a quantum gate circuit based on a pre-designed rotating door;

[0026] The mapped pixel values ​​are converted into rotation angle parameters of the qubits based on the quantum gate circuit.

[0027] In some embodiments, after using the quantum kernel matrix as a convolution kernel and performing a convolution operation on the image data to obtain a convolutional feature map of the image data, the method further includes:

[0028] The convolutional feature map is input into a fully connected layer to obtain intermediate data;

[0029] The intermediate data is input into the Softmax layer, and the class label of the image data is predicted based on the Softmax layer.

[0030] Secondly, this embodiment provides a data feature extraction device based on a quantum convolutional neural network, the device comprising:

[0031] The encoding module is used to encode image data into quantum states to obtain quantum state data;

[0032] A mapping module is used to construct a quantum core circuit and map the quantum state data based on the quantum core circuit;

[0033] A measurement module is used to perform quantum measurements on the final state of the quantum core circuit to obtain the quantum core matrix;

[0034] The convolution module is used to use the quantum kernel matrix as the convolution kernel and perform convolution operations on the image data to obtain the convolution feature map of the image data.

[0035] Thirdly, this embodiment provides a computer device including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the data feature extraction method based on quantum convolutional neural networks described in the first aspect.

[0036] Fourthly, this embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data feature extraction method based on quantum convolutional neural networks described in the first aspect above.

[0037] The aforementioned data feature extraction method and apparatus based on quantum convolutional neural networks utilizes quantum state encoding to convert image data into quantum states, then extracts quantum convolutional kernels from the quantum state data through quantum kernel circuits, and uses these pre-trained quantum convolutional kernels to extract features from the input data. The extracted data features can increase feature representation capabilities through quantum computing while significantly reducing quantum hardware dependence, thus solving the problem of not being able to balance high accuracy and low resource consumption when extracting data features. Attached Figure Description

[0038] Figure 1 This is an application environment diagram of a data feature extraction method based on a quantum convolutional neural network in one embodiment.

[0039] Figure 2 This is a flowchart illustrating a data feature extraction method based on a quantum convolutional neural network in one embodiment;

[0040] Figure 3 This is a schematic diagram of a quantum core circuit in one embodiment;

[0041] Figure 4 This is a flowchart illustrating a data feature extraction method based on a quantum convolutional neural network in another embodiment;

[0042] Figure 5 This is a schematic diagram illustrating the training and testing of a quantum machine learning model in one embodiment.

[0043] Figure 6 This is a structural block diagram of a data feature extraction device based on a quantum convolutional neural network in one embodiment;

[0044] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0046] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of a terminal for a data feature extraction method based on a quantum convolutional neural network according to an embodiment of this application. Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0047] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the data feature extraction method based on quantum convolutional neural networks in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0048] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module for wireless communication with the Internet. This embodiment provides a data feature extraction method based on a quantum convolutional neural network. Figure 2 This is a flowchart illustrating the data feature extraction method based on quantum convolutional neural networks in this embodiment. Figure 2 As shown, it includes the following steps:

[0049] Step S202: Encode the image data into quantum states to obtain quantum state data.

[0050] Quantum state encoding is the process of converting classical data (such as image pixels) into quantum states. Image data can be converted into quantum state data based on existing encoding strategies, including angle encoding, basis vector encoding, or amplitude encoding. Image data can be data from one or more images. Optionally, multiple images can be acquired, preprocessed (e.g., resizing, normalization), and then quantum state encoded sequentially for each image using a rotating gate. This maps each pixel value in the image data to an angle parameter of the rotating gate, resulting in quantum state data.

[0051] Step S204: Construct a quantum core circuit and map the quantum state data based on the quantum core circuit.

[0052] A quantum core circuit consists of a series of quantum gates, which are the basic operational units of quantum computing and are unitary operations that perform specific transformations on qubits. Unlike classical logic gates, quantum gates can handle not only the classical states of 0 and 1, but also the superposition and entanglement states of qubits. Quantum core circuits can be constructed from both single-qubit gates and multi-qubit gates. Single-qubit gates include the Hadamard gate (H gate), which can generate superposition states, and the rotation gate, which allows for continuous angle adjustment. Multi-qubit gates include the CNOT gate, which can establish quantum entanglement, and the SWAP gate, which is used to exchange the states between two qubits. Multi-qubit gates are key to constructing complex quantum algorithms.

[0053] Optionally, kernel functions required for data feature extraction are constructed using single-qubit and multi-qubit gates, and the constructed kernel functions are used as quantum core circuits. In the quantum core circuit, quantum gates arranged in a specific order quantumly entangle the quantum state data to obtain the transformed quantum state. Optionally, the parameters of the quantum gates in the quantum core circuit are set to adjustable parameters. After extracting the convolutional feature map of the image data, the quantum gate parameters are adjusted based on classical optimization algorithms.

[0054] Step S206: Perform quantum measurement on the final state of the quantum nuclear circuit to obtain the quantum nuclear matrix.

[0055] In this context, the initial quantum state is obtained by quantum state encoding of the image data, while the final state of the quantum core circuit is the final state of the quantum system after quantum gate operations on the quantum state data. The quantum core matrix characterizes the similarity measure in the quantum feature space.

[0056] Optionally, after quantum entanglement of the quantum gates and quantum state data of the quantum nuclear circuit, quantum measurement is performed on the final state of the quantum nuclear circuit to obtain the expression of the quantum state data in the quantum nuclear space after a series of changes, and this measurement result is used as the quantum nuclear matrix.

[0057] In step S208, the quantum kernel matrix is ​​used as the convolution kernel, and the image data is convolved to obtain the convolution feature map of the image data.

[0058] Optionally, the quantum kernel matrix can be used as the fixed convolution kernel of a classical convolutional neural network. The convolution kernel is slid across the initial image data, and each local region is weighted and summed sequentially to obtain the convolutional feature map of the image data.

[0059] In the aforementioned data feature extraction method based on quantum convolutional neural networks, classical image data is converted into quantum states using quantum state encoding. A high-dimensional quantum kernel space is constructed through quantum kernel circuits, and a quantum convolution kernel is extracted from the quantum state data. When extracting convolutional features, only a pre-trained quantum convolution kernel needs to be called to extract features from the input data to obtain convolutional feature maps. Compared with the traditional method of simulating convolution operations through quantum circuits, this method can increase feature expression capabilities through quantum computing while significantly reducing quantum hardware dependence, thus solving the problem of not being able to balance high accuracy and low resource consumption when extracting data features.

[0060] In one embodiment, constructing a quantum core circuit includes: sequentially acquiring multiple rotating gates, with the rotation axes corresponding to each rotating gate cyclically set in a specified order; determining a target number based on a preset convolution kernel stride; dividing the rotating gates into multiple quantum gate groups according to the acquisition order, with each quantum gate group including the target number of adjacent rotating gates; and connecting the quantum gates in the same sorting position within each quantum gate group based on entanglement gates to obtain a quantum core circuit, wherein the sum of the target number and the number of entangled gates equals the number of qubits.

[0061] The specified rotation axis can be X-axis, Y-axis, and Z-axis rotations, so that the rotating gates acquired in one step are arranged in the order RX, RY, and RZ; or, the specified rotation axis can be arranged in other orders such as Y-axis, X-axis, and Z-axis. No specific limitation is made on the specified rotation axis order here. The longer the preset convolution kernel stride, the larger the pixel range corresponding to the convolution kernel during convolution. Therefore, the number of quantum gates in each quantum gate group should correspond to the preset convolution kernel stride, so that the quantum kernel matrix obtained after measuring the quantum kernel circuit meets the convolution requirements. The target number is equal to the product of the convolution kernel stride. The number of qubits refers to the basic unit of information that can be operated on in a quantum computer. The number of qubits can be obtained based on the currently available quantum hardware. By limiting the sum of the target number and the number of entangled gates to equal the number of qubits, the current hardware can meet the computational requirements of the quantum kernel circuit; or, the number of qubits can be obtained based on the complexity of the current image data, so that the quantum kernel circuit can accurately extract the features of the image data.

[0062] Optionally, such as Figure 3 A schematic diagram of a quantum core circuit is provided, such as... Figure 3 As shown, If quantum kernel learning is required on the input data (quantum state data), then it is necessary to... After the state is determined, the data is encoded in quantum state. Figure 3In the quantum core circuit, a quantum circuit is constructed using sequentially cyclically arranged RX, RY, and RZ rotating gates, where the rotation axes corresponding to the multiple rotating gates are cyclically arranged along the X, Y, and Z axes. With a preset stride size of 2 for the convolution kernel, every four adjacent rotating gates are set as a quantum gate group. Based on the required number of qubits (12), the circuit is obtained including R... X (θ1), R Y (θ2), R z In the case of 12 rotating gates (θ3), and 8 entangled gates correspondingly set, the sum of the target number and the number of entangled gates is equal to the number of qubits. Each entangled gate connects to a quantum gate in the same order within its respective quantum gate group. For example, the first quantum gate R in the first quantum gate group... X (θ1) and the first quantum gate R in the second quantum gate group y (θ5) connects the second quantum gate R in the first quantum gate group. Y (θ2) and the first quantum gate R in the second quantum gate group Z (θ6) connection, and so on, will not be elaborated further. Through Figure 3 The quantum core circuit shown can achieve quantum entanglement, thus forming the core component of quantum core computing.

[0063] In this embodiment, multiple quantum gate groups are constructed by sequentially acquiring multiple rotating gates, and the rotating gates in each quantum gate group are connected by entanglement gates to construct the kernel function required for data feature extraction. This allows the measurement results of the quantum state after being mapped by the quantum kernel circuit to be used as a convolution kernel to perform convolution operations on the image data.

[0064] Furthermore, in one embodiment, performing quantum measurement on the final state of the quantum core circuit to obtain the quantum core matrix includes: acquiring the target quantum gate group after performing a quantum entanglement operation; measuring the target quantum gate group; and obtaining the quantum core matrix based on the measurement results.

[0065] In this process, the rotation gate in the quantum nuclear circuit cannot directly generate quantum entanglement. However, combining the rotation gate with the entanglement gate enables quantum entanglement operations. Optionally, if the first quantum gate in the quantum gate group has not undergone quantum entanglement operations, one or more quantum gate groups other than the first quantum gate group can be used as target quantum gate groups, and the target quantum gate group after performing quantum entanglement operations can be used as the measurement object.

[0066] Alternatively, you can continue to refer to Figure 3 , Figure 3The dashed box on the right represents the measurement operation. After the rotation gate in each quantum gate group applies a quantum gate operation to the quantum state data, a quantum measurement is performed on the quantum state obtained by processing each target quantum gate group. The quantum state of the qubit in each target quantum gate group is read out, and the measurement result is used as an element in the quantum kernel matrix.

[0067] In this embodiment, by measuring the target quantum gate group after performing quantum entanglement operation, the similarity measure between image data can be extracted from the quantum state, thereby improving the accuracy of data feature extraction.

[0068] Furthermore, in one embodiment, the target quantum gate group is measured, and a quantum core matrix is ​​obtained based on the measurement results, including: measuring and sampling the measurement results of the final states of each quantum gate group in the quantum core circuit multiple times; statistically obtaining the probability distribution of the final states of the quantum gate group based on the measurement results; and generating a quantum core matrix based on the probability distribution.

[0069] Here, the final state refers to the final quantum state obtained by the quantum nuclear circuit after performing quantum gate operations. Quantum measurement causes the quantum state to collapse to a certain definite state, so probabilistic measurement results can be obtained by sampling the final states of the quantum gate group. Since the quantum state measurement process causes quantum state collapse, and the results obtained from each measurement may be different, the accuracy of the measurement results can be improved by sampling the measurement results of the final states of each quantum gate group in the quantum nuclear circuit multiple times. Optionally, after performing multiple measurements on the same final state, the probabilities obtained from the multiple measurements are statistically analyzed using mathematical methods such as frequency statistics, expected value statistics, and variance calculation to obtain a probability distribution, and the measurement results with higher probability distributions are used as elements in the quantum nuclear matrix.

[0070] In this embodiment, the quantum kernel matrix with accurate measurement results is obtained by performing multiple statistical samplings on the probability distribution values ​​of the final states of the quantum gate group.

[0071] In one embodiment, mapping quantum state data based on a quantum core circuit includes: transforming the quantum state data in a first-dimensional space based on the quantum core circuit to obtain quantum state data mapped to a second-dimensional space, wherein the second-dimensional space has a higher dimension than the first-dimensional space.

[0072] Single-qubit gates can realize various transformations of qubits within the space without involving high-dimensional mapping. Combining single-qubit gates with multi-qubit gates can expand the dimension of the state space containing quantum state data. Optionally, quantum core circuits can be constructed based on single-qubit and multi-qubit gates to map quantum state data to a higher-dimensional quantum core space. Single-qubit gates can be H-gates, rotation gates, etc.; multi-qubit gates can be CNOT gates, Toffoli gates, etc. Optionally, quantum core circuits can be constructed using rotation gates and entanglement gates.

[0073] In this embodiment, quantum state data is mapped to a high-dimensional quantum kernel space using quantum kernel circuits, enabling even relatively small-scale quantum systems to handle extremely complex feature spaces. At the same time, the high-dimensional nonlinear mapping capability of quantum kernels is used to enhance the feature representation capability of classical convolution.

[0074] In one embodiment, quantum state encoding of image data to obtain quantum state data includes: mapping pixel values ​​in the image data to a target interval; constructing a quantum gate circuit based on a preset rotating gate; and converting the mapped pixel values ​​into rotation angle parameters of the qubits based on the quantum gate circuit.

[0075] By mapping pixel values ​​in image data to a target range, the image data can be normalized, ensuring that pixel values ​​correspond to the value range of the rotation angle of the rotating gate. The target range can be set according to quantum angle encoding requirements. Optionally, multiple identical preset rotating gates can be obtained, and quantum gate circuits can be constructed using single-qubit rotating gates.

[0076] In this embodiment, by using a single-qubit rotating gate, classical data values ​​can be directly mapped to quantum state parameters, thereby realizing the quantum state representation of the entire image through the stacking of quantum gate circuits.

[0077] In one embodiment, after using a quantum kernel matrix as a convolution kernel and performing a convolution operation on the image data to obtain a convolutional feature map of the image data, the method further includes: inputting the convolutional feature map into a fully connected layer to obtain intermediate data; inputting the intermediate data into a Softmax layer, and predicting the class label of the image data based on the Softmax layer.

[0078] Fully connected layers, also known as dense layers, are a type of layer in neural networks. In a fully connected layer, each input node is connected to every output node, used to extract high-level abstract features from the convolutional feature map. The softmax layer is an activation function used to calculate the probability distribution of each class label in the image data. The index of the highest probability value in the vector output by the softmax layer represents the predicted class label of the image data.

[0079] In this embodiment, after obtaining the convolutional feature map, the class label probability classification output can be achieved through fully connected and Softmax layers, thereby realizing the classification of image data, and the classification accuracy is higher than that of traditional image classification methods.

[0080] In one embodiment, Figure 4 A flowchart illustrating another data feature extraction method based on quantum convolutional neural networks is provided, such as... Figure 4 As shown, it includes the following steps:

[0081] Step S401, Quantum state encoding: Input classical image data, convert it into a quantum state through the quantum state encoding module, and load it into the quantum processing unit to obtain the quantum state data in the above embodiment.

[0082] Optionally, the quantum state encoding module is used to implement angle encoding: input image data, and sequentially perform quantum state encoding on each image through the RY rotating gate, with the rotation angle related to the specific data.

[0083] For example, the data can be preprocessed before quantum state encoding, including: inputting a classical image dataset, normalizing the image, and mapping pixel values ​​to the (0, π) interval; employing a quantum angle encoding method, using an RY rotation gate to convert each pixel value into a rotation angle parameter of a qubit, and realizing the quantum state representation of the entire image through quantum circuit stacking. Here, the RY rotation gate is a single-qubit rotation gate around the Y-axis. For example, for pixel values ​​in image data... The corresponding rotation angle of the RY gate is .

[0084] Step S402, Quantum Core Circuit Construction: A parameterized quantum core circuit is designed as a quantum core mapping module. The constructed quantum core circuit maps quantum state data to a high-dimensional quantum core space through tunable quantum gates such as rotation gates and entanglement gates. A quantum core matrix can be generated based on the mapping results of the quantum core mapping module.

[0085] For example, constructing such Figure 3 The parameterized quantum core circuit shown includes RX rotating gates, RY rotating gates, RZ rotating gates, and CNOT entanglement gates. After mapping the encoded quantum state to a high-dimensional quantum core space through the quantum core circuit, the final state of the quantum core circuit is measured. By sampling multiple times and statistically analyzing the probability distribution of the measurement results, a quantum core matrix K is generated, which characterizes the similarity measure in the quantum feature space. Optionally, when the quantum core matrix dimension is 2×2, a quantum core matrix K=[1, 0.85; 0.9, 0.79] can be generated. It is understood that the quantum core matrix dimension can be set according to requirements, and the generated quantum core matrix will be different depending on the actual measurement results and image data. Therefore, no restrictions are placed on the value of the quantum core matrix here.

[0086] Step S403, Quantum convolution kernel extraction: The output quantum state of the quantum core circuit is measured, the measurement result is converted into classical data, a quantum convolution kernel weight matrix is ​​generated, and stored in a classical database.

[0087] Optionally, the rotating gates in the quantum nuclear circuit are divided according to the dimension of the quantum nuclear matrix to obtain multiple quantum gate groups. The final quantum state of all qubits is measured, and the quantum state of the qubits in each quantum gate group is read out in sequence. The corresponding quantum nuclear matrix is ​​obtained based on the quantum state.

[0088] Step S404, Classical-Quantum Cooperative Feature Extraction: The quantum convolution kernel is used as a preprocessing layer of the classical convolutional neural network. The parameters of the quantum kernel circuit are adjusted by backpropagation using the classical optimizer to minimize the classification loss function.

[0089] The data feature extraction method based on quantum convolutional neural networks in this embodiment, given training image data, only requires quantum kernel circuits to learn the quantum convolutional kernel and complete the training process of the quantum convolutional neural network. This allows for the design of the convolutional kernel within the neural network using quantum kernel learning, and the required number of qubits can be designed independently as needed. Prediction is achieved through classical fully connected layers and a Softmax classifier. While maintaining classification accuracy, high-quality feature extraction requires only a small number of qubits, reducing the number of quantum hardware calls and significantly reducing computational costs and energy consumption.

[0090] Furthermore, addressing the issue that current quantum machine learning models require quantum computing during both training and testing, which places extremely high demands on quantum hardware, based on... Figure 4 The data feature extraction method based on quantum convolutional neural networks shown can be used to design a quantum convolutional neural network model that only requires quantum computation during training. Steps S401 to S403 correspond to the training phase, and step S404 corresponds to the testing phase.

[0091] Figure 5 A schematic diagram of quantum machine learning model training and testing is provided, such as... Figure 5 As shown, during the training phase, the quantum gate circuit in the above embodiment is constructed using RY rotating gates, and the quantum core circuit in the above embodiment is constructed using RX, RY, RZ, and CNOT gates. The quantum core circuit includes R... X (θ5), R Y (θ6), R z (θ7) ..., R x (θ) 20The system comprises 24 rotating gates and 16 controlled gates (CNOT gates). Since the quantum kernel matrix has a 2×2 dimension, every four consecutive rotating gates are grouped into a quantum gate group. Rotating gates in the same order within each quantum gate group are connected by controlled gates. First, the image data in the zero state is quantum-encoded using RY rotating gates. Then, the constructed quantum kernel circuit maps the quantum state data, and quantum measurement operations are performed on the final states of each quantum gate group in the quantum kernel circuit to obtain the quantum kernel matrix. During the training phase, quantum kernel learning can be achieved through quantum kernel circuit construction and quantum convolution kernel extraction.

[0092] During the testing phase, the input image only needs to undergo sequential convolution operations through the quantum kernel matrix to extract the features of each image. Then, it passes through a fully connected layer and a Softmax classifier to output the predicted class label. Optionally, the learned quantum kernel matrix is ​​used to sequentially convolve the initial image data to extract key feature representations. This includes: using the quantum kernel matrix K as a fixed convolution kernel in a classical convolutional neural network, performing convolution operations on the input data in classical computational units. For example, the quantum convolution kernel is used to perform two-dimensional convolution operations on the image data to extract local features, including edges and textures, to obtain a convolutional feature map. This process utilizes the high-dimensional nonlinear mapping capability of the quantum kernel to enhance the feature representation capability of classical convolution. After obtaining vector dimensions including 1, 2, ..., 784, image classification and model output are achieved through a fully connected layer. This includes: inputting the convolutional feature map into a fully connected layer, where each neuron in the fully connected layer is connected to all neurons in the previous layer; then, a Softmax layer is used to predict the intermediate data output by the fully connected layer to obtain the class label probability distribution of the image data. Figure 5 In this model, the predicted labels are 1, 2, ..., 10. Therefore, the testing phase can be performed on a classical computer. Taking handwritten digit image recognition as an example, users can extract features through quantum kernels, while the classification is completed solely by classical computation during testing.

[0093] Quantum machine learning models can also support dynamic optimization of quantum kernel parameters, such as adjusting the number of qubits based on image complexity. Optionally, when performing data feature extraction methods based on quantum convolutional neural networks, the number of qubits or gate sequence depth of the quantum kernel circuit can be dynamically adjusted according to the data complexity (such as image resolution or noise level) to balance computational efficiency and accuracy. Optionally, monitoring test accuracy and quantum resource consumption can also be fed back to the quantum kernel design module to iteratively optimize the quantum circuit structure, such as reducing redundant quantum gates or adding new quantum gates to the quantum kernel circuit.

[0094] In this embodiment, the quantum machine learning model is a convolutional neural network model based on quantum kernel learning. It can improve the efficiency of image classification tasks while reducing resource consumption through quantum-classical collaborative computation. Specifically, during the training phase, the quantum machine learning model uses quantum state encoding to convert classical image data into quantum states, constructs a high-dimensional quantum kernel space through parameterized quantum circuits, and extracts quantum convolutional kernels. During the testing phase, it only needs to call the pre-trained quantum convolutional kernels to extract features from the input data, and completes prediction through classical fully connected layers and a Softmax classifier, significantly reducing dependence on quantum hardware.

[0095] Furthermore, quantum machine learning models support dynamic adjustment of quantum resources (such as the number of qubits and the depth of gate sequences), which can adapt to different data complexities and achieve seamless integration of quantum computing with classical frameworks. On datasets such as MNIST (handwritten digit images), they maintain higher classification accuracy than traditional convolutional neural networks and quantum convolutional neural networks, combining efficiency, compatibility and scalability.

[0096] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0097] Based on the same inventive concept, this application also provides a quantum convolutional neural network-based data feature extraction device for implementing the aforementioned quantum convolutional neural network-based data feature extraction method. The solution provided by this device is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of the quantum convolutional neural network-based data feature extraction device provided below can be found in the limitations of the quantum convolutional neural network-based data feature extraction method described above, and will not be repeated here.

[0098] In one embodiment, such as Figure 6 As shown, a data feature extraction device based on a quantum convolutional neural network is provided, comprising: an encoding module, a mapping module, a measurement module, and a convolution module, wherein:

[0099] The encoding module is used to encode image data into quantum states to obtain quantum state data;

[0100] The mapping module is used to construct quantum core circuits and map quantum state data based on the quantum core circuits;

[0101] The measurement module is used to perform quantum measurements on the final state of the quantum core circuit to obtain the quantum core matrix;

[0102] The convolution module is used to perform convolution operations on image data using the quantum kernel matrix as the convolution kernel, thereby obtaining the convolutional feature map of the image data.

[0103] In one embodiment, the mapping module constructs a quantum core circuit, including: sequentially acquiring multiple rotating gates, with the rotation axes corresponding to each rotating gate cyclically set in a specified order; determining the target number according to a preset convolution kernel stride; dividing the rotating gates into multiple quantum gate groups according to the acquisition order, with each quantum gate group including the target number of adjacent rotating gates; and connecting the quantum gates in the same sorting position within each quantum gate group based on entanglement gates to obtain a quantum core circuit, where the sum of the target number and the number of entangled gates equals the number of qubits.

[0104] In one embodiment, the measurement module performs quantum measurements on the final states of the quantum core circuit to obtain a quantum core matrix, including: acquiring the target quantum gate group after performing a quantum entanglement operation; measuring the target quantum gate group; and obtaining the quantum core matrix based on the measurement results. Optionally, the measurement module measures the target quantum gate group, including: repeatedly measuring and sampling the measurement results of the final states of each quantum gate group in the quantum core circuit; statistically obtaining the probability distribution of the final states of the quantum gate group based on the measurement results; and generating a quantum core matrix based on the probability distribution.

[0105] In one embodiment, the mapping module maps quantum state data based on a quantum core circuit, including: transforming the quantum state data in the first-dimensional space based on the quantum core circuit to obtain quantum state data mapped to the second-dimensional space, wherein the second-dimensional space has a higher dimension than the first-dimensional space.

[0106] In one embodiment, the encoding module performs quantum state encoding on the image data to obtain quantum state data by: mapping pixel values ​​in the image data to a target interval; constructing a quantum gate circuit based on a preset rotating gate; and converting the mapped pixel values ​​into rotation angle parameters of the qubits based on the quantum gate circuit.

[0107] In one embodiment, the data feature extraction device based on quantum convolutional neural network further includes a prediction module. The prediction module is used to input the convolutional feature map of the image data into a fully connected layer after using the quantum kernel matrix as the convolution kernel and performing a convolution operation on the image data to obtain the convolutional feature map of the image data, thereby obtaining intermediate data; input the intermediate data into a Softmax layer, and predict the class label of the image data based on the Softmax layer.

[0108] The modules in the aforementioned quantum convolutional neural network-based data feature extraction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0109] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a data feature extraction method based on a quantum convolutional neural network. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0110] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0111] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0112] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0113] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0114] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0115] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0116] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data feature extraction method based on quantum convolutional neural networks, characterized in that, The method comprises: Quantum state data is obtained by quantum state encoding of image data; Construct a quantum core circuit and map the quantum state data based on the quantum core circuit; The quantum core matrix is ​​obtained by performing quantum measurements on the final state of the quantum core circuit. The quantum kernel matrix is ​​used as the convolution kernel, and the image data is convolved to obtain the convolution feature map of the image data. The construction of the quantum core circuit includes: sequentially acquiring multiple rotating gates, with the rotation axes corresponding to each rotating gate cyclically set in a specified order; determining a target number based on a preset convolution kernel stride; dividing the rotating gates into multiple quantum gate groups according to the acquisition order, with each quantum gate group including the target number of adjacent rotating gates; and connecting the quantum gates in the same sorting position within each quantum gate group based on entanglement gates to obtain the quantum core circuit, wherein the sum of the target number and the number of entangled gates equals the number of qubits.

2. The method according to claim 1, characterized in that, The process of performing quantum measurements on the final state of the quantum core circuit to obtain the quantum core matrix includes: Obtain the target quantum gate group after performing a quantum entanglement operation; The target quantum gate group is measured, and the quantum core matrix is ​​obtained based on the measurement results.

3. The method according to claim 2, characterized in that, The measurement of the target quantum gate group includes: The measurement results of the final states of each quantum gate group in the quantum core circuit are measured and sampled multiple times; The probability distribution of the final state of the quantum gate group is obtained statistically based on the measurement results, and the quantum kernel matrix is ​​generated based on the probability distribution.

4. The method according to claim 1, characterized in that, Mapping the quantum state data based on the quantum core circuit includes: Based on the quantum core circuit, the quantum state data in the first dimension is transformed to obtain the quantum state data mapped to the second dimension, where the second dimension is higher than the first dimension.

5. The method according to claim 1, characterized in that, The process of quantum-state encoding the image data to obtain quantum-state data includes: Map the pixel values ​​in the image data to the target range; Construct a quantum gate circuit based on a pre-designed rotating door; The mapped pixel values ​​are converted into rotation angle parameters of the qubits based on the quantum gate circuit.

6. The method according to claim 1, characterized in that, After using the quantum kernel matrix as a convolution kernel and performing a convolution operation on the image data to obtain the convolutional feature map of the image data, the method further includes: The convolutional feature map is input into a fully connected layer to obtain intermediate data; The intermediate data is input into the Softmax layer, and the class label of the image data is predicted based on the Softmax layer.

7. A data feature extraction device based on a quantum convolutional neural network, characterized in that, The device comprises: The encoding module is used to encode image data into quantum states to obtain quantum state data; A mapping module is used to construct a quantum core circuit and map the quantum state data based on the quantum core circuit; The measurement module is used to perform quantum measurements on the final state of the quantum core circuit to obtain the quantum core matrix; The convolution module is used to use the quantum kernel matrix as a convolution kernel and perform convolution operations on the image data to obtain the convolution feature map of the image data. The construction of the quantum core circuit includes: sequentially acquiring multiple rotating gates, with the rotation axes corresponding to each rotating gate cyclically set in a specified order; determining a target number based on a preset convolution kernel stride; dividing the rotating gates into multiple quantum gate groups according to the acquisition order, with each quantum gate group including the target number of adjacent rotating gates; and connecting the quantum gates in the same sorting position within each quantum gate group based on entanglement gates to obtain the quantum core circuit, wherein the sum of the target number and the number of entangled gates equals the number of qubits.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.