# Performance Evaluation of Quantum-Based Machine Learning Algorithms for Cardiac Arrhythmia Classification

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Arrhythmia Dataset

#### 2.2. Proposed Method

#### 2.2.1. Principal Component Analysis (PCA)

#### 2.2.2. Quantum Support Vector Machine (QSVM)

#### 2.2.3. Experimental Setups

## 3. Experimental Results

#### 3.1. Scenario 1: Different Number of Qubits

#### 3.2. Scenario 2: Different Amount of Data

## 4. Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Ogur, N.B.; Ceken, C. Real Time Data Analytics Architecture for ECG. In Proceedings of the 2018 3rd International Conference on Computer Science and Engineering (UBMK), Xi’an, China, 20–23 September 2018; pp. 286–291. [Google Scholar]
- Li, X.; Li, C.; Wei, Y.; Sun, Y.; Wei, J.; Li, X.; Qian, B. BaT: Beat-aligned Transformer for Electrocardiogram Classification. In Proceedings of the 2021 IEEE International Conference on Data Mining (ICDM), Auckland, New Zealand, 7–10 December 2021; pp. 320–329. [Google Scholar]
- Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; MIT Press: Cambridge, MA, USA, 2016. [Google Scholar]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature
**2015**, 521, 436–444. [Google Scholar] [CrossRef] - Baloglu, U.B.; Talo, M.; Yildirim, O.; San Tan, R.; Acharya, U.R. Classification of myocardial infarction with multi-lead ECG signals and deep CNN. Pattern Recognit. Lett.
**2019**, 122, 23–30. [Google Scholar] [CrossRef] - Yildirim, O.; Baloglu, U.B.; Talo, M.; Ganesan, P.; Tung, J.S.; Kang, G.; Rogers, A.J. Deep Neural Network Trained on Surface ECG Improves Diagnostic Accuracy of Prior Myocardial Infarction over Q Wave Analysis. In Proceedings of the 2021 Computing in Cardiology (CinC), Brno, The Czech Republic, 12–15 September 2021; Volume 48, pp. 1–4. [Google Scholar]
- Murat, F.; Sadak, F.; Yildirim, O.; Talo, M.; Murat, E.; Karabatak, M.; Acharya, U.R. Review of deep learning-based atrial fibrillation detection studies. Int. J. Environ. Res. Public Health
**2021**, 18, 11302. [Google Scholar] [CrossRef] - Hu, Y.; Feng, T.; Wang, M.; Liu, C.; Tang, H. Detection of Paroxysmal Atrial Fibrillation from Dynamic ECG Recordings Based on a Deep Learning Model. 2022, SSRN 4098696. Available online: https://ssrn.com/abstract=4176673 (accessed on 30 July 2022).
- Steane, A. Quantum computing. Rep. Prog. Phys.
**1998**, 61, 117. [Google Scholar] [CrossRef][Green Version] - Paparo, G.D.; Dunjko, V.; Makmal, A.; Martin-Delgado, M.A.; Briegel, H.J. Quantum speedup for active learning agents. Phys. Rev. X
**2014**, 4, 031002. [Google Scholar] [CrossRef] - Maheshwari, D.; Garcia-Zapirain, B.; Sierra-Soso, D. Machine learning applied to diabetes dataset using Quantum versus Classical computation. In Proceedings of the 2020 IEEE International Symposium on Signal Processing and Information Technology (ISSPIT), Los Angeles, CA, USA, 21–26 June 2020; pp. 1–6. [Google Scholar]
- Gupta, H.; Varshney, H.; Sharma, T.K.; Pachauri, N.; Verma, O.P. Comparative performance analysis of quantum machine learning with deep learning for diabetes prediction. Complex Intell. Syst.
**2021**, 8, 3073–3087. [Google Scholar] [CrossRef] - Zhang, Y.; Ni, Q. Recent advances in quantum machine learning. Quantum Eng.
**2020**, 2, e34. [Google Scholar] [CrossRef][Green Version] - Blance, A.; Spannowsky, M. Quantum machine learning for particle physics using a variational quantum classifier. J. High Energy Phys.
**2021**, 2, 1–20. [Google Scholar] [CrossRef] - Zheng, J.; Zhang, J.; Danioko, S.; Yao, H.; Guo, H.; Rakovski, C. A 12-lead electrocardiogram database for arrhythmia research covering more than 10,000 patients. Sci. Data
**2020**, 7, 1–8. [Google Scholar] [CrossRef][Green Version] - Source Code for Qiskit_Machine_Learning.Datasets.Iris. Available online: https://qiskit.org/documentation/machine-learning/_modules/qiskit_machine_learning/datasets/iris.html#iris (accessed on 15 May 2022).
- Aleksandrowicz, G.; Alexander, T.; Barkoutsos, P.; Bello, L.; Ben-Haim, Y.; Bucher, D.; Marques, M. Qiskit: An open-sourceframework for quantum computing. Qiskit
**2019**, 55–63. [Google Scholar] - Murat, F.; Yildirim, O.; Talo, M.; Demir, Y.; Tan, R.S.; Ciaccio, E.J.; Acharya, U.R. Exploring deep features and ECG attributes to detect cardiac rhythm classes. Knowl.-Based Syst.
**2021**, 232, 107473. [Google Scholar] [CrossRef] - Wan, K.H.; Dahlsten, O.; Kristjánsson, H.; Gardner, R.; Kim, M.S. Quantum generalisation of feedforward neural networks. NPJ Quantum Inf.
**2017**, 3, 1–8. [Google Scholar] [CrossRef][Green Version] - Zhao, J.; Zhang, Y.H.; Shao, C.P.; Wu, Y.C.; Guo, G.C.; Guo, G.P. Building quantum neural networks based on a swap test. Phys. Rev. A
**2019**, 100, 012334. [Google Scholar] [CrossRef][Green Version] - Wiebe, N.; Kapoor, A.; Svore, K. Quantum algorithms for nearest-neighbor methods for supervised and unsupervised learning. arXiv
**2019**, arXiv:1401.2142. [Google Scholar] [CrossRef] - Ruan, Y.; Xue, X.; Liu, H.; Tan, J.; Li, X. Quantum algorithm for k-nearest neighbors classification based on the metric of hamming distance. Int. J. Theor. Phys.
**2017**, 56, 3496–3507. [Google Scholar] [CrossRef] - Kerenidis, I.; Landman, J.; Luongo, A.; Prakash, A. q-means: A quantum algorithm for unsupervised machine learning. Adv. Neural Inf. Process. Syst.
**2019**, 32, 4136–4146. [Google Scholar] - Karamizadeh, S.; Abdullah, S.M.; Manaf, A.A.; Zamani, M.; Hooman, A. An overview of principal component analysis. J. Signal Inf. Process.
**2020**, 4, 173. [Google Scholar] [CrossRef][Green Version] - Yang, J.; Awan, A.J.; Vall-Llosera, G. Support vector machines on noisy intermediate scale quantum computers. arXiv
**2019**, arXiv:1909.11988. [Google Scholar] - Rebentrost, P.; Mohseni, M.; Lloyd, S. Quantum support vector machine for big data classification. Phys. Rev. Lett.
**2014**, 113, 130503. [Google Scholar] [CrossRef][Green Version] - ZZFeatureMap. Available online: https://qiskit.org/documentation/stubs/qiskit.circuit.library.ZZFeatureMap.html (accessed on 18 July 2022).
- Qiskit 0.42.0 Documentation. Available online: https://qiskit.org/documentation/index.html (accessed on 28 June 2022).
- Aziz, S.; Ahmed, S.; Alouini, M.S. ECG-based machine-learning algorithms for heartbeat classification. Sci. Rep.
**2021**, 11, 18738. [Google Scholar] [CrossRef] [PubMed] - Sepahvand, M.; Abdali-Mohammadi, F. A novel method for reducing arrhythmia classification from 12-lead ECG signals to single-lead ECG with minimal loss of accuracy through teacher-student knowledge distillation. Inf. Sci.
**2022**, 593, 64–77. [Google Scholar] [CrossRef] - Faust, O.; Kareem, M.; Ali, A.; Ciaccio, E.J.; Acharya, U.R. Automated arrhythmia detection based on RR intervals. Diagnostics
**2021**, 11, 1446. [Google Scholar] [CrossRef] [PubMed] - Dhananjay, B.; Sivaraman, J. Analysis and classification of heart rate using CatBoost feature ranking model. Biomed. Signal Process. Control
**2021**, 68, 102610. [Google Scholar] [CrossRef] - Baygin, M.; Tuncer, T.; Dogan, S.; Tan, R.-S.; Acharya, U.R. Automated arrhythmia detection with homeomorphically irre-ducible tree technique using more than 10,000 individual subject ECG records. Inf. Sci.
**2021**, 575, 323–337. [Google Scholar] [CrossRef]

