--- library_name: braindecode license: apache-2.0 tags: - Brant - braindecode - ieeg - seeg - foundation-model - model_hub_mixin - pytorch_model_hub_mixin --- # Brant — Foundation Model for Intracranial Neural Signals Pretrained weights for [`braindecode.models.Brant`](https://braindecode.org/stable/generated/braindecode.models.Brant.html), a faithful braindecode port of **Brant** (Zhang et al., NeurIPS 2023), a foundation model for intracranial (sEEG/iEEG) recordings. - Paper: [Brant: Foundation Model for Intracranial Neural Signal](https://proceedings.neurips.cc/paper_files/paper/2023/hash/535915d26859036410b0533804cee788-Abstract-Conference.html) (NeurIPS 2023) - Original code & weights: [yzz673/Brant](https://github.com/yzz673/Brant) · [Daoze/Brant](https://huggingface.co/Daoze/Brant) - braindecode docs: https://braindecode.org ## Provenance & license These weights are the **official pretrained checkpoint** released by the original authors (temporal + spatial encoders), converted into the braindecode `Brant` module (state dict mapped 1:1; the two mask-token embeddings used only for the masked-autoencoding pretraining objective are dropped). The original release is under the **Apache-2.0** license, which this repository preserves. > **Disclaimer (from the original authors).** The pre-training data for Brant was > collected during routine treatment of epilepsy patients and is intended solely > for medical or research use. These pre-trained weights are released only for > medical or research purposes and must not be subjected to any form of misuse. ## Model configuration This checkpoint uses the paper's configuration (~508M parameters): | | | |---|---| | `patch_size` | 1500 (6 s at 250 Hz) | | `embed_dim` | 2048 | | `ffn_dim` | 3072 | | `temporal_n_layers` | 12 | | `spatial_n_layers` | 5 | | `n_heads` | 16 | | `n_freq_bands` | 8 | | `n_times` | 22500 (15 patches, 90 s at 250 Hz) | | `sfreq` | 250 Hz | The signal is expected at **250 Hz**. The learnable temporal positional encoding is fixed to 15 patches, so keep `n_times=22500`; you may freely change `n_chans` (channels are pooled) and `n_outputs` (the classification head is task-specific and randomly initialized — fine-tune it on your downstream task). ## Usage ```python from braindecode.models import Brant # Encoders load the pretrained weights; the classification head is (re)initialized # for your task via n_outputs. model = Brant.from_pretrained("braindecode/brant-pretrained", n_outputs=2) ``` ## Citation ```bibtex @inproceedings{zhang2023brant, title = {Brant: Foundation Model for Intracranial Neural Signal}, author = {Zhang, Daoze and Yuan, Zhizhang and Yang, Yang and Chen, Junru and Wang, Jingjing and Li, Yafeng}, booktitle = {Thirty-seventh Conference on Neural Information Processing Systems (NeurIPS)}, year = {2023} } ```