Improving Remote Health Monitoring: A Low-Complexity ECG Compression Approach

Recent advances in mobile technology have created a shift towards using battery-driven devices in remote monitoring settings and smart homes. Clinicians are carrying out diagnostic and screening procedures based on the electrocardiogram (ECG) signals collected remotely for outpatients who need continuous monitoring. High-speed transmission and analysis of large recorded ECG signals are essential, especially with the increased use of battery-powered devices. Exploring low-power alternative compression methodologies that have high efficiency and that enable ECG signal collection, transmission, and analysis in a smart home or remote location is required. Compression algorithms based on adaptive linear predictors and decimation by a factor B/K are evaluated based on compression ratio (CR), percentage root-mean-square difference (PRD), and heartbeat detection accuracy of the reconstructed ECG signal. With two databases (153 subjects), the new algorithm demonstrates the highest compression performance (CR=6 and PRD=1.88) and overall detection accuracy (99.90% sensitivity, 99.56% positive predictivity) over both databases. The proposed algorithm presents an advantage for the real-time transmission of ECG signals using a faster and more efficient method, which meets the growing demand for more efficient remote health monitoring.


Introduction
The World Health Organization (WHO) cites Cardiovascular Diseases (CVDs) as the number one cause of death worldwide [1]. Given the gravity of these diseases, many researchers have focused their research on cardiovascular disease and heart health. Additionally, an intense focus has been placed on studying the ways in which conventional cardiovascular diagnosis technologies can be improved for use in hospitals, clinics, and other related health care facilities. Increased efforts in this research area have led to several advances in technology for cardiac function screening and diagnostics. A variety of cardiac abnormalities are screened and assessed using a simple, risk-free and inexpensive cardiac test known as the electrocardiogram (ECG) analysis [2]. Each ECG heartbeat signal contains three prominent waves: the P wave, the QRS complex, and the T wave. The detection of these waves over a short period of time (<30 min) has been accomplished with great success and accuracy for acute screening and diagnostics [3][4][5]. Early detection of CVDs, on the other hand, necessitates long-term monitoring of ECG signals via ECG electrodes that are connected to wearable devices, mobile phones, smart clothes, and point-of-care (POC) devices in a smart home setting [6]. Devices used in remote monitoring typically rely on wireless communication and could require extensive power resources [7].
A remote system with real-time monitoring for the elderly can provide a timely alarm when patients need urgent help [6,8]. This technology may relieve some of the pressure on hospitals to monitor patients on-site. The architecture proposed in Figure 1 includes: biosensors, connected through a Bluetooth wireless technology to a unit (referred to as a gateway) that mainly interfaces the user with the healthcare center. The gateway unit can carry out signal processing and data storage before transmitting the data over the internet. A gateway can be an independent device or a personal computer. Several studies have developed smart gateways and have proposed different health care system models based on these gateways [9][10][11]. Bansal et al. [12] and Jung et al. [13] proposed health care monitoring systems that rely on mobile gateways, similar to smart phones. Spinsante and Gambi [14] and Lin et al. [15] proposed TV-based mode of home care using a WiFi set-top box as a gateway. Rahmani et al. [16] developed a smart home gateway and a corresponding monitoring system based on embedded technology, which can monitor multi-physiological signals. Although each of these methods has their own advantages, there are also some drawbacks. The mobile gateway cannot guarantee long-term and continuous measurements. The set-top-box-based system does not provide measurement of ECG signals, which is the most important physiological signal for assessing patients with cardiovascular diseases, and thus cannot offer comprehensive services for patients.
Smart homes [17][18][19] are becoming an effective solution that allows the growing number of elderly patients, as well as physically impaired patients such as the deaf and blind, to remain in the comfort of their homes with healthcare monitoring that supports their lifestyles. With several sensors, cameras, biomedical devices, and wearable health trackers installed throughout the home, the health conditions of residents can be continuously monitored. The assistance-required feature is triggered when an unusual or critical situation is detected, helping patients during emergencies. Local and remote alarms generated by the system alert the patient of critical situations, and can call healthcare service providers for help depending on how the system is programmed. A smart home can enable the elderly and people with disabilities to have full control over their living environments and perform daily activities on their own, while monitoring patient safety and well-being to reduce hazard risks. Having this level of independence improves patients' sense of dignity and reduces costs imposed on the healthcare system [20,21].
Energy consumed in remote monitoring systems and smart homes during the transmission of biomedical signals, such as ECG signals, needs to be reduced with a proper compression method that preserves the main ECG events. Notably, there are high-performance compression lossless-based methods [22] that are very complex, require high computational resources, and thus not suitable for remote monitoring [23,24]. We have therefore developed a simple, efficient, and sufficient lossy compression method that is suitable for remote monitoring and smart homes.

Data Used
Training Database: All 48 ECG recordings from the MIT-BIH arrhythmia database were used in the training phase, totaling 109,984 heartbeats [25]. The MIT-BIH database is widely used to evaluate the performance of ECG compression methods and QRS detection algorithms as it contains different types of noise and various QRS morphologies [26]. The annotations of R peaks are provided within each ECG recording.
Testing Database: All 105 ECG recordings from the QT database were used in the testing phase, totaling 111,301 heartbeats [27] for evaluation of the performance of our proposed compression algorithm.

Benchmark Lossless Method I: Adaptive Linear Prediction
In the literature, researchers have used forward-prediction based approaches to detect QRS complexes in ECG signals [28][29][30]. Typically, the use of linear forward prediction is for the estimation of the current ECG sample n based on its past m samples: wherex[n] is the output of estimating x[n], h m represents the predictor coefficients, and e[n] is the prediction error that is calculated as follows: The schematic representation of Method I is shown in Figure 2a. The prediction error e[n] signal is used to detect QRS complexes instead of using the ECG signal itself. For consistency and easy comparison between methods, we have used the variable h to refer to the impulse response in this paper.

Benchmark Lossy Compression Method II: Decimating by a Factor B/K
Method II converts the sampling rate by interpolation factor of B, followed by a decimating factor of K [31,32]. Figure 2b illustrates the idea of decimation by factor B/K. The interpolation step can be expressed as follows: Then, the output J[r] signal passes through low-pass filter (LPF) as follows: Then, the output signal of the decimator is where m is the data samples of the compressed ECG signals. In this paper, r refers to the ECG sample point generated after the filtering step while m refers to the compressed ECG sample point.

Proposed Lossy Compression Method III: Decimating by Factor K
The decimator is an improved version of a downsampler as it avoids aliasing (defined as reconstructing a signal that is completely distorted and does not include the original signal main events [31]). The first step of the decimator is to reduce the bandwidth of x[n] to F x,max = F x /2K, which is equivalent to w x,max = π/K in frequency domain, and then downsample by K. The block diagram of decimation is shown in Figure 2c. The ECG signal x[n] is passed through an LPF, characterized by the impulse response h[n] and frequency response H K (w x ), which satisfies the following: Therefore, the LPF eliminates the spectrum of X(w x ) in the range π/K < w x < K. In other words, only the frequency components of x[n] within the range |w x | ≤ π/K will be downsampled. The output of the LPF can be written as follows: Thus, the output signal of the decimator is: Given that the LPF operation on x[n] is linear and time invariant, the combination of LPF with the downsampler produces a time-variant system. Thus, decimation is suitable for analysis of the ECG signal, as it is a time-varying signal.
We have one variable K to compress the ECG signal to K. An optimization step is needed to determine the optimal value for K. We have three objective functions: TP(K), FP(K), and FN(K) to be optimized simultaneously, as follows: where g is the F-score (the harmonic mean of sensitivity and positive predictivity). The optimization process is time-consuming at the training phase, but once it is achieved, the optimal parameter K will be used as is in the implementation phase.

QRS Detection
In this paper, a QRS detector is needed to evaluate the compression performance. To our knowledge, the recently published QRS detection algorithm [3,26] is the most reliable as it was tested on 11 different ECG databases, making it an efficient algorithm. The QRS detector in [26] was validated multiple times in the literature, and it is called the two-event-related moving averages (TERMA) algorithm [33].
The TERMA-based QRS detector is fast, reliable, and efficient, and better-suited for remote monitoring and battery-operated mobile devices [3,26,33]. Therefore, TERMA-based QRS detectors are used in combination with Method III to improve the overall ECG signal analysis, reduce memory capacity, and improve signal transmission as recommended in [22].
The function of a TERMA-based QRS detector [33] has five inputs: starting frequency (F 1 ), end frequency (F 2 ), first window size (W 1 ), second window size (W 2 ), and rejection threshold (β). The processing flow of TERMA begins by passing an ECG signal through a third-order Butterworth F 1 -F 2 bandpass filter. The output signal is then squared, followed by two moving averages (with two window sizes W 1 and W 2 ), and then applying β threshold is applied for blocks of interest generation. The optimization phase of TERMA is discussed in [26], and the optimal value for these five parameters is found to be F 1 = 8 Hz, F 2 = 20 Hz, W 1 = 97 ms, W 2 = 611 ms, and β = 8. Therefore, we use a TERMA-based QRS detector with these optimized values.
The TERMA-based QRS detector is applied after compressing ECG signals using Method III. The lossless benchmark in Method I has it is own QRS detector that begins by removing high-frequency noise from the prediction error signal. Then, it passes the output signal to a Savtizky-Golay filter to smooth the signal with a window of size W and a polynomial of order O, treating the QRS detection as a least-squares problem. Method II uses a TERMA-based QRS detector as in Method III.

