torcheeg/torcheeg

TorchEEG is a library built on PyTorch for EEG signal analysis.

What it solves

TorchEEG removes the technical overhead of EEG analysis research. Instead of spending time on data format conversions, preprocessing pipelines, and experiment setup, researchers can use a unified interface to access datasets, apply standard preprocessing steps, and train deep learning models. This speeds up reproducing existing work and starting new EEG studies, especially in emotion recognition.

How it works

TorchEEG is built on PyTorch. It defines a unified input/output format (torcheeg.io) for storing and reading preprocessed EEG data. It includes several benchmark datasets such as DEAP, SEED, DREAMER, and AMIGOS. Users can apply two kinds of transforms: offline transforms process the entire dataset once and save the results to disk, while online transforms modify each sample on the fly. The library provides data splitting methods (k-fold, leave-one-out) and reproductions of CNN, GNN, and Transformer models. A built-in ClassifierTrainer (based on PyTorch Lightning) handles the training loop, as shown in the quickstart with the DEAP dataset.

Who it's for

EEG researchers and practitioners who want to focus on experiments rather than implementation details. It’s especially useful for emotion recognition or other EEG classification tasks, where standard datasets and preprocessing are needed quickly. It also suits those who want to compare model performance under different data splitting schemes without writing extra code.

Highlights

  • Unified IO API for efficient storage and fast loading of preprocessed data.
  • Multiple built-in benchmark datasets for emotion recognition.
  • Extensive transforms for feature extraction, normalization, and reshaping data for CNN, GNN, or Transformer models.
  • Offline and online preprocessing modes; offline processing avoids redundant computations.
  • Dataset splitting strategies for subject-dependent, subject-independent, and conventional settings.
  • Reproduced deep learning models (CNN, GNN, Transformer) and a trainer built on PyTorch Lightning.
  • Multiprocessing support to accelerate data preprocessing.

Related

  • Project
  • Project
  • Project
  • Project
  • Project