Prediction of Atrial Fibrillation

Photo by healthline.com

Key Takeaways

This project taught me advanced data processing techniques, how to work with neural networks in practice, the Keras deep learning framework and how to work Agile within a team.

Introduction

This was my 2nd year project on my BSc edducation and was offered to my team by a PhD student at the Amsterdam Medical Center (AMC). Our team of 5 worked intensively on the project over the course of 1 month and in parallel were also trained to work in the agile framework Scrum.

Short Summary

We took on the task of finding patterns in electrocardiograms (ECG) for prediction of abnormalities such as Atrial Fibrillation. We applied various data processing techniques including but not limited to Discrete Fourier Transform and Savitzky-Golay smoothing. The final model consisted of a fully connected Neural Network which was capable of predicting Atrial Fibrillation with high accuracy. The project was a success and part of the team went on to work further with the PhD student which resulted in the improved project being published in a journal.

Links to the slides and the paper are at the top of this page.

The Project

We received a large set of tagged (specific heart diseases) ECG data. This set contained the ECGs of 1̃500 people, each divided in 8 channels consisting of 5000 data points each.

Our client was a PhD (medicine) student working for the AMC. She (and her colleagues) had been tagging the ECGs and were seeking help from competent AI students to perform deep learning on their data.

Example data
Healthy sinus rhytm
Aarhytmia

The goal of the 4 week project was to explore feature extraction methods (in signal processing) and to train a Neural Network that would have an accuracy of at least 70% in predicting the tagged heart diseases in the data.

Preprocessing

With Savitzky-Golay smoothing we reduced the noise in the ECGs.

Noisey signal and smoothed signal

With Fourier Analysis we corrected for baseline wandering in the ECGs.

Baseline Wandering
Detecting a wandering baseline
Correcting the baseline

We extracted the pulses from the ECGs and scaled them to a fixed size. Overlaying them showed a clear division between healthy and unhealthy.

Overlapping scaled pulses

The model

The model we used for predicting Atrial Fibrillation was a relatively deep fully connected Neural Network (Multi-layer Perceptron). We used the preprocessed pulses as input and trained it on a binary classification of Sinus Rhythm and Atrial Fibrillation.

Layer representation of the model

Results

Accuracy Precision Recall
0.96 0.95 0.96

The final prediction results of the model were surprisingly good and exceeded our expectations.

Training metrics
Accuracy per epoch
Loss per epoch

Our goal was to surpass at least 70% accuracy and we achieved 96%. The project was a success and we were satisfied.

Christopher Buch Madsen
Christopher Buch Madsen
BSc, Artificial Intelligence

Turning coffee into machine learning models

Related