In the cardiovascular disease (CVD) classification, there are two main challenges. First, the current electrocardiogram (ECG) datasets consistently exhibit imbalances and biases towards different modalities. Second, the time-series data comprises diverse lead signals, causing the input data for Convolutional Neural Networks (CNNs) to become huge in dimensionality, thereby diminishing the learning efficiency of the Deep Learning (DL) process. Additionally, when the ECG data are short, performance from such high-dimensional data may be susceptible to overfitting. Despite these evident challenges, current efforts predominantly concentrate on enhancing DL models by designing novel architectures, seemingly overlooking the core issues. This narrow focus hinders advancements in ECG classification. To tackle these challenges, the proposed method introduces two straightforward methods to enhance the classification tasks. A Channel-wise Magnitude Equalizer (CME) is proposed on signal-encoded images to address the high dimensionality issue. This approach reduces redundancy in the feature data range, highlighting changes in the dataset. Simultaneously, to counteract data imbalance, the Inverted Weight Logarithmic (IWL) loss is introduced to alleviate imbalances among the data. When applying IWL loss, the accuracy of state-of-the-art models (SOTA) increases up to
The zip file that we provide includes:
- File
make_environment.py
: used to create a virtual environment. - File
requirements.txt
: used to install all necessary Python packages. - 3 folders: "SPH Dataset", "Chapman Dataset", and "CPSC2018 Dataset", each of them contain:
- Folder "Proposed_Method": includes two jupyter notebooks implementing proposed CME and IWL loss method. One notebook with 0.05 alpha value and one with 0.01 alpha value.
- Folder "SOTA_Model"
- Folder "Reimplement_Model": include jupyter notebooks that we reimplement the state-of-the-art existed methods.
- Folder "Model_Architectures": include jupyter notebooks that we test the adaptability of proposed methods on recent model architectures.
- Folder "SOTA_Loss": include jupyter notebooks that use proposed CME method with several existed loss functions.
This work can be conducted on any platform: Windows, Ubuntu, Google Colab. In Windows or Ubuntu use the following script to create a virtual environment.
cd path/to/ECG
python make_environment.py
The Python packages used in this project are listed below. All the packages can be installed by command pip install -r requirements.txt
.
wheel
pandas==1.4.4
matplotlib==3.6.0
numpy==1.19.5
tqdm==4.65.0
jupyter
torch==2.0.1
torchaudio==2.0.2
torchvision==0.15.2
torchmetrics==0.11.4
scipy==1.11.1
scikit-learn==1.3.0
datetime
Pytorch is the main package for conducting optimization calculations.
Directly run the jupyter notebook file " " and easily reproduce the results.