Skip to content

Commit

Permalink
refactor: Update title and enhance description of VBI toolkit in pape…
Browse files Browse the repository at this point in the history
…r.md
  • Loading branch information
Ziaeemehr committed Feb 21, 2025
1 parent 065b62d commit ab8cc79
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 16 deletions.
79 changes: 78 additions & 1 deletion paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,81 @@ @article{Durkan2019
volume={32},
pages={7511--7522},
year={2019}
}
}

@article{gonccalves2020training,
title={Training deep neural density estimators to identify mechanistic models of neural dynamics},
author={Gon{\c{c}}alves, Pedro J and Lueckmann, Jan-Matthis and Deistler, Michael and Nonnenmacher, Marcel and {\"O}cal, Kaan and Bassetto, Giacomo and Chintaluri, Chaitanya and Podlaski, William F and Haddad, Sara A and Vogels, Tim P and others},
journal={elife},
volume={9},
pages={e56261},
year={2020},
publisher={eLife Sciences Publications, Ltd}
}

@article{hashemi2024simulation,
title={Simulation-based inference on virtual brain models of disorders},
author={Hashemi, Meysam and Ziaeemehr, Abolfazl and Woodman, Marmaduke M and Fousek, Jan and Petkoski, Spase and Jirsa, Viktor K},
journal={Machine Learning: Science and Technology},
volume={5},
number={3},
pages={035019},
year={2024},
publisher={IOP Publishing}
}

@article{betancourt2017geometric,
title={The geometric foundations of hamiltonian monte carlo},
author={Betancourt, Michael and Byrne, Simon and Livingstone, Sam and Girolami, Mark},
journal={Bernoulli},
pages={2257--2298},
year={2017},
publisher={JSTOR}
}

@article{cranmer2020frontier,
title={The frontier of simulation-based inference},
author={Cranmer, Kyle and Brehmer, Johann and Louppe, Gilles},
journal={Proceedings of the National Academy of Sciences},
volume={117},
number={48},
pages={30055--30062},
year={2020},
publisher={National Academy of Sciences}
}

@article{sanz2013virtual,
title={The Virtual Brain: a simulator of primate brain network dynamics},
author={Sanz Leon, Paula and Knock, Stuart A and Woodman, M Marmaduke and Domide, Lia and Mersmann, Jochen and McIntosh, Anthony R and Jirsa, Viktor},
journal={Frontiers in neuroinformatics},
volume={7},
pages={10},
year={2013},
publisher={Frontiers Media SA}
}

@article {Hashemi2024vbt,
author = {Hashemi, Meysam and Depannemaecker, Damien and Saggio, Marisa and Triebkorn, Paul and Rabuffo, Giovanni and Fousek, Jan and Ziaeemehr, Abolfazl and Sip, Viktor and Athanasiadis, Anastasios and Breyton, Martin and Woodman, Marmaduke and Wang, Huifang and Petkoski, Spase and Sorrentino, Pierpaolo and Jirsa, Viktor},
title = {Principles and Operation of Virtual Brain Twins},
elocation-id = {2024.10.25.620245},
year = {2024},
doi = {10.1101/2024.10.25.620245},
publisher = {Cold Spring Harbor Laboratory},
abstract = {Current clinical methods often overlook individual variability by relying on population-wide trials, while mechanism-based trials remain underutilized in neuroscience due to the brain{\textquoteright}s complexity. A Virtual Brain Twin (VBT) is a personalized digital replica of an individual{\textquoteright}s brain, integrating structural and functional brain data into advanced computational models and inference algorithms. By bridging the gap between molecular mechanisms, whole-brain dynamics, and imaging data, VBTs enhance the understanding of (patho)physiological mechanisms, advancing insights into both healthy and disordered brain function. Central to VBT is the network modeling that couples mesoscopic representation of neuronal activity through white matter connectivity, enabling the simulation of brain dynamics at a network level. This transformative approach provides interpretable predictive capabilities, supporting clinicians in personalizing treatments and optimizing interventions. This manuscript outlines the key components of VBT development, covering the conceptual, mathematical, technical, and clinical aspects. We describe the stages of VBT construction{\textendash}from anatomical coupling and modeling to simulation and Bayesian inference{\textendash}and demonstrate their applications in resting-state, healthy aging, epilepsy, and multiple sclerosis. Finally, we discuss potential extensions to other neurological disorders, such as Parkinson{\textquoteright}s disease, and explore future applications in consciousness research and brain-computer interfaces, paving the way for advancements in personalized medicine and brain-machine integration.{\textquotedblleft}The brain is conceived as a self-organizing system operating close to instabilities where its activities are governed by collective variables, the order parameters, that enslave the individual parts, i.e., the neurons.{\textquotedblright} Professor Hermann Haken (1927-2024).Competing Interest StatementThe authors have declared no competing interest.VBTvirtual brain twinTVBthe virtual brainDTIdiffusion tractography imagingDW-MRIdiffusion-weighted magnetic resonance imagingCTcomputed tomographyPETpositron emission tomographyBOLDblood-oxygen-level-dependentfMRIfunctional magnetic resonance imagingEEGElectroen-cephalographyMEGMagnetoencephalographySEEGStereoelectroencephalographyiEEGintracranial electroencephalographyECoGElectrocorticographySCstructural connectivityFCfunctional connectivityFCDfunctional connectivity dynamicPSDpower spectral densityNMMNeural mass model},
URL = {https://www.biorxiv.org/content/early/2024/10/25/2024.10.25.620245},
eprint = {https://www.biorxiv.org/content/early/2024/10/25/2024.10.25.620245.full.pdf},
journal = {bioRxiv}
}

@article {Ziaeemehr2025,
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},
elocation-id = {2025.01.21.633922},
year = {2025},
doi = {10.1101/2025.01.21.633922},
publisher = {Cold Spring Harbor Laboratory},
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{\textendash}also known as virtual brain modeling{\textendash}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.Competing Interest StatementThe authors have declared no competing interest.VBIvirtual brain inferenceBOLDblood-oxygen-level-dependentfMRIfunctional magnetic resonance imagingEEGElectroencephalographyMEGMagnetoencephalographysEEGStereoelectroencephalographySCstructural connectivityFCfunctional connectivityFCDfunctional connectivity dynamicPSDpower spectral densitySBIsimulation-based inferenceMAFmasked autoregressive flowNSFneural spline flowMCMCMarkov chain Monte Carlo},
URL = {https://www.biorxiv.org/content/early/2025/01/22/2025.01.21.633922},
eprint = {https://www.biorxiv.org/content/early/2025/01/22/2025.01.21.633922.full.pdf},
journal = {bioRxiv}
}
23 changes: 8 additions & 15 deletions paper/paper.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Virtual Brain Inference (VBI): A Flexible and Integrative Toolkit'
title: 'VBI: A toolkit for Virtual Brain Inference'
tags:
- Python
- Neuroscience
Expand Down Expand Up @@ -44,16 +44,16 @@ Understanding complex brain dynamics and their neurobiological basis is a core c

# Statement of Need

VBI is a Python-based toolkit tailored for probabilistic inference at the whole-brain scale. Combining Python’s flexibility with optimized C++ code for performance, VBI offers a user-friendly API supporting:
VBI is a Python-based toolkit tailored for probabilistic inference at the whole-brain scale. It leverages the flexibility of Python while harnessing the high performance of C++ for optimized computation and massive parallelization using CUDA on GPUs. VBI seamlessly integrates structural and functional neuroimaging data, providing space-efficient storage and memory-optimized batch processing. With its user-friendly API supporting:

- **Brain models**: Wilson-Cowan, Montbrió, Jansen-Rit, Stuart-Landau, Wong-Wang, and Epileptor.
- **Fast simulation**: Just-in-time compilation of models across Python/C++ and CPU/GPU devices.
- **Feature extraction**: Functional connectivity (FC), functional connectivity dynamics (FCD), and power spectral density (PSD).
- **Deep neural density estimators**: Masked autoregressive flows (MAFs) [@Papamakarios2017] and neural spline flows (NSFs) [@Durkan2019].
- **Deep neural density estimators**: Masked autoregressive flows (MAFs) [@Papamakarios2017], [@gonccalves2020training] and neural spline flows (NSFs) [@Durkan2019].

VBI integrates structural and functional neuroimaging data, supporting space-efficient storage and memory-efficient batch processing. Traditional methods like Markov Chain Monte Carlo (MCMC) and Approximate Bayesian Computation (ABC) face significant challenges in this context [@Sisson2007]. MCMC struggles with convergence in high-dimensional spaces and complex geometries, often requiring extensive tuning and computational resources [@Betancourt2013b], [@Betancourt2014], [@Hashemi2020]. ABC, while likelihood-free, relies on predefined thresholds for sample acceptance, leading to inefficiencies and potential biases when rejecting samples that fall outside narrow criteria. In contrast, VBI leverages Simulation-Based Inference (SBI), which sidesteps these issues by using forward simulations and deep neural density estimators to directly approximate posterior distributions. This approach enhances efficiency, scalability, and robustness, making VBI particularly suited for inverting complex virtual brain models.
Traditional methods like Markov Chain Monte Carlo (MCMC) and Approximate Bayesian Computation (ABC) face significant challenges in this context [@Sisson2007]. MCMC struggles with convergence in high-dimensional spaces and complex geometries, often requiring extensive tuning and computational resources [@Betancourt2013b], [@Hashemi2020]. ABC, while likelihood-free, relies on predefined thresholds for sample acceptance, leading to inefficiencies and potential biases when rejecting samples that fall outside narrow criteria. In contrast, VBI leverages Simulation-Based Inference (SBI), which sidesteps these issues by using forward simulations and deep neural density estimators to directly approximate posterior distributions [@cranmer2020frontier]. This approach enhances efficiency, scalability, and robustness, making VBI particularly suited for inverting complex virtual brain models [@hashemi2024simulation].

Designed for researchers and clinical applications, VBI enables personalized simulations of normal and pathological brain activity, aiding in distinguishing healthy from diseased states and informing targeted interventions. By addressing the inverse problem—estimating control parameters that best explain observed data—VBI leverages high-performance computing for parallel processing of large-scale datasets.
Designed for researchers and clinical applications, VBI enables personalized simulations of normal and pathological brain activity, aiding in distinguishing healthy from diseased states and informing targeted interventions. By addressing the inverse problem—estimating control parameters that best explain observed data—VBI leverages high-performance computing for parallel processing of large-scale datasets [@Ziaeemehr2025],[@Hashemi2024vbt].


# Methods
Expand All @@ -71,7 +71,7 @@ $$
\langle \xi_i(t) \rangle = 0, \quad \langle \xi_i(t) \xi_j(t') \rangle = 2 D \delta(t - t') \delta_{i,j},
$$

where $D$ is the noise strength. The system’s operating regime emerges from the interplay of global coupling $G$, local bifurcation parameters, and noise, with connectivity structure shaping macroscopic brain activity through delays and weights [@ghosh2008noise], [@ziaeemehr2020frequency], [@petkoski2019transmission].
where $D$ is the noise strength. The system’s operating regime emerges from the interplay of global coupling $G$, local bifurcation parameters, and noise, with connectivity structure shaping macroscopic brain activity through delays and weights [@ghosh2008noise], [@ziaeemehr2020frequency], [@petkoski2019transmission], [@sanz2013virtual].

Simulation-based inference (SBI) in VBI avoids convergence issues of gradient-based MCMC methods and outperforms approximate Bayesian computation (ABC) by using deep neural density estimators to approximate posterior distributions, $p(\vec{\theta} \mid \vec{x}_{obs})$. SBI requires three components:

Expand All @@ -91,22 +91,15 @@ The VBI workflow comprises:

### Evaluation of Posterior Fit

Posterior reliability is assessed using synthetic data via posterior z-scores ($z$) and shrinkage ($s$):
Posterior reliability is assessed using synthetic data via posterior z-scores ($z$) and shrinkage ($s$) [@betancourt2017geometric]:

$$
z = \left| \frac{\bar{\theta} - \theta^\ast}{\sigma_{post}} \right|, \quad s = 1 - \frac{\sigma^2_{post}}{\sigma^2_{prior}},
$$

where $\bar{\theta}$ is the posterior mean, $\theta^\ast$ is the true parameter, and $\sigma_{post}$ and $\sigma_{prior}$ are posterior and prior standard deviations, respectively. High shrinkage indicates well-identified posteriors, while low z-scores confirm accurate capture of true values.

# Technical Terms

- **Control parameters**: Bifurcation parameters in a generative model that govern data synthesis and may reflect causal relationships.
- **Generative model**: A model (statistical, machine learning, or mechanistic) that generates data mimicking the original distribution.
- **Simulation-based inference**: A likelihood-free approach using forward simulations for inference in complex systems.
- **Virtual brain models**: Computational models of regional brain dynamics linked by a personalized structural connectivity matrix.

![Figure 1: Overview of the VBI workflow, integrating connectome construction, simulation, and inference.](Fig1.png)
![Overview of the VBI workflow: (**A**) A personalized connectome is built using diffusion tensor imaging and a brain parcellation atlas. (**B**) This forms the basis of a virtual brain model with initial control parameters randomly sampled from a prior distribution. (**C**) The VBI simulates time series data associated to neuroimaging recordings using these parameters. (**D**) Summary statistics (FC, FCD, PSD) are extracted from the simulation features for training. (**E**) Deep neural density estimators are trained on parameter-feature pairs to learn the joint posterior distribution. (**F**) The trained network rapidly approximates the posterior for new empirical data, enabling probabilistic predictions consistent with observations. (**G**) Flowchart of the VBI Structure.](Fig1.png)

# Acknowledgements

Expand Down

0 comments on commit ab8cc79

Please sign in to comment.