Compression Ratio
The bit compression ratio (BCR) was calculated as follows: where BW c and BW u refer to the bit widths of compressed and uncompressed samples, respectively.

Results and Discussion
The MIT-BIH arrhythmia database is used for evaluating all compression algorithms. This benchmark database contains 48 ECG recordings, each of which is 30 min in length. The ECG signals have 11-bit resolution over 10 mV and are sampled at 360 Hz.
For the evaluation of all compression methods, two statistical measures are used, sensitivity (SE) and positive predictivity (+P), which are calculated as follows: +P(%) = TP/(TP + FP).
The benchmark lossless Method I uses two parameters during the process of compression and detection of QRS complexes: W and q. The optimal values for W and q are determined in [30]; after applying Pareto optimization, W ranged from 3 to 6 and q ranged from 9 to 17. It was found that optimal values are W = 3 and q = 15.
The benchmark lossy Method II also uses two parameters B and K. The optimization process is determined in [22], where the value of B varies from b min = 360 Hz to b max = 500 Hz, and the value of K varies from k min = 50 Hz to k max = 360 Hz. The optimal value of B = 390 Hz and the optimal value of K = 80 Hz.
The proposed lossy Method III uses only one parameter, K. The optimization process was carried out using the training database (MIT-BIH Arrhythmia database) and the value of K varied from k min = 45 Hz to k max = 360 Hz. The optimal value of K was found to be 60 Hz, as shown in Table 1. Then, the value of K = 60 was used on the testing database (QT database). Note that researchers can use the optimal value for compressing any ECG signals, and there is no need to redo the optimization phase again unless a certain abnormality or noise is investigated. The QRS detection results of all ECG recordings using Method III with K = 60 are shown in Table 2. The y-axis represents manipulated signal amplitudes. Here, the red + represents the annotated R peak based on the MIT-BIH Arrhythmia Database while the green * represents the detected R peak using the two-event-related-moving-average(TERMA)-based QRS detector. The QRS detection performance of the proposed compression methods and well-known QRS detectors is shown in Table 3. As shown, Method III (along with a TERMA-based QRS detector) outperformed most of the well-known algorithms, such as Hamilton and Tompkins [34], Poli et al. [35], Afonso et al. [36], Martínez et al. [37], Chen et al. [38], Ieong et al. [39], and Nallathambi and Principe [40]. Interestingly, Method III scored identical results as the multiscale morphology technique, which is highly computationally complex. In contrast, the proposed Method III is simple, faster, and more efficient, more suitable for smart homes and remote monitoring. Method III outperformed Method I and provided similar (though slightly lower) results to Method II.  Table 4 compares the performance of Methods I, II, and III with other compression schemes implemented for remote monitoring. Method III scored the highest BCR at 6 with low PRD of 1.88 over the whole MIT-BIH Arrhythmia Database, outperforming existing well-known compression methods. Note that Method III outperformed the delta predictor/Rice-Golomb coding [42], adaptive predictor/Huffman coding [43], simple predictor/Huffman coding [44], slope predictor/fixed-length packaging methods [45], Compressive Sensing [46], Nonuniform Binary Matrices [47], and Encoding with Modified Thresholding [48], as well as Method I and Method II.
On the other hand, Method III scored a BCR similar to the Compressive Sensing method [49]; however, Method III scored a lower PRD of 1.88, which makes it superior. The only method that may compete with Method III is the Simultaneous Orthogonal Matching Pursuit [50]; however, these results were based on only one record from the MIT-BIH database, unlike Method III, which was validated over the entire database.  Figure 4 shows the BCR versus PRD and the average processing time (APT) for a TERMA-based QRS detector. As expected, the APT decreased as the BCR increased. The TERMA-based detector took an APT of 0.15 s to achieve a BCR of 6. The compression of Method III took an APT of 0.10 s to compress Record 100 from the MIT-BIH Arrhythmia database. Here, BCR stands for bit compression ratio, PRD stands for percentage root-mean-square difference, and APT stands for average processing time. The red arrow shows the optimal combination of BCR, APT, and PRD.

