Open-source project
braindecode/braindecode avatar
braindecode/braindecode

Braindecode: deep learning on raw EEG, ECoG and MEG signals in Python

Deep learning software to decode EEG, ECG or MEG signals

1,308 stars277 forksPythonBSD-3-Clause

At a glance

What is it?
Braindecode packages dataset fetchers, preprocessing, augmentation and PyTorch model implementations for electrophysiological decoding. It is aimed at two audiences at once, and the split licence inside the repository is the detail most adopters will miss.
Who is it for?
Adopt Braindecode if you already work in Python with MNE-Python Raw objects or with MOABB, and you want published convolutional architectures plus augmentation in one place instead of re-implementing them per paper. Do not adopt it if you need a non-commercial-clean codebase without auditing file headers, or if your pipeline is built on scikit-learn feature extraction and you have no intention of moving to PyTorch.
Can I use it commercially?
Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The gap Braindecode fills between MNE-Python and a PyTorch training loop

MNE-Python handles reading, filtering, epoching and plotting electrophysiological recordings, but it stops short of giving you a trainable network. PyTorch gives you the network and the optimiser, but knows nothing about channel montages, sampling rates or the fact that an EEG epoch is a two-dimensional array of channels by time samples. Braindecode sits in that gap. The README describes it as "an open-source Python toolbox for decoding raw electrophysiological brain data with deep learning models", covering EEG, ECoG and MEG, and it ships dataset fetchers, preprocessing and visualization tools, several deep learning architectures and data augmentations. The stated audience is two-sided: neuroscientists who want to use deep learning, and deep learning researchers who want to work with neurophysiological data. That second group is the one that usually gets forgotten by tooling in this space, and it shapes how the library is organised. The original reference for the library is the 2017 Human Brain Mapping paper by Schirrmeister and colleagues on convolutional neural networks for EEG decoding and visualization, which the README asks you to cite alongside the software itself.

What is actually in the box: models, augmentations, fetchers

The README lists four categories of content: dataset fetchers, preprocessing and visualization tools, implementations of several deep learning architectures, and data augmentations. It does not enumerate the architectures by name in the material available here, so treat any specific model list you see elsewhere as something to confirm against the documentation at braindecode.org rather than against this README. The architectural bet is visible in the citation trail. The foundational paper is about end-to-end learning from raw signals, with model interpretability and brain mapping listed among its keywords, which tells you the intended workflow is to feed relatively unprocessed time series into a network and inspect what the filters learned, rather than to hand-engineer spectral features first. Augmentation matters more here than in computer vision. EEG recordings are short, subject counts are small, and the augmentation transforms exist to stretch a limited number of trials into a usable training set. The ECoG and MEG support is worth noting separately: the same abstractions are meant to cover intracranial and magnetoencephalographic data, not just scalp EEG, which is a broader remit than most EEG-only libraries attempt.

Installation: three steps and two dependencies you supply yourself

The installation path in the README is short and assumes you bring your own deep learning stack. First, install PyTorch from pytorch.org; the README notes explicitly that you do not need torchvision. Second, if you want to download EEG datasets from MOABB, install it with pip install moabb. Third, install the latest release with pip install braindecode. That ordering is not cosmetic. Braindecode does not pull PyTorch in for you, so the version of torch you install first determines what you get, and the MOABB dependency is optional and gated behind a separate command. If you skip MOABB you still get the models and preprocessing, but not the dataset fetchers that make the library self-contained for benchmarking. For the development version, the README points to CONTRIBUTING.md rather than giving a command here. Documentation is published at braindecode.org in both stable and dev versions, which is worth knowing because the dev docs can describe APIs that have not reached the release you installed.

The licence is BSD-3-Clause, except where it is not

The project is primarily licensed under BSD-3-Clause, and the README is unusually direct that this is not the whole story. Some components inside the repository fall under other licences: Creative Commons Attribution-NonCommercial 4.0 International, Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International, MIT and Apache-2.0. The per-file list lives in LICENSE and NOTICE. This is the single most consequential detail for anyone planning commercial use. A BSD-3-Clause badge on the repository does not mean every file you import is BSD-3-Clause, and the non-commercial Creative Commons variants are the ones that change what you are allowed to ship. The README does not say which components carry which licence, so the only reliable route is to read the two files and trace the modules you actually import. I am not giving legal advice here; the point is that the repository itself tells you the top-level licence is not sufficient information. For academic groups this is mostly bookkeeping. For anyone embedding Braindecode in a product, it is a blocking question to answer before writing code against it.

Where Braindecode is the wrong tool

