This repository holds the source code of our PAKDD 2020 paper "Simultaneous ECG Heartbeat Segmentation and Classification with Feature Fusion and Long Term Context Dependencies". Please note that some of the code is transferred from other repositories. Please use our code, as well as that shared by other contributors, in accordance with the respective licenses and protocols.
Please take the following steps to run our code.
- Download the MIT-BIH database to directory:/data_2
- cd tool/
- Run in shell/terminal: python setup.py build develop
- cd tool/batch
- Run in shell/terminal: python setup.py build develop
- Run cls1.py or cls2.py to select a pre-trained model and rename as "base_max.p"
- Run train_test1.py to get segment result and model, rename as 'base_a1_max.p' and 'rpn_a1_max.p'
- Run train_test2.py to get classification result
Our experiments were run in the following environment.
Python 3.7
Pytorch 1.1.0
Cuda 10.0
Ubuntu 18.04.1