Skip to main content

Deep learning classification with clinica

Project description

Clinica Deep Learning (clinicadl)

for Alzheimer's Disease

Build Status PyPI version Documentation Status

See also: AD-ML, Clinica

About the project

This repository hosts the code source for reproducible experiments on automatic classification of Alzheimer's disease (AD) using anatomical MRI data. It allows to train convolutional neural networks (CNN) models. The journal version of the paper describing this work is available 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.

Disclaimer: this software is in going-on development. Some features can change between different commits. A stable version is planned to be released soon. The release v.0.0.1 corresponds to the date of submission of the publication but in the meanwhile important changes are being done to facilitate the use of the package.

If you find a problem when use it or if you want to provide us feedback, please open an issue.

Getting Started

Full instructions for installation and additional information can be found in the user documentation.

clinicadl currently supports macOS and Linux.

We recommend to use conda or virtualenv to create an environment and install inside clinicadl:

conda create --name clinicadl_env python=3.6
conda activate clinicadl_env
pip install clinicadl

Overview

How to use clinicadl ?

clinicadl is an utility to be used with the command line.

There are six kind of tasks that can be performed using the command line:

  • Process TSV files. tsvtool includes many functions to get labels from BIDS, perform k-fold or single splits, produce demographic analysis of extracted labels and reproduce the restrictions made on AIBL and OASIS in the original paper.

  • Generate a synthetic dataset. The generate task is useful to obtain synthetic datasets frequently used in functional tests.

  • T1w-weighted images preprocessing. The preprocessing task processes a dataset of T1 images stored in BIDS format and prepares to extract the tensors (see paper for details on the preprocessing). Output is stored using the CAPS hierarchy.

  • T1 MRI tensor extraction. The extract task allows to create files in PyTorch format (.pt) with different options: the complete MRI, 2D slices and/or 3D patches. This files are also stored in the CAPS hierarchy.

  • Train neural networks. The train task is designed to perform training of CNN models using different kind of inputs, e.g., a full MRI (3D-image), patches from a MRI (3D-patch), specific regions of a MRI (ROI-based) or slices extracted from the MRI (2D-slices). Parameters used during the training are configurable. This task allow also to train autoencoders.

  • MRI classification. The classify task uses previously trained models to perform the inference of a particular or a set of MRI.

For detailed instructions and options of each task type clinica 'task' -h.

Testing

Be sure to have the pytest library in order to run the test suite. This test suite includes unit testing to be launched using the command line.

Unit testing (WIP)

The CLI (command line interface) part is tested using pytest. We are planning to provide unit tests for the other tasks in the future. If you want to run successfully the tests maybe you can use a command like this one:

pytest clinicadl/tests/test_cli.py

Functional testing

Training task are tested using synthetic data created from MRI extracted of the OASIS dataset. To run them, go to the test folder and type the following command in the terminal:

pytest ./test_train_cnn.py

Please, be sure to previously create the right dataset.

Model prediction tests

For sanity check trivial datasets can be generated to train or test/validate the predictive models.

The follow command allow you to generate two kinds of synthetic datasets: fully separable (trivial) or intractable data (IRM with random noise added).

clinicadl generate {random,trivial} caps_directory tsv_path output_directory
--n_subjects N_SUBJECTS

The intractable dataset will be made of noisy versions of the first image of the tsv file given at tsv_path associated to random labels.

The trivial dataset includes two labels:

  • AD corresponding to images with the left half of the brain with lower intensities,
  • CN corresponding to images with the right half of the brain with lower intensities.

Pretrained models

Some of the pretained model for the CNN networks can be obtained here: https://zenodo.org/record/3491003

These models were obtained during the experiments for publication. Updated versions of the models will be published soon.

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.

Related Repositories

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clinicadl-0.0.2b5.tar.gz (79.2 kB view details)

Uploaded Source

Built Distribution

clinicadl-0.0.2b5-py2.py3-none-any.whl (109.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file clinicadl-0.0.2b5.tar.gz.

File metadata

  • Download URL: clinicadl-0.0.2b5.tar.gz
  • Upload date:
  • Size: 79.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7

File hashes

Hashes for clinicadl-0.0.2b5.tar.gz
Algorithm Hash digest
SHA256 11f03a51b360b29f7e04616e0f642c22fc7f6c827351c9400893c230311571d6
MD5 7a7988bee11afe7d8e96fb8aa02c8701
BLAKE2b-256 9a9457ccfc66c6f7983e4aa5dcc466b8017cb9fdddaa537090b3f8ca19284ed1

See more details on using hashes here.

File details

Details for the file clinicadl-0.0.2b5-py2.py3-none-any.whl.

File metadata

  • Download URL: clinicadl-0.0.2b5-py2.py3-none-any.whl
  • Upload date:
  • Size: 109.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7

File hashes

Hashes for clinicadl-0.0.2b5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 baa97e080a6bd00c31c937ba05b746e21a8d8f43176984aa8b9c60c382449d8b
MD5 059ed55d858092e59ffe171f6e3b0a11
BLAKE2b-256 90a1095fd16609fb942c1ae4d62d100b3ba02c6c35b9e24d9fd466d631f311ce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page