Source-linked AI summary

A Quantum Convolutional Neural Network on NISQ Devices

ShiJie Wei, YanHu Chen, ZengRong Zhou, GuiLu Long

arXiv:2104.06918v3quant-ph

TL;DR

The paper addresses how CNN-style image processing can be implemented efficiently on near-term quantum devices. It proposes a QCNN that reproduces convolutional, pooling, and fully connected stages with quantum circuits. The demonstrations cover spatial filtering and handwritten-number recognition, with results showing exact filtering equivalence and performance similar to CNNs with fewer parameters.

  • Problem

    CNN-style image processing requires classical convolutional computation, motivating quantum approaches that can represent and transform image data with quantum states.

  • Method

    The paper constructs a QCNN with LCU-based convolution, qubit abandonment for pooling, and a parametrized Hamiltonian with measured expectation values for the fully connected layer.

  • Results

    The QCNN exactly matches classical outputs for simulated spatial filtering and provides performance similar to CNNs in handwritten-number recognition with fewer parameters.

  • Takeaways & Limitations

    The QCNN provides a mapping from specific classical convolutional kernels to implementable quantum circuits for image processing and handwritten-number recognition.

Abstract

from arXiv · show

Quantum machine learning is one of the most promising applications of quantum computing in the Noisy Intermediate-Scale Quantum(NISQ) era. Here we propose a quantum convolutional neural network(QCNN) inspired by convolutional neural networks(CNN), which greatly reduces the computing complexity compared with its classical counterparts, with $O((log_{2}M)^6) $ basic gates and $O(m^2+e)$ variational parameters, where $M$ is the input data size, $m$ is the filter mask size and $e$ is the number of parameters in a Hamiltonian. Our model is robust to certain noise for image recognition tasks and the parameters are independent on the input sizes, making it friendly to near-term quantum devices. We demonstrate QCNN with two explicit examples. First, QCNN is applied to image processing and numerical simulation of three types of spatial filtering, image smoothing, sharpening, and edge detection are performed. Secondly, we demonstrate QCNN in recognizing image, namely, the recognition of handwritten numbers. Compared with previous work, this machine learning model can provide implementable quantum circuits that accurately corresponds to a specific classical convolutional kernel. It provides an efficient avenue to transform CNN to QCNN directly and opens up the prospect of exploiting quantum power to process information in the era of big data.

I. INTRODUCTION

The paper motivates QCNNs by contrasting classical CNN-based image processing with quantum information processing. It introduces a QCNN framework that mirrors convolution, pooling, and fully connected layers while representing images as quantum states.

  • CNNs exploit data correlation and support applications including image recognition and precision medicine.
  • A CNN combines convolution, pooling, and fully connected layers to transform image features into final outputs.Convolution uses neighborhood pixels and filter-mask weights; pooling reduces feature-map size, while fully connected layers combine remaining pixels.
  • The proposed QCNN sequentially realizes convolution, pooling, and fully connected layers using quantum operations, qubit abandonment, Hamiltonian expectation values, and nonlinear post-processing.The framework is presented as a quantum analogue of the three principal CNN stages.
  • Classical convolution represents an M × M image as a matrix and applies the transformation F ∗ W.The classical image representation requires at least 2n bits, with n = ⌈log2(M^2)⌉.
  • The same image can be encoded as a quantum state using at least n qubits, with quantum transformation performed by unitary evolution U.

A. Quantum Convolution Layer

The quantum convolution layer encodes an image as a quantum state and realizes spatial filtering through a linear combination of controlled unitary operators. Ancilla measurement extracts the desired filtered result while using a constant-size ancilla system independent of image dimensions.

  • Quantum image encoding: Image pixels are encoded into a pure quantum state, with computational-basis states representing positions and amplitudes representing pixel values.The vectorized image uses n = ⌈log2(ML)⌉ qubits.
  • Unitary decomposition: The filter operator is adjusted so it can be decomposed into a linear combination of unitary operators without the original exponential gate-cost scaling.The construction changes boundary elements of intermediate matrices, which is allowed for image processing.
  • Unitary decomposition: The QCNN prepares an ancilla superposition, applies ancilla-controlled operators Q_k, and uncomputes the ancilla register with Hadamard gates.The work register and four ancillary qubits are entangled to implement the linear combination of unitaries.
  • Filter-mask realization: 16 filter masks are realized by distinct ancilla states, so the work-system evolution combines the effects of 16 masks.A single desired mask can be selected by measuring the ancilla register and conditioning on |0000⟩.
  • Filter-mask realization: Four qubits, or a nine-level ancillary system for the general filter operator, are consumed independently of image dimensions.For a general filter mask W, the adjusted operator uses nine unitary operators.

B. Quantum Pooling Layer

