Skip to main content

A Personal Health Agent for Decision Support in Arrhythmia Diagnosis

  • Conference paper
  • First Online:
Information and Communication Technologies for Ageing Well and e-Health (ICT4AWE 2021, ICT4AWE 2022)

Abstract

We propose an architecture for a personal health agent (PHA) that combines machine learning and a Bayesian network (BN) for detecting and diagnosing heart disease, specifically arrhythmia. Machine learning (ML) is used for classifying a patient’s ECG signal. Four ML models, i.e. gradient boosting, random forest, multilayer perceptron and support vector machine, are compared and evaluated using a dataset of 5,340 records containing 12-lead ECG signals created from the Chapman-Shaoxing database. Among the four models, the gradient boosting model produces the best accuracy of 82.88% when classifying an ECG signal as either atrial fibrillation, other arrhythmia, or no arrhythmia. The detected pattern is integrated into a BN that captures expert knowledge about the causes of arrhythmia. The BN structure and parameters are informed by expert knowledge from the literature and evaluated using Pitchforth and Mengersen’s framework. The agent uses a decision support module to guide the diagnosis process. It suggests what questions to ask to increase certainty of the presence of arrhythmia, and it suggests what arrhythmia causes to follow up. This is achieved using sensitivity analysis and diagnostic Bayesian reasoning respectively. The architecture is evaluated using application use cases.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://github.com/mbithenzomo/personal-health-agent-ml.

  2. 2.

    https://www.norsys.com/download.html.

  3. 3.

    https://www.norsys.com/WebHelp/NETICA/X_AutoNetica.htm.

  4. 4.

    https://www.norsys.com/netica-j.html#download.

