0% found this document useful (0 votes)
17 views11 pages

Quantum

Uploaded by

shahina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views11 pages

Quantum

Uploaded by

shahina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1

Exploring Quantum-Enhanced Machine


Learning for Computer Vision: Applications and
Insights on Noisy Intermediate-Scale Quantum
Devices
Purnachandra Mandadapu
[email protected]
Deloitte, Dallas, Texas, USA

simulating physical systems and encrypting data. These


computers work differently from regular ones, using special
Abstract— As medium-scale quantum computers progress, the properties of quantum mechanics.
application of quantum algorithms across diverse fields like
simulating physical systems, chemistry, optimization, and In recent years, there has been significant growth in the field
cryptography becomes more prevalent. However, these quantum of Machine Learning (ML)—a problem-solving approach
computers, known as Noisy Intermediate Scale Quantum (NISQ),
where machines learn to tackle tasks by digesting large
are susceptible to noise, prompting the search for applications
that can capitalize on quantum advantage without extensive volumes of data or general information pertaining to the
error correction procedures. Since, Machine Learning (ML), problem [1]–[5]. This enables them to discern patterns and
particularly Deep Learning (DL), faces challenges due to develop their own decision-making processes, without explicit
resource-intensive training and algorithmic opacity. Therefore, instructions. Common applications include organizing data
this study explores the intersection of quantum computing and into categories, grouping similar items, generating new data,
ML, focusing on computer vision tasks. Specifically, it evaluates and facilitating autonomous driving systems. However, a
the effectiveness of hybrid quantum-classical algorithms, such as notable challenge of this approach is the substantial need for
the data re-uploading scheme and the patch Generative data and computational resources for training, coupled with
Adversarial Networks (GAN) model, on small-scale quantum
the inherent opacity of the algorithms, making it difficult to
devices. Through practical implementation and testing, the study
reveals comparable or superior performance of these algorithms ensure optimal resource utilization. Given these challenges, it
compared to classical counterparts, highlighting the potential of prompts the question: Can quantum computers offer assistance
leveraging quantum algorithms in ML tasks. to ML algorithms? Specifically, can quantum properties
enhance the effectiveness of ML processes without solely
Index Terms— Deep Learning, Generative Adversarial relying on faster hardware, which often poses a significant
Networks, Machine Learning, Noisy Intermediate Scale bottleneck in advancing ML research? Many studies have
Quantum, Quantum Algorithms looked into the fascinating idea—using quantum technology to
improve ML. Therefore, this study combines the strengths of
I. INTRODUCTION both quantum computing and traditional methods. Quantum
As medium-scale quantum computers continue to advance, the variational algorithms offer powerful problem-solving
application of quantum algorithms becomes more prevalent capabilities, while classical computing provides the
across diverse fields such as simulating physical systems, infrastructure for large-scale optimization. Therefore, in this
chemistry, optimization, and cryptography. These algorithms study, we focus on applying hybrid quantum-classical
exploit the distinctive properties of quantum mechanics, such algorithms to a crucial area of ML—computer vision.
as entanglement and superposition, to overcome the Specifically, we examine their effectiveness in tasks like
limitations encountered in classical computing, thereby sorting images into categories and generating new images.
achieving what is known as quantum advantage. At present, Inspired by promising findings in existing literature, we
quantum computers typically operate within the range of small implement and evaluate two such algorithms: the data re-
to medium scales and are susceptible to noise, a characteristic uploading scheme and the patch Generative Adversarial
referred to as Noisy Intermediate Scale Quantum (NISQ). Networks (GAN) model. These algorithms are tailored to
Consequently, there is a growing interest in identifying work well even on small-scale quantum devices. Our
applications that can capitalize on quantum advantage without experiments reveal that both the data re-uploading scheme and
requiring error correction procedures, as implementing such the patch GAN model perform comparably to or even better
routines would significantly escalate the demand for qubits. In than classical algorithms of similar complexity. This
simpler terms, as medium-sized quantum computers become underscores the potential of leveraging quantum algorithms,
more powerful, they're being used in various fields like especially on smaller systems. It suggests that as quantum
2

technology matures, we may see even greater advantages in |𝛹 ⟩ = |01⟩ − |10⟩ (4)
√ √
the realm of ML.
However, in quantum computing, a system of n qubits is
commonly represented by a grid structure known as a quantum
The study commences by introducing fundamental concepts in
circuit. This circuit visually displays the operations that
quantum computation, including the notion of quantum
manipulate the qubits within the Hilbert space. The Hilbert
circuits and quantum gates, elucidating their susceptibility to
space, denoted as 𝐻, is the mathematical construct
errors in Section II. These components serve as the
representing all possible states of the qubits. The operators,
foundational elements of quantum algorithms, particularly
such as the X, Z, and Y, are depicted within the circuit,
pivotal in the realm of Quantum Neural Networks (QNNs).
indicating the transformations applied to the qubits. For
Subsequently, an overview of related works is presented in
instance, the X operator induces a bit-flip3 operation, the Z
Section III. Section IV brings together important concepts of
operator introduces a phase-flip4 operation, and the Y operator
quantum ML. We will define Variational Quantum Circuits
combines both bit-flip and phase-flip operations. This grid-
(VQCs), which are quantum circuits with adjustable parts, and
based5 representation serves as a foundational tool in
explore how they function as QNNs. Furthermore, we'll delve
understanding and analyzing quantum algorithms and their
into two specific quantum ML algorithms—data re-uploading
implementations. Quantum computing relies on fundamental
and Patch GAN. We'll explain these algorithms and provide
building blocks called quantum gates. These gates perform
reasoning for their utilization. In Section V, we will practically
operations on quantum bits, or qubits, which are the basic
implement and test these algorithms. We'll conduct tests on
units of quantum information such as:
both simulators, including perfect and noisy versions, and on a
real quantum device for the data re-uploading algorithm.
Finally, we'll draw conclusions based on our findings and  Hadamard Gates (H): This gate is used to create
outline potential future avenues for research in Section VI. superposition, a key principle in quantum computing
where a qubit can exist in multiple states
II. BACKGROUND simultaneously.
 Pauli Gates (X, Y, Z): These gates are fundamental
