text2brain
text2brain copied to clipboard
Generating brain activation maps from free-form text query
Text2Brain

Generating brain activation maps from free-form text query
Reference
Gia H. Ngo, Minh Nguyen, Nancy F. Chen, Mert R. Sabuncu. Text2Brain: Synthesis of Brain Activation Maps from Free-form Text Query. In International Conference on Medical Image Computing and Computer-Assisted Intervention, 2021. arxiv
Overview
Text2Brain is a search engine for efficiently combing through rapidly growing wealth of neuroimaging literature brain activation patterns. It accepts not only keywords but also flexible free-form text queries. It encodes the text queries using a finetuned Transformer encoder (SciBERT) and generates whole-brain activation maps using a 3D convolutional neural network (CNN).
Demo is available at: braininterpreter.com
Outputs for Synonymous Queries
Activation maps predicted by Text2Brain for 3 synonymous queries: default network, self-generated thought, and task-unrelated thought.
The ground-truth activation map is also included in the figure.
Setting Up Text2Brain Project
- Install Anaconda
- Clone this project from Github to some place on your computer (e.g.
/home/gia/text2brain) - Create a Conda environment using the
env.ymlfileconda env create -f env.yml -n text2brain - Download a checkpoint of the Text2Brain model from Google Drive
- Extract the downloaded file. You should see a file named
best_loss.pth.tar -xzvf text2brain_checkpoint.tar.gz - Move the file
best_loss.pthinto the project directory (e.g./home/gia/text2brain) - Download the pre-trained uncased SciBERT model using this link
- Extract the downloaded file.
tar -xvf scibert_scivocab_uncased.tar - Move the
scibert_scivocab_uncasedfolder into the project directory (e.g./home/gia/text2brain) - Activate the Conda environment
conda activate text2brain - To generate brain activation maps from free-form text query, run
python predict.py <input_query> <output_file>. For example,python predict.py "self-generated thought" prediction.nii.gz
Bugs and Questions
Please contact Gia at [email protected]