ECG Heartbeat Classification in Compressive Domain for Wearable Devices
Journal Pre-proof
ECG Heartbeat Classification in Compressive Domain for Wearable Devices Jing Hua, Yilu Xu, Jianjun Tang, Jizhong Liu, Jihao Zhang PII: DOI: Reference:
S1383-7621(19)30494-1 https://doi.org/10.1016/j.sysarc.2019.101687 SYSARC 101687
To appear in:
Journal of Systems Architecture
Received date: Revised date: Accepted date:
28 July 2019 14 October 2019 24 November 2019
Please cite this article as: Jing Hua, Yilu Xu, Jianjun Tang, Jizhong Liu, Jihao Zhang, ECG Heartbeat Classification in Compressive Domain for Wearable Devices, Journal of Systems Architecture (2019), doi: https://doi.org/10.1016/j.sysarc.2019.101687
This is a PDF file of an article that has undergone enhancements after acceptance, such as the addition of a cover page and metadata, and formatting for readability, but it is not yet the definitive version of record. This version will undergo additional copyediting, typesetting and review before it is published in its final form, but we are providing this version to give early visibility of the article. Please note that, during the production process, errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain. © 2019 Published by Elsevier B.V.
ECG Heartbeat Classification in Compressive Domain for Wearable Devices Jing Huaa , Yilu Xua , Jianjun Tanga,∗, Jizhong Liub,∗, Jihao Zhangc a School
of Software, Jiangxi Agricultural University, Nanchang 330045, China of Mechatronics Engineering, Nanchang University, Nanchang 330031, China c School of Foreign Languages, Huazhong University of Science and Technology, Wuhan 430074, China b School
Abstract The heartbeat classification of ECG signals on wearable devices has attracted extensive attention in recent years. Many existing works have studied them, but they do not consider the energy consumption of wearable device for classification of ECG signals. These methods are thus not suitable for wearable devices. In this paper, we propose a novel ECG heartbeat classification scheme performed in the compressive domain to reduce energy consumption for wearable devices. Specifically, we develop a new QRS detection algorithm that finds the position of the QRS complexes directly on the compressive ECG measurements without signal reconstruction, followed by a deep boltzmann machine (DBM) based classification. Extensive experiments are implemented on MIT-BIH database and our database to verify the proposed scheme. The results show the efficacy of our scheme. More specifically, when CR is 40%, our scheme achieves an accuracy of 90.00% and 81.88% on MIT-BIH database and our database, respectively, compared to an accuracy of 94.38% and 89.38% for the benchmarking method, while ensuring that the energy consumption of wearable devices is reduced. The results also demonstrate that our scheme is effective in significantly improving CPU runtime for wearable devices. Keywords: Compressive sensing, Heartbeat classification, Compressive ∗ Corresponding
author Email addresses:
[email protected] (Jianjun Tang),
[email protected] (Jizhong Liu)
Preprint submitted to Journal of Systems Architecture
December 2, 2019
domain, QRS detection.
1. Introduction Cardiovascular diseases (CVD) is the primary cause of death worldwide, and its morbidity and mortality are much higher than other diseases, making it the number one killer of human health. According to the data from the World 5
Health Organization (WHO) in 2017, approximately 17.7 million people died of cardiovascular disease in 2015, accounting for 31% of all deaths worldwide. The prevalence of cardiovascular disease in China is also on the rise. According to the China Cardiovascular Disease Report (2017), the number of cardiovascular patients is estimated at 290 million. Arrhythmia is the most common form of all
10
cardiovascular diseases. Hence, timely and accurate detection of arrhythmia for patients is of great significance in preventing the occurrence of cardiovascular diseases. As a cardiac electrophysiological signal collected noninvasively, electrocardiogram (ECG) signal are usually used as the object of dynamic monitoring for the detection of arrhythmia [1, 2, 3, 4, 5, 6]. However, it is extremely incon-
15
venient for patients to lie in the hospital for ECG monitoring. Wearable devices enable continuous monitoring of patients anywhere and anytime, dramatically reducing medical costs. For this reason, they are widely used for monitoring ECG signals, which is an application of cyber physical systems (CPS). The traditional diagnosis is that the doctor analyzes and diagnoses the pa-
20
tient’s condition by looking at the electrocardiogram according to his own experience. However, the professional ability of each doctor is different. It is difficult for a doctor with insufficient experience to make a correct judgment on some conditions of pa. In addition, due to the variety of arrhythmia, the waveform of the ECG signal is more complicated, and various variations are often generated,
25
making it difficult to distinguish between them even for experienced doctors. Moreover, doctors face a large number of diagnostic work for a long time, and it is inevitable that there will be leakages, which may lead to misdiagnosis and affect the prevention or treatment of the disease. Therefore, computer-aided
2
methods are needed to assist doctors for arrhythmia diagnosis [7]. 30
The automatic classification of ECG signals on wearable devices has attracted considerable attention in recent years [8, 9, 10, 11, 12]. Dimitra [8] presented an ECG analysis and classification scheme to diagnose heartbeat on a wearable device. The discrete wavelet transform (DWT) and support vector machine (SVM) are chosen for the ECG analysis and classification, respectively.
35
Serkan et al. [9] developed a patient-specific ECG classification approach employing an adaptive realization of 1D Convolutional Neural Networks that can integrate feature extraction and classification into a single learning body. It can be easily used for real-time monitoring system of ECG signals on wearable device. In literature [10], a stacked denoising autoencoder based method was
40
designed to classify wearable ECG signals automatically. The proposed scheme utilizes stacked denoising autoencoder to extract the ECG feature, and classify the ECG signals via softmax regression. A novel algorithm was studied in [11] for wearable ambulatory devices to preprocess and classify the ECG signals. An integral-coefficient-band-stop filter was first employed to preprocess the ECG
45
singals, then a classifier that performs ECG feature extraction and classification was proposed based on two-layered Hidden Markov Models. The authors in [12] presented a long short-term memory (LSTM) based ECG classification approach that is implemented on wearable devices to solve the continuous ECG monitoring by combining wavelet transform with multiple LSTM.
50
Wearable device bring some problem as it becomes more and more popular with consumers. The main drawback is still the battery life problem, and how to reduce the energy consumption is a major factor in the design of it [3, 6, 13, 14, 15, 16]. However, the energy consumption of wearable device are not considered in the above works for classification of ECG signals.
55
In this paper, we developed a novel heartbeat classification scheme of ECG signals for wearable devices to reduce energy consumption. The proposed scheme is based on the compressive ECG measurements obtained by compressive sensing (CS) technique, which has the ability reduce energy consumption and extending battery life for wearable device as a data compression technique with low com3
60
plexity. It first detects the QRS complexes directly on the compressive ECG measurements using a template based algorithm. Then, DBM is employed to classify the cardiac arrhythmia without ECG signal recovery. In summary, the contributions of this paper are divided into three aspects: • A template based algorithm is proposed to locate the QRS complexes by
65
caculating the correlation of the compressive ECG measurements and a designed template of QRS in the compressive domain, skipping a computationally expensive reconstruction step, and thus reduces energy consumption. Moreover, preprocessing is not required in the QRS detection approach.
70
• Based on the detected QRS complexes from the compressed ECG signals, deep Boltzmann machine is introduced in this paper for heartbeat classification without recovering the original ECG singal. • Two sets of simulation experiments have been implemented to verify the effectiveness of our scheme on MIT-BIH database and our database. As
75
expected, the performance of the proposed algorithm is slightly reduced relative to classification on the original ECG data and reconstructed ECG data. However, it achieves lower energy consumption and thus suitable for wearable devices. The rest of the paper is organized as follows. Section 2 introduces the relative
80
technique. Section 3 describes our ECG heartbeat classification scheme. Section 4 reports the experimental results. Finally, Section 5 concludes the paper.
2. Preliminary Below, we describe the compressive sensing [17, 18, 19, 20] and then present the technique of signal processing with compressed measurements.
4
85
2.1. Compressive Sensing Given an original signal vector x of length N and a set of M vectors, inner product vector y is expressed as: yi =< x, ϕi > .
(1)
T
Let Φ = [ϕ1 , ϕ2 , · · · , ϕM ] , where Φ is measurement matrix, also called sensing matrix, Equation (1) becomes: y = Φx,
90
(2)
where y = {yi }M 1 is the CS linear sensing measurement. Equation (2) is underdetermined and has an infinite number of solutions, but if x is sparse, x can be accurately reconstructed from the partial measurements y by solving l0 -minimization problem as shown in Equation (3):
x ˆ = argmin k x k0 s.t.Φx = y.
(3)
If x is not sparse but compressible, that is, it can be sparsely represented 95
under the base Φ, where Φ is sparse base or sparse matrix, so that x = Ψθ, where θ is sparse. Let Θ = ΦΨ. Equation 1 can be re-written as: θˆ = argmin k θ k0 s.t.Φθ = y.
(4)
Then the original signal x is recovered by x = Ψθ. Since the actual signal is generally compressible, Equation (4) is used more in the application to describe CS reconstruction. When the measurement matrix Φ and the sparse basis Ψ are 100
incoherent, that is Θ = ΦΨ, and meets the Restricted Isometry Property (RIP), l1 -minimization problem can be transformed into l1 -minimization problem, ie, Equation (4) is equivalent to Equation (5): θˆ = argmin k θ k1 s.t.Φθ = y. 5
(5)
It can be seen from Equation (2) that a small number of CS measurements contain global correlation information of the original signal, rather than partial 105
independent information of the original signal. Under this premise, according to certain conditions, the original signal can be recovered without distortion by Equation (5). However, the signal is generally distorted in the case of noise interference, amplitude rounding, quantization, etc. In these cases, Equation (5) can be converted into Equation (6) to reconstruct the signal. θˆ = argmin k θ k1 s.t. k Θθ − y k2 < ξ.
110
(6)
The error of the final reconstructed signal x ˆ and the original signal x satisfies kx ˆ − x k2 < Cξ, where C is a constant. 2.2. Signal Processing with Compressed Measurements Signal reconstruction from compressive data has been widely studied during the past decade. Nevertheless, there is no need to recover signals for some
115
signal processing problems. A automated tracker based on particle filter was designed in [21]. The likelihood in the particle filter is updated by utilizing the smashed filter, which directly calculates the correlation without signal recovery. The tracker is converged when the sensing rate is 0.3. Braun et al. [22] developed an image classification method based on deep Boltzmann machine, which
120
is performed on compressive data. The experimental results for the MNIST handwritten digit dataset shows that the proposed approach achieves an error rate of 1.21% for relative to that of 0.99% for uncompressed data when sensing rate is 0.4. Da Poian [23] proposed a method to calculate heart rate based on compressive ECG signals. It detects the position of the QRS complex in com-
125
pressive domain via calculating the correlation between the compressive ECG data and the designed template of QRS waveform. Davenport[24] presented a compressed classifications framework, which can perform on compressed signals skipping the image recovery stage. The experiments indicate that even with very few compressed measurements, the proposed method can achieve very good
6
130
results for target classification. In [25], a problem involved is to obtain a function of original from compressive signas. Given the observation y = Φx, where x and y are original signal and compressive measurements, respectively. The objective is to estimate < τ, x > from y, where τ is a fixed test vector.
135
Two estimators are described in [25]. The first estimator, referred to as the orthogonalized estimator, is given by N T y (ΦΦT )−1 Φτ. M
(7)
The second estimator, referred to as the direct estimator, is given by < y, Φτ > .
(8)
3. Our Approach The proposed scheme aims to perform heartbeat classification directly in 140
the compressive domain without ECG signal reconstruction to reduce energy consumption for wearable devices. A depiction of our proposed scheme is given in Fig. 1. First, the original ECG signal is observed using a sparse binary random matrix, and the compressed ECG measurements are obtained. Then, the locations of the QRS complexes are detected by a template based algorithm
145
on the compressive ECG signals to acquire the RR interval. Next, the RR interval, together with the compressive ECG measurements, provides the input to the classifier, which is based on DBM, and finally the classification result is obtained. The two main steps, QRS detection and heartbeat classification, are presented in the following subsections.
7
Original ECG signal X
Sparse binary random measurement matrix Φ
Compression Y= ΦX Compressed ECG measurements Y
Template based algorithm
QRS detection
RR interval
DBM
Classification
Normal beat
Atrial premature beat
Figure 1: an overview of the proposed scheme.
150
3.1. QRS Detection 3.1.1. Problem Definition Before presenting the formulation of QRS detection problem, we first give the model of ECG signal, which is expressed as xv (n) = x(n) + v(n) =
X i
µi τ (n − δRi ) + v(n),
(9)
where v is the noise, τ is the kernel, δ and µ are the center and amplitude of 155
τ , respectively. When applying the model to the QRS template of ECG signal, δRi denotes the location of the R peak. Then, we rewrite the Equation (9) into a vector form xv = x + n, and the compressed measurements y can be obtained using a measurement matrix Φ according to y = Φx + n.
8
(10)
Therefore, the objective of QRS detection is to obtain the estimation of δRi in 160
the original ECG signal from the compressive ECG measurements. 3.1.2. Template based QRS Detection The proposed template based method for QRS detection is described in Algorithm 1. It mainly consists of four stages, i.e., QRS template design, correlation calculation and R-peak detection, which are presented as follows. Algorithm 1 Detect QRS complexes in the compressive domain Input: Compressive ECG measurements y, Measurement matrix Φ Output: The positions of R waves δ 1: Reconstruct the compressed ECG measurements for a short time, and create the
QRS template τ based on the recovered ECG segments. 2: Calculate the correlation Rxτ between the compressive measurements y and the
compressive QRS template τ . 3: Locate the position δ of the R waves via comparing the correlation with an thresh-
old λ, which is determined by Algorithm 2.
165
Template Designation: In order to provide a reference for the QRS location on the compresseive measurements, the ECG signal for a short time is first recovered by using BSBL algorithm. The recovered ECG is also used to examine if the ECG data are properly acquired. Note that the reconstructed ECG excerpts ought to be long enough to make it include appropriate heart-
170
beats to construct the template of QRS. Then, the Pan-Tompkins algorithm is employed to find the positions of R-peaks for this short recovered ECG, and the QRS complexes are detected by extracting the 0.3 second excerpts before and after the R-peaks. At last, the median of the located QRS complexes is utilized to design the QRS template in the original signal domain.
175
Correlation Calculation: The key stage of the proposed approach is the correlation calculation between the compressive ECG measurements and the QRS template in the compressive domain. First of all, the QRS template in compressive domain is derived using Φτ . Furthermore, since the correlation in
9
the original domain for each signal block is calculated as Rxτ =< x, τ >,
180
(11)
the correlation in the compressive domain can be estimated via employing the direct estimator as follows:
ˆ xτ R
< y, Φτ1 >
< y, Φτ2 > . = ··· < y, ΦτN >
(12)
As a weak signal, ECG signals are easily interfered with by various noises during acquisition and transmission. Therefore, to reduce the influence of noise, the mean of signal, which is obtained by employing the method proposed in [24], 185
is removed from every signal block before Equation (12) is calculated. R-peak detection: The Last but not least step of the proposed QRS detection approach is to find the position of R waves via comparing the correlation with an threshold, which is calculated for every signal block. In order to make the threshold fit for each compression ratio, an adaptive algorithm is proposed to
190
determine the threshold and find the position of R wave, as shown in Algorithm 2. The proposed adaptive algorithm operates as follows. Lines 1-18 describe the process to locate the position of R peak for each signal block. Line 2 computes the Root Mean Square (RMS) rmsi and the maximum absolute value maxi
195
of the correlation for the current i-th signal block. Lines 3-7 determine the threshold λi of the current i-th signal block for detection. If the rmsi is larger than 25% of the maxi , the value of λi is assigned to be 75% of maxi (lines 3-4). If the rmsi is smaller than 25% of maxi . the value of λi is assigned to be 50% of maxi (lines 5-7). Line 8 compares the correlation Rxτ with the threshold
200
λi , and then the corresponding indexes of maximum value are chosen for the location of R waves δRi . 10
Lines 9-12 examine whether QRS wave appearing across two consecutive signal blocks is repeatedly located by measuring the distance Di between the last final located R wave in the (i-1)th signal block δR(i−1) and the opening in the 205
1 i-th signal block δRi . The distance Di is derived (line 9). If Di is smaller than 1 1 last 0.2s, the position of R wave is modified using δRi = (δRi +δR(i−1) )/2 (line10-12).
Lines 13-17 check whether QRS wave appearing across two consecutive signal blocks is missed detected by measuring the RR interval. The RR interval rri and the average RR interval rraver of the prior five signal blocks are caculated 210
(line 13). If rri is larger than 1.5 times rraver , the threshold λi is updated to 0.5 times its value, and then a detection is executed in a 0.1s window centered between the two consecutive signal blocks (line 14-17). 3.2. DBM based Classification To solve the problem of important information loss of ECG signal due to
215
the signal compression, the RR interval is derived. Therefore, the RR interval, together with the compressive ECG measurements, provides the input to the classifier, which is based on DBM. 3.2.1. Deep Boltzmann Machines Boltzmann machines [22] have the ability to be performed in the opposite
220
direction to produce samples. A standard restricted boltzmann machine (RBM) is composed mainly of visible layer, hidden layer, and output layer. Each node of the layers can be derived as below P X p(hj = 1|v, h−j ) = µ( wij vi ),
(13)
i
p(vi = 1|v, h−i ) = µ(
Z X
wij hj ),
(14)
j
where v and h represents the visible layer and hidden layer, respectivity, w is the weight, µ(x) = 1/(1 + e−x ) denotes logistic function. The RBM attempts to 225
obtain a probability distribution of the visible layers v according to h and W . 11
Algorithm 2 Find the position of R wave Input: Correlation Rxτ , number of signal blocks K Output: The positions of R peaks δ 1: for i = 1 to K do 2:
compute the Root Mean Square rmsi and the maximum absolute value maxi of the correlation for the current i − th signal block;
3: 4: 5: 6:
if rmsi > (maxi × 25%) then λi = maxi × 75%; else λi = maxi × 50%;
7:
end if ;
8:
detect the position of R peak δRi by comparing the correlation Rxτ with the threshold λi , and the corresponding indexes of maximum value are chosen for the location of R peaks.
9:
derive the distance Di between the final located R wave in the (i − 1)th signal 1 last ; and the opening in the i − th signal block δRi block δR(i−1)
10: 11:
if Di < 0.2s then last 1 1 + δR(i−1) )/2; = (δRi δRi
12:
end if ;
13:
caculate RR interval rri and the average RR interval rraver of the prior five signal blocks ;
14:
if rri > (rraver × 1.5) then
15:
λi = λi × 0.5;
16:
execute a detection in a 0.1s window centered between the two consecutive signal blocks;
17:
end if ;
18: end for
12
v
1
v
w
(1)
11
h
(1)
h
(1)
w
(2)
11
1
2
(2)
h
(2)
1
2
w
(l )
11
3
P
1
...
...
l
...
v
l
2
...
v
h
h
w
h
(1) Z1
Zl
(2) Z2
(1 ) W Z1
Figure 2: an overview of Deep Boltzmann machine.
The DBM is an extension of Boltzmann machines, which increases numerous layers and adds an pre-training stage for the network. An example of DBM with two hidden layers is shown in Fig. 2. 3.2.2. Training Method 230
A training algorithm is developed to adjust the DBM to the classification for compressed data. The proposed algorithm is implemented in two steps, that is, pre-training and fine tuning. The standard RBM is extended to multiple layers via training layer by layer. Then, the backpropagation algorithm is utilized to slightly adjust the weights of the network.
235
The proposed training algorithm is presented in Algorithm 3. Firstly, for the sake of keep the structure of the original ECG signal, the DBM is trained on the recovered ECG data to obtain the weights W 1 of the network using contrastive divergence (CD) algorithm in reference [26]. Secondly, the weights W 1 in the original domain is projected into compressive domain to estimate its weights of
240
1 the first layer by Wcs = ΦW 1 . Thirdly, the hidden layer h1 of the network is
taken as the input to train the weights of the second layer W 2 . This operation is performed recursively for L layers. Finally, the backpropagation algorithm is implemented in the compressive domain with the same training data to slightly adjust the network weights after pre-training.
13
Algorithm 3 Train the DBM based on compressed data Input: A training set of the compressed ECG data y. Output: The weights of the network W . 1: Train the first layer of the network on the recovered ECG data to initialize the
weight W 1 using contrastive divergence learning algorithm. 1 2: Estimate the first layer weight in the compressive domain by Wcs = ΦW 1 .
3: Use samples h1 as the examples for training the second layer of the RBM to derive
its weight W 2 . 4: Recursively continue up to layer L. 5: Employ backpropagation algorithm in the compressive domain with the same train-
ing data to fine-tune the network weights.
245
4. Experiments and Results In this section, we carry out two sets of simulation experiments to validate our developed QRS detection and heartbeat classification method for ECG signals on MIT-BIH database and our database The data and experimental settings are first introduced, and then the proposed approach is compared with the
250
benchmarking methods in terms of QRS detection and heartbeat classification. 4.1. Data and Experimental Settings The ECG data from MIT-BIH Arrhythmia Database [27] that involves 48 half-hour and two-channel ECG signals of 48 people, are utilized in the experiments. The frequency of the ECG is 360Hz, and only the first channel of each
255
recordings is chosen for the performance evaluation of the proposed algorithms. Each recording has been independently annotated by two or more cardiologists. A total of 2560 heartbeats from this database are utilized, 90% of which are used as training data and the remaining 10% are used as testing data, in other words, the tenfold cross-validation method is used for training and testing the classifier.
260
In order to ensure the robustness of the proposed scheme, our database is also used in the experiments. The ECG signals in this database were acquired by continuous monitoring of nearly 1000 patients. Each patient collected a con-
14
tinuous 10s ECG signal with a sampling frequency of 1000 Hz. In addition, we invited three relevant cardiovascular disease experts to label each heartbeat 265
category and R-wave position. In the following experiments, the ECG signals is classified into two classes, that is, normal beats and atrial premature beats, for the reason that the difference between them is extremely insignificant. To verify our scheme that implements the template based QRS location directly on compressive ECG measurements without reconstructing the original
270
ECG signals, followed by a DBM based classification, we compare it with a benchmarking method, referred to as DCRS, which employs a standard PanTompkins QRS detector and DBM based classification after ECG signals recovery using BSBL algorithm under different compression ratios. The compression ratio (CR) defined as CR =
275
N −M N
× 100% [3] can be varied from 10% to 90%,
where M is the length of compressive measurements, and N denotes the length of original signals. In addition, a sparse binary random matrix is utilized as the observation matrix. Since the number of 1s in each column of the matrix is the same, which is much smaller than the number of matrix rows, and the other values are 0, it can reduce the energy consumption of CPU operation for the
280
sensor node. For the purpose of fairness, the same experimental data and settings are utilized in the benchmarking approaches and our method. All the methods are run in Matlab, and the simulation is implemented on a computer with Intel Core 2.5 GHz CPU and 8GB RAM.
285
4.2. Evaluation of QRS Detection Performance 4.2.1. Evaluation Metric To validate the effectiveness of QRS detection, the position of R wave located by the algorithm is compared with the annotated position of R peak from Database. If the time difference between them is no more than 0.05s, the QRS
290
complex is deem to be correctly detected. We take the sensitivity (Se) and positive predictivity (+P ) as the evaluation metrics for QRS detection. These
15
(a)
4000
600
FP qrs
TP qrs
3500 3000 Our Method DCRS
2500
4000
Our Method DCRS
Total
FNqrs
400
0 10 20 30 40 50 60 70 80 90
Compression Ratio (%) (c)
1500
Our Method DCRS
200
2000 10 20 30 40 50 60 70 80 90
2000
(b)
800
1000 500 0 10 20 30 40 50 60 70 80 90
Compression Ratio (%)
Compression Ratio (%) (d)
3500 3000
Our Method DCRS Reference
2500 10 20 30 40 50 60 70 80 90
Compression Ratio (%)
Figure 3: T Pqrs , F Pqrs , F Nqrs , and total number of QRS detection for all the algorithms under varying CRs.
measurements are given by [28]: Se =
T Pqrs × 100%, T Pqrs + F Nqrs
(15)
+P =
T Pqrs × 100%, T Pqrs + F Pqrs
(16)
where T Pqrs (True Positive) is the correct number of detected QRS, F Pqrs (False Positive) is the wrong number of detected QRS, and F Nqrs (False Negative) is 295
the number of missing located QRS. 4.2.2. Experimental Results Fig. 3(a-c) presents the TP, FP and FN of QRS location achieved by the considered two methods, namely the proposed scheme performed in the compressive domain, and the benchmarking approach DCRS performed on recovered
300
ECG signals. Fig. 3(d) gives the amount of located QRS complexes, which is the sum of TP and FP. Fig. 4 and Fig. 5 plots the sensitivity and positive predictivity of QRS 16
100
90
Se (%)
80
70
60
50
40
Our Method DCRS
10
20
30
40
50
60
70
80
90
Compression Ratio (%)
Figure 4: Sensitivity of QRS detection for different algorithms under varying CRs.
100
90
+P (%)
80
70
60 Our Method DCRS
50
10
20
30
40
50
60
70
80
90
Compression Ratio (%)
Figure 5: Positive predictivity of QRS detection for different algorithms under varying CRs.
17
detection for different algorithms, our method and the benchmarking approach DCRS, under varying CRs (CR = 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80% 305
and 90%). The results in the figure clearly show that when the compression ratios are relatively low (CR= 10%, 20%, 30%, 40%, 50%, 60% and 70%), the two methods have a very similar performance. Both of the approaches show good results of the sensitivity and positive predictivity, especially the positive predictivity. More specifically, when CR = 10%, the Se and +P of our method
310
are 97.35% and 100%, respectively. Those of DCRS are 98.15% and 100%, respectively. When the compression ratios are relatively high (CR= 80% and 90%), the accuracy of QRS detection achieved by both methods declines significantly. Specifically, when CR = 90%, the Se and +P for QRS detection of the proposed approach drops to 53.95% and 77.82%, respectively. The Se
315
and +P of the benchmarking method DCRS also drops to 78.56% and 83.13%, respectively. Fig. 3(d) indicates that the proposed approach avoiding recovery procedure results in many missing detected QRS when the CR is high. Therefore, as we can see in Fig. 4, our algorithm detecting QRS on compressive ECG signals achieves a lower sensitivity for QRS detection than that of DCRS de-
320
tecting QRS on recovered ECG signals. However, it is easy to find in Fig. 5 that the positive predictivity for QRS location of the proposed algorithm is very close to that of the benchmarking approach DCRS even when the CR is high. To further demonstrate the performance of QRS detection, two examples from MIT-BIH Arrhythmia database when CR = 10% and CR = 80% are
325
given in Fig. 6 and Fig. 7, respectively. In particular, Fig. 6(a) depicts the original ECG recording and its annotated positions of R peaks marked with red circles. Fig. 6(b) and (c) plots the positions of R waves marked with red circles detected by the benchmarking algorithm DCRS and our algorithm, respectively, when CR=10%. Similarly, Fig. 7(a) depicts the original ECG signal and the
330
corresponding annotated positions of R peaks marked with red circles. Fig. 7(b) and (c) plots the positions of R waves marked with red circles detected by DCRS and our algorithm, respectively, when CR=80%.
18
(a)
200 0 -200
0
500
1000
1500
2000
2500
3000
3500
4000
4500
5000
3000
3500
4000
4500
5000
3000
3500
4000
4500
5000
(b)
200 0 -200
0
500
1000
1500
2000
2500
(c)
200 0 -200
0
500
1000
1500
2000
2500
Time Points
Figure 6: An example for QRS detection when CR = 10%.
(a)
200 0 -200
0
500
1000
1500
2000
2500
3000
3500
4000
4500
5000
3000
3500
4000
4500
5000
3000
3500
4000
4500
5000
(b)
200 0 -200
0
500
1000
1500
2000
2500
(c)
200 0 -200
0
500
1000
1500
2000
2500
Time Points
Figure 7: An example for QRS detection when CR = 80%.
19
4.3. Evaluation of Classification Performance 4.3.1. Evaluation Metric 335
For the purpose of classification performance evaluation, three indicators [29] are employed in this experiment, namely sensitivity =
TP × 100%, TP + FN
(17)
specificity =
TN × 100%, TN + FP
(18)
TP + TN × 100%, TP + TN + FP + FN
(19)
accuracy =
where TP is the number of correctly detected heartbeats, FN is the number of undetected heartbeats, TN is the number of correctly undetected heartbeats, and FP is the number of falsely detected heartbeats. 340
4.3.2. Experimental Results The sensitivity, specificity and accuracy of our scheme, the benchmarking algorithm DCRS, and another benchmarking algorithm DCOS that detects QRS by Pan-Tompkins and employs a DBM based classifier on original ECG signals without signal compression, at varying CRs (CR = 10%, 20%, 30%, 40%, 50%,
345
60%, 70%, 80% and 90%) on two database are listed in Table 1. The second column through the sixth column describe the technique used by the corresponding method. As expected, the benchmarking method DCOS can acheive a very high sensitivity of 100% and a relative low specificity of 96.25%, .which are superior to the other two methods.
350
In addition, the accuracy achieved by these approaches under different CRs is shown in Fig. 8. As illustrated in Table 1 and Fig. 8, the larger the value of CR, the higher are the accuracy, in other words, the better could be the classification performance. For instance, when CR=30%, the sensitivity, specificity and accuracy obtained by our developed method are 88.17%, 98.51%, and 92.50% for
20
100 90
Accuracy (%)
80 70 60 50 40 30 10
Our Method DCRS
20
30
40
50
60
70
80
90
Compression Ratio (%)
Figure 8: The accuracy of the proposed algorithm and the benchmarking algorithm DCRS under varying CRs.
355
MIT-BIH database, respectively, and are 80.39%, 98.28%, and 86.88% for our database, respectively. These metrics obtained by the benchmarking method DCRS are 98.72%, 92.68%, and 95.63% for MIT-BIH database, respectively, and are 88.89%, 92.40%, and 90.44% for our database, respectively. In the case of CR=80%, the sensitivity, specificity and accuracy obtained by our developed
360
method are 51.43%, 47.78%, and 49.38% for MIT-BIH database, respectively, and are 51.68%, 45.45%, and 51.25% for our database, respectively. These metrics obtained by DCRS are 82.61%, 71.43%, and 76.25% for MIT-BIH database, respectively, and are 61.65%, 96.30%, and 67.50% for our database, respectively. As expected, the performance of the proposed algorithm performed on
365
compressive ECG signals is reduced relative to the algorithm DCRS performed on recovered ECG signals on both databases. The reason is that the former implements QRS detection followed by classification directly in the compressive domain skipping the reconstruction stage. Nevertheless, it is easy to find that the accuracy of the proposed scheme is gradually very close to that of the bench-
370
marking scheme DCRS performed in the original domain as the CR decreases. We can conclude that the proposed method achieves an accuracy of 90.00% and 21
500 Our Method DCRS
450
CPU Time (second)
400 350 300 250 200 150 100 50 0 10
20
30
40
50
60
70
80
90
Compression Ratio (%)
Figure 9: The CPU runtime of the proposed method and the benchmarking method DCRS under varying CRs.
81.88% on MIT-BIH database and our database respectively when CR is 40%, compared to an accuracy of 94.38% and 89.38% for DCRS. In other words, the performance of our scheme is slightly degraded, but the energy consumption is 375
reduced, and therefore suitable for wearable devices. In order to display the advantages of our developed scheme against the benchmarking method DCRS, the CPU runtime taken by each approach to process about 25min long ECG signal under different CRs is shown in Fig. 9. Obviously, the CPU runtime consumed by our algorithm is much less than the
380
runtime of DCRS. To be specific, our approach takes 1.68s when CR=20%, and 1.67s when CR=80%. Nevertheless, for DCRS, the CPU runtime increases to 396s and 187s when CR=20% and CR=80%, respectively. As demonstrated in the two examples, our developed algorithm outperforms the benchmarking algorithm DCRS in terms of CPU runtime. This is because the CPU runtime
385
for our method is only the time taken by template based QRS detection on compressive ECG signal, while that for DCRS is the total time required to recovery ECG signal by BSBL and detect QRS waveform by Pan-Tompkins.
22
Table 1: Three measurments of the proposed algorithm, the benchmarking algorithms DCRS and DCOS under varying CRs for two database
Database
Metric
Sensitivity (%)
Method
Signal
Specificity (%)
40%
50%
60%
70%
80%
90%
-
-
-
-
-
-
-
-
-
DBM
100%
DCRS
Recovered ECG
BSBL
Pan-Tompkins
DBM
-
96.47% 100% 98.72% 94.05% 89.13% 86.32% 79.38% 82.61% 58.75% 98.73% 90.11% 88.17% 86.02% 81.00% 69.49% 61.19% 51.43% 23.81%
-
Template based
DBM
-
DCOS
Original ECG
-
Pan-Tompkins
DBM
96.25%
DCRS
Recovered ECG
BSBL
Pan-Tompkins
DBM
-
98.67% 93.90% 92.68% 94.74% 98.53% 98.46% 90.48% 71.43% 55.00% 93.83% 98.55% 98.51% 95.52% 96.67% 97.62% 96.15% 47.78% 38.14%
-
-
-
-
-
-
-
-
-
23
-
Template based
DBM
-
DCOS
Original ECG
-
Pan-Tompkins
DBM
98.13%
DCRS
Recovered ECG
BSBL
Pan-Tompkins
DBM
-
97.50% 96.88% 95.63% 94.38% 93.13% 91.25% 83.75% 76.25% 56.88% 96.25% 93.75% 92.50% 90.00% 86.88% 76.88% 66.87% 49.38% 34.37%
-
-
-
-
-
-
-
-
-
-
Template based
DBM
-
DCOS
Original ECG
-
Pan-Tompkins
DBM
96.85%
DCRS
Recovered ECG
BSBL
Pan-Tompkins
DBM
-
90.88% 89.20% 88.89% 84.38% 84.62% 88.46% 69.89% 61.65% 51.43% 87.50% 95.92% 80.39% 75.47% 72.38% 58.57% 69.57% 51.68% 13.89%
-
-
-
-
-
-
-
-
-
-
Template based
DBM
-
DCOS
Original ECG
-
Pan-Tompkins
DBM
92.11%
DCRS
Recovered ECG
BSBL
Pan-Tompkins
DBM
-
95.95% 95.85% 92.40% 96.88% 91.30% 82.93% 93.13% 96.30% 45.00% 97.82% 97.32% 98.28% 94.44% 87.27% 95.00% 55.26% 45.45% 37.10%
Our Method Compressive ECG
Accuaracy (%)
30%
Pan-Tompkins
Our Method Compressive ECG
Our Database Specificity (%)
20%
-
Our Method Compressive ECG
Sensitivity (%)
10%
Original ECG
Our Method Compressive ECG
Accuaracy (%)
0% DCOS
Our Method Compressive ECG
MIT-BIH
Compression Ratio
Reconstruction QRS Detection Classifier
-
-
-
-
-
-
-
-
-
-
Template based
DBM
-
DCOS
Original ECG
-
Pan-Tompkins
DBM
94.51%
DCRS
Recovered ECG
BSBL
Pan-Tompkins
DBM
-
93.10% 92.04% 90.44% 89.38% 87.50% 85.63% 71.25% 67.50% 50.63%
-
Template based
DBM
-
91.68% 90.44% 86.88% 81.88% 77.50% 63.13% 59.38% 51.25% 31.88%
Our Method Compressive ECG
-
-
-
-
-
-
-
-
-
5. Conclusion In this paper, we aimed to reduce the energy consumption of wearable de390
vices as much as possible under the premise of ensuring classification performance. We proposed an ECG heartbeat classification approach that detects the QRS waveforms directly in compressive domain, followed by classifying the ECG signals into normal and abnormal categories based on DBM. Two sets of simulation experiments were implemented on MIT-BIH database and our
395
database to verify the proposed scheme. Simulation results have demonstrated that the proposed method can reduce the energy consumption of wearable devices with an accuracy of 90.00% and 81.88% on MIT-BIH database and our database respectively when CR is 40%, compared to an accuracy of 94.38% and 89.38% for the benchmarking method. In addition, the results further show the
400
efficacy of our algorithm in improving CPU runtime. Acknowledgments This research was partially funded by National Natural Science Foundation of China (Grant No.61861021, and No.61863027). References
405
References [1] Hu, S., Shao, Z., and Tan, J.. “A real-time cardiac arrhythmia classification system with wearable electrocardiogram.” 2011 International Conference on Body Sensor Networks. IEEE, 2011. [2] Zhao, Q., et al. “Schedulability analysis and stack size minimization with
410
preemption thresholds and mixed-criticality scheduling.” Journal of Systems Architecture 83 (2018): 57-74. [3] Hua, J., et al. “Compressive sensing of multichannel electrocardiogram signals in wireless telehealth system.” Journal of Circuits Systems & Computers 25.09(2016). 24
415
[4] Wang, X., et al. “An energy-efficient system on a programmable chip platform for cloud applications.” Journal of Systems Architecture 76 (2017): 117-132. [5] Zhou, J., et al. “Thermal-aware correlated two-level scheduling of real-time tasks with reduced processor energy on heterogeneous MPSoCs.” Journal
420
of Systems Architecture 82 (2018): 1-11. [6] Hua, J., et al. “Direct arrhythmia classification from compressive ECG signals in wearable health monitoring system.” Journal of Circuits, Systems and Computers 27.06 (2018): 1850088. [7] Shiyovich, A., et al. “Accuracy of diagnosing atrial flutter and atrial fibril-
425
lation from a surface electrocardiogram by hospital physicians: analysis of data from internal medicine departments.” American Journal of the Medical Sciences 340.4(2010):271. [8] Azariadi, D., et al. “ECG signal analysis and arrhythmia detection on IoT wearable medical devices.” 2016 5th International conference on modern
430
circuits and systems technologies (MOCAST). IEEE, 2016. [9] Kiranyaz, S., et al. “Convolutional neural networks for patient-specific ECG classification.” 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC). IEEE, 2015. [10] Xia, Y., et al. “An automatic cardiac arrhythmia classification system with
435
wearable electrocardiogram.” IEEE Access 6 (2018): 16529-16538. [11] Liang, W., et al. “A novel approach to ECG classification based upon twolayered HMMs in body sensor networks.” Sensors 14.4 (2014): 5994-6011. [12] Saadatnejad, S., Mohammadhosein O., and Matin H.. “LSTM-Based ECG Classification for Continuous Monitoring on Personal Wearable Devices.”
440
IEEE journal of biomedical and health informatics (2019).
25
[13] Zhou, J., et al. ”Improving availability of multicore real-time systems suffering both permanent and transient faults.” IEEE Transactions on Computers (2019). [14] Zhou, J., et al. ”Resource management for improving soft-error and lifetime 445
reliability of real-time MPSoCs.” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems (2018). [15] Wang, X., et al. ”A tensor-based big-data-driven routing recommendation approach for heterogeneous networks.” IEEE Network 33.1 (2019): 64-69. [16] Wang, X., et al. ”NQA: A nested anti-collision algorithm for RFID sys-
450
tems.” ACM Transactions on Embedded Computing Systems (TECS) 18.4 (2019): 32. [17] Qaisar, S., et al. “Compressive sensing: From theory to applications, a survey. Journal of Communications and networks 15.5 (2013): 443-456. [18] Huang, F., et al. “Parallel compressive sampling matching pursuit algo-
455
rithm for compressed sensing signal reconstruction with OpenCL.” Journal of Systems Architecture 72 (2017): 51-60. [19] Qiu, K. , et al. “Efficient Energy Management by Exploiting Retention State for Self-powered Nonvolatile Processors.” Journal of Systems Architecture (2018).
460
[20] Zhang, Y., C. Wang, and J. Liu. “Energy aware fixed priority scheduling for real time sporadic task with task synchronization.” Journal of Systems Architecture 83(2018):12-22. [21] Braun, H., Pavan T., and Andreas S.. “Direct tracking from compressive imagers: A proof of concept.” 2014 IEEE International Conference
465
on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2014. [22] Braun, H., et al. “Direct classification from compressively sensed images via deep Boltzmann machine.” 2016 50th Asilomar Conference on Signals, Systems and Computers. IEEE, 2016. 26
[23] Da P G., Rozell C J., Bernardini R., et al. “Matched filtering for heart 470
rate estimation on compressive sensing ECG measurements.” IEEE Transactions on Biomedical Engineering 65.6 (2017): 1349-1358. [24] Davenport, M A., et al. “The smashed filter for compressive classification and target recognition.” Computational Imaging. International Society for Optics and Photonics, 2007.
475
[25] Davenport, M A., et al. “Signal Processing With Compressive Measurements.” J. Sel. Topics Signal Processing 4.2 (2010): 445-460. [26] Hinton, G E.. “Training products of experts by minimizing contrastive divergence.” Neural computation 14.8 (2002): 1771-1800. [27] PhysioNet,
480
MIT-BIH
Arrhythmia
Database
(2017),
http://www.physionet.org/. [28] Chen, C., and Chuang C.. “A QRS detection and R point recognition method for wearable single-lead ECG devices.” Sensors 17.9 (2017): 1969. [29] Sannino, G., and Giuseppe D P.. “A deep learning approach for ECGbased heartbeat classification for arrhythmia detection.” Future Generation
485
Computer Systems 86 (2018): 446-455.
Conflict Of Interest We confirm that there are no known conflicts of interest associated with this article and there has been no significant financial support for this work that could have influenced its outcome.
27
490
Jing Hua received the Ph.D. degree in Mechanical Engineering from Nanchang University, Nanchang, China, in 2018. She is currently an Assistant Professor with the School of Software, Jiangxi Agricultural University, Nanchang, China. Her research interests include embedded systems, machine learning, and biomedical signal processing.
Yilu Xu received the M.S. degree in information and comp uting science from Nanchang University, Nanchang, China. She is currently pursuing the Ph.D. degree with Nanchang University. She is an Assistant Professor from Jiangxi Agricultural university. Her research interests include machine learning, pattern recognition, biomedical signal processing.
Jianjun Tang received the M.S degree in crop cultivation an d farming from Jiangxi Agricultural University, Nanchang, China in 2005, and the Ph.D. degree in material processing engineering from Nanchang University in 2011. He is currently an Associate Professor with the College of Computer a nd Information Engineering, Jiangxi Agricultural University , Nanchang, China. His research interests include machine learning and intelligent information system.
Jizhong Liu received the B.S. and M.S. degrees in Technical Science from Shandong University, Jinan, China, in 1996 and 1999, respectively, and the Ph. D. degree in Mechanical Engineering from Zhejiang University in 2005. He is currently a Professor with the School of Mechatronic Engineering, Nanchang University, Nanchang China. His research interests include nursing robot, health monitoring and intelligent mechatronic system.
Jihao Zhang, Undergraduate student major in German and minor in Computer Science from Huazhong University of Science and Technology, Wuhan. He is currently also a helper in Advanced Data Engineering and Real-time Computing Laboratory. He was awarded by National Inspirational Scholarship. His research interests include machine learning, natural language processing and computer aided translation.