**Figure 4.**(

**a**) The performance of data cases according to 3 qubits. (

**b**) The performance of data cases according to 5 qubits. (

**c**) The performance of data cases according to 7 qubits. (

**d**) The performance of data cases according to 9 qubits.

**Figure 5.**Confusion matrices obtained on test data for QSVM and SVM: (

**a**) confusion matrix for QSVM, (

**b**) confusion matrix for SVM.

**Figure 6.**Confusion matrices obtained with quantum support vector machine (QSVM) classifier: (

**a**) highest and (

**b**) lowest accuracy.

**Figure 7.**QSVM and SVM performances with different qubit numbers according to Data Case 1 (

**a**), Data Case 2 (

**b**), Data Case 3 (

**c**), Data Case 4 (

**d**), Data Case 6 (

**e**), Data Case 6 (

**f**), and Data Case 7 (

**g**).

Merged Rhythms | New Class |
---|---|

AF + AFIB | AFIB |

SVT + AT + SAAWR + SINT + AVNRT + AVRT | GSVT |

SB | SB |

SR + SI | SR |

Method | Amount of Data | ||||||
---|---|---|---|---|---|---|---|

Data Case 1 | Data Case 2 | Data Case 3 | Data Case 4 | Data Case 5 | Data Case 6 | Data case 7 | |

