Source-linked AI summary
Quantum machine learning for image classification
Arsenii Senokosov, Alexandr Sedykh, Asel Sagingalieva, Basil Kyriacou, Alexey Melnikov
TL;DR
The paper addresses computational challenges in image classification as visual data grows by introducing two hybrid quantum neural network models. HQNN-Parallel uses parallel quantum layers, while HQNN-Quanv uses a resolution-reducing quanvolutional layer. The models achieve strong classification results with fewer parameters, although quantum training and operation costs remain higher than classical costs.
Problem
Growing visual datasets create significant computational challenges for modern neural networks used in image classification.
Method
The paper develops HQNN-Parallel with parallel quantum layers after classical convolutional layers and HQNN-Quanv with a resolution-reducing quanvolutional layer.
Results
HQNN-Parallel achieves 99.21% accuracy on MNIST with eight times fewer parameters, while HQNN-Quanv achieves 67% accuracy with four times fewer first-layer trainable parameters.
Takeaways & Limitations
The two models demonstrate quantum-hybrid approaches for image classification across MNIST and additional benchmark datasets.
Takeaways & Limitations
Quantum models do not necessarily execute more efficiently because their training and operation costs are higher than those of classical models.
Abstract
from arXiv · showhide
Image classification, a pivotal task in multiple industries, faces computational challenges due to the burgeoning volume of visual data. This research addresses these challenges by introducing two quantum machine learning models that leverage the principles of quantum mechanics for effective computations. Our first model, a hybrid quantum neural network with parallel quantum circuits, enables the execution of computations even in the noisy intermediate-scale quantum era, where circuits with a large number of qubits are currently infeasible. This model demonstrated a record-breaking classification accuracy of 99.21% on the full MNIST dataset, surpassing the performance of known quantum-classical models, while having eight times fewer parameters than its classical counterpart. Also, the results of testing this hybrid model on a Medical MNIST (classification accuracy over 99%), and on CIFAR-10 (classification accuracy over 82%), can serve as evidence of the generalizability of the model and highlights the efficiency of quantum layers in distinguishing common features of input data. Our second model introduces a hybrid quantum neural network with a Quanvolutional layer, reducing image resolution via a convolution process. The model matches the performance of its classical counterpart, having four times fewer trainable parameters, and outperforms a classical model with equal weight parameters. These models represent advancements in quantum machine learning research and illuminate the path towards more accurate image classification systems.
Introduction
Growing visual datasets create computational challenges for conventional image-classification systems, motivating hybrid quantum-classical approaches. The paper proposes two HQNN designs and reports strong accuracy with fewer parameters, while noting that quantum execution remains costlier.
- Growing visual data creates significant computational challenges for modern neural networks used in image classification.
- The paper proposes two hybrid approaches: parallel parameterized quantum circuits after classical convolutional layers and an HQNN with a quanvolutional layer.
- 99.21% accuracy on MNIST was achieved by HQNN-Parallel while using eight times fewer parameters than its classical counterpart.
- 67% accuracy was achieved by HQNN-Quanv, matching the classical model with four times fewer trainable parameters in the first layer and outperforming an equally weighted classical model.
- Fewer trainable parameters do not necessarily make quantum models more efficient because their training and operation costs are higher than classical models.
Results
The paper evaluates image-classification models across MNIST, Medical MNIST, and CIFAR-10, including datasets with ambiguous, multichannel, or color images.
- MNIST: MNIST contains 28×28 grayscale handwritten digits labeled from 0 to 9 for digit recognition.The dataset includes ambiguous or broken images that can challenge human evaluators.
- Medical MNIST: Medical MNIST contains 58954 64 × 64 medical images across six categories, with three channels per image.The categories include AbdomenCT, BreastMRI, CXR, ChestCT, Hand, and HeadCT.
- Medical MNIST: Medical MNIST preprocessing used rotations up to 10 degrees, horizontal flips, and resizing to dimensions as large as 244 × 244 pixels.The dataset was split into 47163 training samples and 11791 testing samples.
- CIFAR-10: CIFAR-10 contains 60000 color images represented as 32 × 32 × 3 tensors across ten object categories.The dataset has 50000 training samples and 10000 testing samples.
B. Hybrid Quantum Neural Network with parallel quantum dense layers, HQNN-Parallel
HQNN-Parallel combines classical convolutional processing with classical fully connected layers and parallel quantum layers implemented as parameterized quantum circuits.
- Architecture: HQNN-Parallel uses a classical convolutional block to reduce input dimensionality before hybrid dense processing.Its hybrid dense component combines classical fully connected layers with parallel quantum layers.
- Classical Convolutional Layers: The convolutional architecture uses two blocks followed by fully connected layers, with ReLU activation and batch normalization.Batch normalization is used to stabilize training and improve model accuracy.
- Classical Convolutional Layers: The first convolutional layer maps one input channel to 16 output channels using a 5 × 5 kernel, stride one, and two-pixel padding.The padding preserves the original 28×28 spatial dimensions while producing 16 channels.
- Classical Convolutional Layers: The second convolutional block maps 16 channels to 32 and produces a 32×7×7 feature map for the fully connected component.Its kernel size and padding match those of the preceding convolutional layer.
2. Hybrid Dense Layers
The hybrid dense part converts convolutional features into quantum-layer inputs, preserves their feature count through quantum processing, and maps them to ten class outputs.
- Hybrid Dense Layers: The 32 × 7 × 7 feature map is flattened and transformed from 1568 features to n features before quantum processing.n is determined by the quantum component and represents the total number of quantum encoding parameters.
- Hybrid Dense Layers: Each quantum layer preserves the number of input and output features before passing its output to a second classical fully connected layer.The subsequent layer maps n features to ten outputs corresponding to the digit classes.
- Hybrid Dense Layers: The HQNN-Parallel structure can be adjusted in layer count and feature count to optimize performance for a specific task.
3. Structure of Quantum Layer
The quantum component splits classical features across parallel PQCs, encodes them with rotations, applies trainable and entangling gates, measures them, and feeds concatenated outputs into classification.
- Structure of Quantum Layer: The quantum component contains c parallel PQCs, each consisting of embedding, variational-gate, and measurement stages.Parallel execution allows the circuits to operate simultaneously within the HQNN-Parallel design.
- Embedding: The n features from the preceding classical layer are divided into c vectors of q values and encoded through rotations around each qubit’s X-axis.The division uses c = n/q, so n must be divisible by q.
- Variational Layer: The variational stage applies trainable rotations followed by CNOT operations that entangle qubits, with depth i controlling repeated operation layers.Variational parameters differ across repetitions and parallel circuits.
- Results: HQNN-Parallel achieved 99.21% MNIST test accuracy versus 98.71% for CNN while using eight times fewer variational parameters.On Medical MNIST, accuracies were 99.97% versus 99.96%; on CIFAR-10, they were 82.78% versus 82.64%.
- Measurement and Classification: Measurement produces q-dimensional outputs from each PQC, which are concatenated into an n-dimensional vector for a subsequent classical layer.The final layer outputs a probability distribution over ten digits and selects the class with the highest probability.
- Analysis: The paper additionally reports theoretical analysis of HQNN-Parallel using ZX-Calculus reduction and Fourier expressivity.
4. Training and results
The models are trained with cross-entropy-based optimization and evaluated against classical counterparts across MNIST, Medical MNIST, and CIFAR-10. HQNN-Parallel achieves high accuracy while using fewer parameters, including 99.21% on MNIST and slightly higher accuracy than CNNs on the additional datasets.
- Training procedure: The training objective is to minimize cross-entropy loss, with classical parameters optimized by backpropagation and quantum parameters optimized using the parameter-shift rule.PennyLane supplies optimization techniques for the quantum layers.
- MNIST results: 99.21% accuracy was achieved by HQNN-Parallel on MNIST after replacing its quantum component with a classical dense layer for comparison.The convolutional part was held constant, and both models were trained on the same dataset.
- MNIST results: Approximately eight times fewer parameters still accompanied higher performance for the most successful HQNN-Parallel implementation than for its classical CNN counterpart.Trainable parameters and training/testing results were summarized in Table I and Fig. 5(c).
- Additional datasets: 99.97% accuracy was achieved by HQNN-Parallel on Medical MNIST, compared with 99.96% for the classical CNN.The HQNN used 247462 trainable parameters, while the classical CNN used 247642.
- Additional datasets: 82.78% accuracy was achieved by HQNN-Parallel on CIFAR-10, compared with 82.64% for the classical CNN.The HQNN used 81578 trainable parameters, versus 81698 for the classical CNN.
C. Hybrid Quantum Neural Network with quanvolutional layer, HQNN-Quanv
HQNN-Quanv combines a quanvolutional layer with classical fully connected layers to recognize MNIST digits. The section compares this hybrid architecture with a classical CNN and examines output-channel effects.
- Architecture: HQNN-Quanv combines a quanvolutional layer with classical fully connected layers for MNIST digit recognition.The architecture and comparisons are presented through Fig. 7 and experiments against a classical CNN.
- Comparison design: The model comparison varies the convolutional or quanvolutional layer and the number of output channels.The study investigates the relationship between quanvolutional and classical convolutional layers.
1. Quanvolutional layer
The quanvolutional layer applies a quantum-circuit kernel to image patches, producing lower-resolution classical feature maps. In HQNN-Quanv, these maps are processed and evaluated against CNN variants under a reduced-data training setup.
- Quanvolutional layer: A quanvolutional kernel convolves image patches and produces a lower-resolution output using a quantum circuit with nq qubits.Its circuit includes classical-to-quantum encoding, variational gates, and quantum measurement.
- Quantum processing: Angle embedding encodes pixel values through Ry(φ) rotations before variational quantum transformations are applied.The variational transformations are defined by parameterized unitaries.
- Quantum processing: Measurement expectation values become output pixels, with each quantum wire producing a separate image channel.A 2 × 2 kernel uses four qubits and transforms one image into four reduced-size images.
- HQNN-Quanv architecture: HQNN-Quanv uses four output channels, which are concatenated and flattened before entering a classical fully connected layer producing 10 class probabilities.Each channel is a 4 × 4-pixel image in the described architecture.
- Results: 0.67 ± 0.01 test accuracy was achieved by HQNN-Quanv, close to CNN4 at 0.66 ± 0.02 and above CNN1 at 0.53 ± 0.02.HQNN-Quanv used 4 trainable kernel weights, compared with 16 for CNN4.
- Results: Four trainable quanvolutional-kernel weights produced performance equivalent to CNN4, which used four times as many kernel weights.The experiment trained models for 20 epochs using 500 training images and 100 test images after downscaling images from 28 × 28 to 14 × 14 pixels.
Discussion
The study introduced two hybrid approaches to image classification: HQNN-Parallel and HQNN-Quanv. Across several datasets, these models used substantially fewer weights while achieving comparable or stronger classification performance, although practical efficiency remains constrained by quantum training costs.
- HQNN-Parallel: HQNN-Parallel exceeded 99% accuracy on MNIST, while the classical model reached 98.71% with eight times more neural-network weights.The same hybrid model achieved over 99% quality on Medical MNIST and over 82% accuracy on CIFAR-10, where it outperformed its classical counterpart with a similar number of weights.
- HQNN-Quanv: HQNN-Quanv achieved 67 ± 1% accuracy using four times fewer weights than its classical analog, which reached 66 ± 2% on test samples averaged over ten models.A classical analog with the same number of variational parameters as the hybrid model achieved 53 ± 2%.
- Practical efficiency: Fewer trainable parameters do not necessarily make quantum models more efficient because quantum training and operation costs remain higher than classical costs.The authors note that future quantum-hardware advances might narrow this cost gap.
- Future directions: Broader validation, more complex architectures, improved PQC optimization, and larger-scale quantum hardware remain needed to explore HQNNs fully.The study recognizes the need to test generalization across more diverse datasets and real-world scenarios.
- Architectures: The work demonstrated two hybrid image-classification approaches that combine classical and quantum layers.The first applies parallel parameterized quantum circuits after classical deep convolutional layers; the second uses a quanvolutional layer.
Appendix A: Theoretical Analysis
The theoretical analysis uses ZX-calculus to assess circuit reducibility and Fourier accessibility to examine the HQNN-Parallel quantum layer. ZX rewriting simplifies the circuit without removing its inputs or trainable parameters, indicating no reduction of those components.
- Theoretical analysis: The analysis examines HQNN-Parallel using ZX-calculus for circuit reducibility and Fourier accessibility for data embedding and expressivity.These are the two stated theoretical-analysis methods.
- ZX-calculus: ZX-calculus represents quantum circuits as graphs of spiders and supports simplification through graphical rewrite rules.Light or green spiders represent tensors in the Z basis, while dark or red spiders represent tensors in the X basis.
- Circuit reduction: The ZX-calculus graphs indicate that all weights and inputs occupy independent nodes, suggesting the model is absent of redundancy.The comparison is between the original quantum layer and its reduced form.
- ZX-calculus: ZX diagrams help identify redundancies in a quantum model.
- Circuit reduction: The ZX-reduced quantum layer retains all initial parameters wi on separate nodes, so rewriting does not remove inputs or trainable parameters.The circuit was first represented as a red-green ZX diagram, rewritten, and then extracted as a simplified circuit.
2. Fourier Expressivity
The Fourier analysis treats parameterized quantum-circuit outputs as truncated Fourier series and evaluates the expressivity of the HQNN-Parallel layer. The sampled coefficients show broad variation and independent Fourier terms rather than near-zero behavior.
- Fourier representation: Parameterized quantum-circuit outputs are equivalent to truncated Fourier series over the feature vector x and trainable parameters θ.For a feature vector of length N, the series is expressed through Fourier coefficients indexed by frequencies ω_i.
- Fourier representation: The number of Fourier terms is one more than twice the number of times an input is placed in the circuit, d.The analysis samples θ_i uniformly from [0, 2π] and samples equidistant x values at frequency d.
- Displayed terms: For visual clarity, the analysis displays only the first two feature-associated terms of the final quantum-circuit output.These inputs are denoted x and y in the displayed output function.
- Expressivity: The Fourier coefficients span a wide range of values across parameter realizations, whereas a non-expressive model would have coefficients near zero.The determinant of the correlation matrix was zero for every output, demonstrating independent and expressive Fourier terms.
- Expressivity: The violin plot encodes Fourier-coefficient magnitude through violin width, with the center-line indices identifying coefficient c_ij.The large spread in real and imaginary parts of every coefficient implies high model expressivity.