- 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
(Benelux's IEEE-EMBS Best Paper Award 2019-20, featured 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.
- Evaluation
- Execute a specific evaluation Matlab script, for example
eval_seqsleepnet.m
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
- Matlab files and data list of the example stored in
./example_data/
- 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.
- Matlab v7.3 (for data preparation)
- Python3
- Tensorflow GPU 1.x (x >= 3) (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
School of Electronic Engineering and Computer Science
Queen Mary University of London
Email: h.phan{at}qmul.ac.uk
CC-BY-NC-4.0