/SleepTransformer

Primary LanguagePythonMIT LicenseMIT

SleepTransformer

SleepTransformer


These are source code and experimental setup for SHHS.

How to use:

  1. Download the database SHHS. This may require to apply for licences. Information on how to obtain it can be found in the corresponding website.
  2. To prepare data run shhs_data.m
  3. Split data and generate file lists run data_split_eval.m run genlist_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)
  4. Training and evaluation run bash scripts in "scratch_training/sleeptransformer". The environment I used was Tensorflow 1.13, Python 3.7
  5. 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.

Environment:

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

License

CC-BY-NC-4.0