\section{Introduction}
\IEEEPARstart{Q}{uantum} computing is anticipated to outperform classical algorithms in processing speed and impact various industry sectors that need complex computation~\cite{spl01,spl02,KWAK2022}. In contrast to classical computation, where the computation unit (\textit{i.e.}, bit) is deterministically predetermined to be either $0$ or $1$, the computation unit in quantum computing (\textit{i.e.}, qubit) ranges from $0$ to $1$ and this leads an exponential scale in computation capability~\cite{aimlab2022arvix,kong2020review}. It's because the entanglement of qubits enables the simultaneous representation of multiple states. This distinguishing characteristic of quantum computing allows pursuing several paths concurrently in a single qubit, which is physically impossible for classical algorithms and necessitates multiple passes, increasing complexity orders~\cite{aimlab2022icdcs}. Therefore, even in the current decade of noisy intermediate scale quantum computation (NISQ), quantum machine learning (QML) has acquired linear or sublinear complexity as opposed to the polynomial complexity of conventional ML. Since conventional ML depends heavily on massive data, which is extremely hard to analyze and process, QML has drawn attention as a practical solution to these challenges. Various research has been conducted to utilize the nature of quantum computing on QML fully. For instance, a classification task, which is one of the representative machine learning problems, can be solved by QML based classifier~\cite{blank2020quantum}. In addition, QML can be used with not only itself but classical neural networks~\cite{schuld2019quantum}. Previous research showed that quantum computing performs complex computations in Hilbert space more efficiently than classical computing~\cite{schuld2019quantum,aimlab2022dynn}.
\begin{figure}[t!]
\centering
\includegraphics[width=0.75\linewidth]{Feature.PNG}
\caption{
Extracted feature maps according to various train strategies.}\label{fig:Featuremap}
\end{figure}
However, there is still a challenging problem that QML faces,~\textit{i.e.}, barren plateaus. The barren plateaus are a notorious problem in QML that occurs when the number of qubits increases. The barren plateaus vanish the gradients of the QML, making it impossible to guarantee trainability~\cite{mcclean2018barren}. As a solution, research in~\cite{pesah2021absence} proved that utilizing a quantum convolutional neural network (QCNN) with proper initialization can reduce the barren plateaus. Recent research in~\cite{DBLP:journals/qmi/HendersonSPC20} designed the QCNN with filters to extract the features of input data like classical convolutional neural networks (CNN). However, the QCNN is harsh to scale up the number of features because each feature is extracted by measurement of each qubit. Inspired by it, this paper proposes a new version of QCNN, \textit{scalable quantum convolutional neural network} (\textit{sQCNN}), and a new training algorithm,~\textit{reverse fidelity-train} (\textit{RF-Train}), which utilizes the concept of fidelity,~\textit{i.e.}, the nature of quantum computing. Therefore, sQCNN can fully use the intrinsic features of the input data. This paper has the following contributions.
\begin{itemize}
    \item First of all, we propose a scalable QCNN architecture with quantum computing, \textit{i.e.}, sQCNN, to achieve the scalability of filters while avoiding barren plateaus by maintaining QCNN architecture.
    
    \item In addition, we propose an sQCNN training algorithm, which is named to \textit{RF-Train}, in order to extract the intrinsic features with finite filters.
    
    \item Lastly, we conduct data-intensive experiments to corroborate the superiority of sQCNN with RF-Train in MNIST and FMNIST datasets, widely used in the literature.  
\end{itemize}

Fig.~\ref{fig:Featuremap} shows each feature map of untrained QCNN, Vanilla-Trained QCNN, and RF-trained sQCNN, respectively. We describe the classification performance and Euclidean distance of each feature from these models in Sec.~\ref{sec:experiment}.

\section{Preliminaries of sQCNN}

\subsection{Classical Convolutional Neural Network (CNN)}
A classical CNN is mainly composed of 3 procedures, \textit{i.e.}, convolution layers, pooling layers, and fully connected layers. 

\BfPara{Convolution Layers} In convolution layers, input data are convolved by a set of filters. Each filter is designed to extract the intrinsic feature of the input data. The number of filters are able to be adjusted under the consideration of elapsed calculation time in each layer in this classical CNN. The output is called feature map of this convolution computation.

\BfPara{Pooling Layers}
In pooling layers, dimensionality reduction is conducted on the convolved data. This procedure is essential as it reduces the computation time on next convolution layer. Moreover, it gives to the CNN the ability to learn representation invariant to small translations.

\BfPara{Fully Connected Layers}
After the computational procedure of convolution layers and pooling layers, conducting fully connected layers on input data enables the model to get the probability of initial input to belong to the corresponding class. 

