EpiNT pretrained backbone (authors' representations.bin)
Browse files- README.md +95 -0
- config.json +18 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: braindecode
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- EpiNT
|
| 6 |
+
- braindecode
|
| 7 |
+
- eeg
|
| 8 |
+
- ieeg
|
| 9 |
+
- seeg
|
| 10 |
+
- ecog
|
| 11 |
+
- epilepsy
|
| 12 |
+
- foundation-model
|
| 13 |
+
- model_hub_mixin
|
| 14 |
+
- pytorch_model_hub_mixin
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# EpiNT — Epilepsy Neurophysiological Transformer
|
| 18 |
+
|
| 19 |
+
Pretrained weights for [`braindecode.models.EpiNT`](https://braindecode.org/stable/generated/braindecode.models.EpiNT.html),
|
| 20 |
+
a braindecode port of **EpiNT** (Zhang et al., 2025), a channel-independent
|
| 21 |
+
transformer pretrained on 2,700 hours of scalp EEG and intracranial EEG (ECoG,
|
| 22 |
+
sEEG) from 1,199 patients.
|
| 23 |
+
|
| 24 |
+
- Paper: [Cross-Modal Epileptic Signal Harmonization: Frequency Domain Mapping Quantization for Pre-training a Unified Neurophysiological Transformer](https://arxiv.org/abs/2506.17068) (arXiv:2506.17068)
|
| 25 |
+
- Original code & weights: [RunKZhang/EpiNT](https://github.com/RunKZhang/EpiNT/tree/781e1d61e72899d59b4955b4c075404eef532a40)
|
| 26 |
+
- braindecode docs: https://braindecode.org
|
| 27 |
+
|
| 28 |
+
## Provenance & license
|
| 29 |
+
|
| 30 |
+
These weights are the authors' pretrained backbone, `weights/representations.bin`
|
| 31 |
+
at commit `781e1d61` (sha256 `b4449974058fd6d314debeef0a09c05730a70e822f17244e88d1ee4e7d9a8b1d`),
|
| 32 |
+
converted into the braindecode `EpiNT` module through its `mapping` (all 102
|
| 33 |
+
backbone tensors; the pretraining mask token `embed.mask_encoding` is dropped).
|
| 34 |
+
The classification head is not part of the release and is randomly initialized.
|
| 35 |
+
|
| 36 |
+
The original release is under the MIT license, which this repository preserves:
|
| 37 |
+
|
| 38 |
+
> MIT License
|
| 39 |
+
>
|
| 40 |
+
> Copyright (c) 2024 Auton Lab, Carnegie Mellon University
|
| 41 |
+
>
|
| 42 |
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 43 |
+
> of this software and associated documentation files (the "Software"), to deal
|
| 44 |
+
> in the Software without restriction, including without limitation the rights
|
| 45 |
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 46 |
+
> copies of the Software, and to permit persons to whom the Software is
|
| 47 |
+
> furnished to do so, subject to the following conditions:
|
| 48 |
+
>
|
| 49 |
+
> The above copyright notice and this permission notice shall be included in all
|
| 50 |
+
> copies or substantial portions of the Software.
|
| 51 |
+
>
|
| 52 |
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 53 |
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 54 |
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 55 |
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 56 |
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 57 |
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 58 |
+
> SOFTWARE.
|
| 59 |
+
|
| 60 |
+
## Model configuration
|
| 61 |
+
|
| 62 |
+
This checkpoint uses the paper's configuration (~19.2M parameters):
|
| 63 |
+
|
| 64 |
+
| | |
|
| 65 |
+
|---|---|
|
| 66 |
+
| `patch_size` | 256 |
|
| 67 |
+
| `embed_dim` | 512 |
|
| 68 |
+
| `ffn_dim` | 2048 |
|
| 69 |
+
| `n_layers` | 6 |
|
| 70 |
+
| `n_heads` | 8 |
|
| 71 |
+
| `n_times` | 3072 (12 patches) |
|
| 72 |
+
|
| 73 |
+
Each encoder `LayerNorm` spans tokens and features, so keep `n_times=3072`:
|
| 74 |
+
12 s at 256 Hz for scalp EEG, or 3 s at 1024 Hz for iEEG. Signals are expected
|
| 75 |
+
in microvolts. Every channel is encoded alone and the class tokens are averaged,
|
| 76 |
+
so `n_chans` is free; `n_outputs` resets the task head.
|
| 77 |
+
|
| 78 |
+
## Usage
|
| 79 |
+
|
| 80 |
+
```python
|
| 81 |
+
from braindecode.models import EpiNT
|
| 82 |
+
|
| 83 |
+
model = EpiNT.from_pretrained("braindecode/epint-pretrained", n_chans=17, n_outputs=2)
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## Citation
|
| 87 |
+
|
| 88 |
+
```bibtex
|
| 89 |
+
@article{zhang2025epint,
|
| 90 |
+
title = {Cross-Modal Epileptic Signal Harmonization: Frequency Domain Mapping Quantization for Pre-training a Unified Neurophysiological Transformer},
|
| 91 |
+
author = {Zhang, Runkai and Yu, Hua and Gan, John Q. and Wang, Haixian},
|
| 92 |
+
journal = {arXiv preprint arXiv:2506.17068},
|
| 93 |
+
year = {2025}
|
| 94 |
+
}
|
| 95 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"patch_size": 256,
|
| 3 |
+
"embed_dim": 512,
|
| 4 |
+
"n_layers": 6,
|
| 5 |
+
"n_heads": 8,
|
| 6 |
+
"ffn_dim": 2048,
|
| 7 |
+
"drop_prob": 0.1,
|
| 8 |
+
"head_drop_prob": 0.1,
|
| 9 |
+
"rope_theta": 10000.0,
|
| 10 |
+
"activation": "torch.nn.modules.activation.ReLU",
|
| 11 |
+
"n_outputs": 2,
|
| 12 |
+
"n_chans": 1,
|
| 13 |
+
"chs_info": null,
|
| 14 |
+
"n_times": 3072,
|
| 15 |
+
"input_window_seconds": null,
|
| 16 |
+
"sfreq": 256,
|
| 17 |
+
"braindecode_version": "1.8.1"
|
| 18 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9550cc54c2d0f8d103610db529a1046e91f056a5e3b10b3d33ec622ed6b4a5b
|
| 3 |
+
size 76789328
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:82979f06c4fd8765a845b8a7d3771d0e4664ffc5b7ec8cde46b3273897e98eb9
|
| 3 |
+
size 76816422
|