QuCNN : A Quantum Convolutional Neural Network with Entanglement Based Backpropagation

Samuel Alexander Stein, Ying Mao, James Andrew Ang, Ang LiSEC 2022

Introduction

Classical Convolutional Neural Networks (CNNs) have revolutionized computer vision through their ability to extract spatial features. However, implementing these architectures on quantum hardware presents unique challenges, such as the requirement for unitary operations and the difficulty of performing backpropagation natively. This paper introduces QuCNN, a framework that translates classical CNN principles into the quantum realm by utilizing the SWAP test for feature extraction and a novel entanglement-based method for gradient calculation.

Architecture and Methodology

The QuCNN architecture is built upon two core innovations designed to bridge the gap between classical and quantum neural networks.

Quantum Convolution via SWAP Test

In classical CNNs, convolution involves sliding a filter over an image to compute dot products. QuCNN replicates this by using the SWAP test, which measures the overlap (similarity) between a parameterized "filter state" and an encoded "data state." This provides a mathematically sound quantum analogue to the classical dot product used in image processing.

Overview of the QuCNN architecture, showing the filter bank and SWAP test mechanism.

Entanglement-Based Backpropagation

A significant bottleneck in Quantum Machine Learning (QML) is the reliance on classical computers for gradient calculation. QuCNN addresses this with an entanglement-based backpropagation routine. By using a controlled entangled ancilla qubit, the system can embed the chain rule directly into the quantum circuit. This allows the quantum processor to handle the scaling of gradients natively, reducing the classical overhead typically associated with the parameter shift rule.

Circuit Ansatz

The filters are constructed using layers of $R_y(\theta)$ and $R_z(\theta)$ rotations, followed by CNOT gates to introduce entanglement. The expressivity and complexity of these filters can be tuned by adjusting the number of repetitions ($n$) of these gate layers.

Experimental Validation

The framework was validated using 4x4 patches from the MNIST dataset. Pixel intensities were mapped to quantum amplitudes using $log_2(n)$ amplitude encoding. The primary tasks were to replicate feature maps from pre-trained classical filters and to train quantum filters from scratch to match target states.

Results and Discussion

QuCNN demonstrated high fidelity in both forward pass execution and learning performance.

Feature Map Fidelity

Visual analysis confirms that the quantum-generated feature maps closely match their classical counterparts. While quantum sampling introduces some inherent "shot noise," the spatial features of the MNIST digits remain clearly identifiable, proving the effectiveness of the SWAP test as a convolutional filter.

Comparison of feature maps from classical (a) and quantum (b) convolutional filters.

Gradient and Learning Convergence

The "QuCNN Computed" gradients, derived from the ancilla-based routine, were shown to converge to classically post-processed values as the number of measurement shots increased. Furthermore, training results indicated that even shallow circuits (with $n=2$ or $n=3$ repetitions) could achieve near-perfect fidelity (~1.0) within 30 to 40 epochs, highlighting the expressivity of the chosen ansatz.

Conclusion

QuCNN provides a robust path toward native quantum image processing. By integrating the SWAP test for convolution and an entanglement-based approach for backpropagation, it minimizes the classical-quantum communication bottleneck. Future work will focus on mitigating sampling noise and addressing "barren plateaus" to scale the architecture for deeper networks and more complex datasets.

Summary updated

BibTeX
@inproceedings{stein2022qucnn,
  author = {Samuel Alexander Stein and Ying Mao and James Andrew Ang and Ang Li},
  title = {{QuCNN : A Quantum Convolutional Neural Network with Entanglement Based Backpropagation}},
  booktitle = {SEC},
  year = {2022},
  url = {https://openreview.net/forum?id=CoDkbXcGU9},
}
Figure