Supported Functionality

This page serves as a concise overview of datasets and preprocessing, training and evaluation methods currently supported by ECGAN.

Note

Not all preprocessing methods supported by the framework are used for every dataset and not every metric is in use for every method. If you feel like we are missing crucial preprocessing or evaluation steps please get in touch!

Supported Datasets

The dataset can best be set during initialization using the -b flag followed by the identifier below. We currently support the following datasets out of the box:

Dataset

Identifier

Dataset

Retriever

Preprocessor

MITBIH 1

mitbih

ecgan.utils.datasets.MitbihDataset

ecgan.preprocessing.data_retrieval.MitbihDataRetriever

Not supported

mitbih_beats

ecgan.utils.datasets.MitbihExtractedBeatsDataset

ecgan.preprocessing.data_retrieval.MitbihExtractedBeatsDataRetriever

ecgan.preprocessing.preprocessor.MitbihExtractedBeatsPreprocessor

mitbih_beatgan

ecgan.utils.datasets.MitbihBeatganDataset

ecgan.preprocessing.data_retrieval.MitbihBeatganDataRetriever

ecgan.preprocessing.preprocessor.MitbihBeatganPreprocessor

Shaoxing 2

shaoxing

ecgan.utils.datasets.ShaoxingDataset

ecgan.preprocessing.data_retrieval.ShaoxingDataRetriever

ecgan.preprocessing.preprocessor.ShaoxingPreprocessor

PTB 3

ptb

ecgan.utils.datasets.PTBExtractedBeatsDataset

ecgan.preprocessing.data_retrieval.PtbExtractedBeatsDataRetriever

ecgan.preprocessing.preprocessor.PtbExtractedBeatsPreprocessor

Synthetic sine 4

sine

ecgan.utils.datasets.SineDataset

ecgan.preprocessing.data_retrieval.SineDataRetriever

Not supported

1 a. Paper: Moody and Mark 2001, more information on the PhysioNet MITBIH Website. Data source: unofficial kaggle mirror. The data remains unchanged but is saved as csv. This dataset needs manual preprocessing by the user, we only support the download.
1 b. Paper: Kachuee et al. 2018. Data source: official Kaggle repository. Classes are according to the AAMI classification, each beat is classified individually.
1 c. Paper: Zhou et al. 2019. Data source: official Dropbox mirror. Data is centered, standardized, classes are according to AAMI, each beat is classified individually.
3 Original Paper: Bousseljot et al. 1995 Paper of data source: Kachuee et al. 2018. Data source: official Kaggle repository.
4 Artificial sine wave data, description can be found here: ecgan.preprocessing.data_retrieval.SineDataRetriever.

Additional public ECG datasets which are currently not supported include the recent PTB-XL from Wagner et al. 2020 and ECG 5000. More information on ECG datasets can be found on the PhysioNet Database.

Not all datasets are suitable for all tasks, the quality of the Shaoxing dataset is for example not necessarily high enough for reliable data generation. We hope to add more information and in-depth evaluations for the supported datasets in the future.

Supported Preprocessing

The preprocessing is not set as a flag during initialization, but can be changed after initialization, before starting ecgan-preprocess. Most importantly, you can select the sequence length (TARGET_SEQUENCE_LENGTH) and downsample or upsample the data. This is very important since the sequence length can be very important for the performance of a model and sometimes needs to be downsampled for computational requirements or upsampled to be a good fit for an existing architecture with a specific sequence length in mind. For downsampling we suggest using LTTB downsampling (DOWNSAMPLE_ALGO: lttb) to retain the structure of the time series. For upsampling we support the torch interpolation (DOWNSAMPLE_ALGO: interpolate) which uses linear interpolation between the values.

Supported Training

During training data is split into n Folds (CROSS_VAL_FOLDS in the configuration file). Many parameters such the desired (amount of) channels (either a list for the selected indices or an integer m to take the first m channels), flags to indicate if data shall be masked for binary classification (BINARY_LABELS), transformations such as various normalizations or the Fourier transform (TRANSFORMATION) can be set. It is further possible to train solely on healthy data which can be useful for some tasks such as various generative tasks. Other parameters which are of relevance for training many models (currently focusing deep learning models) can be set freely such as the amount of epochs or the batch size.

Supported Models

Can be selected using the -m flag.

  1. Data generation/synthesis:

    1. Traditional GAN based models (especially DCGAN/RGAN) with a variety of Loss functions. Usage -m dcgan, -m rgan, -m rdcgan.

    2. Autoencoder based GANs: using a (variational) autoencoder. Usage -m aegan, -m vaegan.

  2. Data classification:

    1. Simple RNN for (multiclass as well as single class) classification. Usage -m rnn.

    2. Simple CNN for (multiclass as well as single class) classification. Usage -m cnn.

Supported trackers

Training and evaluation can be tracked using Tracker which can be set using the TRACKER parameter in the experiment config. Currently supported options are local tracking (TRACKER: local) and Weights and Biases (TRACKER: wb). While local tracking is set as a default to not force people to sign up for another service to test ecgan, we strongly recommend Weights and Biases!

Further downstream tasks

The most important downstream tasks is the anomaly detection, see Anomaly Detection for detailed information. Supported techniques currently focus on pretrained models and include both, classification as well as generative models.

Additionally, inverse mappings can be trained for selected deep generative models. See Inverse Mapping for more information.