Deep learning algorithm developed at Stanford to diagnose heart arrhythmias

SAN FRANCISCO — Stanford University computer scientists have developed a new algorithm to sift through hours of heart rhythm data generated by some wearable monitors and find sometimes life-threatening irregular heartbeats, called arrhythmias.

While it performs better than trained cardiologists, the algorithm detailed in an arXiv paper has the added benefit of being able to sort through data from remote locations where people don’t have routine access to cardiologists, as in rural areas and in many parts of the developing world.

People suspected to have an arrhythmia often get an electrocardiogram (ECG) in a doctor’s office. However, if an in-office ECG doesn’t reveal the problem, the doctor may prescribe a wearable ECG that monitors the heart continuously for two weeks. The resulting hundreds of hours of data would then need to be inspected second by second for any indications of problematic arrhythmias.

Researchers in the Stanford Machine Learning Group, led by Andrew Ng, an adjunct professor of computer science, set out to develop a deep learning algorithm to detect 13 types of arrhythmia from ECG signals and partnered with the heartbeat monitor company iRhythm to collect a massive dataset that they used to train a deep neural network model.

In seven months, it was able to diagnose these arrhythmias about as accurately as cardiologists and outperform them in most cases.

“One of the big deals about this work, in my opinion, is not just that we do abnormality detection but that we do it with high accuracy across a large number of different types of abnormalities,” Awni Hannun, a graduate student and co-lead author of the paper, said in a news release from Stanford on Thursday.

The group trained their algorithm on data collected from iRhythm’s wearable ECG monitor. Patients wear a small chest patch for two weeks and carry out their normal day-to-day activities while the device records each heartbeat for analysis.

The group took approximately 30,000 clips, each lasts 30 seconds, from various patients that represented a variety of arrhythmias.

“The differences in the heartbeat signal can be very subtle but have massive impact in how you choose to tackle these detections,” said Pranav Rajpurkar, a graduate student and co-lead author of the paper.

“For example,” Rajpurkar noted, “two forms of the arrhythmia known as second-degree atrioventricular block look very similar, but one requires no treatment while the other requires immediate attention.”

To test accuracy of the algorithm, the researchers gave a group of three expert cardiologists 300 undiagnosed clips and asked them to reach a consensus about any arrhythmias present in the recordings.

Working with these annotated clips, the algorithm could then predict how those cardiologists would label every second of other ECGs with which it was presented, in essence, giving a diagnosis.

The researchers had five different cardiologists, working individually, diagnose the same 300-clip set.

They then compared which more closely matched the consensus opinion, namely the algorithm or the cardiologists working independently, finding that the algorithm is competitive with the cardiologists, and able to outperform cardiologists on most arrhythmias.

In addition to cardiologist-level accuracy, the algorithm does not get fatigued and can make arrhythmia detections instantaneously and continuously.

The researchers hope the algorithm could be part of a wearable device that at-risk people keep on at all times that would alert emergency services to potentially deadly heartbeat irregularities as they’re happening.