Source-linked AI summary
DENS-ECG: A Deep Learning Approach for ECG Signal Delineation
Abdolrahman Peimankar, Sadasivan Puthusserypady
TL;DR
Reviewing large ECG datasets visually is difficult and time-consuming, motivating reliable waveform delineation. DENS-ECG combines CNN and LSTM for ECG delineation, with reported class-wise F1 scores ranging from 93.01% to 99.45%.
Problem
Visual analysis of large ECG datasets is difficult, time-consuming, and subjective, motivating reliable delineation of wave locations for subsequent diagnostic use.
Source: §1 · p. 2Method
DENS-ECG combines convolutional and LSTM layers to extract ECG features and classify P, QRS, T, and NW waveforms.
Source: §2.3 · p. 3, §5 · p. 12Results
93.01%, 99.45%, 96.12%, and 98.55% were the F1 scores for P, QRS, T, and NW, respectively.
Source: §3.3 · p. 9Takeaways & Limitations
Among the reported waveform classes, performance was strongest on QRS detection, followed by T-wave and P-wave detection.
Source: §3.3 · p. 9Prior algorithms using RR-interval features can be cumbersome to test on newly collected raw ECG signals in real-world applications.
Source: §1 · p. 2
Abstract
from arXiv · showhide
Objectives: With the technological advancements in the field of tele-health monitoring, it is now possible to gather huge amounts of electro-physiological signals such as electrocardiogram (ECG). It is therefore necessary to develop models/algorithms that are capable of analysing these massive amounts of data in real-time. This paper proposes a deep learning model for real-time segmentation of heartbeats. Methods: The proposed algorithm, named as the DENS-ECG algorithm, combines convolutional neural network (CNN) and long short-term memory (LSTM) model to detect onset, peak, and offset of different heartbeat waveforms such as the P-wave, QRS complex, T-wave, and No wave (NW). Using ECG as the inputs, the model learns to extract high level features through the training process, which, unlike other classical machine learning based methods, eliminates the feature engineering step. Results: The proposed DENS-ECG model was trained and validated on a dataset with 105 ECGs of length 15 minutes each and achieved an average sensitivity and precision of 97.95% and 95.68%, respectively, using a 5-fold cross validation. Additionally, the model was evaluated on an unseen dataset to examine its robustness in QRS detection, which resulted in a sensitivity of 99.61% and precision of 99.52%. Conclusion: The empirical results show the flexibility and accuracy of the combined CNN-LSTM model for ECG signal delineation. Significance: This paper proposes an efficient and easy to use approach using deep learning for heartbeat segmentation, which could potentially be used in real-time tele-health monitoring systems.
1 Introduction
Because ECG diagnosis depends on locating waveform segments while manual review and existing methods pose practical challenges, the introduction motivates DENS-ECG, a CNN-LSTM approach that automatically learns ECG features for delineation.
1 Introduction
- P-wave delineation matters because P-wave absence is clinically useful for atrial fibrillation detection, while many ECG algorithms depend on QRS detection.The introduction also identifies atrial fibrillation as a common arrhythmia in elderly people.Source: §1 · p. 1
- Algorithms relying on RR-interval features and annotated databases can be cumbersome to test on newly collected raw ECG signals in real-world applications.Source: §1 · pp. 1–2
- Huge ECG volumes make visual examination difficult, time-consuming, and subjective, motivating reliable software to locate P-waves, QRS complexes, and T-waves for diagnostics.Source: §1 · p. 2
- Prior ECG delineation work mainly used classical machine learning or digital signal processing, including wavelet, Gaussian mesa, and Bayesian methods; the Bayesian approach had higher computational cost.Source: §1 · p. 2
- Classical machine-learning methods require engineered input features, whereas deep learning can extract relevant abstract features directly from data without prior domain expertise.Feature engineering transforms raw data into an internal representation that helps distinguish classes.Source: §1 · p. 2
- DENS-ECG combines CNN and LSTM to automatically extract ECG features and distinguish P-waves, QRS complexes, and T-waves in heartbeats.The introduction presents the learned features as inputs for distinguishing the component waveforms.Source: §1 · p. 2
2 Materials and Methods · 2.1 Dataset
The study trained and validated DENS-ECG on QTDB and tested it on MITDB. The datasets differed in recording count, duration, and sampling frequency.
2.1 Dataset
- QTDB supplied 105 15-minute records sampled at 250 Hz for training and validation [41].Source: §2.1 · p. 2
- MITDB supplied 48 half-hour ECG recordings sampled at 360 Hz for testing.Source: §2.1 · p. 2
- The study used PhysioNet’s WFDB Python package to read signals and their corresponding annotations.Source: §2.1 · p. 2
2.2 Pre-processing
The preprocessing pipeline filtered ECG records and divided them into 1,000-sample chunks before model training and evaluation.
2.2 Pre-processing
- Records were zero-phase filtered with a 3rd-order Butterworth band-pass filter (0.5–40 Hz) to remove baseline wander and high-frequency noise.The passage states that 84 QTDB records were used for training and the remaining 26 for evaluation.Source: §2.2 · p. 2
- The filtered records were segmented into chunks of 1,000 samples.The passage reports using 84 of 105 QTDB records for training and the remaining 26 for evaluation.Source: §2.2 · p. 2
2.3 Deep Learning Model Structure
DENS-ECG combines convolutional feature extraction with LSTM sequence processing and a four-neuron time-distributed output layer. The section also describes CNN and LSTM mechanisms and categorical cross-entropy training.
2.3 Deep Learning Model Structure
- Three 1D convolutional layers feed two deep LSTM layers, followed by a four-neuron time-distributed dense layer that outputs class posterior probabilities.The time-distributed layer is used to preserve continuity across ECG records.Source: §2.3 · p. 3
2.3.1 CNN layer
- CNN filters slide fixed-size kernels over ECG signals, using local connections and shared weights to learn features at different locations and form feature maps.Filter weights and bias are learned during training.Source: §2.3.1 · p. 3
2.3.2 LSTM layer
- LSTM networks address unstable gradients and long-term dependencies using forget, input, and output gates to manage memory.The LSTM input here is the output of the last CNN layer; its current memory also contributes to the output gate [47].Source: §2.3.2 · pp. 3–4
2.3.3 Model training
- For multiclass training, the model uses categorical cross-entropy loss, combining softmax with cross-entropy and one-hot encoded class labels [49] [50].The loss produces probabilities over the classes.Source: §2.3.3 · p. 5
2.4 Classification
The LSTM’s extracted ECG features feed a four-neuron softmax layer that assigns posterior probabilities at each time stamp. Each sample is classified as P, QRS, T, or NW by selecting the class with the highest posterior probability.
Classification
- The extracted ECG features from the LSTM layer are fed into a dense layer with four softmax neurons.Source: §2.4 · p. 5
- At each time stamp, the four neuron outputs sum to 1 and can be interpreted as posterior probabilities.Source: §2.4 · p. 5
- Each sample is assigned to the P, QRS, T, or NW class with the highest posterior probability.Source: §2.4 · p. 5
2.5 Deep ECG Delineation Framework
DENS-ECG is presented as an ensemble-learning framework for ECG delineation, using a CNN–BiLSTM sequence model. It filters and segments ECG signals before training and evaluates on unseen records.
2.5 Deep ECG Delineation Framework
- ECG signals are filtered for noise and baseline wander, then divided into 1000-sample chunks that preserve within-segment time continuity.Source: §2.5 · pp. 5–6
- Records are split into unique testing and non-testing sets, with stratified 5-fold cross-validation preserving class proportions across folds.Source: §2.5 · p. 6
- Three 1D convolutional layers extract temporal features before two BiLSTM layers, dropout, and a time-distributed four-unit softmax dense layer.The convolutional layers use 32, 64, and 128 filters; the BiLSTM layers have 250 and 125 hidden units, respectively.Source: §2.5 · p. 6
- Adam is optimized using random search over four hyperparameters, and the model contains 1,416,044 trainable parameters.The tuned parameters are learning rate, two moment-decay rates, and numerical stability parameter ϵ.Source: §2.5 · p. 6
- Training uses early stopping after three epochs without validation-loss decrease, while dropout is applied only during training.The reported validation performance is higher than training performance, which the passage describes as showing proper training without over-fitting.Source: §2.5 · pp. 6–7
- The trained model is evaluated on 26 unseen QTDB test records and on unseen MITDB data for QRS detection.Source: §2.5 · p. 7
3 Results
The section evaluates DENS-ECG on held-out QTDB records and MITDB for QRS detection, and reports waveform delineation and classification diagnostics on QTDB.
3.1 Classification Performance Metrics
- For imbalanced datasets, the authors identify F1-score, precision, and sensitivity as appropriate performance metrics.The balanced F1-score gives precision and sensitivity equal weight; the section also describes ROC curves and AUC for classification evaluation.Source: §3.1 · pp. 7–8
3.2 QRS detection results
- On MITDB QRS detection, DENS-ECG achieved 99.61% Se, 99.52% P+, and 99.56% F1-score on the unseen test data.The authors also report that input filtering increased F1-score by more than 4% on MITDB and more than 7% on QTDB.Source: §3.2 · p. 8, Table 2 · p. 8
3.3 ECG delineation results
- Delineation F1-scores were 93.01% for P, 99.45% for QRS, 96.12% for T, and 98.55% for NW, with QRS performing best.T-wave precision was 5% higher than P-wave precision, while sensitivity for both exceeded 96.5% and slightly favored T-waves.Source: §3.3 · p. 9, Table 3 · p. 9
- Filtering increased sensitivity by around 20% for P, 14% for QRS, 13% for T, and 14% for NW detection, while precision gains were smaller.The comparison covers the test-set waveform delineation results with and without input filtering.Source: §3.3 · p. 9, Table 3 · p. 9
- On the test set, 6.2% of P-waves, 3.9% of QRS complexes, and 8.5% of T-waves were misclassified as NW; the model made no errors between those three classes.The authors report only a small difference between 5-fold cross-validation and test results, which they interpret as evidence of no overfitting.Source: §3.3 · p. 9, Figure 6 · p. 9
- On the test set, micro-average AUC was 0.992 and macro-average AUC was 0.99, with QRS having the highest AUC among classes.The ROC curves are reported for both 5-fold cross-validation and the test set.Source: §3.3 · p. 9, Figure 7 · p. 10
- Example predictions included one excerpt with all four waveforms correctly classified and another with false negatives and false positives in P- and T-wave segments.The errors described include narrow false-negative T-wave detection, false-positive P-wave predictions, and false negatives in a later P-wave segment.Source: §3.3 · pp. 9–10, Figure 8 · p. 10
4 Discussion
The discussion compares DENS-ECG with alternative deep architectures and state-of-the-art delineation and QRS-detection methods. It reports results on QTDB and MITDB, including performance on an unseen dataset and practical-use considerations.
4.1 Comparison of DENS-ECG with other deep learning approaches
- DENS-ECG’s three-CNN/two-BiLSTM architecture had the best average F1-score across all four classes; adding a third CNN layer improved performance without noticeable complexity.The two-CNN/two-BiLSTM model was comparable. End-to-end CNN achieved 71.83% average F1-score, while end-to-end BiLSTM was around 4% lower than the other models.Source: Table 4 · p. 11, §4.1 · p. 11
4.2 Comparison of DENS-ECG with other state-of-the-art methods
- On QTDB, DENS-ECG outperformed and for P- and T-wave delineation, but not; its QRSon and QRSend sensitivities were 99.75% and 99.36%.The first three Table 5 models outperformed DENS-ECG particularly for Pon, Pend, and Tend detection.Source: Table 5 · p. 11, §4.2 · p. 12
- On MITDB QRS detection, DENS-ECG achieved Se=99.61% and P+=99.52%, comparable with and slightly better than.The wavelet-based method had the highest sensitivity and precision (Se=99.8% and P+=99.86%), followed by.Source: Table 6 · p. 12, §4.2 · p. 12
- The QTDB comparison used 26 test records out of 105, so DENS-ECG was evaluated on fewer annotated heartbeats than the other methods.Its QRSon and QRSend results were described as comparable with other models.Source: §4.2 · p. 12
- DENS-ECG is described as fully automated, requiring minimal parameter tuning, and generalizable to different datasets; MITDB filtering matched the QTDB training preprocessing.Its MITDB results were presented as evidence of performance on an unseen dataset.Source: §4.2 · p. 12
5 Conclusion
DENS-ECG combines CNN and LSTM networks to classify ECG waveforms from filtered segments, achieving high average F1-scores on MITDB and QTDB test sets.
5 Conclusion
- 99.56 on MITDB and 96.78 on QTDB were the average F1-scores achieved by DENS-ECG on the respective test sets.The model was tested on completely unseen sets.Source: §5 · p. 12
- DENS-ECG combines deep CNN-LSTM networks to extract temporal features from filtered 1D ECG segments and classify P, QRS, T, and NW classes.The approach omits the laborious feature-extraction step and uses posterior probabilities for each class at every time stamp.Source: §5 · p. 12
- The model was trained using stratified 5-fold cross-validation and tested on completely unseen sets.The passage identifies MITDB and QTDB as the test datasets.Source: §5 · p. 12
- The authors propose that cardiologists could use DENS-ECG to analyze recordings for diagnosing cardiac arrhythmias such as AFIB.Source: §5 · p. 12