Skip to content

SleepEEGNet: Automated Sleep Stage Scoring with Sequence to Sequence Deep Learning Approach

Notifications You must be signed in to change notification settings

lsookie/SleepEEGNet

 
 

Repository files navigation

SleepEEGNet: Automated Sleep Stage Scoring with Sequence to Sequence Deep Learning Approach

In this study, we introduced a novel deep learning approach, called SleepEEGNet, for automated sleep stage scoring using a single-channel EEG.

Paper

Our paper can be downloaded from the arxiv website.

  • The Model architecture Alt text

  • The CNN architecture

Alt text

Requirements

  • Python 2.7
  • tensorflow/tensorflow-gpu
  • numpy
  • scipy
  • matplotlib
  • scikit-learn
  • matplotlib
  • imbalanced-learn(0.4.3)
  • pandas
  • mne

Dataset and Data Preparation

We evaluated our model using the Physionet Sleep-EDF datasets published in 2013 and 2018.
We have used the source code provided by github:akaraspt to prepare the dataset.

  • To download SC subjects from the Sleep_EDF (2013) dataset, use the below script:
cd data_2013
chmod +x download_physionet.sh
./download_physionet.sh
  • To download SC subjects from the Sleep_EDF (2018) dataset, use the below script:
cd data_2018
chmod +x download_physionet.sh
./download_physionet.sh

Use below scripts to extract sleep stages from the specific EEG channels of the Sleep_EDF (2013) dataset:

python prepare_physionet.py --data_dir data_2013 --output_dir data_2013/eeg_fpz_cz --select_ch 'EEG Fpz-Cz'
python prepare_physionet.py --data_dir data_2013 --output_dir data_2013/eeg_pz_oz --select_ch 'EEG Pz-Oz'

Train

  • Modify args settings in seq2seq_sleep_sleep-EDF.py for each dataset.

  • For example, run the below script to train SleepEEGNET model with the 20-fold cross-validation using Fpz-Cz channel of the Sleep_EDF (2013) dataset:

python seq2seq_sleep_sleep-EDF.py --data_dir data_2013/eeg_fpz_cz --output_dir output_2013 --num_folds 20

Results

  • Run the below script to present the achieved results by SleepEEGNet model for Fpz-Cz channel.
python summary.py --data_dir output_2013/eeg_fpz_cz

Alt text

Visualization

  • Run the below script to visualize attention maps of a sequence input (EEG epochs) for Fpz-Cz channel.
python visualize.py --data_dir output_2013/eeg_fpz_cz

Citation

If you find it useful, please cite our paper as follows:

@article{mousavi2019sleepEEGnet,
  title={SleepEEGNet: Automated Sleep Stage Scoring with Sequence to Sequence Deep Learning Approach},
  author={Sajad Mousavi, Fatemeh Afghah and U. Rajendra Acharya},
  journal={arXiv preprint arXiv:1903.02108},
  year={2019}
}

References

github:akaraspt
deepschool.io

Licence

For academtic and non-commercial usage

About

SleepEEGNet: Automated Sleep Stage Scoring with Sequence to Sequence Deep Learning Approach

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 85.3%
  • Shell 14.7%