Skip to main content
Biophysical Reviews logoLink to Biophysical Reviews
. 2020 Jul 14;12(4):777–779. doi: 10.1007/s12551-020-00731-3

Hactive: a smartphone application for heart rate profiling

Adam Goldberg 1,2, Joshua W K Ho 1,2,3,
PMCID: PMC7429606  PMID: 32666466

Abstract

With advancements in popular modern wearable devices, such as Apple Watch and Fitbit, it is now possible to harness these technologies for continuous monitoring and recording of heart rate data, which can then be used for medical research and ultimately e-health applications. In this paper, we report the development of a new mobile smartphone application (app) that enables heart rate profiles to be extracted and analysed from continuous heart rate monitoring time series. The new iOS app, called Hactive, extracts heart rate data from Apple’s smartwatches to construct heart rate profiles. A key innovation is Hactive’s ability to detect and analyse exercise-associated heart rate changes from continuous heart rate data, which enables heart rate profiles to be constructed based on free-living conditions. We believe this tool advances the use of wearable technology to collect physiologically relevant big data for healthcare and medical research. The source code of Hactive is available via an MIT open source licence at https://github.com/VCCRI/hactive.

Keywords: Internet of things, mHealth, Cardiovascular health, Big data

Introduction

A heart rate (HR) profile is a time series that represents the fluctuation of heart rate before, during, and after a period of physical exertion (Fig. 1). In a healthy individual, the heart rate goes up in response to increased physical exertion (e.g. running), and the heart rate would go down after the cessation of such exertion. Analysing how HR changes in response to various exercises provides information about a person’s cardiac physiology and risk of diseases. A HR profile captures various informative measurements such as resting HR, maximum HR, and the HR recovery index. These HR features, especially the reduced rate of HR recovery 1 min after cessation of exercise, correlate with an increased risk of mortality and sudden death (Cole et al. 1999; Jouven et al. 2005; Savonen et al. 2006; Zhang et al. 2016).

Fig. 1.

Fig. 1

Example of heart rate profile views of Hactive. a The heart rate time series of an entire workout. The alternating pairs of red and black dots represent distinct periods of heightened physical activity within the scope of the entire workout as identified by an algorithm in Hactive. The first pair of red dots indicates the start and end of the first period. The following pair of black dots indicates the second period. b Heart rate profiles of multiple periods of physical activity scaled and interlaced onto a single chart for visual comparison. The beginning of each period is marked by blue dots, the peak HR is marked by red dots, and the end of each period is marked by green dots

HR is normally measured in a controlled, typically clinical environment. The emergence of widely available consumer-grade wearable devices, such as wrist-worn heart rate monitors, allows for continuous HR monitoring in free-living conditions. Most of these devices, such as Fitbit and Apple Watch, are connected and integrated with smartphone applications for heart rate monitoring. These commercial-grade wearable devices are widely available in the market and are generally affordable, non-invasive, and socially acceptable. While most of these smartphone applications can reasonably accurately capture HR in non-pathological conditions (Pipitprapat et al. 2018), there is no application that automatically detects and extracts exercise-associated heart rate changes from continuous heart rate data. By detecting and summarising the HR data from all identified exercise events, we can construct a HR profile. This innovation enables the inference of a person’s HR profile based on their everyday activities (i.e. free living conditions).

To fill this gap, our group began to develop software tools to extract continuous HR and physical activity data from popular commercial wearable devices and used this data to construct HR profiles. The primary motivation is to enable HR profiles to be constructed from free-living condition, which enables personalised profiling of physiological data. We recently developed an R package, called CardiacProfileR (Djordjevic et al. 2019), to extract, analyse, and visualise HR profiles from heart rate and physical activity data. This data was acquired from a Training Centre XML (TCX) file, which could be obtained as an output from multiple popular wearable fitness monitors. HR information can be directly obtained from wearable devices such as Fitbit. CardiacProfileR infers periods of physical activities based on accelerometer and global positioning system (GPS) movement information, which in turn can be used to infer energy expenditure. This approach is fine for specific exercise regimes such as running and stair climbing, in which a change in energy expenditure can easily be inferred based on a marked change in physical movement. Nonetheless, this approach does not work well in capturing HR profiles under a free-living condition, in which changes in movement may be more subtle. Furthermore, CardiacProfileR requires the data from the wearable devices to be downloaded onto a standalone computer prior to analysis using R. There is no simple mechanism in which a person can easily contribute their heart rate recoding to medical research through existing means.

In this article, we describe a new open source mobile smartphone application, called Hactive, for extraction, analysis, and visualisation of heart rate dynamics upon physical exertion from data generated from a common wearable heart rate monitor, Apple Watch, under free-living conditions. An important consideration of this app is that it should facilitate easy sharing of data for medical research purposes.

Hactive

