Virtual brain inference.
Project description
VBI: Virtual Brain Inference
Getting Started | Documentation |
Installation
Quick Start
conda env create --name vbi python=3.10
conda activate vbi
Installation Options
VBI offers flexible installation options for different use cases:
# Light version - CPU simulation only (numba + C++), without PyTorch and CuPy
# Includes: Brain simulation models, feature extraction, visualization
# Best for: Users who only need simulation capabilities, minimal dependencies
pip install vbi
# Light version with GPU acceleration (adds CuPy)
# Includes: Everything in light + CuPy for GPU-accelerated simulations
# Best for: GPU users who want fast simulations but don't need inference
pip install vbi[light-gpu]
# Parameter inference (CPU) - adds PyTorch and SBI
# Includes: Everything in light + PyTorch (CPU) + SBI for Bayesian inference
# Best for: Users who need parameter estimation but don't have GPU
pip install vbi[inference]
# Parameter inference with GPU - adds PyTorch, SBI, and CuPy
# Includes: Full functionality with GPU acceleration for both simulation and inference
# Best for: GPU users who need both fast simulation and parameter inference
pip install vbi[inference-gpu]
# All features - complete installation
# Includes: All above + documentation tools, development dependencies
# Best for: Developers, researchers who want all functionality
pip install vbi[all]
From Source
git clone https://github.com/ins-amu/vbi.git
cd vbi
pip install .
# Development installation with all dependencies
pip install -e .[all]
# To skip C++ compilation, use:
SKIP_CPP=1 pip install -e .
Using Docker
To use the Docker image, you can pull it from the GitHub Container Registry and run it as follows:
# Get it without building anything locally
# without GPU
docker run --rm -it -p 8888:8888 ghcr.io/ins-amu/vbi:main
# with GPU
docker run --gpus all --rm -it -p 8888:8888 ghcr.io/ins-amu/vbi:main
Building and Using Docker Locally
For local development and customization, you can build the VBI Docker image yourself:
Quick Start:
# Build the optimized image
docker build -t vbi:latest .
# Start with convenience script
./run-vbi.sh start
# Or start manually
docker run --gpus all -p 8888:8888 vbi:latest
Complete Guides:
-
Docker Build Guide - Comprehensive building guide with optimizations and troubleshooting
-
Docker Quickstart - Quick reference for daily usage and container management
-
Quick check :
import vbi
vbi.tests()
vbi.test_imports()
# Dependency Check
#
# Package Version Status
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# vbi v0.1.3 ✅ Available
# numpy 1.24.4 ✅ Available
# scipy 1.10.1 ✅ Available
# matplotlib 3.7.5 ✅ Available
# sbi 0.22.0 ✅ Available
# torch 2.4.1+cu121 ✅ Available
# cupy 12.3.0 ✅ Available
#
# Torch GPU available: True
# Torch device count: 1
# Torch CUDA version: 12.1
# CuPy GPU available: True
# CuPy device count: 1
# CUDA Version: 11.8
# Device Name: NVIDIA RTX A5000
# Total Memory: 23.68 GB
# Compute Capability: 8.6
Feedback and Contributions
We welcome contributions to the VBI project! If you have suggestions, bug reports, or feature requests, please open an issue on our GitHub repository. To contribute code, fork the repository, create a new branch for your feature or bugfix, and submit a pull request. Make sure to follow our coding standards and include tests for your changes. For detailed guidelines, please refer to our CONTRIBUTING.md file. Thank you for helping us improve VBI!
Citation
@article{VBI,
author = {Ziaeemehr, Abolfazl and Woodman, Marmaduke and Domide, Lia and Petkoski, Spase and Jirsa, Viktor and Hashemi, Meysam},
title = {Virtual Brain Inference (VBI): A flexible and integrative toolkit for efficient probabilistic inference on virtual brain models},
journal = {bioRxiv},
year = {2025},
doi = {10.1101/2025.01.21.633922},
url = {https://doi.org/10.1101/2025.01.21.633922},
abstract = {Network neuroscience has proven essential for understanding the principles and mechanisms underlying complex brain (dys)function and cognition. In this context, whole-brain network modeling--also known as virtual brain modeling--combines computational models of brain dynamics (placed at each network node) with individual brain imaging data (to coordinate and connect the nodes), advancing our understanding of the complex dynamics of the brain and its neurobiological underpinnings. However, there remains a critical need for automated model inversion tools to estimate control (bifurcation) parameters at large scales and across neuroimaging modalities, given their varying spatio-temporal resolutions. This study aims to address this gap by introducing a flexible and integrative toolkit for efficient Bayesian inference on virtual brain models, called Virtual Brain Inference (VBI). This open-source toolkit provides fast simulations, taxonomy of feature extraction, efficient data storage and loading, and probabilistic machine learning algorithms, enabling biophysically interpretable inference from non-invasive and invasive recordings. Through in-silico testing, we demonstrate the accuracy and reliability of inference for commonly used whole-brain network models and their associated neuroimaging data. VBI shows potential to improve hypothesis evaluation in network neuroscience through uncertainty quantification, and contribute to advances in precision medicine by enhancing the predictive power of virtual brain models.}
}
This research has received funding from:
- EU's Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreements:
- No. 101147319 (EBRAINS 2.0 Project)
- No. 101137289 (Virtual Brain Twin Project)
- No. 101057429 (project environMENTAL)
- Government grant managed by the Agence Nationale de la Recherche:
- Reference ANR-22-PESN-0012 (France 2030 program)
The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file vbi-0.2.2.tar.gz.
File metadata
- Download URL: vbi-0.2.2.tar.gz
- Upload date:
- Size: 8.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb3e1edb5ccff0cd2db834b65f42a00edbddea920eb32f27142d2b8877644c90
|
|
| MD5 |
c45f1eb588c17ebda4343185b3e7ff9e
|
|
| BLAKE2b-256 |
91faf78bda15196bb5127232cf5923097b148929f9143f63e9fab0ca8b76b3a4
|