/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
brainmu-tokenizer
Опубликована
12 авг 2026

brainmu-tokenizer

ЭмбеддингиТекст → embedding

Brainmu Tokenizer — токенизатор нейронных сигналов мышей для извлечения признаков, дискретного кодирования и реконструкции EEG, кальциевых и спайковых записей.

4скачиваний за 30 дней1лайквеса обновлены17 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Brainmu Tokenizer (Brainmu0) — предварительно обученный токенизатор от BAAI для нейронных записей мышей. Он преобразует EEG/EMG, кальциевые сигналы ΔF/F и деконволюционные события, а также биннированные спайковые отсчёты Neuropixels в дискретные коды или замороженные признаки; отдельный декодер восстанавливает сигнал из кодов. Архитектура включает отдельные свёрточные входные блоки для модальностей, общий трансформер SigLIP2-ViT-L из 24 блоков и продуктовый квантователь с восемью кодовыми книгами по 4096 кодов. Выпуск содержит только этап токенизатора, без базовой модели, которая потребляет эти токены.

Модель предназначена для извлечения признаков и токенов из записей мозга мышей, реконструкции сигналов и обучения небольших супервизируемых классификаторов или регрессоров на замороженных признаках. В README приведены демонстрационные результаты для стадирования сна, распознавания направления решётки и оценки скорости бега; они не являются стандартизированным бенчмарком. Контрольная точка обучена исключительно на данных мышей, поэтому перенос на другие виды и технологии записи требует отдельной проверки. Назначения кодов чувствительны к точности вычислений и устройству, а общий интерфейс кодов сам по себе не означает одинаковую семантику кодов в разных модальностях. Лицензия — Apache-2.0.

Сценарии применения

  • извлечение замороженных признаков из EEG/EMG мышей
  • дискретное кодирование кальциевых сигналов ΔF/F
  • токенизация биннированных спайков Neuropixels
  • реконструкция нейронных сигналов из токенов
  • классификация стадий сна по EEG-признакам
  • оценка скорости бега по нейронным записям

Ограничения

Модель обучена только на нейронных записях мышей; перенос на другие виды и технологии записи требует независимой проверки. Дискретные коды чувствительны к точности и устройству, поэтому признаки для сравнения рекомендуется извлекать в одинаковых вычислительных условиях.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Brainmu Tokenizer (Brainmu0)

A pretrained tokenizer that maps three kinds of mouse neural recordings — skull EEG/EMG field potentials, two-photon calcium ΔF/F and deconvolved events, and binned Neuropixels spike counts — onto one shared discrete token interface. Modality-specific convolutional stems feed a shared 24-block SigLIP2-ViT-L transformer trunk; a product quantizer splits each 64-dimensional token feature into eight 8-dimensional blocks and assigns each block by cosine similarity to one of 4096 codes in its own codebook; an independent decoder trunk reconstructs the selected modality from the discrete IDs. This is the tokenizer stage of Brainmu1.0; the token-consuming foundation model is not part of this release.

architecture

Usage

The package is not on PyPI. Clone the Brainmu repository and install it from the repository root:

git clone https://github.com/BAAI-Brain-Inspired-Group/Brainmu.git
cd Brainmu
pip install -e .                      # model and core API
pip install -e '.[data,notebook]'     # + public-data demo notebooks
import torch
from brainmu_tokenizer import UniTok

device = "cuda" if torch.cuda.is_available() else "cpu"
model = UniTok.from_pretrained("baai-brain/brainmu-tokenizer").eval().to(device)

# API smoke test: one canonical 4 s mouse EEG/EMG window at 250 Hz.
# Random values verify shapes only; they are not a meaningful neural example.
x = torch.randn(1, 2, 1000, device=device)
encoding = model.encode(x, modality="eeg")

encoding.indices      # (1, 8, 250)  discrete code IDs, one per codebook
encoding.features     # (1, 250, 64) quantized token features
encoding.token_mask   # (1, 250)     valid (non-padding) positions
encoding.grid_shape   # (2, 125)     channel-group × time token grid

reconstruction = model.decode(
    encoding.indices, modality="eeg",
    token_mask=encoding.token_mask, grid_shape=encoding.grid_shape,
)

The first from_pretrained call downloads the BF16 checkpoint (~1.48 GB) into the standard Hugging Face cache. The repository is gated: requesting access on this page shares your Hugging Face username and email with us, and approval is automatic. The download then needs an authenticated session — run hf auth login (huggingface-cli login on older huggingface_hub) or set HF_TOKEN. Set BRAINMU_TOKENIZER_CKPT=/path/to/brainmu-tokenizer to load a local release directory instead.

For source code, demo notebooks, preprocessing utilities, and the data guide, see the Brainmu repository.

Intended use

Extracting discrete tokens or frozen features from mouse neural recordings, reconstructing signals from tokens, and training small supervised heads on pooled frozen features. The tokenizer itself is not meant to be fine-tuned in these workflows.

