Conceptio › Archive › NCBI PubMed Central
NCBI PubMed Central open access

QRS-centric beat-wise atrial fibrillation detection in ECG signals using deep neural networks.

Lim J et al. · ncbi_pmc
NCBI PubMed Central · Papers
Open Source ↗Direct PDF ↓
legal-informatics
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

QRS-Centric Beat-Wise Atrial Fibrillation Detection in ECG Signals Using Deep Neural Networks - PMC Skip to main content An official website of the United States government Here's how you know Here's how you know Search Log in Primary site navigation Search Log in Search PMC Full-Text Archive Search in PMC Journal List User Guide As a library, NLM provides access to scientific literature. Inclusion in an NLM database does not imply endorsement of, or agreement with, the contents by NLM or the National Institutes of Health. Learn more: PMC Disclaimer | PMC Copyright Notice Comput Biol Med . Author manuscript; available in PMC: 2026 Jun 1. Published in final edited form as: Comput Biol Med. 2025 May 15;192(Pt B):110282. doi: 10.1016/j.compbiomed.2025.110282 QRS-Centric Beat-Wise Atrial Fibrillation Detection in ECG Signals Using Deep Neural Networks 1 Jaechan Lim a , Dong Han a , Ki H Chon a Author information Article notes Copyright and License information a Department of Biomedical Engineering, University of Connecticut, Storrs, 06269, CT, U.S. Issue date 2025 Jun. PMC Copyright notice PMCID: PMC12182906  NIHMSID: NIHMS2082874  PMID: 40378565 The publisher's version of this article is available at Comput Biol Med Abstract We propose a deep learning approach for beat-wise atrial fibrillation (AF) detection in electrocardiogram (ECG) signals. AF, a major cardiac arrhythmia affecting millions globally, requires early detection for optimal treatment outcomes. Current rhythm-based methods lack beat-level precision and timeliness. Our QRS-centric approach improves traditional classification by providing precise beat-wise analysis, addressing the critical gap between rhythm-level detection and immediate arrhythmia identification. Our network architecture integrates convolutional layers for feature extraction with bidirectional LSTM layers that target the QRS complex region through adaptive beat segmentation. This architecture enables detailed temporal dependency analysis while preserving morphological feature sensitivity. Extensive evaluation on the MIT-BIH Arrhythmia Database demonstrates exceptional performance with 98.606% precision and 99.648% sensitivity for AF detection. The model’s robust generalizability is confirmed through independent validation on the MIT-BIH Atrial Fibrillation Database, achieving a 98.653% F-score. Further validation using contemporary datasets (MIMIC-III and Simband) confirms the model’s effectiveness in identifying multiple beat types including normal sinus rhythm, AF, premature ventricular contraction, and premature atrial contraction. The QRS-centric approach enables timely arrhythmia detection at the individual beat level, demonstrating a significant advancement in automated ECG analysis. The high accuracy and beat-level precision of this approach suggest potential for integration with wearable devices and real-time monitoring systems, enabling earlier clinical intervention and improved arrhythmia diagnosis in practice. Keywords: QRS-centric ECG analysis, Beat-wise arrhythmia detection, Deep learning in cardiology, Adaptive beat segmentation, Temporal ECG processing 1. Introduction Atrial fibrillation (AF) is a major global health concern, associated with heightened risks of stroke, heart failure, and mortality (January et al., 2014 [ 1 ]; Joglar et al., 2024 [ 2 ]). Early AF detection via electrocardiogram (ECG) analysis is crucial for timely intervention and improved patient outcomes (Ahmed et al., 2020 [ 3 ]; Ramkumar et al., 2018 [ 4 ]). Deep learning has significantly advanced automated ECG analysis for arrhythmia detection (Chen et al., 2021 [ 5 ]; Hagiwara et al., (2018) [ 6 ]; Attia et al., 2019 [ 7 ]; Siontis et al., [ 8 ]; Andersen et al. (2019) [ 9 ]). State-of-the-art methods in AF detection primarily employ deep learning approaches. However, existing methods face a fundamental limitation: they rely on analyzing cardiac rhythms over extended intervals—spanning multiple consecutive beats or even minute-long episodes—rather than classifying individual heartbeats. This delay between onset and detection can critically impact timely intervention. Current approaches face three critical challenges in AF detection: delayed detection due to reliance on extended ECG segments for rhythm classification, limited analytical precision from analyzing multiple beats rather than individual beats, and limited generalizability across diverse datasets and patient populations (Mousavi et al. [ 10 ], 2019; Cai et al., 2020 [ 11 ]). While recent studies using constrained transformer networks and multi-lead analysis have attempted to address these limitations (Che et al., 2021 [ 12 ]; Hong et al., 2022 [ 13 ]), achieving accurate beat-wise AF detection with high generalizability remains an open challenge. Building on our previous work (Lim et al., 2024 [ 14 ]), we propose a QRS-centric deep learning approach for beat-wise AF detection. Our method employs adaptive beat segmentation using proportional RR-intervals and integrates a CNN-BiLSTM architecture optimized for QRS morphology, ensuring feature consistency across varying heart rates unlike fixed-window segmentation methods (Sellami et al., 2023 [ 15 ]). The architecture combines progressive convolutional filtering with bidirectional temporal processing, advancing beyond purely convolutional (Islam et al., 2023 [ 16 ]) or traditional RNN approaches (Xu et al., 2023 [ 17 ]). A multi-stage classification framework with relative heart rate analysis enables precise arrhythmia detection at the individual beat level. This approach provides immediate detection while maintaining high accuracy across independent datasets. 2. Related Work 2.1. Current State of AF Detection AF detection and classification have evolved from conventional signal processing to modern deep learning. Ghosh et al. (2020) [ 18 ] achieved 99.40% accuracy using multirate cosine filter banks with neural networks, establishing a foundation for hybrid architectures. Chen et al. (2020) [ 5 ] and Hannun et al. (2019) [ 19 ] advanced this work with CNN-based approaches validated on clinical data, achieving F-scores of 0.93 and 0.83 respectively. This research field then progressed toward attention mechanisms and multi-lead analysis. Mousavi et al. (2019) [ 10 ] introduced attention-based ECGNET for single-lead analysis, while Cai et al. (2020) [ 11 ] explored 12-lead ECG interpretation, both achieving 99% sensitivity and specificity. Fujita and Cimr (2019) [ 20 ] and Wang (2020) [ 21 ] focused on computational efficiency, achieving 98.5% and 97.8% accuracy respectively through optimized CNN architectures. Recent innovations have focused on architectural advance and clinical applicability. Che et al. (2021) [ 12 ] introduced transformer-based models achieving an F-score of 0.85, while Hong et al. (2022) [ 13 ] combined CNNs with BiLSTM networks for improved temporal analysis. The latest advancements include Li et al. (2023) [ 22 ]’s SEResUTer achieving 99.20% accuracy through enhanced U-Net architectures, Ben-Moshe et al. (2024) [ 23 ]’s RawECGNet demonstrating robust generalization with F scores of 0.91–0.94, and Zhou et al. (2024) [ 24 ]’s mRMEBP framework achieving an F-score of 0.95 through probabilistic modeling. This methodological progression, summarized in Table 1 , demonstrates evolution toward increasingly advanced model architectures. While overall detection accuracy has improved, a consistent challenge remains: balancing prompt beat-level detection with classification accuracy. Our work addresses this fundamental gap through beat-wise analysis while maintaining competitive performance metrics across diverse datasets. Table 1: Summary of related work in AF detection, where mitdb, afdb, LTafdb, acc, sen, spe, and f denote MIT-BIH Arrhythmia Database, MIT-BIH Atrial Fibrillation Database, Long Term AF Database, accuracy, sensitivity, specificity, and F-score, respectively. Related Work Dataset Classes Network Architecture Result Ghosh et al. (2020) [ 18 ] mitdb, afdb Normal, AF NN+ELM AF (sen): 0.98, AF (spe): 1.00 Chen et al. (2020) [ 5 ] 2018 China Physiological Signal Challenge Normal, AF, RBBB, LBBB, I-AVB, PAC, PVC, STD, STE CNN+RNN N (f): 0.8, AF(f): 0.93, PAC(f): 0.82, PVC(f): 0.83 Hannun et al. (2019) [ 19 ] Clinical one-lead ECG AF, AVB, Bigeminy, EAR, IVR, Junctional rhythm, Noise, SR, SVT, VT, Trigeminy, Wenckebach Deep CNN Neural Network AF(f): 0.83, Bigeminy(f): 0.87, Trigeminy(f): 0.86 Fujita et al. (2019) [ 20 ] mitdb, afdb Normal, AF, VF, AFL CNN AF(sen): 0.99, AF(spe): 0.96 Wang et al. (2020) [ 21 ] afdb AF, Normal CNN+ELM AF(sen): 0.97, AF(spe): 0.97 Mousavi et al. (2019) [ 10 ] afdb AF, non-AF CNN+Attention AF(sen): 0.99, AF(spe): 0.99 Cai et al. (2020) [ 11 ] Clinical 12-lead ECG AF, Normal Deep CNN Neural Network AF(sen): 0.99, AF(spe): 0.99 Che et al. (2021) [ 12 ] 2018 China Physiological Signal Challenge Normal, AF, PVC, PAC CNN+ Transformer Normal(f): 0.81, AF(f): 0.85, PVC(f): 0.83, PAC(f): 0.61 Hong et al. (2022) [ 13 ] Clinical 12-lead ECG AF, PAC, PVC, Other CNN+BiLSTM AF(acc): 0.99 Li et al. (2023) [ 22 ] CPSC2018, CPSC2021 Normal, AF U-Net+ResNet+Transformer encoder AF(sen): 0.98, AF(f): 0.92 Ben et al. (2024) [ 23 ] RBDB, SHDB Normal, AF, AFL Conv1D AF(f): 0.91–0.94 Zhou et al. (2024) [ 24 ] mitdb, afdb, LTafdb Normal, AF Back propagation NN AF(sen): 0.98, AF(f): 0.95 Open in a new tab In addition to AF-specific research, there are several notable studies focused on beat-type classification using deep learning. While not exclusively targeting AF, these studies provide important advancements in ECG analysis. Examples include the works of Sellami et al. (2019) [ 15 ], Oh et al. (2018) [ 25 ], Yildirim et al. (2019) [ 26 ], Islam et al. (2023) [ 16 ], Xu et al. (2023) [ 17 ], Zumair et al. (2023) [ 27 ], and Tao et al. (2024) [ 28 ]. 2.2. Contribution: This paper proposes a QRS-centric deep learning approach for beat-wise atrial fibrillation detection, advancing beyond traditional methods. Our approach targets the QRS complex of each heartbeat, integrating convolutional layers for feature extraction with bidirectional LSTM layers to capture temporal dependencies. This framework enables precise beat-wise classification, surpassing methods that require multiple beats or extended periods for accurate detection. 3. Materials and Methods 3.1. Data Acquisition and Preprocessing We used two primary datasets from PhysioNet: MIT-BIH Arrhythmia Database (mitdb) and the MIT-BIH Atrial Fibrillation Database (afdb). These databases provide their complementary strengths: mitdb providing precise beat-level annotations and afdb containing extensive AF episodes enabling comprehensive model validation, although it only has rhythm-level annotations and no beat-level annotations. For multi-class classification, we addressed class imbalance through strategic data curation. Table 2 summarizes the complete dataset composition used in this paper. The training set comprised complete ECG signals from several mitdb records, comprising 11,395 normal beats, 2,243 PAC beats, 3,347 PVC beats, and 2,026 AF beats to ensure balanced class representation. Testing employed records 116, 220, and portions of 210, containing 4,256 normal beats, 95 PACs, 139 PVCs, and 570 AF beats. Table 2: Dataset composition for model training and evaluation Dataset Purpose Records (with Beat Counts) Total Beats Multi-class Classification (mitdb) Training N, PAC, PVC, AF classification Rec 100 (2293 N, 33 PAC, 1 PVC) Rec 106 (1507 N, 520 PVC) Rec 119 (1543 N, 444 PVC) Rec 209 (2621 N, 383 PAC, 1 PVC) Rec 228 (1688 N, 3 PAC, 362 PVC) Rec 221 (2026 AF, 395 PVC) Rec 200 (1743 N, 30 PAC, 826 PVC) Rec 207 (107 PAC, 105 PVC) Rec 213 (25 PAC, 220 PVC) Rec 222 (208 PAC) Rec 223 (72 PAC, 473 PVC) Rec 232 (1382 PAC) N: 11,395 PAC: 2,243 PVC: 3,347 AF: 2,026 Testing Performance validation Rec 116 (2302 N, 1 PAC, 109 PVC) Rec 220 (1954 N, 94 PAC, 1 PVC) Rec 210 (partial: 570 AF, 29 PVC) N: 4,256 PAC: 95 PVC: 139 AF: 570 Binary Classification Training (mitdb) AF vs Normal classification Rec 221 (2026 AF beats) Rec 115 (1953 N beats) N: 1,953 AF: 2,026 Validation (mitdb) Parameter tuning Rec 210 (570 AF beats) Rec 117 (564 N beats) N: 564 AF: 570 Testing (afdb) Independent validation Rec 07879 (3303 N, 4194 AF beats) N: 3,303 AF: 4,194 Additional Validation using Multi-class Model MIMIC-III Modern clinical data validation NSR (7867 samples, 31 beats) AF (9418 samples, 44 beats) PVC (9849 samples, 43 beats) Simband Wearable device validation PAC (76 samples, 11 beats) Open in a new tab For binary AF classification, mitdb records 221 (2,026 AF beats) and 115 (1,953 normal beats) were used for training, with records 210 (570 AF beats) and 117 (564 normal beats) for validation. Independent testing employed afdb record 07879 (3,303 normal, 4,194 AF beats), maintaining class balance while testing generalizability across different databases. These selections provided significant challenges in annotation complexity, particularly for AF rhythms. For instance, mitdb record 221 contains substantial AF segments that PhysioNet’s annotation protocol marks as normal beats, exemplifying the intricate nature of ECG interpretation in clinical practice. To validate model robustness, we applied our trained network to contemporary datasets: MIMIC-III [ 29 ] provided physician-verified ICU data (125 Hz) with NSR, AF, and PVC rhythms, while Simband dataset [ 30 ] (180 Hz) from ambulatory recordings validated PAC detection. Despite varying sampling rates and recording environments, our model maintained effectiveness without retraining. 3.2. Adaptive Beat Segmentation Our methodology employs adaptive beat segmentation based on R-peak locations. Instead of fixed intervals, the approach extracts signal samples relative to R-peaks using ratios of previous (PRRI) and current (CRRI) RR-intervals. As Figure 1 illustrates, the sampling focuses on two regions: the last 30% of PRRI (t1), capturing P-wave onset to R-peak, and the first 45% of CRRI (t2), spanning R-peak to T-wave end. This adaptive approach aligns with typical temporal relationships between ECG components. Figure 1 depicts these relationships, showing a normal ECG waveform with labeled P, Q, R, S, and T components and the corresponding time intervals t1 and t2, as well as the complete beat duration t. When RR-intervals exceed 450 samples, the system employs a fixed segmentation approach, extracting 150 samples preceding and 200 samples following the R-peak. This method is directly applicable to the mitdb with its 360 Hz sampling frequency. For the afdb, which has a 250 Hz sampling frequency, an upsampling process to 360 Hz is performed prior to experiments to maintain consistency in the extracted sample counts. This upsampling process employs optimized filter design that preserves signal fidelity while minimizing potential artifacts, maintaining the crucial temporal and morphological characteristics of the ECG signals. This adaptive technique ensures consistent capture of beat morphology across varying heart rates, providing robust feature extraction even in cases of bradycardia or tachycardia. The dynamic adjustment of segmentation boundaries based on RR-intervals inherently handles overlapping beats, a common challenge in real-world ECG recordings. While our preprocessing pipeline includes standard noise filtering for typical signal variations, extremely noisy signals may benefit from additional denoising techniques such as autoencoder-based approaches (Hajeb et al., 2022 [ 31 ]; Nejad et al., 2024 [ 32 ]. However, our current implementation demonstrates reliable performance across noise levels typically encountered in clinical settings. Figure 1: Open in a new tab Illustration of a normal ECG waveform showing key components and temporal segments. Each beat consists of distinct waves (P, QRS, T) and intervals. The P wave denotes atrial depolarization, the QRS complex denotes ventricular depolarization, and the T wave indicates ventricular repolarization. The RR-interval is the time between consecutive R peaks. Key temporal segments include: “t” (complete beat duration), “t1” (last 30% of previous RR-interval capturing P-wave to R-peak), and “t2” (first 45% of current RR-interval spanning R-peak to T-wave end). “N/W” (No Wave) segments mark regions between distinct electrical activities. This segmentation scheme is fundamental to our adaptive beat analysis approach, ensuring consistent feature extraction across varying heart rates. This beat-wise analysis provides enhanced biological interpretability compared to rhythm-based methods. While rhythm-based approaches require multiple beats to detect irregular patterns, our approach directly maps to cardiac electrophysiology by analyzing how each QRS complex relates to surrounding signal components. This enables immediate detection of AF’s characteristic disruptions in normal conduction patterns, reflecting the underlying pathophysiological changes as they occur. The bidirectional temporal analysis captures both the absence of organized atrial activity and irregular ventricular timing at each beat, providing a more direct connection to AF’s physiological manifestations. 3.3. Network Architecture Our beat-wise AF detection architecture ( Figure 2 ) uses sequence-to-sequence classification, integrating convolutional layers for feature extraction with BiLSTM layers for temporal dependencies. The network processes normalized single-lead ECG signals with 5,000 time-stamp samples per segment. The network’s superior performance stems from key design selections. The convolutional operation in each layer is defined as: x t l = σ ∑ j = 1 F w j l ⋅ x t + j − 1 l − 1 + b l , (1) Figure 2: Open in a new tab Overview of the deep learning model architecture developed for sample-level classification of ECG signals in beat-wise atrial fibrillation detection. The network takes normalized single-lead ECG signals as input and progressively extracts morphological and temporal features through a series of convolutional, batch normalization, and bidirectional LSTM layers. The convolutional layers learn increasingly complex features of the ECG waveform, while the BiLSTM layers capture intricate temporal dependencies within the signal. Batch normalization and ReLU activation improve training stability and enable non-linear expressions. The final fully connected layer maps the learned features to class logits, which are then converted to class probabilities using a softmax function for the beat-level classification output. where x t l is the output at time step t of layer l , F is the filter size, w j l denotes the j -th weight of the filter in layer l , b l is the bias, and σ is the ReLU activation function. This convolution operation slides over the temporal dimension of the ECG signal, extracting relevant features at each time step. BiLSTM layers capture temporal dependencies through: h t → = LSTM x t , h t − 1 → , (2) h t ← = LSTM x t , h t + 1 ← , (3) h t = h t → , h t ← , (4) where h t → and h t ← denote forward and backward hidden states. This bidirectional processing provides an advantage over traditional unidirectional approaches by considering both past and future context for each time point, crucial for accurate beat classification. We maintain training stability using a piecewise learning rate schedule: η e = η 0 ⋅ γ e / τ , (5) where η 0 is the initial learning rate (0.01), γ is the decay factor (0.1), e is the current epoch, and τ is the drop period (3 epochs). In our implementation, this learning rate is reduced by a factor of 0.1 every 3 epochs. The classification loss is computed using cross-entropy: L = − 1 N ∑ i = 1 N ∑ c = 1 C y i , c log y ^ i , c , (6) where N is the batch size, C is the number of classes, y i , c is the true label, and y ^ i , c is the predicted probability. This cross-entropy loss function measures classification error, which the Adam optimizer then uses to compute optimal weight updates through adaptive moment estimation. During training, Adam adjusts learning rates adaptively for each parameter, using estimates of first and second moments of the gradients to optimize convergence. Our architecture outperforms recent approaches like SEResUTer (Li et al., 2023 [ 22 ]) and mRMEBP (Zhou et al., 2024 [ 24 ]) through: (1) focused feature extraction with ECG-specific progressive convolutions, (2) efficient bidirectional temporal modeling, and (3) computationally efficient 1D signal processing. Unlike methods requiring complex preprocessing or parallel networks, our single-stream architecture maintains accuracy with reduced computational overhead. As shown in Table 1 , these architectural advantages translate to superior performance metrics (F-score of 0.99124 on mitdb) while maintaining computational efficiency compared to more complex approaches like transformer-based models (F-score 0.85) or multi-stream networks. This efficiency stems from our focused feature extraction and single-stream processing, unlike methods requiring parallel networks or extensive preprocessing. As detailed in Table 3 , the feature extraction stage consists of four consecutive one-dimensional convolutional layers (CONV1D) with increasing complexity. The initial layer employs 16 filters with a filter size of 5 and a stride of 1, capturing low-level signal characteristics such as sharp transitions and subtle amplitude changes within the ECG waveform. The subsequent convolutional layers adopt 32, 64, and 128 filters respectively, each with a filter size of 7 and maintaining the same stride. This progressive increase in filter depth and size allows the network to learn increasingly complex features of the ECG morphology, such as the relative timing and distinctive patterns of the P-wave, QRS complex, and T-wave. By stacking multiple convolutional layers, the model is able to extract a hierarchical set of features, from simple edge-like elements to detailed and complex characteristics of the ECG signal characteristics that are crucial for accurate beat-wise classification. All convolutional layers use “same” padding to preserve temporal dimensionality, ensuring the model can effectively process the full duration of each heart beat. Table 3: Detailed network configuration, including layer and training parameters for the beat-wise ECG classification model. FS stands for filter size, NF for the number of filters, and NHU for hidden units. Layer/Process Property Input type Output type Number of layers Signal normalization CONV1d-1 CONV1d-2 CONV1d-3 CONV1d-4 BiLSTM-1 BiLSTM-2 BiLSTM-3 Dropout probability FC Loss function Sequence, Size = 1 Classification 14 z-score FS = 5, NF = 16, Stride = 1, padding: same FS = 7, NF = 32, Stride = 1, padding: same FS = 7, NF = 64, Stride = 1, padding: same FS = 7, NF = 128, Stride = 1, padding: same NHU = 64, Input size = 128 NHU = 128, Input size = 128 NHU = 128, Input size = 256 0.2 Output size = 3 or 5, Input size = 256 Cross entropy Training option Adam optimizer Maximum epochs = 10 Batch size = 10 Initial learn rate = 0.01 Learn rate drop period = 3 Gradient threshold = 1 Learn rate schedule: piecewise Shuffle: every epoch Open in a new tab The temporal processing stage incorporates three BiLSTM layers in sequence. The first BiLSTM layer contains 64 hidden units and processes the 128-dimensional feature maps from the convolutional stage. The second and third BiLSTM layers employ 128 hidden units each, with the final layer producing a 256-dimensional output. This progressive increase in dimensionality allows the network to capture increasingly complex temporal patterns in the ECG signal. Our architecture’s decision-making process aligns with established cardiac electrophysiology. The sample-level classifications, visualized in Figures 7 – 8 , demonstrate how the model progressively analyzes ECG components to reach final beat-type determinations. This interpretable approach facilitates clinical adoption by providing clear connections between physiological features and classification decisions. Figure 7: Open in a new tab Illustrative example of 4-class beat-type classification using the MIMIC-III dataset. Each plot shows a 15-second segment of ECG data. (a) The top panel shows the beat-type classification results for a normal sinus rhythm (NSR) segment, including wave delineation (top), sample-level classification (second), full-beat analysis-based beat-type classification (third), and QRS-focused beat-type classification (bottom). (b) The bottom panel shows similar results for an atrial fibrillation (AF) rhythm segment from the MIMIC-III dataset. The figure demonstrates the model’s ability to accurately identify AF beats among different beat types across NSR, premature ventricular contractions (PVCs), and premature atrial contractions (PACs) rhythms. Figure 8: Open in a new tab Illustrative example of 4-class beat-type classification on PVC and PAC rhythm segments. Each plot shows a 15-second segment of ECG data. (a) Results from a PVC rhythm segment (MIMIC-III dataset) showing wave delineation (top), sample-level classification (second), full-beat analysis-based beat-type classification (third), and QRS-fosed beat-type classification (bottom). (b) Results from a PAC rhythm segment (Simband dataset) following the same visualization format. Each panel demonstrates the progression from wave-level analysis to final beat classification, highlighting the model’s ability to distinguish between different arrhythmia beat types. While our approach focuses on QRS regions for final classification, the BiLSTM layers enable comprehensive temporal analysis of the entire ECG signal. This ensures that QRS region classification incorporates information from surrounding ECG components, including P-waves and T-waves, through bidirectional processing. The QRS focus leverages this region’s robust features while maintaining sensitivity to the complete cardiac cycle. To mitigate overfitting, a dropout layer with a probability of 0.2 is implemented following the BiLSTM layers. The classification stage consists of a fully connected layer that maps the 256-dimensional features to output classes, followed by a softmax activation function for final classification. The network produces outputs corresponding to different beat types: normal (N), atrial fibrillation (AF), premature atrial contraction (PAC), premature ventricular contraction (PVC), and no wave (N/W). For training, as shown in Table 3 , we employed the cross-entropy loss function and the Adam optimizer with an initial learning rate of 0.01. The learning rate is adjusted using a piecewise schedule with a drop period of 3 epochs. The model is trained for 10 epochs with a batch size of 10, and a gradient threshold of 1 is applied to prevent exploding gradients. Data shuffling is performed at the beginning of each epoch to enhance the model’s generalization capabilities. The computational efficiency of our architecture is worth noting despite its multi-layered design. Our model requires approximately 580K trainable parameters in total: 96 parameters in CONV1d-1 (16 filters of size 5), 3,584 parameters in CONV1d-2 (32 filters of size 7), 14,336 parameters in CONV1d-3 (64 filters of size 7), 57,472 parameters in CONV1d-4 (128 filters of size 7), 49,664 parameters in BiLSTM-1, 197,632 parameters in BiLSTM-2, 263,680 parameters in BiLSTM-3, and 1,285 parameters in the fully connected layer (assuming 5-class output). This parameter count is considerably more efficient than transformer-based architectures like those used by Che et al. [ 12 ], which typically require 1.2–1.8M parameters, or attention-based mechanisms like those in Mousavi et al. [ 10 ] which need approximately 950K parameters. Our design choices, particularly the use of 1D signal processing rather than image-based or time-frequency approaches, allow for this computational efficiency while maintaining superior performance. The choice of hyperparameters significantly influences the model’s performance and generalizability. The filter sizes and number of filters in the convolutional layers were selected to balance feature extraction capability and computational efficiency. Smaller filter sizes capture fine-grained features, while larger filter sizes help in understanding broader patterns in the ECG signals. The number of hidden units in the BiLSTM layers was chosen to ensure sufficient capacity for capturing temporal dependencies without overfitting. Increasing the number of hidden units generally improves the model’s ability to learn complex patterns but also increases the risk of overfitting and computational load. The dropout rate of 0.2 was selected to provide a balance between regularization and model capacity. A higher dropout rate could lead to underfitting, while a lower rate might not sufficiently prevent overfitting. The initial learning rate of 0.01 for the Adam optimizer was chosen based on empirical results, providing a good balance between convergence speed and stability. The piecewise learning rate schedule helps in fine-tuning the model by reducing the learning rate as training progresses, which aids in achieving better convergence. Overall, these hyperparameters were carefully tuned through extensive experimentation to achieve optimal performance, ensuring the model’s robustness and generalizability across different datasets. Unlike methods requiring parallel networks or extensive preprocessing, our single-stream architecture and 1D signal processing maintain computational efficiency while achieving state-of-the-art performance in terms of all metrics (sensitivity, precision, specificity, and F-score). This streamlined approach enables real-time clinical applications without compromising detection accuracy. 3.4. Multi-Stage Classification Framework Our classification strategy employs a two-stage approach. The first stage performs sample-level classification, categorizing each ECG time-stamp as normal beat (N), premature atrial contraction (PAC), premature ventricular contraction (PVC), atrial fibrillation (AF), or no wave area (N/W). Following sample classification, we implement a full-beat analysis-based beat classification stage. This process uses RR-intervals and our previously proposed beat segmentation technique to determine the overall beat type based on the majority class among its constituent time-stamp samples. However, this approach occasionally results in false detections when N/W emerges as the majority class for a beat segment. To enhance classification accuracy, we proposed an innovative QRS-focused beat classification approach that focuses solely on the QRS complex region for beat-type determination. This method leverages a pre-trained wave delineation network, developed using the QT Database (QTDB) dataset, which provides precise annotations for various ECG wave components. By concentrating on the QRS complex—the most distinctive feature of a heart beat—we significantly improve classification performance. As a final refinement step, we incorporate a post-processing scheme that analyzes the relative heart rates of neighboring beats. This approach is particularly effective for PAC detection, reclassifying normal beats as PAC based on specific temporal criteria. The reclassification occurs when the expected heart rate of a target beat, calculated from its PRRI, falls below the mean heart rate of its twenty nearest neighboring beats. This physiologically-informed post-processing stage significantly enhances the detection accuracy of premature atrial contractions. Our comprehensive strategy combines deep learning techniques with domain-specific knowledge of ECG signal characteristics, enabling accurate beat-wise classification across multiple categories, including the challenging task of atrial fibrillation detection. 3.5. Performance Metrics Model performance was assessed using standard metrics, including sensitivity (recall), precision, specificity, F-score, and accuracy. These metrics were computed for both the initial mitdb test set and the independent afdb validation set to ensure a comprehensive evaluation of the model’s generalization capabilities. The formulas for these metrics are outlined below: Sensitivity = T P T P + F N ; (7) Precision = T P T P + F P ; (8) F-score = 2 × Precision × Sensitivity Precision + Sensitivity , (9) where T P denotes True Positives, F N signifies False Negatives, and F P denotes False Positives. To ensure a comprehensive assessment of the model across all classes, both macro and micro averaging techniques were adopted. Macro-averaging computes the metric for each class independently and then averages the results. This method treats all classes equally, regardless of their frequency: Macro-average = Metric class 1 + Metric class 2 + ⋯ + Metric class N N , where N indicates the number of classes, and Metric can refer to precision, recall, or F-score. In contrast, micro-averaging aggregates the metrics across all classes, resulting in a single average value: Micro-average Precision = T P all classes T P all classes + F P all classes ; (10) Micro-average Recall = T P all classes T P all classes + F N all classes ; (11) Micro-average F-score = 2 × Micro-Precision × Micro-Recall Micro-Precision + Micro-Recall . (12) 4. Results Our study demonstrates significant achievements in beat-wise atrial fibrillation detection from ECG signals through comprehensive validation across multiple datasets. The evaluation began with initial validation using the MIT-BIH Arrhythmia Database (mitdb), followed by independent validation using the MIT-BIH Atrial Fibrillation Database (afdb). To further demonstrate our approach’s adaptability to contemporary data sources, we conducted additional validation using selected segments from the Medical Information Mart for Intensive Care (MIMIC-III) database and the University of Massachusetts Medical Center (UMMC) Simband dataset. While focused in scope, these supplementary tests with MIMIC-III’s more recent clinical data and Simband’s real-world wearable recordings provide valuable insights into our method’s potential application across modern healthcare settings. 4.1. Primary Validation on MIT-BIH Arrhythmia Database Figure 3 illustrates our classification approach, showing identification of AF beats among other arrhythmias ( Figure 3a ) and discrimination between normal beats and PACs ( Figure 3b ). Figure 3: Open in a new tab Visualization of beat-level ECG classification for AF detection among different beat-types of arrhythmias using mitdb. (a) Detection of AF and PVC beats showing true labels (top), model predictions (middle), and wave delineation (bottom). (b) Detection of normal beats and premature atrial contractions using the same subfigure layout. The confusion matrices in Figure 4 shows classification performance progression. Sample-level classification ( Figure 4a ) correctly classified 97.7% of AF samples, with precision and sensitivity of 0.9577 and 0.97651 respectively ( Table 4 ). Figure 4: Open in a new tab Confusion matrices demonstrating the performance progression of ECG classification on mitdb: (a) Sample-level classification showing raw detection accuracy (b) Full-beat analysis-based beat classification results (c) Improved beat classification after applying post-processing (d) Further enhanced beat classification using QRS-focused approach with the post-processing. Table 4: Sample-level classification performance metrics using the mitdb test dataset for five distinct classes: no wave (N/W), normal beat (N), premature atrial contraction (PAC), premature ventricular contraction (PVC), and atrial fibrillation (AF), demonstrating the model’s ability to discriminate between multiple beat types at the individual sample level. Metric N/W N PAC PVC AF Macro AVG Micro AVG True positive 3.3622e+05 9.2252e+05 12369 25971 1.0348e+05 2.8011e+05 2.8011e+05 False positive 16927 21023 155 3098 4570 9154.6 9154.6 False negative 19801 15224 5465 2794 2489 9154.6 9154.6 True negative 1.0734e+06 4.8756e+05 1.4283e+06 1.4145e+06 1.3358e+06 1.1479e+06 1.1479e+06 Precision 0.95207 0.97772 0.98762 0.89343 0.9577 0.95371 0.96835 Sensitivity 0.94438 0.98377 0.69356 0.90287 0.97651 0.90022 0.96835 Specificity 0.98448 0.95866 0.99989 0.99781 0.99659 0.98749 0.99209 Accuracy 0.96835 0.96835 0.96835 0.96835 0.96835 0.96835 0.96835 F-score 0.94821 0.98073 0.81488 0.89812 0.96702 0.92179 0.96835 Open in a new tab Full-beat analysis-based classification further improved performance, with 99.6% of AF beats correctly identified ( Figure 4b ), achieving precision of 0.98264 and sensitivity of 0.99648 ( Table 5 ). The QRS-focused approach maintained comparable metrics ( Table 6 ). Table 5: Initial full-beat analysis-based classification performance metrics using the mitdb test dataset prior to the applying post-processing techniques. Metric N/W N PAC PVC AF Macro AVG Micro AVG True positive 0 4237 72 134 566 1001.8 1001.8 False positive 2 24 0 8 10 8.8 8.8 False negative 0 15 23 4 2 8.8 8.8 True negative 5051 777 4958 4907 4475 4033.6 4033.6 Precision 0 0.99437 1 0.94366 0.98264 0.78413 0.99129 Sensitivity - 0.99647 0.75789 0.97101 0.99648 - 0.99129 Specificity 0.9996 0.97004 1 0.99837 0.99777 0.99316 0.99782 Accuracy 0.99129 0.99129 0.99129 0.99129 0.99129 0.99129 0.99129 F-score - 0.99542 0.86228 0.95714 0.98951 - 0.99129 Open in a new tab Table 6: Beat-level classification performance metrics using QRS region only for the mitdb test dataset prior post-processing. It shows improved classification performance compared to using the entire beat duration. Metric N/W N PAC PVC AF Macro AVG Micro AVG True positive 0 4237 74 135 566 1002.4 1002.4 False positive 1 25 0 7 8 8.2 8.2 False negative 0 15 21 3 2 8.2 8.2 True negative 5052 776 4958 4908 4477 4034.2 4034.2 Precision 0 0.99413 1 0.9507 0.98606 0.78618 0.99189 Sensitivity - 0.99647 0.77895 0.97826 0.99648 - 0.99189 Specificity 0.9998 0.96879 1 0.99858 0.99822 0.99308 0.99797 Accuracy 0.99189 0.99189 0.99189 0.99189 0.99189 0.99189 0.99189 F-score - 0.9953 0.87574 0.96429 0.99124 - 0.99189 Open in a new tab Post-processing maintained strong AF detection while improving PAC detection through relative heart rate analysis ( Figure 4c , Table 7 ). The combination of QRS-region focus with post-processing achieved optimal performance ( Figure 4d ), maintaining AF detection precision at 0.98606 and sensitivity at 0.99648 ( Table 8 ). Table 7: Full-beat analysis-based beat classification performance metrics on the mitdb test dataset after applying post-processing, showing improvements in PAC detection. Metric N/W N PAC PVC AF Macro AVG Micro AVG True positive 0 4234 92 134 566 1005.2 1005.2 False positive 2 3 4 8 10 5.4 5.4 False negative 0 18 3 4 2 5.4 5.4 True negative 5051 798 4954 4907 4475 4037 4037 Precision 0 0.99929 0.95833 0.94366 0.98264 0.77679 0.99466 Sensitivity - 0.99577 0.96842 0.97101 0.99648 - 0.99466 Specificity 0.9996 0.99625 0.99919 0.99837 0.99777 0.99824 0.99866 Accuracy 0.99466 0.99466 0.99466 0.99466 0.99466 0.99466 0.99466 F-score - 0.99753 0.96335 0.95714 0.98951 - 0.99466 Open in a new tab Table 8: Beat-level classification performance metrics using a QRS region-focused approach combined with post-processing on the mitdb test dataset, achieving the highest overall performance. Metric N/W N PAC PVC AF Macro AVG Micro AVG True positive 0 4234 94 135 566 1005.8 1005.8 False positive 1 4 4 7 8 4.8 4.8 False negative 0 18 1 3 2 4.8 4.8 True negative 5052 797 4954 4908 4477 4037.6 4037.6 Precision 0 0.99906 0.95918 0.9507 0.98606 0.779 0.99525 Sensitivity - 0.99577 0.98947 0.97826 0.99648 - 0.99525 Specificity 0.9998 0.99501 0.99919 0.99858 0.99822 0.99816 0.99881 Accuracy 0.99525 0.99525 0.99525 0.99525 0.99525 0.99525 0.99525 F-score - 0.99741 0.97409 0.96429 0.99124 - 0.99525 Open in a new tab This progressive improvement in performance metrics validates the effectiveness of our QRS-centric approach, demonstrating superior results compared to sample-level or full-beat analysis without QRS focus. 4.2. Cross-Database Validation on MIT-BIH Atrial Fibrillation Database We validated generalizability using the independent afdb dataset. Figure 5 demonstrates binary classification between normal and AF beats. Confusion matrices in Figure 6 show progressive improvement from sample-level classification (87.8% AF detection accuracy, Figure 6a ) to beat-wise classification (97.6%, Figure 6b ) and QRS-region focused approach (97.8%, Figure 6c ). For independent testing, the sample-level classification achieved strong AF detection with a precision of 0.94558 and sensitivity of 0.93266, as detailed in Table 9 . The full-beat analysis-based beat classification showed enhanced performance, with AF precision of 0.99514 and sensitivity of 0.97614 ( Table 10 ). The QRS-focused approach further improved these results, achieving AF precision of 0.9949 and sensitivity of 0.97829 ( Table 11 ). Figure 5: Open in a new tab Illustrative example of binary classification for AF detection using an independent afdb dataset. (a) Detection of AF beats showing true labels (top), model predictions (middle), and wave delineation (bottom). (b) Detection of normal beats using the same subfigure layout. Figure 6: Open in a new tab Confusion matrices showing progressive improvement in AF detection performance on independent afdb dataset: (a) Baseline sample-level classification results (b) Enhanced accuracy through full-beat analysis-based beat-wise classification (c) Optimized performance achieved with QRS-region focused approach Table 9: Sample-level classification performance metrics for the fully independent afdb test dataset, demonstrating the generalizability of the model trained on mitdb when applied to a completely different database for three-class classification: N/W, AF, and N. Metric N/W AF N Macro AVG Micro AVG True positive 3.3048e+05 6.3932e+05 4.872e+05 4.8567e+05 4.8567e+05 False positive 1.0066e+05 36796 61305 66255 66255 False negative 84683 46162 67920 66255 66255 True negative 1.1399e+06 9.3349e+05 1.0393e+06 1.0376e+06 1.0376e+06 Precision 0.76652 0.94558 0.88823 0.86678 0.87996 Sensitivity 0.79603 0.93266 0.87765 0.86878 0.87996 Specificity 0.91886 0.96208 0.9443 0.94175 0.93998 Accuracy 0.87996 0.87996 0.87996 0.87996 0.87996 F-score 0.781 0.93907 0.88291 0.86766 0.87996 Open in a new tab Table 10: Full-beat analysis-based beat-level classification performance metrics for the independent afdb test dataset, showing the model’s ability to maintain high performance when classifying beats in fully independent data from a different database recorded. Metric N/W AF N Macro AVG Micro AVG True positive 0 4091 3273 2454.7 2454.7 False positive 24 20 85 43 43 False negative 0 100 29 43 43 True negative 7469 3282 4106 4952.3 4952.3 Precision 0 0.99514 0.97469 0.65661 0.98278 Sensitivity - 0.97614 0.99122 - 0.98278 Specificity 0.9968 0.99394 0.97972 0.99015 0.99139 Accuracy 0.98278 0.98278 0.98278 0.98278 0.98278 F-score - 0.98555 0.98288 - 0.98278 Open in a new tab Table 11: Beat-level classification performance metrics using QRS region focus for the independent afdb test dataset, showing the results of our most refined approach applied to fully independent data, validating the effectiveness of QRS-focused classification across different databases and recording conditions. Metric N/W AF N Macro AVG Micro AVG True positive 0 4100 3281 2460.3 2460.3 False positive 1 21 90 37.333 37.333 False negative 0 91 21 37.333 37.333 True negative 7492 3281 4101 4958 4958 Precision 0 0.9949 0.9733 0.65607 0.98505 Sensitivity - 0.97829 0.99364 - 0.98505 Specificity 0.99987 0.99364 0.97853 0.99068 0.99253 Accuracy 0.98505 0.98505 0.98505 0.98505 0.98505 F-score - 0.98653 0.98337 - 0.98505 Open in a new tab 4.3. Extended Validation Using MIMIC-III and Simband Wearable Datasets We further validated our approach using MIMIC-III and Simband datasets, detecting four beat types: normal sinus rhythm (NSR), atrial fibrillation (AF), premature ventricular contraction (PVC), and premature atrial contraction (PAC). We used MIMIC-III for NSR, AF, and PVC rhythms, and Simband for PAC rhythms. While most rhythms contained predominantly their corresponding beat types, PAC segments included substantial normal beats along with PAC beats. Table 12 summarizes these validation results. Table 12: Detected samples and beats across various cardiac rhythm segments from the MIMIC-III and Simband datasets. Each segment is approximately 30 seconds long. The MIMIC-III dataset, originally sampled at 125 Hz, and the Simband dataset, originally sampled at 128 Hz, were upsampled to 360 Hz to match the trained model. Results are shown as the number of detected samples (S), the number of beats classified by the full-beat analysis-based approach (BF), and the number of beats classified by the QRS-focused approach (BQ) for each rhythm type. N/W sample or beat Normal sample or beat PVC sample or beat PAC sample or beat AF sample or beat Segmented rhythm S BF BQ S BF BQ S BF BQ S BF BQ S BF BQ NSR (MIMIC-III) 2294 0 0 7867 31 31 0 0 0 70 0 0 74 0 0 AF (MIMIC-III) 472 0 0 95 1 1 157 1 1 0 0 0 9418 44 44 PVC (MIMIC-III) 2202 1 0 6872 35 27 774 4 4 251 1 10 272 2 2 PAC (Simband) 2332 0 0 7674 26 26 0 0 0 76 11 11 0 0 0 Open in a new tab The model effectively identified various cardiac rhythms in MIMIC-III segments: 7,867 normal samples (31 beats) in NSR, 9,418 AF samples (44 beats) in AF rhythm, and 9,849 PVC samples (43 beats) in PVC rhythm. For Simband data, the model detected 76 PAC samples, identifying 11 PAC beats and 26 normal beats after post-processing. Figures 7 – 8 illustrate this classification through systematic four-panel visualizations across different rhythm types, demonstrating the progression from wave delineation to final beat classification. A selected Simband dataset segment was specifically used for PAC detection validation. The results indicate that the model detected 76 PAC samples. After post-processing, 11 PAC beats and 26 normal beats were identified. However, since the exact number of PAC and normal beats is unknown, the accuracy of the detection cannot be definitively assessed. This highlights the model’s potential effectiveness in detecting PACs in real-world data from wearable devices, though the exact accuracy cannot be determined without beat-wise ground truth annotations. The following figures demonstrate the beat-wise classification performance of our approach through visual examples. These validations on contemporary datasets confirm our model’s robustness to real-world signal variability. MIMIC-III’s intensive care recordings and Simband’s ambulatory data represent authentic clinical conditions with varied noise levels and signal quality. Figures 7 – 8 illustrate the effectiveness of our classification approach through a systematic four-panel visualization steps, demonstrating its success in identifying four beat classes across various ECG rhythms in the MIMIC-III and Simband datasets. Each figure shows the progression from wave delineation to final beat classification, providing insights into how our system processes and classifies different types of cardiac rhythms. The wave classification panels (top) effectively identify the key ECG components - P-waves, QRS complexes, and T-waves, providing the foundation for subsequent analysis steps. The sample-level classification shown in the second panel reveals the system’s initial decisions at each time point within the cardiac cycles. The final beat-level classification of PACs (shown in the third and fourth panels of Figure 8b ) emerges from the sample-level classifications through our post-processing scheme. This scheme analyzes the relative heart rates of neighboring beats, enabling accurate PAC detection and highlighting the importance of temporal relationship analysis in arrhythmia classification. Across the four rhythm types - NSR ( Figure 7a ), AF ( Figure 7b ), PVC ( Figure 8a ), and PAC ( Figure 8b ) - the system shows consistent classification performance. While both the full-beat analysis and QRS-centric approach show identical performance in these specific examples due to the full-beat analysis already achieving perfect detection, they each effectively capture the distinct characteristics of their respective rhythms: the regular patterns of NSR, the irregular rhythm and absent P-waves in AF, the distinctive wide QRS complexes in PVCs, and the premature beats in PACs This visualization effectively illustrates the robustness of our classification system across different datasets (MIMIC-III and Simband) and its ability to accurately identify various cardiac arrhythmias through both beat-level analysis and post-processing techniques. These validations demonstrate practical clinical applicability. In ICU deployment (MIMIC-III), the system maintains accurate beat-wise classification despite clinical interventions, patient movement, and varying signal quality typical in intensive care. For ambulatory monitoring (Simband), reliable detection continues even with lower sampling rates and signal variations inherent to wearable devices. This performance across different clinical environments, from continuous ICU monitoring to outpatient wearable recording, validates the system’s effectiveness in real-world scenarios. The model achieves consistent performance across these diverse datasets, with both full-beat analysis and QRS-focused approaches maintaining high detection accuracy. While PAC detection performance lacks ground truth validation due to annotation limitations in ambulatory recordings, the system demonstrates robust AF, NSR, and PVC detection across clinical and outpatient settings. Our approach obtained exceptional performance in beat-wise AF detection, demonstrating robust results across both initial and independent validation. The QRS-focused strategy proved particularly effective, achieving F-scores of 0.99124 and 0.98653 for AF detection in the mitdb and afdb datasets, respectively. The high precision and sensitivity values across these datasets demonstrate the approach’s reliability and generalizability for clinical applications. Furthermore, the additional validation using the MIMIC-III and Simband datasets confirms the robustness of our model. Despite the lower original sampling frequencies, the upsampled data maintained high detection accuracy. The model effectively identified various beat types in cardiac rhythms, including NSR, AF, PVC, and PAC, in the MIMIC-III and the Simband datasets. These results further validate the model’s applicability to diverse and real-world clinical data, reinforcing its potential for widespread clinical use. 5. Discussion Table 13 compares our method against existing approaches, demonstrating exceptional performance across multiple metrics in both initial and independent testing. The architectural parameters in Table 3 contribute significantly to these outcomes. Bootstrap analysis (5000 iterations) on both datasets generated 95% confidence intervals shown in Table 13 . Our method achieved statistically significant improvements in most metrics including F-score (p < 0.0002) compared to reference methods. While precision improvement alone approached but did not reach significance (p = 0.321), the significant F-score improvement confirms our QRS-centric approach’s superior overall performance. Table 13: Performance comparison of the proposed and existing methods for atrial fibrillation detection. The proposed method is evaluated both on the MIT-BIH Arrhythmia Database (mitdb) and independently tested on the MIT-BIH Atrial Fibrillation Database (afdb). Dashes indicate metrics not reported in the original studies. Numbers in parentheses indicate 95% confidence intervals obtained via bootstrapping. Reference Sensitivity (Recall) Precision (PPV) Specificity F-score Accuracy Ghosh (2020) [ 18 ] 0.9877 - 1 - 0.9940 Chen (2020) [ 5 ] 0.9330 - - 0.9330 0.9830 Hannun (2019) [ 19 ] - - - 0.831 - Fujita (2019) [ 20 ] 0.9943 0.9874 0.9607 - 0.9861 Wang (2020) [ 21 ] 0.9790 - 0.9710 - 0.9740 Mousavi (2019) [ 10 ] 0.9953 - 0.9926 - 0.9940 Cai (2020) [ 11 ] 0.9919 - 0.9944 - 0.9935 Ribeiro (2020) [ 33 ] 0.769 1 1 0.8700 - Che (2021) [ 12 ] - - - 0.8580 - Hong (2022) [ 13 ] 0.98 0.86 0.89 0.92 0.9680 Li (2023) [ 22 ] 0.98 - - 0.92 - Ben (2024) [ 23 ] - - - 0.91–0.94 - Zhou (2024) [ 24 ] 0.98 - - 0.95 - Our approach, mitdb 0.99648 0.98606 0.99822 0.99124 0.99525 95% CI (0.9910–1.0000) (0.9759–0.9948) (0.9969–0.9993) (0.9856–0.9963) (0.9966–0.9992) Our approach, afdb 0.97829 0.9949 0.99364 0.98653 0.98505 95% CI (0.9739–0.9824) (0.9927–0.9969) (0.9909–0.9961) (0.9840–0.9889) (0.9823–0.9876) p-value 0.321 < 0.0002 < 0.0002 < 0.0002 < 0.0002 Open in a new tab While the numerical performance improvements over existing methods may appear incremental, their clinical significance stems from our beat-wise detection capability and comprehensive validation across all standard metrics. Unlike some previous methods that report only sensitivity while omitting precision and F-score (where high sensitivity alone can be achieved despite low precision), our approach demonstrates superior results across all performance measures. More importantly, our beat-wise detection enables immediate arrhythmia identification at the individual beat level, compared to rhythm-based approaches requiring extended monitoring periods. This granular detection, combined with consistent performance across diverse clinical scenarios and ambulatory settings, provides crucial advantages for timely intervention. These improvements become particularly meaningful in continuous monitoring applications where early detection can significantly impact patient outcomes. In mitdb testing, our approach achieved 0.99648 sensitivity, 0.98606 precision, 0.99822 specificity, and 0.99124 F-score (0.99525 accuracy), surpassing most existing methods in balanced performance across metrics. While Mousavi et al., 2019 [ 10 ] reported slightly higher sensitivity (0.9953), our method’s superior precision and specificity stem from the optimized network parameters and QRS-centric feature extraction strategy. More significantly, our method maintains strong performance on the fully independent afdb dataset, achieving a sensitivity of 0.97829, precision of 0.9949, specificity of 0.99364, and an F-score of 0.98653. This consistency across datasets validates our architectural choices, particularly the progressive filter size expansion and bidirectional temporal processing detailed in Table 3 . The robust performance on independent data demonstrates the effectiveness of our parameter selection and training strategy. A key advantage lies in our beat-wise classification approach, which presents greater challenges than rhythm-based classification. While beat-wise methods analyze individual beats over shorter timeframes, rhythm-based approaches benefit from longer temporal windows. Despite these challenges, our method outperforms several rhythm-based and multi-beat approaches, including Chen et al., 2020 [ 5 ], Cai et al., 2020, [ 11 ], and Che et al., 2021 [ 12 ]. This superior performance derives from our carefully tuned network parameters, including the adaptive learning rate schedule and optimized convolutional filter progression, enabling precise feature extraction at the beat level. It is important to note that our model achieves these performance improvements with reasonable computational complexity. While some approaches like Hong et al. [ 13 ] may use simpler architectures, they achieve lower performance (F-score of 0.92 versus our 0.99124). Conversely, more complex approaches like transformer-based models [ 12 ] require 2–3 times more parameters but achieve lower performance (F-score of 0.85). Our architecture strikes an optimal balance between performance and complexity, with approximately 580K parameters compared to 1.2–1.8M in transformer models. This efficiency is particularly valuable for real-time monitoring applications, where both detection accuracy and computational resources are critical considerations. The statistical significance of our performance improvements (p < 0.0002 for F-score) further justifies this architectural complexity, as it translates to meaningful clinical benefits through more reliable beat-level detection. The effectiveness of our architectural choices is further validated by performance on contemporary datasets. Results from MIMIC-III and Simband testing demonstrate robust generalization across different recording conditions and sampling rates, confirming that our parameter selections maintain effectiveness across diverse clinical scenarios. 5.1. Limitations and Future Directions: Despite strong performance, our approach has limitations. The reliance on accurate QRS detection and adaptive segmentation presents challenges with severely noisy ECG signals. Though sample-level classification functions without accurate QRS detection, the computational overhead from QRS-focused processing requires optimization for clinical deployment. ECG lead specificity presents another critical limitation. Trained on Modified Lead II signals, our model faces challenges with different lead configurations. While temporal characteristics remain consistent, morphological features vary significantly between leads - normal patterns in one lead may resemble pathological patterns in another. This challenge emerged during validation with afdb, where lead specifications varied or were undocumented. The scarcity of well-organized, lead-specified datasets impedes development of universally applicable models, reflecting broader ECG data standardization issues. Our use of 1D ECG signals, rather than images or time-frequency spectrograms, maintains low computational complexity, facilitating deployment in resource-constrained clinical settings. Though comprehensive, our datasets may not fully capture demographic and signal quality diversity in real-world settings. Expanding validation to more heterogeneous datasets would strengthen generalizability. For low-resource environments with significant artifacts, preprocessing techniques like autoencoder-based denoising may maintain performance. Our previously developed approaches (Jajeb et al., 2022 [ 31 ]; Nejad et al., 2024 [ 32 ]) could address severe motion artifacts. Despite strong performance on contemporary datasets using only mitdb training, targeted retraining or transfer learning could optimize performance for specific devices. This adaptability represents an important direction for future validation with emerging monitoring technologies. Future work should focus on three key areas: developing noise-robust preprocessing techniques, implementing lead-invariant feature extraction methods, and establishing standardized protocols for ECG signal classification. Particularly important is the standardization of lead specification documentation in ECG datasets, which would enable more reliable development and validation of classification systems. Additionally, exploring explainable AI techniques could enhance the model’s clinical acceptance by providing transparency in its decision-making process. 6. Conclusion We developed a QRS-centric deep learning approach for beat-wise AF detection, achieving state-of-the-art performance (99.648% sensitivity, 98.606% precision, 99.822% specificity, 99.124% F-score). By integrating convolutional layers for feature extraction with BiLSTM layers for temporal dependencies, our method maintained consistently high performance across standard and independent testing. Beat-wise detection represents a significant advancement over rhythm-based methods, enabling earlier and more precise AF diagnosis. The relative heart rate analysis also improved PAC detection, creating a comprehensive arrhythmia detection system. The approach’s strong performance and generalizability suggest potential for integration into existing monitoring systems, particularly for remote and continuous applications. Despite additional computational requirements, the improved accuracy and granularity provide substantial clinical benefits, marking a significant advancement in automated ECG analysis with strong real-world applicability. Key Innovations: Adaptive segmentation: Our model employs adaptive segmentation techniques to dynamically adjust to varying heart rates and signal characteristics, ensuring robust performance across diverse patient populations. QRS-centric analysis: By focusing specifically on the QRS complex, our method enhances the precision of AF detection at the single-beat level, which is crucial for early and accurate diagnosis. Broader Impact on Clinical Applications: Enhanced diagnostic accuracy: Our model achieves F-scores of 99.124% (MIT-BIH Arrhythmia Database) and 98.653% (independent datasets), ensuring reliable AF detection with reduced false positives and negatives. Generalizability: Strong performance across MIMIC-III and Simband datasets demonstrates robustness and applicability to real-world clinical data. Early intervention: Beat-wise classification enables timelier clinical interventions, potentially improving patient outcomes through prompt AF treatment. Clinical integration: The model’s design facilitates integration with wearable devices and portable ECG monitors, enabling continuous monitoring for at-risk patients. Our approach provides granular AF detection with high precision and sensitivity, enhancing both technical performance and clinical applicability. This work not only advances the state-of-the-art in automated ECG analysis but also paves the way for the development of real-world diagnostic tools that can significantly improve patient care. Highlights: QRS-centric deep learning enables immediate detection of atrial fibrillation at beat level Adaptive segmentation adjusts to varying heart rates, ensuring robust feature extraction CNN-BiLSTM architecture achieves 99.1% F-score on primary database, 98.7% on independent tests Validated across clinical and ambulatory settings using modern healthcare monitoring datasets Footnotes Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain. Ethical and Clinical Considerations: Deploying AI-powered diagnostic tools like our system presents ethical and regulatory challenges. Key considerations include patient data privacy protection and regulatory approval processes. Model outputs require qualified medical professional oversight rather than standalone use. Rigorous validation across diverse populations is necessary to mitigate biases and demonstrate safety before widespread adoption. Ongoing monitoring and refinement in real-world settings will maintain ethical standards and patient trust. CONFLICT OF INTEREST The authors ensure that there is no potential conflict of interest possibly influencing the interpretation of data in the paper. The authors declare that there is no competing financial interest or personal relationship that could have appeared to influence the work reported in this paper. Ethics Statement We affirm that this manuscript is an original work and has not been published elsewhere, nor is it under consideration for publication elsewhere. All authors have significantly contributed to the research and preparation of this manuscript, and their contributions are clearly stated. We have adhered to ethical guidelines throughout the research process, including obtaining necessary approvals from relevant institutional review boards and ensuring informed consent from all participants. Any potential conflicts of interest have been disclosed, and all sources of funding have been acknowledged. We have ensured the accuracy and integrity of the data presented in this manuscript. Any errors discovered post-publication will be promptly reported to the journal editor, and appropriate corrections will be made. We appreciate the opportunity to submit our work to [Journal Name] and are committed to upholding the highest standards of ethical conduct in our research and publication practices. 1 Part of this work has been presented at ICBEA 2025, and this paper significantly expands upon the work presented at the conference, providing more comprehensive research and findings. References [1]. January CT, Wann LS, Alpert JS, Calkins H, Cigarroa JE, Cleveland JC, Conti JB, Ellinor PT, Ezekowitz MD, Field ME, et al. , 2014 aha/acc/hrs guideline for the management of patients with atrial fibrillation: a report of the american college of cardiology/american heart association task force on practice guidelines and the heart rhythm society, Journal of the American College of Cardiology 64 (21) (2014) e1–e76. [ DOI ] [ PubMed ] [ Google Scholar ] [2]. Joglar JA, Chung MK, Armbruster AL, Benjamin EJ, Chyou JY, Cronin EM, Deswal A, Eckhardt LL, Goldberger ZD, Gopinathannair R, et al. , 2023 acc/aha/accp/hrs guideline for the diagnosis and management of atrial fibrillation: a report of the american college of cardiology/american heart association joint committee on clinical practice guidelines, Circulation 149 (1) (2024) e1–e156. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [3]. Ahmed N, Zhu Y, Early detection of atrial fibrillation based on ecg signals, Bioengineering 7 (1) (2020) 16. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [4]. Ramkumar S, Nerlekar N, D’Souza D, Pol DJ, Kalman JM, Marwick TH, Atrial fibrillation detection using single lead portable electro-cardiographic monitoring: a systematic review and meta-analysis, BMJ open 8 (9) (2018) e024178. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [5]. Chen T-M, Huang C-H, Shih ES, Hu Y-F, Hwang M-J, Detection and classification of cardiac arrhythmias by a challenge-best deep learning neural network model, Iscience 23 (3) (2020). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [6]. Hagiwara Y, Fujita H, Oh SL, Tan JH, San Tan R, Ciaccio EJ, Acharya UR, Computer-aided diagnosis of atrial fibrillation based on ecg signals: A review, Information Sciences 467 (2018) 99–114. [ Google Scholar ] [7]. Attia ZI, Noseworthy PA, Lopez-Jimenez F, Asirvatham SJ, Deshmukh AJ, Gersh BJ, Carter RE, Yao X, Rabinstein AA, Erickson BJ, et al. , An artificial intelligence-enabled ecg algorithm for the identification of patients with atrial fibrillation during sinus rhythm: a retrospective analysis of outcome prediction, The Lancet 394 (10201) (2019) 861–867. [ DOI ] [ PubMed ] [ Google Scholar ] [8]. Siontis KC, Noseworthy PA, Attia ZI, Friedman PA, Artificial intelligence-enhanced electrocardiography in cardiovascular disease management, Nature Reviews Cardiology 18 (7) (2021) 465–478. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [9]. Andersen RS, Peimankar A, Puthusserypady S, A deep learning approach for real-time detection of atrial fibrillation, Expert Systems with Applications 115 (2019) 465–473. [ Google Scholar ] [10]. Mousavi S, Afghah F, Razi A, Acharya UR, ECGNET: Learning where to attend for detection of atrial fibrillation with deep visual attention, in: 2019. IEEE EMBS International Conference on Biomedical & Health Informatics (BHI), IEEE, 2019, pp. 1–4. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [11]. Cai W, Chen Y, Guo J, Han B, Shi Y, Ji L, Wang J, Zhang G, Luo J, Accurate detection of atrial fibrillation from 12-lead ECG using deep neural network, Computers in biology and medicine 116 (2020) 103378. [ DOI ] [ PubMed ] [ Google Scholar ] [12]. Che C, Zhang P, Zhu M, Qu Y, Jin B, Constrained transformer network for ECG signal processing and arrhythmia classification, BMC Medical Informatics and Decision Making 21 (1) (2021) 184. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [13]. Hong J, Li H-J, Yang C.-c., Han C-L, Hsieh J.-c., A clinical study on atrial fibrillation, premature ventricular contraction, and premature atrial contraction screening based on an ECG deep learning model, Applied Soft Computing 126 (2022) 109213. [ Google Scholar ] [14]. Lim J, Han D, Nejad MPS, Chon KH, ECG classification via integration of adaptive beat segmentation and relative heart rate with deep learning networks, Computers in Biology and Medicine 181 (2024) 109062. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [15]. Sellami A, Hwang H, A robust deep convolutional neural network with batch-weighted loss for heartbeat classification, Expert Systems with Applications 122 (2019) 75–84. [ Google Scholar ] [16]. Islam MS, Hasan KF, Sultana S, Uddin S, Quinn JM, Moni MA, et al. , Hardc: A novel ECG-based heartbeat classification method to detect arrhythmia using hierarchical attention based dual structured rnn with dilated cnn, Neural Networks 162 (2023) 271–287. [ DOI ] [ PubMed ] [ Google Scholar ] [17]. Xu Y, Liu L, Zhang S, Xiao W, Multilayer extreme learning machine-based unsupervised deep feature representation for heartbeat classification, Soft Computing 27 (17) (2023) 12353–12366. [ Google Scholar ] [18]. Ghosh SK, Tripathy RK, Paternina MR, Arrieta JJ, Zamora-Mendez A, Naik GR, Detection of atrial fibrillation from single lead ECG signal using multirate cosine filter bank and deep neural network, Journal of medical systems 44 (2020) 1–15. [ DOI ] [ PubMed ] [ Google Scholar ] [19]. Hannun AY, Rajpurkar P, Haghpanahi M, Tison GH, Bourn C, Turakhia MP, Ng AY, Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network, Nature medicine 25 (1) (2019) 65–69. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [20]. Fujita H, Cimr D, Computer aided detection for fibrillations and flutters using deep convolutional neural network, Information Sciences 486 (2019) 231–239. [ Google Scholar ] [21]. Wang J, A deep learning approach for atrial fibrillation signals classification based on convolutional and modified elman neural network, Future Generation Computer Systems 102 (2020) 670–679. [ Google Scholar ] [22]. Li X, Cai W, Xu B, Jiang Y, Qi M, Wang M, SEResUTer: a deep learning approach for accurate ECG signal delineation and atrial fibrillation detection, Physiological Measurement 44 (12) (2023) 125005. [ DOI ] [ PubMed ] [ Google Scholar ] [23]. Ben-Moshe N, Tsutsui K, Biton S, Zvuloni E, Sörnmo L, Behar JA, RawECGNet: Deep learning generalization for atrial fibrillation detection from the raw ECG, IEEE Journal of Biomedical and Health Informatics 28 (1) (2024) 183–194. [ DOI ] [ PubMed ] [ Google Scholar ] [24]. Zhou X, Zhang J, Li H, Liang L, Fu X, mRMEBP: a unified framework for online detection of atrial fibrillation utilizing deep learning, npj Biomedical Innovations 1 (1) (2024) 1–12. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [25]. Oh SL, Ng EY, San Tan R, Acharya UR, Automated diagnosis of arrhythmia using combination of cnn and lstm techniques with variable length heart beats, Computers in biology and medicine 102 (2018) 278– 287. [ DOI ] [ PubMed ] [ Google Scholar ] [26]. Yildirim O, Baloglu UB, Tan R-S, Ciaccio EJ, Acharya UR, A new approach for arrhythmia classification using deep coded features and lstm networks, Computer methods and programs in biomedicine 176 (2019) 121–133. [ DOI ] [ PubMed ] [ Google Scholar ] [27]. Zubair M, Woo S, Lim S, Kim D, Deep representation learning with sample generation and augmented attention module for imbalanced ECG classification, IEEE Journal of Biomedical and Health Informatics (2023). [ DOI ] [ PubMed ] [ Google Scholar ] [28]. Tao Y, Xu B, Zhang Y, Refined self-attention transformer model for ECG-based arrhythmia detection, IEEE Transactions on Instrumentation and Measurement (2024). [ Google Scholar ] [29]. Johnson AE, Pollard TJ, Shen L, Lehman L.-w. H., Feng M, Ghassemi M, Moody B, Szolovits P, Anthony Celi L, Mark RG, Mimic-iii, a freely accessible critical care database, Scientific data 3 (1) (2016) 1–9. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [30]. Han D, Bashar SK, Mohagheghian F, Ding E, Whitcomb C, McManus DD, Chon KH, Premature atrial and ventricular contraction detection using photoplethysmographic data from a smartwatch, Sensors 20 (19) (2020) 5683. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] [31]. Hajeb-M S, Cascella A, Valentine M, Chon KH, Enhancing the accuracy of shock advisory algorithms in automated external defibrillators during ongoing cardiopulmonary resuscitation using a deep convolutional encoder-decoder filtering model, Expert Systems with Applications 203 (2022) 117499. [ Google Scholar ] [32]. Nejad MPS, Kargink V, Hajeb-M S, Hicks D, Valentine M, Chon KH, Enhancing the accuracy of shock advisory algorithms in automated external defibrillators during ongoing cardiopulmonary resuscitation using a cascade of CNNEDs, Computers in Biology and Medicine 172 (2024) 108180. [ DOI ] [ PubMed ] [ Google Scholar ] [33]. Ribeiro AH, Ribeiro MH, Paixão GM, Oliveira DM, Gomes PR, Canazart JA, Ferreira MP, Andersson CR, Macfarlane PW, Meira W Jr, et al. , Automatic diagnosis of the 12-lead ECG using a deep neural network, Nature communications 11 (1) (2020) 1760. [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] ACTIONS View on publisher site PDF (2.1 MB) Cite Collections Permalink RESOURCES Similar articles Cited by other articles Links to NCBI Databases Follow NCBI NCBI on X (formerly known as Twitter) NCBI on Facebook NCBI on LinkedIn NCBI on GitHub NCBI RSS feed Connect with NLM NLM on X (formerly known as Twitter) NLM on Facebook NLM on YouTube National Library of Medicine 8600 Rockville Pike Bethesda, MD 20894 Web Policies FOIA HHS Vulnerability Disclosure Help Accessibility Careers NLM NIH HHS USA.gov Back to Top

Related documents

Record · ID 247641 · SHA-256 00a8be92fe352c3a
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive