Professional Documents
Culture Documents
https://doi.org/10.22214/ijraset.2022.46914
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
Abstract: Deep learning algorithms have shown promising results for different image processing tasks, particularly in remote sensing
& image recognition. Till now many studies have been carried out on image processing, which brings a new paradigm of innovative
capabilities under the umbrella of intelligent remote sensing and computer vision. Accordingly, quantum processing algorithms have
proved to efficiently solve some issues that are undetectable to classical algorithms and processors. Keeping that in mind, a Quantum
Convolutional Neural Network (QCNN) architecture along with Hybrid Quantum filters would be utilized supported by cloud
computing infrastructures and data centers to provide a broad range of complex AI services and high data availability.
This research summaries the conventional techniques of Classical and Quantum Deep Learning and it’s research progress on real-
world problems in remote sensing image processing as a comparative demonstration. Last but not least, we evaluate our system by
training on Street View House Numbers datasets in order to highlight the feasibility and effectiveness of using Quantum Deep
Learning approach in image recognition and other similar applications. Upcoming challenges and future research areas on this
spectrum are also discussed.
Keywords: Deep Learning, Quantum Convolutional Neural Network (QCNN), Quantum Computing, Hybrid Quantum-CNN
I. INTRODUCTION / OBJECTIVE
Objective of the project is to:
1) Make use of Quantum Computing and Deep Learning - CNN to develop a more efficient and outperforming technique that can be
applied to solve complex machine learning tasks like digit recognition from high resolution images taken from a distance to identify
addresses of congested households too many at a time
2) Use superposition and entanglement theories, which are not seen in traditional computing environments, to achieve high
performance through qubit parallelism. Here qubit is referred to as the quantum bit which is basically a unit of quantum information.
3) Extend the key features and structures of existing CNN to quantum systems defined in the many-body Hilbert space is transferred to
a classical computing environment, the data size grows exponentially in proportion to the system size, making it unsuitable for
efficient solutions. Because data in a quantum environment can be expressed using qubits, the problem can be avoided by applying a
CNN structure to a quantum system
1) The first part of the solution to be introduced proposes a model to effectively solve the classification problem using classical Deep
Learning by applying the structure of CNN to the classical convolution environment.
2) The second part introduces a method to check whether the algorithm could be performed by adding a layer using Quantum
Computing to the CNN learning model used in the existing computer vision. Hybrid Quantum filters can be introduced to optimize
model accuracy and loss.
This model can also be used in small quantum computers, and a hybrid learning model can be designed by adding a quantum convolution
layer to the CNN model or replacing it with a convolution layer. If successful, this solution could be applied on UAV’s or Quantum
Drones (QD) by building an Internet of Quantum Drones (IoQD) network to effectively process high resolution images of house
addresses to recognize digits from the later to enhance commercial activities like smart delivery hence making it unique.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1720
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
V. IMPLEMENTATION
A. Technology Stack Used – Resources
1) Code repository will contain implementation of Quantum Neural Network as well as Classical Convolutional Neural Network
for Classification Task on Street View House Numbers dataset.
2) Python 3.9
3) For the Quantum Implementation we would need:
o TensorFlow-Quantum
o Cirq
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1721
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
C. Workflow Operations
1) Classical Deep Learning with TensorFlow
a) Configurations/Libraries
Keras
Tensorflow
b) Preprocessing Functions
FormatArray()
fixLabel()
rgb2gray()
The above three functions formats the array in proper shape, fix the label range and convert the pixels from RGB to GrayScale
format.
2) Data Preprocessing
Let's have a look at the first image from our X_train and the corresponding label from y_train.
From the colorbar in the above visualization, we see that there are grayscale images in the dataset and hence their values range from
0 to 255. It's better to scale these pixel values in our dataset so that the values range from 0 to 1. This will help us to converge our
CNN training faster.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1722
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
Before proceeding, we need to reshape our images in the dataset to include the grayscale parameter at the end.
X_train = X_train.reshape(X_train.shape[0], *(32,32,1))
X_valid = X_valid.reshape(X_valid.shape[0], *(32,32,1))
X_test = X_test.reshape(X_test.shape[0], *(32,32,1))
The shape of the X_train is (58605, 32, 32, 1)
The shape of the X_valid is (14652, 32, 32, 1)
The shape of the X_test is (26032, 32, 32, 1)
6) Configuration Parameters
batch_size = 250
no_epochs = 150
validation_split_size = 0.20
verbosity = 1
optimizer = Adam()
loss_function = categorical_crossentropy
additional_metrics = ['accuracy']
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1723
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
9) Model Evaluation
The loss on the test set is 0.3858301639556885
The accuracy on the test set is 0.922633707523346
a) Configurations/Libraries
Cirq 0.7
Tensorflow 2.3.1
Tensorflow-quantum 0.2
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1724
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
c) Image Plot
e) Data Preprocessing:
Remove contradictions
Determine the set of labels for each unique image
Throw out images that match more than one label
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1725
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1726
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
k) Train Model
Define Hinge Accuracy
Compile qcnn_model with learning_rate=.02, loss=mse & metrics=hinge_accuracy (defined above)
Capture history of model training – qcnn_model.fit(..)
m) Model Evaluation
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1727
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1728
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
2) Model Training
3) Model Evaluation
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1729
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1730
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1731
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
Result: Hybrid CNN with Single Quantum Filter gives the best result with an accuracy of ~97%
VI. CONCLUSION
Which is better between Classical and Quantum Deep Learning for high spectral image recognition use case?
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1732
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IX Sep 2022- Available at www.ijraset.com
REFERENCES
[1] “Adiabatic quantum computation." [Online]. Available: https://en.wikipedia.org/wiki/Adiabatic quantum computation
[2] “Calculus on Computational Graphs: Backpropagation { colah's blog." [Online]. Available: http://colah.github.io/posts/2015-08-Backprop/
[3] “Classification datasets results." [Online]. Available: http://rodrigob.github.io/are we there yet/build/classification datasets results.html
[4] “Continuous-variable quantum information." [Online]. Available: https://en.wikipedia.org/wiki/Continuous-variable quantum information
[5] “Convolution as matrix multiplication." [Online]. Available: https://en.wikipedia.org/wiki/Toeplitz matrix#Discrete convolution
[6] “Convolution theorem." [Online]. Available: https://en.wikipedia.org/wiki/Convolutiontheorem
[7] “Convolutional Neural Networks (LeNet) - DeepLearning 0.1 documentation." [Online]. Available: http://deeplearning.net/tutorial/lenet.html
[8] “CS231n Convolutional Neural Networks for Visual Recognition." [Online]. Available: http://cs231n.github.io/classi cation/
[9] “CS231n Convolutional Neural Networks for Visual Recognition." [Online]. Available: http://cs231n.github.io/convolutional-networks/
[10] “CS231n Convolutional Neural Networks for Visual Recognition." [Online]. Available: http://cs231n.github.io/optimization-1/
[11] “CS231n Convolutional Neural Networks for Visual Recognition." [Online]. Available: http://cs231n.github.io/optimization-1/#numerical
[12] “CS231n Convolutional Neural Networks for Visual Recognition." [Online]. Available: http://cs231n.github.io/optimization-2/
[13] “CS231n Convolutional Neural Networks for Visual Recognition." [Online]. Available: http://cs231n.github.io/optimization-2/#mat
[14] “Deep learning book. Optimization chapter." [Online]. Available: http://www.deeplearningbook.org/contents/optimization.html
[15] “Quantum logic gate." [Online]. Available: https://en.wikipedia.org/wiki/Quantum logic gate
[16] ”Qubit." [Online]. Available: https://en.wikipedia.org/wiki/Qubit
[17] “TensorFlow clip by global norm." [Online]. Available: https://www.tensorflow.org/versions/r1.1/api docs/python/tf/clip by global norm
[18] S. Bai, J. Z. Kolter, and V. Koltun, \An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling," mar 2018. [Online].
Available: http://arxiv.org/abs/1803.01271
[19] J. S. Bergstra, R. Bardenet, Y. Bengio, and B. K egl, \Algorithms for Hyper-Parameter Optimization," in Advances in Neural Information Processing Systems, 2011,
pp. 2546{2554. [Online]. Available: http://papers.nips.cc/paper/4443-algorithms-for-hyper-parameter-optimization
[20] T. Bluche, H. Ney, and C. Kermorvant, \A Comparison of Sequence-Trained Deep Neural Networks and Recurrent Neural Networks Optical Modeling for
Handwriting Recognition," pp. 199{210, oct 2014. [Online]. Available: https://link.springer.com/chapter/10.1007/978-3-319-11397-5 15
[21] https://www.academia.edu/43006431/Effective_Handwritten_Digit_Recognition_using_Deep_Convolution_Neural_Network
[22] https://www.researchgate.net/publication/332880911_Improved_Handwritten_Digit_Recognition_using_Quantum_K-Nearest_Neighbor_Algorithm
[23] https://www.researchgate.net/publication/341179765_Hand_Written_Digit_Recognition_Using_Quantum_Support_Vector_Machine#pf5
[24] https://www.tensorflow.org/quantum/tutorials/qcnn
[25] https://jovian.ai/imammuhajir992/quantum-convolutional-neural-network
[26] https://github.com/yh08037/quantum-neural-network
[27] https://www.nature.com/articles/s41467-020-14454-2
[28] https://devblogs.microsoft.com/qsharp/hybrid-quantum-classical-
models/#:~:text=Naively%20speaking%2C%20%E2%80%9Chybrid%E2%80%9D%20means,Quantum%20Processing%20Unit%20(QPU).
[29] https://cupdf.com/document/masters-thesis-deep-learning-for-text-data-mining-.html
[30] https://www.nature.com/articles/s41567-019-0648-8
[31] https://arxiv.org/pdf/quant-ph/0504097.pdf
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1733