NeuroVLM
NeuroVLM maps between neuroimaging activation maps and neuroscience text.
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:
docs/01_data: Fetch raw data and preprocessdocs/02_models: Trains all modelsdocs/03_evaluation: Evaluates models and reproduces publication figures.
License
Apache-2.0 (LICENSE).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neurovlm-0.0.5.tar.gz.
File metadata
- Download URL: neurovlm-0.0.5.tar.gz
- Upload date:
- Size: 129.9 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0943b21ad96167b00f40e953387c6f051949b08808a10e63fe92c4b5605bfef7
|
|
| MD5 |
a2ff8eef42caea131ebcd36cc1826684
|
|
| BLAKE2b-256 |
0a0f3fd4369ce9ccbdec6daf4add53d0f74b3959873a533e8f72a02fc885eb1f
|
File details
Details for the file neurovlm-0.0.5-py3-none-any.whl.
File metadata
- Download URL: neurovlm-0.0.5-py3-none-any.whl
- Upload date:
- Size: 141.5 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c8a9129322bb28d6fd20ccda324e33f50e61ecddeab4b9284a4d78373a98024
|
|
| MD5 |
374ee5ffa0118e4cb261b619ac9aee5e
|
|
| BLAKE2b-256 |
2c819d1bd5ffffc0447f4e46953eeb4c4790c90e23960dfd5a2254dea1e5ed5a
|