facebookresearch/tribev2

▲ 29 stars today★ 3,260⑂ 701

This repository contains the code to train and evaluate TRIBE v2, a multimodal model for brain response prediction

About facebookresearch/tribev2

facebookresearch/tribev2 is an open-source project on GitHub, mainly written in Jupyter Notebook. This repository contains the code to train and evaluate TRIBE v2, a multimodal model for brain response prediction It currently holds 3,260 stars and 701 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the Today's Trending board.

GitHub Repository Details

Repository facebookresearch/tribev2 · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

TRIBE v2

A Foundation Model of Vision, Audition, and Language for In-Silico Neuroscience

Open In Colab License: CC BY-NC 4.0 Python 3.11+

📄 Paper | ▶️ Demo | 🤗 Weights

TRIBE v2 is a deep multimodal brain encoding model that predicts fMRI brain responses to naturalistic stimuli (video, audio, text). It combines state-of-the-art text, audio and video models into a unified Transformer architecture that maps multimodal representations onto the cortical surface.

Quick start

Load a pretrained model from HuggingFace and predict brain responses to a video:

from tribev2 import TribeModel

model = TribeModel.from_pretrained("facebook/tribev2", cache_folder="./cache")

df = model.get_events_dataframe(video_path="path/to/video.mp4") preds, segments = model.predict(events=df) print(preds.shape) # (n_timesteps, n_vertices)

Predictions are for the "average" subject (see paper for details) and live on the fsaverage5 cortical mesh (~20k vertices). They are offset by 5 seconds in the past, in order to compensate for the hemodynamic lag.

You can also pass text_path or audio_path to model.get_events_dataframe — text is automatically converted to speech and transcribed to obtain word-level timings.

For a full walkthrough with brain visualizations, see the Colab demo notebook.

Installation

Basic (inference only):

pip install -e .

With brain visualization:

pip install -e ".[plotting]"

With training dependencies (PyTorch Lightning, W&B, etc.):

pip install -e ".[training]"

Training a model from scratch

1. Set environment variables

Configure data/output paths and Slurm partition (or edit tribev2/grids/defaults.py directly):

export DATAPATH="/path/to/studies"
export SAVEPATH="/path/to/output"

2. Run training

Local test run:

python -m tribev2.grids.test_run

Grid search on Slurm:

python -m tribev2.grids.run_cortical
python -m tribev2.grids.run_subcortical

Project structure

tribev2/
├── main.py              # Experiment pipeline: Data, TribeExperiment
├── model.py             # FmriEncoder: Transformer-based multimodal→fMRI model
├── pl_module.py         # PyTorch Lightning training module
├── demo_utils.py        # TribeModel and helpers for inference from text/audio/video
├── eventstransforms.py  # Custom event transforms (word extraction, chunking, …)
├── utils.py             # Multi-study loading, splitting, subject weighting
├── utils_fmri.py        # Surface projection (MNI / fsaverage) and ROI analysis
├── grids/
│   ├── defaults.py      # Full default experiment configuration
│   └── test_run.py      # Quick local test entry point
├── plotting/            # Brain visualization (PyVista & Nilearn backends)
└── studies/             # Dataset definitions (Algonauts2025, Lahner2024, …)

Contributing to open science

If you use this software, please share your results with the broader research community using the following citation:

@article{dascoli2026foundation,
  title={A foundation model of vision, audition, and language for in-silico neuroscience},
  author={d'Ascoli, St{\'e}phane and Rapin, J{\'e}r{\'e}my and Benchetrit, Yohann and Brooks, Teon and Begany, Katelyn and Raugel, Jos{\'e}phine and Banville, Hubert and King, Jean-R{\'e}mi},
  journal={arXiv preprint arXiv:2605.04326},
  year={2026}
}

License

This project is licensed under CC-BY-NC-4.0. See LICENSE for details.

Contributing

See CONTRIBUTING.md for how to get involved.

GitHub Stars & Activity

3,260Stars
701Forks
0Open issues
Jupyter NotebookLanguage

GitHub Popularity

GitHub stars3,260
Forks701
Open issues0
Primary languageJupyter Notebook
License-
Stars gained today29
Created-
Last pushed-

Trending History

Weekly boardrank #66 · ▲ 29 stars

Related AI Projects

1

patchy631 / ai-engineering-hub

Jupyter Notebook★ 38,158⑂ 6,272▲ 63 stars
→
2

datawhalechina / happy-llm

Jupyter Notebook★ 34,136⑂ 3,221▲ 20 stars
→
3

QwenLM / Qwen3-VL

Jupyter Notebook★ 20,026⑂ 1,857▲ 9 stars
→
4

chiphuyen / aie-book

Jupyter Notebook★ 17,675⑂ 2,577▲ 51 stars
→
5

NVIDIA / cosmos

Jupyter Notebook★ 11,954⑂ 896▲ 11 stars
→
6

MITDeepLearning / introtodeeplearning

Jupyter Notebook★ 8,828⑂ 4,589▲ 16 stars
→
7

evidentlyai / evidently

Jupyter Notebook★ 7,949⑂ 939▲ 2 stars
→
8

ed-donner / llm_engineering

Jupyter Notebook★ 7,541⑂ 7,358▲ 13 stars
→

More AI Rankings