license: bsd-3-clause
language:
- en
tags:
- eeg
- biosignal
- tutorials
- notebooks
- braindecode
- neuroscience
- brain-computer-interface
pretty_name: Braindecode Tutorials
size_categories:
- n<1K
Braindecode Tutorials
Curated collection of 31 executable Jupyter notebooks showing how to use braindecode for end-to-end EEG / biosignal deep learning: data loading, preprocessing, model training, fine-tuning of foundation models, and Hugging Face Hub integration.
Each notebook is mirrored from the
examples/directory of the upstream repo. They are auto-converted from the sphinx-gallery.pysource on every release; the canonical rendered versions live at https://braindecode.org/stable/auto_examples.
How to use this dataset repo
Three options, in increasing order of convenience:
| Option | What you do |
|---|---|
| Open in Colab | Click any ▶ Colab link below. Free GPU runtime; no install. |
| Download | huggingface-cli download braindecode/tutorials --repo-type dataset --local-dir tutorials/ |
| Browse rendered HTML | https://braindecode.org/stable/auto_examples (sphinx-gallery output). |
Each notebook installs braindecode in the first cell, so it's runnable on a fresh kernel.
Catalogue
Getting started — datasets & I/O
| Notebook | Topic | Run |
|---|---|---|
plot_moabb_dataset_example.ipynb |
Load a MOABB dataset (BNCI 2014-001) | ▶ Colab |
plot_mne_dataset_example.ipynb |
Wrap an mne.io.Raw as a braindecode dataset |
▶ Colab |
plot_bids_dataset_example.ipynb |
Load a BIDS-formatted EEG dataset | ▶ Colab |
plot_custom_dataset_example.ipynb |
Roll your own dataset class | ▶ Colab |
plot_load_save_datasets.ipynb |
Cache datasets to disk and reload them | ▶ Colab |
plot_split_dataset.ipynb |
Train/valid/test splits at session and subject level | ▶ Colab |
plot_benchmark_preprocessing.ipynb |
Compare preprocessing strategies head-to-head | ▶ Colab |
plot_tuh_discrete_multitarget.ipynb |
TUH multi-target discrete labels | ▶ Colab |
plot_hub_integration.ipynb |
Push / pull braindecode datasets to the Hub | ▶ Colab |
Model building & training
| Notebook | Topic | Run |
|---|---|---|
plot_basic_training_epochs.ipynb |
Train any braindecode model in a few cells | ▶ Colab |
plot_train_in_pure_pytorch_and_pytorch_lightning.ipynb |
Pure-PyTorch and Lightning training loops | ▶ Colab |
plot_bcic_iv_2a_moabb_trial.ipynb |
BCI Competition IV 2a — trial-wise decoding | ▶ Colab |
plot_bcic_iv_2a_moabb_cropped.ipynb |
BCI Competition IV 2a — cropped decoding | ▶ Colab |
plot_bcic_iv_2a_eegprep_cleaning.ipynb |
EEG-Prep cleaning before training | ▶ Colab |
plot_load_pretrained_models.ipynb |
Load BENDR / BIOT / EEGPT from the Hub and fine-tune | ▶ Colab |
plot_how_train_test_and_tune.ipynb |
Cross-validation and hyper-parameter tuning | ▶ Colab |
plot_hyperparameter_tuning_with_scikit-learn.ipynb |
scikit-learn GridSearchCV over braindecode |
▶ Colab |
plot_preprocessing_classes.ipynb |
The Preprocessor API |
▶ Colab |
plot_channel_interpolation.ipynb |
Bad-channel interpolation | ▶ Colab |
plot_regression.ipynb |
EEG regression instead of classification | ▶ Colab |
Advanced training
| Notebook | Topic | Run |
|---|---|---|
plot_data_augmentation.ipynb |
EEG-specific augmentations | ▶ Colab |
plot_data_augmentation_search.ipynb |
Search over augmentation policies | ▶ Colab |
plot_relative_positioning.ipynb |
Self-supervised pretext tasks | ▶ Colab |
plot_temporal_generalization.ipynb |
Temporal-generalisation matrices | ▶ Colab |
plot_finetune_foundation_model.ipynb |
Fine-tune a Hub foundation model end-to-end | ▶ Colab |
plot_moabb_benchmark.ipynb |
Run a full MOABB benchmark | ▶ Colab |
plot_exca_config.ipynb |
Reproducible experiments with exca |
▶ Colab |
Applied examples
| Notebook | Topic | Run |
|---|---|---|
plot_sleep_staging_chambon2018.ipynb |
Sleep staging with Chambon2018 | ▶ Colab |
plot_sleep_staging_usleep.ipynb |
Sleep staging with U-Sleep | ▶ Colab |
plot_sleep_staging_eldele2021.ipynb |
Sleep staging with Eldele2021 | ▶ Colab |
plot_tuh_eeg_corpus.ipynb |
Working with the TUH EEG corpus | ▶ Colab |
How the notebooks are produced
Sphinx-gallery automatically generates a .ipynb next to each rendered
HTML page during the docs build. The conversion script for this
dataset repo simply collects those generated notebooks:
# in the braindecode repo
cd docs && make html # builds HTML + .ipynb files
python ../hf_assets/tutorials_index/build_notebooks.py # gathers .ipynb
See build_notebooks.py for the gather + push logic.
Cost note
Hosting .ipynb files in a public dataset repo is free on Hugging
Face. Compute (Colab) is also free for the small datasets used in these
tutorials. No paid tier is required.
Citation
@article{aristimunha2025braindecode,
title = {Braindecode: a deep learning library for raw electrophysiological data},
author = {Aristimunha, Bruno and others},
journal = {Zenodo},
year = {2025},
doi = {10.5281/zenodo.17699192},
}