Image classification method based on multi-quantum filtering convolutional neural network

Through the multi-quantum filtering convolutional neural network, the multi-topology structure quantum filter and qubit measurement attention mechanism are used to solve the problem of insufficient feature extraction of a single topology QCNN, and achieve more efficient image classification performance.

CN120279322APending Publication Date: 2025-07-08NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510365726.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The existing quantum convolutional neural network (QCNN) has insufficient feature extraction capabilities, low classification accuracy, and significant entropy loss when the feature value is measured locally.

Method used

Multi-quantum filtering convolutional neural network is used to extract features using multiple quantum filters with different topological structures, and combined with qubit measurements to focus on the correlation between images, encode image pixel values through quantum revolving gates, and train them using quantum convolutional layer, quantum measurement attention layer, pooling layer and fully connected layer to introduce a cross entropy loss function optimization model.

Benefits of technology

It improves the accuracy and reliability of image classification, breaks through the limitations of feature extraction capabilities of single topological quantum nuclei, effectively utilizes the advantages of quantum computing, adapts to the quantum computing environment, and achieves more efficient feature extraction and classification performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279322A_ABST
    Figure CN120279322A_ABST
Patent Text Reader

Abstract

The invention discloses an image classification method based on a multi-quantum filtering convolutional neural network, and the method comprises the steps: compressing a pixel value of an obtained image, and coding the compressed pixel value into a corresponding quantum state through a quantum revolving door; and inputting the quantum state into a quantum convolutional neural network to obtain an image label predicted value, training the quantum convolutional neural network by using the predicted value and a loss function to obtain a trained quantum convolutional neural network, the quantum convolutional neural network including a quantum convolutional layer, a quantum measurement attention layer, a pooling layer and a full connection layer, the quantum convolution layer comprises G quantum filters; and inputting an image needing to be detected into the trained quantum convolutional neural network to complete image classification. According to the method, the multi-topology quantum convolutional neural network is combined with a quantum bit measurement attention mechanism, so that the problem of great loss of entanglement information in a measurement stage is effectively solved, the method can better adapt to a quantum calculation environment, and the advantages of quantum calculation are exerted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence, and particularly relates to an image classification method based on a multi-quantum filter convolutional neural network. Background Art

[0002] With the development of computer technology, QML (Quantum Machine Learning) is a promising application of quantum computing, which can exponentially accelerate classical algorithms through its powerful parallel computing ability. In recent years, QML has attracted extensive attention from scholars in related research fields, including variational quantum autoencoders, quantum generative adversarial learning, variational quantum eigensolvers, etc. Currently, due to the limited quantum hardware resources of NISQ (Noisy Intermediate-Scale Quantum Era), large-scale quantum computers have not been widely applied. Combining quantum computing and machine learning to process and learn data will be a new solution. Compared with traditional machine learning algorithms, QML algorithms have faster speeds and better performance, providing a way to better understand and utilize large-scale data. In the field of artificial intelligence, QML can provide faster and more efficient solutions for problems such as image classification, natural language processing, and financial risk prediction. At the same time, QML can also provide new ideas and methods for problems in fields such as materials science and biology.

[0003] In 2019, Cong et al. proposed the first QCNN (Quantum Convolutional Neural Networks), which uses a quantum circuit to simulate one-dimensional convolution operations. The proposed QCNN architecture is similar to that of a convolutional neural network. H. Chen et al. trained a hybrid QCNN to distinguish two types of quantum data. In addition, applying QML to classify real-world data is also very attractive. However, considering the limited number of qubits and quantum gates available on current quantum devices, another QCNN was proposed, which uses quantum filters instead of classical filters for feature extraction and combines it with a classical neural network for classification tasks. For example, W. Huggins et al. trained a quantum tensor network to classify 45 groups based on a handwritten digit dataset in 2019. Liu et al. used quantum filters to extract handwritten digit classification features in 2021. In 2022, Jing et al. proposed a QCNN for multi-channel image feature extraction.

[0004] Current QCNNs usually adopt a single topology strategy to construct quantum filters, that is, the parameterized circuit topologies of all quantum filters are the same. However, a parameterized quantum circuit with a single topology cannot uniformly explore the Hilbert space, that is, the expressibility and entanglement ability of the circuit are low, and the feature extraction ability is weak. On the other hand, since the eigenvalues are obtained through local measurements, there is often a significant entropy loss. The extracted eigenvalues are usually not comprehensive enough, resulting in low classification accuracy of QCNNs. Summary of the Invention

