https://github.com/jeremiegince/mnist_classification_using_quantum_machine_learning
Project for McGill Physics Hackathon 2020
https://github.com/jeremiegince/mnist_classification_using_quantum_machine_learning
deep-learning deep-neural-networks hyperparameter-optimization machine-learning mnist pennylane python3 pytorch quantum-computing quantum-machine-learning
Last synced: 2 months ago
JSON representation
Project for McGill Physics Hackathon 2020
- Host: GitHub
- URL: https://github.com/jeremiegince/mnist_classification_using_quantum_machine_learning
- Owner: JeremieGince
- Created: 2020-10-28T16:28:26.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-13T16:43:40.000Z (over 4 years ago)
- Last Synced: 2025-05-15T10:39:33.491Z (5 months ago)
- Topics: deep-learning, deep-neural-networks, hyperparameter-optimization, machine-learning, mnist, pennylane, python3, pytorch, quantum-computing, quantum-machine-learning
- Language: Python
- Homepage:
- Size: 9.53 MB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MNIST_classification_using_Quantum_Machine_Learning
This is an API used to create a machine learning classifier using quantum computing.## Background information about convolution and quantum computations
Image classification rely mostly on the notion of convolution. In computer science, the notion of convolution can be described by a small matrix, called kernel, sliding on a bigger matrix. Depending on the main objective, the bigger matrix can be an image, time series, etc. In machine learning, convolutions are used in convolutional neural networks (CNNs for short). The kernel is made of different weights, they can be specific (like in a Gaussian kernel, in Sobel kernels and many more known and useful kernels) or they can be randomly initialized. For more info, one can visit https://en.wikipedia.org/wiki/Kernel_(image_processing)In quantum computation, instead of working with classical information stored in *bits*, we work with *qubits*. which can be seen as the quantum equivalent. Instead of being in a single state, either 0 or 1, qubits can be in a superpostion of states of 0 and 1, i.e. qubits have a certain probability of being 0 and another certain probability of being 1. This lead to interesting properties, such as multiple simultaenous computation that can be used to *easily* crack cryptography (easy relative to a classical computer!). For more general information about quantum computing, see https://en.wikipedia.org/wiki/Quantum_computing
## Quantum convolution
To create a quantum convolution layer, we initialize a quantum circuit with parameters like the number of qubits we want or the kernel size. Then, some quantum operations are done on the kernel depending on the weights. This then gives us a certain number of outputs, depending on the number of qubits, because the value of each qubit is measured. The folowing image shows how a quantum convolution layer works with only 4 qubits1

1 Taken from https://pennylane.ai/qml/_images/circuit.png