\begin{figure*}[t!]
\centering
\includegraphics[width=0.85\linewidth]{MA.PNG}
\caption{Comparison between QCNN with Vanilla-Train and sQCNN with RF-Train.}\label{fig:Model ARchi}
\end{figure*}



\subsection{Quantum CNN (QCNN)}\label{sec:quanvolution}

QCNN is a new design of CNNs for multi-dimensional vectors using quantum circuits as convolutional filters~\cite{DBLP:journals/qmi/HendersonSPC20}. To fully leverage massively parallel computations on the superposition of quantum states with a limited number of qubits, QCNN is designed to mimic the role of CNN. To make QCNN operate as CNN, spatial information should be processed by the quantum circuit adequately. The quanvolution filter is the primary method to utilize spatial information. The quanvolutional filter consists of three components,~\textit{i.e.}, encoder, parameterized quantum circuit (PQC), and measurement. By designing the filter with trainable parameters, the quanvolutional filter can be regarded as an extension of the filter in classical CNN. The architecture of quanvolutional filter is illustrated in Fig.~\ref{fig:Model ARchi}.


\BfPara{Encoder} The encoder in quanvolutional filter encodes classical information $\mathbf{x}$ into the state information of qubits. There are many encoding strategies, \textit{i.e.}, basis encoding, amplitude encoding, and angle encoding. In angle encoding, the state is denoted as follows,
\begin{equation}
    |\psi_\mathbf{x}\rangle = \prod_{m=0}^{ \ceil{ \text{size}(\mathbf{x}) / n_q} }U(\theta_m)U(\mathbf{x}_{n_q m:n_q(m+1)})|0\rangle^{n_q}, 
\end{equation} where $U(\theta_m)$ is the rotation gate of the $m$-th set of re-uploaded input described well in previous research~\cite{perez2020data}, and $n_q$ is the number of qubits in PQC. The terms $\text{size}(\mathbf{x})$ and $\mathbf{x}_{n_q m:n_q(m+1)}$ denote the vector size of input vector $\mathbf{x}$ and the vector which is composed by the first $n_q \cdot m $ to $n_q \cdot (m+1)$ elements, respectively. In this paper, we encode the states of the filters using this angle encoding strategy.


\BfPara{Parameterized Quantum Circuit} As with the universal approximation theorem, there is always a PQC that can represent the optimal objective function within a small error~\cite{benedetti2019parameterized}. Accordingly, QCNN uses PQC with trainable parameters as a filter and proposes to train the filter according to each data-driven task. Using the \textit{chain rule} and \textit{parameter shift rule}, we can write the derivative of the loss function in terms of the output of PQC~\cite{wierichs2022general}.

\BfPara{Measurement}
The measurement procedure of QCNN is the same as the QML. The output state of each n-qubit filter after training on PQC, $|\psi_l\rangle$, can be measured by a set of projection matrices $\mathbf{M}_i$, which form an orthogonal set,~\textit{i.e.}, $\mathbf{M}_i\mathbf{M}_j=0$ where $i\neq j$. If the set satisfies the requirement $\sum_i \mathbf{M}_i =\mathbf{1}$, 
then any observable $\mathbf{M}$ has the spectral decomposition $\mathbf{M}=\sum_i i\mathbf{M}_i$. The possible outcomes correspond to the eigenvalues $i$ of $\mathbf{M}$. In this paper, we use the measurement operator $\mathbf{M}=\mathbf{I}^{\otimes n-1}\otimes \mathbf{Z}$, where $\mathbf{I}$ denotes the identity matrix and $\mathbf{Z} = \begin{bmatrix}
1 &  0 \\
0 &  -1
\end{bmatrix}$. Then, the measurement can be denoted as 
$\langle O \rangle =\langle \psi_{l} | \mathbf{I}^{\otimes n-1}\otimes \mathbf{Z} |\psi_l\rangle$.
By pooling and fully connecting the measurement $\langle O \rangle$ on the FCN, the QCNN can classify the image classes.







\section{Training of sQCNN}
\subsection{Architecture of sQCNN}
Fig.~\ref{fig:Model ARchi} illustrates the architectural difference between QCNN and sQCNN. In classical QCNN with Vanilla-Train, each pixel data is encoded in each qubit. After feature extraction, we can obtain a feature corresponding to the measurement value of each qubit of PQC. Note that, the number of features extracted in this process is equal to the number of qubits in PQC, which is the same as the size of the kernel. Suppose a single quanvolutional layer and a square filter with length $M$. In this case, the number of features (\textit{i.e.,} equal to the number of channels) extracted through the QCNN is fixed to $n_q = M^2$, where $n_q$ is the number of qubits in the filter. In contrast to QCNN, we design sQCNN to be able to increase the number of filters. We assume that the increase of the number of filters outperforms the increase of qubits in a single filter (\textit{i.e.,} we corroborate this assumption via experiments in Sec.~\ref{sec:experiment}). The sQCNN utilizes multi-filters, and this enables sQCNN to adjust the number of extracted features. The number of features is denoted as $n_{f}n_{q}$, where $n_{f}$ is the number of filters. 

\begin{algorithm2e}[t]\label{alg: RF-train}
    \SetCustomAlgoRuledWidth{0.44\textwidth}  
\caption{Reverse Fidelity Train (RF-Train)}\label{alg:Training algorithm} 
\textbf{Initialization.} \texttt{sQCNN} parameters, $w$;

 \For{ $e = \{1,2,\dots, E\}$}
 {
     \For{ $(x, y) \in \zeta^k$}
     {
         \For{$l, l^{'} \in \{1,2,\dots,L-1\}$}
         {  
            Get features with $l$-th and $l^{'}$-th filter\;
            Calculate $\mathcal{L_{RF}}$\;
            Calculate loss gradients\;
            
         }
         Calculate $\mathcal{L}_e^k \leftarrow \mathcal{L}_{total}$\;
         $\ensuremath{\bm{\theta}}^k_{e+1}\leftarrow \ensuremath{\bm{\theta}}^k_{e}-\eta_e\nabla_{\theta^k_{e}}\ensuremath{\mathcal{L}}^{k}_{e}$\;
     }    
 }
\end{algorithm2e}

\subsection{Reverse Fidelity Train (RF-Train)}

As sQCNN can adjust the number of features and measure each PQC-based quanvolutional filter as a set of features, we aim to utilize the architectural advantage of sQCNN fully. Motivated by the fidelity in quantum computing theory, we propose an sQCNN training algorithm named reverse fidelity-train (RF-Train). The RF-Train contains an RF regularizer that adjusts the fidelity between the quanvolutional filters of sQCNN. Note that fidelity is a nature of quantum computing that is a similarity metric between two quantum states. Here, it is possible to measure fidelity because we scale up the sQCNN by increasing the number of filters, not the number of qubits in a single PQC. Suppose two filters have the output states $|\psi_{l} \rangle$ and $|\psi_{l'}\rangle$, respectively. The fidelity between the two quanvolutional filters is denoted as $\Phi(\rho_{l}, \rho_{l'}) = |\langle \psi_{l}|\psi_{l'}\rangle|^2$, where
$\rho_{l} = |\psi_{l} \rangle \langle \psi_{l}| \textrm{ and }
\rho_{l'} =|\psi_{l'} \rangle \langle \psi_{l'}|$. The increasing similarity between the two quanvoltutional filters drives the fidelity to converge to 1. On the other hand, the fidelity converges to 0 when the similarity between the two filters decreases, indicating that the $l$-th filter does not follow the $l'$-th filter.
We assume that a reduction in the fidelity between output states of the quanvolutional filters enables the extraction of various intrinsic features. We corroborate this assumption with numerical experiments in Sec.~\ref{sec:experiment}. We define the RF regularizer as, 
\begin{equation}
    \mathcal{L_{RF}} = 1 - {1\over L(L-1)} \sum_{l=1}^L\nolimits \sum^L_{l'\neq l}\nolimits \Phi(\psi_{q_{l}}, \psi_{q_{l^{'}}}),
\end{equation}
where $L$ is the number of filters. With the RF regularizer, the training procedure of sQCNN is described in Algorithm 1. The parameters ($\mathbf{x}$, $y$) are denoted as the input data and label, respectively. We adopt cross-entropy as,
\begin{equation}
\mathcal{L_{CE}} = -{1\over C}\sum^C_{c=1}\nolimits \log{p(y_{pred} = y_c|\mathbf{x})}, 
\end{equation}
where $C$ represents the number of classes. $y_{pred}$ and $y_c$ are the predicted class and the actual class, respectively. Consequently, we design the total loss of sQCNN as,
\begin{equation}
    \mathcal{L}_{total} ={\frac{1}{|\zeta|}} \sum_{(\mathbf{x}, y) \in \zeta}\nolimits [\mathcal{L_{CE}} -\lambda \mathcal{L_{RF}}],
\end{equation}
where $\zeta$, and  $\lambda$ denote the minibatch and an RF regularizer parameter, respectively. 
\section{Performance Evaluation}\label{sec:experiment}
\subsection{Experimental Setting}
To corroborate the performance of the sQCNN with RF-Train, we design the experiments as follows:
\begin{itemize}
    \item We investigate the top-1 accuracy of sQCNN with various RF-regularizer parameters $\lambda$, and QCNN with Vanilla-Train on both MNIST and FMNIST datasets.
    \item To corroborate the impact of the RF regularizer parameter $\lambda$, we investigate the Euclidean distance between the extracted features due to the RF-regularizer parameter $\lambda$. 
    \item The scalability of sQCNN is proven. In QCNN, an increase in qubits caused a barren plateau, which degraded the overall model performance. In contrast to QCNN, in sQCNN, the increase in filters results in a performance improvement, despite using the same number of qubits in QCNN. Note that the sQCNN shows performance improvement with the increased number of filters. 
\end{itemize}





\subsection{Experimental Results}
\BfPara{Performance of sQCNN}
Fig.~\ref{exp:main} and Fig.~\ref{exp:main2} represent top-1 accuracy of various models with two filters on the MNIST and FMNIST datasets, respectively. Analyzing from the architectural point, both Fig.~\ref{exp:main} and Fig.~\ref{exp:main2} represent that RF-Trained sQCNNs outperform classical Vanilla-Trained QCNN. From the results, we confirmed that even using sQCNN, \textit{i.e.}, even without RF-Train, it can achieve performance improvement in a classification task. Moreover, when the RF-regularizer parameter $\lambda$ increases, sQCNN with a finite number of filters ($n_f =2$) shows performance improvement. sQCNN with high RF-regularizer parameter ($\lambda= 0.5)$ achieves $16 \%$ higher top-1 accuracy than sQCNN which does not utilize RF-Train ($\lambda=0$). Here, we observe that by diversifying the filters with RF-Train, we can improve the performance of sQCNN.
\begin{figure}[t]
    \centering
    \includegraphics[width=\columnwidth]{accuracy-eps-converted-to.pdf}
    \caption{Top-1 accuracy (MNIST).}
    \label{exp:main}
\end{figure}
\begin{figure}[t]
    \centering
    \includegraphics[width=\columnwidth]{bar-eps-converted-to.pdf}
    \caption{Top-1 accuracy on FMNIST dataset according to the number of filters (qubits). sQCNN ($\lambda = 0, 0.1$ and $0.5$) with filters ($n_f = 2, 3$ and $4$) and QCNN with number of qubits ($n_q =8, 12$ and $16$). }
    \label{exp:main3}
\end{figure}

\BfPara{Impact of RF-Train}
Table~\ref{tab:distance} represents the impact of RF regularizer parameter $\lambda$ on the classification performance. We observe that RF-Train increases the Euclidean distance between extracted features and experimentally confirmed that this diversity between features improves the classification task performance of sQCNN.

\BfPara{Scalability of sQCNN} 
Fig.~\ref{exp:main3} represents that sQCNN achieves scalability. In QCNN, the top-1 accuracy decreases significantly as the number of qubits in a filter increases. As the number of qubits increases from 8 to 16, the performance of QCNN drops about $30\%$. In contrast to QCNN, sQCNN shows a stable performance when the number of filters increases. From the result, we corroborate that this scalability of SQCNN can be a significant characteristic in several tasks that require a large number of filters as well as simple MNIST and FMNIST data with one input channel.


\section{Conclusions and Future Work}
This paper proposes a scalable QCNN (sQCNN) architecture and a novel training algorithm (RF-Train) that enables sQCNN to diversify the extracted features. To achieve scalability while avoiding the barren plateaus which occur when the number of qubits in the filter increases, we utilize multiple filters with a finite number of qubits. To extract various features with the filters and maximize the performance of sQCNN, motivated by the quantum theory, we design an RF regularizer using the concept of fidelity. With extensive experiments, we corroborate the diversity of features that are extracted by using RF-Train and the scalability of sQCNN. 

As future research, analyzing the scalability and trainability of sQCNN in various environments could be interesting.


\begin{figure}[t]
    \centering
    \includegraphics[width=\columnwidth]{fmnist_acc-eps-converted-to.pdf}
    \caption{Top-1 accuracy (FMNIST).}
    \label{exp:main2}
\end{figure}

\begin{table}[t]
\centering
\caption{Top-1 accuracy and Euclidean distance comparison }
\resizebox{\columnwidth}{!}{
\begin{tabular}{c||ccc}
    \toprule[1pt]   
     &\multicolumn{3}{c}{\textbf{RF-Train}}\\
    \textbf{Metric} & $\lambda=0$ & $\lambda=0.1$   &  $\lambda=0.5$ \\\midrule
    Top-1 accuracy (\%) & $76$& $78$& $\mathbf{82}$ \\
    Euclidean distance ($\times 10^{-2}$) & $0.4$& $0.7$& $\mathbf{1.1}$ \\
\bottomrule[1pt]
\end{tabular}}\label{tab:distance}
\end{table}

\bibliographystyle{IEEEtran}