In this section, we offer a brief introduction to quantum
computation, amplifying the fundamental concepts important in quantum computing for manipulating qubits along
for this study. Quantum computation involves the processing different axes in the Bloch sphere, a geometric
and manipulation of data rooted in the principles of quantum representation of qubit states.
mechanics, notably superposition and entanglement. Unlike  Entangling Controlled 'Not' (CNOT) Gate: This
classical computation, which uses the binary scalar bits for gate entangles two qubits, where the state of one
information representation—quantum computation utilizes qubit depends on the state of the other qubit. The
quantum bits, or qubits, which are denoted by states within a CNOT gate applies the X operator to the target qubit
Hilbert1 space. Qubits are fundamental units in quantum based on the value of the control qubit.
computing, often represented using discrete-variable states
such as |0⟩ = and |1⟩ = . Unlike classical bits, qubits Quantum computing, although promising, faces challenges
due to errors stemming from various sources such as
can exist in a state of superposition, expressed through
environmental factors and inherent qubit imperfections. These
changes in basis. This superposition is defined by |+⟩ =
errors are quantified using Kraus6 operators, offering a formal
and |−⟩ = , where |+⟩ = (|0⟩ + framework to model noise in quantum circuits. The interaction
√ √ √
|1⟩) 𝑎𝑛𝑑 |−⟩ = (|0⟩ − |1⟩). Quantum gates, akin to between the quantum system and its environment is crucial,
√ often resulting in undesired effects on the quantum
classical logic gates, operate on qubits to preserve unitarity. information. One prevalent type of noise is the bit-flip
One such gate is the Hadamard gate, denoted as 𝐻 , which channel, where qubits undergo unintended changes analogous
transforms |0⟩ 𝑡𝑜 |+⟩ 𝑎𝑛𝑑 |1⟩ 𝑡𝑜 |−⟩. When dealing with to classical bit flips. Similarly, the phase flip channel
multiple qubits, the Hilbert space is tensorized to introduces alterations akin to changes in the quantum phase.
accommodate entanglement between qubits. Therefore, in Moreover, the amplitude damping7 channel represents a
quantum mechanics, states such as those depicted in Equations significant error source, mimicking energy dissipation in the
(1-4) exemplify what is termed as the Bell2 basis. These states quantum system due to environmental interactions. Another
represent a class of maximally entangled states, characterized
by intricate quantum correlations between particles.

|𝛷 ⟩ = |00⟩ + |11⟩ (1) 3


A quantum gate that changes a qubit's state from |0⟩ to |1⟩ or the other way
√ √
around.
|𝛷 ⟩ = |00⟩ − |11⟩ (2) 4
A quantum gate that reverses a qubit's phase, converting |0⟩ to |0⟩ and |1⟩ to -
√ √
||1⟩.
|𝛹 ⟩ = |01⟩ + |10⟩ (3) 5
A technique used in geometric and computational techniques that discretizes
√ √
space or data into a grid form.
6
1 A family of linear operators that characterize open quantum system
A term from mathematics that is used in functional analysis and quantum
dynamics in terms of quantum channels.
mechanics to describe an entire, infinite-dimensional vector space. 7
2 A quantum channel that simulates energy dissipation or decoherence by
A group of four maximally entangled states that serve as the foundation for
Bell experiments' description of quantum correlations. causing the amplitude of a qubit to decay.
3

