Skip to content

WilliamRo/EEG-Denoise

Repository files navigation

DTP-Net: Learning to Reconstruct EEG signals in Time-Frequency Domain by Multi-scale Feature Reuse

Introduction

A deep learning model for single-channel EEG artifact removal.

Code for the model in the paper DTP-Net: Learning to Reconstruct EEG signals in Time-Frequency Domain by Multi-scale Feature Reuse.

The architecture of DTP-Net:

DTP-Net Architecture

Environment

The following setup has been used to reproduce this work:

  • CUDA toolkit 10.1 and CuDNN 7.6.0
  • Python == 3.7
  • Tensorflow == 2.1.0
  • Matplotlib == 3.5.3
  • Numpy == 1.19.5
  • Scipy == 1.4.1

Prepare Dataset

We evaluate our DTP-Net with EEGDenoiseNet, Semi-Simulated EEG/EOG and MNE M/EEG dataset.

For EEGDenoiseNet, the dataset is publicly availabel as referenced in the article EEGdenoiseNet: A benchmark dataset for end-to-end deep learning solutions of EEG denoising.

For Semi-Simulated EEG/EOG, the dataset is publicly availabel as referenced in the article Adaptive Single-Channel EEG Artifact Removal With Applications to Clinical Monitoring.

For MNE M/EEG dataset, the dataset is using the sample dataset provided in the article EEGNet: a compact convolutional neural network for EEG-based brain–computer interfaces

For the sake of convenience, EEGDenoiseNet dataset and Semi-Simulated EEG/EOG dataset are temporarily placed in the G-node database and you can run the following scripts to download datasets.

gin get SummerBae/EEG-Denoise_Database

MNE M/EEG dataset would be download automatically when running 03-MNE_MEG_EEG_Dataset/erp.py.

Model Deployment I

Run this script to train a DTP-Net for model deployment I:

cd 01-EEGDenoiseNet_Dataset
python t1_dtpnet.py --noise_type EOG

noise_type denotes different artifacts source, including EMG, EOG and EMG_EOG.

The pre-trained models are saved in G-node database and you can run the following scripts to download checkpoints.

gin get SummerBae/EEG-Denoise_Database

Download the checkpints and save the checkpoints files SummerBae/EEG-Denoise_Database/01-EEGDenoiseNet_checkpoints/checkpoints in EEG-Denoise/01-EEGDenoiseNet_Dataset/.

Run this script to evaluate the denoise performance at different SNR levels of pre-trained models:

cd 01-EEGDenoiseNet_Dataset
python evaluation.py --noise_type EOG --plot_type metric_report

Denoise result at different SNR levels after EOG artifacts removal

Run this script to get waveform results and PSD results for eliminating artifacts of pre-trained models:

cd 01-EEGDenoiseNet_Dataset
python evaluation.py --noise_type EOG --plot_type denoise_visualize

Denoise waveform results and PSD results after EOG artifacts removal

Model Deployment II

Run this script to train a DTP-Net for model deployment II:

cd 02-Semi_Simulated_Dataset
python t2_dtpnet.py

The pre-trained models are saved in G-node database and you can run the following scripts to download checkpoints.

gin get SummerBae/EEG-Denoise_Database

Download the checkpints and save the checkpoints files SummerBae/EEG-Denoise_Database/02-Semi_Simulated_checkpoints/checkpoints in EEG-Denoise/02-Semi_Simulated_Dataset/.

Run this script to evaluate the denoise performance of pre-trained models:

cd 02-Semi_Simulated_Dataset
python evaluation.py --plot_type metric_report

Run this script to get waveform results and PSD results for eliminating artifacts of pre-trained models:

cd 02-Semi_Simulated_Dataset
python evaluation.py --plot_type denoise_visualize

Denoise waveform results and PSD results after artifacts removal

Run this script to get multi-channel waveform results for eliminating artifacts of pre-trained models:

cd 02-Semi_Simulated_Dataset
python evaluation.py --plot_type denoise_visualize_multi_channel 

Multi_Channel denoise waveform results and PSD results after artifacts removal

Model Deployment III

Run this script to get the ERP classification performance of raw data:

cd 03-MNE_MEG_EEG_Dataset
python erp.py

Run this script to get the ERP classification performance of data denoised by DTP-Net:

cd 03-MNE_MEG_EEG_Dataset
python erp.py --denoise

Citation

@article{Pei2024,
  title = {DTP-Net: Learning to Reconstruct EEG Signals in Time-Frequency Domain by Multi-scale Feature Reuse},
  ISSN = {2168-2208},
  url = {http://dx.doi.org/10.1109/JBHI.2024.3358917},
  DOI = {10.1109/jbhi.2024.3358917},
  journal = {IEEE Journal of Biomedical and Health Informatics},
  publisher = {Institute of Electrical and Electronics Engineers (IEEE)},
  author = {Pei,  Yan and Xu,  Jiahui and Chen,  Qianhao and Wang,  Chenhao and Yu,  Feng and Zhang,  Lisan and Luo,  Wei},
  year = {2024},
  pages = {1–12}
}

Licence

For academic and non-commercial use only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages