Training tutorials

Train your own real-time sleep spindle detector

A hands-on course for neuroscientists. You will learn how the Portiloop turns raw EEG into a closed-loop stimulation decision in a fraction of a second, how its neural network is trained on expert-annotated sleep recordings, and how to train, evaluate and deploy a model of your own. Every concept comes with a simulation you can play with directly in this page.

The published Portiloop network, running in your browser

Synthetic NREM sleep EEG goes through the Portiloop filters and the pre-trained network (25,679 parameters, the model of the PLOS ONE paper). Shaded bands are the spindles we planted in the signal; the orange trace is the network's spindle probability, computed on the fly from past samples only. Press New recording to draw another night.

Loading the model…

Choose your path

I want to understand how it works

Physiology, signal processing and the network, without installing anything.

I want to detect spindles in my recordings

Use the pre-trained model offline on your own EEG.

I want to train a new model

Retrain, change the architecture, evaluate it properly.

I want to run it in closed loop

Simulate stimulation timing and export the model for a device.

All tutorials

How these tutorials work

Citing the Portiloop

If these tutorials or the Portiloop software help your research, please cite:

Valenchon N, Bouteiller Y, Jourde HR, L’Heureux X, Sobral M, Coffey EBJ, Beltrame G (2022). The Portiloop: A deep learning-based open science tool for closed-loop brain stimulation. PLOS ONE 17(8): e0270696. doi:10.1371/journal.pone.0270696

@article{valenchon2022portiloop,
  title   = {The Portiloop: A deep learning-based open science tool for closed-loop brain stimulation},
  author  = {Valenchon, Nicolas and Bouteiller, Yann and Jourde, Hugo R. and L'Heureux, Xavier and
             Sobral, Milo and Coffey, Emily B. J. and Beltrame, Giovanni},
  journal = {PLOS ONE},
  volume  = {17},
  number  = {8},
  pages   = {e0270696},
  year    = {2022},
  doi     = {10.1371/journal.pone.0270696}
}