Table of Contents
Fetching ...

Classification of the Fashion-MNIST Dataset on a Quantum Computer

Kevin Shen, Bernhard Jobst, Elvira Shishenina, Frank Pollmann

TL;DR

This work attempts to solve the data encoding problem by improving a recently proposed variational algorithm that approximately prepares the encoded data, using asymptotically shallow circuits that fit the native gate set and topology of currently available quantum computers.

Abstract

The potential impact of quantum machine learning algorithms on industrial applications remains an exciting open question. Conventional methods for encoding classical data into quantum computers are not only too costly for a potential quantum advantage in the algorithms but also severely limit the scale of feasible experiments on current hardware. Therefore, recent works, despite claiming the near-term suitability of their algorithms, do not provide experimental benchmarking on standard machine learning datasets. We attempt to solve the data encoding problem by improving a recently proposed variational algorithm [1] that approximately prepares the encoded data, using asymptotically shallow circuits that fit the native gate set and topology of currently available quantum computers. We apply the improved algorithm to encode the Fashion-MNIST dataset [2], which can be directly used in future empirical studies of quantum machine learning algorithms. We deploy simple quantum variational classifiers trained on the encoded dataset on a current quantum computer ibmq-kolkata [3] and achieve moderate accuracies, providing a proof of concept for the near-term usability of our data encoding method.

Classification of the Fashion-MNIST Dataset on a Quantum Computer

TL;DR

This work attempts to solve the data encoding problem by improving a recently proposed variational algorithm that approximately prepares the encoded data, using asymptotically shallow circuits that fit the native gate set and topology of currently available quantum computers.

Abstract

The potential impact of quantum machine learning algorithms on industrial applications remains an exciting open question. Conventional methods for encoding classical data into quantum computers are not only too costly for a potential quantum advantage in the algorithms but also severely limit the scale of feasible experiments on current hardware. Therefore, recent works, despite claiming the near-term suitability of their algorithms, do not provide experimental benchmarking on standard machine learning datasets. We attempt to solve the data encoding problem by improving a recently proposed variational algorithm [1] that approximately prepares the encoded data, using asymptotically shallow circuits that fit the native gate set and topology of currently available quantum computers. We apply the improved algorithm to encode the Fashion-MNIST dataset [2], which can be directly used in future empirical studies of quantum machine learning algorithms. We deploy simple quantum variational classifiers trained on the encoded dataset on a current quantum computer ibmq-kolkata [3] and achieve moderate accuracies, providing a proof of concept for the near-term usability of our data encoding method.
Paper Structure (13 sections, 15 equations, 11 figures)

This paper contains 13 sections, 15 equations, 11 figures.

Figures (11)

  • Figure 1: Schematic description of the contents of this work. On classical computers, we optimize the parameterized quantum circuits with gate complexities linear in the number of qubits that approximately prepare the Flexible Representation of Quantum Images (FRQI) of the Fashion-MNIST dataset. The encoded dataset is then used for training a variational quantum classifier on classical computers. We provide results from deploying the trained circuits on a quantum computer ibmq-kolkata.
  • Figure 2: (a) General ansatz with two-qubit gates $V$ arranged in a staircase pattern (same as in Ref. dilip_data_2022). (b) Sparse ansatz with blocks of $2$ single-qubit gates $U$ and a CNOT gate arranged in a staircase pattern. (c) Decomposition of a $U$ gate on ibmq-kolkata. (d) Decomposition of a $V$ gate on ibmq-kolkata. (e) A circuit with $2$ layers of sparse ansatz for data encoding and $2$ layers of sparse ansatz for classification. Additional gates are colored in gray. The last $4$ qubits that are associated with the meter-like symbol are measured at the end of the circuit.
  • Figure 3: Fidelities between the target FRQI states and states approximately prepared by optimized PQCs of $1-3$ general or sparse layer(s). The markers and error bars show the mean values and the $25$th-$75$th percentile intervals computed over all $60000$ training images respectively.
  • Figure 4: Test accuracies (top) and spreads of raw counts (bottom, log-scale) in noiseless simulations on classical computers (dashed curves) and in experiments (dotted curves) on the quantum computer ibmq-kolkata. Each curve corresponds to classifiers on the same encoded dataset, which are prepared by PQCs of $1$--$3$ sparse (left) or general (right) layer(s) respectively. On each encoded dataset, classifiers built from PQCs of $1$--$7$ layer(s) of the same ansatz as the data encoding PQCs are trained and tested. The horizontal axis labels the total number of CNOT gates, which estimates the circuits' gate complexities. Test accuracies in the simulation are computed over all $10000$ testing images. Test accuracies in experiments are computed over the first $100$ testing images. The error bars indicate the $95\%$ Wilson confidence intervals. Test accuracy from a support vector machine (see Appendix \ref{['sec:Multiclass Classification Appendix']}) of value $89.48 \%$ is displayed for reference (dashed gray line). The first $100$ testing images are used for computing the spread of raw counts in both simulations and experiments. The spread of raw counts, computed as the mean $L_2$ distance between each raw count vector and the center of the vectors, indicates the level of hardware noise experienced by the circuits.
  • Figure 5: Example measurement statistics. Left: Raw Counts. Right: Post-processed counts. Top: A successful example where the correct label '1' is found in both simulation and experiment. Bottom: A failed example where the correct label '6' is found in simulation, but the false label '4' is given in experiment primarily due to hardware noise.
  • ...and 6 more figures