Skip to main content
PLOS ONE logoLink to PLOS ONE
. 2020 Jan 24;15(1):e0227401. doi: 10.1371/journal.pone.0227401

Machine learning detection of Atrial Fibrillation using wearable technology

Mark Lown 1,*, Michael Brown 2, Chloë Brown 1, Arthur M Yue 3, Benoy N Shah 3, Simon J Corbett 3, George Lewith 3, Beth Stuart 1, Michael Moore 1, Paul Little 1
Editor: Elena G Tolkacheva4
PMCID: PMC6980577  PMID: 31978173

Abstract

Background

Atrial Fibrillation is the most common arrhythmia worldwide with a global age adjusted prevalence of 0.5% in 2010. Anticoagulation treatment using warfarin or direct oral anticoagulants is effective in reducing the risk of AF-related stroke by approximately two-thirds and can provide a 10% reduction in overall mortality. There has been increased interest in detecting AF due to its increased incidence and the possibility to prevent AF-related strokes. Inexpensive consumer devices which measure the ECG may have the potential to accurately detect AF but do not generally incorporate diagnostic algorithms. Machine learning algorithms have the potential to improve patient outcomes particularly where diagnoses are made from large volumes or complex patterns of data such as in AF.

Methods

We designed a novel AF detection algorithm using a de-correlated Lorenz plot of 60 consecutive RR intervals. In order to reduce the volume of data, the resulting images were compressed using a wavelet transformation (JPEG200 algorithm) and the compressed images were used as input data to a Support Vector Machine (SVM) classifier. We used the Massachusetts Institute of Technology (MIT)—Beth Israel Hospital (BIH) Atrial Fibrillation database and the MIT-BIH Arrhythmia database as training data and verified the algorithm performance using RR intervals collected using an inexpensive consumer heart rate monitor device (Polar-H7) in a case-control study.

Results

The SVM algorithm yielded excellent discrimination in the training data with a sensitivity of 99.2% and a specificity of 99.5% for AF. In the validation data, the SVM algorithm correctly identified AF in 79/79 cases; sensitivity 100% (95% CI 95.4%-100%) and non-AF in 328/336 cases; specificity 97.6% (95% CI 95.4%-99.0%).

Conclusions

An inexpensive wearable heart rate monitor and machine learning algorithm can be used to detect AF with very high accuracy and has the capability to transmit ECG data which could be used to confirm AF. It could potentially be used for intermittent screening or continuously for prolonged periods to detect paroxysmal AF. Further work could lead to cost-effective and accurate estimation of AF burden and improved risk stratification in AF.

Introduction

Atrial Fibrillation is the most common arrhythmia worldwide with a global age adjusted prevalence of 0.5% in 2010.[1] Numerous studies have reported a growing epidemic of AF with an expected doubling of its prevalence by 2030.[1]AF is linked with up to 1/3 of all strokes and as a significant proportion is asymptomatic it can often go undiagnosed.[2] There has been increased interest in detecting AF due to its increased incidence and the possibility to prevent AF-related strokes.[3] Anticoagulation treatment using warfarin or direct oral anticoagulants is effective in reducing the risk of AF-related stroke by approximately two-thirds and can provide a 10% reduction in overall mortality.[4] Screening for AF has been the subject of much recent debate by expert committees.[3]

There has been recent interest in the use of consumer devices for the detection of arrhythmias including AF.[5,6] Wrist-worn heart-rate sensors that measure heart rate using Light Emitting Diodes (LEDs) have become increasingly popular but their accuracy has been questioned and some manufacturers advise the heart rate measurement should be considered an estimate and suggest using a chest heart rate sensor for increased accuracy.[7] LED based wrist sensors have been shown to underestimate heart-rate during AF and thus may be less accurate for detecting AF.[8] Because ECG confirmation is mandated by guidelines for the diagnosis of AF, devices which sense an ECG signal may have the advantage of providing a verifiable ECG trace and would therefore be a preferred screening tool.[9] Although consumer chest heart rate sensors may be less comfortable than wrist based sensors, they are inherently designed to be compact, lightweight, unobtrusive, have long battery lives and should be accurate when used in sub-optimal settings such as during exercise. Consumer devices are now available which transmit ECG data in addition to heart rate enabling accurate AF detection by a cardiologist and automated algorithms.[10]

Consumer devices do not generally have algorithms incorporated for the detection of AF. In terms of diagnostic algorithms, machine learning has the potential to improve patient outcomes particularly where diagnoses are made from large volumes or complex patterns of data. Recently, machine learning algorithms have been developed to detect diabetic retinopathy with high accuracy[11] and to detect breast cancer metastases with a higher accuracy than pathologists.[12] In this research we aimed to investigate if an inexpensive consumer chest heart rate monitor device could be used along with a highly discriminative machine learning algorithm to accurately detect AF.

Methods

The study complies with the declaration of Helsinki, and the protocol was approved by the London—City & East Research Ethics Committee in June 2016 (ref 16/LO/1173). Informed consent was obtained from all participants (trial registration ISRCTN: 17495003). We developed the algorithm using an online database of RR intervals obtained from Holter recordings containing segments of sinus rhythm, AF and other arrhythmias.[13] We used 60 consecutive intervals to construct a Lorenz plot (a correlated scatter-plot of consecutive RR interval changes vs the previous change (ΔRR[k], ΔRR[k-1]) depicting heart rate variability). The patterns of data in the Lorenz plots for regularly irregular intervals such as bigeminy can distinguished from the more random pattern of AF.[14] We de-correlated the Lorenz plot using the following direct transformation derived from first principles (see S1 Appendix):

Y'=Y+0.5X0.75 (1)

Where X is the difference between the two consecutive, discrete RR intervals and Y is the previous value of X ie. X = RR(k)–RR(k-1) and Y = X(k-1). We then compressed the de-correlated Lorenz plot using a wavelet-transformation (as used in the JPEG 2000 image compression algorithm[15]) to reduce the volume of data (to an 8x8 pixel image) presented to the machine learning algorithm (a Gaussian Support Vector Machine (SVM)) and hence the volume of training data required. Overtraining was avoided using crossfold-validation through the dataset.[16] (K-fold cross validation partitions data into k randomly chosen subsets (or folds) of roughly equal size. One subset is used to validate the model trained using the remaining (k-1) subsets. This process is repeated k times such that each subset is used exactly once for validation. We used 5-fold cross validation and the data was split randomly across records in the entire training dataset). This process is depicted in Fig 1 which depicts the original Lorenz plots, de-correlated Lorenz plots and subsequent compressed images used to train the SVM for 60 interval segments of normal sinus rhythm, bigeminy and AF. 60 consecutive RR intervals were used for training and in the validation data.

Fig 1. Correlated de-correlated Lorenz plots, compressed images and corresponding ECG data used to train the SVM for 60 interval segments of [A] normal sinus rhythm, [B] bigeminy and [C] AF.

Fig 1

We trained the SVM using the Massachusetts Institute of Technology (MIT)—Beth Israel Hospital (BIH) Atrial Fibrillation database (comprising approximately 250 hours from 25 subjects; approximately 95 hours of AF (319 episodes), 2 hours of atrial flutter (40 episodes) and 163 hours of other rhythms) and the MIT-BIH Arrhythmia database (comprising approximately 24 hours of data from 47 subjects including complex ventricular, junctional, and supraventricular arrhythmias). We used the RR intervals and rhythms annotated in the database and did not employ a separate QRS detection algorithm. The MITBIH-AF database yielded 7,744 consecutive 60 beat sequences of AF, and 10,467 non-AF; the MIT-BIH Arrhythmia yielded 134 AF and 1404 non-AF consecutive 60-beat sequences.

We validated the algorithm using data from a case-control study of 415 participants aged > 65yrs (79 with AF at the study visit and 336 without) attending 3 general practice surgeries in Hampshire, UK for a single screening visit.[17] Following informed consent, 60 consecutive R-R intervals were obtained from participants at rest using the Polar H7 (PH7) heart rate monitor (via Bluetooth) and an iPad by study nurses. The participants each had a 12-Lead ECG, which were interpreted independently by 2 cardiologists, with a 3rd cardiologist adjudicating disagreements. The PH7 is an inexpensive device (cost price £26) and has been shown to measure RR intervals accurately.[18]

Results

Training data

In the training data, the SVM algorithm yielded excellent discrimination with a sensitivity of 99.2% and a specificity of 99.5% for AF.

