Quantum Convolutional Neural Networks for Multi-Channel Supervised
  Learning
As the rapidly evolving field of machine learning continues to produce
incredibly useful tools and models, the potential for quantum computing to
provide speed up for machine learning algorithms is becoming increasingly
desirable. In particular, quantum circuits in place of classical convolutional
filters for image detection-based tasks are being investigated for the ability
to exploit quantum advantage. However, these attempts, referred to as quantum
convolutional neural networks (QCNNs), lack the ability to efficiently process
data with multiple channels and therefore are limited to relatively simple
inputs. In this work, we present a variety of hardware-adaptable quantum
circuit ansatzes for use as convolutional kernels, and demonstrate that the
quantum neural networks we report outperform existing QCNNs on classification
tasks involving multi-channel data. We envision that the ability of these
implementations to effectively learn inter-channel information will allow
quantum machine learning methods to operate with more complex data. This work
is available as open source at
https://github.com/anthonysmaldone/QCNN-Multi-Channel-Supervised-Learning.
Anthony M. Smaldone, Gregory W. Kyro, Victor S. Batista
# Quantum Convolutional Neural Networks for Multi-Channel Supervised Learning

###### Abstract

As the rapidly evolving field of machine learning continues to produce incredibly useful tools and models, the potential for quantum computing to provide speed up for machine learning algorithms is becoming increasingly desirable. In particular, quantum circuits in place of classical convolutional filters for image detection-based tasks are being investigated for the ability to exploit quantum advantage. However, these attempts, referred to as quantum convolutional neural networks (QCNNs), lack the ability to efficiently process data with multiple channels and therefore are limited to relatively simple inputs. In this work, we present a variety of hardware-adaptable quantum circuit ansatzes for use as convolutional kernels, and demonstrate that the quantum neural networks we report outperform existing QCNNs on classification tasks involving multi-channel data. We envision that the ability of these implementations to effectively learn inter-channel information will allow quantum machine learning methods to operate with more complex data.

**Keywords:** Quantum Machine Learning, Convolutional Neural Networks,

Multi-Channel Data, Image Classification, Supervised Learning

## 1 Introduction

Quantum computers are devices that utilize quantum mechanical phenomena such as superposition and entanglement to solve problems that are infeasible with timescales provided by classical computers. From the time quantum computers were first pro
posed in 1982 [1], researchers have been working to develop algorithms that provide quantum advantage over classical algorithms [2, 3, 4, 5, 6, 7, 8]. The main application challenges are related to noise, high gate errors and short decoherence times [9], necessitating the development of more efficient quantum circuit ansatzes. In recent years, devices have demonstrated quantum supremacy such as those introduced by Google AI Quantum (2019) [10], the University of Science and Technology of China (2020) [11], and IBM (2021) [12].

Machine learning (ML) has been gaining significant attention in recent years for strongly influencing many important fields of study and sectors of society. Image recognition [13, 14, 15], natural language processing [16, 17, 18], self-driving vehicles [19, 20, 21, 22, 23], robotics [24, 25, 26, 27, 28], and molecular biochemistry [29, 30, 31, 32] are just some of the fields that are being revolutionized by ML. The most prominent example would be ChatGPT, a chatbot built on top of OpenAI's generative pre-trained transformer (GPT)-3.5 and GPT-4 large language models that has been fine-tuned for conversation using both supervised and reinforcement learning from human feedback techniques [33, 34]. In the natural sciences, Deepmind's Alphafold is able to accurately predict 3D models of protein structures, and is accelerating research in nearly every field of molecular biology and biochemistry [35].

The advances in both quantum computing and ML inspire the development of quantum ML (QML) methods to exploit the speed of quantum computations and the predictive capabilities of ML. There has been recent work demonstrating the feasibility and advantages of substituting components of classical ML architectures with quantum analogues [36, 37, 38, 39], such as quantum circuits in place of classical convolutional kernels in convolutional neural networks (CNNs) [40, 41, 42, 43, 44, 45, 46, 47, 48]. Classical CNNs are state-of-the-art for image, video, and sound recognition tasks [49, 50] and also have applications in the natural sciences [51, 52, 53, 54, 55, 56]. CNNs that incorporate quantum circuits to function as kernels, referred to as Quantum CNNs (QCNNs), have performed well on classification tasks involving simple data such as the MNIST dataset of handwritten digits [42, 48], as well as multi-channel data such as the CIFAR-10 dataset [45, 57].

The QCNN was introduced in 2019 by Cong _et al._[40], and was applied to quantum phase recognition and quantum error correction optimization. Since then, QCNNs have been applied in areas ranging from high energy physics [43] to biochemistry [44]. However, current methods either do not effectively capture inter-channel information, or require more qubits than are currently permissible, and therefore lack the ability to efficiently process more complex data with multiple channels.