form of noise, the depolarizing8 channel, adds complexity by IV. MATERIALS AND METHODS
introducing a combination of random gate errors. In recent years, researchers have been exploring the potential
Understanding how quantum circuits behave under these of quantum computers to tackle linear algebra problems [11]–
errors is essential for assessing the practicality of quantum [14]. While there have been efforts to demonstrate a quantum
algorithms. Moving forward, the performance of quantum advantage in conjunction with ML algorithms [15], [16], [25]–
circuits, especially those used as neural networks, will be [27], [17]–[24], these endeavours encounter common
evaluated, with quantum noise incorporated into the circuits to challenges—the practical limitations of the Harrow-Hassidim-
simulate real-world conditions or inherent imperfections in Lloyd 9(HHL) algorithm once implemented, and the
quantum hardware. substantial resources, including qubits and circuit depth, that
they demand. To comprehend the applicability of NISQ in the
III. RELATED WORKS realm of ML, it becomes imperative to rely on quantum
Hybrid quantum-classical ML methods have recently attracted algorithms complemented by classical counterparts,
considerable attention due to their ability to combine the particularly in scenarios where quantum algorithms face
strengths of classical and quantum computing, offering implementation barriers, such as solving optimization
potential solutions to computationally intractable problems problems related to fitting functions. VQCs emerge as
with greater efficiency. These methods seek to utilize quantum promising candidates for integrating quantum computation
computing for specific tasks while relying on classical into ML tasks due to their small scale and relatively lower
computing for data preprocessing and result postprocessing. In susceptibility to noise [28]. This makes them particularly
a recent study [6], a hybrid quantum-classical Convolutional suitable for current quantum devices' capabilities.
Neural Network (CNN) model was proposed for X-ray image
A. Variational Quantum Circuits
prediction. The quantum component of the model involves
encoding, random quantum circuits, and decoding phases. VQCs are a type of quantum-classical architecture that blends
This hybrid model demonstrated superior accuracy, quantum and classical computing components. A VQC
outperforming classical ML approaches in sensitivity and F1- comprises a parameterized quantum circuit, followed by a
measure. Another hybrid quantum-classical CNN model was classical optimization routine like Stochastic Gradient Descent
introduced in a separate study [7], employing a federated (SGD). Its design is straightforward, consisting mainly of two
learning approach to enhance model security and mitigate components—the quantum circuit and the classical optimizer.
privacy attack vulnerabilities. Results indicated that models The quantum circuit is typically constructed using a series of
with quantum convolution exhibited slightly improved quantum gates, often parameterized, such as single or
accuracy compared to baseline classical models. Additionally, controlled rotation gates. These gates manipulate quantum
researchers proposed a hybrid quantum-classical model of states, with the rotation angles serving as parameters adjusted
Long Short-Term Memory (LSTM), a type of Recurrent by the classical optimizer during the optimization process.
Neural Network (RNN), in another study [8]. Comparative Meanwhile, the classical optimizer plays a crucial role in
analysis revealed that the hybrid model achieved faster determining the optimal values for these parameters, aiming to
convergence and higher accuracy than its classical minimize a specified cost function. These cost functions vary,
counterpart, albeit under conditions assuming absence of noise being either problem-specific, such as those in molecular
and decoherence. Furthermore, a hybrid quantum-classical energy level studies [29], or problem-agnostic, typically
approach was developed for generative adversarial learning in associated with classical supervised learning scenarios [30].
[9], focusing on anomaly and fraudulent transaction detection. Generally, the fundamental steps involved in a VQC are
Performance evaluations showed comparable results to shown in Algorithm 1.
classical methods in terms of F1 score. Recent work [10]
delved into catastrophic forgetting with quantum algorithms, Algorithm 1: VQC
particularly focusing on incremental learning across different START
classification tasks. Inspired by replay methods, the 1. Initialization of the quantum circuit with initial
researchers proposed constraining model updates by parameter values.
projecting gradient directions onto regions defined by previous 2. Setting the qubits to a defined state, often the |0⟩ state.
task gradients, along with storing a portion of training data 3. Apply the parameterized quantum circuit to an input
from previous tasks for gradient descent computation. state.
However, a drawback of this method lies in the need to 4. Measuring the quantum circuit's output using
compute gradients of previous tasks at each training iteration. predefined measurement operators.
Overall, recent advancements in hybrid quantum-classical ML 5. Computing the cost function based on the measurement
methodologies underscore their potential to surpass classical outcomes, which relies on the circuit's parameters.
algorithms, particularly in handling large and complex 6. Utilizing the classical optimizer to refine the quantum
datasets. As quantum computing technology continues to circuit's parameters.
advance, further progress and the development of more 7. Repeat steps 2-5 until convergence is achieved.
powerful hybrid algorithms are expected in this field. END

8 9
Often employed in quantum error correction, a quantum channel randomly A quantum technique with potential applications in optimization that solves
rotates qubit states, adding noise and decreasing fidelity. linear equation systems quickly.
4

A notable advantage of VQCs lies in their potential to solve approach is particularly relevant in fields like condensed
problems more efficiently than classical algorithms. This matter and quantum chemistry due to their natural
efficacy stems from the capacity of quantum circuits to mathematical description using Hamiltonian13 operators.
explore exponentially large quantum state spaces [31], QNNs have diverse applications in quantum simulation,
facilitating more effective search for optimal solutions including Hamiltonian interaction mapping, ground state
compared to classical approaches. When we use a VQC, we compression, and exploring quantum materials and phase
adjust some settings to get the best result. It's a bit like how a transitions. VQCs have shown promise in this domain,
neural network works. Next, we want to see how we can outperforming alternatives like the Quantum Phase Estimation
combine the best parts of both quantum computing and neural (QPE) algorithm, which is susceptible to noise and errors.
networks. When a VQC gives us an result, it's usually in a Experimental trials on IBM's Qiskit14 framework using the
special format. To work with this result, we need to be able to ibmq-bogota15 device have highlighted the challenges posed
change the settings and see how the result changes. We have a by noise in QPE and the robustness of VQCs in such
way to do this called the parameter shift rule10. For instance, environments (refer to Fig. 1). While quantum data analysis
the rotation gate—can easily show how the result changes. We offers advantages in studying quantum states directly on a
can use this to make our VQC work better. We can even use it quantum device—the potential of quantum computing to
to help us understand how different parts of the VQC affect enhance classical ML algorithms remains unexplored. An
the final result. additional challenge in classical ML is the tendency of neural
networks to over-parameterize, leading to difficulties in data
However, in VQCs, various types of noise and errors affect generalization. Recent studies have focused on whether
their performance. Unlike traditional algorithms with fixed quantum circuits offer superior capabilities in sampling
parameters or 'black-box' gates, VQCs are learned during the distributions and leveraging the high dimensionality of Hilbert
optimization process, making it crucial to analyze how space, where classical data must be embedded.
different errors impact their effectiveness. One prevalent type
of noise is stochastic noise, which arises during the
optimization process. However, the saddle points11, where the
first derivative is zero but the hessian12 matrix has eigenvalues
of different signs, pose challenges. To mitigate the risk of
being trapped in saddle points, methods like the SGD have
been proposed, which introduces stochastic variables into the Fig. 1. QPE comparison between a ideal device and an noisy device
update rule. Measurement noise is inherent in VQCs,
particularly during the estimation of derivatives. This noise However, in Fig. 2, classical data is encoded into a quantum
arises due to the stochastic nature of quantum measurement. circuit using different methods known as ansatzes16. These
By considering the difference between the actual derivative include amplitude embedding, assigning data values to qubit
and the estimation, a SGD algorithm naturally emerges, amplitudes; basis embedding, suitable for binary data mapped
without the need for additional random variables. VQCs to qubits in 𝜎 base; and angle embedding, applying rotation
exhibit robustness against certain types of noise, such as bit matrices to encode data phases. Choosing the optimal ansatz is
flip-like and phase flip-like errors, as discussed in [28]. These actively researched due to their distinct pros and cons. While
errors are suppressible if they preserve the circuit symmetry. amplitude embedding is straightforward, it requires careful
However, decoherent noise, like amplitude damping and selection of a small constant to ensure non-zero amplitudes for
depolarizing channels, remains a significant challenge. zero-valued data points, and basis embedding scales
Decoherent noise can lead to difficulties in executing quantum logarithmically with qubit number and is limited to binary
algorithms correctly, necessitating innovative approaches to data. Angle embedding requires an additional encoding gate,
mitigate its effects. Recent studies have explored methods to increasing circuit depth. Recent studies has also explored the
protect information contained in states, offering promising inefficiency of certain ansatzes, particularly those resulting in
avenues for addressing decoherence errors in VQCs. product states like (𝑥 = (𝑥 , 𝑥 , 𝑥 ) → |𝑥 ⟩|𝑥 ⟩|𝑥 ⟩). This
underscores the importance of selecting efficient encoding
B. Quantum Neural Networks
methods for quantum data analysis.
The QNNs operates using quantum circuits, replacing
traditional neurons and layers with quantum components like
qubits and quantum gates. QNNs process both quantum and
classical data, with quantum simulation showing promise in
solving complex problems in quantum systems, such as
simulating molecular spectra or quantum dynamics. This

