Clear Sky Science · en
A joint CNN-Bi-LSTM-transformer architecture with SHAP explanations for multi-label arrhythmia detection from 12-lead ECGs
Why heart rhythm scanning matters to everyone
Heart rhythm problems, or arrhythmias, are a leading cause of sudden cardiac death, yet the main test used to spot them—the 12‑lead electrocardiogram (ECG)—still relies heavily on time‑pressed human experts. This study introduces an artificial intelligence system that can scan standard ECGs for many different rhythm problems at once, explain what it found in terms doctors understand, and run fast enough to fit inside wearable devices or telemedicine platforms. For patients, that could mean earlier warning of dangerous rhythms; for clinicians, it promises a tireless assistant that not only flags trouble but also shows why.

Listening to the heart with many ears
A 12‑lead ECG captures the heart’s electrical activity from multiple viewpoints using electrodes on the chest and limbs. Each heartbeat produces a characteristic pattern of waves that reveal how signals travel through the heart’s chambers. Small distortions in these patterns can signal conditions ranging from harmless variations to life‑threatening disruptions. Interpreting these subtle changes across many leads and over long recordings is demanding, and human readings can differ from one expert to another. At the same time, modern care increasingly relies on continuous monitoring in hospitals, at home, and in wearables, creating more data than clinicians can realistically review by eye.
Teaching a digital assistant to read complex heart signals
The researchers built a deep learning model that takes raw 12‑lead ECG segments as its input and learns to recognize 27 clinically important rhythm and conduction problems. First, they pre‑processed more than 43,000 expert‑labelled recordings from the large PhysioNet/Computing in Cardiology 2020 collection. Signals from different hospitals used different sampling rates and contained noise, missing values, and occasional outliers. The team resampled all ECGs to a common rate, removed baseline drift and electrical interference, filled in gaps using statistically sound rules, and segmented the data into overlapping four‑second windows. This window length proved long enough to capture key rhythm patterns while remaining short and efficient for real‑time analysis.
How the layered model sees space, time, and context
The core of the system is a chain of three complementary neural network modules. Convolutional layers act as pattern detectors, scanning each ECG lead for shapes such as sharp spikes, widened complexes, or distorted segments. Next, bidirectional long short‑term memory layers follow how these features evolve over time, effectively watching the rhythm both forward and backward to capture irregular intervals and transitions between beats. Finally, a transformer block applies an attention mechanism that can focus on distant but related signal fragments across all leads at once, drawing connections that may indicate overlapping conditions. Together, these layers convert each short ECG window into a compact representation from which the network estimates the presence of each of the 27 arrhythmia and conduction categories in a multi‑label fashion.

Opening the black box with meaningful highlights
To make the system’s decisions understandable, the authors integrated a technique called SHAP, which calculates how much each portion of the ECG contributed to a particular prediction. After training, they used SHAP to generate visual “importance maps” that highlight specific wave segments and leads the model relied on for each case. These maps often matched standard cardiology reasoning: for example, the system emphasized absent P‑waves and irregular beat intervals when identifying atrial fibrillation, or widened QRS complexes and compensatory pauses when recognizing premature ventricular beats. This alignment suggests that the AI is not merely memorizing patterns, but keying in on the same physiologic clues that human experts use.
Real‑world performance and future promise
On an independent test group of patients, the model correctly classified rhythms with an overall accuracy of about 91%, and maintained strong balance between catching true problems and avoiding false alarms across common and rare conditions alike. For dangerous arrhythmias such as ventricular premature beats and atrial fibrillation, its ability to distinguish abnormal from normal was extremely high. Remarkably, the complete model occupies less than two megabytes of memory and can analyze an ECG window in under ten milliseconds, making it suitable for deployment in bedside monitors, ambulatory recorders, or even smart wearables. In plain terms, this work shows that a compact, explainable AI can help read standard ECGs across a wide range of heart rhythm problems, offering clinicians clear visual justifications while paving the way for safer, more accessible heart monitoring.
Citation: Al-Bairmani, M.T., Yazdchi, M. & Nasimi, F. A joint CNN-Bi-LSTM-transformer architecture with SHAP explanations for multi-label arrhythmia detection from 12-lead ECGs. Sci Rep 16, 11123 (2026). https://doi.org/10.1038/s41598-026-40925-5
Keywords: electrocardiogram, heart arrhythmia, deep learning, explainable AI, cardiac monitoring