Add model card (provenance, license, config, usage)
Browse files
README.md
CHANGED
|
@@ -1,14 +1,77 @@
|
|
| 1 |
---
|
| 2 |
library_name: braindecode
|
| 3 |
-
license:
|
| 4 |
tags:
|
| 5 |
- Brant
|
| 6 |
- braindecode
|
|
|
|
|
|
|
|
|
|
| 7 |
- model_hub_mixin
|
| 8 |
- pytorch_model_hub_mixin
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
library_name: braindecode
|
| 3 |
+
license: apache-2.0
|
| 4 |
tags:
|
| 5 |
- Brant
|
| 6 |
- braindecode
|
| 7 |
+
- ieeg
|
| 8 |
+
- seeg
|
| 9 |
+
- foundation-model
|
| 10 |
- model_hub_mixin
|
| 11 |
- pytorch_model_hub_mixin
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Brant — Foundation Model for Intracranial Neural Signals
|
| 15 |
+
|
| 16 |
+
Pretrained weights for [`braindecode.models.Brant`](https://braindecode.org/stable/generated/braindecode.models.Brant.html),
|
| 17 |
+
a faithful braindecode port of **Brant** (Zhang et al., NeurIPS 2023), a foundation
|
| 18 |
+
model for intracranial (sEEG/iEEG) recordings.
|
| 19 |
+
|
| 20 |
+
- Paper: [Brant: Foundation Model for Intracranial Neural Signal](https://proceedings.neurips.cc/paper_files/paper/2023/hash/535915d26859036410b0533804cee788-Abstract-Conference.html) (NeurIPS 2023)
|
| 21 |
+
- Original code & weights: [yzz673/Brant](https://github.com/yzz673/Brant) · [Daoze/Brant](https://huggingface.co/Daoze/Brant)
|
| 22 |
+
- braindecode docs: https://braindecode.org
|
| 23 |
+
|
| 24 |
+
## Provenance & license
|
| 25 |
+
|
| 26 |
+
These weights are the **official pretrained checkpoint** released by the original
|
| 27 |
+
authors (temporal + spatial encoders), converted into the braindecode `Brant`
|
| 28 |
+
module (state dict mapped 1:1; the two mask-token embeddings used only for the
|
| 29 |
+
masked-autoencoding pretraining objective are dropped). The original release is
|
| 30 |
+
under the **Apache-2.0** license, which this repository preserves.
|
| 31 |
+
|
| 32 |
+
> **Disclaimer (from the original authors).** The pre-training data for Brant was
|
| 33 |
+
> collected during routine treatment of epilepsy patients and is intended solely
|
| 34 |
+
> for medical or research use. These pre-trained weights are released only for
|
| 35 |
+
> medical or research purposes and must not be subjected to any form of misuse.
|
| 36 |
+
|
| 37 |
+
## Model configuration
|
| 38 |
+
|
| 39 |
+
This checkpoint uses the paper's configuration (~508M parameters):
|
| 40 |
+
|
| 41 |
+
| | |
|
| 42 |
+
|---|---|
|
| 43 |
+
| `patch_size` | 1500 (6 s at 250 Hz) |
|
| 44 |
+
| `embed_dim` | 2048 |
|
| 45 |
+
| `ffn_dim` | 3072 |
|
| 46 |
+
| `temporal_n_layers` | 12 |
|
| 47 |
+
| `spatial_n_layers` | 5 |
|
| 48 |
+
| `n_heads` | 16 |
|
| 49 |
+
| `n_freq_bands` | 8 |
|
| 50 |
+
| `n_times` | 22500 (15 patches, 90 s at 250 Hz) |
|
| 51 |
+
| `sfreq` | 250 Hz |
|
| 52 |
+
|
| 53 |
+
The signal is expected at **250 Hz**. The learnable temporal positional encoding
|
| 54 |
+
is fixed to 15 patches, so keep `n_times=22500`; you may freely change `n_chans`
|
| 55 |
+
(channels are pooled) and `n_outputs` (the classification head is task-specific
|
| 56 |
+
and randomly initialized — fine-tune it on your downstream task).
|
| 57 |
+
|
| 58 |
+
## Usage
|
| 59 |
+
|
| 60 |
+
```python
|
| 61 |
+
from braindecode.models import Brant
|
| 62 |
+
|
| 63 |
+
# Encoders load the pretrained weights; the classification head is (re)initialized
|
| 64 |
+
# for your task via n_outputs.
|
| 65 |
+
model = Brant.from_pretrained("braindecode/brant-pretrained", n_outputs=2)
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
## Citation
|
| 69 |
+
|
| 70 |
+
```bibtex
|
| 71 |
+
@inproceedings{zhang2023brant,
|
| 72 |
+
title = {Brant: Foundation Model for Intracranial Neural Signal},
|
| 73 |
+
author = {Zhang, Daoze and Yuan, Zhizhang and Yang, Yang and Chen, Junru and Wang, Jingjing and Li, Yafeng},
|
| 74 |
+
booktitle = {Thirty-seventh Conference on Neural Information Processing Systems (NeurIPS)},
|
| 75 |
+
year = {2023}
|
| 76 |
+
}
|
| 77 |
+
```
|