Skip to content

SeqSleepNet: End-to-End Hierarchical Recurrent Neural Network for Sequence-to-Sequence Automatic Sleep Staging

Notifications You must be signed in to change notification settings

pquochuy/SeqSleepNet

Repository files navigation

SeqSleepNet

SeqSleepNet

These are source code and experimental setup for the MASS database, used in our above arXiv preprint. Although the networks have many things in common, we try to separate them and to make them work independently to ease exploring them invididually.

Currently, SeqSleepNet and two baselines E2E-ARNN and Multitask E2E-ARNN are available (E2E-DeepSleepNet baseline is still missing, we will clean it up and make it available shortly). Output of t nheetworks are also included, so that you can re-produce the results with the evaluation scripts. However, you can repeat the experiments following the steps below.

How to run:

  1. Download the database
  • MASS database is available here. Information on how to obtain it can be found therein.
  1. Data preparation
  • Change directory to ./data_processing/
  • Run main_run.m
  1. Network training and testing
  • Change directory to a specific network in ./tensorflow_net/, for example ./tensorflow_net/SeqSleepNet/
  • Run a bash script, e.g. bash run_seq20.sh, to repeat 20 cross-validation folds.
  1. Evaluation
  • Execute a specific evaluation Matlab script, for example eval_seqsleepnet.m

An example:

Matlab files of the used database can be requested but it's best to request for the orignial MASS database. So far, many told that requests for the database were not responded/took so long. I'd suggest to be patient.

In order to give an idea about the data structure and how to run the networks, I have added a small example

  1. Matlab files and data list of the example stored in ./example_data/
  2. Network training and testing
  • Change directory to a specific network in ./tensorflow_net/, for example ./tensorflow_net/SeqSleepNet/
  • Run a bash script, e.g. run_example_seq10_3chan.sh, to train and test SeqSleepNet-10 with the example data.

Environment:

  • Matlab v7.3 (for data preparation)
  • Python3
  • Tensorflow GPU 1.x (x >= 3) (for network training and evaluation)

Some results:

Sleep scoring with SeqSleepNet for one subject of MASS databaset:

scoring

Illustration of attention weights learned by SeqSleepNet on five epochs of different sleep stages:

attention_weights

Contact:

Huy Phan

School of Electronic Engineering and Computer Science
Queen Mary University of London
Email: h.phan{at}qmul.ac.uk

License

CC-BY-NC-4.0

About

SeqSleepNet: End-to-End Hierarchical Recurrent Neural Network for Sequence-to-Sequence Automatic Sleep Staging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published