With current QCNNs, the number of required qubits scales linearly with the length of the channel dimension of the input data. This is a feasible approach for simple data that can be modeled with small filters. For instance, Jing _et al._ demonstrated the ability to use a 12- and 18-qubit circuit to function as a 2 \(\times\) 2 and 3 \(\times\) 3 convolutional filter, respectively, on low resolution red-green-blue (RGB) images (three channels, one for each color) [45]. However, extension of this approach to tasks involving data with more channels is prohibited by current hardware limitations. As an attempt to overcome this challenge, there has been much recent work that performs a measurement on each channel individually, collapsing the wavefunction after measuring a given channel of the data and storing the measurement classically [42, 43, 44, 46]. Although the
hardware requirements have no dependence on the number of channels when using this method, much of the inter-channel information is lost, which is valuable for accurately modeling the data. In this work, we propose several methods for operating with multi-channel data that preserve inter-channel information and require a number of qubits that is independent of the length of the channel dimension of the input data.

## 2 Quantum Circuits and Related Mathematical Formalisms

### Brief Theory of Quantum Computing

Qubits are two-level systems used in computations to exploit the quantum mechanical phenomena of superposition and entanglement. The state of a single qubit can be represented by:

\[\left|\psi\right\rangle=\alpha\left|0\right\rangle+\beta\left|1\right\rangle \text{ such that }\left|\alpha\right|^{2}+\left|\beta\right|^{2}=1\text{ and }\alpha,\beta\in\mathbb{C}. \tag{1}\]

The state of a multi-qubit system is represented by the tensor product of all \(N\) single qubit states:

\[\left|\Psi\right\rangle=\bigotimes_{i=1}^{N}\left|\psi_{i}\right\rangle=\left| \psi_{1}\right\rangle\otimes\left|\psi_{2}\right\rangle\otimes\cdots\otimes \left|\psi_{N}\right\rangle \tag{2}\]

These qubit states are transformed via unitary operations. For any single qubit unitary,

\[U=\begin{bmatrix}u_{00}&u_{01}\\ u_{10}&u_{11}\end{bmatrix}, \tag{3}\]

the matrix of a two-qubit controlled operation may be expressed as

\[CU=\begin{bmatrix}1&0&0&0\\ 0&1&0&0\\ 0&0&u_{00}&u_{01}\\ 0&0&u_{10}&u_{11}\end{bmatrix}. \tag{4}\]

In a two-qubit controlled gate, if the control qubit is in the \(\left|1\right\rangle\) state, the unitary operation is applied to the target qubit. If the control qubit is in the \(\left|0\right\rangle\) state, the target qubit is unaffected. Measurements on a quantum state are performed by taking the expectation value of a Pauli operator, \(\sigma\) as shown in Equation 5. Quantum circuits model the sequential manipulation and measurement of qubits.

\[\mathcal{M}=\left\langle\psi\right|\sigma_{x,y,z}\left|\psi\right\rangle \tag{5}\]

### The Deposit and Reverse Method

The proposed Deposit and Reverse (DR) method takes advantage of phase kickback (i.e., phase accumulation on the ancilla qubit) and the guaranteed invertibility of quantum gates. In our case, a single channel of classical data is encoded into a quantum
state and passed through a learnable set of unitary operations. Quantum information from the working qubits is deposited onto the ancilla qubit via a phase kickback, and the working qubits are uncomputed to return them to the uninitialized \(\ket{0}\) state, preparing them for angle encoding. This process is repeated for each channel, and the relative quantum phase is accumulated on the ancilla qubit. After processing all channels of the data, the ancilla qubit is measured, and the expectation value is used as the output of that quantum convolution.

#### 2.2.1 State Preparation

The DR-QCNN method removes the dependency of the number of necessary qubits on the length of the channel dimension of the data, and requires only \(F^{2}+1\) qubits, where \(F\) is the length of a single dimension of the square filter. The working qubits perform a convolution over one channel of an input signal, and the output is stored on the ancilla qubit. The uninitialized quantum state and classical input can be represented as:

\[\ket{\Psi_{0}}=\ket{0}\otimes\ket{\psi_{0}}=\ket{0}\otimes\ket{0}^{\otimes N-1 },\mathbf{x}_{l,w,c}\in\mathbb{R}^{N-1} \tag{6}\]

where \(l,w,c\) are the initial indices of an input 3D-tensor of total length \(L\), width \(W\), and channels \(C\), respectively, \(\ket{\Psi_{0}}\) is the state of the total quantum system, and \(\ket{\psi_{0}}\) is the state of the working qubits. \(\mathbf{x}_{l,w,c}\) is a vector of the flattened normalized input data covered by the filter for a single channel, described by the expression:

\[\mathbf{x}_{l,w,c}=\{x_{l,w,c},x_{l,w+1,c},\cdots,x_{l,w^{\prime},c},x_{l+1,w,c},x_{l+1,w+1,c},\cdots,x_{l+1,w^{\prime},c},\cdots,x_{l^{\prime},w^{\prime},c}\} \tag{7}\]

where \(l^{\prime}\) and \(w^{\prime}\) represent the final index covered by the filter of the length and width dimensions.

\[l^{\prime}=l+F-1,w^{\prime}=w+F-1 \tag{8}\]

