XanaduAI / QHack2021

Official repo for QHack—the quantum machine learning hackathon
https://qhack.ai
121 stars 94 forks source link

[Power Up] Performance Evaluation of Hybrid Quantum-Classical Object Detection Networks #10

Closed RKHashmani closed 3 years ago

RKHashmani commented 3 years ago

Team Name:

QuantumTunnelers

Project Description:

Our project aims to create a hybrid model of popular object detection networks. Primarily, we are focusing on RetinaNet with a MobileNet (and possibly ResNet-18) feature extraction backbone. Our goal is to introduce quantum layers and measure various performance statistics such as mean Average Precision (mAP) and the number of epochs taken to reach a comparable Loss value.

The main layer we are focusing on is the convolutional layer. Using a modification of both the original Quanvolutional layer model introduced in Henderson et al. (2019) and the demo found on PennyLane, we custom built a quantum convolutional layer that takes in any kernel size and output layer depth as parameters, automatically determines the correct number of qubits needed, and outputs the appropriate feature map using a quantum circuit as its base.

We plan to replace key convolutional layers within RetinaNet with our custom quanvolutional layer and measure the aforementioned performance statistics. We hope to see improvement within the statistics and hope to extend this project to other popular networks after this Hackathon.

Currently, we have trained and evaluated a custom-made backbone to test our quanvolutional layer due to MobileNet's architecture being too resource-consuming for our laptops. We plan to use AWS servers to properly train our hybrid backbones. For more details and information about our progress, please visit our GitHub repository.

Source code:

Our GitHub Repository: QuobileNet

Resource Estimate:

We have a hybrid model that costs too much time and resources to train on our current hardware. Therefore, we plan to train a 30 Qubit QCNN hybrid model using the Floq service. We plan to use the AWS service to test the quality of our results by comparing the inference performance of our QuobileNet with the classic RetinaNet (+ MobileNetV2 backbone) inference. The resource estimates for inference are as follows:

Inference with QCNN: Kernel Size: 3x3 Input Image: 10x10 Number of Executions per QCNN layer: (10-3+1)^2 = 64 Number of input images: 50 Cost of 30 Qubit Circuit Execution with 1000 shots (Aspen-9): 0.35+0.30 = 0.65 Cost per QCNN layer: 2080$

We can afford 2 QCNN layers that add up to 4160$ in total. We haven't used the initial 250$ credit yet, as we planned to use it for our final model. With the 4000$ bonus credit we will be able to test our model.

Good luck to everyone!

co9olguy commented 3 years ago

Thanks for the submission @RKHashmani!

Please don't forget to update your submission above with draft Source Code and Resource Estimate by 12pm EST Wed Feb 24 in order to be considered for the Power up :muscle:

cnktysz commented 3 years ago

Resource Estimate: We have a hybrid model that would cost too much time and resources to train on hardware at the moment. Therefore, we plan to train out 30 Qubit QCNN hybrid model using the Floq service. We plan to use the AWS service to test the quality of our results by comparing inference performances we will obtain. The resource estimates for inference is as follows:

Inference with QCNN: Kernel Size: 3x3 Input Image: 10x10 Number of Executions per QCNN layer: (10-3+1)^2 = 64 Number of input images: 50 Cost of 30 Qubit Circuit Execution with 1000 shots (Aspen-9): 0.35+0.30 = 0.65 Cost per QCNN layer: 2080$

We can afford 2 QCNN layers that add up to 4160$ in total. We haven't used the initial 250$ credit yet, so that we can save it to our final model. With the 4000$ bonus credit we can test our model .

co9olguy commented 3 years ago

Hi @RKHashmani, we can't find this team name in our database. Have you created a login at challenge.qhack.ai/register? If not, could you please do so? That will help us connect this entry to a corresponding email address

cnktysz commented 3 years ago

Hi, we registered under my name, email address is cenktuysuz@gmail.com and username should be cenktuysuz.

RKHashmani commented 3 years ago

Hi @RKHashmani, we can't find this team name in our database. Have you created a login at challenge.qhack.ai/register? If not, could you please do so? That will help us connect this entry to a corresponding email address

Hi @co9olguy, it's as @cnktysz said. Our team name is QuantumTunnelers but on the challenge.qhack.ai website we registered with the username cenktuysuz. Please let us know if you need anything else. Thank you!

co9olguy commented 3 years ago

Thank you, I've found it! :+1:

co9olguy commented 3 years ago

Thanks for your Power Up Submission @RKHashmani!

To help us keep track of final submissions, we will be closing all of the [Power Up] issues. We ask you to open a new issue for your final submission. Please use this pre-formatted [Entry] Issue template. Note that for the final submission, the Resource Estimate requirement is replaced by a Presentation item.