3.2 R-Peak Detection from Single Lead ECG
3.2.3 Results and Discussion
3. PREPROCESSING ELECTROCARDIOGRAM SIGNAL
Algorithm 5 Area Calculation using MM operators Input: ECG signal S[n], FS: Frame size
Output: Area
nf rames ←lengthsignal/F S k←0
Area← ∅
for k ←0 to nf rames do
seg←signal[F S∗k :F S∗(k+ 1)]
h←max(seg)−min(seg) h←h/len(seg)
areak←dilation(seg, h)−erosion(seg, h) k←k+ 1
Area←Area∪areak end
than one marker is found out by our algorithm then it is assumed to be an extra beat.
3.2. R-PEAK DETECTION FROM SINGLE LEAD ECG
increase in frame size, the detection performance increased till frame size 120 and gradually deteriorated with increasing frame size with lower threshold. It can also be observed that with increasing frame size, an increase in threshold also provides better performance. Increasing the hard thresholding after five times of mean area signal degraded the model performance. The performance remains consistent when both thresholding and frame size are increased together. The maximum sensitivity and predictivity were not obtained at a particular threshold and frame size. Max- imum sensitivity was obtained using area mean as threshold and frame size of 10 timestamps. Maximum predictivity was obtained using mean area as threshold and frame size of 120 timestamps. Figure 3.13 depicts the Logarithmic Column Chart for change in detection error rate with varying frame size and thresholding using trian- gular structuring element. The minimum DER was achieved for mean thresholding and a frame size of 90 timestamps. Increasing thresholding with less frame size also enabled the algorithm to detect significant peaks thereby minimizing DER. The al- gorithm achieved a sensitivity of 95.78%, predictivity of 97.53%, and DER of 8.44%
using triangular structuring element with frame size of 90 timestamps and mean thresholding. In the figures, only those combinations of threshold and frame size are depicted where the algorithm was able to detect significant amount of peaks in the MIT-BIH records. Those combinations are excluded where the algorithm completely missed out on R-peaks.
Detection using Rectangular Structuring Element: The sensitivity and predictivity achieved with varying framesize and thresholding using rectangular struc- turing element for area calculation is provided using the radar plot in Figure 3.14.
The performance is quite similar, if not better than triangular structuring element.
Increase framesize increases sensitivity and predictivity till framesize 120 and grad- ually deteriorates later. Increasing framesize with threshold provides consistent per- formance. As explained earlier, maximum sensitivity and predictivity were obtained using different combinations. Maximum sensitivity was obtained using area mean as threshold and framesize of 10 timestamps. Maximum predictivity was obtained using twice the mean area as threshold and framesize of 20 timestamps. Figure 3.15 depicts the Logarithmic Column Chart for change in detection error rate with vary- ing framesize and thresholding using rectangular structuring element. The minimum DER was achieved for mean thresholding and a framesize of 90 timestamps. Increas- ing thresholding with less framesize also enabled the algorithm to detect significant peaks thereby minimizing DER. The algorithm achieved a sensitivity of 94.95%, pre- dictivity of 97.70%, and DER of 8.21% with framesize of 90 timestamps and mean
58 TH-2764_156201001
3. PREPROCESSING ELECTROCARDIOGRAM SIGNAL
Figure 3.12: Radar Plot of Sensitivity and Predictivity with varying threshold and frame size using Triangular Structuring Element.
thresholding. In the figures, only those combinations of threshold and framesize are depicted where the algorithm was able to detect significant amount of peaks in the MIT-BIH records.
Detailed MIT-BIH Evaluation using Rectangular Element: Area calcu- lation using rectangular element achieved better performance than triangular element.
Detailed results for MIT-BIH records are provided in Figure 3.16. The highest num- ber of beats detected in each record was obtained using mean of area as thresholding and framesize of 90 timestamps. Figure 3.16a depicts the change in predictivity, Fig- ure 3.16b depicts the change in sensitivity, and Figure 3.16c depicts the change in detection error rate using the mentioned parameters. It is evident from the figures TH-2764_156201001
3.2. R-PEAK DETECTION FROM SINGLE LEAD ECG
Figure 3.13: Logarithmic Column Chart of DER with varying threshold and frame- size for Triangular Structuring Element.
that the proposed algorithm was able to achieve higher sensitivity and predictivity for non-arrhythmic records (100-124) in comparison to arrhythmic records (200-234).
The predictivity is high in most of the records as compared to sensitivity, meaning that less extra beats are detected but more beats are missed by the algorithm. A sim- ilar pattern was observed in DER, less DER was observed in non-arrhythmic records as compared to arrhythmic records, meaning that higher number of actual and extra beats were detected and fewer beats were missed. The few key areas or patterns we discovered that caused the algorithm to under preform were broad duration and small amplitude QRS complexes. The reason behind low accuracy and high DER were re- versed QRS polarity and low-amplitude QRS complexes as the area amplitude was insufficient for detection. The false positives increased due to reversed QRS polarity and high amplitude P and T wave. To counteract this issue, we implemented a new function that checked for multiple peaks in a window and choose the later peak as the former peak occurred probably due to the P wave. This lead to reduced sensi- tivity but high predictivity as many beats were missed. This issue was tackled by reducing the framesize from 200 to 60 timestamps. FN occurred due to high magni- tude thresholding in the algorithm. Fixed hard thresholding was performed [84] for detecting final R-Peaks.
Comparison with Existing Methods: The proposed fractal based QRS de- tection approach is compared with state of the art methods in Table 3.1. Since the performance of the algorithms depend strongly on the selection of the ECGs for the evaluation purposes, PT method [85], KNN-PSO method [205] and the DOM [202]
are re-implemented for comparing the proposed approach. Often the previous ap- proaches exclude extremely noisy data before peak detection. The proposed approach achieves Sensitivity, Positive predictivity and detection error rate of 95.82%, 95.15%
60 TH-2764_156201001
3. PREPROCESSING ELECTROCARDIOGRAM SIGNAL
Figure 3.14: Radar Plot of Sensitivity and Predictivity with varying threshold and framesize using Rectangle Structuring Element.
and 10.16%. All judgements of correctness are based upon the annotations in the database.
Table 3.1: Comparison with Existing Methods.
Method Sensitivity (%) Predictivity (%) DER
PT [85] 96.08 97.89 9.43
KNN-PSO [205] 96.26 98.33 5.97
DOM [202] 96.81 97.95 5.78
Fractal Rect 99.03 99.41 8.21
Fractal Tri 95.78 94.99 10.43
TH-2764_156201001
3.2. R-PEAK DETECTION FROM SINGLE LEAD ECG
Figure 3.15: Logarithmic Column Chart of DER with varying threshold and frame- size for Rectangular Structuring Element.
(a) Predictivity for all records in MIT-BIH database.
(b) Sensitivity for all records in MIT-BIH database.
(c) Logarithmic Column chart of DER for all records in MIT-BIH database.
Figure 3.16: Results using Rectangular Structuring Element with mean threshold- ing and a framesize of 90 timestamps.
The proposed R-peak detection algorithm uses erosion and dilation operators 62
TH-2764_156201001
3. PREPROCESSING ELECTROCARDIOGRAM SIGNAL
for area calculation. The area obtained using either rectangle or triangle structuring elements is further resampled and thresholded to detect peaks. The method achieved a sensitivity of 95.82%, predictivity of 95.15%, and DER of 10.16%. The algorithm was tested against all the records available in the dataset. The detected beats are provided to a classifier that performs fine grained heartbeat classification.