10 13
A method that uses the difference of circuit outputs with shifted parameters In quantum physics, representations of a system's total energy are essential
to estimate gradients in quantum circuits. for comprehending its dynamics and long-term evolution.
11 14
There are places in the optimization landscape where gradients disappear— https://qiskit.org/index.html
15
they are neither minimum nor maximum—and this presents difficulties for https://metriq.info/Method/97
16
optimization convergence. Forms or structures that are hypothesized and employed as first
12
A square matrix of second-order partial derivatives that is employed to approximations for algorithms in problem solving, especially in quantum
describe a scalar-valued function's curvature. computing.
5

been thoroughly investigated recently, both in terms of theory


and experimentation. High expressibility in describing
continuous distributions of unstructured data is provided by
VQCs. Their use as generators in the discriminator-generator
configuration of GANs is one appropriate application. Patch
GAN is the proposed approach to manage computational
resources and optimize performance (refer to Fig. 4). The
Fig. 2. Working blocks of a QNN generator in a patch GAN is made up of several subcircuits,
Recent studies have seen a surge in quantitative findings, often each of which is designed to produce a different percentage of
rooted in statistical learning theory. This field meticulously the high-dimensional data. Each subcircuit uses controlled Z
examines statistical models to quantify concepts like gates for entanglement and trainable unitary single qubit
expressibility and generalizability. Expressibility refers to a rotation gates in response to an input noise vector. Partial
model's ability to handle complex functions with limited data, measurements allow for the use of nonlinear mappings that
while generalizability involves accurately predicting unseen improve model expressibility even more. Concatenating the
data. Of particular interest is exploring the information-theory outputs of each subgenerator yields the final output, which
aspects of QNNs [32], focusing on analyzing the Fisher17 allows limited qubits to generate high-dimensional data. The
information matrix. The Fisher information matrix is a vital potential of quantum computing in generative modeling is
tool for gauging a model's trainability, often mirroring the demonstrated by this approach, which uses RY rotations and
Hessian matrix of the loss for common loss functions. By CZ entangling gates to generate images on benchmark datasets
analyzing its eigen values, researchers gain insights into loss like MNIST18 and CIFAR1019.
function behavior, enabling them to anticipate barren plateaus
that impede gradient descent optimization and lead to
suboptimal models. Recent studies [32], [33] have delved into
the effective dimension of models within their parameter
space, highlighting a positive correlation between larger
eigenvalues of the Fisher matrix and enhanced model efficacy,
particularly evident in QNNs [32]. However, viewing neural
networks through the statistical learning theory lens, they are Fig. 3. QNN Schematization
seen as statistical models describing the relationship between
data pairs (x, y), where 𝑝(𝑥, 𝑦; 𝜃) = 𝑝(𝑦 ∣ 𝑥; 𝜃)𝑝(𝑥). Here, (x)
represents input data points—features, (y) represents output
data points—labels for classification tasks or scalar values for
regression tasks, and (𝜃) denotes the empirical parameter
space. This construction explicitly accounts for a finite
number of available data points.

However, Quantum Convolutional Neural Networks (QCNNs)


have garnered interest for image processing akin to classical
CNNs, but initial studies like [34] debunk the effectiveness of
simple quantum feature maps. Subsequent efforts focus on
integrating quantum operations with convolutional layers, Fig. 4. Quantum circuit for patch quantum GAN
inspired by classical Deep Learning (DL) architectures'
modular design. This aims to create quantum computation V. RESULT ANALYSIS
modules that seamlessly merge with conventional layers, as
To illustrate the impact of using quantum computation in ML
illustrated in Fig. 3. In QCNNs, input data undergo processing
tasks, practical applications on real-world tasks are essential.
through VQCs, potentially outperforming classical kernels.
Quantum measurement aids in extracting pixel values and acts Among various fields of computer science, computer vision
as a nonlinear activation function. Despite challenges, various stands out as one heavily reliant on ML techniques,
QCNN approaches show promise. A compelling solution is particularly in recent years, thanks to advancements in
the data re-uploading scheme—streamlining circuit computational hardware and the refinement of DL models.
components and enhancing efficiency. Its non-linear mapping The complexity of computer vision tasks arises from the high-
from input to Hilbert space aligns with the universal dimensional nature of image data, where even a simple RGB
approximation theorem, showcasing potential. Flexibility with image with N by N pixels translates into a tensor of
multiple qubits enhances model expressibility. The scheme dimensions 3N². This complexity drives continuous efforts to
presents a promising avenue for advancing QCNNs, enhance both computational power and algorithmic efficiency,
addressing both theoretical and practical aspects effectively. making the integration of quantum computation into computer
Similarly, the potential of VQCs as generative models has

