GithubHelp home page GithubHelp logo

wj0315 / ad-dl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aramis-lab/clinicadl

0.0 1.0 0.0 112.5 MB

Clinica Deep Learning: software for reproducible experiments using CNNs on automatic classification of Alzheimer's disease (AD) using anatomical MRI data

Python 72.61% Shell 22.35% Jupyter Notebook 5.04%

ad-dl's Introduction

Clinica Deep Learning AD

This repository contains a software framework for reproducible experiments with convolutional neural networks (CNN) on automatic classification of Alzheimer's disease (AD) using anatomical MRI data from the publicly available dataset ADNI. It is developed by Junhao Wen, Elina Thibeau--Sutre and Mauricio Diaz. The preprint version of the corresponding paper may be found here.

Automatic Classification of AD using a classical machine learning approach can be performed using the software available here: https://github.com/aramis-lab/AD-ML.

This software is currently in active developmet. Pretrained models for the CNN networks can be obtained here: https://zenodo.org/record/3491003

Bibliography

All the papers described in the State of the art section of the manuscript may be found at this URL address: https://www.zotero.org/groups/2337160/ad-dl.

Dependencies:

  • Python >= 3.6
  • Clinica (needs only to perform preprocessing)
  • Numpy
  • Pandas
  • Scikit-learn
  • Pandas
  • Pytorch
  • Nilearn
  • Nipy
  • TensorBoardX

How to use?

Create a conda environment with the corresponding dependencies:

conda create --name clincadl_env_py36 python=3.6 jupyter
conda activate clinicadl_env_py36
conda install -c aramislab -c conda-forge clinica

git clone [email protected]:aramis-lab/AD-DL.git
cd AD-DL
pip install -r requirements.txt
conda install -c pytorch pytorch torchvision

Install the package clinicadl as developer:

cd clinicadl
pip install -e .

Use in command line mode

clinicadl -h

usage: clinicadl [-h] {preprocessing,extract,train,classify} ...

Clinica Deep Learning.

optional arguments: -h, --help            show this help message and exit

Task to execute with clinicadl:
  What kind of task do you want to use with clinicadl (preprocessing,
  extract, train, validate, classify).

  {preprocessing,extract,train,classify}
                        Stages/task to execute with clinicadl
    preprocessing       Prepare data for training (needs clinica installed).
    extract             Create data (slices or patches) for training.
    train               Train with your data and create a model.
    classify            Classify one image or a list of images with your
                        previouly trained model.  

Typical use for preprocessing:

clinicadl preprocessing --np 32 \
  $BIDS_DIR \
  $CAPS_DIR \
  $TSV_FILE \
  $REF_TEMPLATE \
  $WORKING_DIR

For detailed instructions type clinica 'action' -h. For example:

clinicadl train -h
usage: clinicadl train [-h] [-gpu] [-np NPROC] [--batch_size BATCH_SIZE]
                       [--evaluation_steps EVALUATION_STEPS]
                       [--preprocessing {linear,mni}]
                       [--diagnoses DIAGNOSES [DIAGNOSES ...]] [--baseline]
                       [--minmaxnormalization] [--n_splits N_SPLITS]
                       [--split SPLIT] [-tAE]
                       [--accumulation_steps ACCUMULATION_STEPS]
                       [--epochs EPOCHS] [--learning_rate LEARNING_RATE]
                       [--patience PATIENCE] [--tolerance TOLERANCE]
                       [--add_sigmoid] [--pretrained_path PRETRAINED_PATH]
                       [--pretrained_difference PRETRAINED_DIFFERENCE]
                       {subject,slice,patch,svm} caps_directory tsv_path
                       output_dir network

positional arguments:
  {subject,slice,patch,svm}
                        Choose your mode (subject level, slice level, patch
                        level, svm).
  caps_directory        Data using CAPS structure.
  tsv_path              tsv path with sujets/sessions to process.
  output_dir            Folder containing results of the training.
  network               CNN Model to be used during the training.

optional arguments:
  -h, --help            show this help message and exit
  -gpu, --use_gpu       Uses gpu instead of cpu if cuda is available
  -np NPROC, --nproc NPROC
                        Number of cores used during the training
  --batch_size BATCH_SIZE
                        Batch size for training. (default=2)
  --evaluation_steps EVALUATION_STEPS, -esteps EVALUATION_STEPS
                        Fix the number of batches to use before validation
  --preprocessing {linear,mni}
                        Defines the type of preprocessing of CAPS data.
  --diagnoses DIAGNOSES [DIAGNOSES ...], -d DIAGNOSES [DIAGNOSES ...]
                        Take all the subjects possible for autoencoder
                        training
  --baseline            if True only the baseline is used
  --minmaxnormalization, -n
                        Performs MinMaxNormalization
  --n_splits N_SPLITS   If a value is given will load data of a k-fold CV
  --split SPLIT         Will load the specific split wanted.
  -tAE, --train_autoencoder
                        Add this option if you want to train an autoencoder
  --accumulation_steps ACCUMULATION_STEPS, -asteps ACCUMULATION_STEPS
                        Accumulates gradients in order to increase the size of
                        the batch
  --epochs EPOCHS       Epochs through the data. (default=20)
  --learning_rate LEARNING_RATE, -lr LEARNING_RATE
                        Learning rate of the optimization. (default=0.01)
  --patience PATIENCE   Waiting time for early stopping.
  --tolerance TOLERANCE
                        Tolerance value for the early stopping.
  --add_sigmoid         Ad sigmoid function at the end of the decoder.

Or use the scripts

Look at the clinicadl/scripts/ folder.

Run testing:

pytest clinicadl/tests/

ad-dl's People

Contributors

anbai106 avatar mdiazmel avatar alexandreroutier avatar

Watchers

James Cloos avatar

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.