- Huy Phan, Kaare Mikkelsen, Oliver Y. Chén, Philipp Koch, Alfred Mertins, and Maarten De Vos. SleepTransformer: Automatic Sleep Staging With Interpretability and Uncertainty Quantification. IEEE Transactions on Biomedical Engineering (TBME), vol. 69, no. 8, pp. 2456-2467, 2022. [PDF] [Preprint]
These are source code and experimental setup for SHHS.
- Download the database SHHS. This may require to apply for licences. Information on how to obtain it can be found in the corresponding website.
- To prepare data
run
shhs_data.m
- Split data and generate file lists
run
data_split_eval.m
rungenlist_scratch_training.m
(Not: I have included the "data_split_eval.mat" file and the "file_list" folder, you dont have to run this step again) - Training and evaluation run bash scripts in "scratch_training/sleeptransformer". The environment I used was Tensorflow 1.13, Python 3.7
- Run matlab scripts in "evaluation" folders to aggregate the network outputs and compute metrics for example, run aggregate_sleeptransformer.m
The model weights trained on SHHS are available at https://zenodo.org/record/7927282 for reproducing the results in the paper.
- Matlab v7.3 (for data preparation)
- Python3.7
- Tensorflow GPU 1.x (x >= 3) (for network training and evaluation)
- numpy
- scipy
- h5py
- sklearn
CC-BY-NC-4.0