Clear Sky Science · en

AI-enhanced approaches for personalized cardiac treatment: insights from ECG data

· Back to index

Why smarter heart tests matter

When doctors prescribe drugs that affect the heart, they rely on the electrocardiogram, or ECG, to make sure the treatment is safe. But many medicines leave only subtle fingerprints on the heartbeat that can be hard to spot by eye. This study explores how artificial intelligence can read ECG traces more precisely, helping doctors tell which drug or drug mix is affecting the heart and opening the door to more personalized and safer cardiac care.

Looking for hidden drug effects in heartbeats

The researchers focused on a long standing safety problem: some drugs can disturb the heart’s electrical rhythm and raise the risk of dangerous irregular beats. Traditionally, doctors watch one main ECG measure, the QT interval, but this single yardstick often misses important details. Different drugs, and combinations of drugs, can change several parts of the heartbeat in complex ways. The team asked whether computer models could learn these patterns from data and reliably sort ECGs according to the treatment that produced them.

Figure 1. AI reads ECG patterns to match heart drug treatments and support safer personalized care.
Figure 1. AI reads ECG patterns to match heart drug treatments and support safer personalized care.

Building a rich picture from ECG signals

To tackle this, the study used a public database from a tightly controlled trial of 22 healthy volunteers. Each person received several drug regimens, including known heart rhythm drugs alone, in combination with others, and placebo. For every dosing period, standard 12 lead ECGs were recorded alongside blood samples. Instead of feeding the raw waveforms straight into the computer, the team first cleaned the signals and then extracted a detailed set of features that describe each heartbeat: how long it takes the electrical impulse to travel through the heart, how the T wave rises and falls as the heart recovers between beats, and how much the time between beats varies.

Training AI to recognize treatment fingerprints

Using these features, the authors trained and compared three popular machine learning models. Two of them, Random Forest and XGBoost, are tree based methods that learn from many simple decision rules working together, while the third, a Support Vector Machine, is a more traditional classifier. The models were asked to assign each ECG segment to one of ten possible treatment codes. After careful tuning and cross checking, XGBoost reached an accuracy of about 98 percent, with Random Forest close behind at about 97 percent, while the Support Vector Machine lagged far below. The best models not only made accurate predictions, they did so reliably across all treatment groups.

Figure 2. AI compares subtle ECG wave changes to tell different heart drug responses apart without human labels.
Figure 2. AI compares subtle ECG wave changes to tell different heart drug responses apart without human labels.

What the models say about the heartbeat

Beyond raw scores, the team examined which ECG features mattered most for the tree based models. Both approaches repeatedly highlighted the duration of the QRS complex, the PR interval, and several traits of the T wave, such as its height and shape, as the strongest clues to drug treatment. These findings line up well with clinical knowledge that these parts of the ECG reflect how electrical signals spread through the heart and how the lower chambers reset between beats, processes that many drugs influence. When the same pipeline was tested on a separate database that included different drugs, it again achieved strong performance without needing to be retrained, suggesting that the learned rules are not tied to a single study.

What this means for future care

In plain terms, this work shows that AI can learn to read ECGs in a way that captures the combined, subtle impact of different medicines on the heart. Instead of relying on one or two manual measurements, doctors could one day use such models to scan many ECG features at once and quickly flag patients whose hearts react in risky ways to a drug. While the study still needs to be extended to larger and more diverse patient groups, it lays a solid foundation for using data driven tools to fine tune cardiac treatments so that each person receives a regimen that is not only effective but also safer for their heart.

Citation: Tiwari, V., Gupta, R., Telang, A. et al. AI-enhanced approaches for personalized cardiac treatment: insights from ECG data. npj Syst Biol Appl 12, 72 (2026). https://doi.org/10.1038/s41540-026-00702-6

Keywords: electrocardiogram, machine learning, drug safety, cardiac arrhythmia, personalized medicine