In this work, the input data is encoded into a quantum state with angle encoding, as this method requires only a single gate per qubit and permits a low circuit depth compared to basis encoding and amplitude encoding. We encode all normalized data \(\mathbf{x}\) with a rotation about the Pauli-X axis by \(\pi x_{i}\) radians. Additionally, we prepare the ancilla qubit by placing it into a state of maximal superposition with a Hadamard transformation. The matrix representation of the gates for a rotation about the Pauli-X axis and a Hadamard transformation are described in Equations 10 and 9, respectively.

\[\mathbf{R_{x}}\left(\theta\right)=\begin{bmatrix}\cos\left(\frac{ \theta}{2}\right)&-\sin\left(\frac{\theta}{2}\right)\\ -\sin\left(\frac{\theta}{2}\right)&\cos\left(\frac{\theta}{2}\right)\end{bmatrix} \tag{9}\] \[\mathbf{H}=\frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\ 1&-1\end{bmatrix} \tag{10}\]

The prepared quantum state is represented as:

\[\ket{\Psi_{1}}=\ket{+}\otimes\ket{\psi_{1}}=\mathbf{H}\ket{0}\otimes\bigotimes \bigotimes_{i=1}^{F^{2}}\mathbf{R_{x}}\left(x_{i}\cdot\pi\right)\ket{\psi_{0}} \tag{11}\]
#### 2.2.2 Circuit Construction

Let \(\mathbf{U}\) be the set of \(\gamma\) chosen unitaries to perform the quantum convolution.

\[\mathbf{U}=\prod_{i=1}^{\gamma}U_{i} \tag{12}\]

After the classical data has been encoded and the deposition qubit has been placed into a state of maximal superposition, \(\mathbf{U}\) is applied to the working qubits, transforming the total state according to:

\[\left|\Psi_{2}\right\rangle=\left|+\right\rangle\otimes\mathbf{U}\left|\psi_{ 1}\right\rangle=\left|+\right\rangle\otimes\left|\psi_{2}\right\rangle. \tag{13}\]

Following this convolutional unitary, we parametrically deposit phasic information from the entangled working register onto the prepared ancilla qubit. This is achieved via a phase gate, controlled by the deposition qubit:

\[\left|\Psi_{3}\right\rangle=CP\left(\theta\right)\left(\left|+\right\rangle \otimes\left|\psi_{2}\right\rangle\right)=\left|\psi_{a}\right\rangle\otimes \left|\psi_{2}\right\rangle, \tag{14}\]

where the matrix representation of the single qubit phase gate is:

\[P\left(\theta\right)=\begin{bmatrix}1&0\\ 0&e^{i\theta}\end{bmatrix} \tag{15}\]

The application of a learnable controlled phase gate provides a quantum phase kick back. The phasic information that is learned within the entangled block is deposited onto the ancilla qubit without disrupting the state of the working register, assuming the ancilla qubit is in any arbitrary superposition state and the remaining \(F^{2}\) qubits are entangled in an arbitrary state \(\left|\psi_{c}\right\rangle\) (Appendix). It should be noted that these phase depositions on the ancilla qubit may be applied to each qubit in the working register to retain as much information as possible. For simplicity, we restrict the phase depositions to a single operation.

The inverse convolutional unitary \(\mathbf{U^{-1}}\) may be applied to \(\left|\psi_{2}\right\rangle\) to uncompute the working register without changing \(\left|\psi_{a}\right\rangle\):

\[\left|\Psi_{4}\right\rangle=\left|\psi_{a}\right\rangle\otimes\mathbf{U^{-1} }\left|\psi_{2}\right\rangle=\left|\psi_{a}\right\rangle\otimes\mathbf{U^{-1} }\mathbf{U}\left|\psi_{1}\right\rangle=\left|\psi_{a}\right\rangle\otimes \left|\psi_{1}\right\rangle. \tag{16}\]

After uncomputing the working register, the angle-encoded classical data is uncomputed to return the convolutional register to the uninitialized state \(\left|0\right\rangle^{\otimes N-1}\), prepared for an additional convolution:

\[\left|\Psi_{5}\right\rangle=\left|\psi_{a}\right\rangle\otimes\overset{F^{2}} {\underset{i=1}{\overset{F^{2}}{\otimes}}}\mathbf{R_{x}}\left(-x_{i}\cdot\pi \right)\left|\psi_{1}\right\rangle=\left|\psi_{a}\right\rangle\otimes\left| \psi_{0}\right\rangle \tag{17}\]

It should be noted that performing a hard reset of the qubits in the working register will result in a mathematically identical state to \(\left|\Psi_{5}\right\rangle\). Measurements are typically the most error-prone operations to conduct, so the choice to reset or uncompute the working register should be dictated by the specifications of the available quantum hardware.
This procedure is repeated for each channel of the input data, a Hadamard gate is applied to the ancilla qubit in state \(\ket{\psi_{a}^{\prime}}\), and then a measurement is taken on the final state of the ancilla:

\[\mathcal{M}=\bra{\mathbf{H}\psi_{a}^{\prime}}\sigma_{z}\ket{\mathbf{H}\psi_{a}^{ \prime}}. \tag{18}\]

