Microsoft Word - 1423 Mario 102.docx HUNGARIAN JOURNAL OF INDUSTRY AND CHEMISTRY VESZPRÉM Vol. 42(2) pp. 65–70 (2014) TELEMEDICAL HEART RATE MEASUREMENTS FOR LIFESTYLE COUNSELLING MARIO SALAI,* GERGELY TUBOLY, ISTVÁN VASSÁNYI, AND ISTVÁN KÓSA Faculty of Information Technology, University of Pannonia, Egyetem u. 10.,Veszprém, 8200, HUNGARY *Email: mario.salai@gmail.com In this paper we analyse a low-cost commercial chest belt to be integrated into a lifestyle counselling system as a source of heart rate data. We compared data from a Schiller ECG Holter device, which serves as a reference to a CardioSport device. Due to missing data in the CardioSport device caused by loss of contact with the body, the creation of special algorithms was necessary for synchronization and data validation. The results show that when using our synchronization algorithms the average absolute percentage error between the two signals was 2% with correlation of more than 99%. Using a data validation algorithm, we were able to get on average more than 70% of the signal with an absolute percentage error of 3% and a high average correlation of 99%. The mean RR interval values and standard deviation of RR intervals are very close to those of the reference device using both the synchronization and data validation algorithms. When using the data validation algorithm, the reference measurements produced only slightly better results with regard to false detections of atrial defibrillation than the CardioSport device. In conclusion, we found that with a simple pre- processing algorithm, CardioSport as a low-cost device can be safely integrated into a lifestyle support system as a telemedical solution. Keywords: telemedicine, lifestyle counselling, heart rate monitor Introduction Low-cost telemedical sensors are often used in modern ambient assisted living (AAL) telemonitoring and self- management systems for providing inputs to medical intelligence algorithms [1]. Such systems extend the scope of traditional health care that is based purely on data measurement. However, the proper interpretation and reliability of the results depends on the reliability of the measured data and the sensor itself. Nevertheless, there are still surprisingly few reviews reported in the literature to date on the validation of the information content of such low-cost sensors compared to the clinically accepted reference device. An example of a device that was tested for validity is the SenseWear HR Armband [2]. In this study, they used the reference device simultaneously with the tested device as a way of validating data. However, most of the compared devices are expensive high-end devices, which present an obstacle for their wide use in telemedicine. In this proof-of-concept paper, we analyse a simple commercial chest belt chosen to be integrated into the Lavinia lifestyle mirror system [3] as a source of heart rate (HR) data. In the Lavinia system, the HR signal of the patient will be used to (i) estimate the calories burnt by physical activity, (ii) calculate the heart rate variability (HRV) in order to detect periods of mental or emotional stress, and (iii) analyse arrhythmia patterns (Poincare plots) for atrial fibrillation detection. Our approach involves the comparison of the HRV and Poincare plots computed from the filtered chest belt signal, with those parameters computed from a reference Holter device. Methods Measurements Two devices were used simultaneously by a healthy volunteer over a 24 hour period. A Schiller MT- 101/MT-200 Holter device was our reference device designed for clinical use. The chest belt was a CardioSport TP3 Heart Rate Transmitter device. Since this device does not have its own memory for storing data, we used a Nexus 7 tablet with Android version 4.4.2 to connect the device via the Bluetooth 4.0 protocol and store the measured data on the tablet. Although both devices were worn by volunteers for 24 hours, only 12 hours of the overall signal were used for analysis due to frequent detachments of the device from the body during nighttime. The measurements of 12 hours were repeated on 4 additional healthy male subjects. Signal Analysis The direct comparison of measured data was not possible due to the different designs of the reference and the telemedical devices. However, we wanted to 66 compare signals directly in terms of time and also to develop a data validation algorithm for removing the noisy parts of the CardioSport device measurements reliably without using the reference data. The problem was that the chest belt was not firmly attached to the body and sudden movements of the device caused signal loss. Therefore, we needed to create a software module for synchronization and data validation before any analysis. Data validation means removing obviously bad data (artefacts) and keeping only ‘good’ data segments of sufficient length, because, as a rule of thumb, both HRV and Poincare plot computations require data chunks of at least 5 minutes. Even though the data validation algorithm removed a considerable amount of data from the original signal, we still had enough useful data for analysis from the daytime. The Synchronization Algorithm Our simple algorithm for signal synchronization uses a sliding window that passes from the beginning of the chest belt signal to the end and calculates the absolute error between the two signals. When sliding finishes, the location of the sliding window with the minimum absolute error is considered as the point where the two signals should be synchronized. This applies only if the correlation of the data in the sliding window and the same amount of data from the reference device are higher than a minimum set by the user. If these conditions are met, the algorithm copies data from the sliding window into a newly generated third signal, which represents the chest belt signal fully synchronized with the reference signal. If conditions are not met, the third signal is filled with zeros. Finally, the algorithm extracts all the highly correlated segments from the third signal ignoring zero values. Also, a file with all the merged segments is generated for general analysis. The algorithm uses the following 5 main parameters that can be set up by the user: 1. window size: amount of data copied from the signal into the sliding window (default: 200), 2. window shift step: the number of samples by which we shift the sliding window in each iteration (default: 50), 3. absolute error window: amount of data used for calculating the minimum absolute error (default: 200), 4. maximum error distance: the number of samples by which we shift the absolute error window in order to find the minimum absolute error (default: 1000), 5. minimum correlation: minimum correlation, expressed as a percentage, required for the two signals to consider data in the chest belt signal as accurate (default: 97%). Each parameter’s default value was determined empirically. After running the synchronization process, we obtained segments of highly correlated data. Fig.1 shows the distribution of the lengths of signal segments. We can see that most segments are 3 to 18 minutes long. The longest highly correlated segment with the reference data is 110 minutes long. The default parameter settings minimize the number of overly short (< 5 min) segments. Most of the bad segments (Fig.2) are shorter than one minute, and only one bad segment was 60 minutes long. Data Validation Algorithm Another type of algorithm was used in the real telemedical scenario for finding good parts of the signal without relying on reference data. This implies finding gaps and abnormal values and omitting them. First, we compared the timestamp of each data point with the timestamp of the previous one. If the difference between the timestamps was longer than 3 seconds, we marked this as a ‘gap’. The 3-second gap detection was enabled by the chest belt’s buffering system that can tolerate short detachments of the device from the body. In the second step we identified abnormal values in the signal that were treated as gaps. The abnormal values are identified by observing the mean value of 20 neighbouring data points (10 before and 10 after a given point). If the mean value differs from the value of the Figure 1: The distribution of strongly correlated segment lengths for all subjects Figure 2: The distribution of weakly correlated segment lengths for all subjects 67 current sample by more than 300 units, we consider it invalid and mark it as a gap/error in the signal. Finally, we extract the good segments from the signal with a length of more than 5 minutes. We implemented the above algorithm in a simple software tool (Fig.3). On the left-hand side we can load the two signals and set the parameter values as well as the amount of data to be analysed. The graph shows two signals after the synchronization process was completed. The user can examine signals by clicking the Previous and Next buttons. General statistics are shown in the middle part of the screen, while in the lower part, we can see the histogram, and save the histogram and results as a file. Two tabs in the top left-hand corner allow the user to switch between synchronization and data validation algorithms. Statistical Analysis Time and frequency domain analyses, correlation comparisons, mean absolute percentage errors, and the slopes of scatter plot diagrams were compared between two measurements for HRV analysis. The specificities of a self-developed atrial fibrillation detector algorithm were compared for atrial fibrillation analysis. The latter algorithm is based on the k-means clustering of Poincaré plots (consisting of RR intervals) The time and frequency domain analyses for HRV were performed using Kubios HRV analysis software, while the rest of the analysis for HRV and atrial fibrillation was performed in Microsoft Excel. Atrial fibrillation detection was done using the MATLAB environment and the results were saved as Microsoft Excel workbooks. Results and Analysis Heart Rate Variability After the synchronization process, we got strongly correlated (greater than 97%) synchronized data segments of various durations. Table 1 summarizes the duration of signals analysed. Table 2 shows results in the time domain for Schiller and CardioSport devices after using the algorithm for the synchronization of signals. Time domain analysis shows similar values for mean RR values and standard deviation (STD RR in Eq.(1)). The average Mean RR values for the Schiller and CardioSport devices are 851 and 871 respectively. The average STD RR for the Schiller device is 108 and 110 for the CardioSport device. Figure 3: Synchronization and data validation software Table 1: Signal duration after the synchronization process Subject Duration (h:m:s) #1 10:53:28 #2 8:45:40 #3 10:30:17 #4 7:46:56 68 𝑆𝑇𝐷  𝑅𝑅 = ! !!! (𝑅𝑅! − 𝑅𝑅)! ! !!! (1) The frequency domain analysis for the synchronization process is presented in Table 3. The absolute power was compared for very low frequencies (VLF: 0-0.04 Hz), low frequencies (LF: 0.04-0.15 Hz), high frequencies (HF: 0.15-0.4 Hz) and ratios between low frequencies and high frequencies (LF/HF). Results show no significant difference between Schiller and CardioSport device values. The average mean absolute percentage error (MAPE) between two signals is 2% with a high average correlation of close to 100%. Using the data validation algorithm, we extracted data points from the collected signals. The duration of the resulting signal is shown in Table 4. It is important to note that due to the noise on Schiller device recordings, we had to remove noisy parts from the original signal. Therefore, even though the signal was recorded continuously for 12 hours, overall duration is much less. Calculations show that in the worst scenario only 45% of the signal can be used for analysis using this data validation method, while in the best scenario this number reaches 95%. This leads to a conclusion that results are rather subject dependent. The results of data analysis in the time domain after the removal of bad parts using the validation algorithm can be seen in Table 5. The mean RR intervals for Schiller and CardioSport devices are 851 and 871 and standard deviations are 104 and 106, respectively. The CardioSport device has slightly greater values, but these are practically identical. The frequency domain analysis for the data validation process is presented in Table 6. The absolute power was compared for very low frequencies (VLF: 0- 0.04 Hz), low frequencies (LF: 0.04-0.15 Hz), high frequencies (HF: 0.15-0.4 Hz), and ratios between low frequencies and high frequencies (LF/HF). As in the synchronization process, the results show no significant difference between the Schiller and CardioSport device values. The minimum, maximum and average percentage errors on whole signals were calculated using 5 minute long sliding windows with one minute long shift steps (Table 7). Only one subject had a high maximum error value of 34%. By visual examination, it was determined that the cause of such a high error was the artefact of the Schiller device. In spite of that, the average error remained low (2%). Table 2: Time domain analysis after synchronization Mean RR (ms) a STD RR (ms) b Subject Schiller CardioSport Schiller CardioSport #1 738 755 123 125 #2 704 720 91 93 #3 908 929 90 93 #4 855 875 145 148 #5 937 959 107 109 Average 851 871 108 111 a with 2% error, b with 1-3% error Table 3: Frequency domain analysis after synchronization Schiller CardioSport Error Subject Absolute power (ms2) Absolute power (ms2) % % % % VLF LF HF LF/HF VLF LF HF LF/HF VLF LF HF LF/HF #1 7937.6 3086 1578 1.956 8444 3224 1330 2.4235 6 4 19 19 #2 5431.5 626.6 245 2.557 5723 659.3 250.9 2.6281 5 5 2 3 #3 4251.2 1927 494.4 3.898 4543 2055 538.8 3.8146 6 6 8 2 #4 12682 1790 636.5 2.813 13514 1869 621.5 3.0077 6 4 2 6 #5 6139.8 1212 476.7 2.542 6465 1274 481.4 2.6459 5 5 1 4 Table 4: Signal duration after data validation Subject Duration (h:m:s) #1 1:28:10 #2 11:20:03 #3 6:15:38 #4 9:27:07 #5 4:29:44 Table 5: Time-domain analysis after data validation Mean RR (ms) a STD RR (ms) b Subject Schiller CardioSport Schiller CardioSport #1 701 724 136 139 #2 700 717 91 93 #3 899 921 100 100 #4 846 866 139 142 #5 958 981 88 90 Average 851 871 105 106 a with 2% error, b with 0-2% error Table 6: Frequency domain analysis after data validation Schiller CardioSport Error Subject Absolute power (ms2) Absolute power (ms2) % % % % VLF LF HF LF/HF VLF LF HF LF/HF VLF LF HF LF/HF #1 10414 2297 1171 1.96 10847 2442 1004 2.43 4 6 17 19 #2 5446 631 245 2.57 5718 654 245 2.67 5 3 1 4 #3 5163 1990 523 3.80 5424 2054 540 3.80 5 3 3 0 #4 11683 1769 616 2.87 12149 1831 594 3.08 4 3 4 7 #5 4356 1235 317 3.89 4522 1303 330 3.95 4 5 4 1 69 Fig.4 represents a typical relationship between CardioSport and Schiller devices. All gradient values are close to 1. The lowest slope value is 0.98 while the highest value is 1.02. The average mean absolute percentage error (MAPE) between two signals was 3% with a strong average correlation of 99%. Atrial Fibrillation We carried out the detection of atrial fibrillation (AFib) by analysing POINCARÉ plots consisting of 30 RR intervals. We considered 30 RR intervals per iteration and in each iteration after constructing the POINCARÉ plot we calculated the dispersion around the diagonal line and used k-means based cluster analysis to determine the number of the clusters. If the dispersion was too high (greater than 0.06) and the number of clusters was 1, or the number of clusters was more than 9; we assigned “AFib” to that series of RR intervals, otherwise to “Non-AFib”. The details of the algorithm can be seen in our previous study [16]. Since our data set did not contain real AFib cases, only specificity could be calculated with regard to the efficiency of detection. The evaluation of atrial fibrillation detection results for synchronized data validation can be seen in Tables 8 and 9. Conclusion Even though the CardioSport device may suffer from signal loss due to its design, we managed to determine that it can be safely used for telemedical purposes of measuring HRV and atrial fibrillation. We found only a few usable data segments that were less than 5 minutes long. With our algorithm that detects gaps and errors in Table 7: The minimum, maximum and average percentage errors Subject Minimum error Maximum error Average error #1 0.1% 3.5% 1.5% #2 0.0% 7.7% 2.1% #3 0.0% 33.9% 3.2% #4 0.1% 6.7% 1.9% #5 0.1% 5.1% 2.2% Average 0.1% 13.4% 2.4% Figure 4: Comparison of the CardioSport and Schiller devices after data validation Table 8: Results from the synchronized data related to atrial fibrillation detection Subject Number of iterations Schiller MT-101/MT-200 system CardioSport TP3 Heart Rate Transmitter AFib cases Non-Afib cases AFib cases Non-Afib cases #1 331 26 8% 305 92% 31 9% 300 91% #2 1796 9 1% 1787 99% 3 >1% 1793 ~100% #3 1120 7 1% 1113 99% 5 1% 1115 99% #4 1427 11 1% 1416 99% 16 1% 1411 99% #5 964 46 5% 918 95% 45 5 919 95% Min - - 1% - 92% - >1% - 91% Max - - 8% - 99% - 9% - ~100% Mean - - 3% - 97% - 3% - 97% STD - - 3% - 3% - 4% - 4% Table 9: Results from the data validation process related to atrial fibrillation detection Patient Number of iterations Schiller MT-101/MT-200 system CardioSport TP3 Heart Rate Transmitter AFib cases Non-Afib cases AFib cases Non-Afib cases #1 241 3 1% 238 99% 8 3% 233 97% #2 1879 29 2% 1850 98% 2 >1% 1877 ~100% #3 808 15 2% 793 98% 3 >1% 805 ~100% #4 1296 10 1% 1286 99% 20 2% 1276 98% #5 544 6 1% 538 99% 7 1% 537 99% Min - - 1% - 99% - >1% - 97% Max - - 2% - 99% - 3% - ~100% Mean - - 1% - 99% - 1% - 99% STD - - >1% - >1% - 1% - 11% 70 the signal and removes them with an average effectiveness of more than 70%, which translates into having enough data to calculate HRV and atrial fibrillation from daytime measurements. Regarding atrial fibrillation detection, we can conclude that by using the developed data validation algorithm the reference Schiller MT-101/MT-200 measurements produced only slightly better results with regard to false detections than the CardioSport TP3 Heart Rate Transmitter. In two cases the CardioSport measurements proved to be even better than Schiller records, which implies that some relatively simple heart rate recorders are equivalent to some Holter devices after signal processing using the data validation algorithm. We have to emphasize; however, that we have not performed any measurements on actual atrial fibrillating patients yet. Therefore, the investigation of the sensitivity of our atrial fibrillation detection algorithm under the presented circumstances could be the subject of further studies. In summary, the CardioSport as a low-cost device can easily be integrated into a lifestyle support system as a telemedical solution. ACKNOWLEDGMENTS This research was supported by the European Union and co-funded by the European Social Fund “Telemedicine- focused research activities in the field of Mathematics, Informatics and Medical Sciences” TÁMOP-4.2.2.A- 11/1/KONV-2012-0073. REFERENCES [1] PATEL S., PARK H., BONATO P., CHAN L., RODGERS M.: A review of wearable sensors and systems with application in rehabilitation, J. Neuroengng. Rehab., 2012, 9(21), 1–17 [2] KRISTIANSEN J., KORSHØJ M., SKOTTE J.H., JESPERSEN T., SØGAARD K., MORTENSEN O.S., HOLTERMANN A.: Comparison of two systems for long-term heart rate variability monitoring in free- living conditions - a pilot study, Biomed Eng. Online, 2011, 10(27), 1–14 [3] KÓSA I., VASSÁNYI I., NEMES M., KÁLMÁNNÉ K.H., PINTÉR B., KOHUT L.: A fast, Android based dietary logging application to support the lifestyle change of cardio-metabolic patients, Global Telemedicine and eHealth Updates: Knowledge Resources, Eds.: M. JORDANOVA, F. LIEVENS, 2014, 7, 553–556 [4] SALAI M., TUBOLY G., VASSANYI I., KOSA I.: Reliability of telemedical Heart Rate meters, IME J., 2014, 8(5), 49–55