Brain-Semantoks: Learning Semantic Tokens of Brain Dynamics with a Self-Distilled Foundation Model

Sam Gijsen, Marc-Andre Schulz, Kerstin Ritter

TL;DR

Brain-Semantoks is a self-supervised foundation model for fMRI that shifts the paradigm from reconstructing low-level brain signals to learning abstract, high-level representations of brain dynamics. By combining a neuroscientifically-grounded semantic tokenizer with a self-distillation objective, it extracts stable phenotypic signatures that excel at downstream tasks using simple linear probes and generalize remarkably well to out-of-distribution datasets.

What Problem Does This Paper Address?

Functional magnetic resonance imaging (fMRI) captures complex brain dynamics by measuring blood-oxygen-level-dependent (BOLD) signals across the brain over time. While highly valuable for understanding cognition and neurological diseases, fMRI data suffers from an exceptionally low signal-to-noise ratio (SNR) and high temporal fluctuations.

Current fMRI foundation models borrow heavily from computer vision and natural language processing, utilizing "mask-and-reconstruct" objectives (similar to Masked Autoencoders or BERT). These models attempt to predict masked, low-level regional signals. The authors argue this approach is fundamentally flawed for fMRI: it forces the model to waste capacity encoding transient noise and scanner-specific artifacts rather than stable, high-level phenotypic traits. Consequently, these models require extensive, task-specific fine-tuning and struggle to transfer across different patient cohorts or imaging hardware.

Methods

Brain-Semantoks introduces a self-supervised framework designed to prioritize abstraction over reconstruction. The architecture relies on three core innovations:

  1. Semantic Tokenizer ($G$): Instead of treating individual, noisy brain regions as independent tokens, the model groups regions into $N=9$ functional brain networks (e.g., the default mode network) based on established neuroscientific priors. It breaks the time series into long temporal patches and uses a multi-scale convolutional filter bank to capture hierarchical temporal patterns, producing compact and semantically rich tokens.
  2. Self-Distillation Framework: To learn temporal stability, the framework uses a student-teacher architecture. The student model receives a masked version of the tokens and is trained to match the global representation of a teacher model (which sees the full, unmasked sequence and is updated via an exponential moving average of the student's weights).
  3. Teacher-guided Temporal Regularizer (TTR): Applying self-distillation directly to noisy fMRI data typically causes training instability or representation collapse. To fix this, the authors introduce a novel training curriculum (TTR) active only at the start of training. It guides the student to first learn the time-averaged signature of each network before attempting to model complex temporal variations.
Figure 1: Brain-Semantoks. A student-teacher architecture is used to learn stable brain dynamics representations across time by aligning long temporal views. The semantic tokenizer (G) is used to produce robust tokens of functional brain networks, which serve as input to a transformer encoder (f). Three losses are used during pretraining: a temporary regularisation loss for stability (LT T R), a within-view, latent space prediction loss of masked tokens (LT ok), and a global cross-view loss to learn a high-level, semantic representation (LCLS).

Datasets

  • Pretraining Data: The model was pretrained on resting-state fMRI data from UK Biobank (UKB), utilizing 39,139 preprocessed recordings.
  • Downstream Evaluation Datasets: To test generalization, the authors evaluated the model on a diverse array of external datasets:
  • SRPBS: For binary classification of Schizophrenia and Major Depressive Disorder (MDD).
  • ABIDE: For Autism Spectrum Disorder (ASD) classification.
  • HBN: For predicting language (CELF) and cognitive (WISC) scores.
  • LEMON: For mood (MDBF) and cognitive task scores (CVLT, TMT).
  • ADHD200: Used additionally for demographic scaling analyses.

Key Insights and Ideas

  • Abstraction Over Reconstruction: By forcing the model to align global temporal views across time rather than predicting missing local pixels/voxels, the model learns to ignore transient noise and capture the underlying phenotypic signature of the subject.
  • Neuroscientific Inductive Biases Matter: Grouping regions of interest into functional networks provides a significantly better starting point for transformers than standard linear projections of raw region signals, reducing sequence length and improving attention mechanism efficiency.
  • Curriculum-Driven Stability: The success of self-distillation on low-SNR data hinges on the TTR curriculum. Constraining the initial token space helps the model find a stable, meaningful representation before tackling temporal complexity.

Key Results

Brain-Semantoks consistently outperformed existing state-of-the-art fMRI foundation models (like BrainLM and Brain-JEPA) as well as fully supervised baselines.

Crucially, under a strict linear probing protocol—where the pretrained backbone is frozen and only a single linear layer is trained—Brain-Semantoks achieved an average balanced accuracy of 52.72% across ten diverse downstream tasks, frequently outperforming models that were fully fine-tuned. It achieved striking performance gains on challenging out-of-distribution clinical datasets, such as predicting ASD, Schizophrenia, and MDD.

Furthermore, the authors provided the first detailed scaling analysis for fMRI foundation models, demonstrating a clear power-law relationship: performance on nearly all tasks improves predictably with the logarithm of the pretraining data size, showing robust out-of-distribution generalization without explicit domain adaptation.

Figure 2: Scaling performance of linear probing following pretraining on increasing sample sizes. We compare within and out-of-distribution scaling. RW: Random weights. ROI: We compare to using a linear layer for projecting single-ROI timeseries instead of our semantic tokenizer.

Limitations and Future Work

  • Fixed Network Mappings: The semantic tokenizer currently relies on a fixed, predefined atlas (the Yeo 7-network parcellation plus subcortical/cerebellar groups). Future work could explore learning how to dynamically group brain regions directly from the data.
  • Task-based fMRI Integration: While the model showed strong zero-shot transfer to short segments of task-based fMRI (the Hariri emotion task), the pretraining data remains entirely resting-state. Incorporating diverse task-based fMRI datasets during pretraining could further broaden the model's capabilities.

Summary updated

BibTeX
@inproceedings{gijsen2026brain,
  author = {Sam Gijsen and Marc-Andre Schulz and Kerstin Ritter},
  title = {{Brain-Semantoks: Learning Semantic Tokens of Brain Dynamics with a Self-Distilled Foundation Model}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=ANkm27vNuk},
}
Figure