209 | 418 | 625 | 800 | 1031 | 1534 | 3133 | |

Qubit = 3 | |||||||

SVM | 65.09 ± 6.03 | 70.29 ± 2.95 | 72.14 ± 2.61 | 72.56 ± 2.60 | 77.23 ± 2.58 | 73.25 ± 2.17 | 74.50 ± 0.86 |

QSVM | 59.51 ± 7.06 | 66.85 ± 5.08 | 68.73 ± 2.62 | 69.40 ± 2.56 | 73.88 ± 3.15 | 72.73 ± 2.26 | 74.46 ± 1.27 |

Qubit = 5 | |||||||

SVM | 69.03 ± 6.12 | 72.94 ± 3.73 | 74.90 ± 3.11 | 75.32 ± 2.44 | 77.29 ± 3.58 | 76.51 ± 2.05 | 77.94 ± 1.21 |

QSVM | 62.78 ± 4.98 | 67.72 ± 5.28 | 71.46 ± 2.74 | 72.36 ± 2.86 | 74.66 ± 4.04 | 75.54 ± 1.61 | 78.06 ± 1.69 |

Qubit = 7 | |||||||

SVM | 69.23 ± 5.28 | 76.42 ± 4.60 | 78.11 ± 3.79 | 78.57 ± 2.23 | 79.12 ± 2.40 | 80.39 ± 1.84 | 81.95 ± 1.19 |

QSVM | 65.76 ± 5.17 | 69.17 ± 3.75 | 75.45 ± 3.09 | 76.62 ± 2.59 | 76.17 ± 2.96 | 79.13 ± 1.72 | 81.82 ± 1.47 |

Qubit = 9 | |||||||

SVM | 71.93 ± 4.04 | 78.59 ± 4.35 | 79.70 ± 3.21 | 79.92 ± 2.16 | 80.00 ± 2.18 | 81.40 ± 1.51 | 83.17 ± 1.38 |

QSVM | 71.05 ± 6.10 | 69.32 ± 3.44 | 78.73 ± 2.94 | 77.21 ± 3.31 | 79.44 ± 2.87 | 79.53 ± 1.61 | 82.73 ± 1.13 |

Qubit = 11 | |||||||

SVM | 74.23 ± 4.87 | 78.16 ± 3.87 | 79.70 ± 3.21 | 80.37 ± 2.16 | 80.87 ± 2.24 | 81.52 ± 1.61 | - |

