Icon

ecg_​cnn_​mit

ECG MIT-BIH Data Analysis and Modelling

This is also the ECG dataset from Kaggle, put together from PhysioNet MIT-BIH Arrhythmia (https://www.kaggle.com/shayanfazeli/heartbeat). This dataset is pre-processed with heartbeats recorded in a 10 second window and is classified in 5 categories:

0.0: Normal Heartbeat
1.0: Atrial premature
2.0: Premature ventricular contraction
3.0: Fusion of ventricular and normal
4.0: Unclassifiable

For more details, please read the paper at (https://arxiv.org/pdf/1805.00794.pdf).
In this workflow Conv1D Neural Network is trained for the classification task. The network implemented is a small version of what is described in the paper.

Read more about this workflow here: https://www.knime.com/blog/ecg-categorization-to-detect-arrhythmia

URL: Kaggle Dataset https://www.kaggle.com/shayanfazeli/heartbeat
URL: ECG Heartbeat Classification: A Deep Transferable https://arxiv.org/pdf/1805.00794.pdf

Visualize sample Beats from each class and check for class imbalance

This part of workflow deals with modelling on processed data

Read data for Physikalisch-Technische Bundesanstalt (PTB) ECG dataset available on Kaggle: https://www.kaggle.com/shayanfazeli/heartbeat. Configure the Decompress Files node so that it points to the PTB data .zip folder.

PTB dataset is already preprocessed with heartbeats recorded in a 10 second window and is classified in 5 categories:

  • 0.0: Normal Heartbeat

  • 1.0: Atrial premature

  • 2.0: Premature ventricular contraction

  • 3.0: Fusion of ventricular and normal

  • 4.0: Unclassifiable

For more details on prepreocessing, read the preprocessing section in this paper: https://arxiv.org/pdf/1805.00794.pdf

In this workflow Conv1D Neural Network is trained for the classification task. The network implemented is a small version of what is described in the paper.

Decompress Files
Train/Test Split with 80% for train and 20% for test. Test to be used as Validation set.
Partitioning
mitbh_train
CSV Reader
mitbh_test
CSV Reader
Save weights of trained model
Keras Network Writer
Predictions on test data
Keras Network Executor
Join predictions column and test data class column
Joiner
Important! Swap the order of class columns to 0.0 - 4.0
Column Resorter
One-Hot Encode
One to Many
Pie/Donut Chart (JavaScript)
Add decimal to String Predictions
Add in Decimal
Downsample 0.0 class (Normal Heartbeats) to 25% of the dataset
Bootstrap Sampling
Split class 0.0 (Bottom) for downsampling
Nominal Value Row Splitter
Append downsampled class with rest of the class variables
Concatenate
Many to One
Plot Sample Beats
Check model performance
Scorer
Convert class variable to String to use for Stratified Sampling
Number to String
Creates a Conda Env
Conda Environment Propagation
SMOTE all minority classes
SMOTE
Shuffle Rows to input in
Shuffle
Cache SMOTED tableto avoid repeating the process
CSV Writer
Keras model structure
Neural Network Model
Read Smoted data
CSV Reader
Final configurations for neural network
Keras Network Learner

Nodes

Extensions

Links