Validation / Trial data

The SVM algorithm correctly identified AF in 79/79 cases; sensitivity 100% (95% CI 95.4%-100%) and non-AF in 328/336 cases; specificity 97.6% (95% CI 95.4%-99.0%). Several control cases had non-AF arrhythmias including heart block, bigeminy and sinus arrhythmia[19]. Fig 2 shows Lorenz plots (standard / correlated) for the incorrectly classified (false positive) cases.

Fig 2. Correlated Lorenz plots for the false positive cases.

Fig 2

Discussion of results

The SVM algorithm demonstrated excellent discrimination with sensitivity and specificity both exceeding 99% for the training data set. This compares favourably with other algorithms results using the same databases in the literature.[2022] Furthermore, we have validated the algorithm performance with clinical data obtained using an in expensive consumer device and achieved excellent discrimination with sensitivity and specificity both within 2% of the training data set results. High performing algorithms such as the SVM could greatly reduce clinical workload in terms of clinician confirmation of AF in positive cases. Visual inspection of the Lorenz plots of the false positive cases indicates several cases with clustering of RR intervals (case 021 and 118) which is not suggestive of atrial fibrillation and thus algorithm modifications or further training could possibly lead to improvements in performance.

The accuracy of the Polar-H7 and SVM algorithm also compares favourably with the accuracy of commercial devices designed and approved to detect AF.[23,24] The accuracy of the consumer device and algorithm was comparable to a cardiologist’s interpretation of single-lead ECGs.[25] Although it is not currently implemented commercially, a variant of the Polar-H7 device can transmit single lead ECG data which could be used to confirm the AF diagnosis. A newly available similar device that also provides a rhythm strip has been used clinically to detect AF and the ECG strip was sufficient for reliable confirmation of AF compared with a Holter monitor.[10] Smartphones are becoming more widely used among the elderly and in developing countries and in conjunction with inexpensive wearable technology, present an opportunity for cost-effective screening for AF. If these products are to be used in future for the diagnosis of AF, they would need to be registered as medical devices with either FDA approval (US) or a CE mark (EU).

Current guidelines make identical recommendations for anticoagulation regardless of AF pattern or burden (defined as the amount of time spent in AF). Reviews of recent evidence however suggests that higher AF burden is associated with higher risk of stroke[26]. Developments in monitoring technologies and algorithms will likely change the landscape of long-term AF monitoring and could allow better definition of the significance of changes in AF burden over time and to improved risk stratification and potentially improved patient outcomes. Inexpensive devices such as the Polar-H7 and Suunto Movesense[10] together with further algorithm development and implementation could lead to cost-effective methods for prolonged and continuous monitoring for AF detection. In addition, they could also potentially be used where clinically appropriate for the investigation of palpitations and syncope and the detection of other arrhythmias. The SVMs utility could potentially be used to classify patterns generated by other arrhythmias from the Lorenz plots which would potentially be an advantage over methods employing statistical analysis. This should be considered for future research.

Conclusions

An inexpensive wearable heart rate monitor and machine learning algorithm can be used to detect AF with very high accuracy and has the capability to transmit ECG data which could be used to confirm AF. It could potentially be used for intermittent screening or continuously for prolonged periods to detect paroxysmal AF. Further work could lead to cost-effective and accurate estimation of AF burden and improved risk stratification in AF.

Supporting information

S1 AFPlosOne

(XLSX)

S1 Polar data

(7Z)

S1 Appendix

(DOCX)

Acknowledgments

We thank the CRN Wessex team and in particular Kerry Gunner, Clare Grocott, Julie Kennedy, Vivian Sparshott and the trial manager Kate Martinson.

The views expressed are those of the authors(s) and not necessarily those of the NIHR, the NHS or the department of Health or Leonardo MW Ltd.

Data Availability

All relevant data has been included in the paper and the Supporting Information files.

Funding Statement

Funded by NIHR (NIHR SPCR) FR 11: Project No:318 https://www.spcr.nihr.ac.uk/projects/screening-for-atrial-fibrillation-using-economical-and-accurate-technology-safety-2013-a-pilot-study The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript. The funder provided support in the form of salaries for authors ML, but did not have any additional role in the study design, data collection and analysis, decision to publish, or preparation of the manuscript. The specific roles of these authors are articulated in the ‘author contributions’ section.” MB is affiliated with Leonardo MW Ltd. but did not receive any funding from any organisation for this work.

