Authors: Zirui Li, Hanrui Wang
See this tutorial video for detailed explanations:
Referece: Quanvolutional Neural Networks: Powering Image Recognition with Quantum Circuits
- Introduction to Quanvolutional Neural Network.
- Build and train a Quanvolutional Neural Network.
- a. Compare Quanvolutional Neural Network with a classic model.
- b. Evaluate on real quantum computer.
- Compare multiple models with or without a trainable quanvolutional filter.
In this tutorial, we use tq.QuantumDevice
, tq.GeneralEncoder
, tq.RandomLayer
, tq.MeasureAll
, tq.PauliZ
class from TrochQuantum.
You can learn how to build, train and evaluate a quanvolutional filter using TorchQuantum in this tutorial.
Convolutional neural network is a classic neural network genre, mostly applied to anylize visual images. They are known for their convolutional layers that perform convolution. Typically the convolution operation is the Frobenius inner product of the convolution filter with the input image followed by an activation function. The convolution filter slides along the input image and generates a feature map. We can use the feature map for classification.
One can extend the same idea also to the context of quantum variational circuits. Replace the classical convolution filters with variational quantum circuits and we get quanvolutional neural networks with quanvolutional filters. The quanvolutional filters perform more complex operations in a higher dimension Hilbert space than Frobenius inner product. Therefore, quanvolutional filters have more potential than traditional convolution filters.