A sample circuit is shown in Figure 1. The total number of gates and total circuit depth is calculated by Equation 19 and Equation 20, respectively:

\[\mathrm{Gates}=\left(C-1\right)\left(2F^{2}+2\mathbf{U}_{G}+1\right)+F^{2}+ \mathbf{U}_{G}+3 \tag{19}\]

\[\mathrm{Depth}=\left(C-1\right)\left(2\mathbf{U}_{D}+3\right)+\mathbf{U}_{D}+2 \tag{20}\]

where \(\mathbf{U}_{G}\) is the number of gates and \(\mathbf{U}_{D}\) is the depth of the chosen set of convolutional unitaries \(\mathbf{U}\).

### Deposit and Reverse with Parallel Channels Method

The Deposit and Reverse with Parallel Channels-QCNN (DRPC-QCNN) method decreases the circuit depth compared to that which is used in the DR-QCNN method. The DRPC-QCNN operates simultaneously on \(R\) parallelized channels, where \(R\) is the number of specified registers, and then deposits and reverses as in the DR-QCNN method. This method therefore requires \(RF^{2}+1\) qubits.

#### 2.3.1 State Preparation

The states of the working qubits in the DRPC-QCNN method are prepared similarly to the DR-QCNN method, with the caveat of each register being encoded with a different channel of the data The overall quantum state is initialized as done in Equation 6. The data covered by the filter of \(R\) channels is angle encoded as done in Equation 11, and the ancilla qubit is placed in a uniform superposition.

#### 2.3.2 Circuit Construction

The method of deposition and reversal is extended to \(R\) working qubit registers in the DRPC-QCNN. All working qubits are entangled according to Equation 22. This hierarchical method of first entangling intra-channel data and then inter-channel data is similar to the method used in the HQConv circuit [45]. Relative phasic information is deposited onto the ancilla qubit from the first qubit of each working register in Equation 23, and a measurement is taken as previously done in Equation 18.

Figure 1: Deposit and Reverse (DR) circuit using a 2 \(\times\) 2 filter applied to three channels.
\[|\Psi_{2}\rangle=|+\rangle\otimes\bigotimes_{i=1}^{R}|\mathbf{U}\psi_{1,i}\rangle= |+\rangle\otimes\bigotimes_{i=1}^{R}|\psi_{2,i}\rangle \tag{21}\]

\[|\Psi_{3}\rangle=|+\rangle\otimes\mathbf{U}_{c}\bigotimes_{i=1}^{R}|\psi_{2,i} \rangle=|+\rangle\otimes|\psi_{3}\rangle \tag{22}\]

\[|\Psi_{4}\rangle=CP^{R}\left(\theta\right)(|+\rangle\otimes|\psi_{3}\rangle)=| \psi_{a}\rangle\otimes|\psi_{4}\rangle \tag{23}\]

This circuit is visualized in Figure 2. Although more qubits are being used than in the DR-QCNN, the number of gates and circuit depth have been reduced. The number of gates and depth of the DRPC-QCNN is calculated according to Equations 24 and 25, where \(\mathbf{U}_{c_{G}}\) and \(\mathbf{U}_{c_{D}}\) are the number of gates and depth, respectively, in the inter-channel unitary block.

\[\text{Gates}=\left(\frac{C}{R}-1\right)\left(1+2RF^{2}+2R\mathbf{U}_{G}+2 \mathbf{U}_{c_{G}}+R\right)+R\mathbf{U}_{G}+\mathbf{U}_{c_{G}}+R+1 \tag{24}\]

**Fig. 2**: Deposit and Reverse with Parallel Channels (DRPC) circuit with three registers using a 2 \(\times\) 2 filter applied to six channels. Parallelizing the channels allows for the opportunity to entangle them before the deposition step.
\[\text{Depth}=\left(\frac{C}{R}-1\right)\left(2+2\mathbf{U}_{D}+2\mathbf{U}_{c_{D}} +R\right)+\mathbf{U}_{D}+\mathbf{U}_{c_{D}}+R+1 \tag{25}\]

### Deposit and Reverse with Parallel Channels -

Topologically Considerate Method

The circuit construction put forth in Section 2.3.2 is generalizable to \(C\) channels, but it becomes difficult to control each register from the same ancilla qubit as \(C\) becomes large. To account for this difficulty, we present an additional method that mitigates the challenges related to the topology of the hardware being used by introducing additional ancilla qubits. In this method, the maximum number of controlled depositions can be conducted before beginning to deposit phase onto the next ancilla qubit. With this Deposit and Reverse with Parallel Channels - Topologically Considerate (DRPC-T-QCNN) method, the ancilla qubits are entangled at the conclusion of all depositions, generating the final state:

\[\left|\Psi\right\rangle=\left(\mathbf{U}_{a}\bigotimes_{i}^{A}\left|\psi_{a, i}\right\rangle\right)\otimes\left|\psi\right\rangle, \tag{26}\]

