Table of Contents
Fetching ...

Quantum Ensemble for Classification

Antonio Macaluso, Luca Clissa, Stefano Lodi, Claudio Sartori

TL;DR

This work proposes a quantum ensemble framework for binary classification that leverages quantum superposition to generate an exponential number of training-output trajectories with only linear circuit depth. By applying a common quantum classifier to all trajectories via interference, the method achieves additive training cost and enables accessing the ensemble prediction from a single measurement, offering potential speedups over classical ensembles. The authors instantiate a quantum cosine classifier and demonstrate, through simulations and IBM Qiskit experiments, that the quantum ensemble can outperform a single weak learner while reducing prediction variance, albeit with current device noise and data-encoding challenges. The study also discusses extensions to randomisation and boosting and outlines future work toward scalable, fault-tolerant quantum implementations and more efficient data-encoding strategies that could broaden practical impact.

Abstract

A powerful way to improve performance in machine learning is to construct an ensemble that combines the predictions of multiple models. Ensemble methods are often much more accurate and lower variance than the individual classifiers that make them up but have high requirements in terms of memory and computational time. In fact, a large number of alternative algorithms is usually adopted, each requiring to query all available data. We propose a new quantum algorithm that exploits quantum superposition, entanglement and interference to build an ensemble of classification models. Thanks to the generation of the several quantum trajectories in superposition, we obtain $B$ transformations of the quantum state which encodes the training set in only $log\left(B\right)$ operations. This implies exponential growth of the ensemble size while increasing linearly the depth of the correspondent circuit. Furthermore, when considering the overall cost of the algorithm, we show that the training of a single weak classifier impacts additively the overall time complexity rather than multiplicatively, as it usually happens in classical ensemble methods. We also present small-scale experiments on real-world datasets, defining a quantum version of the cosine classifier and using the IBM qiskit environment to show how the algorithms work.

Quantum Ensemble for Classification

TL;DR

This work proposes a quantum ensemble framework for binary classification that leverages quantum superposition to generate an exponential number of training-output trajectories with only linear circuit depth. By applying a common quantum classifier to all trajectories via interference, the method achieves additive training cost and enables accessing the ensemble prediction from a single measurement, offering potential speedups over classical ensembles. The authors instantiate a quantum cosine classifier and demonstrate, through simulations and IBM Qiskit experiments, that the quantum ensemble can outperform a single weak learner while reducing prediction variance, albeit with current device noise and data-encoding challenges. The study also discusses extensions to randomisation and boosting and outlines future work toward scalable, fault-tolerant quantum implementations and more efficient data-encoding strategies that could broaden practical impact.

Abstract

A powerful way to improve performance in machine learning is to construct an ensemble that combines the predictions of multiple models. Ensemble methods are often much more accurate and lower variance than the individual classifiers that make them up but have high requirements in terms of memory and computational time. In fact, a large number of alternative algorithms is usually adopted, each requiring to query all available data. We propose a new quantum algorithm that exploits quantum superposition, entanglement and interference to build an ensemble of classification models. Thanks to the generation of the several quantum trajectories in superposition, we obtain transformations of the quantum state which encodes the training set in only operations. This implies exponential growth of the ensemble size while increasing linearly the depth of the correspondent circuit. Furthermore, when considering the overall cost of the algorithm, we show that the training of a single weak classifier impacts additively the overall time complexity rather than multiplicatively, as it usually happens in classical ensemble methods. We also present small-scale experiments on real-world datasets, defining a quantum version of the cosine classifier and using the IBM qiskit environment to show how the algorithms work.

Paper Structure

This paper contains 34 sections, 33 equations, 9 figures, 2 tables, 1 algorithm.

Figures (9)

  • Figure 1: Quantum algorithm for ensemble classification. The circuit contains $d$ pairs of unitaries $U_{(i,1)}$, $U_{(i,2)}$ and $d$ control qubits. It produces an ensemble of $B$ classifiers, where $B = 2^{d}$. The single evaluation of $F$ allows propagating the classification function $\hat{f}$ in all trajectories in superposition. The firsts $d$ steps allows generating $B$ transformations of the training set $(x,y)$ in superposition, and each transformation is entangled with a quantum state of the $control$ register (firsts $d$ qubits). Thus, the test set $x^{(\text{test})}$ is encoded in the $test$ register that interferes with all samples in superposition. Finally, the ensemble prediction is obtained as the average of individual results from each trajectory.
  • Figure 2: Theoretical performance of the quantum ensemble based on the expected prediction error of the base classifiers ($E_{\text{model}}$) and their average correlation $(\rho)$. The ensemble size depends on the number of qubits $d$ in the control register. Each solid line corresponds to an error level, with coloured bands obtained by varying $\rho$ between $0$ (lower edge) and $0.5$ (upper edge).
  • Figure 3: Predictions of the cosine distance classifier based on $10^3$ randomly generated datasets per class. The classifier is implemented using the circuit in Figure \ref{['circuit:quantum_cosine']} on a $7$-qubit quantum device (ibmq_casablanca). The same implementation assuming a perfect quantum device is reported in Appendix \ref{['appendix: Quantum Cosine Classifier']}, Fig. \ref{['fig:multiple_run_avg_qasm']}.
  • Figure 4: Quantum circuit of the cosine classifier using $x_{b}$ as training vector and $x^{(\text{test})}$ as test vector. The training label $y_{b}$ is either $\ket{0}$ or $\ket{1}$ based on the binary target value. The measurement of the qubit $y^{(\text{test})}$ provides the prediction for the test observation whose features are encoded in $x^{(\text{test})}$.
  • Figure 5: Comparison between the Quantum Ensemble and the Classical Ensemble as a result of the classical average of four quantum cosine classifiers executed separately. Both approaches are performed on a simulator (orange line, brown dots) and on real device (light blue line, blue dots). Importantly, the Quantum Ensemble implementation on real device is performed using noisy simulations of the specific quantum device ($ibmq\_16\_montreal^*$). These simulations are only an approximation of the real errors that occur on actual devices, but still allow us to test the effectiveness of the quantum ensemble on near-term devices. The details about the implementation in terms of quantum gates of the quantum ensemble is reported in Appendix \ref{['appendix: Quantum Ensemble as Simple Averaging']}
  • ...and 4 more figures