The proposed method is based on the observation that arrhythmias episodes change the morphology of the ECG signal. A block diagram is shown in Fig. 1, and each of the processing blocks is described in the following.
2.1 Datasets
The ECG signals were obtained from the databases (DB): MIT-BIH Normal Sinus Rhythm (NSR) database contains 18 ECG recordings of approximately 24 h duration. Subjects included in this database had no significant arrhythmias; they include 5 men, aged 26 to 45, and 13 women, aged 20 to 50 [18]; MIT-BIH Arrhythmia database contains 48 half-hour excerpts of two-channel ambulatory ECG recordings, obtained from 47 subjects [19], and MIT-BIH AF contains 319 episodes of atrial fibrillation. The individual recordings have approximately a 10-h duration of 25 individuals [20].
Database records contain the rhythm types: atrial bigeminy, atrial fibrillation, atrial flutter, ventricular bigeminy, 2o heart block, idioventricular rhythm, normal sinus rhythm, nodal (A-V junctional) rhythm, paced rhythm, pre-excitation (WPW), sinus bradycardia, supraventricular tachyarrhythmia, ventricular trigeminy, ventricular flutter, and ventricular tachycardia.
2.1.1 Pre-processing
In the preprocessing step, the goal is to reduce contamination of different types of noise and artifacts in the ECG signal. Therefore, to perform this work, the following types of noise have been removed: a signal in the frequency of 60 Hz and its bandwidth below 1 Hz; baseline wander, a low-frequency (0.15 up to 0.3 Hz) noise that results from the patient inhaling and compels a baseline shifting of the ECG signals; electrode contact noise, noise that results from a deficiency in the contiguity between the electrode and skin, which adequately cuts off the measurement system from the subject; electrode motion artifacts, artifacts that result from variations in the electrode-skin impedance with electrode motion; muscle contractions, noise that results from the contraction of other muscles apart from the heart; electrosurgical noise, noise produced from other medical apparatus in the patient care circumstance at frequencies between 100 and 1 MHz; and instrumentation noise, noise produced by the electronic equipment utilized in the ECG measurements [21].
From the records of the MIT-BIH NSR, MIT-BIH Arrhythmia, and MIT-BIH AF bases, as described in Section 2, 50,000 healthy heartbeat and 50,000 heartbeat of people with AF were withdrawn. Less than 1%, at the beginning and at the end, of the ECG signals were excluded due to measurement error. The ECG signal was normalized, and the sampling frequency was set to 128 Hz with 12-bit resolution in a range of ±10 mV. Two or more cardiologists independently annotated each record; disagreements were resolved to obtain the computer-readable reference annotations for each beat (approximately 110,000 annotations in all) included with the database.
2.2 Data extraction of the heartbeat
The data extraction of the ECG signal proposed in this study is carried out by analyzing the voltage variation on each heartbeat and is given by [22]
$$ B=(b_{\text{start}}, b_{2}, \cdots, b_{\text{end}}), $$
(1)
where B is a heartbeat, bstart and bend are given by
$$ b_{\text{start}}=P_{R}-F_{s}\lambda, $$
(2)
and
$$ b_{\text{end}}=P_{R}+F_{s}\theta, $$
(3)
where PR is the position of the R peak (PR are found in annotation files in MIT-BIH database), Fs is the sampling frequency, and λ and θ are the proportion weights of the heartbeat, being λ+θ≤1. The parameters λ and θ are heuristically assigned and function as sliding windows on the heartbeat.
2.3 Method’s generalization
The method presented in the previous Section 2.2 specifically analyzes heartbeat. Nevertheless, an arbitrary analysis to any segment of the heartbeat is defined as
$$ X=(x_{\text{start}}, x_{2}, \cdots, x_{\text{end}}), $$
(4)
where X is any segment of a heartbeat. If the segment of interest in the heartbeat begins before the peak of the R wave, Eq. 2 must be used, but if the segment of interest starts after the peak of the R wave, Eq. 3 should be used. Both equations are heuristically adjusted. The end of an arbitrary segment in the ECG signal, from a specific part in a given heartbeat or even a succession of heartbeats, is given by
$$ x_{\text{end}}=\mathbf{t}_{a}F_{s}, $$
(5)
where ta is the arbitrary period in the heartbeat or the ECG signal.
Another point of interest within the ECG is the peak of the P, QRS, and T waves. Therefore, the peak of the waves is defined as
$$ P_{X}=\text{max}(X). $$
(6)
Finally, a heartbeat can be defined as
$$ {{}\begin{aligned} B = P \bigcup PQ \bigcup QRS \bigcup ST \bigcup T= \end{aligned}} $$
(7)
$$ {{}\begin{aligned} = (p_{\text{start}}, p_{2}, \cdots, P_{P}, \cdots, p_{\text{end}}) \bigcup ({pq}_{\text{start}}, {pq}_{2}, \cdots, {pq}_{\text{end}}) \end{aligned}} $$
(8)
$$ {{}\begin{aligned} \bigcup ({qrs}_{\text{start}}, {qrs}_{2}, \cdots, P_{\text{QRS}}, \cdots, {qrs}_{\text{end}}) \bigcup ({st}_{\text{start}}, {st}_{2}, \end{aligned}} $$
(9)
$$ {{}\begin{aligned} \cdots, {st}_{\text{end}}) \bigcup (t_{\text{start}}, t_{2}, \cdots, P_{T}, \cdots, t_{\text{end}}). \end{aligned}} $$
(10)
2.4 Feature extraction of the heartbeat
Modulation of the ECG signal can be performed in time (or frequency) and in amplitude (or energy). For frequency modulation, HRV is used, and for amplitude modulation, presented in Section 2.3, the voltage variation of the ECG signal was used. Thus, to classify different types of arrhythmias, we use two modulation information of the ECG signal, unlike several authors that only use the time modulation (HRV) [23–28]. The use of the two modulations allows a greater characterization of the ECG signal, improving the quality of the classification of arrhythmia. The variance, skewness, and kurtosis were used in this study to extract characteristics of both the ECG signal modulations.
-
Variance
$$ \sigma^{2}_{X} = E \left(X^{2} \right)-(E(X))^{2}; $$
(11)
-
Skewness
$$ \gamma_{X} = E\left[(X-E(X))\sigma^{-1}\right]^{3}; $$
(12)
-
Kurtosis
$$ \kappa_{X} = E\left[(X-E(X))\sigma^{-1}\right]^{4}. $$
(13)
Proposed method will be evaluated in a generalist (arrhythmia classification) and specialist (AF classification) manner.
2.5 Performance evaluation
The new method of ECG data extraction will be evaluated based on the ECG window for arrhythmia classification. Metrics for evaluation are specificity (SPEC—how efficient is the method for diagnosing healthy patients), sensibility (SENS—how efficient is the method for diagnosing patients with arrhythmias), and accuracy (ACC—how efficient is the method regarding the diagnosis).
The sensitivity and specificity are defined, respectively, given by
$$ \text{SPEC} = \frac{TN}{TN+FP} \times 100. $$
(14)
and
$$ \text{SENS} = \frac{TP}{TP+FN} \times 100, $$
(15)
And the accuracy is given by
$$ \text{ACC} = \frac{TP+TN}{TP+TN+FN+FP} \times 100 $$
(16)
where TP is the true positive, TN is the true negative, FP is the false positive, and FN is the false negative.