Skip to content

A new take on EEG sleep spindles detection exploiting a generative model (dynamic bayesian network) to characterize reoccurring dynamical regimes of single-channel EEG.

Notifications You must be signed in to change notification settings

carlosloza/spindles-HMM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

spindles-HMM

Code to replicate all results, tables, and figures of paper "Robust autoregressive hidden semi–Markov models applied to EEG sleep spindles detection"

Requirements

MATLAB - Results, Tables and Figure 2

  • MATLAB R2016b or newer (the implemented algorithms require broadcasting capabilities)
  • Statistics and Machine Learning Toolbox
  • Signal Processing Toolbox
  • Parallel Computing Toolbox (optional, but extremely recommended for EM-based learning)

Python - Figure 1

  • python 3
  • jupyter notebook
  • matplotlib
  • daft to plot the probabilistic graphical model

Data

  • DREAMS sleep spindles dataset

Instructions

  1. Add "Main_Code" folder to MATLAB path
  2. Download DREAMS sleep spindles dataset. A reliable source is here (make sure to download the DatabaseSpindles.rar file). Unpack .rar file.
  3. Run reformatDREAMS.m script to reformat and downsample the EEG and expert labels
  4. Algorithms/scripts in the "DREAMS" folder are now ready to be run. These are the scripts that replicate results, tables, and Figure 2
  5. (Optional) Set up a python environment with matplotlib and daft to run RARHSMM_GraphicalModel.ipynb on a jupyter notebook

PS1: All main code is MATLAB, python is only used to render the probabilistic graphical model of Figure 1

PS2: The DREAMS sleep spindles dataset used to be hosted here but that website has been down for quite some time now

About

A new take on EEG sleep spindles detection exploiting a generative model (dynamic bayesian network) to characterize reoccurring dynamical regimes of single-channel EEG.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published