Skip to content

theYGE/connectome_innolab

Connectome

Cookiecutter template from @cthoyt Code style: black

A preprocessing and graph-based analytics tool for anomaly detection in the human connectome.

Abstract

Neurological diseases and psychiatric disorders are increasingly prevalent [1][2]. Despite advanced technological possibilities to measure brain connectivity and functionality, capabilities like functional Magnetic Resonance Imaging [3] are mostly used for research and sparsely for diagnosing neurological disorders in individual patients.
This project aims to provide a platform for medical practitioners to detect disconnectivity in individual patient connectomes and predict the probability of a neurological disorder.
Currently, the prototype creates connectivity matrices (400x400) from pre-processed fMRI images via Schaefer2018_Parcellations atlas with 400 parcels [4]. Connectivity matrices are labeled and augmented with metadata (age and gender).
Then, a graph convolutional network (see Model architecture), trained on samples from the large fMRI dataset, encodes the image to a five dimensional embedding space. A prototype binary classifier is implemented to detect anomalous connectomes (to be trained with further unhealthy connectomes).
Results are evaluated with a probability of neurological disorder (anomalous connectome), brain regions summary using nilearn and the patients connectivity matrix.
The project also includes a front-end (via React) and back-end (via Flask) so it can be easily web-hosted.

[1] https://www.paho.org/en/enlace/burden-neurological-conditions
[2] https://www.who.int/news-room/fact-sheets/detail/mental-disorders
[3] Glover, Gary H. “Overview of functional magnetic resonance imaging.” Neurosurgery clinics of North America vol. 22,2 (2011): 133-9, vii. doi:10.1016/j.nec.2010.11.001
[4] Schaefer A, Kong R, Gordon EM, Laumann TO, Zuo XN, Holmes AJ, Eickhoff SB, Yeo BTT. Local-Global parcellation of the human cerebral cortex from intrinsic functional connectivity MRI. Cerebral Cortex, 29:3095-3114, 2018

Prototype demo

The following video explains how to launch the web-app and use the product.

99.Connectome.Productdemo.Compress.mp4

Project details

large fMRI dataset

We downloaded and labeled large fMRI dataset (~26k in total) data as 'healthy' (~20k) and as 'patients with significant brain/mental disease' (~2.1k), by utilizing the ICD-10 (International Classification of Diseases, version 10) codes and metadata provided by large fMRI dataset. We selected the healthy participants by finding out the ones without any significant general diseases (we screened around 1k diseases in total, i.e., cancers). And the 'patients' are defined as participants who have any form of significant brain/mental disease (ICD-10 Code with prefix F, i.e. Alzheimer’s disease).

Pre-processing

Our pre-processing pipeline involves two parts: normalization and creation of connectivity matrices.
To perform normalization, we use the applywarp from FSL to apply a pre-calculated warp to the input data (large fMRI dataset). We then apply the fslmaths from FSL to mask the output image from the previous step with a binary mask image.
For the creation of connectivity matrices, we utilize the nilearn package, a Python library for neuroimaging analysis.
We have developed a function that produces the connectivity matrices based on the Schaefer2018_LocalGlobal Atlas file, which includes 400 parcels and 7 networks. Detailed information about parcel names can be found here.

Model architecture

The graph based neural network model was implemented using PyTorch Geometric. Specifically, we employ a Graph Convolutional Network (GCN) as proposed in Kipf & Welling (2017) with a Variational Graph Auto-Encoder (VGAE).
It has been shown that VGAE-based model performance is competitive compared to other GCN models for unsupervised learning tasks (Kipf & Welling, 2017). Our GCN model returns a five dimensional embedding space, which serves as input for the binary classifier (final layer).

Project milestones

Goals Status
Data & Pre-processing
  • Label and categorize large fMRI data
  • Normalize fMRI images into MNI-space &
    create connectivity matrices from Yeo7 Atlas
Model
  • Implement & train graph neural network on large fMRI data
  • Prototype binary classifier (yes/no anomalous connectome)
Outputs & backend
  • Create easy-to-use web-hosted application
  • Output visualization of patient connectome & connectivity

Preliminary results

The GCN model as well as the prototype binary classifier need to be trained on more data (training on large fMRI dataset still in progress) before meaningful results can be reported.

Repository structure

  • attic: Supporting functionalities not included in the source distribution (e.g. create dummy data)
  • client-side/src & server-side: Front-end and back-end functionalities, respectively.
  • data: Data handling & exploratory analysis of large fMRI dataset
  • docs\source: Files for automatic documentation (to come)
  • src: Everything distribution related
    • assets: Saved model epochs, training/validation errors etc.
    • conf: Configuration of models
    • connectome: Model training, architecture and main utils
  • tests: Unit testing modules for main functions

💪 Getting Started

For tips on how to run the preprocessing see here.

For training a folder with connectivity matrices stored as pytorch tensors (.pt files) is needed.
The module utils.preprocess_matrices provides functionalities for creating a folder with .pt files from a folder with .csv files only. We provided an example image here.
Training results are written in assets folder. Training creates a folder called checkpoints, storing models from each epoch as a pickle file .
Further training_results folder stores training and validation error as .csv per epoch. assets\hydra folder stores .yaml configurations and tracked training results from hydra invoked by the decorator of this function. The checkpoints and training_results folder may be cleaned before training setting clear-assets to 'True'. Models can be loaded based on lowest validation error using function
utils.select_optimal_model()

👋 Attribution

⚖️ License

The code in this package is licensed under the MIT License.

Authors

  • Oleksandr Makarevych
  • Simei Li
  • Sven Morlock
  • Zhiwei Cheng
  • Thomas Lux

Project Partner: Dr. Boris Rauchmann.

🍪 Cookiecutter

This package was created with @audreyfeldroy's cookiecutter package using @cthoyt's cookiecutter-snekpack template.

(back to top)

About

GitHub repo for Innolab Course at LMU 22/23

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors