Skip to main content

NeuroVLM

NeuroVLM maps between neuroimaging activation maps and neuroscience text.

model

System Requirements

  • python >=3.10, <3.14
  • ubuntu-latest, macos-latest
  • GPU (NVIDIA or Apple MPS) or CPU

Installation

Minimal, inference-only installation:

pip install neurovlm

With optional dependencies needed to train and reproduce analyses:

pip install "neurovlm[full]"

Installation take a couple minutes. After installation, calling neurovlm.data.fetch_data() will fetch datasets and models from huggingface, which will be slower.

Demo

See here for the introductory notebook that walks through using all NeuroVLM models. In short:

Fetch NeuroVLM's datasets and models:

from neurovlm.data import fetch_data
fetch_data()

Use the four text/brain inference paths:

from neurovlm import NeuroVLM
from neurovlm.data import load_latent

nvlm = NeuroVLM(device="cuda") # use device="cpu" if GPU not available

# Text-to-brain generation (MSE)
brain_map = nvlm.text("auditory processing").to_brain(head="mse")
brain_map.plot(0, threshold=0.1)

# Brain-to-text generation (QFormer)
auditory = load_latent("networks_neuro")["Du"]["AUD"]
description = nvlm.brain(auditory).to_text(head="qformer")
print(description)

# Text-to-brain retrieval (InfoNCE)
brain_matches = nvlm.text("auditory processing").to_brain(head="infonce")
df_text_to_brain = brain_matches.top_k(3)

# Brain-to-text retrieval (InfoNCE)
text_matches = nvlm.brain(auditory).to_text(head="infonce")
df_brain_to_text = text_matches.top_k(3)

Documentation

See the docs for the API and tutorials.

Reproducibility

All analyses are in Juptyer notebooks. Their are three directories:

  1. docs/01_data: Fetch raw data and preprocess
  2. docs/02_models: Trains all models
  3. docs/03_evaluation: Evaluates models and reproduces publication figures.

License

Apache-2.0 (LICENSE).

Metadata

Release files for neurovlm 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neurovlm 0.0.5
File Size Uploaded
neurovlm-0.0.5.tar.gz 129.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neurovlm 0.0.5
File Interpreter ABI Platform
neurovlm-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 271.4 kB

Release files / neurovlm-0.0.5.tar.gz

Download URL neurovlm-0.0.5.tar.gz
Size 129.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0943b21ad96167b00f40e953387c6f051949b08808a10e63fe92c4b5605bfef7
BLAKE2b-256 checksum
How to use checksums
0a0f3fd4369ce9ccbdec6daf4add53d0f74b3959873a533e8f72a02fc885eb1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neurovlm-0.0.5-py3-none-any.whl

Download URL neurovlm-0.0.5-py3-none-any.whl
Size 141.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c8a9129322bb28d6fd20ccda324e33f50e61ecddeab4b9284a4d78373a98024
BLAKE2b-256 checksum
How to use checksums
2c819d1bd5ffffc0447f4e46953eeb4c4790c90e23960dfd5a2254dea1e5ed5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page