https://github.com/aiformedresearch/neurobooster

https://github.com/aiformedresearch/neurobooster

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: aiformedresearch
  • Language: Python
  • Default Branch: main
  • Size: 6.33 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 10 months ago · Last pushed 10 months ago
Metadata Files
Readme

README.md

NeuroBooster

NeuroBooster paper. NeuroBooster (NB) is a novel self-supervised learning (SSL) paradigm tailored for brain MRI analysis, which stands out by not requiring multiple patient views, meta-data, contrastive objectives, or masked image modeling. The core idea of NeuroBooster is very simple: first, pretrain the model to understand brain anatomy by regressing morphological features extracted using open-source brain MRI analysis tools; then, fine-tune the model for downstream diagnostic tasks. A simplified overview is shown in in Figure 1.

Figure 1: NeuroBooster Schema

Figure 1: General NeuroBooster Schema

Currently the repo supports pretraining ResNet and ViT backbones with Neurobooster (our proposed paradigm), Supervised Learning, SimCLR, VICReg, MaskedAE. The repo is thought to be easily scalable to include different architectures, learning paradigms, data augmentations, datasets and losses.

Figure 2: Saliency maps

Figure 2 is a comparison of the average saliency maps obtained from the ViT models pretrained with the different paradigms. Check the paper for more details [...]. NeuroBooster (NB) saliency maps are the most similar to the ones obtained with SL.

Figure 2: Saliency maps

Table of Contents

You can run the scripts either using Docker or directly with the provided bash script:

Setup

  1. Clone the Repository: bash git clone https://github.com/aiformedresearch/NeuroBooster.git cd <repository-directory>

Using Docker 🐳

  1. Build the Docker Image: bash docker build -t neurobooster_public .

Using just Conda 🐍

  1. Create and activate the Conda Environment: bash conda env create -f environment.yml conda activate neurobooster

Usage

  1. Prepare Your Data: Ensure your imaging and tabular data are in the correct paths of your host machine. As explained in the paper [...] if you want to pretrain the model with NeuroBooster, then the tabular data must contain the features that are desired to be regressed (e.g., cortical thickness and fractal dimension, extracted with tools like FreeSurfer or/and fractalbrain).

Running with Docker 🐳:

bash docker run --rm --gpus all \ --shm-size=8g \ -e images_dir="/app/data/imaging_file.gz" \ -e tabular_dir="/app/data/tabular_file.csv" \ -e EXPERIMENT_FOLDER_NAME="/app/exp_folder/" \ -v /path/to/data:/app/data \ -v /path/to/exp_folder:/app/exp_folder \ neurobooster_public Replace the paths in the -e and -v options with the appropriate paths of your host machine.

Running with a simple bash script

Make sure that the script run_exp.sh receives the correct paths via environment variables for the following required inputs:

bash images_dir='/path/to/image/data/imaging_file.gz' \ tabular_dir='/path/to/image/data/tabular_file.csv' \ EXPERIMENT_FOLDER_NAME='/path/to/exp/exp_folder' \ bash run_exp.sh

Notes

  • Ensure that the paths to your data and experiment directories are correctly specified.
  • Adjust the shared memory size (--shm-size) if necessary, based on your system's capabilities and the dataset size.

Troubleshooting

  • GPU Not Found: Ensure NVIDIA drivers and CUDA toolkit are correctly installed on your host machine.
  • Insufficient Shared Memory: Increase the --shm-size parameter when running the Docker container.

License

License

This work is licensed under multiple licences.

It includes code from:

  • Our code, which is licensed under the MIT License.
  • VICReg, which is licensed under the MIT License.
  • MAE, which is licensed under the CC BY-NC 4.0 License. Note that the CC BY-NC 4.0 Linense does not allow commercial use.
  • SimCLR repo, which is licensed under the Apache-2.0 license.
  • SimMIM repo,which is licensed under the MIT License.

The code sections that where extracted from the MAE and SimCLR repos, thus under the CC BY-NC 4.0 license and the Apache-2.0 license respectively, are indicated in the scripts themselves.

Owner

  • Name: AI for Medicine Research Group
  • Login: aiformedresearch
  • Kind: organization

GitHub Events

Total
  • Push event: 3
  • Create event: 2
Last Year
  • Push event: 3
  • Create event: 2

Dependencies

Dockerfile docker
  • nvidia/cuda 11.8.0-cudnn8-runtime-ubuntu20.04 build
environment.yml pypi
  • medmnist ==3.0.2
  • timm ==0.4.9
  • torchio ==0.19.2