Giter Site home page Giter Site logo

dosed's Introduction

CircleCI

Dreem One Shot Event Detector (DOSED)

This repository contains a functional implementation of DOSED, a deep learning method proposed first in:

Stanislas Chambon, Valentin Thorey, Pierrick J. Arnal, Emmanuel Mignot, Alexandre Gramfort
A deep learning architecture to detect events in EEG signals during sleep
IEEE 28th International Workshop on Machine Learning for Signal Processing (MLSP), 2018
https://arxiv.org/abs/1807.05981

and extended in:

Stanislas Chambon, Valentin Thorey, Pierrick J. Arnal, Emmanuel Mignot, Alexandre Gramfort.
DOSED: a deep learning approach to detect multiple sleep micro-events in EEG signal
https://arxiv.org/abs/1812.04079

also used in:

Valentin Thorey and Albert Bou Hernandez and Pierrick J. Arnal and Emmanuel H. During.
AI vs Humans for the diagnosis of sleep apnea
https://arxiv.org/abs/1906.09936

Introduction

DOSED in a deep learning approach to jointly predicts locations, durations and types of events in time series. It was inspired by computer vision object detectors such as YOLO and SSD and relies on a convolutional neural network that builds a feature representation from raw input signals, as well as two modules performing localization and classification respectively. DOSED can be easily adapt to detect events of any sort.

dosed_detection_image

Citing DOSED

@inproceedings{chambon2018deep,
  title={A deep learning architecture to detect events in EEG signals during sleep},
  author={Chambon, Stanislas and Thorey, Valentin and Arnal, Pierrick J and Mignot, Emmanuel and Gramfort, Alexandre},
  booktitle={2018 IEEE 28th International Workshop on Machine Learning for Signal Processing (MLSP)},
  pages={1--6},
  year={2018},
  organization={IEEE}
}

@article{chambon2018dosed,
  title={DOSED: a deep learning approach to detect multiple sleep micro-events in EEG signal},
  author={Chambon, Stanislas and Thorey, Valentin and Arnal, Pierrick J and Mignot, Emmanuel and Gramfort, Alexandre},
  journal={arXiv preprint arXiv:1812.04079},
  year={2018}
}

Minimum example

The folder /minimum_example contains all necessary code to train a spindle detection model on EEG signals.

We provide a dataset composed of 21 recordings with two EEG central channels downsampled at 64Hz on which spindles have been annotated. The data was collected at Dreem with a Polysomnography device.

The example works out-of-the-box given the following considerations.

1. Package requirements

Packages detailed in requirements.txt need to be installed for the example to work.

2. Minimum example

A minimum example is provided in the folder /minimum_example directory.

Running the script ipython notebook download_and_data_format_explanation.ipynb or run make download_example to download, pre-processes training data.

H5 data format

To work with different datasets, and hence data format, we first require you to convert you original data and annotation into H5 files for each record. download_and_data_format_explanation.ipynb and to_h5.py provides detailed explanation and an example of that process.

Required structure for the .h5 files is the following:

/  # root of the h5 file

-> /path/to/signal_1
   + attribute "fs" # sampling frequency

-> /path/to/signal_2
   + attribute "fs"

-> /path/to/signal_3
   + attribute "fs"

-> ... # add as many signals as desired


-> /path/to/event_1/
   -> /start  # array containing start position of each event with respect to the beginning of the recording (in seconds).
   -> /duration  # array containing duration  of each event (in seconds).

-> /path/to/event_2/
   -> /start
   -> /duration

-> ... # add as many events as desired

This code is the only dataset-specific code that you will need to write.

Training and testing

The jupyter notebook train_and_evaluate_dosed.ipynb goes through the training process in detail, describing all important training parameters. It also explains how to generate predictions, and provides a plot of a spindle detection.

dosed's People

Contributors

agramfort avatar haberdashpi avatar theomoutakanni avatar vthorey avatar

Watchers

 avatar  avatar

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.