Braindecode: PyTorch Deep Learning for EEG, iEEG, MEG & fNIRS#

BRAINDECODE OPEN-SOURCE PYTORCH FOR BRAIN SIGNALS · SINCE 2017

Decode Brain Signals
with Braindecode

A PyTorch-native toolbox for end-to-end neural decoding. Load a dataset, pick a published model, train. Same scikit-learn API you already know.

For neuroscientists and clinicians who want to work with deep learning, and machine learning researchers who want to work with neurophysiological data.

Maintained across
UC San Diego Inria University of Freiburg Donders Institute Yneuro
+ 134 contributors
Braindecode Braindecode Hugging Face Hugging Face

Pretrained on the Hub

141 Repos · 402K downloads/mo

Every Braindecode model implements from_pretrained() and push_to_hub() via PyTorchModelHubMixin, serializing a diffable safetensors + JSON pair that records the Hub commit hash and pretraining corpora for auditable fine-tuning. Hub checkpoints connect to 954 BIDS corpora from EEGDashDataset (48,000+ subjects, 138,000+ hours), while Zarr-backed datasets stream lazily via pull_from_hub().

Output
Python · safetensors
>>> from braindecode.models import REVE>>> model = REVE.from_pretrained(...     "brain-bzh/reve-base",...     n_outputs=4,...     n_times=800,...     chs_info=raw.info["chs"],... )>>> model(X_test).softmax(dim=-1)[:3]tensor([[0.92, 0.03, 0.03, 0.02],        [0.04, 0.89, 0.05, 0.02],        [0.02, 0.04, 0.91, 0.03]])
Python · EEGDash + Hub
>>> from eegdash import EEGDashDataset>>> from braindecode.datasets import BaseConcatDataset>>> bids_ds = EEGDashDataset(...     dataset="ds002718", subject="012",... )>>> hub_ds = BaseConcatDataset.pull_from_hub(...     "braindecode/bcic2a"... )>>> X, y, crop_ind = hub_ds[0]>>> X.shape(22, 1000)

Braindecode by the numbers

80 60 40 20 0 69 Conv 50 Attention 48 Foundation 23 Montage 15 RNN / GNN 80 60 40 20 0 77 EEG / PSG 9 iEEG / sEEG 8 fNIRS 7 MEG 7 sEMG

103 peer-reviewed PyTorch architectures verified in CI

Cross-modal backbones support multiple recording types

1.4M+ PyPI installs & 402K monthly Hub downloads

2.1M+ installations across Braindecode, MOABB, EEGDash, and SPD Learn, maintained openly across 50+ releases and 4,600+ citations since HBM 2017.

1,100+ open datasets & 138,000+ hours ready to train

954 BIDS corpora across 48,000+ subjects via EEGDash and 158 BCI benchmarks via MOABB load through one dataset API.

48 foundation models, checkable end to end

Change the evaluation split or preprocessing, and rankings flip. Shared protocols keep splits leak-free and baselines reproducible.

Built for every neurophysiological signal

Scalp EEG & Sleep PSG

77 models

19–128 ch @ 128–512 Hz · C3 Cz C4 Fpz-Cz Pz-Oz · MNE Raw / BIDS / EDF

Intracranial iEEG, ECoG & MEG

16 models

64–306 sensors @ 500–2048 Hz · 3D stereotactic shafts & OPM/SQUID arrays

fNIRS Optical & Surface sEMG

15 models

HbO/HbR optode pairs @ 10 Hz · 2 kHz motor-unit wrist arrays

SHARED BASE CLASS · ALL 103 MODELS Docs →

EEGModuleMixin

+ PyTorchModelHubMixin · torch.nn.Module

SCALP EEG X: (B, 64, 1000) @ 250 Hz → n_chans, n_times, sfreq derived
Auto-sized geometry

Pass any subset of n_chans, n_times, sfreq, input_window_seconds, or chs_info; missing shapes are derived automatically.

Hub safetensors

from_pretrained() and push_to_hub() with JSON config and parameter-level provenance.

Transfer & probing

reset_head(n_outputs) and return_features=True across classifiers and foundation models.

Zero lock-in

Standard torch.nn.Module compatible with EEGClassifier, Lightning, and torch.compile.

USED BY THE COMMUNITY

What labs and students build with Braindecode

From student thesis projects to hospital cohorts and NeurIPS competitions, researchers use Braindecode to run checkable experiments and share their models back.

COMPETITIONS

1,197 teams from 247 institutions competed in the NeurIPS 2025 EEG Foundation Challenge on Braindecode and EEGDash, returning in 2026 across 4 EEG & EMG tracks.