QSVM | 72.69 ± 6.10 | 72.12 ± 3.10 | 78.73 ± 2.94 | 79.35 ± 1.86 | 77.98 ± 1.86 | 79.70 ± 1.90 | - |

**Table 3.**Comparisons of quantum support vector machine (QSVM) and support vector machine (SVM) classifier performance metrics, detailed.

Classifier | Performance Metrics (%) | ||||
---|---|---|---|---|---|

Class | Precision | Sensitivity | Specificity | F1-Score | |

QSVM | AFIB | 61.53 | 50.52 | 92.82 | 55.48 |

GSVT | 77.41 | 82.05 | 92.83 | 79.66 | |

SB | 90.22 | 97.82 | 93.98 | 93.86 | |

SR | 81.69 | 77.67 | 95.07 | 79.62 | |

SVM | AFIB | 57.25 | 37.36 | 91.92 | 45.21 |

GSVT | 71.85 | 82.90 | 87.58 | 76.98 | |

SB | 89.62 | 98.64 | 91.21 | 93.91 | |

SR | 6.38 | 5.55 | 94.44 | 5.93 |

Classifier | Performance Metrics (%) | ||||
---|---|---|---|---|---|

Class | Precision | Sensitivity | Specificity | F1-Score | |

QSVM(H) | AFIB | 75.34 | 53.65 | 95.56 | 62.67 |

GSVT | 77.73 | 90.05 | 93.15 | 83.43 | |

SB | 95.51 | 100.00 | 96.89 | 97.70 | |

SR | 79.39 | 81.44 | 95.01 | 80.40 | |

QSVM(L) | AFIB | 38.09 | 38.09 | 84.33 | 38.08 |

GSVT | - | 0 | - | 84.61 | |

SB | 55.71 | 97.50 | 51.56 | 70.90 | |

SR | 23.07 | 11.11 | 87.01 | 14.99 |

Reference | Classifier | Accuracy (%) | F1—Score | Sensitivity | Specificity |
---|---|---|---|---|---|

Aziz et al. [29] | SVM MLP | 84.2 90.7 | - - | - - | - - |

Sepahvand et al. [30] | Teacher Model CNN Student Model CNN | 98.96 98.13 | 98.65 96.47 | 98.01 95.82 | 98.00 97.86 |

Faust et al. [31] | ResNet | 99.98 | - | 99.94 | 100.00 |

Dhananjay et al. [32] | SVM CatBoost | 71.00 99.00 | 66.11 99.00 | 72.50 99.17 | - - |

Murat et al. [18] | K-NN | 80.94 | 77.92 | 78.03 | 93.75 |

SVM | 84.06 | 80.49 | 81.13 | 94.77 | |

RF | 90.30 | 88.52 | 88.65 | 96.86 | |

NB | 79.90 | 75.71 | 76.42 | 93.38 | |

GBC | 87.68 | 85.21 | 85.53 | 96.03 | |

ABC | 77.27 | 72.81 | 73.36 | 92.72 | |

DTC | 85.78 | 83.46 | 83.54 | 95.41 | |

MLP | 77.71 | 74.20 | 75.34 | 92.76 | |

QDA | 77.01 | 72.79 | 73.62 | 92.44 | |

Baygin et al. [33] | SVM | 97.18 | - | - | - |

Proposed Method | SVM QSVM | 86.96 84.64 | 82.41 81.15 | 81.70 81.13 | 95.61 95.00 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Ozpolat, Z.; Karabatak, M. Performance Evaluation of Quantum-Based Machine Learning Algorithms for Cardiac Arrhythmia Classification. *Diagnostics* **2023**, *13*, 1099.
https://doi.org/10.3390/diagnostics13061099

**AMA Style**

Ozpolat Z, Karabatak M. Performance Evaluation of Quantum-Based Machine Learning Algorithms for Cardiac Arrhythmia Classification. *Diagnostics*. 2023; 13(6):1099.
https://doi.org/10.3390/diagnostics13061099

**Chicago/Turabian Style**

Ozpolat, Zeynep, and Murat Karabatak. 2023. "Performance Evaluation of Quantum-Based Machine Learning Algorithms for Cardiac Arrhythmia Classification" *Diagnostics* 13, no. 6: 1099.
https://doi.org/10.3390/diagnostics13061099