We look at quantum convolutional (quanvolutional) neural networks (QNNs), extending the quanvolutional layer to produce a hybrid QAE. Autoencoders are a type of unsupervised feed-forward ANN that are designed to deconstruct input data and encode it into a compressed representation of the original data. The quanvolutional neural network is an architecture by Henderson et al (Henderson et al. 2020) inspired by the convolutional neural network (CNN). Convolutional layers are made of stacks of convolutional filters which convolve over the input to produce feature maps, each map containing only the useful features of the data. The quanvolutional neural network seeks to leverage aspects of the convolutional layer to create a 'quanvolutional layer' run on a quantum circuit. As with convolutional layers, quanvolutional layers are made of filters which operate over the input. These filters extract information by transforming local data via quantum circuits, which can be random circuits, or designed with a specific architecture.
The original concept of a QNN is that the quanvolutional layer would act as an initial layer within the overall classical CNN architecture. Like a convolutional layer, the quanvolutional layer has parameters that can be defined including the number of filters, the number of layers stacked, the quantum encoding and decoding method, and the quantum circuit itself. The flexibility of the layer makes it generalisable to many tasks. However, the rotational parameters within the quantum circuit are kept constant, meaning the quantum contribution of the model is not a part of the training. We chose to explore both keeping the layer as a static pre-processing step, prior to the autoencoder architecture, and as a parameterised quantum circuit (PQC) with trainable parameters that are optimised with the classical autoencoder parameters.
We used a simple model architecture. Input data is encoded through angle encoding and is passed through the quanvolutional layer, which halves the dimensions with an output of a collection of feature maps, which are flattened and passed through a fully-connected layer to reduce the dimensions further. The number of filters the quanvolutional layer produces is equivalent to the number of qubits in the circuit. For our study, we chose to use four qubits, producing four channels.
We investigated three different circuit architectures, a randomly generated circuit, as used by Henderson et al., a circuit which consists solely of CNOTs to introduce entanglement, and a hardware-efficient ansatz, with one model containing fixed rotational gates and the other with trainable parameters, which are optimised along with the classical parameters. We compared the loss and reconstruction error for each model, including the classical equivalent, where the quanvolutional layer is swapped for an equivalent convolutional layer. The training was repeated 50 times with a different random seed for each run and we plot the average train and validation loss per epoch, the reconstruction error, which is an indicator of how well the model is learning the important data features, and their respective standard deviation. We also visually inspect the generated data samples.