Validation of a smartphone based photoplethysmographic beat detection algorithm for normal and ectopic complexes

Computing in Cardiology

2014; 41:845-848

Abstract:

Background: To date little or no smartphone apps exist to differentiate between a normal heart beat and a premature ectopic beat.

Aim: To develop and validate a smartphone based acquisition and processing algorithm based on photopletyhsmographic (PPG) data collected in a controlled hospital environment.

Methods: A smartphone camera application was developed to record PPG data in synchronization with a reference electrocardiogram. Subjects were recorded while undergoing an electrophysiological examination. The PPG data acquisition was validated on 28 volunteers with sinus rhythm. After signal analysis an algorithm was developed for detection of ectopic beats. To characterize arrhythmias, supraventricular extrasystoles were induced every 10, 5 or 3 beats after 500 ms by applying a pacing train to the right atrium. The coupling interval was also examined by altering the intermediary time by 400, 500 or 600 ms.

Results: After signal conditioning, an accurate ectopic beat detection was obtained from the PPG signal. Premature atrial ectopic beats could be differentiated based on the interpeak distance at different coupling intervals.

Conclusion: By acquiring a PPG signal with the camera, the smartphone is not only capable of determining a regular sinus rhythm, but it also has the power to identify ectopic beats.

Introduction:

The smartphone has been widely adopted on a global scale since the release of the first iPhone in 2007. Since then, the user base has skyrocketed to a total of 1.76 billion users [1]. Key to the success of smartphones are the respective app stores of Android and iOS which offer a huge selection of downloadable apps, many of which apply to the healthcare field. By the end of 2013, 43,689 health and medical apps were listed on both platforms [2].

These mobile health (mHealth) apps provide solutions to improve healthcare system processes, such as appointment booking to the retrieval of patient data by the caregiver, to aiding patients in managing chronic conditions. Additionally, mHealth can also provide immediate access to health advice through video calls which can be invaluable to those living in remote or rural areas. This communication of information can also be extended to include external devices that connect to the smartphone. This way, the dedicated hardware performs the medical feature to subsequently transfer the data to the mobile device or the internet. These numerous mHealth applications are on the verge of changing healthcare in a fundamental way [3].

Figure 1. Screenshot of the smartphone heart rate acquisition application. Top right the camera feed can be seen with pulsating colors representing blood flow. A live data feed is shown as well as a progress bar for the 60-second measurement. Online peak detection indicates the pres- ence of heart beats and allows RR-interval analysis to ob- tain heart rate.

One type of mHealth apps are those capable of detecting the users heart rate. They are based on the technique of photoplethysmography (PPG). This PPG is an optical, volumetric measurement where the amount of blood present at the blood vessels in the skin determine the amount of scattered light [4]. For apps using the rear-facing camera, the LED flash is used to illuminate the users finger while the camera records the amount of light that is scattered. The light intensity oscillates as each heart beat pumps blood to the finger [5].

A lot of user interest towards heart rate apps has grown over the years to the point where the top downloaded app ́Instant Heart Rate ́ has gathered over 25 million unique downloads [6]. However, to date, there are no apps available that can perform an additional analysis of the PPG waveform to provide more insight in the user heart health. Detection of an irregular rhythm or differentiation between a normal heart beat and a premature ectopic beat is non existent on a smartphone without the use of an external device. This limits the devices capabilities from a cardiac mHealth perspective. Although the electrocardiogram (ECG) will remain the golden standard to diagnose the presence of rhythm disorders, this research aims to increase the clinical relevance of heart rate apps. Other authors have shown the possibility to detect ectopic beats in a high quality PPG signal, captured with specialized devices [7]. In this work, a smartphone based acquisition and processing algorithm was developed to collect PPG data in a controlled hospital environment. The aim is to identify the presence of premature, atrial ectopic beats using only a smartphone.

Methods:

For the acquisition of the PPG data, an Android smartphone application was developed on a Galaxy S4 smartphone (Samsung Group, Seoul, South Korea). This app was written in basic Android, Java and xml. First, raw YUV images were captured from the devices camera at a rate of 30 frames per second and converted to a single grey value. These values were then filtered and smoothed to gain the preconditioned signal. The filter used was a Butterworth high pass filter with a cutoff of 0.5 Hz. The smoothing was done over four samples. All data, both filtered and raw were digitally uploaded in a comma separated format allowing for offline analysis in Matlab (MathWorks, Natick, Massachusetts, USA).

Validation of PPG versus ECG

Validation of the obtained and filtered signal was performed in a small cohort study of 28 healthy subjects. During recording they were asked to keep the smartphone in their right hand to acquire the photoplethysmographic information while having a continues 12-lead electrocardiogram recording. The PPG signal was recorded for a duration of 60 seconds. ECG data was analyzed using the standardized Pan-Thompkins algorithm allowing identification of QRS-complexes and extraction of the RR- intervals. The peaks from the PPG signals were extracted by use of a moving window to detect local maxima. Here- after the peaks were analyzed in te same way as the ECG signals. These peaks allowed inter-peak distances to be calculated where cross-correlation analysis could be performed. Bland-Altman analysis was performed on average heartrate results of the 60-second fragments between both ECG and PPG.

Ectopic beat induction

