Table of Contents
Fetching ...

Implementation and Empirical Evaluation of a Quantum Machine Learning Pipeline for Local Classification

Enrico Zardini, Enrico Blanzieri, Davide Pastorello

TL;DR

This work implements and empirically evaluates a locality-based quantum machine learning pipeline that combines a quantum k-NN with a quantum cosine-based binary classifier, using amplitude-encoded data and SWAP-test-based similarity. In ideal (statevector) conditions, the quantum pipeline achieves accuracy comparable to classical approaches and validates locality as a useful strategy in QML; however, the quantum k-NN is highly sensitive to probability fluctuations, and the pipeline generally underperforms strong classical baselines like random forests and SVMs in practical (simulated or hardware-like) settings. The study provides a concrete Qiskit-based implementation, analyzes complexity and resource requirements, and highlights avenues for future work, including more robust k-NN variants, adoption of Euclidean distance, and integration with other quantum models such as quantum SVM. Overall, locality remains a promising direction for QML, but current quantum components require enhancements to outperform classical methods on typical datasets.

Abstract

In the current era, quantum resources are extremely limited, and this makes difficult the usage of quantum machine learning (QML) models. Concerning the supervised tasks, a viable approach is the introduction of a quantum locality technique, which allows the models to focus only on the neighborhood of the considered element. A well-known locality technique is the k-nearest neighbors (k-NN) algorithm, of which several quantum variants have been proposed. Nevertheless, they have not been employed yet as a preliminary step of other QML models, whereas the classical counterpart has already proven successful. In this paper, we present (i) an implementation in Python of a QML pipeline for local classification, and (ii) its extensive empirical evaluation. Specifically, the quantum pipeline, developed using Qiskit, consists of a quantum k-NN and a quantum binary classifier. The results have shown the quantum pipeline's equivalence (in terms of accuracy) to its classical counterpart in the ideal case, the validity of locality's application to the QML realm, but also the strong sensitivity of the chosen quantum k-NN to probability fluctuations and the better performance of classical baseline methods like the random forest.

Implementation and Empirical Evaluation of a Quantum Machine Learning Pipeline for Local Classification

TL;DR

This work implements and empirically evaluates a locality-based quantum machine learning pipeline that combines a quantum k-NN with a quantum cosine-based binary classifier, using amplitude-encoded data and SWAP-test-based similarity. In ideal (statevector) conditions, the quantum pipeline achieves accuracy comparable to classical approaches and validates locality as a useful strategy in QML; however, the quantum k-NN is highly sensitive to probability fluctuations, and the pipeline generally underperforms strong classical baselines like random forests and SVMs in practical (simulated or hardware-like) settings. The study provides a concrete Qiskit-based implementation, analyzes complexity and resource requirements, and highlights avenues for future work, including more robust k-NN variants, adoption of Euclidean distance, and integration with other quantum models such as quantum SVM. Overall, locality remains a promising direction for QML, but current quantum components require enhancements to outperform classical methods on typical datasets.

Abstract

In the current era, quantum resources are extremely limited, and this makes difficult the usage of quantum machine learning (QML) models. Concerning the supervised tasks, a viable approach is the introduction of a quantum locality technique, which allows the models to focus only on the neighborhood of the considered element. A well-known locality technique is the k-nearest neighbors (k-NN) algorithm, of which several quantum variants have been proposed. Nevertheless, they have not been employed yet as a preliminary step of other QML models, whereas the classical counterpart has already proven successful. In this paper, we present (i) an implementation in Python of a QML pipeline for local classification, and (ii) its extensive empirical evaluation. Specifically, the quantum pipeline, developed using Qiskit, consists of a quantum k-NN and a quantum binary classifier. The results have shown the quantum pipeline's equivalence (in terms of accuracy) to its classical counterpart in the ideal case, the validity of locality's application to the QML realm, but also the strong sensitivity of the chosen quantum k-NN to probability fluctuations and the better performance of classical baseline methods like the random forest.
Paper Structure (22 sections, 20 equations, 8 figures, 9 tables, 1 algorithm)

This paper contains 22 sections, 20 equations, 8 figures, 9 tables, 1 algorithm.

Figures (8)

  • Figure 1: Quantum pipeline workflow overview.
  • Figure 2: Quantum pipeline circuits example. The first one (a) corresponds to the quantum $k$-NN, the second one (b) to the quantum binary classifier. In the case of the statevector modality, the final measurements are not present. The barriers (vertical dotted lines) have been added for illustrative purposes.
  • Figure 3: Execution modality comparison on 15 qubits datasets for the quantum pipeline. Each point represents the accuracy obtained in a fold (or its average across runs).
  • Figure 4: Execution modality comparison on 15 qubits datasets (the 02_transfusion dataset is not present) for the quantum binary classifier. Each point represents the accuracy obtained in a fold (or its average across runs). The p-value obtained by applying the Wilcoxon signed-rank test ($\alpha\,{=}\,0.05$) to the fold accuracy distributions is $0.016$.
  • Figure 5: Quantum pipeline - quantum binary classifier comparison on common 15 qubits datasets, with each point representing the accuracy obtained in a fold (or its average across runs). The $k$ values refer only to the pipeline.
  • ...and 3 more figures