17 18
A matrix that shows the likelihood function's curvature in a statistical http://yann.lecun.com/exdb/mnist/
19
model, which is important for estimating parameters. https://www.cs.toronto.edu/~kriz/cifar.html
6

vision a promising prospect for the future. In adapting quantum circuit, specifically assessing how classification
quantum ML algorithms, as discussed in Section 4, for accuracy is affected by varying amplitude damping
computer vision tasks, adjustments are required, particularly parameters. The impact of amplitude damping noise on the
concerning the data reuploading scheme. While classical effectiveness of quantum circuits has been observed to be
CNNs process data locally, preserving spatial characteristics quite significant. It's crucial to demonstrate the resilience of
through convolutions, the data reuploading approach is specific algorithms, even when faced with minor instances of
amplitude damping, as this is essential in the quest for
tailored to handle localized segments of input data. The
quantum advantage. To thoroughly analyze the ideal system,
application of quantum ML in computer vision encompasses
numerical simulations of quantum circuits were conducted.
two primary areas—image generation and image These simulations allowed us to focus solely on the effects of
classification. For image generation tasks, the effectiveness of amplitude damping noise. This noise was introduced as a
the patch GAN architecture will be demonstrated using quantum operation, following Kraus operators, at the
standard computer vision benchmark datasets, including conclusion of each quantum circuit within the neural network,
MNIST, Fashion MNIST20, and CIFAR10. Furthermore, as illustrated in Fig. 5. Fig. 6(a) demonstrates that the
beyond these standardized datasets, real-world challenges will inclusion of more reuploading layers indeed enhances
be addressed, such as the identification of Parkinson's disease performance, reinforcing the effectiveness of the reuploading
through the analysis of Positron Emission Tomography (PET) technique. Furthermore, Fig. 6(b) illustrates the pivotal role
scan brain images [35]. The focus of this study lies in the played by the number of qubits in the quantum circuit's
thorough analysis of an algorithm, with particular attention performance. It highlights how a quantum circuit with
paid to its performance and scalability. Additionally, the multiple qubits, entangled together, offers greater flexibility in
terms of the functions it can accommodate.
impact of noise on the outcomes will be carefully addressed.
Subsequently, the results derived from the aforementioned
architectures will be presented and juxtaposed against those
obtained from classical neural networks possessing a
comparable number of parameters.

A. Image Classification
To align with CNNs, the approach of data reuploading ansatz
has undergone adaptation. Instead of processing the entire
image within the quantum circuit, which is computationally
inefficient and time-consuming, a method akin to classical
practices has been adopted. This involves applying a sliding
window technique to the image. Rather than conducting Fig. 5. The performance analysis in the presence of amplitude damping noise
convolution between the pixels under the window and the was conducted using QNN
neural network's kernel, the pixel values within the window
are inputted to the quantum circuit. The quantum circuit
functions as a quantum kernel, following a similar framework
as elucidated in [31]. The development of the QNNs—aims
for seamless integration into the TensorFlow framework.
These are implemented as callable Python classes, facilitated
by the TensorFlow-Quantum21 and Cirq22 libraries.
Importantly, all quantum layers are compatible with the
classical pipeline of standard DL models, ensuring full
interoperability with other layers present in the library. We
investigate the scalability of the data reuploading scheme
through adjustments in the number of layers and qubits.
Utilizing the MNIST dataset, a compact QNNs architecture
comprising two convolutional layers with an intermediate
maxpool operation, followed by a fully connected classical
softmax output layer, is evaluated to gauge its practicality. We
focus on examining how changes in classification accuracy
correlate with variations in the number of reuploading layers
within each convolutional layer and the number of qubits
employed in the quantum circuit. Furthermore, we conduct
additional tests to explore the impact of noise within the

20
https://www.kaggle.com/datasets/zalando-research/fashionmnist
21
https://www.tensorflow.org/quantum
22
https://quantumai.google/cirq
7

Fig. 6. Reuploading image classifier accuracy on the MNIST dataset with


different reuploading layers/qubits compared to a constant number of
layers/qubits
In this, the focus is on exploring the performance of QNNs in
classifying various benchmark datasets. Specifically, the
analysis involves comparing the QNN with classical CNN
across different datasets such as MNIST, Fashion MNIST,
CIFAR10, and brain PET images (CDOPA). The MNIST
dataset comprises grayscale images depicting digits from 0 to
9, Fashion MNIST features clothing items, CIFAR10 consists
of RGB images depicting various objects and animals, while
CDOPA involves binary classification of PET brain images
for diagnosing Parkinson's disease. For each dataset, the QNN
is trained using an ideal simulator, a noisy simulator Fig. 9. When faced with a classical classifier, a quantum classifier trained on
genuine quantum devices using MNIST datasets
introducing bit and phase flip errors, and a real quantum TABLE I
computer, namely Google’s IonQ Harmony23. The test DETAILS OF THE COMPARISON BETWEEN THE CLASSICAL CNN
accuracy and training-validation curves are analyzed and AND THE QUANTUM QCNN FOR MNIST DATASET
presented in Figs. 7, 8, and 9. The architecture of the neural Mode Paramet Learni Qubi Reupload Flip Test
ls ers ng ts ing Paramet accura
networks, including the number of trainable parameters and Rate Layers ers cy
hyperparameters, is detailed in Table I. CNN ≈2900 10 - - 0.76