The quantum pooling layer implements average pooling by discarding selected qubits, reducing the spatial representation for a 2×2 patch operation with stride 2.

  • Quantum pooling: Average pooling computes the average value over each feature-map patch and reduces the spatial representation.This pooling choice follows the convolutional layer in the QCNN.
  • Quantum pooling: A 2×2 pooling operation with stride 2 is realized in the quantum model by ignoring the last qubit and the m-th qubit.Discarding these qubits directly reproduces the intended spatial reduction.

C. Quantum Fully Connected Layer

The quantum fully connected layer replaces classical weighted aggregation with a parametrized Hamiltonian, whose expectation value is passed through a nonlinear activation function.

  • Quantum fully connected layer: A parametrized Hamiltonian composed of identity and Pauli operators serves as the quantum fully connected layer.Its coefficients are trainable parameters associated with the operators' qubit sites.
  • Quantum fully connected layer: The network output is the expectation value f(p) = ⟨p|H|p⟩, followed by a nonlinear mapping R(f(p)).The Hamiltonian parameters are updated by gradient descent, while parameters in S are trained through classical backpropagation.
  • Quantum neural-network framework: The framework combines quantum convolution, pooling, and fully connected stages for image processing and handwritten-number recognition.The paper demonstrates the resulting quantum neural-network framework in both tasks.

A. Image Processing: Edge Detection, Image Smoothing and Sharpening

The quantum convolutional layer is applied to spatial filtering, demonstrating edge detection, smoothing, and sharpening. Numerical simulation shows that classical and quantum convolutional layers produce exactly the same output images.

  • Three spatial filtering tasks—edge detection, image smoothing, and sharpening—are demonstrated with fixed filter masks.
  • Classical and quantum convolutional layers produce exactly the same output images in numerical simulation.

B. Handwritten Number Recognition

The QCNN is evaluated on MNIST for two-class and ten-class handwritten-character recognition under noise-free and noisy circuit conditions. Across repeated simulations, QCNN and CNN show similar performance, while QCNN uses fewer parameters and has a smaller accuracy fluctuation range.

  • MNIST recognition covers two classes, ‘1’ and ‘8’, and ten classes, ‘0’–‘9’, using complete quantum convolutional, pooling, and fully connected layers.
  • A 0.01 probability of a randomly applied single-qubit Pauli gate models noise after each circuit operation.
  • QCNN and CNN provide similar performance across the simulated MNIST classification tasks.
  • QCNN uses fewer parameters and has a smaller accuracy fluctuation range than the compared models.

IV. ALGORITHM COMPLEXITY

The algorithm’s resource analysis reports polylogarithmic gate complexity for the quantum convolutional layer and logarithmic qubit requirements, contrasting with quadratic classical convolutional complexity. Figure 4 organizes MNIST accuracy by noise condition, dataset split, and classification setting.

  • O((log_2M)^6) basic gates implement the quantum convolutional filter operations.
  • Figure 4 compares noisy QCNN, noise-free QCNN, and CNN accuracy for training and test sets in two-class and ten-class MNIST tasks.
  • O(M^2) is the classical convolutional-layer complexity, so the reported quantum algorithm achieves an exponential gate-complexity speedup.
  • O(log_2(m^2)) ancillary qubits and O(log_2(M^2)) work qubits determine the stated total qubit requirement.

V. CONCLUSION

The paper presents a quantum neural network with exponential gate-complexity speedups and similar handwritten-number recognition performance using fewer parameters. It demonstrates image processing and recognition applications while mapping classical convolutional kernels to implementable quantum circuits.

  • The proposed quantum neural network provides exponential speedups over classical counterparts in gate complexity.
  • It achieves similar handwritten-number recognition performance with fewer parameters than classical algorithms.
  • Image processing and handwritten-number recognition demonstrate the method’s applications.
  • Mapping specific classical convolutional kernels to quantum circuits provides a bridge between QCNN and CNN.

Appendix A: Adjusted operator U′ can provide enough information to remap the output imagine.

The appendix shows that the adjusted operator U′ preserves the interior image pixels while enabling output remapping, and develops a basic-gate decomposition for its constituent operators.

  • Adjusted operator U′: U′ and U differ only in matrix elements associated with image boundaries, enabling U′ to remap the output image.The proof identifies the changed elements after applying the two operators and connects them to the remapped output.
  • Adjusted operator U′: G′_i,j = G_i,j for 2 ≤ i,j ≤ M − 1, so the interior pixels remain unchanged.
  • Basic-gate decomposition: Q1, Q2, …, Q9 compose the filter operator U′, with each Qk formed from tensor products of two elementary operators.
  • Basic-gate decomposition: E1 uses O(n^3) CNOT and Pauli X gates, while E3 is obtained from the inverse basic-gate combination.
  • Basic-gate decomposition: O((log2M)^6) basic gates suffice for each controlled Qk operation.Here n = log2(M^2), and constant factors are ignored.
Loading 2104.06918v3…