-
Distribution of classes in the testing data set.
-
Typical, random ecg signal from training dataset.
-
Training data loss values vs epochs.
-
Typical, random ecg signal from testing dataset.
-
Testing data loss values vs epochs
-
Confusion matrix for ECG classification.
-
ECG classification with machine learning being used to guide diagnoses in the healthcare setting.
Inspiration
There are medical professionals, cardiac telemetry technicians, with the specific job of monitoring patient electrocardiogram (ECG) data. They notify doctors and nurses if urgent cardiac problems such as irregular heartbeats (arrhythmias) occur. However, they are often looking at hundreds of patients at any given time. Having a tool which can both precisely and accurately identify these problems could offload this high demand on these healthcare workers or even be used to assist their work.
What it does
We classify ECG signals into 5 classes: Normal, Supraventricular Ectopy, Ventricular Ectopy, Fusion, and Unknown Beats.
How we built it
The Kaggle ECG Heartbeat Categorization Dataset is used to classify pre-processed and segmented ECG signals into 5 classes: Normal, Supraventricular Ectopy, Ventricular Ectopy, Fusion, and Unknown Beats. A convolutional neural network or CNN was used with 5 layers. Each layer was composed of a convolutional operation, maxpooling, and ReLU activation with a final dense network to recover the predicted label. The model is reduces error by minimizing a cross-entropy loss function.
Challenges we ran into
Hyperparameter tuning was quite difficult for the neural network as training data took so long. Deciding upon which model and learning how to implement it for the given problem was extremely tough.
Accomplishments that we're proud of
At the end, the model is able to predict classes with an overall accuracy of 90.49%. The runtime for the script is ~23 minutes, which is pretty lightweight for the implementation chosen and final accuracy.
What we learned
We had no previous experience doing any kind of machine learning before this project. So much was learnt about how machine learning works, the heavy math that goes behind it, and its widespread utility.
What's next for ECG Classification Using Machine Learning
Making some sort of GUI for medical professionals where they can read ECG data from telemetry machines, compress and segment the data, run it through the trained model, and get a live diagnosis is the logical next step. The first thing to do however is improve the accuracy by implementing a more sophisticated NN like RNNs or transformer networks. We would also like to extend this to identify more specific classes of heart beats such as tachycardia for example which need to be identified over larger timescales.
Log in or sign up for Devpost to join the conversation.