Run this model with HF Jobs

Run ShreyDixit/Text2fMRI-Qwen-2.5-1.5B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/ShreyDixit/Text2fMRI-Qwen-2.5-1.5B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/ShreyDixit/Text2fMRI-Qwen-2.5-1.5B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use from the
Use from the
Transformers library
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("ShreyDixit/Text2fMRI-Qwen-2.5-1.5B", device_map="auto")
Quick Links

Text2fMRI: Brain Encoding from Movie Transcripts

DOI

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:

https://brain-encoding-response-generator.readthedocs.io/en/latest/models/model_cards/fmri-cneuromod_algo2025-text2fmri.html

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_timepoints is the number of input TRs
  • num_rois is 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.

Glass brain evaluation figure

Additional functionality

When loaded through BERG, this model also supports:

  • berg.get_model_variants() to inspect available pretrained variants
  • model.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
23
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including ShreyDixit/Text2fMRI-Qwen-2.5-1.5B