CoolFace
Modelpublic

braindecode/BIOT

sourceHugging Facebsd-3-clauseupdated 5mo agoView on Hugging Face
0likes
README.md94 linesDownload Raw Back to root
1---2license: bsd-3-clause3library_name: braindecode4pipeline_tag: feature-extraction5tags:6  - eeg7  - biosignal8  - pytorch9  - neuroscience10  - braindecode11  - foundation-model12  - sleep-staging13---14 15# BIOT16 17BIOT from Yang et al (2023) [Yang2023]18 19> **Architecture-only repository.** Documents the20> `braindecode.models.BIOT` class. **No pretrained weights are21> distributed here.** Instantiate the model and train it on your own22> data.23 24## Quick start25 26```bash27pip install braindecode28```29 30```python31from braindecode.models import BIOT32 33model = BIOT(34    n_chans=16,35    sfreq=200,36    input_window_seconds=10.0,37    n_outputs=2,38)39```40 41The signal-shape arguments above are illustrative defaults — adjust to42match your recording.43 44## Documentation45- Full API reference: <https://braindecode.org/stable/generated/braindecode.models.BIOT.html>46- Interactive browser (live instantiation, parameter counts):47  <https://huggingface.co/spaces/braindecode/model-explorer>48- Source on GitHub: <https://github.com/braindecode/braindecode/blob/master/braindecode/models/biot.py#L56>49 50 51## Architecture52 53![BIOT architecture](https://braindecode.org/dev/_static/model/biot.jpg)54 55 56## Parameters57 58| Parameter | Type | Description |59|---|---|---|60| `embed_dim` | int, optional | The size of the embedding layer, by default 256 |61| `num_heads` | int, optional | The number of attention heads, by default 8 |62| `num_layers` | int, optional | The number of transformer layers, by default 4 |63| `activation: nn.Module, default=nn.ELU` | — | Activation function class to apply. Should be a PyTorch activation module class like `nn.ReLU` or `nn.ELU`. Default is `nn.ELU`. |64| `return_feature: bool, optional` | — | Changing the output for the neural network. Default is single tensor when return_feature is True, return embedding space too. Default is False. |65| `hop_length: int, optional` | — | The hop length for the torch.stft transformation in the encoder. The default is 100. |66| `sfreq: int, optional` | — | The sfreq parameter for the encoder. The default is 200 |67 68 69## References70 711. Yang, C., Westover, M.B. and Sun, J., 2023, November. BIOT: Biosignal Transformer for Cross-data Learning in the Wild. In Thirty-seventh Conference on Neural Information Processing Systems, NeurIPS.722. Yang, C., Westover, M.B. and Sun, J., 2023. BIOT Biosignal Transformer for Cross-data Learning in the Wild. GitHub https://github.com/ycq091044/BIOT (accessed 2024-02-13)73 74 75## Citation76 77Cite the original architecture paper (see *References* above) and braindecode:78 79```bibtex80@article{aristimunha2025braindecode,81  title   = {Braindecode: a deep learning library for raw electrophysiological data},82  author  = {Aristimunha, Bruno and others},83  journal = {Zenodo},84  year    = {2025},85  doi     = {10.5281/zenodo.17699192},86}87```88 89## License90 91BSD-3-Clause for the model code (matching braindecode).92Pretraining-derived weights, if you fine-tune from a checkpoint,93inherit the licence of that checkpoint and its training corpus.94