where \(A\) is the total number of ancilla qubits, \(\mathbf{U}_{a}\) is set of unitaries entangling the ancilla register, \(\left|\psi_{a,i}\right\rangle\) is the state of the \(i\)th ancilla qubit, and \(\left|\psi\right\rangle\) is the final state of the working registers. The total number of qubits in this method is \(RF^{2}+A\).

Figure 3: Deposit and Reverse with Parallel Channels - Topologically Considerate (DRPC-T) circuit with three registers using a 2 \(\times\) 2 filter applied to six channels.
### Weighted Expectation Value Method

The Weighted Expectation Value (WEV)- QCNN method adds a hybrid component to classically learn inter-channel features. The quantum convolutions are performed in the traditional sense of passing the filter over each channel individually. After the expectation values are acquired, we apply a classical weight and bias before summing each value to generate the corresponding output:

\[\tilde{x}_{i^{\prime},j^{\prime}}=\sum_{c=1}^{C}\bra{\Psi_{i,j,c}}\sigma_{z} \ket{\Psi_{i,j,c}}\cdot w_{i,j,c}+b_{i,j,c} \tag{27}\]

\(\tilde{x}_{i^{\prime},j^{\prime}}\) is a single classical output data point given by the quantum convolution. \(\Psi_{i,j}\) is the wavefunction after the convolution. This method is ideal for few qubits, few gates, and shallow circuit depth. The total number of qubits is \(F^{2}\), and the number of gates and circuit depth are shown in Equations 28 and 29, respectively.

\[\text{Gates}=F^{2}+\mathbf{U}_{G} \tag{28}\]

\[\text{Depth}=1+\mathbf{U}_{D} \tag{29}\]

### Convolutional Unitary Blocks

The unitary blocks used to perform the convolutions are designed to demonstrate the functionality of the proposed methods. Unitary blocks \(\mathbf{U}_{1}\) and \(\mathbf{U}_{2}\) are shown in Figure 4, and are based on [58] and [42], respectively. The gate \(X^{\theta}\) represents a power of an \(X\) gate, and is described by Equation 30. The entangling unitary blocks \(\mathbf{U}_{c}\) and \(\mathbf{U}_{a}\) used in the DRPC and DRPC-T circuits are detailed in the Appendix.

\[X^{\theta}=\begin{bmatrix}e^{\frac{i\pi\theta}{2}}\cos\left(\frac{\pi\theta}{2 }\right)&-ie^{\frac{i\pi\theta}{2}}\sin\left(\frac{\pi\theta}{2}\right)\\ -ie^{\frac{i\pi\theta}{2}}\sin\left(\frac{\pi\theta}{2}\right)&e^{\frac{i\pi \theta}{2}}\cos\left(\frac{\pi\theta}{2}\right)\end{bmatrix} \tag{30}\]
## 3 Results and Discussion

### Architecture

We evaluate the proposed quantum circuits as components of a hybrid quantum-classical machine learning architecture for image classification. A quantum circuit is used to perform the convolution over the embedded input pixels of the image and build the output feature map, and a two-layer feed-forward network is used to obtain the probabilities for each possible class. This architecture is portrayed in Figure 5.

### Datasets

We utilize the CIFAR-10 dataset, as well as three sets of synthetic data designed to isolate the ability of our circuits to learn inter-channel information. All models are trained for 20 epochs and the hyperparameters used for each dataset are not changed between models.

#### 3.2.1 Cifar-10

The Canadian Institute for Advanced Research, 10 classes (CIFAR-10) [59] is a dataset of images that has become a prominent benchmark for image recognition models. This dataset consists of 50,000 training and 10,000 testing RGB images of ten different classes: airplane, automobile, bird, cat, dog, deer, frog, horse, ship, and truck. Each image is 32 \(\times\) 32 pixels (in this work, we rescale them to 10 \(\times\) 10 pixels). Unless
otherwise specified, we train on 500 randomly selected images from each class, and test on 100 randomly selected images from each class that do not appear in the training set.

#### 3.2.2 Synthetic Noisy Colors

10 \(\times\) 10 pixel images of nine colors are created (blue, green, red, cyan, magenta, yellow, light cyan, pink, and light yellow), and 20% of these pixels are randomly selected and corrupted by setting all channel values of the corrupted pixel to 0. Three representative images are shown in Figure 7. In total, there are 400 images for each color (3,600 total images), where 80% of these images were used for training and 20% are used for testing.

#### 3.2.3 Synthetic Noisy Patterned Colors

To demonstrate that this method also captures intra-channel features, four different design shapes are drawn on the synthetic colors in white before corruption. In this dataset six base colors (blue, green, red, cyan, magenta, and yellow) are used, for a

Figure 5: Hybrid quantum-classical machine learning architecture used to evaluate each of the proposed circuits.

Figure 6: Three representative full-resolution (32 \(\times\) 32 pixel) images from the CIFAR-10 dataset.
total of 24 classes, four of which are shown in Figure 8. We create 400 10 \(\times\) 10 training images of each class, and use 80% for training and 20% for testing.

#### Synthetic High-Channel Data

