Upload folder using huggingface_hub
Browse files- README.md +111 -0
- config.json +52 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: bsd-3-clause
|
| 3 |
+
library_name: braindecode
|
| 4 |
+
pipeline_tag: feature-extraction
|
| 5 |
+
tags:
|
| 6 |
+
- eeg
|
| 7 |
+
- biosignal
|
| 8 |
+
- pytorch
|
| 9 |
+
- neuroscience
|
| 10 |
+
- eeg-dino
|
| 11 |
+
- foundation-model
|
| 12 |
+
- self-supervised
|
| 13 |
+
- self-distillation
|
| 14 |
+
- braindecode
|
| 15 |
+
- model_hub_mixin
|
| 16 |
+
- pytorch_model_hub_mixin
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# EEG-DINO Medium — Self-Distillation EEG Foundation Model
|
| 20 |
+
|
| 21 |
+
EEG-DINO-Medium encoder (~33M parameters) pretrained with DINO-v2 hierarchical self-distillation (Wang et al., MICCAI 2025).
|
| 22 |
+
|
| 23 |
+
This is the **eegdino-medium-pretrained** checkpoint for `braindecode.models.EEGDINO`,
|
| 24 |
+
curated and re-uploaded as part of the
|
| 25 |
+
[OpenEEG-Bench](https://huggingface.co/spaces/braindecode/OpenEEGBench) effort.
|
| 26 |
+
|
| 27 |
+
## Quick start
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
pip install braindecode[hub]
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from braindecode.models import EEGDINO
|
| 35 |
+
|
| 36 |
+
model = EEGDINO.from_pretrained(
|
| 37 |
+
"braindecode/eegdino-medium-pretrained",
|
| 38 |
+
n_outputs=2, # set to your downstream task
|
| 39 |
+
n_chans=19,
|
| 40 |
+
sfreq=200,
|
| 41 |
+
)
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
`from_pretrained` reads both the architecture configuration (`config.json`)
|
| 45 |
+
and the weights (`model.safetensors` or `pytorch_model.bin`) and returns a
|
| 46 |
+
ready-to-fine-tune `nn.Module`.
|
| 47 |
+
|
| 48 |
+
## Model details
|
| 49 |
+
|
| 50 |
+
| | |
|
| 51 |
+
|---|---|
|
| 52 |
+
| Architecture | `braindecode.models.EEGDINO` |
|
| 53 |
+
| Expected channels | 19 |
|
| 54 |
+
| Expected sampling frequency | 200 Hz |
|
| 55 |
+
| Library | [braindecode](https://github.com/braindecode/braindecode) ≥ 1.5 |
|
| 56 |
+
| Loaded via | `huggingface_hub.PyTorchModelHubMixin` (free with `braindecode[hub]`) |
|
| 57 |
+
|
| 58 |
+
For the full architecture description, parameter table, and references,
|
| 59 |
+
see the rendered docstring at
|
| 60 |
+
<https://braindecode.org/stable/generated/braindecode.models.EEGDINO.html>
|
| 61 |
+
or in the interactive
|
| 62 |
+
[Model Explorer Space](https://huggingface.co/spaces/braindecode/model-explorer).
|
| 63 |
+
|
| 64 |
+
## Training data
|
| 65 |
+
|
| 66 |
+
Temple University Hospital EEG Corpus (TUEG), 19 common 10-20 channels resampled to 200 Hz (>9000 hours), following CBraMod's preprocessing. Pretrained by hierarchical self-distillation.
|
| 67 |
+
|
| 68 |
+
## Intended use
|
| 69 |
+
|
| 70 |
+
Larger EEG-DINO encoder for feature extraction or fine-tuning; the architecture is restored from config.json on load. The classification head is re-initialized on load.
|
| 71 |
+
|
| 72 |
+
## Limitations
|
| 73 |
+
|
| 74 |
+
- **Channel layout matters.** Performance degrades when the input montage
|
| 75 |
+
differs from the pretraining montage. Use the `Interpolated*` variant
|
| 76 |
+
(where available) or resample channels with MNE before fine-tuning.
|
| 77 |
+
- **Sampling rate matters.** Resample your data to 200 Hz before
|
| 78 |
+
inference; the positional / patch embeddings assume this rate.
|
| 79 |
+
- **Inherited license restrictions.** Downstream weights derived from
|
| 80 |
+
this checkpoint inherit the license of the original training corpus
|
| 81 |
+
(some braindecode pretraining corpora are CC-BY-NC). Verify the
|
| 82 |
+
upstream dataset licence before commercial use.
|
| 83 |
+
|
| 84 |
+
## Citation
|
| 85 |
+
|
| 86 |
+
If you use this checkpoint, please cite both the original architecture
|
| 87 |
+
paper and braindecode.
|
| 88 |
+
|
| 89 |
+
```bibtex
|
| 90 |
+
@inproceedings{wang2025eegdino,
|
| 91 |
+
title = {{EEG-DINO}: Learning {EEG} Foundation Models via Hierarchical
|
| 92 |
+
Self-Distillation},
|
| 93 |
+
author = {Wang, Xujia and Liu, Xuhui and Liu, Xi and Si, Qian and Xu,
|
| 94 |
+
Zhaoliang and Li, Yang and Zhen, Xiantong},
|
| 95 |
+
booktitle = {Medical Image Computing and Computer Assisted Intervention (MICCAI)},
|
| 96 |
+
year = {2025},
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
@article{aristimunha2025braindecode,
|
| 100 |
+
title = {Braindecode: a deep learning library for raw electrophysiological data},
|
| 101 |
+
author = {Aristimunha, Bruno and others},
|
| 102 |
+
journal = {Zenodo},
|
| 103 |
+
year = {2025},
|
| 104 |
+
doi = {10.5281/zenodo.17699192},
|
| 105 |
+
}
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
## License
|
| 109 |
+
|
| 110 |
+
BSD-3-Clause for the model code (matching braindecode).
|
| 111 |
+
The pretraining data may impose additional restrictions — see *Limitations*.
|
config.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"n_outputs": 2,
|
| 3 |
+
"n_chans": 19,
|
| 4 |
+
"chs_info": null,
|
| 5 |
+
"n_times": 1000,
|
| 6 |
+
"input_window_seconds": null,
|
| 7 |
+
"sfreq": null,
|
| 8 |
+
"patch_size": 200,
|
| 9 |
+
"n_layer": 16,
|
| 10 |
+
"nhead": 16,
|
| 11 |
+
"dim_feedforward": 1024,
|
| 12 |
+
"channels_kernel_stride_padding_norm": [
|
| 13 |
+
[
|
| 14 |
+
64,
|
| 15 |
+
49,
|
| 16 |
+
25,
|
| 17 |
+
24,
|
| 18 |
+
[
|
| 19 |
+
8,
|
| 20 |
+
64
|
| 21 |
+
]
|
| 22 |
+
],
|
| 23 |
+
[
|
| 24 |
+
128,
|
| 25 |
+
3,
|
| 26 |
+
1,
|
| 27 |
+
1,
|
| 28 |
+
[
|
| 29 |
+
8,
|
| 30 |
+
128
|
| 31 |
+
]
|
| 32 |
+
],
|
| 33 |
+
[
|
| 34 |
+
64,
|
| 35 |
+
3,
|
| 36 |
+
1,
|
| 37 |
+
1,
|
| 38 |
+
[
|
| 39 |
+
8,
|
| 40 |
+
64
|
| 41 |
+
]
|
| 42 |
+
]
|
| 43 |
+
],
|
| 44 |
+
"num_channels": 19,
|
| 45 |
+
"n_global_tokens": 1,
|
| 46 |
+
"global_token_layer": 1,
|
| 47 |
+
"activation": "torch.nn.modules.activation.GELU",
|
| 48 |
+
"drop_prob": 0.1,
|
| 49 |
+
"return_features": false,
|
| 50 |
+
"return_encoder_output": false,
|
| 51 |
+
"braindecode_version": "1.6.1dev0"
|
| 52 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9454036a1825cfe980c716a10152f5c15417f3827b7992030bc4ca94536a5dfc
|
| 3 |
+
size 135048840
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4cb5c491ca177d319ab9ab17a8da34adc6a86e84c9713fa8d59e930a019d9df8
|
| 3 |
+
size 135109751
|