QCN ≈2800 10 5 5 - 0.82


N
(ideal
)
QCN ≈2800 10 5 5 0.1 0.80
N
(noisy
)
QCN ≈2800 10 5 5 0.1 0.81
N
(real)

Results indicate that the QNN outperforms the classical CNN


Fig. 7. Comparing a quantum classifier with an ideal simulator on the MNIST
in terms of accuracy and convergence time across all datasets.
dataset against a classical classifier Notably, despite the increased complexity of the Fashion
MNIST (refer to Figs. 10, 11, and 12) and CIFAR10 (refer to
Figs. 13, 14, and 15) dataset, the QNN demonstrates
advantages over the CNN, particularly in loss descent and
overall accuracy. The hybrid approach, integrating classical
TensorFlow convolutional layers with quantum layers, is
employed for CDOPA due to its high-dimensional nature in
Figs. 16, 17, and 18.

Fig. 8. Using the MNIST dataset, a quantum classifier with bit and phase flip
errors is compared against a classical classifier

Fig. 10. Comparing a quantum classifier with an ideal simulator on the


Fashion MNIST dataset against a classical classifier

23
https://ionq.com/quantum-systems/harmony
8

Fig. 11. Using the Fashion MNIST dataset, a quantum classifier with bit and Fig. 15. When faced with a classical classifier, a quantum classifier trained on
phase flip errors is compared against a classical classifier genuine quantum devices using CIFAR10 datasets

Fig. 12. When faced with a classical classifier, a quantum classifier trained on Fig. 16. Comparing a quantum classifier with an ideal simulator on the
genuine quantum devices using Fashion MNIST datasets CDOPA dataset against a classical classifier

Fig. 13. Comparing a quantum classifier with an ideal simulator on the Fig. 17. Using the CDOPA dataset, a quantum classifier with bit and phase
CIFAR10 dataset against a classical classifier flip errors is compared against a classical classifier

Fig. 14. Using the CIFAR10 dataset, a quantum classifier with bit and phase
flip errors is compared against a classical classifier Fig. 18. When faced with a classical classifier, a quantum classifier trained on
genuine quantum devices using CDOPA datasets

B. Image Generation
As the exploration advances in quantum ML, another
significant challenge in computer vision arises—image
9

generation. This section presents findings obtained through the compatibility and ease of use within the research framework.
utilization of the patch GAN algorithm. Notably, the study For the three datasets, the patch GAN has effectively
employs three renowned computer vision benchmark replicated the images to the same standard as conventional
datasets—MNIST, Fashion MNIST, and CIFAR10. The classical generative models. Observing the results, it's evident
experimental setup comprises a discriminator-generator that the quantum generative model exhibits comparable
framework, featuring a conventional fully-connected performance in reproducing both greyscale and RGB images
discriminator paired with both classical and quantum without any anomalies during training. Specifically, the
generator models. The classical generator model adheres to a discriminator loss stabilizes at 0.5 (illustrated by the blue
standard conditional convolutional generative network, curves), indicating random guessing of generated image
whereas the quantum patch architecture is adapted to authenticity, while the quantum generator loss steadily
incorporate class labels, facilitating the generation of class- decreases with each training step. The classical discriminator
specific images. Due to the inherently qualitative nature of architecture comprises a Multi-layer Perceptron (MLP) with
image generation tasks, human evaluation remains pivotal. A two hidden layers, consisting of 64 and 32 nodes, respectively.
comparative analysis among original images, classical GAN- Both the generator's and discriminator's optimizers were
generated images, and quantum GAN-generated images is configured with a learning rate of 2 x 10-4. In comparison, the
conducted to gauge the quantum model's efficacy. classical generator utilized is a standard convolutional model
Furthermore, the training dynamics, inferred from the featuring two transposed convolution layers. Commencing
discriminator's loss value, are visualized as shown in Figs. 19, from a latent space of dimension 50, this generator outputs the
20, and 21. image, encompassing approximately 10,000 parameters.
Conversely, for the quantum model, the considerably fewer
qubits required result in a total trainable parameter count of
approximately 4,500, encompassing 14 distinct sub-
generators' circuits. Thus, despite a smaller quantity of
trainable parameters, the quantum model demonstrates
performance comparable to its classical counterpart.

VI. CONCLUSION AND FUTURE WORKS


This study suggests that quantum computation holds promise
Fig. 19. Loss vs iteration steps of discriminator (blue) vs quantum generative for advancing ML, extending its applicability beyond physical
(orange) model for MNIST dataset research domains. Notably, experiments demonstrate that our
image classifier achieves performance levels comparable to, if
not surpassing, those of conventional classical architectures.
Furthermore, our image generator faithfully reproduces
benchmark datasets for image generation tasks. The utilization
of simple yet hybrid VQCs has proven effective in mitigating
bit and phase flip-like noise, particularly in low
concentrations. However, it has become evident that amplitude
damping errors significantly impede the performance of
quantum algorithms. Given the current limitations of quantum
devices, hybrid algorithms that leverage both quantum and
Fig. 20. Loss vs iteration steps of discriminator (blue) vs quantum generative classical computation present an intriguing avenue for
(orange) model for Fashion MNIST dataset
exploration, potentially leading to quantum advantage. Future
research should focus on refining embedding ansatzes, which
play a crucial role in determining the feasibility of achieving
quantum advantage. Moreover, the accessibility of quantum
computers is paramount for assessing algorithm performance.
As circuit complexity increases, simulators face exponential
slowdowns, rendering even simple algorithms infeasible to
execute. Real quantum computers offer the opportunity to
evaluate algorithm performance authentically, circumventing
the challenges posed by simulated noise. Addressing the
Fig. 21. Loss vs iteration steps of discriminator (blue) vs quantum generative computational demands of QNNs training requires innovative
(orange) model for CIFAR10 dataset solutions. Libraries facilitating multiple executions of QNNs
Similar to the development of the quantum classifier, the on the same quantum device are urgently needed, mirroring
quantum generative model is seamlessly integrated into the the efficiency of classical neural network training routines.
PyTorch DL framework. Implemented as Python classes Ultimately, realizing a genuine quantum advantage may
leveraging the Pennylane24 library, this integration ensures necessitate the complete implementation of QNNs as quantum
algorithms. However, the current generation of NISQ imposes
constraints, requiring classical optimization routines and
24
https://pennylane.ai/
10