We create a 12-channel dataset consisting of tensors of shape 10 \(\times\) 10 \(\times\) 12 that are each populated with a uniform random distribution of numbers \(\in[0,1)\). Each of the 10 classes is defined by the addition of 0.5 to three distinct channels of the data, and is shown in Figure 9.

### CIFAR-10 Dataset Results

All four proposed methods DR-QCNN, DRPC-QCNN, DRPC-T-QCNN, and WEV-QCNN are tested against a control QCNN. This control QCNN operates by passing the quantum filter over each channel individually, acquiring an expectation value, and summing the expectation values to produce the final output.

To comprehensively evaluate the proposed QCNNs on the CIFAR-10 dataset, each model is evaluated on an _n_-member classification task, where \(n\) (two - ten) classes are contained in the training and test sets. We begin with ten classes and iteratively remove the remaining class that the DR-QCNN classifies with the least accuracy,

Figure 8: Each design shape of patterned noisy color from the dataset. The designs are created using white (255, 255, 255), and then subsequently subjected to the random corruption.

Figure 7: Three representative noisy color data points from the data set. Each color in the figure has a different number of populated channels: red (255, 0, 0), cyan (0, 255, 255), and light yellow (255, 255, 128).
performing a classification at each iteration. The DRPC-QCNN using \(\mathbf{U}_{1}\) achieves the highest binary accuracy of 93.5%, compared to 85.0% with the control QCNN. When trained on all ten classes, the DR-QCNN was able to achieve 37.0% while the control QCNN produced 28.2% accuracy. The performance of each method on variable numbers of classes is shown in Figure 10. A comparison between each circuit is displayed for each type of classification in Figure 11. For all classifications, the DR-QCNN, DRPC-QCNN, and WEV-QCNN outperformed the control QCNN.

The DR-QCNN achieves state-of-the-art performance on the CIFAR-10 dataset compared to current quantum neural networks (Table 1).

### Synthetic Dataset Results

In an attempt to demonstrate that the increased accuracy of the DR-QCNN, DRPC-QCNN, and WEV-QCNN models can be attributed to their ability to extract features across the channel dimension, all proposed methods and the control QCNN are evaluated with synthetic datasets that emphasize inter-channel relationships. These synthetic datasets place all patterns to be learned in the channel dimension only, rather than both the spatial and channel dimension of the data. In an RGB image, the color is explicitly defined by the value of each channel. In the synthetic 12-channel dataset, the classes are determined by which channels contains higher values than the others. By relegating all important learnable patterns to the channel dimension, the proposed models' abilities to extract inter-channel features are demonstrated.

All proposed methods are able to achieve 95% accuracy, with DRPC-QCNN achieving 100% accuracy on the _synthetic 12-channel dataset_. When predicting the color of noisy RGB images, the proposed models demonstrate the ability to learn, with the DR-QCNN and DRPC-QCNN achieving 100% accuracy. The control QCNN is shown to perform much worse. The results for the _noisy colors with shapes dataset_ are similar to those of the _noisy color dataset_.

Figure 9: Synthetic high-channel data. Each element in the blue colored channels are random numbers between 0 and 1. Each element in the red colored channels are random numbers between 0.5 and 1.5.
**Fig. 10**: Test set accuracy as a function of training epochs for the CIFAR dataset. Deposit and Reverse (DR) quantum convolutional neural network (QCNN), DR with parallel channels (DRPC)-QCNN, DRPC topologically considerate (DRPC-T)-QCNN, weighted expectation value (WEV)-QCNN, and a control QCNN are evaluated for two to ten classes on the CIFAR dataset. The control QCNN passes a filter individually over each channel and sums the expectation values. Quantum convolutions are performed with \(\mathbf{U}_{1}\).
\begin{table}
\begin{tabular}{c c} \hline Quantum Model & Test Accuracy \\ \hline \hline Quanvolutional Neural Network1[47; 57] & 34.9\% \\ Neural Network with Quantum Entanglement1[57] & 36.0\% \\ Flat Quantum Convolutional Ansatz2[45] & 41.8\% \\ Our work (DR-QCNN) & 45.1\% \\ \hline Classical Model & Test Accuracy \\ \hline CNN3 & 64.6\% \\ CNN-P3 & 51.2\% \\ \hline \hline \end{tabular} 1Models make no attempt to learn inter-channel information, and instead converts the images to grayscale.

2Model is tested with images from the training data. This accuracy is a reproduction trained and tested on the full CIFAR-10 data using their exact architecture and circuit.

3Both architectures are shown in Figures 1 and 2 in the Appendix. CNN-P is a CNN with the same number of parameters as our work.

\end{table}
Table 1: Full 60,000 CIFAR-10 Image Recognition