The library assumes you want a learned representation. If your analysis is a within-subject classification of motor imagery using common spatial patterns and a linear discriminant, the classic MOABB pipeline gives you a shorter path and a well-understood baseline, and Braindecode's value proposition does not apply. The dependency structure is the second constraint. You must install PyTorch yourself, which means you inherit its platform and CUDA constraints on top of whatever MNE-Python and NumPy versions your environment already pins. On a locked-down clinical workstation where you cannot add a deep learning framework, Braindecode is simply unavailable, regardless of how good the models are. The third constraint is data volume. The README does not state a minimum number of trials or subjects, and I cannot confirm one from this material, but the presence of a dedicated augmentation module is itself a signal that the intended datasets are small. If you have thousands of labelled hours, augmentation is not your bottleneck and the library's framing will feel mismatched. Finally, the README does not describe a deployment or inference-serving story. It is a research and analysis toolbox, and treating it as a production inference layer is a use case the documentation does not appear to address.

How Braindecode relates to MOABB rather than competing with it

The README's own installation instructions make the relationship explicit: MOABB is installed separately, with pip install moabb, and is described as the source you download EEG datasets from. The two projects divide the work. MOABB handles dataset access and the benchmarking protocol around classical decoding pipelines; Braindecode handles the deep learning side, taking the arrays and turning them into trained networks. The difference in approach is not model architecture, it is where the abstraction boundary sits. A scikit-learn plus MOABB workflow gives you a fixed feature representation and a classifier you can swap in one line, with results that are easy to compare across subjects and studies. Braindecode moves the representation learning inside the model, which buys you the ability to learn filters that a fixed feature set would miss, at the cost of longer training, more hyperparameters and results that are harder to compare against a published baseline unless you reproduce the exact preprocessing. If you are choosing between them, the honest framing is that they answer different questions: one asks whether a known feature set separates the conditions, the other asks what representation a network finds on its own.

Release cadence and what upgrading costs you

The release history shows v1.7.0 in early August 2026, then v1.8.0 and v1.8.1 both on 2026-08-31, with the patch following the minor release the same day. That pattern suggests active development with quick follow-up fixes, and it also means minor versions arrive roughly monthly. For a research codebase that is a reasonable cadence, but it has a practical consequence: pinning is not optional. If your paper's results depend on a specific preprocessing default or model initialisation, an unpinned pip install braindecode will silently move you onto the next minor release, and the README gives no deprecation policy or API stability guarantee that I can confirm from this material. The upgrade cost itself is mostly the PyTorch and MNE-Python compatibility surface, since Braindecode does not vendor either. Before upgrading, check the release notes for the version you are moving to and re-run your preprocessing on a single subject to confirm the epoch shapes and channel handling are unchanged. The repository is not archived and was last pushed on 2026-09-09, so the maintenance signal is current rather than historical.

Who should adopt Braindecode, and what to check first

The fit is narrow but real. You are a neuroscientist or machine learning researcher working in Python, your data is already in or convertible to MNE-Python structures, you want to compare published convolutional architectures on the same preprocessing, and you are comfortable managing a PyTorch install yourself. In that setting Braindecode removes a lot of duplicated work, and the MOABB integration means you can get to a benchmark without writing your own loader. The misfit is equally clear. If you need a commercial licence without a per-file audit, the mixed licensing described in the README is a reason to look elsewhere or to budget time for the audit. If your pipeline is scikit-learn based and performing adequately, switching to a deep learning toolbox is a rewrite, not an upgrade. If you cannot install PyTorch in your environment, the question is closed. The concrete first step is to read LICENSE and NOTICE and map the non-BSD components onto the modules you intend to import, then install PyTorch and MNE-Python at the versions your target release expects before running pip install braindecode. Everything else, including which architectures are available and how augmentation is configured, is documented at braindecode.org rather than in the README, so plan to spend your first hour there.

Editorial conclusion

Adopt Braindecode if you already work in Python with MNE-Python Raw objects or with MOABB, and you want published convolutional architectures plus augmentation in one place instead of re-implementing them per paper. Do not adopt it if you need a non-commercial-clean codebase without auditing file headers, or if your pipeline is built on scikit-learn feature extraction and you have no intention of moving to PyTorch. Before committing, read LICENSE and NOTICE to identify which files fall under CC BY-NC 4.0 or CC BY-NC-SA 4.0, and check that your PyTorch and MNE-Python versions satisfy what the current release pins.

Official sources

  1. braindecode/braindecode on GitHub
  2. License: BSD-3-Clause
  3. Project website
  4. README
  5. Releases
Community notes

Community notes