Skip to main content

Coverage Status License: MIT

IVADO Medical Imaging

Comprehensive and open-source repository of deep learning methods for medical data segmentation. Collaboration between MILA and NeuroPoly for the IVADO project on medical imaging.

Contributions and features

Physic-informed network

We adapted the Feature-wise Linear Modulation (FiLM) approach to the segmentation task. FiLM enabled us to modulate CNNs features based on non-image metadata.

Figure FiLM

Two-step training with class sampling

We implemented a class sampling scheme, coupled with a transfer learning strategy, in order to mitigate the issue of class imbalance, while adressing the limitations of classical under-sampling (risk of loss of information) or over-sampling (risk of overfitting) approaches. During a first training step, the CNN is trained on an equivalent proportion of positive and negative samples, negative samples being under-weighted dynamically at each epoch. During the second step, the CNN is fine-tuned on the realistic (i.e. class-imbalanced) dataset.

Mixup

Mixup is a data augmentation technique which trains on virtual samples, generated by linear interpolation of two random samples from the training set and the associated labels. The idea is to regularize the network by linearly interpolating between training samples while extending the training distribution.

Figure mixup

Data augmentation on lesion ground-truths

This data augmentation is motivated by the large inter-rater variability that we measured on our MS dataset. The raters indeed mainly disagreed on the boundaries of the lesions, which suggests that the lesion surrounding voxels may also include some lesion level information. A soft mask is constructed by morphological dilation of the binary segmentation (i.e. mask provided by expert), where expert-labeled voxels have one as value while the augmented voxels are assigned a soft value which depends on the distance to the core of the lesion. Thus, the prior knowledge about the subjective lesion borders is then leveraged to the network.

Figure Data Augmentation on lesion ground truths

Network architectures

Loss functions

Installing

This project requires Python 3.6 and PyTorch >= 1.5.0. We recommend you work under a virtual environment:

virtualenv venv-ivadomed --python=python3.6
source venv-ivadomed/bin/activate

Option 1 : development version from Github

ivadomed is installed from Github and the requirements are installed using pip:

git clone https://github.com/neuropoly/ivado-medical-imaging.git
cd ivado-medical-imaging
pip install -e .

Option 2 : release from PyPI

ivadomed and its requirements are installed directly using pip :

pip install --upgrade pip
pip install ivadomed

Training

To train the network, use the ivadomed command-line tool that will be available on your path after installation, example below:

ivadomed config/config.json

where config.json is a configuration file. A description of each parameter is available in the wiki.

Data

The working dataset are:

  1. derived from the Spinal Cord MRI Public Database.
  2. the spinal cord grey matter segmentation challenge dataset.
  3. private multi-center dataset (duke/sct_testing/large) for spinal cord and MS lesion segmentation task.

The data structure is compatible with BIDS and is exemplified below:

bids_folder/
└── dataset_description.json
└── participants.tsv
└── sub-amu01
    └── anat
        └── sub-amu01_T1w_reg.nii.gz --> Processed (i.e. different than in the original SpineGeneric database)
        └── sub-amu01_T1w_reg.json
        └── sub-amu01_T2w_reg.nii.gz --> Processed
        └── sub-amu01_T2w_reg.json
        └── sub-amu01_acq-MTon_MTS_reg.nii.gz --> Processed
        └── sub-amu01_acq-MTon_MTS_reg.json
        └── sub-amu01_acq-MToff_MTS_reg.nii.gz --> Processed
        └── sub-amu01_acq-MToff_MTS_reg.json
        └── sub-amu01_acq-T1w_MTS.nii.gz --> Unprocessed (i.e. same as in the original SpineGeneric database)
        └── sub-amu01_acq-T1w_MTS.json
        └── sub-amu01_T2star_reg.nii.gz --> Processed
        └── sub-amu01_T2star_reg.json
└── derivatives
    └── labels
        └── sub-amu01
            └── anat
                └── sub-amu01_T1w_seg.nii.gz --> Spinal cord segmentation

Contributors

List of contributors

Release files for ivadomed 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ivadomed 1.1
File Size Uploaded
ivadomed-1.1.tar.gz 59.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ivadomed 1.1
File Interpreter ABI Platform
ivadomed-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 127.6 kB

Release files / ivadomed-1.1.tar.gz

Download URL ivadomed-1.1.tar.gz
Size 59.4 kB
Tags Source
SHA-256 checksum
How to use checksums
84fdfbad188048704404e303277ee0fe1137693c71ce71663cb22a90c7df2a40
BLAKE2b-256 checksum
How to use checksums
d38149cdd6ab6ead0cd0cec2d3d28b32b948d352390dc3c1a25d5fb9266b8501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

Release files / ivadomed-1.1-py3-none-any.whl

Download URL ivadomed-1.1-py3-none-any.whl
Size 68.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4b14e98a028379cd56776a2048fffe0e7afb4ac8cca80eac33fd5552d3b603a
BLAKE2b-256 checksum
How to use checksums
febee866c8f09b2807d9fb2ae2f0459ff0591e5f9f77ca32f286168a5b02b906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

Release history Release notifications | RSS feed

2.9.10

2 release files

2.9.9

2 release files

2.9.8

2 release files

2.9.7

2 release files

2.9.6

2 release files

2.9.5

2 release files

2.9.4

2 release files

2.9.3

2 release files

2.9.2

2 release files

2.9.1

2 release files

2.9.0

2 release files

2.8.0

2 release files

2.7.4

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

1.2.1

2 release files

1.2

2 release files

This release

1.1 This release

2 release files

1.0

2 release files

0.14

2 release files

0.13

2 release files

0.12

2 release files

0.11

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page