A Heartbeat Classifier for Continuous Prediction Using a Wearable Device
Abstract
:1. Introduction
2. Automated Heartbeats Classification
3. Materials and Methods
3.1. Dataset and Features
3.2. Oversampling
3.3. Train the Classifiers
4. Results
5. Real-Case Experiment
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Charlton, J.; Murphy, M.E.; Khaw, K.T.; Ebrahim, S.B.; Davey Smith, G. Cardiovascular diseases. In The Health of Adult Britain 1841–1994; Charlton, J., Murphy, M., Eds.; Stationery Office: London, UK, 1997; Volume 2, pp. 60–81. [Google Scholar]
- Gilgen-Ammann, R.; Schweizer, T.; Wyss, T. RR interval signal quality of a heart rate monitor and an ECG Holter at rest and during exercise. Eur. J. Appl. Physiol. 2019, 119, 1525–1532. [Google Scholar] [CrossRef] [PubMed]
- Polar Electro. Polar H10 Heart Rate Sensor System. Polar Res. Technol. 2019, 1, 6–11. [Google Scholar]
- Pramukantoro, E.S.; Gofuku, A. A study of bluetooth low energy (BLE) frameworks on the IoT based heart monitoring system. In Proceedings of the 2021 IEEE 3rd Global Conference on Life Sciences and Technologies (LifeTech), Nara, Japan, 5–11 March 2021; pp. 108–110. [Google Scholar]
- Polar Electro. Let’s build products together. Available online: https://www.polar.com/en/developers (accessed on 5 July 2021).
- Pramukantoro, E.S.; Gofuku, A. A study of Real-Time HRV Analysis Using a Commercial Wearable Device. In Proceedings of the 6th International Conference on Sustainable Information Engineering and Technology 2021, Malang, Indonesia, 13–14 September 2021; pp. 216–220. [Google Scholar]
- Luz, E.J.d.S.; Schwartz, W.R.; Cámara-Chávez, G.; Menotti, D. ECG-based heartbeat classification for arrhythmia detection: A survey. Comput. Methods Programs Biomed. 2016, 127, 144–164. [Google Scholar] [CrossRef]
- Alkhodari, M.; Islayem, D.K.; Alskafi, F.A.; Khandoker, A.H. Predicting hypertensive patients with higher risk of developing vascular events using heart rate variability and machine learning. IEEE Access 2020, 8, 192727–192739. [Google Scholar] [CrossRef]
- Taye, G.T.; Hwang, H.J.; Lim, K.M. Application of a convolutional neural network for predicting the occurrence of ventricular tachyarrhythmia using heart rate variability features. Sci. Rep. 2020, 10, 6769. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Speer, K.E.; Semple, S.; Naumovski, N.; McKune, A.J. Measuring heart rate variability using commercially available devices in healthy children: A validity and reliability study. Eur. J. Investig. Heal. Psychol. Educ. 2020, 10, 390–404. [Google Scholar] [CrossRef] [Green Version]
- Hinde, K.; White, G.; Armstrong, N. Wearable Devices Suitable for Monitoring Twenty Four Hour Heart Rate Variability in Military Populations. Sensors 2021, 21, 1061. [Google Scholar] [CrossRef]
- Mark, R.; Moody, G. The impact of the MIT-BIH Arrhythmia Database. IEEE Eng. Med. Biol. Mag. 2001, 20, 45–50. [Google Scholar] [CrossRef]
- Lemaître, G.; Nogueira, F.; Aridas, C.K. Imbalanced-learn: A python toolbox to tackle the curse of imbalanced datasets in machine learning. J. Mach. Learn. Res. 2017, 18, 1–5. [Google Scholar]
- AAMI EC57; Testing and Reporting Performance Results of Cardiac Rhythm and ST Segment Measurement Algorithms. Association for the Advancement of Medical Instrumentation: Washington, DC, USA, 1998.
- Dukes, J.W.; Dewland, T.A.; Vittinghoff, E.; Mandyam, M.C.; Heckbert, S.R.; Siscovick, D.S.; Stein, P.K.; Psaty, B.M.; Sotoodehnia, N.; Gottdiener, J.S.; et al. Ventricular Ectopy as a Predictor of Heart Failure and Death. J. Am. Coll. Cardiol. 2015, 66, 101–109. [Google Scholar] [CrossRef] [Green Version]
- Acharya, T.; Tringali, S.; Bhullar, M.; Nalbandyan, M.; Ilineni, V.K.; Carbajal, E.; Deedwania, P. Frequent Atrial Premature Complexes and Their Association with Risk of Atrial Fibrillation. Am. J. Cardiol. 2015, 116, 1852–1857. [Google Scholar] [CrossRef]
- Ebrahimi, Z.; Loni, M.; Daneshtalab, M.; Gharehbaghi, A. A review on deep learning methods for ECG arrhythmia classification. Expert Syst. Appl. X 2020, 7, 100033. [Google Scholar] [CrossRef]
- Rodrigues, P.R.F.; da Silva Monteiro Filho, J.M.; do Vale Madeiro, J.P. The issue of automatic classification of heartbeats. In Developments and Applications for ECG Signal Processing: Modeling, Segmentation, and Pattern Recognition; Academic Press: Cambridge, MA, USA, 2018; pp. 169–193. [Google Scholar]
- Lin, C.C.; Yang, C.M. Heartbeat classification using normalized RR intervals and morphological features. Math. Probl. Eng. 2014. [Google Scholar] [CrossRef]
- Tsipouras, M.G.; Fotiadis, D.I.; Sideris, D. An arrhythmia classification system based on the RR-interval signal. Artif. Intell. Med. 2005, 33, 237–250. [Google Scholar] [CrossRef] [PubMed]
- Lian, J.; Wang, L.; Muessig, D. A simple method to detect atrial fibrillation using RR intervals. Am. J. Cardiol. 2011, 107, 1494–1497. [Google Scholar] [CrossRef]
- Xiang, Y.; Luo, J.; Zhu, T.; Wang, S.; Xiang, X.; Meng, J. ECG-Based heartbeat classification using two-level convolutional neural network and RR interval difference. IEICE Trans. Inf. Syst. 2018, E101D, 1189–1198. [Google Scholar] [CrossRef] [Green Version]
- Sannino, G.; De Pietro, G. A deep learning approach for ECG-based heartbeat classification for arrhythmia detection. Future Gener. Comput. Syst. 2018, 86, 446–455. [Google Scholar] [CrossRef]
- Tyagi, A.; Mehra, R. Intellectual heartbeats classification model for diagnosis of heart disease from ECG signal using hybrid convolutional neural network with GOA. SN Appl. Sci. 2021, 3, 265. [Google Scholar] [CrossRef]
- Saenz-Cogollo, J.F.; Agelli, M. Investigating feature selection and random forests for inter-patient heartbeat classification. Algorithms 2020, 13, 75. [Google Scholar] [CrossRef] [Green Version]
- Mondéjar-Guerra, V.; Novo, J.; Rouco, J.; Penedo, M.G.; Ortega, M. Heartbeat classification fusing temporal and morphological information of ECGs via ensemble of classifiers. Biomed. Signal Process. Control 2019, 47, 41–48. [Google Scholar] [CrossRef]
- Pan, J.; Tompkins, W.J. A real-time QRS detection algorithm. IEEE Trans. Biomed. Eng. 1985, BME-32, 230–236. [Google Scholar] [CrossRef] [PubMed]
- De Chazal, P.; O’Dwyer, M.; Reilly, R.B. Automatic classification of heartbeats using ECG morphology and heartbeat interval features. IEEE Trans. Biomed. Eng. 2004, 51, 1196–1206. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Abadi, M.; Agarwal, A.; Barham, P.; Brevdo, E.; Chen, Z.; Citro, C.; Corrado, G.S.; Davis, A.; Dean, J.; Devin, M.; et al. TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. 2015. Available online: tensorflow.org (accessed on 7 September 2021).
- Marinho, L.B.; de MM Nascimento, N.; Souza, J.W.M.; Gurgel, M.V.; Rebouças Filho, P.P.; de Albuquerque, V.H.C. A novel electrocardiogram feature extraction approach for cardiac arrhythmia classification. Future Gener. Comput. Syst. 2019, 97, 564–577. [Google Scholar] [CrossRef]
- Chen, S.; Hua, W.; Li, Z.; Li, J.; Gao, X. Heartbeat classification using projected and dynamic features of ECG signal. Biomed. Signal Process. Control 2017, 31, 165–173. [Google Scholar] [CrossRef]
- Ghorbani Afkhami, R.; Azarnia, G.; Tinati, M.A. Cardiac arrhythmia classification using statistical and mixture modeling features of ECG signals. Pattern Recognit. Lett. 2016, 70, 45–51. [Google Scholar] [CrossRef]
- Huang, H.; Liu, J.; Zhu, Q.; Wang, R.; Hu, G. A new hierarchical method for inter-patient heartbeat classification using random projections and RR intervals. BioMed. Eng. Online 2014, 13, 90. [Google Scholar] [CrossRef] [Green Version]
- Li, Y.; He, Z.; Wang, H.; Li, B.; Li, F.; Gao, Y.; Ye, X. CraftNet: A deep learning ensemble to diagnose cardiovascular diseases. Biomed. Signal Process. Control 2020, 62, 102091. [Google Scholar] [CrossRef]
Normal (N) | Supraventricular Ectopic Beat (SVEB) | Ventricular Ectopic Beat (VEB) | Fusion Beat (F) | Unknown Beat (Q) |
---|---|---|---|---|
Normal beat (N) | Atrial premature beat (A) | Premature ventricular contraction (V) | Fusion of ventricular and normal beat (F) | Paced beat (/) |
Left bundle branch block (L) | Aberrated atrial premature beat (a) | Ventricular escape beat (E) | Fusion of paced and normal beat (f) | |
Right bundle branch block (R) | Nodal (junctional) premature beat (J) | Unclassified beat (Q) | ||
Atrial escape beat (e) | Supraventricular premature beat (S) | |||
Nodal junctional escape beat (j) |
Features Series | Descriptions |
---|---|
RR0 | Current RRi value |
RR-1 | Previous RRi value |
RR+1 | Next RRi value |
RR0/avgRR | Current RRi/average of RRi within 42 s |
tRR0 | (CurrentRR-averageRR)/stddevRR |
RR-1/avgRR | Previous RRi/average of RRi |
RR-1/RR0 | Previous RRi/ current RRi within 42 s |
RR+1/avgRR | Next RRi, average of RRi within 42 s |
RR+1/RR0 | Next RRi, current RRi |
Original | ROS | SMOTE | ADASYN | |
---|---|---|---|---|
number of N | 90,125 | 90,125 | 90,125 | 90,125 |
number of S | 2781 | 90,125 | 90,125 | 90,332 |
number of V | 7009 | 90,125 | 90,125 | 89,215 |
number of F | 803 | 90,125 | 90,125 | 90,293 |
number of Q | 15 | 90,125 | 90,125 | 90,120 |
Model | Parameter |
---|---|
DT | default |
GB | estimator = 100, learning rate = 0.1, max. depth = 3, random state = 0. |
kNN | k = 3. |
MLP | network solver = adam, alpha=1e-5, hidden layer = 128, input layer = 9 output layer = 5, max iteration = 600, random state = 42. |
RF | tree = 30, random state = 42. |
SVM | kernel = RBF, gamma = 0.8, C = 1. |
Layer (Type) | Output Shape | Param |
---|---|---|
dense (Dense) | 314,857, 9 | 80 |
dense_1 (Dense) | 314,857, 64 | 576 |
dense_2 (Dense) | 314,857, 128 | 8320 |
dense_3 (Dense) | 314,857, 512 | 66,048 |
dense_4 (Dense) | 314,857, 128 | 65,664 |
dense_5 (Dense) | 314,857, 64 | 8256 |
dense_6 (Dense) | 314857, 5 | 325 |
Protocol Split | Random Split | Oversampling | ||||
---|---|---|---|---|---|---|
Train | Test | Train | Test | Train | Test | |
number of N | 45,866 | 44,259 | 63,150 | 26,975 | 63,050 | 27,075 |
number of S | 944 | 1837 | 1973 | 808 | 63,225 | 26900 |
number of V | 3788 | 3221 | 4845 | 2164 | 63042 | 27,083 |
number of F | 415 | 388 | 536 | 267 | 63,076 | 27049 |
number of Q | 8 | 7 | 9 | 6 | 63,044 | 27,081 |
Total | 51,021 | 49,712 | 70,513 | 30,220 | 315,437 | 135,188 |
Method | Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) |
---|---|---|---|---|
DT | 89.15 | 88.30 | 89.15 | 88.64 |
GB | 89.08 | 89.10 | 89.08 | 88.44 |
KNN | 90.76 | 88.42 | 90.76 | 89.42 |
NN | 92.50 | 91.36 | 92.50 | 91.46 |
RF | 91.81 | 89.24 | 91.81 | 90.29 |
SVM | 92.57 | 90.23 | 92.57 | 90.81 |
ANN | 91.44 | 88.59 | 91.04 | 89.72 |
Classifier | ||||||
---|---|---|---|---|---|---|
Reference | n | s | v | f | q | |
N | 43,588 | 49 | 622 | 0 | 0 | |
S | 1159 | 79 | 599 | 0 | 0 | |
V | 808 | 64 | 2349 | 0 | 0 | |
F | 385 | 0 | 3 | 0 | 0 | |
Q | 6 | 1 | 0 | 0 | 0 |
Classifier | ||||||
---|---|---|---|---|---|---|
Reference | n | s | v | f | q | |
N | 43,170 | 199 | 872 | 18 | 0 | |
S | 789 | 279 | 768 | 1 | 0 | |
V | 619 | 55 | 2535 | 12 | 0 | |
F | 382 | 0 | 5 | 1 | 0 | |
Q | 6 | 0 | 1 | 0 | 0 |
Method | Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) |
---|---|---|---|---|
DT | 94.08 | 94.12 | 94.08 | 94.10 |
GB | 95.57 | 95.29 | 95.57 | 95.21 |
KNN | 95.08 | 94.50 | 95.08 | 94.53 |
NN | 95.82 | 95.53 | 95.82 | 95.46 |
RF | 96.22 | 95.94 | 96.21 | 95.89 |
SVM | 95.05 | 93.97 | 95.05 | 94.35 |
ANN | 96.35 | 96.07 | 96.35 | 96.09 |
Classifier | ||||||
---|---|---|---|---|---|---|
Reference | n | s | v | f | q | |
N | 26,734 | 20 | 206 | 15 | 0 | |
S | 129 | 594 | 85 | 0 | 0 | |
V | 420 | 43 | 1698 | 3 | 0 | |
F | 211 | 0 | 6 | 50 | 0 | |
Q | 6 | 0 | 0 | 0 | 0 |
Classifier | ||||||
---|---|---|---|---|---|---|
Reference | n | s | v | f | q | |
N | 26,776.2 | 28 | 214.6 | 15.2 | 0 | |
S | 112.8 | 632.6 | 88.6 | 0 | 0 | |
V | 392.6 | 44.6 | 1663 | 10.8 | 0 | |
F | 178 | 0 | 9.4 | 46.6 | 0 | |
Q | 5.75 | 0.75 | 0.5 | 0 | 0 |
Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
R | S | A | R | S | A | R | S | A | R | S | A | |
DT | 99.31 | 96.50 | 96.08 | 99.32 | 96.49 | 96.07 | 99.31 | 96.50 | 96.08 | 99.31 | 96.49 | 96.06 |
GB | 89.57 | 86.73 | 78.26 | 89.62 | 86.70 | 77.94 | 89.57 | 86.73 | 78.26 | 89.55 | 86.67 | 78.01 |
KNN | 98.93 | 97.55 | 97.49 | 98.99 | 97.71 | 97.56 | 98.97 | 97.68 | 97.49 | 98.96 | 97.64 | 97.44 |
NN | 89.88 | 90.06 | 84.48 | 90.17 | 90.19 | 84.54 | 89.88 | 90.06 | 84.48 | 89.81 | 89.96 | 84.23 |
RF | 99.67 | 98.15 | 98.08 | 99.67 | 98.15 | 98.09 | 99.67 | 98.15 | 98.08 | 99.67 | 98.14 | 98.07 |
SVM | 87.87 | 87.43 | 79.83 | 87.93 | 87.46 | 79.59 | 87.87 | 87.43 | 79.83 | 87.78 | 87.32 | 79.39 |
ANN | 97.51 | 96.20 | 95.85 | 97.54 | 96.22 | 95.81 | 97.51 | 96.20 | 95.85 | 97.49 | 96.18 | 95.83 |
Classifier | ||||||
---|---|---|---|---|---|---|
Reference | n | s | v | f | q | |
N | 26,626 | 32 | 370 | 44 | 2 | |
S | 0 | 26,900 | 0 | 0 | 0 | |
V | 0 | 0 | 27,083 | 0 | 0 | |
F | 0 | 0 | 0 | 27,049 | 0 | |
Q | 0 | 0 | 0 | 0 | 27,081 |
Classifier | ||||||
---|---|---|---|---|---|---|
Reference | n | s | v | f | q | |
N | 26,148 | 141 | 576 | 205 | 5 | |
S | 0 | 26,900 | 0 | 0 | 0 | |
V | 0 | 0 | 27,083 | 0 | 0 | |
F | 0 | 0 | 0 | 27,049 | 0 | |
Q | 0 | 0 | 0 | 0 | 27,081 |
Classifier | ||||||
---|---|---|---|---|---|---|
Reference | n | s | v | f | q | |
N | 24,773.4 | 255.8 | 943.4 | 1073.6 | 27.8 | |
S | 84.2 | 26,670.75 | 146.5 | 2.4 | 0 | |
V | 334.4 | 123.8 | 26,277.75 | 310.4 | 0.4 | |
F | 50 | 0 | 13.6 | 26,992 | 0 | |
Q | 0 | 0 | 0 | 0 | 27,082 |
Classifier | Feature | No. of Features | Data Scheme | Class | Accuracy (%) |
---|---|---|---|---|---|
Ensemble SVM [26] | RR interval, HOS, wavelet, time domain, morphology | 45 | Inter-patient | 5 | 94.5 |
Random Forest [25] | RR interval, HBF, time domain, morphology | 6 | Inter-patient | 5 | 96.14 |
Naïve bayes [30] | HOS | 4 | Inter-patient | 5 | 94 |
SVM [31] | RR-Interval, DCT Random projection | 33 | Inter-patient | 5 | 93.1 |
Ensemble of BDT [32] | RR-interval, DCT random projection | 33 | Inter-patient | 5 | 96.15 |
Ensemble SVM [33] | RR-Interval, Random projection | 101 | Inter-patient | 5 | 93.8 |
Deep neural network [34] | RR interval, Wavelet, HOS, morphologcy | 45 | Inter-patient | 4 | 89.25 |
This work (SVM) | RR interval | 9 | Inter-patient | 5 | 92.57 |
This work (NN) | RR interval | 9 | Inter-patient | 5 | 92.50 |
This work (RF) | RR interval | 9 | Intra-patient | 5 | 96.22 |
This work (ANN) | RR interval | 9 | Intra-patient | 5 | 96.35 |
This work (RF) | RR interval | 9 | Intra-patient(O) | 5 | 99.67 |
This work (DT) | RR interval | 9 | Intra-patient(O) | 5 | 99.31 |
Average Processing Time (Second) | Found Beat | Number Beats | Average RSSI (dBm) | |||||
---|---|---|---|---|---|---|---|---|
N | S | V | F | Q | ||||
RF | 0.108739 | 1172 | 0 | 0 | 0 | 0 | 1172 | −49.15 |
ANN | 0.043825 | 1172 | 0 | 0 | 0 | 0 | 1172 | −62.80 |
ANN-ROS | 0.043033 | 1177 | 0 | 0 | 0 | 0 | 1177 | −69.98 |
DT-ROS | 0.000359437 | 1169 | 0 | 0 | 0 | 0 | 1169 | −67.23 |
RF-SMOT | 0.108851 | 1177 | 0 | 0 | 0 | 0 | 1177 | −64.63 |
KNN-ROS | 0.001943876 | 1171 | 0 | 0 | 0 | 0 | 1177 | −52.47 |
RF-ROS | 0.10563 | 1176 | 0 | 0 | 0 | 0 | 1176 | −45.032 |
Participant | Age | Gender | Found Beat | Average RSSI (dBm) | ||||
---|---|---|---|---|---|---|---|---|
N | S | V | F | Q | ||||
1 | 33 | M | 1764 | 0 | 0 | 0 | 0 | −63.7 |
2 | 34 | M | 1773 | 0 | 0 | 0 | 0 | −59.1 |
3 | 36 | M | 1753 | 0 | 0 | 0 | 0 | −59.3 |
4 | 35 | M | 1773 | 0 | 0 | 0 | 0 | −46.9 |
5 | 28 | F | 1752 | 0 | 0 | 0 | 0 | −72.8 |
6 | 33 | F | 1772 | 0 | 0 | 0 | 0 | −60.5 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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
Pramukantoro, E.S.; Gofuku, A. A Heartbeat Classifier for Continuous Prediction Using a Wearable Device. Sensors 2022, 22, 5080. https://doi.org/10.3390/s22145080
Pramukantoro ES, Gofuku A. A Heartbeat Classifier for Continuous Prediction Using a Wearable Device. Sensors. 2022; 22(14):5080. https://doi.org/10.3390/s22145080
Chicago/Turabian StylePramukantoro, Eko Sakti, and Akio Gofuku. 2022. "A Heartbeat Classifier for Continuous Prediction Using a Wearable Device" Sensors 22, no. 14: 5080. https://doi.org/10.3390/s22145080
APA StylePramukantoro, E. S., & Gofuku, A. (2022). A Heartbeat Classifier for Continuous Prediction Using a Wearable Device. Sensors, 22(14), 5080. https://doi.org/10.3390/s22145080