TensorFlow implementation of ecg classification.
To prepare the dataset create_traindataset_mitdb.py extract the beats from all patients, compute the RR interval information and set their corresponding label from the annotation files.
In dnn_mitdb.py a DNN default classifier from tensorflow is used
mitdb_classifier = tf.contrib.learn.DNNClassifier(feature_columns=feature_columns,
hidden_units=[10, 20, 10],
n_classes=5)
Due to the imbalanced data (common in that problem) between N class and anomalies class (SVEB, VEB, F). In my_dnn_mitdb.py a classifier that adjust the weight for loss computation during training step is defined.
def my_model_fn(features, targets, mode, params):
...
loss = tf.losses.softmax_cross_entropy(targets_onehot, output_layer, weights=weights_tf)
...
my_nn = tf.contrib.learn.Estimator(model_fn=my_model_fn, params=model_params)
Tensorflow
python-matplotlib
pywavelets