- Huy Phan, Fernando Andreotti, Navin Cooray, Oliver Y. Chén, and Maarten De Vos. SeqSleepNet: End-to-End Hierarchical Recurrent Neural Network for Sequence-to-Sequence Automatic Sleep Staging. IEEE Transactions on Neural Systems and Rehabilitation Engineering (TNSRE), vol. 27, no. 3, pp. 400-410, 2019
(Highlighted in the publish issue: Link)
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.
- Download the database
- MASS database is available here. Information on how to obtain it can be found therein.
- Data preparation
- Change directory to
./data_processing/
- Run
main_run.m
- 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.
Note1: You may want to modify and script to make use of your computational resources, such as place a few process them on multiple GPUs. If you want to run multiple processes on a single GPU, you may want to modify the Tensorflow source code to change GPU options when initializing a Tensorflow session.
- Evaluation
- Execute a specific evaluation Matlab script, for example
eval_seqsleepnet.m
- Matlab v7.3 (for data preparation)
- Python3
- Tensorflow GPU 1.3.0 (for network training and evaluation)
Sleep scoring with SeqSleepNet for one subject of MASS databaset:
Illustration of attention weights learned by SeqSleepNet on five epochs of different sleep stages:
Huy Phan
Institute of Biomedical Engineering
Department of Engineering Science
University of Oxford
Email: huy.phan{at}ieee.org
or
School of Computing
University of Kent
Email: h.phan{at}kent.ac.uk