Skip to content

iotaisolutions/hackathon-submission

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hackathon-submission

IEEE SERVICES Hackathon 2021 Repository

QKA for QNN

Exploring Quantum Kernel Alignment Runtime for optimizing Quantum Neural Network (processing images from Surface Crack Detection dataset)

IEEE SERVICES HACKATHON 2021

Members:

  • Anuj Mehrotra,@iotaisolutions, IOTAONEIQ Solutions Pvt. Ltd. (India)
  • Vardaan Sahgal,@Vardaan Sahgal, University of Delhi (India), B.Sc. (Hons.) Physics
  • Mitesh Adake, @Mitesh, Pune Institute of Computer Technology (India), Computer Engineering
  • Vishal Sharathchandra Bajpe, @Vishal Bajpe, Sahyadri College of Engineering & Management (India), Mechanical Engineering
  • Rajatav Dutta, @Rajatav Dutta, SAP Labs (India)
  • Meghashrita Das, @Meghashrita Das,Indian institute of technology Kharagpur (India), Agricultural , Food and Financial engineering

Quantum neural networks are computational neural network models which are based on the principles of quantum mechanics and acts application-agnostic computational units that can be used for many different use cases : like Image Processing , Natural Language Processing, computer games, function approximation, handling big data, in modelling social networks, associative memory devices, and automated control systems etc.

In Quantum Machine Learning (QML), Quantum kernels is the approach of exploiting group structure in data which helps to achieve quantum speedup ( but not mandatory). Quantum kernels can be optimized with a technique called kernel alignment.

Different quantum computing methods are used to encode classical data in a quantum-enhanced feature space. For computing quantum kernels, an algorithm called Quantum kernel estimator (QKE) is used which leverages quantum circuits for classical data and provides an efficient way to evaluate inner products between data in a quantum feature space.

Quantum Neural Networks (QNN) are parameterized quantum circuits which acts like linear methods in quantum feature space and suitable case for using quantum kernels and in turn can be optimized using Quantum Kernel Alignment (QKA).

QKA is an iterative quantum-classical algorithm, in which quantum hardware is used to execute parametrized quantum circuits for evaluating the quantum kernel matrices with QKE, while a classical optimizer tunes the parameters of those circuits to maximize the alignment. Iterative algorithms of this type can be slow due to latency between the quantum and classical calculations.

Qiskit Runtime is a new architecture that can speed up iterative algorithms like QKA by co-locating classical computations with the quantum hardware executions.

In this project, in order to showcase an application of Quantum Kernel Alignment Runtime , QKA was used foroptimizing Quantum Neural Network, which processes images from Surface Crack Detection dataset (Kaggle.com) and can be scaled up & used as a module in Automated Quality Management in assembly line of Manufacturing Factory units (like of Automobile).

Technology stack

Below table covers Technology Stack for implementing this project:

Programming Language Classical (Deep) ML Framework Quantum Compluting Development Platform Simulator Additional Module Coding Collaboration Environment
Python PyTorch Qiskit IBM QASM ( With Qiskit Runtime) & AER Simulator (for local) QKA.PY from https://github.com/Qiskit-Partners/qiskit-runtime Open In Collab

Note : kaggle.json credential file is required to download Surface Crack Detection dataset from Kaglge.com

Design decisions and architecture

In order to highlight the differentiating faetures, while implementing the Quantum Kernel Alignment Runtime a compartive study was performed across 3 methodologies (mentioned below) for same problem of processing images from Surface Crack Detection dataset (Kaggle.com),

  1. Classical Convolutional Neural Networks (Surface Crack-recognition with CNN & Pytorch) : Used complete dataset of 20k postive & 20k negative images of 227 x 227 pixels along with pretrained model of resnet50.
  2. Quantum Neural Networks (Surface Crack-recognition with QNN & Pytorch): Due to Quantum Computing resource restrictions and inline with QKA methodology, considered only 100 images of 7 x 7 pixels , with single convolution layer and fully connected layer apart from Hybrid layer.
  3. Quantum Kernel Alignment Runtime for Quantum Neural Networks ( Surface Crack-recognition with QKA,QNN & Pytorch): Due to Quantum Computing resource restrictions, considered only 100 images of 7 x 7 pixels, with single convolution layer and fully connected layer apart from Hybrid layer.

The report contextualizes the project and summarizes the software design process covering below mentioned aspects:

  1. Motivation
  2. Innovation
  3. Applicability
  4. Role of Qiskit Runtime
  5. Technology stack, design decisions, and architecture.
  6. Future applications

Note By the time of final submission ( 30th Aug, 2021), we didn't received any endrosement for arXiv.org, so don't have arXiv link for our final report. Pending arXiv Endrosement