BioDG is a publically available framework for the evaluation of Domain Generalization algorithms in Biosignal Classification.
Python
27
15 commits
updated Dec 12, 2025
BioDG is a PyTorch suite containing benchmark datasets and algorithms for domain generalization, as introduced in Towards Domain Generalization for ECG and EEG Classification: Algorithms and Benchmarks.
The available algorithms were based on DomainBed and modified for 1D biosignal classification.
The currently available ECG algorithms and currently available EEG algorithms are:
The currently available datasets are:
The datasets for the ECG Domain Generalization setup were taken from the 2020 PhysioNet Challenge and are the:
To download the above datasets run the following in a terminal:
# Download all files
wget -r -N -c -np -R "index.html*" https://physionet.org/files/challenge-2020/1.0.2/training/
# INCART Annotations -- Extract data and rename folder to 'annotations'
wget -r -N -c -np -R "index.html*" https://physionet.org/files/incartdb/1.0.0/training/
mv physionet.org/files/challenge-2020/1.0.2/training/ .
mv physionet.org/files/challenge-2020/1.0.0/training/ annotations/
After downloading the datasets, please also download the following files:
After extracting all datasets, the ECG data directory should follow the below tree structure:
├── annotations
├── cpsc_2018
├── cpsc_2018_extra
├── georgia
├── ptb
├── ptb-xl
├── st_petersburg_incart
├── dx_mapping_scored.csv
└── dx_mapping_unscored.csv
The datasets for the EEG Domain Generalization are provided by the BCMI laboratory of the Shanghai Jiao Tong University, and are the following:
The datasets are available for research purposes, after applying here.
python3 ECG/convert_to_pickles.py --hostname user --outpath 'path to directory where converted data will be stored'
python3 experiments/ecg_dg_train.py\
--network RSC --algorithm RSC\
--c "Flags are mentioned in the experiment file"
python3 experiments/ecg.py --model biodg_resnet18 --epochs 30 --optim adam --batch_size 128
python3 EEG/split_de_features.py\
--eeg_de_features_path 'path to 1s_de_feature folder in EEG dataset'
--split_data_path 'output path for split data'
--dataset 'one between china, fra or ger'
python3 experiments/eeg_dg_train.py\
--network ERM --algorithm ERM\
--c "Flags are mentioned in the experiment file"
python3 experiments/eeg.py --epochs 20 --optim adam --batch_size 128
If you use the above code for your research please cite our paper, which as of the 22nd of June 2023 has been accepted at IEEE TETCI:
@ARTICLE{10233054,
author={Ballas, Aristotelis and Diou, Christos},
journal={IEEE Transactions on Emerging Topics in Computational Intelligence},
title={Towards Domain Generalization for ECG and EEG Classification: Algorithms and Benchmarks},
year={2024},
volume={8},
number={1},
pages={44-54},
keywords={Brain modeling;Biological system modeling;Electrocardiography;Data models;Electroencephalography;Adaptation models;Feature extraction;Biosignal classification;deep learning;domain generalization;1D signal classification;electrocardiogram (ECG) classification;electroencephalogram (EEG) classification},
doi={10.1109/TETCI.2023.3306253}}
If you are interested in other 1D biosignals, such as Phonocardiograms (PCG), check out our paper "Which Augmentation Should I Use? An Empirical Investigation of Augmentations for Self-Supervised Phonocardiogram Representation Learning", accepted in IEEE Access, here:
https://github.com/aristotelisballas/listen2yourheart/tree/main
@ARTICLE{10804781,
author={Ballas, Aristotelis and Papapanagiotou, Vasileios and Diou, Christos},
journal={IEEE Access},
title={Which Augmentation Should I Use? An Empirical Investigation of Augmentations for Self-Supervised Phonocardiogram Representation Learning},
year={2024},
volume={12},
number={},
pages={193459-193472},
keywords={Brain modeling;Phonocardiography;Biological system modeling;Training;Data models;Electrocardiography;Electroencephalography;Feature extraction;Robustness;Representation learning;Contrastive learning;deep learning;OOD representation learning;phonocardiogram classification;self-supervised learning},
doi={10.1109/ACCESS.2024.3519297}}
This source code is released under the MIT license.
BioDG is a publically available framework for the evaluation of Domain Generalization algorithms in Biosignal Classification.
Python
27
15 commits
updated Dec 12, 2025
BioDG is a PyTorch suite containing benchmark datasets and algorithms for domain generalization, as introduced in Towards Domain Generalization for ECG and EEG Classification: Algorithms and Benchmarks.
The available algorithms were based on DomainBed and modified for 1D biosignal classification.
The currently available ECG algorithms and currently available EEG algorithms are:
The currently available datasets are:
The datasets for the ECG Domain Generalization setup were taken from the 2020 PhysioNet Challenge and are the:
To download the above datasets run the following in a terminal:
# Download all files
wget -r -N -c -np -R "index.html*" https://physionet.org/files/challenge-2020/1.0.2/training/
# INCART Annotations -- Extract data and rename folder to 'annotations'
wget -r -N -c -np -R "index.html*" https://physionet.org/files/incartdb/1.0.0/training/
mv physionet.org/files/challenge-2020/1.0.2/training/ .
mv physionet.org/files/challenge-2020/1.0.0/training/ annotations/
After downloading the datasets, please also download the following files:
After extracting all datasets, the ECG data directory should follow the below tree structure:
├── annotations
├── cpsc_2018
├── cpsc_2018_extra
├── georgia
├── ptb
├── ptb-xl
├── st_petersburg_incart
├── dx_mapping_scored.csv
└── dx_mapping_unscored.csv
The datasets for the EEG Domain Generalization are provided by the BCMI laboratory of the Shanghai Jiao Tong University, and are the following:
The datasets are available for research purposes, after applying here.
python3 ECG/convert_to_pickles.py --hostname user --outpath 'path to directory where converted data will be stored'
python3 experiments/ecg_dg_train.py\
--network RSC --algorithm RSC\
--c "Flags are mentioned in the experiment file"
python3 experiments/ecg.py --model biodg_resnet18 --epochs 30 --optim adam --batch_size 128
python3 EEG/split_de_features.py\
--eeg_de_features_path 'path to 1s_de_feature folder in EEG dataset'
--split_data_path 'output path for split data'
--dataset 'one between china, fra or ger'
python3 experiments/eeg_dg_train.py\
--network ERM --algorithm ERM\
--c "Flags are mentioned in the experiment file"
python3 experiments/eeg.py --epochs 20 --optim adam --batch_size 128
If you use the above code for your research please cite our paper, which as of the 22nd of June 2023 has been accepted at IEEE TETCI:
@ARTICLE{10233054,
author={Ballas, Aristotelis and Diou, Christos},
journal={IEEE Transactions on Emerging Topics in Computational Intelligence},
title={Towards Domain Generalization for ECG and EEG Classification: Algorithms and Benchmarks},
year={2024},
volume={8},
number={1},
pages={44-54},
keywords={Brain modeling;Biological system modeling;Electrocardiography;Data models;Electroencephalography;Adaptation models;Feature extraction;Biosignal classification;deep learning;domain generalization;1D signal classification;electrocardiogram (ECG) classification;electroencephalogram (EEG) classification},
doi={10.1109/TETCI.2023.3306253}}
If you are interested in other 1D biosignals, such as Phonocardiograms (PCG), check out our paper "Which Augmentation Should I Use? An Empirical Investigation of Augmentations for Self-Supervised Phonocardiogram Representation Learning", accepted in IEEE Access, here:
https://github.com/aristotelisballas/listen2yourheart/tree/main
@ARTICLE{10804781,
author={Ballas, Aristotelis and Papapanagiotou, Vasileios and Diou, Christos},
journal={IEEE Access},
title={Which Augmentation Should I Use? An Empirical Investigation of Augmentations for Self-Supervised Phonocardiogram Representation Learning},
year={2024},
volume={12},
number={},
pages={193459-193472},
keywords={Brain modeling;Phonocardiography;Biological system modeling;Training;Data models;Electrocardiography;Electroencephalography;Feature extraction;Robustness;Representation learning;Contrastive learning;deep learning;OOD representation learning;phonocardiogram classification;self-supervised learning},
doi={10.1109/ACCESS.2024.3519297}}
This source code is released under the MIT license.