Accurate Identification of Cardiac Anomalies through Deep Learning
CSEF · 2019 Computational Systems & Analysis (Senior Division Only)
Overview
Objectives The objective of this research was to develop a neural network to automatically identify arrhythmia in the electrocardiogram (ECG) at diagnostically accurate levels. Methods 108,240 heartbeats were extracted from the MIT-BIH Arrhythmia Database, comprising 11 beat types (normal beat + 10 types of arrhythmia) using the WFDB software package. Heartbeats were constructed encompassing the PQRST complex, from 0.25s before to 0.45s after the R peak, for a total of 256 data points per beat at 360 Hz. The heartbeats were converted into 256x256 grayscale images and labeled by heartbeat type. The images were randomly shuffled and divided 80/10/10 into training, validation, and test sets. A convolutional neural network comprising 4 convolutional layers and 2 fully connected layers was developed in Python using the Keras and TensorFlow machine learning packages. The network was trained over 500 epochs, achieving maximum training and validation accuracy without overfitting. Misclassified heartbeats were reviewed to identify potential sources of error during hyperparameter tuning. The test data set was evaluated by the network. Results The neural network achieved accuracy of 99.06% on the test data with an f1 score of 0.99. Individual beat level precision ranged from 0.846 to 1 and recall ranged from 0.733 to 0.999. Beat types of smaller sample size had precision and recall at the lower end of the range, although still at diagnostically useful levels. Conclusions This research demonstrates that deep convolutional neural networks can accurately classify cardiac arrhythmia from heartbeats that have been converted into images. This approach requires no feature engineering or noise reduction, producing high precision and recall results at diagnostically meaningful levels across all arrhythmia beat types. Although this project used a relatively small amount of data on a consumer-class GPU, the results suggest that this is a promising approach for further research at larger scale.
Summary statement
I developed a convolutional neural network that automatically identifies cardiac arrhythmia in ECG data at diagnostically accurate levels.
Help received
I designed and programmed the neural network myself.
Competition history
- CSEF 2019
Resources
Related projects
AJAS · 2025
Auto-Detection and Classification of Arrhythmias with ECG Signal Analysis
ISEF · 2021
An Active Role for Machine Learning in the Diagnosis of Cardiac Arrhythmias, Year Two
AJAS · 2022
Evaluating ECGs and Diagnosing Various Heart Conditions via Convolutional Neural Networks
AJAS · 2020
Designing a Machine Learning Solution to Atrial Fibrillation
JSHS · 2020
An Active Role for Machine Learning in the Diagnosis of Atrial Fibrillation Quentin Hughes Minnetonka High School
CSEF · 2019
MapAF: Deep Learning to Improve Therapy for Complex Human Heart Rhythm Abnormalities
ISEF · 2020
An Active Role for Machine Learning in the Diagnosis of Atrial Fibrillation
ISEF · 2018
Neural Networking System for Detecting and Analyzing Heart Pathologies
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects