Model reference · open weights
duin-pretrained is an open-weight embedding model from braindecode. duin-pretrained (FP32) weighs 8 MB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the braindecode/duin-pretrained model card, 2026-11-19
What it is
| Released by | braindecode |
|---|---|
| Released | 2026-10-11 |
| Parameters | 4M |
| VRAM | 8 MB for the weights |
What it runs on
| Card | Runs | Memory |
|---|---|---|
| RTX 3060 12 GB | fits | 11.6 GB |
| RTX 4060 Ti 16 GB | fits | 15.4 GB |
| RTX 3090 24 GB | fits | 23.4 GB |
| RTX 4090 24 GB | fits | 23.4 GB |
| RTX 5090 32 GB | fits | 31.0 GB |
| L40S 48 GB | fits | 44.0 GB |
| A100 80 GB | fits | 78.2 GB |
| H100 80 GB | fits | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | fits | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
From the model card
braindecode-native re-host of the official Du-IN pretrained checkpoints
(Zheng et al., NeurIPS 2024), converted so they load directly with
braindecode.models.DuIN.
Du-IN decodes speech (61 Chinese words) from sEEG. Each subject's signal (10
selected bipolar channels, 1000 Hz) goes through a subject-specific spatial
projection, a patch-wise convolutional tokenizer (one token per 100 ms) and an
8-layer Transformer encoder. The encoder is pretrained per subject by masked
modelling of discrete codes learned by a VQ-VAE (mae); the VQ-VAE encoder
itself (vqvae) is the other released stage.
| Original code | https://github.com/liulab-repository/Du-IN (MIT) |
| Original weights | https://huggingface.co/datasets/liulab-repository/Du-IN (pretrains/duin///model/checkpoint-399.pth, CC BY 4.0) |
| Paper | Zheng et al. (2024), Du-IN: Discrete units-guided mask modeling for decoding speech from intracranial neural signals, NeurIPS 2024, arXiv:2405.11459 |
These weights are a format conversion only of the authors' checkpoints, with no re-training. For each of the 24 checkpoints:
W (160, 1), reshaped to spatial_projection.weight (16, 10));duin_cls encoder output on the
same input to < 1e-5 (max abs diff 7.2e-6 over all 24);DuIN.from_pretrained on the uploaded file gives the same state dict and
outputs as loading the original .pth.The pretraining-only parts (mask_emb, VQ codebook, MAE token head) are
dropped. The classification head (head_hidden, final_layer, 61 outputs) is
randomly initialised and must be fine-tuned. Per-file source sha256 are
in conversion_report.json.
| path | content |
|---|---|
config.json | shared DuIN config (n_chans=10, n_times=3000, sfreq=1000, n_outputs=61) |
subj-XXX/mae/model.safetensors | MAE-pretrained encoder of subject XXX (001 to 012), the paper's Du-IN |
subj-XXX/vqvae/model.safetensors | VQ-VAE-stage encoder of subject XXX (the paper's "Du-IN (vqvae)") |
model.safetensors | default = subj-001/mae |
Every checkpoint is subject-specific: it was trained on that subject's 10 channels and only fits that montage, in the channel order of the authors' dataset. They are not a cross-subject foundation model.
The data that shaped these weights. The ids are the datasets: field of this card,
which braindecode reads into model.card_data.datasets when you call
from_pretrained (MOABB class names for MOABB datasets, OpenNeuro / NEMAR
accessions, Hub ids otherwise). nm/on ids are datasets on NEMAR
(on = NEMAR's copy of the OpenNeuro dataset with the same number). Rows marked
private: are data the authors did not release; they are not in datasets:.
datasets: id | Dataset | Stage | Modality |
|---|---|---|---|
private:Du-IN-Xuanwu-sEEG-other-tasks | Unreleased sEEG recordings of the same 12 Du-IN subjects from other cognitive tasks (~12 h per subject; Xuanwu Hospital, Beijing) | pretraining | iEEG |
nm000365 | Du-IN Chinese 61-word reading sEEG dataset (12 subjects, Xuanwu Hospital; preprocessed ~3 h task recordings per subject), 'seeg.he2023xuanwu' | pretraining | iEEG |
from braindecode.models import DuIN
# MAE-pretrained Du-IN of subject 002; the 61-word head is re-initialised.
model = DuIN.from_pretrained(
"braindecode/duin-pretrained",
filename="subj-002/mae/model.safetensors",
)
# Pass n_outputs=... for another task (the head is re-created).
# input: (batch, 10, 3000) — 3 s at 1000 Hz, z-scored per channel
logits = model(x)
The reference head ends with a sigmoid and is trained with
F.cross_entropy(torch.sigmoid(logits), target); braindecode returns logits.
Use that loss to match the reference training.
Fine-tuning on the 61-word task with the authors' run_cls.py protocol (200
epochs, AdamW, sigmoid cross-entropy, 6 seeds × 12 subjects, paper-time data
revision 056a87b7, mean ± SE over subjects). There are two independent runs:
run_cls.train() loop run with both the original model
and the port, starting from the same weights (Gaudi2 / CPU);| paper (Table 2) | A: authors' code | A: port | B: port | |
|---|---|---|---|---|
| Du-IN (mae) | 62.70 ± 4.69 | 60.52 ± 4.58 | 60.16 ± 4.62 | 59.37 ± 4.69 |
| Du-IN (vqvae) | 58.24 ± 4.83 | 55 |
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.
How it works