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

Direct quantum filter implementations can consume exponentially many basic gates, making gate complexity a concern. The paper constructs a QCNN and reports performance similar to CNN on handwritten-number recognition, with fewer parameters and smaller fluctuation.

  • Problem

    Direct quantum filter implementations can consume exponentially many basic gates, making gate complexity a concern for quantum convolution.

    Source: A. Quantum Convolution Layer · p. 3
  • Method

    The QCNN sequentially realizes convolution, pooling, and fully connected layers, using linear combinations of unitary operators for convolution.

    Source: §I · p. 1
  • Results

    QCNN and CNN provide similar performance in handwritten-number recognition, while QCNN involves fewer parameters and has a smaller fluctuation range.

    Source: B. Handwritten Number Recognition · p. 7
  • Takeaways & Limitations

    The work maps specific classical convolution kernels to quantum circuits, providing a bridge between QCNN and CNN.

    Source: §V · p. 8

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 introduction presents a quantum convolutional neural network that sequentially implements convolution, pooling, and fully connected layers, and previews numerical demonstrations and a complexity discussion.

I. INTRODUCTION

  • CNNs exploit data-correlation information and have applications including image recognition and precision medicine.Source: §I · p. 1
  • Quantum information processing uses superposition and entanglement and can offer higher computational speed for certain problems; quantum machine learning has often focused on the evaluation component.The passage cites quantum information processing as 1,2, quantum speedups as 3–5, developments in quantum machine learning as 6–15, and evaluation-focused quantum algorithms as 16–21.Source: §I · p. 1
  • CNNs combine convolution, pooling, and fully connected layers; their filter-mask and fully connected weights are optimized through training on large datasets.Convolution uses neighborhood pixels, pooling reduces feature-map size, and the fully connected layer computes output from the remaining pixels.Source: §I · p. 1
  • The QCNN implements convolution through linear combinations of unitary operators, pooling by abandoning qubits, and a fully connected layer through Hamiltonian expectation measurements and nonlinear post-processing.The authors preview numerical demonstrations with two examples and a discussion of computational complexity.Source: §I · p. 1
  • A quantum image can be encoded in at least n qubits and transformed by unitary evolution, whereas a classical M × M image uses at least 2n bits and matrix computation.The figure defines n = ⌈log2(M2)⌉ for the classical encoding.Source: §I · p. 2, Figure 1 · p. 2

II. FRAMEWORK OF QUANTUM NEURAL NETWORKS · A. Quantum Convolution Layer

The quantum convolution layer encodes pixel positions in computational-basis states and pixel values in amplitudes, then implements spatial filtering through an adjusted operator built from unitary operations. Its general filter uses four ancillary qubits, independent of image dimensions.

A. Quantum Convolution Layer

  • Pixel positions are encoded in computational-basis states and pixel values in amplitudes, forming a pure state with n = ⌈log2(ML)⌉ qubits.The amplitudes are normalized pixel values; basis states beyond the ML pixels receive zero amplitude.Source: A. Quantum Convolution Layer · p. 2
  • A filter mask W maps an input image state to an output image state, with each interior output pixel computed from a weighted neighborhood.For a 3 × 3 mask, the text gives the weighted sum over neighboring pixels; it says the construction generalizes to arbitrary m × m masks.Source: A. Quantum Convolution Layer · p. 2
  • Because the linear filtering operator is generally non-unitary and direct implementation scales exponentially with system dimensions, the authors adjust its boundary matrix elements to reduce gate complexity.The boundary changes affect the first and last rows and columns of three matrices and are described as allowable for image processing.Source: A. Quantum Convolution Layer · p. 3
  • The ancilla-controlled unitary construction can realize a linear combination of 16 filter masks, with each mask associated with a distinct ancilla state.The circuit prepares an ancilla superposition, applies controlled operations, and uncomputes the ancilla registers.Source: A. Quantum Convolution Layer · p. 4
  • For a single desired mask, measuring the ancilla in state |0000⟩ yields a state proportional to the expected filtered result.The processed state retains unchanged edge elements, while evaluated interior pixel values match those of the output under the original operator.Source: A. Quantum Convolution Layer · pp. 4–5
  • Four ancillary qubits implement the general adjusted filter operator as a linear combination of nine unitary operators, independent of image dimensions.The paper also notes that a nine-energy-level ancillary system can be used.Source: A. Quantum Convolution Layer · pp. 4–5

B. Quantum Pooling Layer

The quantum pooling layer uses average pooling to reduce feature-map size and parameter count. A 2×2 pooling operation with stride 2 is implemented by ignoring two qubits.

B. Quantum Pooling Layer

  • Average pooling reduces representation size and parameter count; 2×2 pooling with stride 2 is realized by ignoring the last and m-th qubits.The layer averages each feature-map patch.Source: B. Quantum Pooling Layer · p. 5

C. Quantum Fully Connected Layer

The quantum fully connected layer uses a parameterized Hamiltonian to produce the network’s final output, with trainable parameters updated by gradient descent and S-matrix parameters trained through classical backpropagation.

C. Quantum Fully Connected Layer

III. NUMERICAL SIMULATIONS · A. Image Processing: Edge Detection, Image Smoothing and Sharpening

