Text2fMRI: Brain Encoding from Movie Transcripts
This repository provides a pretrained Text2fMRI encoding model for predicting whole-brain fMRI responses from movie transcripts alone. The model is integrated with the BERG (Brain Encoding Response Generator) library and was trained on the CNeuroMod dataset used for Algonauts 2025 challenge preparation.
This model card corresponds to the Qwen-2.5-1.5B feature extractor variant. Additional variants, including larger language models, are released separately.
For full model documentation, BERG integration details, metadata structure, and API usage, see the BERG model page:
Model summary
Text2fMRI predicts parcel-wise fMRI activity from text aligned to fMRI TRs. It is designed as a lightweight encoding model that uses a frozen language model for feature extraction and a trainable encoding head for neural prediction.
- Modality: fMRI
- Species: Human
- Stimuli: Text transcripts aligned to TRs
- Atlas: Schaefer 2018, 1000 parcels, 7-network parcellation
- Training data: CNeuroMod (Friends and Movie10)
- Subjects: 4 subjects
Model architecture
This variant uses:
- a frozen Qwen-2.5-1.5B language model as text feature extractor
- a lightweight trainable encoding model for mapping transcript-derived representations to fMRI responses
This is the smallest configuration and has approximately ~200M trainable parameters, in addition to the frozen language model used for feature extraction.
Input and output
Input
A list[str] where each string contains the text spoken during one fMRI TR.
Example:
["Hello, are you", "awake? Yes,"]
Output
A torch.Tensor of shape:
[num_timepoints, num_rois]
where:
num_timepointsis the number of input TRsnum_roisis the number of Schaefer parcels (1000 by default)
Usage with BERG
from berg import BERG
berg = BERG(berg_dir="path/to/brain-encoding-response-generator")
# Inspect available pretrained variants
variants = berg.get_model_variants("fmri-cneuromod_algo2025-text2fmri")
# Load this model variant
model = berg.get_encoding_model(
"fmri-cneuromod_algo2025-text2fmri",
subject=1,
model_variant="ShreyDixit/Text2fMRI-Qwen-2.5-0.5B"
)
stimulus = ["Hello, are you", "awake? Yes,"]
responses = berg.encode(model, stimulus)
print(responses.shape)
Evaluation
This repository contains the Qwen-2.5-1.5B variant.
Regional evaluation figure
Average correlation across regions for Friends season 7, shown for the mean across all four subjects.
Additional functionality
When loaded through BERG, this model also supports:
berg.get_model_variants()to inspect available pretrained variantsmodel.generate_glass_brain_animation()to render animated spatial visualizations of predicted activity
Citation
If you use this model, please cite:
@software{dixit_2026_text2fmri,
author = {Dixit, Shrey},
title = {Text2fMRI: Brain Encoding Models using LLMs},
year = {2026},
publisher = {Zenodo},
version = {v0.1.2},
doi = {10.5281/zenodo.18369862},
url = {https://doi.org/10.5281/zenodo.18369862}
}
- Downloads last month
- 29