lacking the capacity for parallelized computations within large Accessed: Feb. 04, 2024. [Online]. Available:
https://arxiv.org/abs/2401.15715v1
quantum circuits, thereby limiting the exploitation of quantum
[14] V. K. Kanaparthi, “Examining the Plausible Applications of
superposition and entanglement. Artificial Intelligence & Machine Learning in Accounts Payable
Improvement,” FinTech, vol. 2, no. 3, pp. 461–474, Jul. 2023, doi:
VII. DECLARATIONS 10.3390/fintech2030026.
[15] G. S. Kashyap, A. E. I. Brownlee, O. C. Phukan, K. Malik, and S.
A. Funding: No funds, grants, or other support was received. Wazir, “Roulette-Wheel Selection-Based PSO Algorithm for
Solving the Vehicle Routing Problem with Time Windows,” Jun.
B. Conflict of Interest: The authors declare that they have no 2023, Accessed: Jul. 04, 2023. [Online]. Available:
known competing for financial interests or personal https://arxiv.org/abs/2306.02308v1
[16] H. Habib, G. S. Kashyap, N. Tabassum, and T. Nafis, “Stock Price
relationships that could have appeared to influence the work Prediction Using Artificial Intelligence Based on LSTM– Deep
reported in this paper. Learning Model,” in Artificial Intelligence & Blockchain in Cyber
Physical Systems: Technologies & Applications, CRC Press, 2023,
C. Data Availability: Data will be made on reasonable pp. 93–99. doi: 10.1201/9781003190301-6.
request. [17] P. Kaur, G. S. Kashyap, A. Kumar, M. T. Nafis, S. Kumar, and V.
Shokeen, “From Text to Transformation: A Comprehensive Review
D. Code Availability: Code will be made on reasonable of Large Language Models’ Versatility,” Feb. 2024, Accessed: Mar.
request. 21, 2024. [Online]. Available: https://arxiv.org/abs/2402.16142v1
[18] S. Wazir, G. S. Kashyap, K. Malik, and A. E. I. Brownlee,
REFERENCES “Predicting the Infection Level of COVID-19 Virus Using Normal
Distribution-Based Approximation Model and PSO,” Springer,
Cham, 2023, pp. 75–91. doi: 10.1007/978-3-031-33183-1_5.
[1] V. Kanaparthi, “Evaluating Financial Risk in the Transition from [19] S. Naz and G. S. Kashyap, “Enhancing the predictive capability of a
EONIA to ESTER: A TimeGAN Approach with Enhanced VaR mathematical model for pseudomonas aeruginosa through artificial
Estimations,” Jan. 2024, doi: 10.21203/RS.3.RS-3906541/V1. neural networks,” International Journal of Information Technology
[2] V. K. Kanaparthi, “Navigating Uncertainty: Enhancing Markowitz 2024, pp. 1–10, Feb. 2024, doi: 10.1007/S41870-023-01721-W.
Asset Allocation Strategies through Out-of-Sample Analysis,” Dec. [20] S. Wazir, G. S. Kashyap, and P. Saxena, “MLOps: A Review,” Aug.
2023, doi: 10.20944/PREPRINTS202312.0427.V1. 2023, Accessed: Sep. 16, 2023. [Online]. Available:
[3] V. Kanaparthi, “Transformational application of Artificial https://arxiv.org/abs/2308.10908v1
Intelligence and Machine learning in Financial Technologies and [21] G. S. Kashyap, K. Malik, S. Wazir, and R. Khan, “Using Machine
Financial services: A bibliometric review,” Jan. 2024, doi: Learning to Quantify the Multimedia Risk Due to Fuzzing,”
10.1016/j.jbusres.2020.10.012. Multimedia Tools and Applications, vol. 81, no. 25, pp. 36685–
[4] V. Kanaparthi, “Robustness Evaluation of LSTM-based Deep 36698, Oct. 2022, doi: 10.1007/s11042-021-11558-9.
Learning Models for Bitcoin Price Prediction in the Presence of [22] G. S. Kashyap et al., “Detection of a facemask in real-time using
Random Disturbances,” Jan. 2024, doi: 10.21203/RS.3.RS- deep learning methods: Prevention of Covid 19,” Jan. 2024,
3906529/V1. Accessed: Feb. 04, 2024. [Online]. Available:
[5] V. Kanaparthi, “Credit Risk Prediction using Ensemble Machine https://arxiv.org/abs/2401.15675v1
Learning Algorithms,” in 6th International Conference on Inventive [23] M. Kanojia, P. Kamani, G. S. Kashyap, S. Naz, S. Wazir, and A.
Computation Technologies, ICICT 2023 - Proceedings, 2023, pp. Chauhan, “Alternative Agriculture Land-Use Transformation
41–47. doi: 10.1109/ICICT57646.2023.10134486. Pathways by Partial-Equilibrium Agricultural Sector Model: A
[6] E. H. Houssein, Z. Abohashima, M. Elhoseny, and W. M. Mathematical Approach,” Aug. 2023, Accessed: Sep. 16, 2023.
Mohamed, “Hybrid quantum-classical convolutional neural network [Online]. Available: https://arxiv.org/abs/2308.11632v1
model for COVID-19 prediction using chest X-ray images,” Journal [24] G. S. Kashyap, A. Siddiqui, R. Siddiqui, K. Malik, S. Wazir, and A.
of Computational Design and Engineering, vol. 9, no. 2, pp. 343– E. I. Brownlee, “Prediction of Suicidal Risk Using Machine
363, Apr. 2022, doi: 10.1093/JCDE/QWAC003. Learning Models.” Dec. 25, 2021. Accessed: Feb. 04, 2024.
[7] C. H. H. Yang et al., “Decentralizing feature extraction with [Online]. Available: https://papers.ssrn.com/abstract=4709789
quantum convolutional neural network for automatic speech [25] G. S. Kashyap, D. Mahajan, O. C. Phukan, A. Kumar, A. E. I.
recognition,” in ICASSP, IEEE International Conference on Brownlee, and J. Gao, “From Simulations to Reality: Enhancing
Acoustics, Speech and Signal Processing - Proceedings, 2021, vol. Multi-Robot Exploration for Urban Search and Rescue,” Nov. 2023,
2021-June, pp. 6523–6527. doi: Accessed: Dec. 03, 2023. [Online]. Available:
10.1109/ICASSP39728.2021.9413453. https://arxiv.org/abs/2311.16958v1
[8] S. Y. C. Chen, S. Yoo, and Y. L. L. Fang, “QUANTUM LONG [26] G. S. Kashyap et al., “Revolutionizing Agriculture: A
SHORT-TERM MEMORY,” in ICASSP, IEEE International Comprehensive Review of Artificial Intelligence Techniques in
Conference on Acoustics, Speech and Signal Processing - Farming,” Feb. 2024, doi: 10.21203/RS.3.RS-3984385/V1.
Proceedings, 2022, vol. 2022-May, pp. 8622–8626. doi: [27] N. Marwah, V. K. Singh, G. S. Kashyap, and S. Wazir, “An analysis
10.1109/ICASSP43922.2022.9747369. of the robustness of UAV agriculture field coverage using multi-
[9] D. Herr, B. Obert, and M. Rosenkranz, “Anomaly detection with agent reinforcement learning,” International Journal of Information
variational quantum generative adversarial networks,” Quantum Technology (Singapore), vol. 15, no. 4, pp. 2317–2327, May 2023,
Science and Technology, vol. 6, no. 4. IOP Publishing, p. 045004, doi: 10.1007/s41870-023-01264-0.
Jul. 09, 2021. doi: 10.1088/2058-9565/ac0d4d. [28] J. R. McClean, J. Romero, R. Babbush, and A. Aspuru-Guzik, “The
[10] H. Situ, T. Lu, M. Pan, and L. Li, “Quantum continual learning of theory of variational hybrid quantum-classical algorithms,” New
quantum data realizing knowledge backward transfer,” Physica A: Journal of Physics, vol. 18, no. 2, p. 023023, Feb. 2016, doi:
Statistical Mechanics and its Applications, vol. 620, p. 128779, Jun. 10.1088/1367-2630/18/2/023023.
2023, doi: 10.1016/j.physa.2023.128779. [29] I. Kassal, J. D. Whitfield, A. Perdomo-Ortiz, M. H. Yung, and A.
[11] V. Kanaparthi, “Examining Natural Language Processing Aspuru-Guzik, “Simulating chemistry using quantum computers,”
Techniques in the Education and Healthcare Fields,” International Annual Review of Physical Chemistry, vol. 62, no. Volume 62,
Journal of Engineering and Advanced Technology, vol. 12, no. 2, 2011, pp. 185–207, May 2011, doi: 10.1146/annurev-physchem-
pp. 8–18, Dec. 2022, doi: 10.35940/ijeat.b3861.1212222. 032210-103512.
[12] V. Kanaparthi, “AI-based Personalization and Trust in Digital [30] E. Farhi and H. Neven, “Classification with Quantum Neural
Finance,” Jan. 2024, Accessed: Feb. 04, 2024. [Online]. Available: Networks on Near Term Processors,” Feb. 2018, Accessed: Mar. 30,
https://arxiv.org/abs/2401.15700v1 2024. [Online]. Available: https://arxiv.org/abs/1802.06002v2
[13] V. Kanaparthi, “Exploring the Impact of Blockchain, AI, and ML on [31] V. Havlíček et al., “Supervised learning with quantum-enhanced
Financial Accounting Efficiency and Transformation,” Jan. 2024, feature spaces,” Nature, vol. 567, no. 7747, pp. 209–212, Mar.
11

2019, doi: 10.1038/s41586-019-0980-2.


[32] A. Abbas, D. Sutter, C. Zoufal, A. Lucchi, A. Figalli, and S.
Woerner, “The power of quantum neural networks,” Nature
Computational Science, vol. 1, no. 6, pp. 403–409, Jun. 2021, doi:
10.1038/s43588-021-00084-1.
[33] O. Berezniuk, A. Figalli, R. Ghigliazza, and K. Musaelian, “A scale-
dependent notion of effective dimension,” Jan. 2020, Accessed:
Mar. 30, 2024. [Online]. Available:
https://arxiv.org/abs/2001.10872v1
[34] M. Henderson, S. Shakya, S. Pradhan, and T. Cook,
“Quanvolutional neural networks: powering image recognition with
quantum circuits,” Quantum Machine Intelligence, vol. 2, no. 1,
Apr. 2020, doi: 10.1007/s42484-020-00012-y.
[35] A. Piccardo et al., “The role of the deep convolutional neural
network as an aid to interpreting brain [18F]DOPA PET/CT in the
diagnosis of Parkinson’s disease,” European Radiology, vol. 31, no.
9, pp. 7003–7011, Sep. 2021, doi: 10.1007/s00330-021-07779-z.

You might also like