Cardiovascular Disease Classification Employing Empirical Mode Decomposition (EMD) of Modified ECG
This repository is licensed under the MIT License - see the LICENSE file for details
- tensorflow
- teensorflow-gpu
- theano
- keras
- scikit-learn
- numpy
- matplotlib
- scipy
- wfdb package of PhysioNet
- GPUtil
- pickle
- pydot
- graphviz
- pyhht
If you are benefited by this repository or the research, please cite the work as follows.
- @article{HASAN2019128,
title = "Deep Learning Approach to Cardiovascular Disease Classification Employing Modified ECG Signal from Empirical Mode Decomposition",
journal = "Biomedical Signal Processing and Control",
author = "Nahian Ibn Hasan and Arnab Bhattacharjee",
volume = "52",
pages = "128 - 140",
year = "2019",
issn = "1746-8094",
doi = "https://doi.org/10.1016/j.bspc.2019.04.005",
url = "http://www.sciencedirect.com/science/article/pii/S1746809419301028"}
- Cardiovascular disease classification based on Modified ECG employing Empirical Mode Decomposition.
- Different modes of training such as maximum voting strategy, parallel mode and etc.
- Compare modified ECG and raw ECG signal
- Visualization of Empirical Mode Decomposition
- Validate on multiple database such as MIT-BIH Arrhythmia database, PTB diagonstic database, St.-Petersburg Arrhythmia database etc. from PhysioNet.
- Different combinations of IMF testing
- Customizable to any custom built database
- Analyze the test result through confusion matrix
- custom learning rate scheduler implementation
- custom network implementation
- 1-D version of many standard DNN architectures such as Alexnet, ZFNet, Resnet150, GoogleNet and etc.
- provision for individual network structure for each of IMF signals
- Nahian Ibn Hasan
- Email: nahianhasan1994@gmail.com
- LinkedIn: www.linkedin.com/in/nahian-ibn-hasan-buet
- Bangladesh University of Engineering and Technology (BUET)
- Dhaka, Bangladesh
- Arnab Bhattacharjee
- Email:pritamarnab@gmail.com
- Bangladesh University of Engineering and Technology (BUET)
- Dhaka, Bangladesh
This readme file will instruct you to run the codes in this repository and customize it to your own database.
- config.py--------------------------------- contains parameters.
- Folder_creation.py------------------------ creates separate folders to store the training outputs.
- EMD_Models.py----------------------------- contains different network architectures to train the model.
- EMD_Models_Parallel.py-------------------- contains parallel architectures for training. [for details refer to the original elsevier article.]
- EMD_data_prepare.py------ code for generating IMF signals from EMD analysis of signals.
- EMD_data_train_all_combinations_pc.py----- train on specified IMF combination in a CPU
- EMD_data_train_any_combinations.py-------- train on specified IMF combination in a GPU
- EMD_data_training_pc.py------------------- train on individual IMF in CPU
- EMD_data_training_server.py--------------- train on individual IMF in GPU
- EMD_data_training_server_ensembled.py----- train on IMF[1,2,3] combination only in GPU
- EMD_ensembled_data_prepare_Test_server.py- Modified ECG signal formation from IMF[1,2,3] for test purpose.
- EMD_ensembled_data_prepare_Train_server.py-Modified ECG signal formation from IMF[1,2,3] for train purpose.
- EMD_Test_all_combinations.py-------------- Test code on specified IMF combination
- EMD_Test.py------------------------------- Test code on individual IMF.
- EMD_Parallel_Test.py---------------------- Test code on parallel architecture
- EMD_Parallel_Test_3_IMF.py---------------- Test code on parallel architecture of 3 specified IMFs only.
- EMD_Test_original.py---------------------- Test code on original raw signal
- Original_signal_Data_prepare.py----------- Prepare original raw data for training
- confusion_mat_plot.py--------------------- Confusion matrix plot[used by Confusion_Matrix.py]
- Confusion_Matrix.py----------------------- Confusion matrix plot
- Confusion_Matrix_Parallel.py-------------- Confusion matrix for parallel architecture
- all_combinations_plot.py------------------ Plot the accuracy of all combinations used for modified ECG
- modified_ECG_analysis_MIT_BIH.py---------- Pearson correlation coefficient calculation for each of the classes considered from MIT-BIH Arrhythmia database
- modified_ECG_analysis_PTB_Petes.py-------- Pearson correlation coefficient calculation for each of the classes considered from PTB and ST.-Petersberg database
- EMD_visualization_petersburg.py----------- IMFs visualization of Petersburg Database
- EMD_visualization_PTB.py------------------ IMFs visualization of PTB databse
- learning_rate_scheduler.py---------------- learning rate scheduler visualize used in training
- modified_EMD_visualization_Petersburg.py-- Modified EMD comparison with raw signal of Petersburg database
- modified_EMD_visualization_PTB.py--------- Modified EMD comparison with raw signal of PTB database
python EMD_data_train_any_combinations.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -res = Resume Training | default='False'
- -inep = Initial Epoch after Resuming Training | default=config.initial_epoch
- -reim = Resumed IMF number after resuming | default=1
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -spl = Splitting percentage of train and test(upper limit) | type=float | default=config.split_perc
- -fold* = Save training and testing results in folder
python EMD_data_train_all_combinations_pc.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -res = Resume Training | default='False'
- -inep = Initial Epoch after Resuming Training | default=config.initial_epoch
- -reim = Resumed IMF number after resuming | default=1
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -spl = Splitting percentage of train and test(upper limit) | type=float | default=config.split_perc
- -fold* = Save training and testing results in folder
python EMD_data_training_server.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -res = Resume Training | default='False'
- -inep = Initial Epoch after Resuming Training | default=config.initial_epoch
- -reim = Resumed IMF number after resuming | default=1
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -spl = Splitting percentage of train and test(upper limit) | type=float | default=config.split_perc
- -fold* = Save training and testing results in folder
python EMD_data_training_pc.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -res = Resume Training | default='False'
- -inep = Initial Epoch after Resuming Training | default=config.initial_epoch
- -reim = Resumed IMF number after resuming | default=1
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -spl = Splitting percentage of train and test(upper limit) | type=float | default=config.split_perc
- -fold* = Save training and testing results in folder
python EMD_data_training_server_ensembled.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -res = Resume Training | default='False'
- -inep = Initial Epoch after Resuming Training | default=config.initial_epoch
- -reim = Resumed IMF number after resuming | default=1
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -spl = Splitting percentage of train and test(upper limit) | type=float | default=config.split_perc
- -fold* = Save training and testing results in folder
python EMD_data_prepare.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -spl = Splitting percentage of train and test(upper limit) | type=float | default=config.split_perc
python EMD_ensembled_data_prepare_Train_server.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -trl* = training file list as a csv file
python EMD_ensembled_data_prepare_Test_server.py -options
options
* means mandatory argument
- -p = Path to the main database | deafault = config.data_path
- -c = Path to the CSV Folder of EMD Data | default = config.IMF_csv_path
- -rc = Path to the Patient file RECORD.txt | default=config.patient_data_path
- -pd = Path to the text file where problematic data to be stored | default=config.preoblem_data_path
- -s = Number of samples to be taken by each record",type=int | default=config.samplenumber
- -imf = Number of IMFs to be extracted | default=config.number_of_IMFs | choices=[2,3,4,5,6]
- -tel* = test file list as a csv file