NeurIPS 2026 EEG/EMG Challenge · NeurIPS 2025 Challenge · BEETL 2021

Explore NeurIPS challenges →
eBIOMEDICINE

Braindecode ConvNets detect pathology in clinical EEG and predict age and sex from over 2,600 recordings, separating brain from peripheral signals.

Bomatter et al. · F. Hoffmann-La Roche (eBioMedicine, 2024) · Gemein et al. · Univ. Freiburg (NeuroImage, 2020)

Read clinical study →
J. Neural Eng. SELF-SUPERVISED

Self-supervised pretraining on unlabeled sleep and clinical EEG, the origin of Braindecode's relative-positioning sampler, and dynamic spatial filtering that learns to ignore corrupted channels.

Banville, Chehab, Hyvärinen, Engemann & Gramfort (J. Neural Eng., 2021) · Dynamic spatial filtering, Banville et al. (NeuroImage, 2022)

Read SSL paper →
Front. Neurosci. MOTOR IMAGERY

Teams in Xi'an, Gumi and Beijing decode motor imagery with Braindecode: a multiscale filter-bank CNN, a capsule network, and same-limb baselines.

Wu et al. · Xidian Univ. (Front. Neurosci., 2019) · Ha & Jeong · Kumoh National Institute of Technology (Sensors, 2019) · Ma, Qiu & He · CAS (IEEE TNSRE, 2022)

Read Frontiers paper →
DOMAIN SHIFT

Source-free EEG adaptation under label shift, tested on Braindecode sleep-staging models, and domain-adversarial training with Braindecode's Deep ConvNet.

SPDIM · Li, Kawanabe & Kobler · ATR, RIKEN & NAIST (ICLR 2025) · ELS · Zhang et al. · CAS Inst. of Automation (ICLR 2023)

Read ICLR paper →
COMMUNICATIONS BIOLOGY

Multiverse analysis across 2,592 preprocessing paths and seven ERP CORE paradigms using Braindecode to measure how filtering and artifact removal shape decoding.

Kessler, Enge & Skeide · Max Planck CBS (Communications Biology, 2025)

Read preprocessing study →
IEEE TBME SPEECH · fNIRS

Bimodal EEG-fNIRS decoding of overt and imagined speech, and image classification from low-density EEG with Braindecode's EEGNet.

Cooney, Folli & Coyle · Ulster Univ. (IEEE TBME, 2021) · Guenther, Kosmyna & Maes · MIT Media Lab & TUM (Sci. Reports, 2024)

Read TBME paper →
FM BENCHMARKS

Standardized evaluation and diagnostic analysis of EEG foundation models and Braindecode baselines across 14 datasets and 10 paradigms.

EEG-FM-Bench · Xiong, Li, Li, Zhu & Jiang (ICML 2026, PMLR v306)

Read ICML benchmark →
COMMUNITY

Your next paper here :)

Working on an EEG, iEEG, MEG, fNIRS, or sEMG study with Braindecode? Tell us about your paper, push weights to Hugging Face, or add your architecture to the zoo.

Share your work with us →
WHY BRAINDECODE · CORE STACK

Everything you need to go from signal to prediction

Built to plug into the neurophysiology ecosystem you already use: every MOABB benchmark (158 datasets), every MNE-Python and EEGPrep preprocessing function, NeuralBench tasks, SPD Learn, and 954 BIDS corpora via EEGDash. One library, no lock-in.

A unified API, nine modules

From raw recording to trained checkpoint, the same nine modules cover every task: classification, regression, sleep staging, seizure detection, and self-supervised pretraining.

Full API reference
QUICKSTART · END-TO-END PIPELINE

Train a model in 15 lines

From raw EEG to a trained decoder. Each step is a stand-alone module; swap any piece without touching the others, or switch tabs for Hub fine-tuning and clinical SzCORE evaluation.