Hactive is an iOS application that takes workouts recorded by an Apple Watch as input and constructs heart rate profiles from these workouts. Our app allows users to identify periods of active exercises without the need to use physical movement data. Instead, Hactive infers the start and end of physical exercise events using the HR time series alone. An example HR time series is shown in Fig. 1a. Hactive uses simple and fast sliding-window approach to detect significant and sustained increases and decreases in HR, which the algorithm uses to define the start and end points of an exercise event. Further technical details on the methods can be found on Hactive’s GitHub page (https://github.com/VCCRI/hactive). It is possible to identify multiple exercise events from a heart rate time series derived from free-living conditions. Once all the HR profiles have been extracted, Hactive can scale the profile down to 100-s time series. These scaled profiles can then be displayed in a single plot (Fig. 1b). This allows for a visual comparison of all the HR profiles. Furthermore, Hactive computes statistical summaries of the HR profiles such has maximum HR, average HR, start time, end time, and duration.

Hactive is implemented using the Swifts Core Data framework which is used to manage the model layer object of the app. The app is optimised to use Apple’s existing data infrastructure (iOS persistent datastore). This means privacy, and security is handled by Apple. Hactive has access to this data through Apple HealthKit. Apple’s medically orientated open source framework ResearchKit was designed to support researchers and clinicians in conducting studies and collecting sensitive data. This kit allows medical researches to embed consent flows, surveys, and real-time dynamic, active tasks into an application. A template consent form has been installed in Hactive to allow future researchers to incorporate their own approved consent document once one is created. Like ResearchKit, HealthKit was developed to manage, monitor, and safely store sensitive medical health data. To avoid the management of sensitive data such as heart rate, Hactive has offloaded this to HealthKit. By making request requests to HealthKit rather than storing the data within the application, we avoid managing the massive data pile that will inevitably build up as a result of recording and storing workouts as well as the security risks associated with this data.

Discussion

Prior to settling on developing an iOS application using Swift, we explored the use of a cross-platform native architecture as the development platform. The basis for this was so a single development tool could be used to incorporate Android devices as well as iOS and hence allow all currently available smartwatches to be utilised under one programme. Both React Native and Ionic were the most compelling options given their relative popularity; however, after further investigation, both development options were too naive in terms of extracting information from smartwatch technology. We were unable to extract all the relevant data provided by smartwatches using these platforms. It was, therefore, appropriate to take the native route of building the application strictly in iOS.

There are other popular commercial smartwatches currently available. Extending our experience in developing Hactive, a future goal is to implement a similar app in other operating systems (such as Android devices) and wearable monitors. In any case, this paper presents our experience in developing a mobile smartphone app that can be used to collect, store, analyse, and visualise heart rate profiles of an individual in a free-living condition.

Hactive currently is in early development. Currently no cloud solution has been created to remotely store and share the data. Future work would include setting up cloud infrastructure to collect health data shared through this feature. We hypothesise that given enough labelled data, new machine learning models can be developed to predict cardiovascular diseases or risk to cardiovascular diseases using these HR profiles. In the long term, Hactive may be trained to become a screening tool for early symptoms of cardiac function deterioration, which could be a risk factor of cardiovascular diseases. In fact, the use of wearable devices to collect data for detecting and collection physiological big data is an emerging trend in biomedical research (Orphanidou 2019). We believe the demand of this type of mobile software for healthcare and medical research applications will increase in the near future. We hope Hactive is a first step towards collecting good quality biomedical big data, which will eventually impact modern healthcare practice.

Acknowledgments

We thank Djordje Djordjevic, Andrian Yang and Eleni Giannoulatou for their helpful comments and discussion throughout the study.

Funding information

The work was supported in part by funds from the National Health and Medical Research Council (1105271 to JWKH) and the National Heart Foundation (100848 to JWKH).

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  1. Cole CR, Blackstone EH, Pashkow FJ, Snader CE, Lauer MS. Heart-rate recovery immediately after exercise as a predictor of mortality. N Engl J Med. 1999;341:1351–1357. doi: 10.1056/NEJM199910283411804. [DOI] [PubMed] [Google Scholar]
  2. Djordjevic D, Cawood BK, Rispin SK, Shah A, Yim LHH, Hayward CS, Ho JWK. CardiacProfileR: an R package for extraction and visualisation of heart rate profiles from wearable fitness trackers. Biophys Rev. 2019;11:119–121. doi: 10.1007/s12551-019-00498-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  3. Jouven X, Empana J-P, Schwartz PJ, Desnos M, Courbon D, Ducimetière P. Heart-rate profile during exercise as a predictor of sudden death. N Engl J Med. 2005;352:1951–1958. doi: 10.1056/NEJMoa043012. [DOI] [PubMed] [Google Scholar]
  4. Orphanidou C. A review of big data applications of physiological signal data. Biophys Rev. 2019;11:83–87. doi: 10.1007/s12551-018-0495-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
  5. Pipitprapat W, Harnchoowong S, Suchonwanit P, Sriphrapradang C. The validation of smartphone applications for heart rate measurement. Ann Med. 2018;50:721–727. doi: 10.1080/07853890.2018.1531144. [DOI] [PubMed] [Google Scholar]
  6. Savonen KP, Lakka TA, Laukkanen JA, Halonen PM, Rauramaa TH, Salonen JT, Rauramaa R. Heart rate response during exercise test and cardiovascular mortality in middle-aged men. Eur Heart J. 2006;27:582–588. doi: 10.1093/eurheartj/ehi708. [DOI] [PubMed] [Google Scholar]
  7. Zhang D, Shen X, Qi X. Resting heart rate and all-cause and cardiovascular mortality in the general population: a meta-analysis. CMAJ. 2016;188:E53–E63. doi: 10.1503/cmaj.150535. [DOI] [PMC free article] [PubMed] [Google Scholar]

Articles from Biophysical Reviews are provided here courtesy of Springer

RESOURCES