Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bayes on the Brain in Python #78

Open
2 tasks done
garner-code opened this issue Nov 15, 2022 · 3 comments
Open
2 tasks done

Bayes on the Brain in Python #78

garner-code opened this issue Nov 15, 2022 · 3 comments

Comments

@garner-code
Copy link
Contributor

garner-code commented Nov 15, 2022

Title

Bayes on the Brain in Python

Leaders

Kelly Garner
mastodon: [email protected]
github: kel-github
mattermost: @Kels

Gang Chen
twitter: @gangchen6
github: afni-gangc
mattermost: @gangchen

Collaborators

Christopher Nolan
mastodon: @[email protected]
github: crnolan

Brainhack Global 2022 Event

Brainhack Australasia

Project Description

Human brain imaging data is massively multidimensional, yet current approaches to modeling functional brain responses apply univariate tests to each voxel separately. This leads to controlling for a vast number of statistical inferences, and to an implicit but unrealistic assumption of a uniform distribution over voxels – no information is shared across the brain.

A more reasoned approach to assessing regional activity focuses on estimating the strength of an effect; this can be achieved readily under a Bayesian multilevel modeling framework. A further advantage to this approach is that you can build in better assumptions about the data (e.g. normality across space, see Chen et al, 2019, Neuroinformatics and eradicate the need for adjusting for masses of simultaneous statistical inferences.

Applying such a Bayesian multilevel modeling framework to the analysis of fMRI data is in its infancy. The methodology has been implemented at the region level into the AFNI programme (see Chen et al, 2022, Aperture Neuro, using Stan through the R package BRMS (Burkner et al, 2017, Journal of Statistical Software). At OHBM Brainhack 2022, we also implemented this methodology in Python using the PyMC framework (Salvatier et al, 2016, PeerJ Computer Science) and the Bambi interface (Capretto et al, 2022, Journal of Statistical Software).

At Brainhack Global 2022, we will be expanding the capability of the Python implementation. We will:

  • Test the computational limits of the approach - can we model activity at the voxel (as opposed to regional) level? What are the run times for voxel-based models, for many subjects or more complex models?
  • Build a workflow and a tutorial document to equip anyone to use the method.

Our long term goal is to build a python interface and this is the first step!

To get started, take a look at Chen (2022, see above) for more details on the method. Also check out our implementation in Python

Link to project repository/sources

Repo:
https://github.com/crnolan/pyrba

Resources
https://bambinos.github.io/bambi/main/index.html
https://www.pymc.io/projects/docs/en/stable/learn.html
https://nilab-uva.github.io/AOMIC.github.io/
{Chen et al, 2022, Aperture Neuro](http://dx.doi.org/10.52294/2e179dbf-5e37-4338-a639-9ceb92b055ea)

Goals for Brainhack Global

  • Test for computational limitations of applying a Bayesian multilevel framework to fMRI data analysis

  • Build a jupyter notebook tutorial workflow that includes model definition, fitting, quality checks, and results interpretation

  • Start translating the notebook into a Python interface for the people!

Good first issues

  1. Have a go at using the current Python implementation in a Jupyter notebook
  2. Add a sample of the open dataset to the cloud server.
  3. Run through the PyMC, Bambi and brms tutorials to find any key differences (e.g. with regard to priors etc)
  4. Define a model to be run at the voxel level. Calculate compute time.

Communication channels

mattermost channel: bayes-on-the-brain

Skills

  • Python
  • Bayesian modeling analysis
  • fMRI data analysis
  • Github
  • R
  • Interest and enthusiasm :)

Onboarding documentation

See the link to the project repository and resources.

What will participants learn?

  • Python
  • Bayesian multilevel modeling
  • fMRI data analysis
  • Github
  • R

Data to use

https://nilab-uva.github.io/AOMIC.github.io/

Number of collaborators

more

Credit to collaborators

Project contributors will be listed on the project README and included as authors on any further outputs.

Image

Leave this text if you don't have an image yet.
project-image

Type

coding_methods, method_development, pipeline_development

Development status

1_basic structure

Topic

bayesian_approaches, MR_methodologies, reproducible_scientific_methods, statistical_modelling

Tools

AFNI, BIDS, fMRIPrep, Jupyter, other

Programming language

documentation, Python, R

Modalities

fMRI

Git skills

0_no_git_skills, 1_commit_push, 2_branches_PRs, 3_continuous_integration

Anything else?

No response

Things to do after the project is submitted and ready to review.

  • Add a comment below the main post of your issue saying: Hi @brainhackorg/project-monitors my project is ready!
  • Twitter-sized summary of your project pitch.
@garner-code
Copy link
Contributor Author

Hi @brainhackorg/project-monitors my project is ready!

@garner-code
Copy link
Contributor Author

Got Bayes on the brain? Put Bayes on the brain! We're applying multilevel modelling to the analysis of fMRI data. Join us :)

@Remi-Gau
Copy link
Member

LGTM @kel-github

Will tell our bot minion to put that on the website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment