CoolFace
Modelpublic

braindecode/EEGPT

sourceHugging Facebsd-3-clauseupdated 5mo agoView on Hugging Face
0likes
Model Card

EEGPT

EEGPT: Pretrained Transformer for Universal and Reliable Representation of EEG Signals from Wang et al. (2024) [eegpt].

Architecture-only repository. Documents the braindecode.models.EEGPT class. No pretrained weights are distributed here. Instantiate the model and train it on your own data.

Quick start

bash
pip install braindecode
python
from braindecode.models import EEGPT

model = EEGPT(
    n_chans=22,
    sfreq=200,
    input_window_seconds=4.0,
    n_outputs=2,
)

The signal-shape arguments above are illustrative defaults — adjust to match your recording.

Documentation

  • Full API reference: <https://braindecode.org/stable/generated/braindecode.models.EEGPT.html>
  • Interactive browser (live instantiation, parameter counts): <https://huggingface.co/spaces/braindecode/model-explorer>
  • Source on GitHub: <https://github.com/braindecode/braindecode/blob/master/braindecode/models/eegpt.py#L21>

Architecture

EEGPT architecture

Parameters

ParameterTypeDescription
return_encoder_outputbool, default=FalseWhether to return the encoder output or the classifier output.
patch_sizeint, default=64Size of the patches for the transformer.
patch_strideint, default=32Stride of the patches for the transformer.
embed_numint, default=4Number of summary tokens used for the global representation.
embed_dimint, default=512Dimension of the embeddings.
depthint, default=8Number of transformer layers.
num_headsint, default=8Number of attention heads.
mlp_ratiofloat, default=4.0Ratio of the MLP hidden dimension to the embedding dimension.
drop_probfloat, default=0.0Dropout probability.
attn_drop_ratefloat, default=0.0Attention dropout rate.
drop_path_ratefloat, default=0.0Drop path rate.
init_stdfloat, default=0.02Standard deviation for weight initialization.
qkv_biasbool, default=TrueWhether to use bias in the QKV projection.
norm_layertorch.nn.Module, default=NoneNormalization layer. If None, defaults to nn.LayerNorm with epsilon layer_norm_eps.
layer_norm_epsfloat, default=1e-6Epsilon value for the normalization layer.

References

  1. 1.Wang, G., Liu, W., He, Y., Xu, C., Ma, L., & Li, H. (2024). EEGPT: Pretrained transformer for universal and reliable representation of eeg signals. Advances in Neural Information Processing Systems, 37, 39249-39280. Online: https://proceedings.neurips.cc/paper_files/paper/2024/file/4540d267eeec4e5dbd9dae9448f0b739-Paper-Conference.pdf

Citation

Cite the original architecture paper (see References above) and braindecode:

bibtex
@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},
}

License

BSD-3-Clause for the model code (matching braindecode). Pretraining-derived weights, if you fine-tune from a checkpoint, inherit the licence of that checkpoint and its training corpus.