References

  1. Adeleke, J.A., Moodley, D., Rens, G., Adewumi, A.O.: Integrating statistical machine learning in a semantic sensor web for proactive monitoring and control. Sensors 17(4), 807 (2017). https://doi.org/10.3390/s17040807

    Article  Google Scholar 

  2. Al Rahhal, M.M., Bazi, Y., Al Zuair, M., Othman, E., BenJdira, B.: Convolutional neural networks for electrocardiogram classification. J. Med. Biol. Eng. 38(6), 1014–1025 (2018). https://doi.org/10.1007/s40846-018-0389-7

    Article  Google Scholar 

  3. Alday, E.A.P., et al.: Classification of 12-lead ECGs: the PhysioNet/Computing in Cardiology Challenge 2020. Physiol. Measur. 41(12), 124003 (2020). https://doi.org/10.1088/1361-6579/abc960

    Article  MathSciNet  Google Scholar 

  4. Ang, C.: Visualizing the world’s population by age group (2021). https://www.visualcapitalist.com/the-worlds-population-2020-by-age/. Accessed 12 Aug 2022

  5. Chen, S.H., Pollino, C.A.: Good practice in Bayesian network modelling. Environ. Model. Softw. 37, 134–145 (2012). https://doi.org/10.1016/j.envsoft.2012.03.012

    Article  Google Scholar 

  6. Chung, M.K., et al.: Lifestyle and risk factor modification for reduction of atrial fibrillation: a scientific statement from the American Heart Association. Circulation 141(16), e750–e772 (2020). https://doi.org/10.1161/CIR.0000000000000748

    Article  Google Scholar 

  7. Clifford, G.D., et al.: AF classification from a short single lead ECG recording: the PhysioNet/Computing in Cardiology Challenge 2017. In: 2017 Computing in Cardiology (CinC), pp. 1–4. IEEE (2017). https://doi.org/10.22489/CinC.2017.065-469

  8. Coromilas, E.J., et al.: Worldwide survey of COVID-19-associated arrhythmias. Circ.: Arrhythmia Electrophysiol. 14(3), e009458 (2021). https://doi.org/10.1161/CIRCEP.120.009458

    Article  Google Scholar 

  9. De Oliveira, L.S., Andreão, R.V., Sarcinelli-Filho, M.: Detection of premature ventricular beats in ECG records using Bayesian networks involving the P-wave and fusion of results. In: 2010 Annual International Conference of the IEEE Engineering in Medicine and Biology, pp. 1131–1134. IEEE (2010). https://doi.org/10.1109/IEMBS.2010.5627116

  10. De Oliveira, L.S., Andreão, R.V., Sarcinelli-Filho, M.: Premature ventricular beat classification using a dynamic Bayesian network. In: 2011 Annual International Conference of the IEEE Engineering in Medicine and Biology Society, pp. 4984–4987. IEEE (2011). https://doi.org/10.1109/IEMBS.2011.6091235

  11. De Oliveira, L.S.C., Andreão, R.V., Sarcinelli-Filho, M.: The use of Bayesian networks for heart beat classification. In: Hussain, A., Aleksander, I., Smith, L., Barros, A., Chrisley, R., Cutsuridis, V. (eds.) Brain Inspired Cognitive Systems 2008. AEMB, vol. 657, pp. 217–231. Springer, Cham (2010). https://doi.org/10.1007/978-0-387-79100-5_12

    Chapter  Google Scholar 

  12. Drake, R., Moodley, D.: INVEST: ontology driven Bayesian Networks for investment decision making on the JSE. In: Second Southern African Conference for Artificial Intelligence Research, pp. 252–273 (2022)

    Google Scholar 

  13. Fuster-Parra, P., Tauler, P., Bennasar-Veny, M., Ligeza, A., Lopez-Gonzalez, A., Aguiló, A.: Bayesian network modeling: a case study of an epidemiologic system analysis of cardiovascular risk. Comput. Methods Programs Biomed. 126, 128–142 (2016). https://doi.org/10.1016/j.cmpb.2015.12.010

    Article  Google Scholar 

  14. Geselowitz, D.B.: On the theory of the electrocardiogram. Proc. IEEE 77(6), 857–876 (1989). https://doi.org/10.1109/5.29327

    Article  Google Scholar 

  15. Ghosh, J.K., Valtorta, M.: Building a Bayesian network model of heart disease. In: 38th Annual on Southeast Regional Conference (ACM-SE 38), pp. 239–240 (2000). https://doi.org/10.1145/1127716.1127770

  16. Hagiwara, Y., et al.: Computer-aided diagnosis of atrial fibrillation based on ECG signals: a review. Inf. Sci. 467, 99–114 (2018). https://doi.org/10.1016/j.ins.2018.07.063

    Article  Google Scholar 

  17. Harmelen, F.: Preface: the 3rd AI wave is coming, and it needs a theory. In: Neuro-Symbolic Artificial Intelligence: The State of the Art, pp. V–VII. IOS Press BV (2022). https://doi.org/10.3233/FAIA210347-fm

  18. Hartikainen, S., et al.: Effectiveness of the chest strap electrocardiogram to detect atrial fibrillation. Am. J. Cardiol. 123(10), 1643–1648 (2019). https://doi.org/10.1016/j.amjcard.2019.02.028

    Article  Google Scholar 

  19. Hastie, T., Tibshirani, R., Friedman, J.: Model assessment and selection. In: Hastie, T., Tibshirani, R., Friedman, J. (eds.) The Elements of Statistical Learning: Data Mining, Inference, and Prediction, 2nd edn., pp. 219–259. Springer, New York (2009). https://doi.org/10.1007/978-0-387-84858-7_7

    Chapter  MATH  Google Scholar 

  20. Klabunde, R.E.: Cardiac electrophysiology: normal and ischemic ionic currents and the ECG. Adv. Physiol. Educ. 41(1), 29–37 (2017). https://doi.org/10.1152/advan.00105.2016

    Article  Google Scholar 

  21. Korb, K.B., Nicholson, A.E.: Bayesian Artificial Intelligence. CRC Press (2011)

    Google Scholar 

  22. Kornej, J., Börschel, C.S., Benjamin, E.J., Schnabel, R.B.: Epidemiology of atrial fibrillation in the 21st century: novel methods and new insights. Circ. Res. 127(1), 4–20 (2020). https://doi.org/10.1001/jama.2019.18058

    Article  Google Scholar 

  23. Kusumoto, F.M.: ECG Interpretation: From Pathophysiology to Clinical Application. Springer, Boston (2009). https://doi.org/10.1007/978-0-387-88880-4

    Book  Google Scholar 

  24. Kyrimi, E., Neves, M.R., McLachlan, S., Neil, M., Marsh, W., Fenton, N.: Medical idioms for clinical Bayesian network development. J. Biomed. Inform. 108, 103495 (2020). https://doi.org/10.1016/j.jbi.2020.103495

    Article  Google Scholar 

  25. Lau, D.H., Nattel, S., Kalman, J.M., Sanders, P.: Modifiable risk factors and atrial fibrillation. Circulation 136(6), 583–596 (2017). https://doi.org/10.1161/CIRCULATIONAHA.116.023163

    Article  Google Scholar 

  26. Lippi, G., Sanchis-Gomar, F., Cervellin, G.: Global epidemiology of atrial fibrillation: an increasing epidemic and public health challenge. Int. J. Stroke 16(2), 217–221 (2021). https://doi.org/10.1177/1747493019897870

    Article  Google Scholar 

  27. Lu, J., et al.: Efficient hardware architecture of convolutional neural network for ECG classification in wearable healthcare device. IEEE Trans. Circuits Syst. I Regul. Pap. 68(7), 2976–2985 (2021). https://doi.org/10.1109/TCSI.2021.3072622

    Article  Google Scholar 

  28. Mayo Clinic: Heart arrhythmia (2022). https://www.mayoclinic.org/diseases-conditions/heart-arrhythmia/symptoms-causes/syc-20350668. Accessed 13 July 2022

  29. Mohammad, M., Emin, M., Bhutta, A., Gul, E.H., Voorhees, E., Afzal, M.R.: Cardiac arrhythmias associated with COVID-19 infection: state of the art review. Expert Rev. Cardiovasc. Ther. 19(10), 881–889 (2021). https://doi.org/10.1080/14779072.2021.1997589

    Article  Google Scholar 

  30. Moodley, D., Simonis, I.: A new architecture for the sensor web: the SWAP framework. In: ISWC 2006: 5th International Semantic Web Conference (2006)

    Google Scholar 

  31. Moodley, D., Simonis, I., Tapamo, J.R.: An architecture for managing knowledge and system dynamism in the worldwide sensor web. Int. J. Semant. Web Inf. Syst. (IJSWIS) 8(1), 64–88 (2012). https://doi.org/10.4018/jswis.2012010104

    Article  Google Scholar 

  32. Naccarelli, G.V., Varker, H., Lin, J., Schulman, K.L.: Increasing prevalence of atrial fibrillation and flutter in the United States. Am. J. Cardiol. 104(11), 1534–1539 (2009). https://doi.org/10.1016/j.amjcard.2009.07.022

    Article  Google Scholar 

  33. Neil, M., Fenton, N., Nielson, L.: Building large-scale Bayesian networks. Knowl. Eng. Rev. 15(3), 257–284 (2000). https://doi.org/10.1017/S0269888900003039

    Article  MATH  Google Scholar 

  34. Nguyen, T.N., Hilmer, S.N., Cumming, R.G.: Review of epidemiology and management of atrial fibrillation in developing countries. Int. J. Cardiol. 167(6), 2412–2420 (2013). https://doi.org/10.1016/j.ijcard.2013.01.184

    Article  Google Scholar 

  35. Nicholson, A.E., Twardy, C.R., Korb, K.B., Hope, L.R.: Decision support for clinical cardiovascular risk assessment. In: Pourret, O., Naim, P., Marcot, B. (eds.) Bayesian Networks: A Practical Guide to Applications, pp. 33–52. Wiley, Chichester (2008). https://doi.org/10.1002/9780470994559.ch3

  36. Olier, I., Ortega-Martorell, S., Pieroni, M., Lip, G.Y.: How machine learning is impacting research in atrial fibrillation: implications for risk prediction and future management. Cardiovasc. Res. 117(7), 1700–1717 (2021). https://doi.org/10.1093/cvr/cvab169

    Article  Google Scholar 

  37. Orphanou, K., Stassopoulou, A., Keravnou, E.: DBN-extended: a dynamic Bayesian network model extended with temporal abstractions for coronary heart disease prognosis. IEEE J. Biomed. Health Inform. 20(3), 944–952 (2015). https://doi.org/10.1109/JBHI.2015.2420534

    Article  Google Scholar 

  38. Patel, M.S., Asch, D.A., Volpp, K.G.: Wearable devices as facilitators, not drivers, of health behavior change. JAMA 313(5), 459–460 (2015). https://doi.org/10.1001/jama.2014.14781

    Article  Google Scholar 

  39. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., et al.: Scikitlearn: machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011)

    MathSciNet  MATH  Google Scholar 

  40. Pitchforth, J., Mengersen, K.: A proposed validation framework for expert elicited Bayesian networks. Expert Syst. Appl. 40(1), 162–167 (2013). https://doi.org/10.1016/j.eswa.2012.07.026

    Article  Google Scholar 

  41. Price, C.S., Moodley, D., Pillay, A.W., Rens, G.B.: An adaptive probabilistic agent architecture for modelling sugarcane growers’ decision-making. S. Afr. Comput. J. 34(1), 152–191 (2022). https://doi.org/10.18489/sacj.v34i1.857

    Article  Google Scholar 

  42. Rajakariar, K., Koshy, A.N., Sajeev, J.K., Nair, S., Roberts, L., Teh, A.W.: Accuracy of a smartwatch based single-lead electrocardiogram device in detection of atrial fibrillation. Heart 106(9), 665–670 (2020). https://doi.org/10.1136/heartjnl-2019-316004

    Article  Google Scholar 

  43. Reyna, M.A., Sadr, N., Alday, E.A.P., Gu, A., Shah, A.J., Robichaux, C.: Will two do? Varying dimensions in electrocardiography: The PhysioNet/Computing in Cardiology Challenge 2021. In: 2021 Computing in Cardiology (CinC), pp. 1–4. IEEE (2021). https://doi.org/10.23919/CinC53138.2021.9662687

  44. Scholten, J., et al.: Six-lead device superior to single-lead smartwatch ECG in atrial fibrillation detection. Am. Heart J. 253, 53–58 (2022). https://doi.org/10.1016/j.ahj.2022.06.010

    Article  Google Scholar 

  45. Scripps: Top 10 things you should know about heart rhythm (2015). https://www.scripps.org/sparkle-assets/documents/heart_rhythm_facts.pdf. Accessed 09 July 2022

  46. Sznajder, M., Łukowska, M.: Python online and offline ECG QRS detector based on the Pan-Tomkins algorithm (2017). https://zenodo.org/record/591747. Accessed 22 July 2022

  47. Uusitalo, L.: Advantages and challenges of Bayesian networks in environmental modelling. Ecol. Model. 203(3–4), 312–318 (2007). https://doi.org/10.1016/j.ecolmodel.2006.11.033

    Article  Google Scholar 

  48. Wanyana, T., Moodley, D.: An agent architecture for knowledge discovery and evolution. In: Edelkamp, S., Möller, R., Rueckert, E. (eds.) KI 2021. LNCS (LNAI), vol. 12873, pp. 241–256. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-87626-5_18

    Chapter  Google Scholar 

  49. Wanyana, T., Moodley, D., Meyer, T.: An ontology for supporting knowledge discovery and evolution. In: Gerber, A. (ed.) Southern African Conference for Artificial Intelligence Research (SACAIR), pp. 206–221 (2020)

    Google Scholar 

  50. Wanyana, T., Nzomo, M., Price, C.S., Moodley, D.: Combining machine learning and Bayesian networks for ECG interpretation and explanation. In: 8th International Conference on Information and Communication Technologies for Ageing Well and e-Health (ICT4AWE), pp. 81–92. INSTICC, SciTePress (2022). https://doi.org/10.5220/0011046100003188

  51. Wasilewski, J., Polonski, L.: An introduction to ECG interpretation. In: Gacek, A., Pedrycz, W. (eds.) ECG Signal Processing, Classification and Interpretation: A Comprehensive Framework of Computational Intelligence, pp. 1–20. Springer, Cham (2012). https://doi.org/10.1007/978-0-85729-868-3_1

    Chapter  Google Scholar 

  52. Weimann, K., Conrad, T.O.F.: Transfer learning for ECG classification. Sci. Rep. 11(1), 1–12 (2021). https://doi.org/10.1038/s41598-021-84374-8

    Article  Google Scholar 

  53. Williams, B.A., Chamberlain, A.M., Blankenship, J.C., Hylek, E.M., Voyce, S.: Trends in atrial fibrillation incidence rates within an integrated health care delivery system, 2006 to 2018. JAMA Netw. Open 3(8), e2014874–e2014874 (2020). https://doi.org/10.1001/jamanetworkopen.2020.14874

    Article  Google Scholar 

  54. Ye, J., Dobson, S., McKeever, S.: Situation identification techniques in pervasive computing: a review. Pervasive Mob. Comput. 8(1), 36–66 (2012). https://doi.org/10.1016/j.pmcj.2011.01.004

    Article  Google Scholar 

  55. 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 7(1), 1–8 (2020). https://doi.org/10.1038/s41597-020-0386-x

    Article  Google Scholar 