Figure 11: Test set accuracy as a function of training epochs for the Deposit and Reverse (DR) quantum convolutional neural network (QCNN), DR with parallel channels (DRPC)-QCNN, DRPC topologically considerate (DRPC-T)-QCNN, weighted expectation value (WEV)-QCNN, and a control QCNN for binary and ten-member classification. Quantum convolutions are performed with \(\mathbf{U}_{1}\).
Figure 12: Test set accuracy and test set loss as a function of training epochs for the Deposit and Reverse (DR) quantum convolutional neural network (QCNN), DR with parallel channels (DRPC)-QCNN, DRPC topologically considerate (DRPC-T)-QCNN, weighted expectation value (WEV)-QCNN, and control QCNN for classification of the _synthetic 12-channel dataset_ using \(\mathbf{U}_{2}\).

Figure 13: Test set accuracy and test set loss as a function of training epochs for the deposit and reverse (DR) quantum convolutional neural network (QCNN), DR with parallel channels (DRPC)-QCNN, DRPC topologically considerate (DRPC-T)-QCNN, weighted expectation value (WEV)-QCNN, and control QCNN for classification of the _noisy colors dataset_ using \(\mathbf{U}_{2}\).
**Fig. 14**: Test set accuracy and test set loss as a function of training epochs for the Deposit and Reverse (DR) quantum convolutional neural network (QCNN), DR with parallel channels (DRPC)-QCNN, DRPC topologically considerate (DRPC-T)-QCNN, weighted expectation value (WEV)-QCNN, and control QCNN for classification of the _noisy colors with shapes dataset_ using \(\mathbf{U}_{2}\).
## 4 Summary

The proposed quantum circuits allow our QCNNs to effectively learn inter-channel information, as shown through evaluation of the models on synthetic data that holds important patterns in the channel dimension. Moreover, the DR-QCNN method achieves state-of-the-art performance on the CIFAR-10 dataset compared to current quantum neural networks.

The poorer performance of the proposed DRPC-T-QCNN suggests better efforts must be made to effectively correlate the multiple ancilla qubits. It is our hope that soon this method will lose relevance, as fully connected systems are beginning to emerge, most recently Honeywell's 32-qubit trapped-ion quantum processor [60]. As these models possess a heightened ability to learn inter-channel patterns, we wish to apply these to deeper layers in quantum-hybrid neural networks. For the DR-QCNN, DRPC-QCNN, and DRPC-T-QCNN, the first qubit of each working register is used as the target to provide a phase kickback to the ancilla qubit(s). It is theorized higher accuracy may be achieved by performing controlled phase gates targeting all qubits in the working register, however as this work aims to create hardware considerate circuits, this is left to future projects. Since all expectation values are weighted in the WEV-QCNN method, it is proposed that as this method is parallelized across a Quantum Processing Unit the classical weights will learn which qubits are better performing than others and weight them less in the final output. This could serve as a quantum error corrective technique inherent to the WEV-QCNN method, and running it on real quantum hardware would test this theory.

Beyond image recognition, we envision that these methods can be applied to problems in the natural and physical sciences.

## 5 Methods

### Hardware

All scripting was done in Python 3.9.13. The quantum simulation package Cirq [61] version 0.13.1 was used, as well as Tensorflow 2.7.0 [62] and Tensorflow Quantum 0.7.2 [63]. An Intel i7-13700KF CPU, 12GB Nvidia GeForce RTX 3080Ti GPU, and 64GB of 3600MHz CL18 RAM were used for all computations.

### Datasets

The CIFAR-10 dataset (Section 3.2.1) was loaded with Tensorflow Keras, and the pixel values were normalized between 0 and 1. The training and testing data were segregated by class, and the first 500 data points in each class of the training data were used as the training set. The first 100 data points in each class of the test data were used as the test set. Both sets were then shuffled using scikit-learn [64]. After building the training and test sets, all images were downsized from 32 \(\times\) 32 \(\times\) 3 to 10 \(\times\) 10 \(\times\) 3 using bilinear interpolation.

The _noisy color dataset_ (Section 3.2.2) was created by making a colored 10 \(\times\) 10 - pixel square in Microsoft Paint using the RGB values specified in Table 3 and then images were saved as PNG files. For each color, 400 replicas of the images were loaded
with Tensorflow, and 20% of the pixels were randomly corrupted in each by setting the pixel value to 0, 0, 0. The _noisy colors with shapes dataset_ (Section 3.2.3) was prepared analogously, where the shapes were drawn by setting the pixel values to white (255, 255, 255). Each channel in both of these RGB synthetic datasets was normalized to \(\frac{c}{C}\), where \(c\) is the index of the channel and \(C\) is the total number of channels. This allows the model to better distinguish between channels in the Bloch sphere.

The _synthetic 12-channel dataset_ (Section 3.2.4) was created by initializing a 10 \(\times\) 10 \(\times\) 12 tensor, where all elements were populated with uniformly distributed random values between 0 and 1. 0.5 was added to every element in the three specified channels that comprised a class, where \(i\) class is defined by adding 0.5 to channels \(i\) to \(i+2\). 100 replicas of each class were generated to serve as training data, and 20 replicas of each class were generated to serve as test data.

### Machine Learning