Methods Implementation
To date, researchers have focused only on the ECG lossless compression methods, as seen in Method I. The lossless compression methodology tries to achieve a PRD of value 0. However, the lossy methods have no yet been investigated as extensively as the lossless methods [22]. We have therefore developed Method III to improve the CR of the lossy method that was recently published in [22].
Method I uses the prediction error signal to detect the QRS complexes in ECG signals. Method II and Method III detect the QRS complexes from the filtered ECG signal, and therefore they do not need a linear predictor. The advantage of using the prediction error signal is its low amplitude values and its center around zero amplitude, except for the QRS complex areas. However, a lossless coding step is required to preserve the main events within ECG signals. It is known that the use of lossless coding scheme would affect the signal quality and increase consumption of energy and computational resources.
The CR (downsampling factor) in Method III ranges from 1 to 8. If we downsample by a factor greater than 8, then the corresponding frequency band will be ≤40 Hz. In other words, if the downsampling factor is 9, then the corresponding sampling frequency is 40 Hz (the original sampling frequency of the ECG signals is 360 Hz). When applying the bandpass filter of the QRS detection algorithm, there will be an error, as the cutoff frequencies must be within the interval of 0-1. For example, the QRS detection algorithm uses F 2 = 20 Hz. If the factor is 9, then the sampling frequency will be 40 Hz; if the cutoff frequency is F 2 /(F s /2), then it will equal exactly one, which the filter will fail to implement. Therefore, the maximum factoring for Method III is 8. In other words, the sampling frequency of ECG signals is recommended to be greater than or equal to 40 Hz.
Method II was developed to compress ECG signals and focused on achieving a high QRS detection rate and a high PRD. In comparison, Method III was developed to focus on increasing the CR with a strong emphasis on the QRS detection method, rather than emphasizing the PRD method. The main objective of Method III was to create a method that could be applied to smart homes and remote monitoring, where long-term (over several days) ECG signals need to be collected in a fast and efficient manner. In other words, if we have the computational resources, and the ECG processing speed is not crucial, then Method II can be used; otherwise, Method III needs to be used to achieve high processing speeds.

