Giter Club home page Giter Club logo

camull_net's Introduction

camull-net

An implementation of the Cambridge parameter efficient 3D convolutional network for the classification of Alzheimer's disease in pytorch. The architecture is described in detail in this link. More specifically the architecture can classify between static and progressive Mild cognitive impairement which is a disease that precludes Alzheimers. The area under the curve achieved for this harder second task is: 0.88.

The code was developed as part of my dissertation at the university of Hull. You can read more about it, including the data required, in this medium link.

Features

  • Neural Net
    • 3D seperable convolution to reduce number of parameters and hence overfitting.
    • Multiple concurrent data streams
      • MRI Data
      • Clinical Data
  • Program
    • Saves and loads model
    • Supports k-fold cross validation
    • Logs the train and test loss
    • Outputs Area under the ROC curve for each k-fold
    • Saves each model under a unique identifier

Requirements

The following requirements are contained within the requirements.yml file. To install them just run:

$ conda env create -f environment.yml
Library Version Purpose
Pytorch 1.4.0 Deep learning library for tensor transformations
Torchvision 0.2.2 library required by pytorch
Numpy 1.18.1 Datascience library for creating and manipulating arrays in python
sklearn 0.23 Machine learning library used to output area under the curve and other stats.
matplotlib 3.1.2 A visualization library required by sklearn to generate the 2D graphs.
Pandas 0.25.3 Datascience library for working with tabular data
Nibabel 3.0.0 Library for loading in MRI scans into python
Tqdm 4.42.1 library for outputting progress to the console.

Data

You must place the data folder in a directory above the project folder. The data folder must contain a csv file with the clinical data and a folder containing the MRI images for each class. The data can be obtained from the ADNI website. The data requirements are described in more detail in the wiki but to sumarize the clinical vector must be of length 21 and the mri scans have to be of dimension 110x110x110. Alternatively you can download a zip from this link of my preprocessed dataset.

How to use

  1. Place your data in the directory above. (See wiki)
  2. Run "python train_model.py"
  3. Wait about 20 mins; grab some snacks.
  4. Look in the save folder for logs and graphs (..\graphs, ..\logs).

Inference

Once the model has been trained and you are happy with its perfomance after reviewing the graphs and logs you can use it for predictions. This is also known as inference and can be initiated by running the interface.py script. This script will give you an option to load a model of your choice and perform inference on the specified data.

To read an explanation on this checkout this medium article. https://medium.com/@hextra_19712/deep-learning-for-alzheimers-classification-57611161e442?sk=ebc8035cead352f51f7d0e105a69a6c7

!(image)[https://i.gyazo.com/1b655be7b33cff82372088abdbf8eb4c.png]

Extras

alt alt

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.