Professional Documents
Culture Documents
See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
IET Signal Processing
Research Article
MFO-based DFOD
Revised 13th June 2018
Accepted on 16th July 2018
E-First on 4th October 2018
doi: 10.1049/iet-spr.2018.5230
www.ietdl.org
Abstract: This study proposes a heuristic approach for designing highly efficient, infinite impulse response (IIR) type Digital
First-Order Differentiator (DFOD) by employing a nature-inspired evolutionary algorithm called Moth-Flame Optimisation (MFO)
for the detection of the QRS complexes in the electrocardiogram (ECG) signal. The designed DFOD is used in the pre-
processing stage of the proposed QRS complex detector, to generate feature signals corresponding to each R-peak by
efficiently differentiating the ECG signal. The generated feature signal is employed to detect the precise instants of the R-peaks
by using a Hilbert transform-based R-peak detection logic. The performance efficiency of the proposed QRS complex detector is
evaluated by using all the first channel records of the MIT/BIH arrhythmia database (MBDB), regarding the standard
performance evaluation metrics. The proposed approach has resulted in Sensitivity (Se) of 99.93%, Positive Predictivity (PP) of
99.92%, Detection Error Rate (DER) of 0.15%, and QRS Detection Rate (QDR) of 99.92%. Performance comparison with the
recent works justifies the superiority of the proposed approach.
(a) This paper justifies the applicability of the MFO algorithm, for The performance of the proposed DFOD is demonstrated by using
the design of the wideband, stable, and accurate IIR type digital the maximum absolute magnitude error (MAME) metric as given
first-order differentiator. The magnitude response of the proposed by (5) [35].
differentiator almost replicates to that of the ideal integer order
differentiator counterpart, and affirms the superiority of the MFO- MAMEDFOD = max ( | | Dideal(ω) | − | HDFOD(ω) | | ) (5)
based DFOD design problem.
(b) The proposed DFOD, an integral part of the pre-processing Small group delay value is essential for the practical signal
stage, is used to generate the feature signal corresponding to each processing applications. The group delay of the DFOD is given by
R-peak by efficiently differentiating the ECG signal. The generated (6).
feature signal is employed to detect the exact instants of the R-
peaks by using a Hilbert transform (HT)-based R-peak finding dθDFOD(ω)
τDFOD(ω) = − (6)
logic. dω
(c) The performance of the proposed R-peak detector is evaluated
against all the first channel records of the MBDB by using the where θDFOD(ω) = ∠HDFOD(ω) is the phase response of the
standard R-peak detection statistical metrics such as Detection HDFOD(ω).
Error Rate (DER), QRS Detection Rate (QDR), Positive The phase response of the proposed DFOD is demonstrated by
Predictivity (PP), and Sensitivity (Se). evaluating the average group delay, given by (7).
(d) The superiority of the proposed R-peak detector over all the
recently published R-peak detection techniques is also justified in
π
1
terms of all the above mentioned standard R-peak detection
τDFOD =
π ∫
0
τDFOD(ω)d(ω) (7)
metrics.
2.2 Moth-flame optimisation algorithm
The rest part of the proposed research work is organised as
follows: after the introduction, Section 2 describes the proposed The design of digital differentiator is a very old research area. An
MFO-based DFOD, an integral part of the pre-processor. Section 3 IIR-type digital differentiator was designed by using Simpson's
presents the HT-based R-peak detection technique. Section 4 shows rule for integration [36]. However, in the recent trend, highly
the simulation results and discussions. Section 5 concludes the efficient digital integrators and differentiators are developed by
proposed work. using evolutionary optimisation techniques [37–40]. Since lower
order integrators and differentiators are suitable for the real-time
2 Proposed DFOD applications [40], in this paper, an IIR type, first-order digital
differentiator is designed by using MFO algorithm, for the
The proposed DFOD is analogous to the ideal integer order detection of the QRS complexes in the ECG signal.
differentiator (IOD) in the discrete time domain. MFO algorithm is inspired by the natural navigation mechanism
of moths (search agents), called transverse orientation [41]. During
2.1 Problem formulation the night time, the moth traverses a very long distance in the
straight line path, by maintaining a fixed angle with respect to the
The frequency response of the ideal integer order differentiator is moon. However, when the moth navigates for artificial light
given by (1). (flame) by retaining the same transverse orientation, due to the
short distance between moth and light source, moths traverse in a
Dideal( jω) = jω (1) shrinking spiral path towards the artificial light. This spiral
movement of moth concerning the artificial lights is modelled to
where ω ∈ [0, 1] is the normalised frequency and j = −1. perform optimisation.
The Transfer Function (TF) of an N th order IIR-type DFOD is The initial positions of the moths are distributed randomly in
given by (2). the search space and the random position of the ith moth in the jth
dimension is stored in a (n × d) matrix called M. Here, n represents
N
∑i = 0 aiZ − i the total number of moths and d represents the total number of
HDFOD(Z) = N (2) design variables.
∑i = 0 biZ − i
The cost function of each moth is evaluated, and its
corresponding fitness values are stored in a (n × 1) matrix called
IET Signal Process., 2018, Vol. 12 Iss. 9, pp. 1172-1184 1173
© The Institution of Engineering and Technology 2018
17519683, 2018, 9, Downloaded from https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/iet-spr.2018.5230 by National Medical Library The Director, Wiley Online Library on [15/11/2022]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
Fig. 1 (a) Block diagram of the proposed DFOD. (b) The proposed R-peak detection algorithm
OM. Best-so-far positions of the moths called flames are stored in Step 4: If iteration_no = 1, then go to Step 5, otherwise, go to Step
a (n × d) matrix called F. The fitness values of the flames are stored 6.
in a (n × 1) matrix called OF. Step 5: Evaluate F = sort(M) and OF = sort(OM).
The next position of the moths is evaluated by using (8). Step 6:Evaluate F = sort(Mt − 1, Mt)
and OF = sort(Mt − 1, Mt).
M(i, j) = S(Mi, F j) = Di ⋅ ebt ⋅ cos(2πt) + F j (8)
Step 7: For each moth (mi) repeat Step 8 to Step 10.
where S is the spiral function; Di = | F j − Mi| is the separation Step 8: For each dimension (d j) of the design variable repeat Step 9
to Step 10.
distance between the ith moth (Mi) and the jth flame (F j); b is a
Step 9: Update r and t.
constant denoting the shape of the logarithmic spiral; and t is the
random number t ∈ [r, + 1]. Here, the value of r (adaptive Step 10: Find Di = | F j − Mi|, and update M(i, j) by using (8).
convergence constant) is varied from −1 to −2 over the number of Step 11: Until the stopping criteria are not satisfied repeat Step 2 to
iterations and ensures faster convergence and intensification of the Step 10.
MFO algorithm. Step 12: Return the position of the best moth, consisting of the
In order to avoid the local optima and to diversify the problem optimal sets of Num. Coeff. (ai) and Denum. Coeff. (bi) of the
search space, after each iteration, the flames are sorted according to proposed designed DFOD.
their fitness values. The sorted flames are assigned to their
respective moths, i.e. the first moth modifies its position with 3 Proposed R-peak detection scheme
respect to the best flame, and the last most adjusts its position with
respect to the worst flame. The proposed DFOD-based R-peak detection scheme is shown in
To ensure a proper balance between the exploration and the Fig. 1b. It consists of ECG pre-processor design and R-wave
exploitation phases, the number of flames is varied adaptively over detector design, as discussed in the following sub-sections.
the number of iterations as given by (9).
3.1 ECG pre-processor design (stage-1)
P−1
flame_no = round (P − l) × (9) The proposed ECG pre-processor design scheme consists of a
T
bandpass filter (BPF), an optimally designed DFOD, an amplitude
where l represents the current iteration number, T represents the normaliser (AN), and a smooth waveform generator as discussed in
maximum iteration number, and P represents the maximum the following sub-sections.
number of flames.
Steps of MFO algorithm for evaluating the optimal set of 3.1.1 Enhancement of QRS complex by noise reduction and
coefficients are described below. differentiation: Practical ECG signal is corrupted by several types
of noise and artefacts as shown in Fig. 2a. The presence of this
Step 1: Randomise the initial position of the moths (search agents) noise and artefacts hinders the R-peak detection process and
in the problem search space. For the N th order DFOD design decreases the R-peak detection accuracy. Therefore, to combat
problem, each candidate solution consists of equal number of Num. these noise and artefacts, the ECG signals are filtered by using a
Coeff. (ai) and Denum. Coeff. (bi) for i = 0, 1, 2, 3, …, N, with third order Chebyshev type-1 bandpass filter (5–22 Hz), so that
these unwanted components are automatically discarded from the
dimension D = 2 × (N + 1). Initialise n = 50 and b = 1. raw ECG signal. To accentuate the QRS complex, the filtered ECG
Step 2: Update the flame_no by using (9). signal is differentiated by the proposed DFOD. The differentiated
Step 3: Calculate OM = JDFOD(M) by using (4). ECG signal is shown in Fig. 2b. The DFOD stage generates feature
signal (slope information) corresponding to each R-peak in the by considering the amplitude of the few previously detected R-
ECG signal. From Fig. 2b it can be observed that the out-of-band peaks. If an R-peak is not detected for a specific duration, search
noise and artefacts are diminished, and suitable feature signals back mechanism is implemented by reducing the present threshold
corresponding to each R-peak are obtained. This feature signal is value. If more than one R-peak is detected within a particular
used as a reference point (marker or feature signal) for the period, based upon their current amplitudes, any of the R-peak is
detection of the R-peaks in the subsequent signal processing stages. accepted.
The differentiated ECG signal (d[n]) is normalised by using (10). There are a wide variety of thresholding techniques [28]. These
thresholding techniques work well for regular heartbeats [28].
d[n] However, the difficulty arises for the irregular beats.
a[n] = (10) The R-peak detection accuracy of the threshold-based R-peak
max ( | d[n] | )
detection logic is dependent on the initial threshold value. To avoid
the complexity associated with thresholding-based R-peak
3.1.2 Smooth waveform generator: The differentiated output is detection logic an HT-based simple R-peak finding logic [7, 28] is
further enhanced by calculating the Shannon energy and the implemented in this paper and is explained in the following sub-
moving sum of the differentiated signal. The Shannon energy is section.
calculated by using (11) [7, 28] to amplify the differentiated ECG
signal nonlinearly, which further assists to accentuate the QRS 3.2.1 Simple peak finding logic based on Hilbert transform
complex compared to other components. Further, to obtain the and zero crossing detection: Let g(t) is a real-time signal, and
smooth waveform moving window integration is implemented. h(t) = (1/πt) is the impulse response of the HT. Then the HT of
g(t) is denoted by g^ (t).
s(n) = − ((a[n])2 ⋅ log(a[n])2) (11)
∞
1 1
For moving window integration, the number of sample points L is g^ (t) = HT[g(t)] = g(t) ∗
πt
=
π ∫−∞
g(τ)
t−τ
dτ (12)
chosen in such a way that it corresponds to the maximum duration
of the QRS complex. For the ECG signal with 360 Hz sampling By using the convolution property of the Fourier transform one can
frequency the length, L = 55 is considered to maintain a proper get
balance between the design complexity and the detection accuracy
[28]. The output of the smooth waveform generator is shown in F g^ (t) = F g(t) × F h(t) (13)
Fig. 2c.
^
G( f ) = G( f )H( f ) (14)
3.2 R-peak detector design (stage-2)
From Figs. 2a and c it can be observed that the maximum positions ^
G( f ) = F g(t) × F
1
= − jsgn( f )G( f ) (15)
of the smoothed waveform (Fig. 2c) are uniquely related to the R- πt
peaks in the raw ECG signal (Fig. 2a). Hence, the R-peaks of the
ECG signal can be detected by determining the maximum positions where
of the corresponding smooth waveforms. The maximum positions
of the smooth waveform can be obtained either by using an +1 f >0
amplitude threshold-based peak finding logic or by using a sgn( f ) = 0 f =0
threshold independent peak finding logic. In case of the threshold-
−1 f <0
based logic, the smoothed waveform is continuously compared
with a fixed or adaptive threshold. One R-peak is declared each
time the smoothed waveform crosses the threshold. The amplitude Hence, the HT of the real-time signal g(t) can be evaluated
of the ECG signal is patient specific and varies with respect to the by using (16).
external conditions [10]. Hence, the adaptive threshold is more
preferred than a fixed threshold. ^ ^ jG( f ) if f < 0
g^ (t)(t) = IFT G( f ) where G( f ) = (16)
In case of adaptive thresholding logic, initially, a default − jG( f ) if f > 0
threshold value is assigned. The next threshold value is calculated
Table 3 Average performance of the proposed MFO-based DFOD with respect to MAME metric
Error metrics Best Worst Mean SD
MAME, dB −13.12 −2.87 −12.27 1.63
best, worst, average, and standard deviation values are estimated adaptive convergence constant (r), and size of population (n) on the
by running the algorithm for 50 independent times, and the outputs final solution quality of the designed DFOD, in terms of the
are shown in Table 4. MAME metric are examined in the following sub-sections. The
algorithm is run for 50 independent times for each case to calculate
4.1.4 Execution time analysis of the MFO-based DFOD the best, worst, mean, and standard deviation (SD) values of the
design: The computational time also decides the efficiency of the MAME metric. While varying a particular control parameter value,
algorithm. Hence, in order to know the execution time required for the other control parameter values are kept constant, as per Table 1.
400 function evaluations by the MFO algorithm for the
implementation of the DFOD, the MFO algorithm is run for 50 4.2.1 MFO sensitivity analysis due to the change in the
independent times, to calculate the statistical parameters namely logarithmic spiral shape constant (b): The logarithmic spiral
SD, worst, mean, and best values, and the corresponding results are shape constant, b controls the convergence speed and the direction
shown in Table 4. The mean time taken for the evaluation by the of the spiral movement. For a very low value of b, the spiral
algorithm is only 45.485 s, for the DFOD type design problem. becomes a circle, and for a very large value of b the spiral tends
towards a straight half-line. The effect of the MFO algorithm on
4.1.5 Stability analysis of the proposed MFO-based the resulted solution quality for different values of b is examined,
DFOD: The pole-zero plot of the designed MFO-based DFOD is and the results are presented in Table 5. It can be observed that the
depicted in Fig. 4b. It can be observed that both the pole and zero better MAME (dB) metric value is obtained corresponding to b = 1,
reside within the unit circle, which guarantees the system to be a due to a proper balance between the diversification and the
stable and minimum phase. intensification phases.
4.2 Sensitivity analysis 4.2.2 MFO sensitivity analysis by changing the value of
adaptive convergence constant (r): r is used to accelerate the
The impact of MFO algorithm due to the change in initial control convergence speed of the moths towards the flames. Also, it is used
parameter values like logarithmic spiral shape constant (b), to enhance the intensification phase of the MFO algorithm. Table 6
Table 4 Statistical analysis of the convergence speed for the MFO algorithm employed for DFOD design
Number of iterations required for convergence to the optimal solution Computational time (s) for 400 iterations
best worst average SD best worst average SD
112 163 130 2.548 45.269 45.742 45.485 0.249
presents the performance of the MFO algorithm in terms of number of search agents are considered as the most suitable for the
MAME metric for different ranges of r. It can be observed that MFO-based DFOD type design problem.
when the range of r varies from −1 to −2, over the number of
iterations, better solution quality is obtained due to the better 4.3 QRS detection
intensification of the search space.
An R-peak detection example illustrating the operation of the
4.2.3 MFO sensitivity analysis due to the change in proposed DFOD-based R-peak detection technique is depicted in
population size (n): The optimal sets of Num. Coeff. and Denum. Figs. 5–10. In each figure, the subplot (a) portrays the raw ECG
Coeff. and the corresponding MAME error metrics resulted from signal. The output of the proposed DFOD is portrayed in subplot
the design of the MFO-based DFOD with n of 25, 50, and 100 (b). It can be observed that at this stage a suitable feature signal is
numbers of moths are presented in Table 7. It can be observed that generated corresponding to each R-peak in the differentiated ECG
by considering a lesser number of moths (n = 25), poor solution signal. Also, it can be observed that across the output of the DFOD,
quality is obtained. Also, by considering a large number of moths the effects of the P/T-waves and the baseline shift are eliminated.
(n = 100), minute improvement in the solution quality is achieved The true instants of the R-peaks are detected by using this suitable
with higher design time overhead. Hence, by considering a suitable feature signal in subsequent signal processing stages. The subplot
trade-off between the design time and the solution quality, 50 (c) represents the output of the smooth waveform (portrayed in
blue), the HT output (portrayed in green), and the zero crossing
Table 8 Performance of the proposed DFOD-based R-peak detector over the MBDB
Record Total beats TP beats FP beats FN beats Se, % PP, % DER, % QDR, %
100 2273 2273 0 0 100 100 0 100
101 1865 1864 2 1 99.95 99.89 0.1609 99.89
102 2187 2187 0 0 100 100 0 100
103 2084 2084 0 0 100 100 0 100
104 2229 2226 13 3 99.87 99.42 0.7178 99.42
105 2572 2566 19 6 99.77 99.26 0.9720 99.26
106 2027 2026 2 1 99.95 99.90 0.1480 99.90
107 2137 2137 0 0 100 100 0 100
108 1763 1763 4 0 100 99.77 0.2269 99.77
109 2532 2532 0 0 100 100 0 100
111 2124 2124 0 0 100 100 0 100
112 2539 2538 0 1 99.96 100 0.0394 99.96
113 1795 1795 0 0 100 100 0 100
114 1879 1879 1 0 100 99.95 0.0532 99.95
115 1953 1953 0 0 100 100 0 100
116 2412 2400 5 12 99.50 99.79 0.7048 99.50
117 1535 1535 0 0 100 100 0 100
118 2278 2278 2 0 100 99.91 0.0878 99.91
119 1987 1987 1 0 100 99.95 0.0503 99.95
121 1863 1863 1 0 100 99.95 0.0537 99.95
122 2476 2476 0 0 100 100 0 100
123 1518 1518 0 0 100 100 0 100
124 1619 1619 0 0 100 100 0 100
200 2601 2597 1 4 99.85 99.96 0.1922 99.85
201 1963 1963 0 0 100 100 0 100
202 2136 2134 0 2 99.91 100 0.0936 99.91
203 2980 2966 4 14 99.53 99.87 0.6040 99.53
205 2656 2655 0 1 99.96 100 0.0377 99.96
207 1860 1854 2 6 99.68 99.89 0.4301 99.68
208 2955 2952 0 3 99.90 100 0.1015 99.90
209 3005 3005 1 0 100 99.97 0.0333 99.97
210 2650 2641 0 9 99.66 100 0.3396 99.66
212 2748 2748 1 0 100 99.96 0.0364 99.96
213 3251 3251 0 0 100 100 0 100
214 2262 2262 0 0 100 100 0 100
215 3363 3363 0 0 100 100 0 100
217 2208 2207 0 1 99.95 100 0.0453 99.95
219 2154 2154 0 0 100 100 0 100
220 2048 2048 0 0 100 100 0 100
221 2427 2427 0 0 100 100 0 100
222 2483 2483 1 0 100 99.96 0.0403 99.96
223 2605 2605 0 0 100 100 0 100
228 2053 2043 16 10 99.51 99.22 1.2664 99.22
230 2256 2256 0 0 100 100 0 100
231 1571 1571 0 0 100 100 0 100
232 1780 1776 8 4 99.78 99.55 0.6742 99.55
233 3079 3077 0 2 99.94 100 0.0650 99.94
234 2753 2753 1 0 100 99.96 0.0363 99.96
overall 109,494 109,414 85 80 99.93 99.92 0.1507 99.92
Fig. 12 R-peak detection using the MBDB (in each figure the detected R-peak is portrayed in black upward arrowhead and the annotation is portrayed in red
vertical lines)
(a) Record-208: detection of premature ventricular contraction (PVC) beats, (b) Record-117: detection of R-peak in the presence of high amplitude T-waves, (c)Record-217:
detection of R-peaks of a very critical ECG morphology, (d) Record-200: detection of irregular heartbeat
algorithms for processing each sample is shown in Table 10. As proposed QRS detection algorithm is run on a slower processor
illustrated in Table 10 the average execution time required for than that used in [28].
performing the proposed method on each 30 min ECG record in the Altogether the performance comparison between the proposed
MBDB is about 2.41 s, which corresponds to around 3.7 µs for and the reported R-peak detection techniques is demonstrated in
each sample. The execution time required by the proposed terms of three statistical parameters called Se (%), PP(%), and
approach is the least compared to all the reported methods except DER (%), as portrayed in Fig. 13b. It can be observed that the
the algorithm reported in [28]. It is noteworthy to mention that the proposed DFOD-based R-peak detection technique achieves the
best values of Se, PP, and DER. Though the Se (%) value of the
Table 10 Comparison of performance between the proposed and the recently published R-peak detectors
Publication Total TP FP FN Se, % PP, % DER, % QDR, % Execution time, µs/sample
Min et al. [5] Δ 109,496 109,383 102 113 99.90 99.91 0.19 99.90 N/R
Leong et al. [6] 109,134 N/R 330 753 99.31 99.70 0.99 99.31 N/R
Rakshit et al. [7] N/R 109410 99 84 99.93 99.91 0.16 99.91 N/R
Bouaziz et al. [8] 109,494 109,354 232 140 99.87 99.79 0.33 99.79 N/R
Deepu et al. [10] 109,508 N/R 201 395 99.64 99.81 0.54 99.64 5.2*
Jain et al. [11] Δ 109,494 N/R 184 272 99.75 99.83 0.41 99.75 13
Phukpattaranont et al. [15] 109,483 109,281 210 202 99.82 99.81 0.37 99.81 N/R
Yazdani et al. [16] 109,494 N/R 108 137 99.87 99.90 0.22 99.87 N/R
Zhang et al. [17] 109,510 N/R 204 213 99.81 99.80 0.38 99.80 N/R
Arbateni et al. [18] 109,483 N/R 109 210 99.82 99.91 0.29 99.82 N/R
Nallathambi et al. [19] 109,494 N/R 495 462 99.58 99.55 0.87 99.55 N/R
Pandit et al. [23] 109,809 109,432 369 389 99.65 99.66 0.69 99.65 15.74
Sharma et al. [24] 109,494 109,381 136 113 99.90 99.88 0.22 99.88 4
Pan et al. [26] 116,137 115,860 507 277 99.76 99.56 0.67 99.56 13.56*
Manikandan et al. [28] 109,496 N/R 140 79 99.93 99.86 0.20 99.86 3.45
Sabherwal et al. [30] 109,498 109,368 98 93 99.90 99.90 0.17 99.90 N/R
Benmalek et al. [31] N/R 107,632 153 156 99.86 99.86 0.28 99.86 10
proposed method 109,494 109,414 85 80 99.93 99.92 0.15 99.92 3.7
N/R: Not reported; ‘Δ’: Best value is reported; *: Reported in [11].
Fig. 13 (a) Percentage improvement of the proposed QRS detector over the reported QRS detection techniques in terms of a total number of false beat
detection. (b) Performance comparison in terms of Se, PP, and DER
proposed method and the method reported in [7] are the same, it detection application has been proposed by employing a highly
should be noted that the proposed method achieves the lowest DER efficient optimisation algorithm, called Moth-flame optimisation
value and the highest values of PP. Also, the process reported in [7] (MFO). The performance of the proposed DFOD-based R-peak
used a refractory period of 200 ms whereas, the proposed approach detector is verified against the MIT/BIH arrhythmia database
does not consider any refractory period. Hence, the detection (MBDB) by using the standard statistical parameters like
accuracy can be further enhanced by finding a suitable refractory Sensitivity (Se), positive Predictivity (PP), detection error rate
period. (DER), and QRS detection rate (QDR), which yields Se (%) of
99.93%, PP(%) of 99.92%, DER (%) of 0.1507%, and QDR (%) of
5 Conclusion 99.92%. The supremacy of the proposed R-peak detector in
comparison with the other recently published techniques is
An optimally designed, highly accurate, and computationally confirmed from the calculated statistical parameters. Finally, this
efficient Digital First-order Differentiator (DFOD) for the R-peak paper ensures the MFO-based DFOD is an efficient pre-processing