Generating brain activation maps from free-form text query
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
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
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.
- 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.yml
fileconda 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.pth
into 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_uncased
folder 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
Please contact Gia at ngohoanggia@gmail.com