A Fast, Lightweight, and Generalizable Deep Neural Network for the Detection of Atrial Fibrillation

preprint OA: closed
📄 Open PDF Full text JSON View at publisher
AI-generated deep summary by claude@2026-07, 2026-07-03 · read from full text

This paper develops a fast, lightweight convolutional deep neural network for atrial fibrillation (AFib) detection, trained on 67,432 resampled and normalized 12-lead ECGs from the HDXML dataset and externally validated on over 1.1 million ECG recordings across six independent public datasets (including MIMIC-IV). The model (17 million parameters) uses channel-masking plus channel attention/dual-path fusion so the same weights can process variable lead configurations, and it achieves AUROC 0.97 with average sensitivity 0.83 and specificity 0.96 across cohorts; it also reports real-time feasibility on CPU (200 ms per 10-second ECG). The authors emphasize a key caveat/limitation of reliance on a modest but curated training set and the need to harmonize labels and data formats across heterogeneous datasets. This paper does not explicitly discuss endometriosis or adenomyosis; it was included in the corpus via a keyword match in the upstream search index.

Read from the paper's body, not the abstract. Not a substitute for reading the paper. No clinical advice. How this works

Abstract

Atrial fibrillation (AFib) represents a critical diagnostic challenge in clinical cardiology, calling for automated detection systems capable of robust performance across diverse clinical environments. We present a computationally efficient deep neural network architecture for AFib detection that demonstrates exceptional generalizability despite training on a modest dataset. Our convolutional neural network, comprising 17 million parameters, was trained on 67,432 12-lead electrocardiograms and subsequently validated on over 1.1 million ECG recordings spanning six independent public datasets. On CPU, the model processes a 10-second ECG in 200 ms, enabling real-time inference capabilities. Our model achieves state-of-the-art performance, with an average area under the receiver operating characteristic curve (AUROC) of 0.97, an average sensitivity of 0.83, and an average specificity of 0.96 across six external validation cohorts. These metrics rank among the highest reported in the literature, while preserving computational efficiency suitable for resource-constrained environments. A key innovation of our approach is the implementation of channel-masking methodology, enabling seamless operation across variable lead configurations without model retraining. This flexibility allows deployment from single-lead ambulatory monitors to comprehensive 12-lead clinical systems using identical network weights. Gradient-based saliency analysis confirms the model’s attention to physiologically relevant features, particularly P-wave morphology and lead II characteristics, thereby enhancing clinical interpretability and trustworthiness. Our findings also establish that a single, well-curated small training dataset can yield a compact yet highly generalizable AFib detection system suitable for deployment across diverse clinical settings, from critical care monitoring to ambulatory screening applications. The combination of robust cross-dataset performance, computational efficiency, and clinical interpretability positions this approach as a viable solution for largescale AFib diagnosis and monitoring programs.
Full text 46,022 characters · extracted from preprint-html · click to expand
A Fast, Lightweight, and Generalizable Deep Neural Network for the Detection of Atrial Fibrillation | medRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-P4HH5NV'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search A Fast, Lightweight, and Generalizable Deep Neural Network for the Detection of Atrial Fibrillation View ORCID Profile Harshit Mishra , View ORCID Profile Farhan Adam Mukadam , View ORCID Profile Nachiket Makwana , Pradyot Tiwari , K. Subramani , View ORCID Profile K. V. S. Hari doi: https://doi.org/10.1101/2025.11.13.25340129 Harshit Mishra a Gauze , India Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Harshit Mishra Farhan Adam Mukadam b Department of Electrical Communication Engineering, Indian Institute of Science , Bangalore, India Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Farhan Adam Mukadam For correspondence: farhanm{at}iisc.ac.in Nachiket Makwana a Gauze , India Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Nachiket Makwana Pradyot Tiwari c Interventional Cardiology Department, Waikato District Health Board , Hamilton, New Zealand Find this author on Google Scholar Find this author on PubMed Search for this author on this site K. Subramani d Critical Care Division, Christian Medical College , Vellore, India Find this author on Google Scholar Find this author on PubMed Search for this author on this site K. V. S. Hari b Department of Electrical Communication Engineering, Indian Institute of Science , Bangalore, India Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for K. V. S. Hari Abstract Full Text Info/History Metrics Data/Code Preview PDF Abstract Atrial fibrillation (AFib) represents a critical diagnostic challenge in clinical cardiology, calling for automated detection systems capable of robust performance across diverse clinical environments. We present a computationally efficient deep neural network architecture for AFib detection that demonstrates exceptional generalizability despite training on a modest dataset. Our convolutional neural network, comprising 17 million parameters, was trained on 67,432 12-lead electrocardiograms and subsequently validated on over 1.1 million ECG recordings spanning six independent public datasets. On CPU, the model processes a 10-second ECG in 200 ms, enabling real-time inference capabilities. Our model achieves state-of-the-art performance, with an average area under the receiver operating characteristic curve (AUROC) of 0.97, an average sensitivity of 0.83, and an average specificity of 0.96 across six external validation cohorts. These metrics rank among the highest reported in the literature, while preserving computational efficiency suitable for resource-constrained environments. A key innovation of our approach is the implementation of channel-masking methodology, enabling seamless operation across variable lead configurations without model retraining. This flexibility allows deployment from single-lead ambulatory monitors to comprehensive 12-lead clinical systems using identical network weights. Gradient-based saliency analysis confirms the model’s attention to physiologically relevant features, particularly P-wave morphology and lead II characteristics, thereby enhancing clinical interpretability and trustworthiness. Our findings also establish that a single, well-curated small training dataset can yield a compact yet highly generalizable AFib detection system suitable for deployment across diverse clinical settings, from critical care monitoring to ambulatory screening applications. The combination of robust cross-dataset performance, computational efficiency, and clinical interpretability positions this approach as a viable solution for largescale AFib diagnosis and monitoring programs. 1. Introduction Atrial fibrillation (AFib) is the most common sustained cardiac arrhythmia. Global prevalence already exceeds 33.5 million persons and is projected to reach 17.9 million in Europe and 12.1 million in the USA by 2030 [ 1 , 2 ]. Each year AFib accounts for nearly 454,000 US hospitalizations and 158,000 deaths, and adds up to $26 billion to direct health-care spending [ 4 , 3 ]. In critical care environments the problem is magnified: new-onset AFib occurs in 5–15% of intensive-care admissions and independently raises 30-day mortality by 40–60% [ 5 , 6 ]. AFib also confers a five-fold stroke risk, triples heart-failure incidence, and doubles all-cause mortality [ 7 ]. Contemporary guidelines therefore emphasize early rhythm identification to guide anticoagulation and rhythm control strategies [ 8 , 9 ]. Yet manual ECG interpretation is resource intensive and error prone, motivating research into fully automated detectors deployable at the bedside or on wearables. Evolution of automated AFib detection First-generation algorithms exploited heart rate variability: Tateno & Glass [ 10 ] achieved 94.4% sensitivity and 97.2% specificity from RR-interval histograms, while Dash et al . combined time- and frequency-domain descriptors to surpass 98% accuracy [ 11 ] on their internal test sets. Subsequent hand-crafted entropy measures [ 12 ] improved robustness but required expert-driven feature engineering. All these handcrafted approaches required extensive domain expertise for feature engineering and were prone to failure under adverse or unseen conditions Deep-learning era Rajpurkar et al . framed arrhythmia detection as a sequence-to-sequence task and ran raw, single-lead ECG through a 34-layer 1-D ResNet—16 [ 13 ]. Attia et al .’s “AI-ECG” preserves the purely convolutional philosophy but adapts it to 12 leads: stacked 1-D convolutional layers with progressively wider receptive fields [ 14 ]. Ribeiro et al . port the 2-D image ResNet to one-dimensional signals for multi-label diagnosis on 12-lead input—residual that outputs six common abnormalities [ 15 ]. Moving beyond pure CNNs, Natarajan et al .’s “wide-and-deep Transformer” first embeds the waveform with a small convolutional front-end, adds positional encodings, then passes the sequence through an eight-layer Transformer encoder (multi-head self-attention, d = 256) whose output is concatenated with 22 handcrafted “wide” ECG features before the final classifier [ 17 ]. However,most studies are evaluated on a single site; true cross-cohort generalization and deployability remain open challenges. Our contribution We present a lightweight and fast 17M-parameter CNN, trained on a small but carefully curated HDXML corpus—specifically, the Heart Disease HDXML Strain dataset by Tse et al. [ 18 ]—comprising 67,432 12-lead ECGs. We externally validated on more than 1.1 million ECGs across six public datasets including MIMIC-IV critical-care recordings. Built-in channel attention and dual-path fusion permit identical weights to process anything from a single-lead wearable trace to a full 12-lead ECG, meeting the practical needs of both outpatient monitors and ICU telemetry systems. 2. Methodology 2.1. Dataset Preparation We pooled eight open-access 12-lead ECG datasets totaling 1.37 million tracings (see Table 1 ): HDXML [ 18 ] (hereafter referred to as HDXML), CODE-15 [ 19 ], Chapman–Shaoxing [ 20 ], Chapman-10k [ 21 ], MedalCare-XL [ 22 ], PhysioNet 2020 (Offline-TS) [ 23 ], PhysioNet CinC 2021 [ 24 ], and the MIMIC-IV ECG dataset [ 25 ]. Each dataset is loaded by a dedicated dataloader that harmonizes file formats and maps native rhythm labels to our binary AFib/non-AFib schema. All signals, regardless of origin, were processed as follows: View this table: View inline View popup Download powerpoint Table 1: Sample distribution across all datasets (AFib vs Non-AFib) Resampling – all recordings were resampled (or kept) at 500 Hz. Min–max normalisation – each lead was linearly scaled to the range [−1, 1]. Fixed-length framing – signals were zero-padded or truncated to 5000 samples (10 s) to enable mini-batch training. Augmentations (training splits only): A single stochastic transformation was sampled per mini-batch from the list below; all augmentations preserve class membership. Temporal transforms: random circular phase shift; variable-length leading/trailing zero shifts. Morphological noise: baseline drift (linear), baseline wander (low-frequency sinusoids), EMG-like muscle artefacts (20–100 Hz band-passed Gaussian noise). Channel manipulations: accidental lead reversal, random lead swapping, electrode contact artefacts (spikes, drop-outs, steps, jitter). Spectral smoothing: FFT low-pass ( f c = 40 Hz, Hann transition) to simulate analogue antialias filtering. Spatial masking: per-sample binary lead mask to mimic missing channels (used later by the interpretability head). All transformations were implemented on-the-fly to avoid duplicating data on disk and were disabled for validation, internal testing, and all external evaluations. 2.2. Model Architecture We developed a deep learning architecture for automated Atrial Fibrillation (AFib) detection from 12-lead ECG signals. The architecture leverages the power of convolutional neural networks (CNNs) to extract and analyze temporal and spatial features from ECG signals. The proposed ECG classification model consists of three main blocks: Feature Extraction Network, Dense Feature Extraction, and Classification Head. Each block is designed to progressively extract and refine the features of the raw ECG signals for accurate binary classification, as illustrated in Figure 1 . Download figure Open in new tab Figure 1: Overall model architecture showing the three main components: embedding network, feature extraction network, and classification head for AFib detection from 12-lead ECG signals. 2.2.1. Feature Extraction Network The feature extraction network serves as the primary feature learning component, transforming raw ECG signals into rich, multi-scale representations through two complementary sub-modules: Embedding Network and Multi-Scale Feature Fusion. Embedding Network The embedding network transforms raw ECG signals into compact feature representations. Once the 12×5000 signal is loaded, an initial 1-D convolution with 7×7 kernel, stride 2, and padding 3 is applied to generate a 512×2500 dimensional output. This is followed by batch normalization and ReLU activation to ensure stable training and introduce non-linearity for effective feature extraction. An average pooling layer with 3×3 kernel size, stride 2, and padding 1 then downsamples the output to 512×1250 dimensions. The core component is the dual path block, which enhances feature extraction through a custom neural network comprising three parts: 1) A residual path, 2) A dense connection path, and 3) Squeeze and Excitation Mechanism. The residual path consists of two stacked convolutional layers with large receptive fields using 15×15 convolutional kernels, enabling capture of long-range temporal dependencies. The dense connection path utilizes 1×1 convolutions for efficient feature transformations. The Squeeze-and-Excitation (SE) block operates as a channel-wise attention mechanism designed to enhance the representational power of convolutional neural networks by adaptively recalibrating channel-wise feature responses. The SE block seamlessly integrates with existing architectures and improves feature selectivity and overall network efficiency through adaptive channel weighting. Multi-Scale Feature Fusion The multi-scale feature fusion module captures contextual information at different granularities within the ECG signal processing pipeline. The module utilizes three distinct parallel convolutional branches with kernel sizes of 1×1, 3×3, and 5×5, each applied to the input feature maps. These convolutions capture different levels of feature granularity: the 1×1 convolution captures point-wise information and cross-channel interactions, the 3×3 convolution captures local contextual features and short-term temporal patterns, and the 5×5 convolution extracts broader contextual patterns and longer-term temporal dependencies. The outputs are concatenated and processed through a squeeze-and-excitation mechanism before being fused back to the original channel dimension with a residual connection. 2.2.2. Dense Feature Extraction The dense feature extraction block refines and transforms the multi-scale features from the feature extraction network through two sequential processing stages. Convolution After the initial feature extraction, the dense feature extraction process begins with a sequence of convolutional layers aimed at progressively refining and transforming the initial embeddings. The process starts with batch normalization applied to the embeddings, followed by a series of convolutional layers: Initial 1×1 convolutional layer reduces the dimensionality to 512 channels Two sequential 3×3 convolutional layers with padding capture local temporal patterns Batch normalization and ReLU activation are applied after each convolution Final batch normalization ensures stable feature distributions Global Context Extraction The global context extraction module transforms the refined convolutional features into a compact global representation. A 1×1 convolution reduces the feature dimensionality to 256 channels, followed by batch normalization and ReLU activation. A squeeze-and-excitation block is then applied for final feature refinement and adaptive channel weighting. This stage prepares the features for the final classification by capturing global temporal patterns and contextual information across the entire ECG sequence. 2.2.3. Classification Head The classification head transforms the global context features into binary classification outputs through a multi-layer neural network architecture. The process begins with adaptive average pooling that converts the temporal features into a fixed-size representation regardless of input sequence length. The multi-layer classifier consists of three sequential linear transformations: First linear layer projects the input features to 256 dimensions, followed by batch normalization and ReLU activation Dropout layer with rate 0.4 provides regularization to prevent overfitting Second linear layer reduces dimensionality to 128 features, followed by batch normalization, ReLU activation, and dropout with rate 0.3 Final linear layer outputs a single logit for binary classification The entire architecture is trained end-to-end using binary cross entropy loss with class weighting to handle potential class imbalance in ECG rhythm classification tasks. 2.3. Training Pipeline 2.3.1. Optimization Strategy The model had random weight initialization and was trained using the AdamW optimizer with differential learning rates applied to various model components. The embedding network was initialized with a learning rate of 1 × 10 − 5 , while the classifier components utilized a learning rate of 1 × 10 − 4 . Weight decay was set to 1 × 10 − 4 to regularize model parameters. Gradient clipping was applied with a parameter of 1.0 to prevent gradient explosion. 2.3.2. Learning Rate Scheduling A Cosine Annealing learning rate scheduler was implemented with minimum learning rate of 1 × 10 − 6 . This scheduler allows for initial 20 epochs with higher learning rates and then it decays gradually. 2.3.3. Handling Class Imbalance To mitigate the bias introduced by an uneven class distribution, we incorporate a class-weighted loss. Specifically, for binary classification we compute a weight for the positive class as where N + and N − denote the numbers of positive and negative samples in the training set, respectively, f is the empirical positive-class frequency, and α is a scaling exponent (set to 1 in our experiments). The negative-class weight is taken as w − = 1. By up-weighting the minority class in proportion to 1 /f , the loss function emphasizes rare events and helps prevent the model from trivially predicting the majority class. 2.4. Experiments Performed Various distinct experimental protocols were conducted to comprehensively evaluate model performance and generalisation. We describe the four different experiments conducted below : Multi-dataset training : A single network was trained on the union of Code-15, Chapman, Chapman-Shaoxing, MedalCare-XL, Offline.TS and PhysioNet 2021. Evaluation was performed both on held-out internal splits and on the unseen MIMIC IV dataset. Number of training samples were 237,921, validation and testing samples were 29,740 each. Further, we tested this on MIMIC IV as a test set which includes 800,034 ECG signals. Refer table 1 to check the distribution of labels across all datasets. P-wave mask augumented training : The most common characteristic of AFib are irregularly irregular R-R intervals and the absence of P waves. This experiment was done using a two-stage pipeline, where in the first stage we segment out P wave regions using a trained lightweight 1-D U-Net architecture. An attention module to focus on these segmentation masks was incorporated in the classifier architecture such that the model focuses on important P wave regions, which is important in diagnosis of AFib. The data set used was the same as that used in multi-dataset training with their P wave masks. Vectorcardiogram (VCG) based training : The 12-lead ECG was transformed to 3-lead VCG signals via the Kors transformation. All the 12 lead ECG used in multi dataset training was transformed to 3 lead VCG signals. All subsequent pre-processing was done in VCG domain and classification was done using same model architecture. HDXML-only training : The network was trained exclusively on the HDXML dataset and then tested across all remaining datasets to quantify cross-dataset generalizability from a single source. The dataset comprised of 67,432 total ECGs with 10,471 positive AFib cases and 56,961 non-AFib cases. 3. Experimental Results 3.1. Multi-Dataset Training Results 3.1.1. Model Performance Metrics We evaluated our model using standard classification metrics including precision, recall, F1-score, and area under the receiver operating characteristic curve (AUROC). The PR curve and AUC-ROC curve can be seen in ( Figure 2a, 2b ) respectively which illustrates the classification performance across positive and negative cases. Download figure Open in new tab Figure 2: Performance evaluation metrics for multi-dataset training: (a) Precision-Recall curve demonstrating model performance across different thresholds, (b) ROC curve illustrating the trade-off between sensitivity and specificity The model achieved an overall accuracy of 97.54% on the test set, with a precision of 84.36% and recall of 90.08% for atrial fibrillation detection. The F1-score, which represents the harmonic mean of precision and recall, was 88.50%. Sensitivity and specificity were reported to be 90.08% and 97.93% respectively. The model was evaluated with 0.7 threshold of sigmoid activation function. The detailed performance metrics are presented in Table 2 . View this table: View inline View popup Download powerpoint Table 2: Performance of recent AF-detection systems (binary AFib vs. non-AFib unless stated). ‘Ext.” = external unseen cohort; Int.” = internal hold-out or CV. Best value in each numeric column is bold; -” = information not reported 3.1.2. Evaluation on MIMIC IV ECG Dataset The classification report revealed that the model achieved an overall accuracy of 95.71%, with a sensitivity of 70.35% and a specificity of 98.46%. The model’s precision for AFib detection was 83.26%. The F1-score was computed as 76.26%. All evaluations were conducted on a GPU with batch processing employed to optimize memory usage and inference speed. The total execution time for the entire evaluation process was recorded as approximately 765.63 seconds, reflecting the model’s efficiency in processing large-scale ECG data. To analyze the model’s discriminative ability across different threshold settings, a Receiver Operating Characteristic (ROC) curve was generated, and the Area Under the ROC Curve (AUC) was computed to quantify overall classification performance. A confusion matrix was computed to provide a granular breakdown of classification results, capturing true positives (correctly identified AFib cases), true negatives (correctly classified normal ECGs), false positives (normal ECGs misclassified as AFib), and false negatives (AFib cases misclassified as normal). A Precision-Recall curve was generated to assess performance in handling class imbalance, and the corresponding plot is shown in Figure 3a . Additionally, the ROC curve was visualized and can be seen in Figure 3b Download figure Open in new tab Figure 3: MIMIC IV external validation results: (a) Precision-Recall curve demonstrating model robustness across thresholds, (b) ROC curve illustrating discriminative performance on external dataset. 3.1.3. Saliency Map Analysis This saliency map visualization effectively demonstrates the model’s focus on clinically relevant features for atrial fibrillation detection. The low probability score, which suggests Non-AFib ECG signal, aligns with the visual evidence of regular rhythm and consistent beat morphology across leads. This approach enhances model interpretability and builds clinical trust by demonstrating appropriate attention to established diagnostic ECG features. 3.2. P-wave mask augumented classifier results The ECG P-Wave AFib classifierr experiment showed variable performance across the datasets. On MIMIC IV, performance was at 95.36% accuracy with 67.80% sensitivity and 98.35% specificity. 3.3. VCG classifier results The VCG-based approach using Kors transformation showed enhanced robustness to noisy signals, particularly evident in the Offline-TS dataset where accuracy improved by 3.89% and F1-score by 12.49%. However, this came at the cost of reduced sensitivity across all datasets. 3.4. HDXML-Only Training: Cross-Dataset Generalization Training the model exclusively on the HDXML dataset demonstrated noteworthy cross-dataset generalization. Table 3 summarizes the performance obtained when the XML-only model was evaluated on each of the test sets. View this table: View inline View popup Download powerpoint Table 3: Performance of the HDXML-only model on external datasets The results reveal four clear patterns: Strong generalization to the Chapman datasets: Sensitivity exceeded 96% and specificity exceeded 96.5% on both Chapman test sets, indicating that features learned from HDXML transfer well to the Chapman distribution. Moderate performance on Offline-TS and PhysioNet 2021: Sensitivity remained around 87–88% and specificity around 91–92%, showing solid but attenuated transferability. Limited generalization to Code-15: Although specificity stayed high ( > 99%), sensitivity dropped sharply to 58.12%, suggesting potential label noise or domain mismatch in Code-15. Despite this variability, the ROC–AUC remained above 0.93 for every dataset, underscoring the model’s strong overall discriminative capability. Interpretability Analysis Saliency map was generated to do final class-specific analysis. Figure 4 illustrates qualitatively different attention patterns between normal rhythm and AFib cases from two of the test set samples. Download figure Open in new tab Figure 4: Saliency maps generated on both AFIB and non-AFIB cases. 4. Discussion 4.1. Contributions and Comparative Performance This work addresses key gaps in the literature with the following contributions: Systematic generalisation analysis : HDXML only experiment quantifies transferability to six unseen datasets. Deployment-oriented design : high specificity ( > 97%) and saliency-based interpretability meet clinical requirements. Edge-ready efficiency : the end-to-end network contains only 17 M trainable parameters ( ≈ 55MB floating point precision (FP32)) enabling real-time inference on mobile or bedside devices. Table 2 summarises performance against nine baselines; our model offers the most balanced out-of-distribution results to date. Cross-site external validity . Block A of Table 2 reports performance on six truly unseen cohorts. Competing studies typically publish a single external test (if any) and almost never include the real-world MIMIC-IV ICU records. Only ECG-AI [ 35 ] evaluated on MIMIC-IV, reporting ROC–AUC 0.77; our detector achieves 0.96 , a relative improvement of +24.7%. Likewise on Chapman, our model attains ROC–AUC 0.99 and 96.01 % sensitivity, which is slightly larger than knowledge-embedded pseudo-Siamese CNN [ 30 ]. Clinical specificity under heavy covariate shift . False positives drive alarm fatigue and unnecessary anticoagulation. Across all six external cohorts our detector keeps specificity ≥ 91 %, and it remains 99.3 % on the CODE-15 dataset. No other method in Table 2 simultaneously sustain ≥ 97 % specificity on MIMIC-IV and high sensitivity on Chapman Shaoxing and PhysioNet 2021 datasets. Efficiency without accuracy sacrifice . The proposed network contains only 17M parameters (55MB FP32), yet matches or beats heavyweight Transformers (e.g. 110 M-parameter Wide-and-Deep Transformer [ 17 ]) on every shared benchmark. This significant reduction in memory footprint enables real-time execution on mobile SoCs and edge GPUs, a prerequisite for bedside or ambulatory deployment. Conclusively, the HDXML-only experiment demonstrates that a single high-quality training source can yield a lightweight yet highly generalisable detector , surpassing prior work that either lacks rigorous external validation or relies on massive, less interpretable models. We propose this model as our final architecture, demonstrating strong potential for deployment in clinical settings due to its robust generalization and interpretability. 4.2. Performance Analysis Our comprehensive evaluation demonstrates that the proposed deep learning architecture achieves state-of-the-art performance for AFib detection across diverse datasets. The HDXML-only training experiment yielded well-balanced metrics across all datasets, with the exception of CODE-15. This suggests that the CODE-15 dataset may have adversely impacted MIMIC-IV test performance in the multi-dataset training setup. 4.3. Clinical Relevance Saliency map analysis confirmed that the model consistently attends to clinically meaningful regions—particularly Lead II and P-wave segments. This supports the model’s physiological alignment with AFib characteristics. Additionally, the high specificity achieved across all settings is crucial to minimize false alarms in clinical monitoring systems, a key barrier in real-world deployment. 4.4. Ablation Studies and Supplementary Experiments Several supplementary experiments were conducted en route to finalizing the HDXML-only model, which helped justify key architectural and design decisions. 4.4.1. P-wave mask augumented classifier Despite the conceptual relevance of this experiment, this approach showed inferior performance. These results were consistently lower than both the HDXML-only and multi-dataset training models. Hence, we concluded that the architecture itself effectively learns to focus on P-wave regions without the need for handcrafted segmentation. 4.4.2. Vectorcardiogram (VCG)-Based AFib Detection This approach improved robustness on certain datasets, particularly the Offline-TS set, where accuracy increased by 3.89% and F1-score by 12.49%. However, this came at the cost of decreased sensitivity across all datasets. Thus, while promising for noise resilience, VCG-based models require further refinement to match the sensitivity of multi-lead ECG models. 4.5. Robustness to Signal Quality Clinical ECGs are often imperfect due to noise, lead displacements, or hardware artifacts. To simulate such variability, we introduced one random perturbation per signal per epoch during training. The perturbations included: timing shifts, lead mix-ups, missing leads, baseline drift, high-frequency noise,contact loss artifacts and smoothing. This augmentation strategy improved the model’s ability to generalize to noisy and artifact-laden clinical ECGs, ensuring it learns robust rhythm-based representations. 4.6. Limitations Performance variability across CODE 15 dataset underscores the need for careful analysis for dataset. The model has not yet been prospectively validated in real-world clinical workflows. 5. Conclusion We presented a lightweight 17M-parameter CNN that delivers state-of-the-art AFib detection from 12-lead ECGs. Two complementary training protocols were explored, yet one emerged as clearly superior: HDXML-only training is the best performer . A model trained exclusively on a single, meticulously curated HDXML corpus achieved class-balanced performance on six of the six external test sets—often matching or surpassing far larger architectures—while retaining a very high mean ROC–AUC ( ≥ 0.96). Only the CODE-15 cohort exhibited a marked sensitivity drop, pointing to a domain-mismatch rather than a weakness in the model itself. Real-world readiness . The HDXML-only detector attained specificity ≥ 97% on every external cohort, an essential requirement for hospital monitors and wearables where false alarms drive alarm fatigue and unnecessary anticoagulation. Clinically trustworthy and deployable . Saliency analysis showed consistent attention to Lead II and P-wave regions, reflecting the clinical judgment of cardiologists. The small memory footprint ( ≈ 55MB, FP32) enables real-time inference on embedded GPUs and even high-end mobile devices. These findings demonstrate that one well-curated training source is sufficient to build a detector that generalizes across disparate hospitals, devices, and patient populations with our model architecture. The HDXML-only experiment therefore offers a compelling path to regulatory approval and large-scale screening. Future work We will launch a prospective emergency-department study to quantify clinical impact on alarm burden and time-to-diagnosis.In parallel, we will benchmark the network on resource-constrained edge devices—such as mobile CPUs, ARM-based single-board computers, and low-power GPUs—and explore quantization, pruning, and other compression techniques to further reduce inference latency and memory footprint. Data Availability All data produced in the present work are contained in the manuscript Acknowledgment The authors would like to thank the contributors of the public datasets used in this study, including the PhysioNet community, Chapman University, MIT Critical Care, HDXML for making their data available for research purposes. Footnotes Email addresses: harshitmishra{at}gofynd.com (Harshit Mishra), nachiketmakwana{at}gofynd.com (Nachiket Makwana), drpradyot.tiwari{at}gmail.com . (Pradyot Tiwari), ksubramani9{at}hotmail.com (K. Subramani), hari{at}iisc.ac.in (K. V. S. Hari) References [1]. ↵ S. S. Chugh et al. , ‘ Worldwide epidemiology of atrial fibrillation: A Global Burden of Disease 2010 study ,” Circulation , vol. 129 , no. 8 , pp. 837 – 847 , 2014 . OpenUrl Abstract / FREE Full Text [2]. ↵ B. P. Krijthe et al. , ‘ Projections on the number of individuals with atrial fibrillation in the European Union, from 2000 to 2060 ,” Eur. Heart J ., vol. 34 , no. 35 , pp. 2746 – 2751 , 2013 . OpenUrl CrossRef PubMed Web of Science [3]. ↵ M. H. Kim et al. , ‘ Estimation of total incremental health-care costs in patients with atrial fibrillation in the United States ,” Circ.: Cardiovasc. Qual. Outcomes , vol. 4 , no. 3 , pp. 313 – 320 , 2018 . OpenUrl [4]. ↵ D. Mozaffarian et al. , ‘ Heart disease and stroke statistics—2016 update ,” Circulation , vol. 133 , no. 4 , pp. e38 – e360 , 2016 . OpenUrl FREE Full Text [5]. ↵ A. J. Walkey et al. , ‘ Incident stroke and mortality associated with new-onset atrial fibrillation in patients hospitalised with severe sepsis ,” JAMA , vol. 170 , no. 9 , pp. 772 – 780 , 2014 . OpenUrl [6]. ↵ Z. Wu et al. , “ Prevalence, Outcomes, and Risk Factors of New-Onset Atrial Fibrillation in Critically Ill Patients: A Systematic Review ,” Int. Heart J ., vol. 61 , no. 3 , pp. 476 – 485 , 2020 . OpenUrl PubMed [7]. ↵ E. J. Benjamin et al. , ‘ Impact of atrial fibrillation on the risk of death: The Framingham Heart Study ,” Circulation , vol. 98 , no. 10 , pp. 946 – 952 , 1998 . OpenUrl Abstract / FREE Full Text [8]. ↵ C. T. January et al. , ‘ 2019 AHA/ACC/HRS focused update of the 2014 guideline for the management of patients with atrial fibrillation ,” Circulation , vol. 140 , no. 2 , pp. e125 – e151 , 2019 . OpenUrl CrossRef PubMed [9]. ↵ G. Hindricks et al. , ‘ 2020 ESC guidelines for the diagnosis and management of atrial fibrillation ,” Eur. Heart J ., vol. 42 , no. 5 , pp. 373 – 498 , 2021 . OpenUrl CrossRef PubMed [10]. ↵ K. Tateno and L. Glass , ‘ Automatic detection of atrial fibrillation using the coefficient of variation and density histograms of RR andRR intervals ,” Med. Biol. Eng. Comput ., vol. 39 , no. 6 , pp. 664 – 671 , 2001 . OpenUrl CrossRef PubMed [11]. ↵ S. Dash et al. , ‘ Automatic real-time detection of atrial fibrillation ,” Ann. Biomed. Eng ., vol. 37 , no. 9 , pp. 1701 – 1709 , 2009 . OpenUrl CrossRef PubMed [12]. ↵ D. E. Lake and J. R. Moorman , ‘ Accurate estimation of entropy in very short physiological time series: The problem of atrial fibrillation detection in implanted ventricular devices ,” American Journal of Physiology – Heart and Circulatory Physiology , vol. 300 , no. 1 , pp. H319 – H325 , 2011 . OpenUrl [13]. ↵ P. Rajpurkar et al. , ‘ Cardiologist-level arrhythmia detection with convolutional neural networks ,” eprint arXiv: 1707.01836 , 2017 . [14]. ↵ Z. I. Attia et al. , ‘ An artificial-intelligence–enabled ECG algorithm for the identification of patients with atrial fibrillation during sinus rhythm ,” Nat. Med ., vol. 25 , no. 9 , pp. 1399 – 1405 , 2019 . OpenUrl [15]. ↵ A. H. Ribeiro et al. , ‘ Automatic diagnosis of the 12-lead ECG using a deep neural network ,” Nat. Commun ., vol. 11 , no. 1 , Art. no. 1760 , 2020 . OpenUrl CrossRef PubMed [16]. H. Yang et al. , ‘ Multi-scale attention-based convolutional neural network for atrial fibrillation detection ,” IEEE Trans. Biomed. Eng ., vol. 69 , no. 4 , pp. 1200 – 1210 , 2022 . OpenUrl [17]. ↵ A. Natarajan et al. , ‘ A wide and deep transformer neural network for 12-lead ECG classification ,” in Proc. Comput. Cardiol ., vol. 47 , 2020 , pp. 1 – 4 . OpenUrl [18]. ↵ G. Tse et al. , ‘ Heart Disease XML Strain (v17) ,” Zenodo, Dataset , doi: 10.5281/zenodo.5700069 , 2021 . OpenUrl CrossRef [19]. ↵ A. H. Ribeiro et al. , ‘ Automatic diagnosis of the 12-lead ECG using a deep neural network ,” Nat. Commun ., vol. 11 , Art. no. 1760 , 2020 . OpenUrl CrossRef PubMed [20]. ↵ J. Zheng et al. , ‘ A 12-lead electrocardiogram database for arrhythmia research covering more than 10 000 patients ,” Sci. Data , vol. 7 , Art. no. 48 , 2020 . OpenUrl PubMed [21]. ↵ J. Zheng , H. Guo , and H. Chu , ‘ A large-scale 12-lead electrocardiogram database for arrhythmia study (ver. 1.0.0) ,” dataset, PhysioNet , doi: 10.13026/wgex-er52 , 2022 . OpenUrl CrossRef [22]. ↵ K. Gillette et al. , ‘ MedalCare-XL: 16 900 healthy and pathological synthetic 12-lead ECGs from electro-physiological simulations ,” Sci. Data , vol. 10 , Art. no. 290 , 2023 . OpenUrl PubMed [23]. ↵ E. A. Pérez Alday et al. , ‘ Classification of 12-lead ECGs: The PhysioNet/Computing in Cardiology Challenge 2020 ,” Physiol. Meas ., vol. 41 , no. 12 , Art. no. 124003 , 2020 . OpenUrl [24]. ↵ M. A. Reyna et al. , ‘ Will two do? Varying dimensions in electrocardiography: The PhysioNet/Computing in Cardiology Challenge 2021 ,” in Proc. Comput. Cardiol ., vol. 48 , 2021 , pp. 1 – 4 . OpenUrl [25]. ↵ A. E. W. Johnson et al. , ‘ MIMIC-IV, a freely accessible electronic health-record dataset ,” Sci. Data , vol. 10 , Art. no. 106 , 2023 . OpenUrl PubMed [26]. S. Hong et al. , ‘ Ensemble deep learning for atrial fibrillation detection ,” in Proc. Comput. Cardiol ., vol. 48 , 2021 , pp. 1 – 4 . OpenUrl [27]. W. Cai et al. , ‘ Accurate detection of atrial fibrillation from 12-lead ECG using deep neural networks ,” Comput. Electr. Eng ., vol. 89 , Art. no. 106934 , 2020 . OpenUrl [28]. E. Habineza et al. , ‘ End-to-end risk prediction of atrial fibrillation from the 12-lead ECG by deep neural networks ,” Eur. Heart J. Digit. Health , vol. 4 , no. 1 , pp. 17 – 25 , 2023 . OpenUrl [29]. Y.Y. Jo , Y. Cho , S.Y. Lee , J.M. Kwon , K.H. Kim , K.H. Jeon , S. Cho , J. Park , and B.H. Oh , ‘ Explainable artificial intelligence to detect atrial fibrillation using electrocardiogram ,” Int. J. Cardiol ., vol. 328 , pp. 104 – 110 , Apr . 2021 , doi: 10.1016/j.ijcard.2020.11.053 . OpenUrl CrossRef PubMed [30]. ↵ C. Lin , H. Lu , P. Sang , et al. , ‘ A knowledge-embedded multimodal pseudo-Siamese model for atrial fibrillation detection ,” Scientific Reports , vol. 15 , no. 3133 , 2025 . doi: 10.1038/s41598-025-87115-3 . OpenUrl CrossRef [31]. A. Hassan et al. , ‘ Automatic extraction of medical latent variables from ECG signals utilizing a mutual information-based technique and capsular neural networks for arrhythmia detection ,” Comput. Mater. Continua , vol. 81 , pp. 971 – 986 , 2024 . OpenUrl [32]. J. Si , Y. Bao , F. Chen , Y. Wang , M. Zeng , N. He , Z. Chen , and Y. Guo , ‘ Research on atrial fibrillation diagnosis in electrocardiograms based on CLA-AF model ,” Eur. Heart J. Digit. Health , vol. 6 , no. 1 , pp. 82 – 95 , Nov . 2024 , doi: 10.1093/ehjdh/ztae092 . OpenUrl CrossRef PubMed [33]. Shany et al. , ‘ Generalizable and robust deep-learning algorithm for AF diagnosis across geography ,” NPJ Digit. Med ., vol. 6 , Art. XX , 2023 . OpenUrl [34]. B. Chen , G. Javadi , A. Hamilton , et al. , ‘ Quantifying deep neural network uncertainty for atrial fibrillation detection with limited labels ,” Sci. Rep ., vol. 12 , Art. 20140 , 2022 , doi: 10.1038/s41598-022-23956-w . OpenUrl CrossRef PubMed [35]. ↵ J. Choi , J.Y. Kim , M.S. Cho , M. Kim , J. Kim , I.-Y. Oh , Y. Cho , and J.H. Lee , ‘ Artificial intelligence predicts undiagnosed atrial fibrillation in patients with embolic stroke of undetermined source using sinus rhythm electrocardiograms ,” Heart Rhythm , vol. 21 , no. 9 , 2024 , doi: 10.1016/j.hrthm.2024.06.002 . OpenUrl CrossRef [36]. H. Wen and J. Kang , ‘ A comparative study on neural networks for paroxysmal atrial fibrillation events detection from electrocardiography ,” J. Electrocardiol ., vol. 75 , pp. 19 – 27 , 2022 , doi: 10.1016/j.jelectrocard.2022.06.002 . OpenUrl CrossRef PubMed [37]. T. Ahmed et al. , ‘ Deep-learning classifier for ICU atrial fibrillation monitoring ,” J. Cardiovasc. Electrophysiol ., vol. 34 , pp. 89 – 98 , 2023 . OpenUrl View the discussion thread. Back to top Previous Next Posted November 15, 2025. Download PDF Data/Code Email Thank you for your interest in spreading the word about medRxiv. NOTE: Your email address is requested solely to identify you as the sender of this article. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following A Fast, Lightweight, and Generalizable Deep Neural Network for the Detection of Atrial Fibrillation Message Subject (Your Name) has forwarded a page to you from medRxiv Message Body (Your Name) thought you would like to see this page from the medRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share A Fast, Lightweight, and Generalizable Deep Neural Network for the Detection of Atrial Fibrillation Harshit Mishra , Farhan Adam Mukadam , Nachiket Makwana , Pradyot Tiwari , K. Subramani , K. V. S. Hari medRxiv 2025.11.13.25340129; doi: https://doi.org/10.1101/2025.11.13.25340129 Share This Article: Copy Citation Tools A Fast, Lightweight, and Generalizable Deep Neural Network for the Detection of Atrial Fibrillation Harshit Mishra , Farhan Adam Mukadam , Nachiket Makwana , Pradyot Tiwari , K. Subramani , K. V. S. Hari medRxiv 2025.11.13.25340129; doi: https://doi.org/10.1101/2025.11.13.25340129 Citation Manager Formats BibTeX Bookends EasyBib EndNote (tagged) EndNote 8 (xml) Medlars Mendeley Papers RefWorks Tagged Ref Manager RIS Zotero Tweet Widget Facebook Like Google Plus One Subject Area Health Informatics Subject Areas All Articles Addiction Medicine (568) Allergy and Immunology (863) Anesthesia (297) Cardiovascular Medicine (4420) Dentistry and Oral Medicine (443) Dermatology (381) Emergency Medicine (606) Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1507) Epidemiology (15210) Forensic Medicine (30) Gastroenterology (1120) Genetic and Genomic Medicine (6579) Geriatric Medicine (667) Health Economics (995) Health Informatics (4516) Health Policy (1366) Health Systems and Quality Improvement (1611) Hematology (538) HIV/AIDS (1264) Infectious Diseases (except HIV/AIDS) (15906) Intensive Care and Critical Care Medicine (1103) Medical Education (620) Medical Ethics (144) Nephrology (667) Neurology (6578) Nursing (345) Nutrition (998) Obstetrics and Gynecology (1139) Occupational and Environmental Health (956) Oncology (3322) Ophthalmology (970) Orthopedics (369) Otolaryngology (420) Pain Medicine (435) Palliative Medicine (129) Pathology (663) Pediatrics (1689) Pharmacology and Therapeutics (691) Primary Care Research (710) Psychiatry and Clinical Psychology (5428) Public and Global Health (9211) Radiology and Imaging (2192) Rehabilitation Medicine and Physical Therapy (1368) Respiratory Medicine (1194) Rheumatology (593) Sexual and Reproductive Health (709) Sports Medicine (529) Surgery (709) Toxicology (99) Transplantation (288) Urology (265) (function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9fef55842ecb58f4',t:'MTc3OTMyMTk3NA=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00