Training domain — mouse only. The checkpoint was trained exclusively on mouse recordings. Other species and other recording technologies are out-of-domain transfer and require independent validation; a successful API call is not evidence of scientific validity after a domain shift.

modalityExpected signalTraining-time sampled rangesRelease chunk canvasDecoder output
eegmouse EEG/EMG field potentials128–250 Hz; 1–2 channels; 800 or 1000 samples2 × 1000signal values
dffcalcium ΔF/F traces1–30 Hz; 8–256 cells; 10 or 15 frames128 × 15signal values
eventdeconvolved calcium events1–30 Hz; 8–256 cells; 10 or 15 frames128 × 15Poisson log-rates
spikesper-unit binned spike counts5–60 Hz; 16–1024 units; 40 or 60 bins128 × 120Poisson log-rates

Normalize each channel over the full recording before cutting windows (brainmu_tokenizer.data.normalize_traces implements the training-matched rule), and convert event / spikes reconstructions out of log-rate space with reconstruction.clamp(max=6).exp() before comparing them to counts. Inputs that do not divide the modality stride must be zero-padded with aligned channel_mask / time_mask; oversized inputs are chunked automatically.

Weight precision and reproducibility

The uploaded model.safetensors stores all tensors in BF16, cast from the FP32 training weights. from_pretrained loads them into an FP32 model, which is the recommended way to run it.

Code assignment is a cosine argmax whose top-1/top-2 margins reach down to ~1e-4, so the discrete IDs are sensitive to numerical precision:

  • fixed model dtype and device → repeated runs agree exactly. encode ignores any ambient torch.autocast and keeps the quantization path in FP32, the same invariant training held.
  • changing the precision — model.to(torch.bfloat16), a different GPU, other kernels — shifts a few percent of code IDs.
  • token features and reconstructions are far more stable: pooled features move far less than the discrete IDs, and reconstructions are unaffected in practice.

Practical consequence: extract every feature set you intend to compare in one pass, and do not mix features cached from different dtypes or devices.

Results

Numbers below come from this checkpoint on the documented public mouse-data subsets used by the demo notebooks. They are reference points for checking your own run of those notebooks, not a standardized benchmark.

Reconstruction (masked metrics over the demo windows):

ModalitySignalDatasetPearson rSNR (dB)
eegmouse EEG/EMG @ 250 HzAccuSleep (Mouse01, day 1)0.99519.5
dffcalcium ΔF/F tracesAllen Visual Coding ophys0.97010.9
eventcalcium event proxy derived from ΔF/FAllen Visual Coding ophys0.98613.5
spikesNeuropixels binned spike countsAllen Visual Coding Neuropixels (DANDI:000021)0.9708.8

Frozen-feature heads — a small MLP (LayerNorm → Linear → GELU → Dropout → Linear, 17k–134k parameters) trained on pooled frozen features; the tokenizer is never fine-tuned:

TaskDatasetModalitySplit ruleExample score (chance)
Sleep staging, 3-classAccuSleep (2 mice × 2 days)eegsubject-isolated mouse92.9% balanced accuracy (33%)
Grating direction, 8-way / axis, 4-wayAllen Visual Coding ophys (experiment 510517131)dffheld-out presentations71.5% / 92.4% balanced accuracy (12.5% / 25%)
Running speed, regression / 2-stateAllen Visual Coding Neuropixels (DANDI:000021)spikescontiguous time blocksPearson r 0.974 / 96.7% balanced accuracy (50%)

Token interface

indices are parallel codebook assignments, not a flat language-model vocabulary: eight IDs, each indexing its own 4096-entry codebook, at every token-grid position. A downstream model must embed and merge the eight assignments explicitly, or consume features instead. The modalities share the codebooks, which gives them a uniform interface; that alone should not be read as proof that one ID means the same thing across modalities.

License and citation

Apache-2.0.

@software{brainmu,
  title   = {Brainmu Project},
  author  = {{The Brainmu Authors}},
  year    = {2026},
  version = {1.0.0},
  url     = {https://github.com/BAAI-Brain-Inspired-Group/Brainmu}
}

Associated study, where the mouse sleep work is relevant:

@article{yu2026memory,
  title   = {Memory reactivation underlies experience-dependent adaptive
             regulation of sleep},
  author  = {Yu, Menghan and Wang, Junjie and Zhai, Zihan and Huang, Ruoyi and
             Fan, Guofan and Su, Xiaoya and Niu, Yijun and Zhu, Haochen and
             Chen, Jiayi and Jiang, Grace and Zhang, Tian and Zhong, Yi and
             Lei, Bo},
  journal = {Science},
  volume  = {392},
  number  = {6802},
  pages   = {eaed8630},
  year    = {2026},
  doi     = {10.1126/science.aed8630}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · brainmu-tokenizer

Нельзя запустить

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
6f52ea4

0 моделей