[0005] The object of the present invention is to provide an image classification method based on a multi-quantum filter convolutional neural network, which uses multiple quantum filters with different topological structures for feature extraction, and uses qubit measurement attention to explore the correlation between the measured images, so as to extract data features more comprehensively and thus obtain better image classification performance.

[0006] The present invention adopts the following technical solutions: An image classification method based on a multi-quantum filter convolutional neural network, comprising the following steps:

[0007] S1. Compress the pixel values of the acquired image, and encode the compressed pixel values into corresponding quantum states by using a quantum rotation gate.

[0008] S2. Input the quantum state obtained in step S1 into a quantum convolutional neural network to obtain an image label prediction value, and use this prediction value and a loss function to train the quantum convolutional neural network to obtain a trained quantum convolutional neural network.

[0009] S3. Input the image to be detected into the trained quantum convolutional neural network to complete image classification.

[0010] Further, in step S1, obtaining the quantum state includes the following content:

[0011] Use a quantum filter with a window size of m×n to scale the pixel values [α 11 , α 21 ,..., α l1 , α 12 ,..., α lc into and convert it into a quantum state. The specific formula is:

[0012]

[0013] where represents the quantum state corresponding to the pixel value; represents the outer product operation; c represents the total number of channels; l represents the total number of qubits of the quantum filter, l = mn, m represents the width of the quantum filter window, and n represents the height of the quantum filter window; R y represents the y-axis rotation gate; α io represents the pixel value of the i-th qubit of the quantum filter in the o-th channel; |0> io represents the initial quantum state of the i-th qubit of the quantum filter in the o-th channel; |0> lo represents the initial quantum state of the l-th qubit of the quantum filter in the o-th channel; α l1 represents the pixel value of the l-th qubit of the quantum filter in the 1st channel; α lc represents the pixel value of the l-th qubit of the filter in the c-th channel.

[0014] Further, in step S2, obtaining the image label prediction value includes the following content:

[0015] The quantum convolutional neural network includes a quantum convolutional layer, a quantum measurement attention layer, a pooling layer, and a fully connected layer.

[0016] Among them, the quantum convolutional layer includes G quantum filters.

[0017] The quantum state undergoes feature extraction processing by the quantum convolutional layer, and a measurement operation is performed on each qubit to obtain a local measurement feature map. This image undergoes coefficient calculation and aggregation processing by the quantum measurement attention layer to obtain a first feature image corresponding to each quantum filter. This image undergoes a max-pooling operation by the pooling layer to obtain a second feature image. The second feature image is tiled to obtain a new feature vector, and this feature vector passes through the fully connected layer to obtain the image label prediction value.

[0018] Further, in the quantum convolutional layer, G quantum filters are used to perform feature high-dimensional mapping and feature extraction on the quantum state to obtain a new feature quantum state. The specific formula is:

[0019]

[0020] Among them, U g represents the g-th quantum filter, g = 1, 2,..., G; represents the new feature quantum state.

[0021] The new feature quantum state is measured using the Z-basis measurement to obtain the corresponding feature vector. The specific formula is:

[0022]

[0023] Among them, E image represents the feature vector, Z lcDenotes the Z-basis measurement operation performed on the l-th qubit of the quantum filter in the c-th channel.

[0024] Each quantum filter obtains a feature vector of length lc. The feature vector is divided into lc groups in position sequence and concatenated in turn according to the processing order of the quantum filters to obtain G groups of lc local measurement feature maps.

[0025] Furthermore, in the quantum measurement attention layer, the measurement attention mechanism is used to perform attention operations on the local measurement feature maps to obtain G groups of weight sets. Each group of weight sets includes lc weight values. Each group of local measurement feature maps is tiled, multiplied by the weight matrix W, added to the bias b, and processed by the activation function to obtain the corresponding feature vector. The specific formula is:

[0026] u p =σ(Wh p +b)

[0027] where u p represents the feature vector of the p-th local measurement feature map, h p represents the flattened vector of the p-th local measurement feature map, p = 1, 2, …, lc, and σ() represents the activation function.

[0028] The local measurement feature maps are merged according to the obtained feature vectors to obtain G first feature images s. The specific expression is:

[0029]

[0030] where a p represents the weight value of the p-th local measurement feature map, represents the transpose of u p , Y represents the weight matrix, u q represents the q-th feature vector of the local measurement feature map, a q represents the weight value of the q-th feature vector, and image q represents the q-th local measurement feature map.

[0031] Furthermore, in the pooling layer, a pooling window of a fixed size is set, and the pooling window is slid on the first feature image according to the set stride. At each sliding position, the maximum value among all pixel values in the pooling window replaces the pixel values in the original window to obtain G second feature images.

[0032] Furthermore, in step S2, the loss function is the cross-entropy loss function.

[0033] Furthermore, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the image classification method based on the multi-quantum filtering convolutional neural network are implemented.

[0034] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the image classification method based on the multi-quantum filtering convolutional neural network.

[0035] Compared with the prior art, the present invention adopts the above technical solutions and has the following technical effects:

[0036] The present invention combines the multi-topology quantum convolutional neural network with the qubit measurement attention mechanism, breaking through the limitation of the single-topology quantum kernel feature extraction ability and opening up a new direction for the development of quantum neural networks. By introducing quantum kernels with multiple different topologies, image features can be mined from multiple perspectives, providing new ideas and references for subsequent related research.

[0037] The qubit measurement attention mechanism proposed by the present invention closely combines the characteristics of entanglement information in the quantum measurement process, effectively solves the problem of a large amount of loss of entanglement information in the measurement stage, can better adapt to the quantum computing environment, and gives full play to the advantages of quantum computing.

[0038] The present invention has higher accuracy, practicability, and reliability in image classification tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is the overall flowchart of the present invention.

[0040] Figure 2 is a schematic diagram of a 4-qubit quantum filter with a linear topology structure according to the present invention.

[0041] Figure 3 is the topology structure diagram of the present invention.

[0042] Figure 4 is the measurement attention mechanism diagram of the present invention.

[0043] Figure 5 is the result diagram of various methods for processing image classification in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be used to limit the protection scope of the present invention.

[0045] To achieve the above object, the present invention proposes an image classification method based on a multi - quantum filtering convolutional neural network, as Figure 1 shown, and the specific steps are as follows:

[0046] S1. Compress the pixel values of the images in the CIFAR - 10 dataset, and encode the compressed pixel values into corresponding quantum states using quantum rotation gates. The specific content is as follows:

[0047] Use a quantum filter with a window size of m×n to scale the pixel values [α 11 ,α 21 ,...,α l1 ,α 12 ,...,α lc of the image into and convert them into quantum states. The specific formula is:

[0048]

[0049] where, represents the quantum state corresponding to the pixel value; represents the outer product operation; c represents the total number of channels; l represents the total number of qubits of the quantum filter, l = mn, m represents the width of the quantum filter window, and n represents the height of the quantum filter window; R y represents the y - axis rotation gate; α io represents the pixel value of the i - th qubit of the quantum filter in the o - th channel; |0> io represents the initial state of the i - th qubit of the quantum filter in the o - th channel; |0> lo represents the initial state of the l - th qubit of the quantum filter in the o - th channel; α l1 represents the pixel value of the l - th qubit of the quantum filter in the 1 - st channel; α lc represents the pixel value of the l - th qubit of the filter in the c - th channel.

[0050] S2. The original intention of image convolution operation is to find the internal correlation of adjacent pixels. Due to the superposition and entanglement principles of quantum computing, QNN (Quantum Neural Network) can better represent the connection between data. Therefore, a quantum filter can be used to replace the classical filter to extract the deep features between pixels.

[0051] Input the quantum state obtained in step S1 into the quantum convolutional neural network to obtain the predicted value of the image label. Use this predicted value and the cross - entropy loss function to train the quantum convolutional neural network to obtain the trained quantum convolutional neural network. The specific content is as follows:

[0052] The quantum convolutional neural network includes a quantum convolutional layer, a quantum measurement attention layer, a pooling layer, and a fully connected layer.

[0053] Among them, the quantum convolutional layer includes G quantum filters.

[0054] As Figure 2 shown, the quantum state undergoes feature extraction processing in the quantum convolutional layer, and a measurement operation is performed on each qubit to obtain a local measurement feature map. The specific content is as follows:

[0055] Use G quantum filters to perform feature high-dimensional mapping and feature extraction on the quantum state to obtain a new feature quantum state. The specific formula is:

[0056]

[0057] Among them, U g represents the g-th quantum filter, g = 1, 2,..., G; represents the new feature quantum state.

[0058] In order to reduce feature loss, perform a measurement on the new feature quantum state using the Z-basis measurement to obtain the corresponding feature vector. The specific formula is:

[0059]

[0060] Among them, E image represents the feature vector, and Z lc represents the Z-basis measurement operation performed on the l-th qubit of the quantum filter in the c-th channel.

[0061] Each quantum filter obtains a feature vector of length lc. Divide this feature vector into lc groups in the position order, and splice them in turn according to the processing order of the quantum filters to obtain G groups of lc local measurement feature maps.

[0062] Formula (3) is non-linear, so there is no need to add an additional non-linear function. It can be seen from formula (3) that when using a quantum filter with a window size of m×n to operate on an image with c channels, at least mnc qubits are required. In fact, the minimum number of qubits is mn because there are no quantum gates between channels, and these qubits can be reused for different quantum filters. Therefore, the quantum convolutional layer is friendly and suitable for NISQ (Noisy Intermediate-Scale Quantum Era, medium-scale noisy), because only a few qubits are required and no additional qubits are needed.

[0063] Construct PQC (Parameterized Quantum Circuit) using multiple topologies to generate quantum filters. The specific content is as follows:

[0064] In traditional QCNN (Quantum Convolutional Neural Networks), quantum filters are usually composed of a single topology. However, due to the singularity of the circuit topology, that is, the expressiveness and entanglement ability of a single-topology circuit are relatively low, the exploration of the Hilbert space is often uneven. Expressiveness is defined as the ability of a circuit to generate (pure) states that well represent the Hilbert space. The potential advantages of PQCs with high entanglement ability include the ability to effectively represent the solution space of tasks such as ground state preparation or data classification, and to capture non-trivial correlations in quantum data.

[0065] Figure 3 Five common topologies are listed, and each topology corresponds to three methods of constructing quantum gates (Rx rotation gate, Ry rotation gate, Rz rotation gate). A total of 15 four-qubit PQCs are listed. These circuits can be used as a quantum filter of size 2×2 (m×n = 2×2). Figure 3 (a)-(c) of are quantum filters with random topologies constructed using Rx rotation gate, Ry rotation gate, and Rz rotation gate respectively. The qubit connection of the random topology is completely random. Figure 3 (d)-(f) of are quantum filters with linear topologies constructed using Rx rotation gate, Ry rotation gate, and Rz rotation gate respectively. Adjacent qubits are connected in sequence. Figure 3 (g)-(i) of are quantum filters with ring topologies. On the basis of the linear topology, the last qubit is connected to the first qubit. Figure 3 (j)-(l) of are quantum filters with double-ring topologies constructed using Rx rotation gate, Ry rotation gate, and Rz rotation gate respectively. On the basis of the ring topology, a misaligned connection is introduced in the second layer. Figure 3 (m)-(o) of are quantum filters with all-to-all topologies constructed using Rx rotation gate, Ry rotation gate, and Rz rotation gate respectively. Any two qubits are connected to each other.

[0066] These PQCs can be regarded as quantum filters of different depths, which are used to extract shallow features and deep features of data respectively. Therefore, it is of great significance to select circuits with different topologies for quantum filters. To better express the features of data, this method proposes a quantum filter selection algorithm. The above-mentioned 15 circuits will be used as quantum filters of MQCNN-QA (Multi-scale Quantum Convolutional Neural Network with Quantum Attention).

[0067] As Figure 4 shown, the local measurement feature maps obtained in the quantum convolutional layer are processed by coefficient calculation and aggregation in the quantum measurement attention layer to obtain the first feature images corresponding to each quantum filter. The specific content is as follows:

[0068] Using the measurement attention mechanism to perform attention operations on the local measurement feature maps, G sets of weight sets are obtained. Each set of weight sets includes lc weight values. The local measurement feature maps of each group are tiled, multiplied by the weight matrix W, added with the bias b, and processed by the activation function to obtain the corresponding feature vectors. The specific formula is:

[0069] u p =σ(Wh p +b) (4)

[0070] where u p represents the feature vector of the p-th local measurement feature map, h p represents the flattened vector of the p-th local measurement feature map, p = 1, 2,..., lc, and σ() represents the activation function.

[0071] According to the obtained feature vectors, the local measurement feature maps are merged to obtain G first feature images s. The specific expression is:

[0072]

[0073] where a p represents the weight value of the p-th local measurement feature map, represents the transpose of u p , Y represents the weight matrix, u q represents the q-th feature vector of the local measurement feature map, a q represents the weight value of the q-th feature vector, and image q represents the q-th local measurement feature map.

[0074] Then, according to the weights of these local measurement feature maps, they are overlapped. After being processed by the quantum measurement attention layer, a total of G new feature images are retained for the next layer for subsequent operations.

[0075] In order to reduce the data dimension and retain key information, the first feature image obtained in the quantum measurement attention layer undergoes a max-pooling operation in the pooling layer to reduce the data dimension to prevent overfitting and obtain the second feature image. The specific content is as follows:

[0076] Set a pooling window of size 2×2, and slide the pooling window over the G first feature images with a stride of 2. At each sliding position, replace the pixel values in the original window with the maximum value among all pixel values within the pooling window to obtain G second feature images. The scale of this image is 1 / 4 of the scale of the first feature image.

[0077] Flatten the second feature image to obtain a new feature vector, and this feature vector passes through the fully connected layer to obtain the predicted value of the image label.

[0078] S3. Input the image to be detected into the trained quantum convolutional neural network to complete image classification.

[0079] Example:

[0080] The CIFAR-10 dataset consists of 60,000 color images of 32×32 pixels in 10 categories. This dataset is divided into a training set and a test set. The training set contains 50,000 images, and the test set contains 10,000 images. Scale the images in the dataset to 10×10, randomly select 640 images from each category as the training set, and randomly select 100 images from each category as the test set.

[0081] The experimental device is a server equipped with an Intel Xeon Gold 5220R CPU (2.20GHz) and two NVIDIA A100-PCIE-40GB GPUs.

[0082] The software environment is Python 3.10 in the Linux system. The deep learning framework uses PyTorch, and the quantum simulator selects PennyLane. The parameter optimizer uses the Adam optimizer, the learning rate is set to 0.001, the batch size is 128, the number of training epochs is 50, and the activation function is the ReLU function. The number of quantum kernels is 5, the size is 2, and the stride is 1. All codes can be obtained at "https: / / github.com / wqs1999 / MQCNN-QA".

[0083] To verify the effectiveness of the proposed MQCNN-QA of the present invention, the performances of QEN (Quantum Embedding Network), FQCNN (Fully Quantum Convolutional Neural Network), DR-QCNN (Deep Residual Quantum Convolutional Neural Network), MQCNN (Multi-scale Quantum Convolutional Neural Network) and MQCNN-QA were compared on the CIFAR-10 dataset, where MQCNN is the MQCNN-QA model without the attention mechanism. To investigate the performances of these models in tasks with different complexities, a total of nine experiments were conducted, gradually from binary classification to ten-class classification. The category selection and test accuracy are shown in Table 1 and Table 2, and the accuracy convergence curves of the classification experiments are shown in Figure 5 。

[0084] Table 1 Category Selection

[0085] Number of categories Category 2 categories Airplane, car 3 categories Airplane, car, bird 4 categories Airplane, car, bird, cat 5 categories Airplane, car, bird, cat, deer 6 categories Airplane, car, bird, cat, deer, dog 7 categories Airplane, car, bird, cat, deer, dog, frog 8 categories Airplane, car, bird, cat, deer, dog, frog, horse 9 categories Airplane, car, bird, cat, deer, dog, frog, horse, ship 10 categories Airplane, car, bird, cat, deer, dog, frog, horse, ship, truck

[0086] Table 2 Accuracy Comparison

[0087]

[0088]

[0089] Figure 5 Figure (a) of which is the convergence curve graph for binary classification. It can be seen from it that MQCNN-QA has the highest convergence speed and MQCNN has the highest accuracy; Figure 5 Figure (b) of which is the convergence curve graph for three-class classification. It can be seen from it that MQCNN-QA has the highest accuracy, but the leading margin over MQCNN is not high; Figure 5 Figure (c) of which is the convergence curve graph for four-class classification. It can be seen from it that MQCNN-QA has the highest accuracy; Figure 5 Figure (d) of which is the convergence curve graph for five-class classification. It can be seen from it that MQCNN-QA has the highest accuracy; Figure 5 Figure (e) of which is the convergence curve graph for six-class classification. It can be seen from it that MQCNN-QA has the highest accuracy graph. The leading margin of MQCNN-QA over MQCNN increases significantly, and both MQCNN-QA and MQCNN are significantly ahead of DR-QCNN; Figure 5 Figure (f) of which is the convergence curve graph for seven-class classification. It can be seen from it that MQCNN-QA has the highest accuracy;Figure 5 (g) is a convergence curve graph for 8-classification, from which it can be seen that MQCNN-QA still maintains the highest accuracy rate, but there is some overfitting at the end; Figure 5 (h) is a convergence curve graph for 9-classification, from which it can be seen that MQCNN-QA has the highest accuracy rate and always maintains a leading margin; Figure 5 (i) is a convergence curve graph for 10-classification, from which it can be seen that MQCNN-QA has the highest accuracy rate.

[0090] As shown in Table 2 and Figure 5 as shown, in all classification tasks, MQCNN and MQCNN-QA show significant accuracy advantages compared with DR-QCNN. Although in the binary classification task, the accuracy rate of MQCNN-QA is slightly lower than that of MQCNN, its advantage gradually emerges as the problem scale increases. It should be noted that in the 8-classification problem, MQCNN and MQCNN-QA achieve the same accuracy rate, but from the convergence curve, it can be seen that compared with MQCNN, the time required for MQCNN-QA to reach the highest accuracy rate is greatly reduced. This indicates that the attention mechanism enables the model to more effectively focus on the key features in the input data, thereby improving the classification accuracy. It can be seen that both the multi-topology quantum filter mechanism and the qubit measurement attention mechanism of MQCNN-QA improve the model to varying degrees, and as the problem scale expands, the leading margin gradually increases, and the performance of the present invention exceeds the current state-of-the-art models.

[0091] The embodiment of the present invention also proposes an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. It should be noted that when the processor executes the computer program, it corresponds to the specific steps of the method provided by the embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. For the technical details not described in detail in this embodiment, reference can be made to the method provided by the embodiment of the present invention.

[0092] The embodiment of the present invention also proposes a computer-readable storage medium, and the computer-readable storage medium stores a computer program. It should be noted that when the computer program is run by the processor, it corresponds to the specific steps of the method provided by the embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. For the technical details not described in detail in this embodiment, reference can be made to the method provided by the embodiment of the present invention.

[0093] The above are only the preferred embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and deformations can still be made, and these improvements and deformations should also be regarded as the protection scope of the present invention.

Claims

1. An image classification method based on a multi - quantum filtering convolutional neural network, characterized in that, Including: S1. Compress the pixel values of the acquired image, and encode the compressed pixel values into corresponding quantum states by using quantum rotation gates; S2. Input the quantum states obtained in step S1 into a quantum convolutional neural network to obtain an image label prediction value. Use this prediction value and a loss function to train the quantum convolutional neural network to obtain a trained quantum convolutional neural network; S3. Input the image to be detected into the trained quantum convolutional neural network to complete image classification.

2. The image classification method based on a multi - quantum filtering convolutional neural network according to claim 1, wherein In step S1, the obtained quantum states include the following: Using a quantum filter with a window size of m×n to scale the pixel values [α 11 ,α 21 ,...,α l1 ,α 12 ,...,α lc and convert them into quantum states. The specific formula is: And convert it into a quantum state. The specific formula is: Among them, represents the quantum state corresponding to the pixel value; represents the outer product operation; c represents the total number of channels; l represents the total number of qubits of the quantum filter, l = mn, m represents the width of the quantum filter window, and n represents the height of the quantum filter window; R y represents the y-axis rotation gate; α io represents the pixel value of the i-th qubit of the quantum filter in the o-th channel; |0> io represents the initial quantum state of the i-th qubit of the quantum filter in the o-th channel; |0> lo represents the initial quantum state of the l-th qubit of the quantum filter in the o-th channel; α l1 represents the pixel value of the l-th qubit of the quantum filter in the 1st channel; α lc represents the pixel value of the l-th qubit of the filter in the c-th channel.

3. The image classification method based on a multi - quantum filtering convolutional neural network according to claim 1, characterized in that, In step S2, the obtained image label prediction value includes the following: The quantum convolutional neural network includes a quantum convolutional layer, a quantum measurement attention layer, a pooling layer, and a fully connected layer; Among them, the quantum convolutional layer includes G quantum filters; The quantum state undergoes feature extraction processing by the quantum convolutional layer, and a measurement operation is performed on each qubit to obtain a local measurement feature map. This image undergoes coefficient calculation and aggregation processing by the quantum measurement attention layer to obtain a first feature image corresponding to each quantum filter. This image undergoes a max-pooling operation by the pooling layer to obtain a second feature image. The second feature image is tiled to obtain a new feature vector, and this feature vector passes through the fully connected layer to obtain an image label prediction value.

4. The image classification method based on a multi - quantum filtering convolutional neural network according to claim 3, wherein In the quantum convolutional layer, use G quantum filters to perform feature high-dimensional mapping and feature extraction on the quantum state to obtain a new feature quantum state. The specific formula is: Among them, U g represents the g-th quantum filter, where g = 1, 2, …, G; represents the new characteristic quantum state; represents the outer product operation; c represents the total number of channels; l represents the total number of qubits of the quantum filter, l = mn, m represents the width of the quantum filter window, and n represents the height of the quantum filter window; R y represents the y-axis rotation gate; α io represents the pixel value of the i-th qubit of the quantum filter in the o-th channel; |0> io represents the initial state of the i-th qubit of the quantum filter in the o-th channel; |0> lo represents the initial state of the l-th qubit of the quantum filter in the o-th channel; Use Z-basis measurement to measure the new feature quantum state to obtain a corresponding feature vector. The specific formula is: Among them, E image represents the eigenvector, and Z lc represents the Z-basis measurement operation performed by the l-th qubit of the quantum filter in the c-th channel. Each quantum filter obtains a feature vector of length lc. Divide this feature vector into lc groups according to the position sequence, and splice them in turn according to the processing sequence of the quantum filters to obtain G groups of lc local measurement feature maps.

5. The image classification method based on a multi - quantum filtering convolutional neural network according to claim 4, wherein In the quantum measurement attention layer, use the measurement attention mechanism to perform an attention operation on the local measurement feature map to obtain G groups of weight sets. Each group of weight sets includes lc weight values. Tile each group of local measurement feature maps, multiply by the weight matrix W, add the bias b, and process it by the activation function to obtain a corresponding feature vector. The specific formula is: u p = σ(Wh p + b) Among them, u p represents the feature vector of the p-th local measurement feature map, h p represents the flattened vector of the p-th local measurement feature map, p = 1, 2, …, lc, and σ() represents the activation function; Merge the local measurement feature maps according to the obtained feature vectors to obtain G first feature images s. The specific expression is: Among them, a p represents the weight value of the p-th local measurement feature map, represents the transpose of u p , Y represents the weight matrix, and u q represents the q-th eigenvector of the local measurement feature map, and a q represents the weight value of the q-th eigenvector, and image q represents the q-th local measurement feature map.

6. The image classification method based on a multi - quantum filtering convolutional neural network according to claim 3, wherein In the pooling layer, set a pooling window of a fixed size, slide the pooling window on the first feature image according to the set stride. At each sliding position, replace the maximum value of all pixel values in the pooling window with the original pixel values in the window to obtain G second feature images.

7. The image classification method based on a multi-quantum filtering convolutional neural network according to claim 1, wherein In step S2, the loss function is a cross-entropy loss function.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the image classification method based on a multi-quantum filter convolutional neural network according to any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is run by the processor, it executes the image classification method based on a multi-quantum filter convolutional neural network according to any one of claims 1 to 7.

Citation Information

Cited By

  • Point cloud classification method, device and equipment based on multi-scale parallel quantum convolution and storage medium

    CN121214424A

  • Point cloud classification method, device, equipment, and storage medium based on multi-scale parallel quantum convolution.

    CN121214424B

  • Image classification method and system based on quantum network

    CN121640197A

  • Quantum classical mixed image classification method based on group isovariant and delayed aggregation

    CN121962777A