Image Compression and Classification Using Qubits and Quantum Deep Learning

Ali Mohsen, Mo Tiwari

Abstract

Recent work suggests that quantum machine learning techniques can be used for classical image classification by encoding the images in quantum states and using a quantum neural network for inference. However, such work has been restricted to very small input images, at most 4 x 4, that are unrealistic and cannot even be accurately labeled by humans. The primary difficulties in using larger input images is that hitherto-proposed encoding schemes necessitate more qubits than are physically realizable. We propose a framework to classify larger, realistic images using quantum systems. Our approach relies on a novel encoding mechanism that embeds images in quantum states while necessitating fewer qubits than prior work. Our framework is able to classify images that are larger than previously possible, up to 16 x 16 for the MNIST dataset on a personal laptop, and obtains accuracy comparable to classical neural networks with the same number of learnable parameters. We also propose a technique for further reducing the number of qubits needed to represent images that may result in an easier physical implementation at the expense of final performance. Our work enables quantum machine learning and classification on classical datasets of dimensions that were previously intractable by physically realizable quantum computers or classical simulation.

Introduction

Quantum Machine Learning (QML) holds the promise of leveraging quantum properties like entanglement and superposition for advanced data processing. However, a significant "input bottleneck" persists: encoding classical data into quantum states often requires a prohibitive number of qubits. Consequently, most research has been confined to extremely low-resolution images, typically 4x4 pixels. At this resolution, visual features are largely lost, making it difficult even for human observers to identify the subject matter.

Comparison of image resolutions from the original 28x28 MNIST digit to the downsampled 16x16, 8x8, and 4x4 versions used in the study.

This study addresses this resolution ceiling by introducing a framework that utilizes the Flexible Representation of Quantum Images (FRQI) to encode images with exponential qubit efficiency, enabling the classification of 16x16 images on current hardware and simulators.

Methodology

The proposed framework rests on two primary innovations: a compact encoding scheme and a specialized quantum neural network (QNN) architecture.

FRQI Encoding

The researchers utilize the Flexible Representation of Quantum Images (FRQI). Unlike injective encoding schemes that map one bit to one qubit, FRQI uses entanglement to store pixel coordinates in the state of "pixel qubits" and the grayscale intensity in a single "color qubit." For a $2^n \times 2^n$ image, this requires only $2n$ pixel qubits and 1 color qubit. For instance, a 16x16 image (256 pixels) is represented using just 9 qubits (8 for location, 1 for color). The authors developed a method to construct these states using only 2-qubit gates, ensuring compatibility with NISQ-era software frameworks like Google’s Cirq.

CRADL Architecture

To process these encoded states, a novel QNN layer called the Color-Readout-Alternating-Double-Layer (CRADL) was designed. CRADL employs alternating XX and ZZ rotation gates between pixel qubits, the color qubit, and a dedicated readout qubit. This structure is specifically tailored to capture the spatial correlations inherent in the entangled FRQI state.

Quantum circuit diagram illustrating the proposed encoding and neural network architecture.

Experimental Setup

The framework was evaluated using the MNIST dataset of handwritten digits, specifically focusing on a binary classification task between the digits '3' and '6'. The images were preprocessed by downsampling from the original 28x28 resolution to 8x8 and 16x16 using bilinear interpolation, followed by thresholding to create black-and-white (binary) versions. The training set comprised approximately 12,000 images.

Results and Discussion

The QNN was benchmarked against a classical Convolutional Neural Network (CNN) with a comparable number of learnable parameters.

  • 8x8 Resolution: The Quantum CRADL model achieved 92% accuracy, performing nearly as well as the classical CNN (94%).
  • 16x16 Resolution: The QNN reached 90% accuracy. While the classical benchmark was higher (98.9%), this result demonstrates the feasibility of classifying resolutions previously considered intractable for quantum simulation.
  • Parameter Efficiency: The QNN achieved high performance with very few parameters (e.g., 64-72 for 8x8 images), suggesting that quantum layers possess high expressive power.

The study also explored a "lossy" compression technique to further reduce qubit requirements by mapping pixel locations into the color angle. While this saves hardware resources, it introduces a tradeoff in final model accuracy.

Conclusion

This work demonstrates that quantum entanglement can serve as a powerful tool for data compression in machine learning. By successfully classifying 16x16 images, the researchers have moved QML beyond "thumbnail" resolutions toward more realistic visual data processing. Future efforts will focus on optimizing gate counts for real-world quantum hardware and exploring higher-order gate interactions to capture more complex image features.

Summary updated

Abstract

Recent work suggests that quantum machine learning techniques can be used for classical image classification by encoding the images in quantum states and using a quantum neural network for inference. However, such work has been restricted to very small input images, at most 4 x 4, that are unrealistic and cannot even be accurately labeled by humans. The primary difficulties in using larger input images is that hitherto-proposed encoding schemes necessitate more qubits than are physically realizable. We propose a framework to classify larger, realistic images using quantum systems. Our approach relies on a novel encoding mechanism that embeds images in quantum states while necessitating fewer qubits than prior work. Our framework is able to classify images that are larger than previously possible, up to 16 x 16 for the MNIST dataset on a personal laptop, and obtains accuracy comparable to classical neural networks with the same number of learnable parameters. We also propose a technique for further reducing the number of qubits needed to represent images that may result in an easier physical implementation at the expense of final performance. Our work enables quantum machine learning and classification on classical datasets of dimensions that were previously intractable by physically realizable quantum computers or classical simulation
BibTeX
@inproceedings{mohsen2022image,
  author = {Ali Mohsen and Mo Tiwari},
  title = {{Image Compression and Classification Using Qubits and Quantum Deep Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=t1QXzSGwr9},
}
Figure