Source-linked AI summary
DENS-ECG: A Deep Learning Approach for ECG Signal Delineation
Abdolrahman Peimankar, Sadasivan Puthusserypady
TL;DR
Large-scale ECG monitoring requires reliable, efficient delineation of P, QRS, and T waveforms, but visual analysis is time-consuming and existing feature-based methods are cumbersome on newly collected raw signals. DENS-ECG combines CNN and LSTM networks to classify ECG segments, achieving high QRS detection performance on unseen databases and strong delineation performance across four classes.
Problem
Large-scale ECG analysis requires accurate waveform locations, while visual examination is time-consuming and subjective and feature-based methods are cumbersome on newly collected raw signals.
Method
DENS-ECG combines 1D convolutional layers for abstract feature extraction with LSTM layers for temporal processing, using ECG segments directly to classify P, QRS, T, and NW classes.
Results
99.61% sensitivity, 99.52% precision, and 99.56% F1-score were achieved for QRS detection on the unseen MITDB database; delineation F1-scores were 93.01%, 99.45%, 96.12%, and 98.55% for P, QRS, T, and NW.
Takeaways & Limitations
The results support DENS-ECG as a flexible and accurate deep-learning approach for ECG waveform delineation without a laborious feature-extraction step.
Takeaways & Limitations
The feature-based methods discussed become extremely cumbersome to test on newly collected raw ECG signals in real-world applications.
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
ECG delineation is important for diagnosing cardiac disorders and supporting arrhythmia analysis, but large-scale manual examination and feature-dependent methods are difficult to apply in real-world settings. DENS-ECG addresses this need with a combined CNN-LSTM approach that automatically extracts features from ECG signals.
- Clinical motivation: ECG analysis requires locating and characterizing P, QRS, and T waveforms for diagnosis and arrhythmia classification.P-wave delineation is clinically useful for detecting atrial fibrillation, where P-wave absence is an important feature.
- Limitations of existing approaches: RR-interval methods validated on annotated databases are cumbersome to test on newly collected raw ECG signals in real-world applications.These approaches commonly rely on features extracted from annotated datasets such as PhysioNet databases.
- Clinical motivation: Manual visual examination of the growing volume of ECG recordings is difficult, time consuming, and subjective.Tele-health monitoring enables collection of huge amounts of ECG data, increasing the need for reliable automated delineation.
- Methodological motivation: Classical machine-learning methods require manually defined features, whereas deep learning extracts relevant representations directly from raw data.The paper presents deep learning as a way to learn highly abstract signal features without prior domain knowledge or feature engineering.
- Proposed approach: DENS-ECG combines convolutional neural networks and long short-term memory networks for automated ECG signal delineation.The paper motivates this combination because CNNs and LSTMs learn different complex functions from input signals during training.
2.1 Dataset
The study uses PhysioNet QTDB for training and validation and MITDB for testing the ECG delineation model.
- Datasets: QTDB contains 105 ECG records, each 15 minutes long and sampled at 250 Hz.MITDB contains 48 half-hour ECG recordings sampled at 360 Hz and is used to test the model.
- Datasets: MITDB provides an independent test database distinct from the QTDB training and validation data.The study uses the two databases for separate development and evaluation roles.
2.2 Pre-processing
Each ECG record is filtered to reduce baseline wander and high-frequency noise, then divided into fixed-length segments for model processing.
- Filtering: Signals are zero-phase filtered with a third-order Butterworth band-pass filter from 0.5 to 40 Hz.The filtering step removes baseline wander and high-frequency noise.
- Segmentation: Filtered records are segmented into chunks of 1000 samples.The segmentation follows record-level filtering and prepares the signals for model input.
- Dataset split: 84 of the 105 QTDB records are used for training, while the remaining 26 records are reserved for evaluation.This split is applied after preprocessing and segmentation.
2.3 Deep Learning Model Structure
The DENS-ECG model combines convolutional layers for temporal feature extraction with BiLSTM layers for sequential processing and time-distributed classification. Its training uses categorical cross-entropy to produce probabilities across four waveform classes.
- Model architecture: The model combines three 1D convolutional layers, two BiLSTM layers, dropout, and a time-distributed dense layer for sequence prediction.Convolutional layers extract temporal patterns from ECG segments, while the BiLSTM layers process the extracted features.
- Model architecture: The dense layer outputs posterior probabilities for four classes while preserving ECG record continuity through time distribution.The four classes correspond to the model’s waveform delineation outputs.
- CNN layer: CNN filters slide across ECG signals using shared weights to learn temporal features at different locations.Different filters generate feature maps, with each feature map corresponding to a filter’s shared weights and bias.
- LSTM layer: LSTM gates regulate memory updates and outputs, enabling the network to retain or forget information efficiently across the sequence.The LSTM input is the output of the final CNN layer, and its memory is updated using learned gate parameters.
- CNN layer: The convolution operation preserves signal dimensions through zero-padding while applying a kernel of size M across the input.For odd M, padding uses (M−1)/2 zeros at each end; otherwise, the padding size is M/2.
- Model training: Training uses categorical cross-entropy with softmax and one-hot encoded labels to optimize multi-class classification.The loss is used to learn network parameters such as weights and biases through iterative optimization.
2.4 Classification
The classifier converts LSTM-extracted ECG features into four time-distributed waveform classes using a softmax dense layer. Each sample is assigned the class with the highest posterior probability.
- The TimeDistributed dense layer uses four softmax neurons to classify each ECG time stamp as P, QRS, T, or NW.Softmax outputs sum to 1 and can be interpreted as posterior probabilities.
- The LSTM output provides the extracted ECG features used by the dense classification layer.
- The predicted class for sample x_i is the class c_j with the highest posterior probability.
2.5 Deep ECG Delineation Framework
The DENS-ECG framework processes ECG signals through preprocessing, segmentation, stratified validation, and a CNN-BiLSTM sequence model. It evaluates the trained classifier on unseen QTDB records and MITDB QRS annotations.
- The framework filters ECG signals to remove noise and baseline wander before segmentation.
- ECG signals are divided into 1000-sample chunks while preserving within-segment time-series continuity for waveform learning.
- The model contains an input layer, three 1D convolutional layers, two BiLSTM layers, dropout, and a time-distributed dense layer.The convolutional layers extract temporal patterns from the ECG segments.
- The training and validation curves report model loss and accuracy across the training process.
- Dropout is applied during training, and validation loss is monitored to address overfitting during model training.The paper states that the model achieves higher validation performance than training performance, indicating proper training without overfitting.
- The trained model is evaluated on 26 unseen QTDB test records and on unseen MITDB data for QRS detection.
3 Results
DENS-ECG achieved strong ECG waveform and QRS delineation performance across cross-validation and unseen test data, with QRS detection generally outperforming the other waveform classes. Filtering improved sensitivity, while confusion matrices and ROC analysis indicated limited class confusion and high overall discrimination.
- QRS detection: 99.61% sensitivity and 99.52% precision were achieved for QRS detection on the unseen MITDB dataset.The corresponding F1-score was 99.56%.
- Waveform delineation: 93.01%, 99.45%, 96.12%, and 98.55% were the F1-scores for P, QRS, T, and NW waveform classes, respectively.QRS detection performed best, followed by NW, T-wave, and P-wave performance.
- Filtering effects: Filtering increased sensitivity by around 20%, 14%, 13%, and 14% for P, QRS, T, and NW detection, respectively.Precision improved less than sensitivity after filtering.
- Classification analysis: The test-set confusion matrix showed that 6.2%, 3.9%, and 8.5% of P-wave, QRS, and T-wave cases were incorrectly classified as NW.The model did not make incorrect classifications among the P-wave, QRS, and T-wave classes, and the small cross-validation/test difference indicated no over-fitting problem.
- ROC analysis: The test-set micro- and macro-average ROC AUC values were 0.992 and 0.99, respectively.The QRS class had the highest AUC among the four classes.
- Prediction examples: Prediction examples included one nearly perfect classification and another with false-positive and false-negative detections.The errors occurred in example P-wave and T-wave segments, while all four waveform types were correctly classified in the high-performing example.
4 Discussion
DENS-ECG was compared with alternative deep architectures and state-of-the-art delineation methods on QTDB and MITDB. Its three-convolutional, two-BiLSTM design performed strongly, while evaluation scope and dataset differences constrain direct comparisons.
- Comparison with other deep learning approaches: DENS-ECG, using three convolutional and two BiLSTM layers, achieved the best average F1-score among the compared deep architectures.Adding a third convolutional layer produced the highest performance without noticeably increasing model complexity.
- Comparison with other deep learning approaches: 71.83% average F1-score was achieved by the end-to-end CNN model, the lowest result among the compared deep architectures.The end-to-end BiLSTM model performed better than the end-to-end CNN model but remained about 4% below the other models in average F1-score.
- Comparison with state-of-the-art methods: 99.75% sensitivity for QRSon and 99.36% sensitivity for QRSend were reported on QTDB, with QRS detection comparable to other models.DENS-ECG outperformed some published algorithms for P- and T-wave delineation but was not as accurate as the algorithm reported in.
- Comparison with state-of-the-art methods: Evaluation on QTDB used only 26 of 105 records, so DENS-ECG was assessed with fewer heartbeat annotations than the other methods.This difference limits direct comparison of the reported delineation results across methods.
- Practical applicability: DENS-ECG is fully automated, requires minimal parameter tuning, and generalized to the unseen MITDB dataset using identical filtering to QTDB training.The authors present these properties as supporting practical use across datasets.
- Comparison with state-of-the-art methods: 99.61% sensitivity and 99.52% precision were obtained for QRS detection on MITDB, with performance comparable to other algorithms.The wavelet-based model reported higher sensitivity and precision, while DENS-ECG was comparable with the well-known algorithm and slightly better than.
5 Conclusion
DENS-ECG combines CNN and LSTM networks to delineate ECG waveforms without laborious feature extraction. It achieved high F1-scores on QTDB and MITDB and was evaluated on completely unseen test sets.
- Method: DENS-ECG combines CNN-LSTM networks to classify P, QRS, T, and No wave classes from filtered ECG segments.The network extracts highly abstract temporal features from one-dimensional ECG signals and produces posterior probabilities at each time stamp.
- Results: 99.56 average F1-score on MITDB and 96.78 average F1-score on QTDB were achieved on the test sets.The model was trained using stratified 5-fold cross validation and then tested on completely unseen sets.
- Significance: The approach omits laborious feature extraction by using filtered ECG segments directly as model inputs.This design supports data-driven waveform classification without a separate feature-engineering step.