The quantum convolutional layer is used for spatial filtering, and numerical simulations show that it produces the same output images as a classical convolutional layer for edge detection, smoothing, and sharpening.

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

  • The simulated quantum and classical convolutional layers produce exactly the same output images for the spatial filtering tasks (Fig. 3).The simulation covers edge detection, image smoothing, and sharpening.Source: A. Image Processing: Edge Detection,… · p. 6
  • For spatial filtering, one specific filter mask is used, and the task succeeds when measurement of the ancillary register yields |0⟩.The three demonstrated tasks use fixed masks Wde, Wsm, and Wsh for edge detection, smoothing, and sharpening, respectively.Source: A. Image Processing: Edge Detection,… · p. 6

B. Handwritten Number Recognition

On MNIST handwritten-number recognition, numerical simulations show that QCNN and CNN provide similar performance, while QCNN uses fewer parameters and has a smaller accuracy fluctuation range.

B. Handwritten Number Recognition

  • The simulations use a complete QCNN with convolutional, pooling, and fully connected layers for MNIST recognition of ‘1’ versus ‘8’ and ‘0’–‘9’.The 28 × 28 images are zero-padded to 32 × 32; QCNN uses a 10-qubit work register and 4 ancillary qubits, with pooling by abandoning the 4th and 9th work qubits.Source: B. Handwritten Number Recognition · pp. 6–7
  • For two-class recognition, QCNN has 37 learnable Hamiltonian parameters versus 256 CNN fully connected parameters; for ten classes, the counts are 10 × 37 and 10 × 256.Both models use 9 learnable convolutional parameters; CNN applies average pooling, while QCNN measures Hamiltonian expectations on the remaining work qubits for classification.Source: B. Handwritten Number Recognition · p. 7
  • Across 100 repeated runs, QCNN and CNN provide similar performance, while QCNN involves fewer parameters and has a smaller accuracy fluctuation range.The reported averages and accuracy ranges come from repeated noisy-QCNN, noise-free-QCNN, and CNN runs under the same construction.Source: B. Handwritten Number Recognition · p. 7
  • The two-class task uses 5,000 training and 2,100 test images, while the ten-class task uses 60,000 training and 10,000 test images.Each training epoch randomly selects 100 images, and training runs for 50 epochs, so accuracy fluctuates.Source: B. Handwritten Number Recognition · p. 7

IV. ALGORITHM COMPLEXITY

The QCNN implements convolution with O((log_2 M)^6) basic gates and uses logarithmic qubit resources in the input size and filter-mask dimension. Its gate complexity is exponentially lower than the O(M^2) classical convolutional layer, while fully connected measurements scale as O(e).

IV. ALGORITHM COMPLEXITY

  • O((log_2 M)^6) basic gates implement the controlled operations for convolution, yielding an exponential gate-complexity speedup over the O(M^2) classical convolutional layer.State preparation takes O(poly(log_2(M^2))) steps when amplitudes and probabilities are classically efficiently calculable; alternatively, qRAM preparation takes O(log_2(M^2)) after the quantum memory cell is established.Source: §IV · pp. 7–8
  • O(e) measurements are required in fully connected layers, where e is the number of parameters in the Hamiltonian.Source: §IV · p. 8
  • Ancillary qubits scale as O(log_2(m^2)) and work qubits as O(log_2(M^2)), where m is the filter-mask dimension.Source: §IV · p. 8

V. CONCLUSION

The paper presents a quantum neural network with lower gate complexity and fewer parameters than classical counterparts, reporting similar handwritten-number recognition performance. It demonstrates image-processing and recognition applications and maps classical convolutional kernels to quantum circuits.

  • The authors report exponential speed-ups in gate complexity and similar handwritten-number recognition performance with fewer parameters than classical algorithms.They argue the approach has significant advantages for large data.Source: §V · p. 8
  • The paper demonstrates the method through image processing and handwritten-number recognition, and maps specific classical convolutional kernels to quantum circuits.The mapping is presented as a bridge between QCNN and CNN.Source: §V · p. 8
  • The authors describe the algorithm as general and implementable on programmable quantum computers, including superconducting, trapped-ion, and photonic platforms.They suggest it has potential to outperform classical counterparts for large data.Source: §V · p. 8

Appendix A: Adjusted operator U′ can provide enough information to remap the output imagine. · Appendix B: Decomposing operator Q into basic gates

The appendices show that the adjusted operator U′ preserves the remappable interior of the output image, and give a basic-gate decomposition for the controlled Qk operation. The decomposition uses no more than O((log2 M)^6) basic gates.

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

  • The adjusted operator U′ differs from U in edge elements, yet its evolution provides enough information to remap the output image.Source: Appendix A · p. 9
  • After remapping, the output image G′ matches G at pixels with 2 ≤ i, j ≤ M − 1; differences are confined to the edges.The elements affected by the differences between U′ and U are identified as edge elements.Source: Appendix A · p. 9

Appendix B: Decomposing operator Q into basic gates

  • The filter operator U′ consists of nine operators Q1 through Q9, each formed as a tensor product of two of three operators.The supplied passage does not identify the three operators.Source: Appendix B · p. 9
  • E2 is an M × M identity matrix and does not need further decomposition.Source: Appendix B · p. 9
  • The n-qubit operator E1 is expressed using O(n^3) CNOT gates and Pauli X gates, while E3 is implemented by the inverse combination because E3 = E1†.The passage defines n = log2(M^2).Source: Appendix B · p. 9
  • Because E2 needs no further decomposition, the Qk decomposition uses the E1 and E3 gate constructions.The passage states that Qk can be implemented using no more than O(n^6) basic gates.Source: Appendix B · p. 9
  • No more than O((log2 M)^6) basic gates implement the controlled Qk operation, ignoring a constant number.The passage also expresses this bound as O(n^6).Source: Appendix B · pp. 9–10
Loading 2104.06918v3…