Method Performance
The comparison of the compression performance of Methods I, II, and III with well-known compression techniques can be seen in Table 4. There are more compression techniques that achieve higher BCR, but these techniques are not suitable for low-power wearable applications [54,55], and are therefore not included in the table. Note that low complexity compression algorithms that achieve high BCR result in energy savings for both the compression process and the wireless transmission [46]. The overall energy consumption is more efficient when compared to transmitting the original signal with more complex algorithms [56][57][58].
Method III achieved a BCR of 6 without the need for linear predictor, coding, or packaging. The compression performance of Method III is substantially higher than all the algorithms, especially when the value PRD is considered. Moreover, applying the TERMA-based QRS detector validates the proposed Method III based on QRS detection accuracy. This step is crucial for developing a compression methodology for smart homes and remote monitoring applications.
Most of the published ECG compression methods are typically not validated by a QRS detection step, which makes it more difficult to assess compression quality. Method III succeeds in preserving the main features of the ECG signal morphology given its lossy nature, as shown in Figure 3. It is clear that Method III is a fast, efficient, and sufficient technique for remote monitoring.
The performance of different QRS detectors published in the literature is shown in Table 2. Unfortunately, some researchers have excluded records from the MIT-BIH arrhythmia database due to noise or arrhythmia, and, consequently, their algorithms appear to achieve higher performance levels. Other researchers have excluded specific segments from each recording [37,59]. In contrast, we tested the TERMA-based QRS detector over the output of Method III without excluding any records or segments making the results more robust and meaningful [3]. Figure 5 shows that Method III smooths the frequencies with a power spectrum capturing the main frequencies in the range of 10 Hz to 18 Hz. This observation confirms the findings in [26,[60][61][62]. Method II also enhances the ECG frequencies, creating a bimodal distribution and improving the frequency spectra of Method I. The detection performance of Method III on the QT database on a record-by-record basis is shown in Table 5, while Table 6 shows the overall comparison of our results with the existing QRS detection algorithms on the QT database. The performance of each algorithm was reported in terms of number of beats, SE, and +P. The proposed algorithm performed higher in terms of SE and +P when compared to Pan-Tompkins [26] and Elgendi [26] over the same number of beats. Moreover, Method III scored an overall performance similar to Method II with a higher compression rate (CR = 6) when compared to the recently published Method II. We applied Method III to the QT database without changing the value of any parameter and without re-training the algorithm. It is clear that the results of Method III are promising (with the fixed parameter K = 60 Hz) and can be applied over different databases with different sampling frequencies.   One of our next steps is to test Method III in a wireless healthcare system to confirm the findings. Given the fact that we implemented the algorithm on Matlab, the results are promising and give an approximation of real-world application. Mamaghanian et al. [46] found that the processing time of compression method provided by the TI MSP430 microcontroller and the CC2420 radio chip-set, which operates on a Li-ion battery, is close to the processing time estimated by Matlab.

Smart Homes
This proposed lossy algorithm aims at developing a smart home solution based on ECG signals that is environmentally friendly, maintains and enhances occupant lifestyles, and cares for users both physiologically and psychologically. There are several technical challenges that exist in remote monitoring, health, wellness, and home operations. Through this paper, we investigate the possibility of overcoming the technical challenges associated with transmitting and processing ECG signals as part of a smart home system.
To provide a long-range remote monitoring, several gateway devices can be deployed to interface with the existing wireless systems in healthcare [65]. These gateway devices will mainly be used to provide communications between the sensor unit and the remote computers or mobile devices [8]. Two scenarios can be considered: • Scenario 1: The lossy compression method is applied on the sensor unit and the analysis of ECG signals such QRS detection can be implemented on the gateway(s) or the processing unit (computers, internet, etc.). This will depend on the gateway computational capability in terms of processing and memory. • Scenario 2: The lossy compression method is applied on the gateway unit and the analysis of ECG signals such QRS detection can be implemented on the processing unit (computers, internet, etc.).
We believe that the key to establishing a smart home system lies in developing and enabling hybrid technologies that are user-friendly, affordable, and allow for a seamless transition as new technologies evolve, such as cloud computing, the Internet of Things, 5G wireless networking, and sensor networks. Such an integrated system can augment current healthcare methods and empower healthcare professionals and patients with an advanced personalized smart home for continuous monitoring, quality diagnosis and prognosis, and assessment of rehabilitation efficacy for better treatment, well-being, and smart care. The proposed ECG compression algorithm will facilitate health care cost reduction, early release from hospitals, quality patient care through continuous monitoring, reduced pressure on health care providers, and accessibility to care for underserved populations in remote areas.

Global Health
Method III potentially plays a major role in the development of ECG-based point-of-care technologies to assist in the prediction and diagnosis of diseases in low-and middle-income countries (LMICs). It is known that LMICs struggle to attain high quality and universally accessible healthcare. Many factors need to be considered when developing robust medical monitoring technologies, one of the most important parts being data collection and transmission. A framework was created to standardize the way of tackling this issue in [66], and Method III achieves all the requirements of the global health framework in [66]: simplicity, mining, connecting, reliability, affordability, and scalability. Simpler algorithms that achieve the same or even higher accuracy than complex algorithms are necessary for global health application [66].
In LMICs, mobile network penetration has reached 89% [66], and, consequently, the use of mobile devices in these countries has increased. This gives researchers an opportunity to collect ECG signals using mobile phones as a gateway for transmitting ECG data. Some analysis can be done locally on point-of-care devices, phones, and wearable devices before transmission; however, this step requires a large amount of energy. Investigating efficient ECG compression methods for local analysis and transmission is valuable in these scenarios.

Conclusions
We discuss in this paper the lossy compression Method III, which is suitable for remote health monitoring systems. The proposed Method III is validated with QRS detection and is scalable for smart homes, wearable devices, and point-of-care devices. It can provide long-term and continuous monitoring for the elderly and other patients whose mobility and access to healthcare is limited. Given the considerable data collection, transmission, and analysis involved in the monitoring process, Method III achieves a compression ratio that is six times faster with a high QRS detection accuracy (an SE of 99.90% and a +P of 99.56% using the MIT-BIH arrhythmia and QT databases). The results demonstrate system readiness, and effectiveness for real-time healthcare monitoring.