Skip to main content
Department of Information Technology

Data Science and Health

An explosion of AI related research is currently revolutionizing the medical sciences, ranging from the prediction of epidemics to the monitoring of patients. One of the use cases where Machine Learning can improve our quality of life is with the analysis of ECG readings. An ECG (Electrocardiogram) is used to measure the heart’s electrical activity. Several electrodes are placed on the patient’s body and detect the electrical signals produced by the beating of the heart. Recordings of these signals are conventionally looked at by an expert in order to detect anomalies, indicating something may be wrong. Manual analysis is however a demanding task and prone to errors.

Thomas Schön, professor and teacher at the IT department, is currently working with his team on automating this process. Together with researchers from Brazil they are developing a method to assist cardiologists in their work. A deep learning neural network is used to detect six different classes of ECG anomalies. To train this NN a dataset consisting of over two million entries, each lasting from 7 to 12 seconds, is used. To acquire this uniquely large data set, ECG signals were collected from medical sources spanning over ten years. This project is an advancement compared to previous studies since it uses 12-lead and clinically relevant data for model training. This means that twelve sensors are used on the patient, which is the standard approach for an ECG.

The team took a pragmatic attitude to selecting the structure of the neural network, looking for the one with the best performance. They selected ResNet, a residual network with nine convolutional layers. Convolutional layers were originally developed to assist with analysis of image data but have also become more common in cases with sequential data. The network uses an end-to-end approach and was trained on 98% of the dataset. The output of the model is a scalar between 0 and 1, with higher values indicating a larger certainty of an anomaly existing within the ECG. The remaining 2% of data is used for validation. Within this process the optimal threshold is selected, indicating when the output value is high enough to warrant the positive detection of an anomaly.

Collaborating with cardiologist enabled the creation of high-quality annotations for 1000 ECG readings, used to establish a ground truth. This input is necessary to test the performance of the network. Currently the trained model can be used to detect a relatively small set of anomalies with a high performance. In the future this set will be expanded, hopefully encompassing around sixteen different anomalies.

For the Swedish medical community, the development of this tool is not essential due to the high standards of practice and relatively large availability of cardiologists. In other countries this might not be the case. In Brazil, the physical distance between patients and cardiologists is often very large. Experts might not present at the same location as where the ECG is recorded and must find time to analyze the data after it is sent to them. Meanwhile, using an automated detection system with human level performance, an analysis can be made instantly. This result is not the final diagnosis for the patient but can be used as an indication of the urgency of the case. Urgent cases should be looked at first, which for the patient might mean skipping a couple of hours of waiting time and potentially changing his or her life. Even though methods like these are not meant as a replacement of human doctors they can still form an important tool within the medical field.

In the future the research team hopes to tackle more applications within cardiology and apply their knowledge to other data types like MRI and ultrasound. There are many more clinical topics with which the medical world is struggling and where AI could assist. One interesting topic is the detection of myocardial infarctions, commonly known as heart attacks. During a heart attack part of the heart muscle starts to die due to a lack of blood flow. This can take place without the patient being aware of the seriousness of the issue. Detection of a heart attack is often challenging for humans and therefore presents a relevant topic for AI research.

More information on the ECG analysis project can be found in the paper ‘Automatic diagnosis of the 12-lead ECG using a deep neural network’ by Ribeiro et al. (2020), which is freely available from the publisher’s website. For further news on the research of Thomas Schön and his team take a look on their news page.

Article and interviews by Erik Jan Bootsma, MSc Computational Science

Updated  2021-06-20 10:56:20 by Matteo Magnani.