ScaHybNet: turning heartbeats into pictures
ScaHybNet converts each heartbeat into a wavelet picture, then runs CNN, BiLSTM and Transformer branches. Test accuracy is 94.73%, but fusion beats are still hard.
Abstract
Nagar et al. (2026) transform MIT-BIH heartbeats into 224x224 RGB scalograms with a Morlet continuous wavelet transform. A residual CNN learns shape, a BiLSTM models sequence, and a Transformer encoder captures long-range context. Their outputs are combined with validation-weighted softmax fusion. On five beat classes the ensemble reaches 94.73% test accuracy, 76.51% macro precision, 82.93% macro recall and 77.40% macro F1.
Video resources
Related ECG learning videos, embedded for playback on this page.
Why I picked this
Most papers feed the raw signal to a network. This one converts it to an image first, which made me curious whether the time-frequency picture really helps.
The problem
The data is tricky in three ways:
- Heavy imbalance: normal beats dominate, fusion beats are rare.
- Noise and patient differences change waveform shape.
- Plain CNNs may miss rhythm over time.
How it works
- Data. ECG Heartbeat Categorization Dataset: 109,446 beats in five classes (N, S, V, F, Q), balanced by stratified balancing and inverse-frequency class weights.
- Scalogram. Morlet CWT at 360 Hz, scales 1 to 64, saved as 224x224 RGB images.
- Three branches. Residual CNN, then BiLSTM over the CNN feature sequence, then a Transformer encoder with multi-head self-attention.
- Fusion. Validation-weighted softmax ensemble. Five-fold cross-validation, batch size 2, 150 epochs, Adam.
Results
| Class | Precision | Recall | F1 |
|---|---|---|---|
| N (normal) | 97.21 | 97.00 | 97.12 |
| S (supraventricular) | 68.56 | 58.45 | 63.12 |
| V (ventricular) | 88.48 | 83.84 | 86.09 |
| F (fusion) | 32.21 | 82.72 | 46.37 |
| Q (unknown) | 96.07 | 92.66 | 94.33 |
| Macro average | 76.51 | 82.93 | 77.40 |
Per-class test metrics in %, from Table 8. Swapping CWT for an STFT spectrogram drops accuracy to 91.64% and macro F1 to 73.92%.
My reading notes
Accuracy flatters it
94.73% test accuracy sounds great, but fusion-beat precision is only 32.21% and macro F1 is 77.40%.
Three different accuracies
Train 99.81%, five-fold CV 90.42% (+/- 1.26), test 94.73%. The gap between training and the rest is large.
A contradiction
The limitations say no outside datasets were tested, yet the paper also reports a PTB run (89.83% test accuracy, normal vs abnormal). It looks trained separately, so it is not true transfer.
No patient IDs
The beat-level data has no subject identifiers, so strict patient-wise splits cannot be guaranteed. That is a big caveat.
Biggest lesson: read macro metrics and per-class tables before trusting a headline accuracy.
What's next
The authors suggest adaptive CWT scales, adding PPG, and SHAP explanations. I would add patient-wise evaluation on a second, independent dataset.
Paper: Nagar, Verma, Singh and Shashvat, Scientific Reports 16:25403 (2026).
Why a scalogram?
A continuous wavelet transform maps a one-dimensional ECG into a time–scale representation. Unlike a single global frequency summary, it can make transient events visible at different scales. A CNN can learn local image patterns; a bidirectional LSTM adds sequence context; a Transformer adds attention-based relationships across the representation.
Reported results, read carefully
The 2026 Scientific Reports paper reports 94.73% test accuracy, 76.51% precision, 82.93% recall and 77.40% F1 for its five-category ECG heartbeat task. The gap between accuracy and F1 is important: strong overall accuracy can coexist with weaker performance on underrepresented classes. The article also reports mean five-fold cross-validation accuracy of 90.42% ± 1.26%.
Research limitations to consider
- Class imbalance makes per-class sensitivity and F1 essential.
- Image conversion adds compute and preprocessing choices that must be reproduced.
- Beat-level random splits may overstate generalization if patient separation is not respected.
- Benchmark performance does not establish performance on independent clinical populations.
Primary sources
- Nagar et al. (2026), Scientific Reports article
- Open full text on PubMed Central
- MIT-BIH Arrhythmia Database
💬 Comments
Share a thought. Your name and comment will be public. Please be kind and keep personal details private.
Say hello ✉
Questions, feedback or just a kind word? Email contact@ranjeetpandey.xyz or send a message below.
Loading comments…