qiskit-advocate / qamp-fall-21

Qiskit advocate mentorship program (QAMP) fall 21 cohort (Sep - Dec 2021)
30 stars 6 forks source link

Real-World QML Algorithms #43

Open ElePT opened 3 years ago

ElePT commented 3 years ago

Description

The goal of this project is to expand our current understanding of the different practical aspects of recently proposed QML algorithms (i.e [1], [2], [3]). These could include factors such as computational cost, execution time, level of applicability to real-world scenarios and other challenges related to software implementation or execution in current quantum devices.

The main idea is to implement one or more recent QML algorithm proposals in Qiskit, and benchmark them against the already existing qiskit-machine-learning algorithms (such as VQC or QKE). Furthermore, these algorithms could be tested in one or more industrial applications to help showcase the potential contributions of QML to different fields.

The scope of the project can be adjusted to fit within the expected 3-month timeline.

Mentor/s

Matched by prior communication with Alex Pozas-Kerstjens @apozas (should he accept the challenge)

Type of participant

I accept this challenge :)

Number of participants

1

Deliverable

apozas commented 3 years ago

I accept the challenge

ElePT commented 2 years ago

Here are the slides for the intermediate presentation: #43 Real-World QML Algorithms.pdf

ElePT commented 2 years ago

And here is the update for checkpoint 2:

Because the original project definition was quite open, for checkpoint 2 we have focused on developing a more concrete approach to benchmarking QML algorithms, starting with Quantum Neural Networks.

On one hand, we have selected two datasets to use throughout the project:

  1. The first dataset is a simple 2D classification dataset, where points are either in or out of a circle. This dataset is very simple and can be used to verify that the implementations work.
  2. The second dataset is from Kaggle and defines the actual real-world task: credit card fraud classification. Originally, this is a binary classification dataset with 30 features, but the number of features can be adjusted to the current limitations in number of qubits in a pre-processing step (as it is commonly done in data science problems).

On the other hand, we have established a criterion for classical baselines: because it is not “fair” to compare a deep neural network to a basic quantum machine learning algorithm, we have determined that a “comparable” classical neural network could be one with a similar number of trainable parameters.

In terms of algorithm implementation, we have decided to follow a bottom-up strategy, starting from the most fundamental algorithm, and building up in number of qubits and gates. According to this logic, the first algorithm to implement was the single-qubit universal quantum classifier [1] [2], a variational quantum circuit with 3 alternative theoretical formulations and trained through a fidelity loss function. To implement this fidelity loss effectively, we had to adapt the BinaryObjectiveFunctionclass from qiskit-machine-learning.

After some preliminary tests using the circle dataset, we selected the best formulations, trained the networks using the credit card fraud detection data, and compared the results to the previously established classical baselines:

image

We have seen that the best single-qubit approach can achieve an accuracy comparable to the classical baseline in this real-world data, and this is really promising. In the following steps, we will explore how can entanglement and more complex variational architectures help improve these results. If necessary, we can make the task more challenging by modifying the pre-processing step.

ElePT commented 2 years ago

As for the image, here is the visual comparison of the quantum and classical networks on the credit card dataset:

image

ElePT commented 2 years ago

The final slides are the following: Final_ppt_issue_43.pdf