Quantum machine learning is a new field of study that aims to apply the advantages of quantum computing, such as superposition, which is one of the intriguing properties that could speed up computation, to machine learning. Like classical machine learning models, quantum machine learning models can learn from specific input data and perform specific prediction tasks. However, quantum machine learning models are currently in the form of quantum circuits with parameterizable gates. In this paper, the implementation of a quantum classification model is investigated using the two most well-known quantum machine learning development tools: Cirq with TensorFlow Quantum (TFQ) and Qiskit with PyTorch. The quantum classification circuit is trained to recognize images of handwritten digits using the MNIST dataset. However, because the quantum computer is still in development and is difficult to access and use, quantum simulators are the best alternative for the time being. The performance of the quantum classification model implemented by the two development tools is then compared in this paper experimentally using quantum simulators on two different hardware configurations. In addition, the experimental setups differ in the number of input qubits used to store the image’s classical pixel values. Finally, the wall time and CPU time used to run the training process, as well as classification accuracy, are examined. In terms of accuracy, Qiskit with PyTorch outperforms Cirq with TFQ only in the lower number of qubits but the results are similar in the higher number of qubits. The experiment results in terms of run-time are highly different. From the result, we find that Cirq is noticeably faster than Qiskit in every experiment by at least 90 times.
Quantum machine learning is a new field of study that aims to apply the advantages of quantum computing, such as superposition, which is one of the intriguing properties that could speed up computation, to machine learning. Like classical machine learning models, quantum machine learning models can learn from specific input data and perform specific prediction tasks. However, quantum machine learning models are currently in the form of quantum circuits with parameterizable gates. In this paper, the implementation of a quantum classification model is investigated using the two most well-known quantum machine learning development tools: Cirq with TensorFlow Quantum (TFQ) and Qiskit with PyTorch. The quantum classification circuit is trained to recognize images of handwritten digits using the MNIST dataset. However, because the quantum computer is still in development and is difficult to access and use, quantum simulators are the best alternative for the time being. The performance of the quantum classification model implemented by the two development tools is then compared in this paper experimentally using quantum simulators on two different hardware configurations. In addition, the experimental setups differ in the number of input qubits used to store the image’s classical pixel values. Finally, the wall time and CPU time used to run the training process, as well as classification accuracy, are examined. In terms of accuracy, Qiskit with PyTorch outperforms Cirq with TFQ only in the lower number of qubits but the results are similar in the higher number of qubits. The experiment results in terms of run-time are highly different. From the result, we find that Cirq is noticeably faster than Qiskit in every experiment by at least 90 times.
Nowadays, using machine learning for image classification is very common. However, due to the increasing demand for data processing and fast computing, the idea of enhancing machine learning with quantum computing has been proposed, known as quantum machine learning (QML). Quantum machine learning has the advantages of higher efficiency and accuracy. Quantum computing uses quantum bits (qubits) for data storage and computing, where a qubit can represent quantum states |0〉and |1〉simultaneously, enabling the processing of information for two states simultaneously, which is unparalleled in classical computing. Moreover, quantum machine learning can handle more complex data and process data faster. In classical machine learning, the processing of large-scale data and complex problems often faces problems of high computational complexity and low algorithm efficiency. Quantum computing can handle multiple computing tasks simultaneously, achieving faster computing. Therefore, in some scenarios that require efficient computing, quantum machine learning may be the best choice. In this study, we simulated quantum circuits using Qiskit and built a hybrid quantum-classical neural network model using VQNet to classify MNIST handwritten digits and CIFAR-10 datasets. The experiments showed that quantum machine learning has the advantages of efficiency, accuracy, and security over classical machine learning, which may be an improvement over classical machine learning. This research proposes a machine learning algorithm based on quantum computing, which promotes the development of quantum computing and quantum technology. At the same time, it provides a new solution and idea for image classification, enabling people to pursue faster and more accurate quantum machine learning instead of being limited to classical machine learning.[1]
Quantum Computer is a computer machine using principles of quantum mechanics in doing its computation. The Quantum Computer Machine itself is still in the development stage and has not been deployed yet, however TensorFlow provides a library for hybrid quantum-classical machine learning called TensorFlow Quantum (TFQ). One of the quantum computing models is the Quantum Neural Network (QNN). QNN is adapted from classical neural networks capable of processing qubit data and passing quantum circuits. QNN is a machine learning model that allows quantum computers to classify image data. The image data used is classical data, but classical data cannot reach a superposition state. So in order to carry out this protocol, the data must be readable into a quantum device that provides superposition. QNN uses a supervised learning method to predict image data. Quantum Neural Network (QNN) with a supervised learning method for classifying handwritten numeric image data is implemented using a quantum computer circuit simulation using the Python 3.6 programming language. The quantum computer circuit simulation is designed using library Cirq and TFQ. The classification process is carried out on Google Colab. The results of training on the QNN model obtained a value of 0.337 for the loss value and 0.3427 for the validation loss value. Meanwhile, the hinge accuracy value from the training results is 0.8603 for the hinge accuracy value with training data and 0.8669 for the hinge accuracy validation value. Model testing is done by providing 100 handwritten number images that are tested, with 53 image data of number three and 47 image data of number six. The results obtained for the percentage of testing accuracy are 100% for the number three image and 100% for the number six image. Thus, the total percentage of testing is 100%.
Quantum computers might be more potent than the normal classical computers and Supercomputers.Some of the specific applications like Quantum simulation, Cryptography, Optimization etc. Normal classical computers are worked based on the binary system (0,1) Whereas in the Quantum computers are worked as Quantum bit also termed as Qubit.Quantum computers use qubit, which can represent 0, 1, or any superposition of these states.This property enables quantum computers to process information in unique ways.The Qubit state can be 0&1 at the same time.When we observe that it can collapses into one of the possible states.We propose to implement the predictive capability of the Quantum Machine Learning (QML) classifier on the MNIST Handwritten Digits dataset.We deploy the model on the IBM Quantum computer using Qiskit.
Quantum machine learning (QML) has emerged as a promising field, combining the power of quantum computing with classical machine learning techniques to solve complex computational tasks. As the demand for efficient quantum simulations grows, multiple QML frameworks, including PennyLane, Qiskit, and TensorFlow Quantum (TFQ), have been developed to facilitate hybrid quantum-classical computations. This study aims to evaluate and compare the performance of three leading QML frameworks PennyLane, Qiskit, and TensorFlow Quantum in simulating quantum machine learning models, focusing on accuracy, execution time, and noise tolerance. The study examined three leading quantum machine learning (QML) frameworks PennyLane (v0.24), Qiskit (v0.43.2), and TensorFlow Quantum (TFQ, v0.7) each tested on a 64-bit Ubuntu Linux system with an Intel Core i7 processor, 32 GB RAM, and NVIDIA GeForce RTX 3080 GPU. Quantum algorithms like variational quantum circuits (VQCs) and quantum support vector machines (QSVMs) were simulated using these frameworks. Various quantum gates, including Pauli-X, Y, Z, Hadamard, CNOT, and Rotation gates (Rx, Ry, Rz), were used for parameter optimization and quantum superposition. The Iris and MNIST datasets were adapted for quantum encoding using Amplitude and Angle Encoding for binary classification tasks. Simulations were run on classical computers, while select circuits were executed on IBM Quantum’s Falcon r5.11 processor to compare hardware performance. PennyLane achieved the highest accuracy (92%) in quantum simulations, excelling in hybrid quantum-classical model integration. TensorFlow Quantum provided the fastest execution time, especially in classical simulations, making it suitable for rapid prototyping. Qiskit produced deeper quantum circuits but had higher error rates (6%) on real quantum hardware, highlighting noise and decoherence effects. The VQC models optimized by stochastic gradient descent (SGD) showed significant improvements in model performance, and QSVMs effectively classified both linearly separable and non-separable datasets, demonstrating the potential of quantum algorithms over classical approaches. Statistical analysis confirmed the significance of the results (p < 0.05). PennyLane is the most robust framework for hybrid quantum-classical models, while TensorFlow Quantum is suited for rapid prototyping. Qiskit, despite longer execution times, excels in hardware implementation. The choice of framework should align with the specific needs of quantum machine learning tasks.
In this work, we investigate the use of a quantum circuit as a binary classification model in the context of quantum machine learning. We call this model, binary quantum classifier.
First, we describe fundamental concepts of quantum computing and introduce the computational tool used: Qibo, an open-source framework for efficient quantum simulations and quantum hardware control. Then, we describe how to design a binary quantum classifier for the classification of images and small arrays of variables by showing how to input data in the circuit, defining a quantum circuit model Ansatz with trainable parameters and a loss function, and implementing multiple minimizers. We test our quantum classifier with two data sets. The first one is the MNIST data set which is composed of handwritten digits (reduced to only handwritten zeros and handwritten ones for binary classification). We study the behavior of different minimizers by increasing the number of layers of the Ansatz. The second data set represents two different high energy collisions that can occur at colliders such as LHC (CERN). Due to in-time proton-proton interactions known as pile-up, we distinguish two different data sets: "without pile-up" and "with pile-up". These collisions can be represented by images of size 32x32 or by six high-level variables that we call features. By increasing the size of the training data set and the number of layers of the Ansatz, we search for the best minimizer. Splitting the data set in training set and test set, we compute: ROC curve, AUC score, confusion matrices and test set accuracy. For "with pile-up" images, we compare the results obtained with the quantum classifier with a small convolutional neural network.
We conclude that is possible to build a binary quantum classifier with a quantum circuit and we highlight its performances and limitations in comparison with classical technologies.
Abstract Image classification, a pivotal task in multiple industries, faces computational challenges due to the burgeoning volume of visual data. This research addresses these challenges by introducing two quantum machine learning models that leverage the principles of quantum mechanics for effective computations. Our first model, a hybrid quantum neural network with parallel quantum circuits, enables the execution of computations even in the noisy intermediate-scale quantum era, where circuits with a large number of qubits are currently infeasible. This model demonstrated a record-breaking classification accuracy of 99.21% on the full MNIST dataset, surpassing the performance of known quantum–classical models, while having eight times fewer parameters than its classical counterpart. Also, the results of testing this hybrid model on a Medical MNIST (classification accuracy over 99%), and on CIFAR-10 (classification accuracy over 82%), can serve as evidence of the generalizability of the model and highlights the efficiency of quantum layers in distinguishing common features of input data. Our second model introduces a hybrid quantum neural network with a Quanvolutional layer, reducing image resolution via a convolution process. The model matches the performance of its classical counterpart, having four times fewer trainable parameters, and outperforms a classical model with equal weight parameters. These models represent advancements in quantum machine learning research and illuminate the path towards more accurate image classification systems.