Download references

Acknowledgements

This work was financially supported by the Hasso Plattner Institute for Digital Engineering through the HPI Research School at UCT.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mbithe Nzomo .

Editor information

Editors and Affiliations

Appendix

Appendix

Bayes’ Rule

$$\begin{aligned} Pr(A|B) = \frac{Pr(B|A)Pr(A)}{Pr(B)} \end{aligned}$$
(1)

where Pr(A|B) is the posterior probability of A given B; Pr(B|A) is the posterior probability of B given A; and Pr(A) and Pr(B) are prior probabilities of A and B respectively.

Entropy and Mutual Information

$$\begin{aligned} ENT(X) = - \sum P(x)logP(x) \end{aligned}$$
(2)
$$\begin{aligned} MI(X|Y) = ENT(X) - ENT(X|Y) \end{aligned}$$
(3)

Hyperparameter Selection Table

Algorithm

Hyperparameter

Options

Selected Options

Gradient Boosting

n_estimators

300, 500, 800

800

criterion

friedman_mse, squared_error, mse

friedman_mse

loss

log_loss, exponential

log_loss

max_depth

1, 3, 10

3

Random Forest

n_estimators

300, 500, 800

800

criterion

gini, entropy, log_loss

entropy

max_depth

50, 100, None

None

max_features

sqrt, log2, None

sqrt

SVM

C

0.5, 1, 1.5

1.5

kernel

poly, rbf, sigmoid

rbf

gamma

scale, auto

auto

decision_function_shape

ovo, ovr

ovo

MLP

hidden_layer_sizes

N/A

(158, 100, 50)

activation

identity, logistic, tanh, relu

tanh

batch_size

auto, 64, 100

auto

solver

lbfgs, sgd, adam

adam

learning_rate

constant, invscaling, adaptive

adaptive

max_iter

200, 500, 1000, 2000

500

ML Metrics: Accuracy, Precision, Recall, F1-Score

$$\begin{aligned} Accuracy = \frac{TP+TN}{TP+TN+FP+FN} \end{aligned}$$
(4)
$$\begin{aligned} Precision = \frac{TP}{TP+FP} \end{aligned}$$
(5)
$$\begin{aligned} Recall = \frac{TP}{TP+FN} \end{aligned}$$
(6)
$$\begin{aligned} F1Score = 2*\frac{Precision*Recall}{Precision+Recall} \end{aligned}$$
(7)

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wanyana, T., Nzomo, M., Price, C.S., Moodley, D. (2023). A Personal Health Agent for Decision Support in Arrhythmia Diagnosis. In: Maciaszek, L.A., Mulvenna, M.D., Ziefle, M. (eds) Information and Communication Technologies for Ageing Well and e-Health. ICT4AWE ICT4AWE 2021 2022. Communications in Computer and Information Science, vol 1856. Springer, Cham. https://doi.org/10.1007/978-3-031-37496-8_20

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-37496-8_20

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-37495-1

  • Online ISBN: 978-3-031-37496-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics