gms | German Medical Science

67. Jahrestagung der Deutschen Gesellschaft für Medizinische Informatik, Biometrie und Epidemiologie e. V. (GMDS), 13. Jahreskongress der Technologie- und Methodenplattform für die vernetzte medizinische Forschung e. V. (TMF)

21.08. - 25.08.2022, online

R-Peak Detection of ECGs from Apple Watches using Neural Networks

Meeting Abstract

  • Robert Henri Horrion - Department of Medical Informatics, University of Heidelberg, Heidelberg, Germany
  • Sebastian Kaletta - Department of Medical Informatics, University of Heidelberg, Heidelberg, Germany
  • Leonhard Valentin Bamberg - Department of Medicine, University of Heidelberg, Heidelberg, Germany
  • Magdalena Smieszek - Section of Bioinformatics and Systems Cardiology, Klaus Tschira Institute for Integrative Computational Cardiology, University Hospital Heidelberg, Heidelberg, Germany; Department of Internal Medicine III (Cardiology, Angiology, and Pneumology), University Hospital Heidelberg, Heidelberg, Germany; German Centre for Cardiovascular Research (DZHK) - Partner Site Heidelberg/Mannheim, Heidelberg, Germany
  • Christoph Dieterich - Section of Bioinformatics and Systems Cardiology, Klaus Tschira Institute for Integrative Computational Cardiology, University Hospital Heidelberg, Heidelberg, Germany; Department of Internal Medicine III (Cardiology, Angiology, and Pneumology), University Hospital Heidelberg, Heidelberg, Germany; German Centre for Cardiovascular Research (DZHK) - Partner Site Heidelberg/Mannheim, Heidelberg, Germany

Deutsche Gesellschaft für Medizinische Informatik, Biometrie und Epidemiologie. 67. Jahrestagung der Deutschen Gesellschaft für Medizinische Informatik, Biometrie und Epidemiologie e. V. (GMDS), 13. Jahreskongress der Technologie- und Methodenplattform für die vernetzte medizinische Forschung e.V. (TMF). sine loco [digital], 21.-25.08.2022. Düsseldorf: German Medical Science GMS Publishing House; 2022. DocAbstr. 202

doi: 10.3205/22gmds070, urn:nbn:de:0183-22gmds0703

Published: August 19, 2022

© 2022 Horrion et al.
This is an Open Access article distributed under the terms of the Creative Commons Attribution 4.0 License. See license information at http://creativecommons.org/licenses/by/4.0/.


Outline

Text

Introduction: With an estimated 100 million devices sold, the Apple Watch is the most widely spread smartwatch worldwide [1]. Apple Watch Series 4 or newer feature a built-in single-lead electrocardiogram recorder (ECG). R-Peaks are the most characteristic waves of an ECG and central to many further analyses.

In this work, we compared the performance of existing Christov [2] and Engzee [3], [4] algorithms which detect R-peaks through adaptive thresholding with deep learning algorithms. The Deep Learning algorithms were trained on a self-collected dataset of Apple Watch ECGs. The goal was to see if we could achieve more reliable R peak detection in short and artifact-prone 30 second smartwatch ECGs.

Methods: ECGs recorded by an Apple Watch are automatically transferred to and stored on the connected iPhone. We implemented a custom data submission application by which ECG data can be sent to a server. In total, 485 single channels ECGs were recorded using Apple Watches associated with 3 of the authors (healthy males, aged 25-27) were collected. The number of ECGs submitted by each author are 233/132/80. The R-peaks in these ECGs were then manually tagged. During the tagging, 40 ECGs were excluded as they contained artifacts, that made recognition of the R-peaks impossible for the researchers. The remaining 445 ECGs were used in an 80-20 split (356 ECGs for training of which 20% for validation, 89 ECGs for testing) to train a 1-Dimensional convolutional neural network (CNN) and a Long short-term memory (LSTM) model based on 2 Bidirectional Layers with 128 LSTM Units each [5].

Results: When applied to the test data, Engzee is able to achieve ~91.89% accuracy. Christov achieves ~85.68%. The trained CNN model scores ~87.52%. In contrast, the LSTM achieves ~99.68% accuracy.

Discussion: The LSTM model accomplished a highly accurate detection of R-peaks, which is the first step to accurate heart rate variability (HRV) calculation in short single lead ECGs. Thus, Apple Watches can become an even more useful tool in medical research and personal health. The LSTM performs better than the CNN, which might be a consequence of better information flow for consecutive data points through the LSTMs cell state, which is why it is considered highly suitable for timeseries in general. Compared with adaptive thresholding algorithms, our LSTM performed much more accurately on noisy data, highlighting the performance in real world applications. Important limitations of this study are the constraint of a maximum ECG recording time to 30 seconds, as well as the small number of participants for the dataset.

Conclusions: Considering an accuracy greater than 99% as with the LSTM, a reliable HRV analysis becomes possible. Further filtering methods could be applied, such as evaluating each RR-interval between two heartbeats. A sudden drastic change would indicate that a specific R-peak isn't detected correctly. Our pilot implementation will provide the foundation for more general ECG analysis projects using smartwatches.

The authors declare that they have no competing interests.

The authors declare that an ethics committee vote is not required.


References

1.
Mawston N. Wearables Jump 33% to Pre-Pandemic Levels [Internet]. Strategy Analytics; 2021 [cited 2021 Sep 25]. Available from: https://www.strategyanalytics.com/access-services/devices/wearables/reports/report-detail/wearables-jump-33-to-pre-pandemic-levels External link
2.
Christov II. Real time electrocardiogram QRS detection using combined adaptive threshold. Biomed Eng OnLine. 2004 Aug 27;3:28. DOI: 10.1186/1475-925X-3-28 External link
3.
Engelse WAH, Zeelenberg C. A single scan algorithm for QRS-detection and feature extraction. Comput Cardiol. 1979;(6):37–42.
4.
Lourenço A, Silva H, Fred A. ECG-based biometrics: A real time classification approach. In: 2012 IEEE International Workshop on Machine Learning for Signal Processing (MLSP); 2012 Sep 23-26; Santander, Spain. DOI: 10.1109/MLSP.2012.6349735 External link
5.
Laitala J, Jiang M, Syrjälä E, Naeini EK, Airola A, Rahmani AM, et al. Robust ECG R-peak detection using LSTM. In: SAC '20: Proceedings of the 35th Annual ACM Symposium on Applied Computing. 2020. p. 1104–11. DOI: 10.1145/3341105.3373945 External link