Copyright (C) 2024 ETH Zurich, Switzerland. SPDX-License-Identifier: Apache-2.0. See LICENSE file for details.
Authors: Thorir Mar Ingolfsson, Simone Benatti, Xiaying Wang, Adriano Bernini, Pauline Ducouret, Philippe Ryvlin, Sandor Beniczky, Luca Benini & Andrea Cossettini
This repository contains two major components for EEG analysis: Artifact Detection and Seizure Detection. Each component includes code, data processing scripts, and experimental environments designed to reproduce results reported in associated research papers.
The Artifact Detection module provides an environment for detecting artifacts in EEG data using tree-based classifiers. The details of this approach are discussed in the papers:
- Minimizing artifact-induced false-alarms for seizure detection in wearable EEG devices with gradient-boosted tree classifiers, available on Nature.
- Energy-efficient tree-based EEG artifact detection, available on IEEE.
This module is located in the Artifact_Detection
directory and includes scripts for data processing, model training, and evaluation.
- Dataset: Download the TUH EEG Artifact Corpus (TUAR) from here (use version 2.0.0). Configure the path in
data_making/create_dataset.py
as specified inArtifact_Detection/README.md
. - Environment Setup: Create the required environment:
conda env create -f Artifact_Detection/TPOT.yml -n TPOT
conda activate TPOT
- Running the Code:
- First, generate the datasets by running
create_dataset.py
in thedata_making
folder. - Follow up with
make_features.py
to extract features andunroll_data.py
to prepare the data. - Train models using
TPOT_search.py
and evaluate using scripts in theplotting
directory.
For more details, refer to Artifact_Detection/README.md
.
The Seizure Detection module is designed to minimize false alarms for seizure detection in wearable EEG devices using gradient-boosted tree classifiers. Details can be found in the paper Minimizing artifact-induced false-alarms for seizure detection in wearable EEG devices with gradient-boosted tree classifiers, available on Nature.
This module is located in the Seizure_Detection
directory and includes all scripts for data preparation, model training, and evaluation.
- Dataset: Download the CHB-MIT dataset from here and configure paths for
data_dir
anddata_save
inmake_data.py
. - Environment Setup: Create the required environment:
conda env create -f Seizure_Detection/XGBoost.yml -n XGBoost
conda activate XGBoost
- Running the Code:
- Generate dataset features by running
make_data.py
. - Train models using
train_xgboost.py
for global models and cross-validation scripts (train_xgboost_LOOCV.py
,train_xgboost_RFCV.py
, andtrain_xgboost_WFCV.py
) for subject-specific models. - View results with the
read_results.ipynb
notebook.
For more information, see Seizure_Detection/README.md
.
If you find this work useful, please cite the respective papers for each component:
For Seizure Detection:
@article{ingolfsson2024minimizing,
title={Minimizing artifact-induced false-alarms for seizure detection in wearable EEG devices with gradient-boosted tree classifiers},
author={Ingolfsson, Thorir Mar and Benatti, Simone and Wang, Xiaying and Bernini, Adriano and Ducouret, Pauline and Ryvlin, Philippe and Beniczky, Sandor and Benini, Luca and Cossettini, Andrea},
journal={Scientific Reports},
volume={14},
number={1},
pages={2980},
year={2024},
publisher={Nature Publishing Group UK London}
}
For Artifact Detection:
@article{ingolfsson2024minimizing,
title={Minimizing artifact-induced false-alarms for seizure detection in wearable EEG devices with gradient-boosted tree classifiers},
author={Ingolfsson, Thorir Mar and Benatti, Simone and Wang, Xiaying and Bernini, Adriano and Ducouret, Pauline and Ryvlin, Philippe and Beniczky, Sandor and Benini, Luca and Cossettini, Andrea},
journal={Scientific Reports},
volume={14},
number={1},
pages={2980},
year={2024},
publisher={Nature Publishing Group UK London}
}
and
@inproceedings{ingolfsson2022energy,
title={Energy-efficient tree-based EEG artifact detection},
author={Ingolfsson, Thorir Mar and Cossettini, Andrea and Benatti, Simone and Benini, Luca},
booktitle={2022 44th Annual International Conference of the IEEE Engineering in Medicine \& Biology Society (EMBC)},
pages={3723--3728},
year={2022},
organization={IEEE}
}
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.