Giter Site home page Giter Site logo

favour-nerrise / xgw-gat Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 1.0 62 KB

An Explainable Geometric-Weighted Graph Attention Network (xGW-GAT) for Identifying Functional Networks Associated with Gait Impairment

License: MIT License

Python 100.00%
ai4health brain-imaging brain-networks classification connectome gat graph-attention-networks graph-neural-networks parkinsons-disease pytorch

xgw-gat's Introduction

xGW-GAT

This repository is the official implementation of xGW-GAT, an explainable, graph attention network for n-ary, transductive, classification tasks for functional brain connectomes and gait impairment severity. Our associated paper, "An Explainable Geometric-Weighted Graph Attention Network for Identifying Functional Networks Associated with Gait Impairment" has been accepted to MICCAI 2023 and is supported by the MICCAI 2023 STAR award. Check out our paper and our oral talk!

Our pipeline of three modules:

  1. A stratified, learning-based sample selection method leveraging Riemannian metrics for connectome similarity comparisons
  2. An attention-based, brain network-oriented prediction model
  3. An explanation generator for individual and global attention masks that highlight salient Regions of Interest (ROIs) in predicting gait impairment severity states.

Screenshot 2023-08-01 at 12 19 32 PM

An Explainable Geometric-Weighted Graph Attention Network for Identifying Functional Networks Associated with Gait Impairment

Favour Nerrise1, Qingyu Zhao2, Kathleen L. Poston3, Kilian M. Pohl2, Ehsan Adeli2
1Department of Electrical Engineering, Stanford University, Stanford, CA, USA
2Department of Psychiatry and Behavioral Sciences, Stanford University, Stanford, CA
3Dept. of Neurology and Neurological Sciences, Stanford University, Stanford, CA, USA

Abstract: *One of the hallmark symptoms of Parkinson's Disease (PD) is the progressive loss of postural reflexes, which eventually leads to gait difficulties and balance problems. Identifying disruptions in brain function associated with gait impairment could be crucial in better understanding PD motor progression, thus advancing the development of more effective and personalized therapeutics. In this work, we present an explainable, geometric, weighted-graph attention neural network (xGW-GAT) to identify functional networks predictive of the progression of gait difficulties in individuals with PD. xGW-GAT predicts the multi-class gait impairment on the MDS Unified PD Rating Scale (MDS-UPDRS). Our computational- and data-efficient model represents functional connectomes as symmetric positive definite (SPD) matrices on a Riemannian manifold to explicitly encode pairwise interactions of entire connectomes, based on which we learn an attention mask yielding individual- and group-level explainability. Applied to our resting-state functional MRI (rs-fMRI) dataset of individuals with PD, xGW-GAT identifies functional connectivity patterns associated with gait impairment in PD and offers interpretable explanations of functional subnetworks associated with motor impairment. Our model successfully outperforms several existing methods while simultaneously revealing clinically relevant connectivity patterns.

Installation Instructions

  • Download the ZIP folder or copy this repository, e.g. git clone https://github.com/favour-nerrise/xGW-GAT.git.

Dependencies

This code was prepared using Python 3.10.4 and depends on the following packages:

See more details and install all required packages using pip install -r requirements.txt. We recommend running all code and making installations in a virtual environment to prevent package conflicts. See here for more details on how to do so.

Getting Started

Prepare Your Data

  • Extract functional correlation matrices from your chosen dataset, e.g. PPMI, save it as an .npy file, and place the dataset files in the ./datasets/ folder under the root folder. The saved matrix should be of shape (num_subjects, node_dim, node_dim).
  • Save associated subject metrics, e.g. gait impairment severity score., as an .npy file and also place them in the ./datasets/ folder. The saved matrix should be of shape (num_subjects).
  • Configure the brain_dataset.py and related files in the associated folder to correctly read in and process your dataset. Code has been provided for our use case of the PRIVATE dataset.

Calling the Model

python main.py --dataset=<name_of_dataset> --model_name=gatv2 --sample_selection --explain

The --explain argument is optional and triggers providing attention-based explanations of your model's predictions and saves related explanation data to the outputs/explanations/ folder.

Configuration Options

Different configurations for the models and dataset can be specified in the main.py file, such as num_epochs, num_classes, and hidden_dim.

Hyperparameter Tuning

This pipeline was configured for hyperparameter optimization with nni. Tuning configurations can be modified in the src/nni_configs.config.yml file. Using a Colab/Jupyter notebook, this can be done as follows: Create a free ngrok.com account and copy your AuthToken to be able to use the UI. Then run the following lines.

! wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip # download ngrok and unzip it
! unzip ngrok-stable-linux-amd64.zip
! ./ngrok authtoken <AuthToken> 
! nnictl create --config src/nni_configs/config.yml --port 5000 &
get_ipython().system_raw('./ngrok http 5000 &') # get experiment id
! curl -s http://localhost:4040/api/tunnels # don't change the port number 4040
!nnictl stop <experiment_id> # stop running experiment

Acknowledgments

This work was partially supported by NIH grants (AA010723, NS115114, P30AG066515), Stanford School of Medicine Department of Psychiatry and Behavioral Sciences Jaswa Innovator Award, UST (a Stanford AI Lab alliance member), and the Stanford Institute for Human-Centered AI (HAI) Google Cloud credits.} FN is funded by the Stanford Graduate Fellowship and the Stanford NeuroTech Training Program Fellowship.

This code was developed by Favour Nerrise ([email protected]). We also thank @Henny-Jie, @basiralab, and @pyg-team for their related works and open-source code on IBGNN + BrainGB, RegGNN, and Pytorch Geometric, respectively, which served as great resources for developing our methods and codebase.

Citation

Please cite our paper when using xGW-GAT:

@inproceedings{nerrise2023explainable,
  title={An Explainable Geometric-Weighted Graph Attention Network for Identifying Functional Networks Associated with Gait Impairment},
  author={Nerrise, Favour and Zhao, Qingyu and Poston, Kathleen L and Pohl, Kilian M and Adeli, Ehsan},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  pages={723--733},
  year={2023},
  organization={Springer}
}

xgw-gat's People

Contributors

favour-nerrise avatar fnerrise avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vadori

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.