Giter VIP home page Giter VIP logo

rfonod / deepsleep2 Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 3.0 30 KB

A compact convolutional deep neural network with an encoder/decoder structure to detect at a 5-millisecond resolution level non-apnea sleep arousals from multi-channel polysomnographic recordings.

License: MIT License

Python 31.43% Shell 12.34% Jupyter Notebook 56.23%
cnn convolutional-neural-networks deep-learning encoder-decoder multichannel physionet pytorch segmentation sleep-analysis time-series

deepsleep2's Introduction

PWC Jupyter Notebook PyTorch

DeepSleep 2.0: Automated Sleep Arousal Segmentation via Deep Learning

A 300-second example of a 13-channel physiological recording and the corresponding sleep arousal prediction/target labels.

sample_300s_example_animation

Overview

DeepSleep 2.0 is a compact version of DeepSleep, a state-of-the-art, U-Net-inspired, fully convolutional deep neural network, which achieved the highest unofficial score in the 2018 PhysioNet Computing Challenge. The proposed network architecture has a compact encoder/decoder structure containing only 740,551 trainable parameters. The input to the network is a full-length multi-channel polysomnographic recording signal. The network has been designed and optimized to efficiently predict non-apnea sleep arousals on held-out test data at a 5-millisecond resolution level, while not compromising the prediction accuracy. When compared to DeepSleep, the obtained experimental results in terms of gross area under the precision-recall curve (AUPRC) and gross area under the receiver operating characteristic curve (AUROC) suggest that a lightweight architecture, which can achieve similar prediction performance at a lower computational cost, is realizable.

Requirements

It is assumed that you have the full or partial PhysioNet dataset (~135 GB of data per folder) on the disk. In ./data, you can find two bash scripts to download the PhysioNet dataset.

Running the code

Here are the essential steps to sucesfully run the main Jupyter notebook file (deep_sleep2.ipynb).

STEP 0: Clone the Repository

 git clone https://github.com/rfonod/deepsleep2.git
 cd deepsleep2

STEP 1: Installation

  1. Install Python and PyTorch. Python 3.8 and PyTorch 1.8.1 were considered for the reported results in the DeepSleep 2.0 paper
  2. [OPTIONAL] Create a virtual environment with a specific version of Python
  3. Install Python dependencies listed in requirements.txt. You can run:
pip3 install -r requirements.txt
  1. If you plan to use GPU computations (recommended), install CUDA

STEP 2: Hyperparameters

A correctly set up hyperparameters.txt file must be present in a subdirectory of ./models. The subdirectory name is specified in the MODEL_NAME variable.

STEP 3: Notebook File

Run the cells of deep_sleep2.ipynb in a sequential order. Consider the description of the Main Switches section.

Citation

If you use this code in your research, please cite the following publication:

@Article{Fon22a,
  author    = {Fonod, Robert},
  title     = {{DeepSleep 2.0: Automated Sleep Arousal Segmentation via Deep Learning}},
  journal   = {AI},
  year      = {2022},
  volume    = {3},
  number    = {1},
  pages     = {164-179},
  doi       = {https://doi.org/10.3390/ai3010010},
  publisher = {MDPI},
}

Consider also citing the original DeepSleep paper.

deepsleep2's People

Contributors

rfonod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

deepsleep2's Issues

DataLoader worker exited unexpectedly.

Hi There,

I received this error when running your code, I have downloaded all the file repositories and followed it through but still receiving this error. What is the solution?

Code Error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.