References

  • 1.Patel NJ, Atti V, Mitrani RD, Viles-Gonzalez JF, Goldberger JJ. Global rising trends of atrial fibrillation: a major public health concern. Heart. 2018. December;104(24):1989–1990. 10.1136/heartjnl-2018-313350 [DOI] [PubMed] [Google Scholar]
  • 2.Reiffel JA, Atrial fibrillation and stroke: epidemiology. Am J Med. 2014. April;127(4):e15–6. [DOI] [PubMed] [Google Scholar]
  • 3.Lown M, Moran P. Should we screen for atrial fibrillation? BMJ. 2019. February 13;364:l43 10.1136/bmj.l43 [DOI] [PubMed] [Google Scholar]
  • 4.Granger CB, Armaganijan LV. Newer oral anticoagulants should be used as first-line agents to prevent thromboembolism in patients with atrial fibrillation and risk factors for stroke or thromboembolism. Circulation. 2012. January 3;125(1):159–64; 10.1161/CIRCULATIONAHA.111.031146 [DOI] [PubMed] [Google Scholar]
  • 5.Turakhia MP, Desai M, Hedlin H, Rajmane A, Talati N, Ferris T et al. Rationale and design of a large-scale, app-based study to identify cardiac arrhythmias using a smartwatch: The Apple Heart Study. Am Heart J. 2019. January;207:66–75. 10.1016/j.ahj.2018.09.002 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Bonomi AG, Schipper F, Eerikäinen LM, Margarito J, van Dinther R, Muesch G, et al. Atrial Fibrillation Detection Using a Novel Cardiac Ambulatory Monitor Based on Photo-Plethysmography at the Wrist. J Am Heart Assoc. 2018. August 7;7(15): [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.https://www.suunto.com/en-gb/Content-pages/what-should-you-know-about-wrist-heart-rate2/. Accessed 01/03/2019
  • 8.Koshy AN, Sajeev JK, Nerlekar N, Brown AJ, Rajakariar K, Zureik M, et al. Smart watches for heart rate assessment in atrial arrhythmias. Int J Cardiol. 2018. September 1;266:124–127. 10.1016/j.ijcard.2018.02.073 [DOI] [PubMed] [Google Scholar]
  • 9.Freedman B, Camm J, Calkins H, Healey JS, Rosenqvist M, Wang J, et al. ; AF-Screen Collaborators. Screening for Atrial Fibrillation: A Report of the AF-SCREEN International Collaboration. Circulation. 2017. May 9;135(19):1851–1867. 10.1161/CIRCULATIONAHA.116.026693 [DOI] [PubMed] [Google Scholar]
  • 10.Hartikainen S, Lipponen JA, Hiltunen P, Rissanen TT, Kolk I, Tarvainen MP, et al. Effectiveness of the Chest Strap Electrocardiogram to Detect Atrial Fibrillation. Am J Cardiol. 2019. February 23. [DOI] [PubMed] [Google Scholar]
  • 11.Gulshan V, Peng L, Coram M, Stumpe MC, Wu D, Narayanaswamy A, et al. Development and Validation of a Deep Learning Algorithm for Detection of Diabetic Retinopathy in Retinal Fundus Photographs. JAMA. 2016. December 13;316(22):2402–2410. 10.1001/jama.2016.17216 [DOI] [PubMed] [Google Scholar]
  • 12.Ehteshami Bejnordi B, Veta M, Johannes van Diest P, van Ginneken B, Karssemeijer N, Litjens G, et al. ; the CAMELYON16 Consortium. Diagnostic Assessment of Deep Learning Algorithms for Detection of Lymph Node Metastases in Women With Breast Cancer. JAMA. 2017. December 12;318(22):2199–2210. 10.1001/jama.2017.14585 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh, Mark RG, et al. PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals. Circulation 2000;101:e215–e220. 10.1161/01.cir.101.23.e215 [DOI] [PubMed] [Google Scholar]
  • 14.Deshmukh A, Brown ML, Higgins E, Schousek B, Abeyratne A, Rovaris G, et al. Performance of Atrial Fibrillation Detection in a New Single-Chamber ICD. Pacing Clin Electrophysiol. 2016;39:1031–1037. [DOI] [PubMed] [Google Scholar]
  • 15.Zeng W, Daly S. An overview of the visual optimization tools in JPEG 2000. Signal Process: Image Comm. 2002;17:85–104. [Google Scholar]
  • 16.Ji-Hyun Kim. 2009. Estimating classification error rate: repeated cross-validation, repeated hold-out and bootstrap. Computational Statistics & Data Analysis, 53(11):3735–3745. [Google Scholar]
  • 17.Lown M, Yue A, Lewith G, Little P, Moore M. Screening for Atrial Fibrillation using Economical and accurate TechnologY (SAFETY)-a pilot study. BMJ Open. 2017;13;7 1:e013535 10.1136/bmjopen-2016-013535 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Giles D, Draper N, Neil W. Validity of the Polar V800 heart rate monitor to measure RR intervals at rest. Eur J Appl Physiol 2016;116:563–71. 10.1007/s00421-015-3303-9 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Lown M, Yue AM, Shah BN, Corbett SJ, Lewith G, Stuart B, et al. Screening for Atrial Fibrillation Using Economical and Accurate Technology (From the SAFETY Study). Am J Cardiol. 2018. October 15;122(8):1339–1344. 10.1016/j.amjcard.2018.07.003 [DOI] [PubMed] [Google Scholar]
  • 20.Zhou X, Ding H, Wu W, Zhang Y. A Real-Time Atrial Fibrillation Detection Algorithm Based on the Instantaneous State of Heart Rate. PLoS One. 2015. September 16;10(9):e0136544 10.1371/journal.pone.0136544 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Andersen RS, Poulsen ES, Puthusserypady S. A novel approach for automatic detection of Atrial Fibrillation based on Inter Beat Intervals and Support Vector Machine. Conf Proc IEEE Eng Med Biol Soc. 2017. July;2017:2039–2042. 10.1109/EMBC.2017.8037253 [DOI] [PubMed] [Google Scholar]
  • 22.Gilani M, Eklund JM, Makrehchi M. Automated detection of atrial fibrillation episode using novel heart rate variability features. Conf Proc IEEE Eng Med Biol Soc. 2016. August;2016:3461–3464. 10.1109/EMBC.2016.7591473 [DOI] [PubMed] [Google Scholar]
  • 23.Desteghe L, Raymaekers Z, Lutin M, Vijgen J, Dilling-Boer D, Koopman P, et al. Performance of handheld electrocardiogram devices to detect atrial fibrillation in a cardiology and geriatric ward setting. Europace. 2017. January;19(1):29–39. 10.1093/europace/euw025 [DOI] [PubMed] [Google Scholar]
  • 24.Lowres N, Neubeck L, Salkeld G, Krass I, McLachlan AJ, Redfern J, et al. Feasibility and cost-effectiveness of stroke prevention through community screening for atrial fibrillation using iPhone ECG in pharmacies. The SEARCH-AF study. Thromb Haemost. 2014;111:1167–1176. 10.1160/TH14-03-0231 [DOI] [PubMed] [Google Scholar]
  • 25.Kearley K, Selwood M, Van den Bruel A, Thompson M, Mant D, Hobbs FR, et al. Triage tests for identifying atrial fibrillation in primary care: a diagnostic accuracy study comparing single-lead ECG and modified BP monitors. BMJ Open. 2014;45:e004565. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Chen LY, Chung MK, Allen LA, Ezekowitz M, Furie KL, McCabe P, et al. ; American Heart Association Council on Clinical Cardiology; Council on Cardiovascular and Stroke Nursing; Council on Quality of Care and Outcomes Research; and Stroke Council. Atrial Fibrillation Burden: Moving Beyond Atrial Fibrillation as a Binary Entity: A Scientific Statement From the American Heart Association. Circulation. 2018. May 15;137(20):e623–e644. 10.1161/CIR.0000000000000568 [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

S1 AFPlosOne

(XLSX)

S1 Polar data

(7Z)

S1 Appendix

(DOCX)

Data Availability Statement

All relevant data has been included in the paper and the Supporting Information files.


Articles from PLoS ONE are provided here courtesy of PLOS

RESOURCES