Quanvolutional Neural Networks
Overview
Quanvolutional Neural Networks
This PennyLane demo implements a Quanvolutional Neural Network (QuanvNN), a hybrid model that inserts a quantum convolution (quanvolution) layer into an otherwise classical convolutional neural network for image classification. Inspired by classical convolution, the quanvolutional layer slides a small quantum circuit over local patches of an input image: each patch is encoded into the circuit, the circuit (a fixed or random quantum transformation) processes it, and the measurement results produce several output feature channels, much like a classical convolutional filter but with a quantum kernel. The tutorial applies a quanvolutional layer to the MNIST handwritten-digit dataset, pre-processing the images through the quantum layer once to produce quantum-transformed feature maps, and then training a small classical network on those features. It uses PennyLane to define and run the per-patch quantum circuit and a classical framework for the surrounding network, and compares the quanvolutional model against a purely classical baseline. By embedding a quantum operation inside a familiar CNN architecture, the demo offers an accessible, image-focused example of hybrid quantum machine learning in PennyLane.
Run it
pip install -r requirements.txt
python demo.py
Source and license
Imported from demonstrations_v2/tutorial_quanvolution/demo.py in PennyLaneAI/demos at c52c0abeb5122218aa96b38eea848864cce7323f, under the Apache License 2.0. Original authors: Xanadu and the PennyLane community. The upstream LICENSE is included alongside this example.
This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.
Publication
doi:10.48550/arxiv.1904.04767Maxwell Henderson, Samriddhi Shakya, Shashindra Pradhan, Tristan Cook
Versions
Cite all versions? Use the base QCR ID to always reference the latest version of this entry.
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!