Pipeline
PyTorch · CUDA / CPU
# 1. Load BCI Competition IV-2a (subject 3) via MOABBfrom braindecode.datasets import MOABBDatasetdataset = MOABBDataset("BNCI2014_001", subject_ids=[3])# 2. Bandpass-filter EEG channels and slice event windowsfrom braindecode.preprocessing import (    Preprocessor, create_windows_from_events, preprocess,)preprocess(dataset, [    Preprocessor("pick_types", eeg=True),    Preprocessor("filter", l_freq=4.0, h_freq=38.0),])windows = create_windows_from_events(dataset, preload=True)# 3. Pick a published architecture; shapes are derived from windowsfrom braindecode import EEGClassifierclf = EEGClassifier("EEGNeX", max_epochs=20, batch_size=64)# 4. Train with scikit-learn compatible fit()clf.fit(windows, y=None)
✓ 22 ch · 4 classes · 1000 samples @ 250 Hz derived automatically Open full tutorial →
Hugging Face · safetensors
# 1. Read EEG recording with 3D electrode metadataimport mneraw = mne.io.read_raw_edf("patient_eeg.edf", preload=True)raw.set_montage("standard_1020")# 2. Pull audited LaBraM weights from Hugging Face Hubfrom braindecode.models import Labrammodel = Labram.from_pretrained(    "braindecode/labram-pretrained",    # 3. Pass sensor metadata & reset classification head    chs_info=raw.info["chs"],    n_outputs=4,)# 4. Probe frozen embeddings or fine-tune with EEGClassifierfrom braindecode import EEGClassifierclf = EEGClassifier(model, max_epochs=10, optimizer__lr=1e-4)clf.fit(windows, y=None)
✓ Audited safetensors weights + automatic task-head reset Open Hub tutorial →
Clinical · SzCORE
# 1. Cut held-out CHB-MIT recording into 4 s windows (2 s stride @ 256 Hz)import numpy as np, pandas as pdfrom braindecode.preprocessing import create_fixed_length_windowswindows = create_fixed_length_windows(    test_ds, window_size_samples=1024, window_stride_samples=512, preload=True,)# 2. Predict seizure probability for each windowprob = clf.predict_proba(windows)[:, 1]starts = windows.get_metadata()["i_start_in_trial"].to_numpy() / 256.0# 3. Smooth causally over past windows and extract alarm intervalssmooth = pd.Series(prob).rolling(5).mean().rolling(3).min().to_numpy()alarms = starts[smooth > 0.9]events = np.c_[alarms + 2.0, alarms + 4.0]# 4. Score overlap sensitivity, F1 & false alarms/24h under SzCOREfrom braindecode.training import szcore_event_scoresscores = szcore_event_scores(ref_seizures, events, duration_s)
✓ Overlap F1, sensitivity & false-alarm rate per 24h Open clinical tutorial →
MODEL ZOO · 103 ARCHITECTURES

Explore 103 published architectures

Every model is reproduced from its original paper and ships with a consistent constructor. The shared EEGModuleMixin takes any of n_chans, n_outputs, n_times, chs_info, input_window_seconds, or sfreq; the missing ones are derived for you. Hover any pill or card to preview its Python API.

