Atrial Fibrillation Classification via 1D-CNN and 2D-CNN
In this project, I use the open ECG dataset from AF Classification from a Short Single Lead ECG Recording - The PhysioNet Computing in Cardiology Challenge 2017, dataset can be found in here.
In dataset, there are total 8528 short single lead ECG recordings collected by AliveCor device. The ECG recordings last from 9s to 60s and were sampled as 300Hz and have been band pass filtered by AliverCor device. The recordings have been categorized into 4 types: Normal rhythm, Atrial fibrillation, other rhythm and noisy recordings.
Type | Recording | Mean | SD | Max | Median | Min |
---|---|---|---|---|---|---|
Normal | 5154 | 31.9 | 10.0 | 61.0 | 30 | 9.0 |
AF | 771 | 31.6 | 12.5 | 60 | 30 | 10.0 |
Other | 2557 | 34.1 | 11.8 | 60.9 | 30 | 9.1 |
Noisy | 46 | 27.1 | 9.0 | 60 | 30 | 10.2 |
Total | 8528 | 32.5 | 10.9 | 61.0 | 30 | 9.0 |
Overview
QRS complex detection
Apply Hamilton QRS complex detection algorithm to locate the R peaks of ECG signals.
Heartbeat segmentation
1D-CNN
2D-CNN
Download ECG dataset:
Download dataset in here and extract training2017 and sample2017 folders.
Execute preprocess.py to prepare training input for further CNN training
python3 Preprocess.py
python3 main.py
tensorboard --logdir logs/