Ectopic beats were induced in anesthetized patients in a controlled environment during an electrophsyiological (EP) examination. During this EP examination, pacing leads are attached at different positions in the atria and ventricles allowing electrical control of the heart. During the EP procedure a baseline pacing to the right atrium was applied with an interval of 857 ms (70 beats per minute). Pacing could be varied depending on the requirements. Supraventricular extrasystoles were induced after every 10, 5 and 3 beats with a coupling interval of 500 ms with respect to the normal heart beat. In a similar approach, these coupling intervals were examined fixing the extrasystole interval but varying the length of the coupling interval to 400, 500 and 600 ms. This was followed by a refractory period of 3,000 ms to allow for the compensatory pause during which the heart could regain its natural response and rhythm. The detection of extrasystoles was accomplished by moving a sliding window of six distances over the inter-peak distances. This window checked if the middle two distances were respectively smaller and larger than the average mean of the window, in addition to a margin of 0.2 times the average to compensate for variations in heart rate. Each measurement was processed with MATLAB.

Supraventricular extrasysole algorithm

The algorithm to detect extrasystolic beats is based on a sliding window of 6 repeating elements. Six consecutive RR-intervals are averaged and logic rules are applied to identify the ectopic complex. If the interval-of-interest is smaller than the averaged RR-interval and the follow- ing interval is larger, this is tagged as a potential ectopic complex. Setting a threshold of 20%, and crossing of the averaged RR-interval indicates the presence of the ectopic beat. Results are plotted in time-resolved figures with stem-hight representing the length of the preceding RR- interval.

Results:

Validation of the PPG versus the ECG algorithm was done using cross correlation of both inter peak intervals. A correlation coefficient of R2=95.7% was obtained with a significance level of (p<0.001). Bland-Altman analysis of averaged heart rate detection of both ECG versus the PPG indicated no significant changes (results not shown). Figure 2 shows an ECG trace of a sinus rhythm with an supraventricular extrasystolic beat. The synchronized PPG shows the a similar behavior where the compensatory pause before the next pulse is clearly visible. This pause is key for the extrasystolic beat detection (Figure 2).

Figure 2. Alignment of a PPG signal at the top and ECG at the bottom. Marked are the inter-peak distances between each beat (RR). After each ectopic beat of atrial origin (es) a longer, compensatory inter-peak distance occurs before returning to a normal sinus rhythm.

Variations in extra systolic beat intervals

The obtained PPG and ECG results for the subjects where ectopic beats were induced after a series of 10, 5 and 3 normal heart beats correlated very well. For simplicity the ECG data was not included (Figure 3). Analysis of the PPG data was able to identify each ectopic complex in a normal sinus rhythm with a ectopic beat every 10, 5 and 3 normal heart beats. The robustness of the algorithm is that only two heart beats are required to provide the detection. Due to safety aspects the induction of trigemeny rhythm disorders was not possible and could therefore not be used to stress-test this algorithm.


Figure 3. Detection of ectopic beats by the algorithm ev- ery 10th (Top), 5th (Middle) and 3rd (Bottom) beat on top of a 857 ms baseline pacing rate. Length of the inter-peak distance is shown by the stem plot with each detected ec- topic beat marked in red.

Variations in coupling intervals for extrasystolic beats

The coupling interval indicates the time between the extrasystole and the preceding sinus beat. Based on the focus of the ectopic complex this coupling interval will be the same. Artificial induction of extrasystolic complexes allowed control to investigate the sensitivity of detection and identification of these complexes. Different intervals were applied ranging from 400, 500 and 600 ms. Figure 4 shows the results of the detected beats. Coupling intervals of 400 ms could not be differentiated from the preceding sinus beat due to signal preconditioning. The compensatory pause after the beat could still be differentiated.

Figure 4. On the right, the effect of different coupling in- tervals 400 ms (Top) 500ms (Middle) 600 ms (Bottom) on the PPG signal and algorithm. Length of the interpeak distance is shown by the stem plot with each detected ectopic beat marked in red.

Future perspectives will aim to make the algorithm more robust. Another variable that can be taken into considera- tion is the amplitude of the signal. The ectopic beat causes a larger volume of blood to go into the arteries which can be observed as an increase of amplitude in the signal. Additionally, testing of the algorithm in a less controlled environment will allow for further validation. This can be accomplished by capturing real subject data without pacing or the induction of ectopic beats during an electrophysio- logical examination.

Conclusion:

This work has shown that it is possible to do more with the PPG collected with a smartphone camera than currently being done by popular heart rate apps. Beside the heart rate measurement of a sinus rhythm, the presence of premature atrial ectopic beats can also be detected based on the observation of the resulting compensatory pause. The designed algorithm for this research was sufficient for the most datasets but needs more work to be made robust for future studies and field testing.

References:

[1]  eMarketeer. Worldwide Smartphone Usage to Grow 25% in 2014 [Internet]. 2014 Jun 11 [cited 2014 Aug 14]. Avail- able from: http://www.emarketer.com/Article/Worldwide- Smartphone-Usage-Grow-25-2014/1010920

[2]  IMS Institute for Healthcare Informatics. Patient Apps for Improved Healthcare. Report; 2013.

[3]  Visiongain. Mobile Health (mHealth) Market Forecast 2014-2024. Report; 2014.

[4]  Allan J. Photoplethysmography and its application in clinical physiological measurement. Physiol. Meas.; 2007,28:R1R39.

[5]  Jonathan E, Leahy M. Investigating a smartphone imag- ing unit for photoplethysmogrpahy. Physiol. Meas.; 2010,31:N79.

[6]  Azumio. Instant Heart Rate [internet] 2012 [cited 2014 Aug 14]. Available from: http://www.azumio.com/apps/heart- rate/

[7]  Solosenko A, Marozas V. Automatic Extrasystole Detec- tion Using Photoplethysmography Signals. IFMBE Pro- ceedings; 2013,41:985-8.