ConvolutionEEGShallowFBCSPNetEEG Convolutional Network · Prediction46.1 K params250 HzAttentionEEGEEGConformerEEG Conv-Transformer · Prediction789.6 K params250 HzFoundationEEGLabramEEG Foundation Model · Prediction & Embedding5.8 M params200 HzFoundationEEGEEGPTEEG Foundation Model · Prediction25.3 M params256 HzFoundationEEGCBraModEEG Foundation Model · Prediction & Embedding5 M params200 HzFoundationEEGREVEEEG Foundation Model · Prediction69.5 M params200 HzFoundationEEGSleepFMSleep Staging & Disease Prediction4.8 M params128 HzConvolutionEEGEEGNeXMotor Imagery · Prediction55.9 K params125 HzFoundationMEGMEGXLSpeech Decoding · Classification & Embedding23.5 M params50 HzFoundationEEGSAMBAEEG Foundation Model · Classification & Embedding392.7 K params128 HzAttentionEEGSeizureTransformerEpilepsy · Event Detection37.8 M params256 HzFoundationfNIRSGeoNIRSfNIRS Foundation Model · Prediction & Embedding4.5 M params5 HzConvolutionEEGEEGNetEEG Convolutional Network · Prediction2.5 K params128 HzConvolutionEEGDeep4NetEEG Convolutional Network · Prediction282.9 K params250 HzGraphEEGDGCNNEmotion Recognition · Prediction1 M params128 HzRecurrentEEGDeepSleepNetSleep Staging · Prediction48.3 M params256 HzAttentionEEGAttnSleepSleep Staging · Prediction522.8 K params100 HzConvolutionEEGSleepStagerChambon2018Sleep Staging · Prediction5.8 K params128 HzFoundationEEGBENDREEG Foundation Model · Prediction & Embedding157.1 M params250 HzAttentionEEGATCNetEEG Conv-Recurrent Transformer · Prediction113.7 K params250 HzConvolutionEEGUSleepSleep Staging · Prediction2.5 M params128 HzFoundationEEGBIOTSleep Staging & Epilepsy · Prediction3.2 M params200 HzRecurrentEEGEEGTCNetMotor Imagery · Prediction4 K params250 HzConvolutionEEG · MEGBrainModuleSpeech Decoding · Prediction6.2 M params250 HzAttentionEEGCTNetMotor Imagery · Prediction26.9 K params250 HzFilterbankEEGFBCNetMotor Imagery · Prediction15.7 K params250 HzAttentionsEMGMetaNeuromotorHandHandwriting (sEMG) · CTC Sequence1 M params2000 HzConvolutionEEGEEGInceptionMIMotor Imagery · Prediction558 K params250 HzRecurrentEEGBDTCNClinical Normal/Abnormal · Prediction456.5 K params100 HzConvolutionEEGEEGInceptionERPERP & SSVEP · Prediction14.9 K params128 HzConvolutionEEG · MEGNICEVisual Decoding · Prediction & Embedding2 M params250 HzGraphEEGGCNsNetMotor Imagery · Prediction613.4 K params160 HzConvolutionEEGSPARCNetEpilepsy · Prediction1.1 M params200 HzFoundationEEGMEDFormerEEG Foundation Model · Prediction2.1 M params250 HzFilterbankEEGIFNetMotor Imagery · Prediction12.6 K params250 HzFoundationEEGSleepFMStagerSleep Staging · Prediction5.5 M params128 HzFoundationiEEGBrainBERTiEEG Foundation Model · Prediction & Embedding603.3 K params2048 HzFilterbankEEGFBMSNetMotor Imagery · Prediction20.1 K params250 HzRecurrentEEGEEGITNetMotor Imagery · Prediction3.7 K params125 HzFoundationiEEGBrantEpilepsy · Prediction2.9 M params250 HzInterpretableEEGSincShallowNetMotor Imagery · Prediction21.9 K params250 HzConvolutionEEGTSceptionEmotion Recognition · Prediction2.2 M params256 HzAttentionfNIRSFNIRSPreTfNIRS Conv-Transformer · Prediction1.7 M params10 HzAttentionfNIRSFNIRSTfNIRS Conv-Transformer · Prediction1.7 M params10 HzConvolutionfNIRSFNIRSCNN1DfNIRS Convolutional Network · Prediction59.7 K params5 HzFilterbankEEGFBLightConvNetMotor Imagery · Prediction10.5 K params250 HzConvolutionEEGTIDNetEEG Convolutional Network · Prediction240.4 K params250 HzConvolutionsEMGNeuroPoseHand pose (sEMG) · Sequence Regression6.4 M params2000 HzFoundationEEGCSBrainEEG Foundation Model · Prediction & Embedding27.6 M params200 HzAttentionsEMGTCCNetGesture recognition (sEMG) · Prediction88.8 K params100 HzAttentionEEGMSVTNetMotor Imagery · Prediction75.5 K params250 HzAttentionEEGMSCFormerMotor Imagery · Prediction150.7 K params250 HzConvolutionEEGContraWRSleep Staging · Prediction & Embedding1.6 M params125 HzChannelEEGEEGSymMotor Imagery · Prediction32.5 K params250 HzInterpretableEEGSyncNetEmotion Recognition & Alcoholism · Prediction554 params256 HzRecurrentsEMGVEMG2PoseHand pose (sEMG) · Sequence Regression6 M params2000 HzConvolutionfNIRSFNIRSNetfNIRS Convolutional Network · Prediction498 params10 HzConvolutionEEGSCCNetMotor Imagery · Prediction12.1 K params125 HzAttentionEEGAttentionBaseNetMotor Imagery · Prediction3.7 K params250 HzFoundationEEG · MEGBrainOmniCross-modal EEG + MEG Foundation Model · Prediction & Embedding14 M params256 HzFoundationEEG · MEGBrainTokenizerCross-modal EEG + MEG Foundation Model · Embedding5.1 M params256 HzConvolutionsEMGEMG2QwertyNetTouch typing (sEMG) · CTC Sequence5.3 M params2000 HzAttentionEEGTMSANetMotor Imagery · Prediction20.3 K params250 HzAttentionEEGSSTDPNMotor Imagery · Prediction19.5 K params250 HzConvolutionEEGSleepStagerBlanco2020Sleep Staging · Prediction2.8 K params100 HzConvolutionEEGEEGSimpleConvMotor Imagery · Prediction730.4 K params80 HzAttentionEEGCareSleepNetSleep Staging · Prediction22.8 M params100 HzAttentionEEGTCFormerMotor Imagery · Classification77.8 K params250 HzFoundationEEGCodeBrainEEG Foundation Model · Prediction & Embedding106.5 M params200 HzFoundationEEGLUNAEEG Foundation Model · Prediction & Embedding7.1 M params128 HzFoundationiEEGPopulationTransformeriEEG Foundation Model · Prediction & Embedding20 M params2048 HzFoundationEEGSTEEGFormerEEG Foundation Model · Classification25.3 M params250 HzFoundationMEGBBLSpeech Decoding · Prediction & Embedding41.3 M params250 HzFoundationEEGPBTEEG Foundation Model · Prediction840.3 K params250 HzFoundationEEGSignalJEPAMotor Imagery & ERP & SSVEP · Embedding3.5 M params128 HzFoundationEEGSignalJEPA_ContextualMotor Imagery & ERP & SSVEP · Prediction3.5 M params128 HzFoundationEEGSignalJEPA_PostLocalMotor Imagery & ERP & SSVEP · Prediction16.1 K params128 HzFoundationEEGSignalJEPA_PreLocalMotor Imagery & ERP & SSVEP · Prediction16.1 K params128 HzFoundationiEEGDuINSpeech Decoding · Prediction4.2 M params1000 HzFoundationEEGTFMTokenizerEEG Neural Tokenizer · Pretraining & Tokenization641.8 K params200 HzAttentionEEGDeepSOZEpilepsy · Event Detection688 K params256 HzFoundationEEGEEGCLIPEEG Foundation Model · Embedding & Prediction402.6 K params250 HzInterpretableEEGEEGMinerEmotion Recognition · Prediction8.9 K params128 HzFoundationsEMGTinyMyoGesture recognition (sEMG) · Prediction & Embedding3.7 M params2000 HzFoundationEEGMIRepNetMotor Imagery · Prediction & Embedding5.1 M params250 HzChannelsEMGSensingDynamicsHand pose (sEMG) · Sequence Regression1.7 M params2000 HzFoundationEEGNeuroRVQEEG Foundation Model · Prediction & Embedding7.1 M params200 HzFoundationEEGNeuroRVQTokenizerEEG Foundation Model · Embedding75.7 M params200 HzFoundationEEGEEGDINOEEG Foundation Model · Classification4.5 M params200 HzFoundationiEEGBaRISTAiEEG Foundation Model · Prediction & Embedding870.3 K params2048 HzFoundationiEEGDIVER1iEEG Foundation Model · Prediction12.7 M params500 HzFoundationMEGMEGGPTMEG Foundation Model · Prediction & Embedding4.1 M params250 HzFoundationEEGMVPFormerEEG Foundation Model · Prediction & Embedding3.4 M params512 HzFoundationEEGZUNAEEG Foundation Model · Classification & Embedding172.1 M params256 HzAttentionEEGDANCEEEG Conv-Transformer · Event Detection29.8 M params200 HzFoundationfNIRSJungMAEfNIRS Foundation Model · Prediction & Embedding1.9 M params5 HzFoundationEEG · iEEGEpiNTEpilepsy · Prediction & Embedding19.2 M params256 HzRecurrentfNIRSFNIRS4DfNIRS Temporal Conv-Recurrent Net · Prediction89.9 K params10 HzFoundationiEEGCORTEGiEEG Foundation Model · Prediction & Embedding25.5 M params128 HzFoundationEEGPratibha2EEG Foundation Model · Classification & Embedding92.9 M params200 HzFoundationEEGAXONEEG Foundation Model · Classification & Embedding118.6 M params200 HzFoundationEEGGuetschel2026EEG Foundation Model · Prediction & Embedding12.9 M params200 HzFoundationiEEGMAPAiEEG Foundation Model · Prediction & Embedding21.3 M params2048 HzFoundationfNIRSMtReNIRSfNIRS Foundation Model · Prediction & Embedding1.2 M params10 Hz

No architectures match the active modality, backbone, or search query.

Showing 12 featured of 104 architectures Open full sortable comparison table
OPEN ECOSYSTEM · 2.1M+ INSTALLS

Built and shared with neighbors

Open neural decoding does not live alone. Braindecode plugs into a wider open-source neuroscience stack, ships sibling projects that round out the data story, and is built upon across MNE-Python, EEGDash, MOABB, NeuralBench, NeuroAI, Meta Brain & AI, SPD Learn, EEGPrep, and skorch.

Building on Braindecode? Explore dependent projects on GitHub →

Braindecode

Start decoding brain signals today

Install in one command, pull a pretrained foundation backbone or a MOABB / NeuralBench benchmark, and run your first experiment in minutes.