The learnable parameters in the quantum circuits were initialized using the Xavier method [65]. For the CIFAR-10 and synthetic RGB datasets (all but the _synthetic 12-channel dataset_), the classical weights and biases associated with the expectation values in the WEV-QCNN were initialized with a random normal distribution centered at 1.0 and 0.0, respectively, with both distributions having a standard deviation of 0.1. Xavier initialization was also used for the classical weights and biases when training on the _synthetic 12-channel dataset_. Categorical cross-entropy was used as the loss function, and Adam optimizer [66] was used to update the weights. A constant learning rate was used, which was a constant rate of 0.001 and was used for all datasets, except for the _synthetic 12-channel dataset_ which used a learning rate of 0.01. The exponential decay rate for the first and second moment estimations were set to 0.9 and 0.999, respectively for all training. Epsilon was set to \(1.0\times 10^{-7}\). The output of each hidden layer in the model architecture was activated with ReLU, and Softmax was applied to the final output layer to obtain probabilities. The classical architecture was the same for all models. Accuracy was calculated as the ratio of images the model classified correctly to the number of total images the model attempted to classify.
## 6 Data Availability

All of our software including that to generate the synthetic datasets and reproduce the results from this work are available as open source at [https://github.com/anthonysmaldone/QCNN-Multi-Channel-Supervised-Learning](https://github.com/anthonysmaldone/QCNN-Multi-Channel-Supervised-Learning).

## 7 Statements and Declarations

The authors declare no competing financial interest.

\begin{table}
\begin{tabular}{c c} \hline \hline Number of Classes & Class That is Added \\ \hline
2 & frog, ship \\
3 & 2 + automobile \\
4 & 3 + truck \\
5 & 4 + airplane \\
6 & 5 + bird \\
7 & 6 + cat \\
8 & 7 + horse \\
9 & 8 + dog \\
10 & 9 + deer \\ \hline \hline \end{tabular}
\end{table}
Table 2: Classes used in CIFAR-10 Experiments

\begin{table}
\begin{tabular}{c c} \hline \hline Color & RGB Value \\ \hline Blue & 0, 0, 255 \\ Green & 0, 255, 0 \\ Red & 255, 0, 0 \\ Cyan & 0, 255,255 \\ Magenta & 255, 0, 255 \\ Yellow & 255, 255, 0 \\ Light Cyan & 128, 255, 255 \\ Pink & 255, 128, 255 \\ Light Yellow & 255, 255, 128 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Colors used in the Noisy Colors Dataset
## 8 Acknowledgements

We acknowledge the support provided by the NSF CCI grant (Award Number 2124511).

## Appendix

Let the deposition qubit be in an arbitrary superposition state

\[\left|\psi_{a}\right\rangle=\alpha\left|0\right\rangle+\beta\left|1\right\rangle. \tag{1}\]

When the \(CP\left(\theta\right)\) gate is applied to a qubit, if the control qubit is \(\left|0\right\rangle\), the state of the qubits remain unaltered. If the control qubit is in the \(\left|1\right\rangle\) state, phase is attached to the state of the control qubit as shown

\[CP\left(\theta\right)\left(\left|0\right\rangle\otimes\left|\Psi_{c}\right\rangle \right)=\left|0\right\rangle\otimes\left|\Psi_{c}\right\rangle, \tag{2}\]

\[CP\left(\theta\right)\left(\left|1\right\rangle\otimes\left|\Psi_{c}\right\rangle \right)=e^{i\theta}\left|1\right\rangle\otimes\left|\Psi_{c}\right\rangle. \tag{3}\]

The parameterized phase gate being controlled by the deposition qubit and targeting the entangled state will show that only the state of the controlled qubit is affected.

\[CP\left(\theta\right)\left(\left|\psi_{a}\right\rangle\otimes\left|\Psi_{c} \right\rangle\right)=CP\left(\theta\right)\left(\left(\alpha\left|0\right\rangle +\beta\left|1\right\rangle\right)\otimes\left|\Psi_{c}\right\rangle\right)=\]

\[CP\left(\theta\right)\left(\alpha\left|0\right\rangle\otimes\left|\Psi_{c} \right\rangle+\beta\left|1\right\rangle\otimes\left|\Psi_{c}\right\rangle \right)=\]

\[CP\left(\theta\right)\left(\alpha\left|0\right\rangle\otimes\left|\Psi_{c} \right\rangle\right)+CP\left(\theta\right)\left(\beta\left|1\right\rangle \otimes\left|\Psi_{c}\right\rangle\right)=\]

\[\alpha\left|0\right\rangle\otimes\left|\Psi_{c}\right\rangle+\beta e^{i\theta }\left|1\right\rangle\otimes\left|\Psi_{c}\right\rangle=\left(\alpha\left|0 \right\rangle+\beta e^{i\theta}\left|1\right\rangle\right)\otimes\left|\Psi_{ c}\right\rangle=\]

\[\left|\psi_{a}\right\rangle\otimes\left|\Psi_{c}\right\rangle \tag{4}\]

Thus, Equation 14 holds, and the ancilla qubit is not entangled with the qubits in the working register.
Figure 1: CNN Architecture

Figure 2: CNN-P Architecture