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

hymedc/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.
    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.
  1. Evaluation
  • Execute a specific evaluation Matlab script, for example eval_seqsleepnet.m

Environment:

  • Matlab v7.3 (for data preparation)
  • Python3
  • Tensorflow GPU 1.3.0 (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

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

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

Languages

  • Python 46.0%
  • Shell 40.6%
  • MATLAB 13.4%