A pytorch-based deep learning framework for multi-modal 2D/3D medical image segmentation

Overview

A 3D multi-modal medical image segmentation library in PyTorch

Contributors Forks Stargazers Issues Open In Colab

We strongly believe in open and reproducible deep learning research. Our goal is to implement an open-source medical image segmentation library of state of the art 3D deep neural networks in PyTorch. We also implemented a bunch of data loaders of the most common medical image datasets. This project started as an MSc Thesis and is currently under further development. Although this work was initially focused on 3D multi-modal brain MRI segmentation we are slowly adding more architectures and data-loaders.

Top priorities 21-07

[Update] 21-07 We have just received a brand new GPU. The project developedment was postponed due to lack of computational resources. We will be back with more updates. Please Watch our Github repository for releases to be notified. We are always looking for passionate open-source contributos. Full credits will be given.

  • Project restructure, API/CLI design ++
  • Minimal test prediction example with pre-trained models
  • Overlapping and non-overlapping inference
  • Finalize preprocessing on Brats datasets
  • Save produced 3d-total-segmentation as nifty files
  • Medical image decathlon dataloaders
  • StructSeg 2019 challenge dataloaders
  • More options for 2D architectures
  • Rewrite manual
  • New notebooks with google colab support

Quick Start

  • If you want to quickly understand the fundamental concepts for deep learning in medical imaging, we strongly advice to check our blog post. We provide a general high-level overview of all the aspects of medical image segmentation and deep learning. For a broader overview on MRI applications find my latest review article.

  • To grasp more fundamental medical imaging concepts, check out our post on coordinate systems and DICOM images.

  • For a more holistic approach on Deep Learning in MRI you may advice my thesis this.

  • Alternatively, you can create a virtual environment and install the requirements. Check the installation folder for more instructions.

  • You can also take a quick glance at the manual.

  • If you do not have a capable environment or device to run this projects then you could give Google Colab a try. It allows you to run the project using a GPU device, free of charge. You may try our Colab demo using this notebook:Open In Colab

Implemented architectures

  • U-Net3D Learning Dense Volumetric Segmentation from Sparse Annotation Learning Dense Volumetric Segmentation from Sparse Annotation

  • V-net Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation

  • ResNet3D-VAE 3D MRI brain tumor segmentation using auto-encoder regularization

  • U-Net Convolutional Networks for Biomedical Image Segmentation

  • SkipDesneNet3D 3D Densely Convolutional Networks for Volumetric Segmentation

  • HyperDense-Net A hyper-densely connected CNN for multi-modal image segmentation

  • multi-stream Densenet3D A hyper-densely connected CNN for multi-modal image segmentation

  • DenseVoxelNet Automatic 3D Cardiovascular MR Segmentation with Densely-Connected Volumetric ConvNets

  • MED3D Transfer learning for 3D medical image analysis

  • HighResNet3D On the Compactness, Efficiency, and Representation of 3D Convolutional Networks: Brain Parcellation as a Pretext Task

Implemented medical imaging data-loaders

Task Data Info/ Modalities Train/Test Volume size Classes Dataset size (GB)
Iseg 2017 T1, T2 10 / 10 144x192x256 4 0.72
Iseg 2019 T1, T2 10 / 13 144x192x256 4 0.75
MICCAI BraTs2018 FLAIR, T1w, T1gd,T2w 285 / - 240x240x155 9 or 4 2.4
MICCAI BraTs2019 FLAIR, T1w, T1gd,T2w 335 / 125 240x240x155 9 or 4 4
Mrbrains 2018 FLAIR, T1w, T1gd,T2w 8 240x240x48 9 or 4 0.5
IXI brain development Dataset T1,T2 no labels 581 (110~150)x256x256 - 8.7
MICCAI Gleason 2019 Challenge 2D pathology images ~250 5K x 5K - 2.5

Preliminary results

Visual results on Iseg-2017

Iseg and Mr-brains

Model # Params (M) MACS(G) Iseg 2017 DSC (%) Mr-brains 4 classes DSC (%)
Unet3D 17 M 0.9 93.84 88.61
Vnet 45 M 12 87.21 84.09
DenseNet3D 3 M 5.1 81.65 79.85
SkipDenseNet3D 1.5 M 31 - -
DenseVoxelNet 1.8 M 8 - -
HyperDenseNet 10.4 M 5.8 - -

Usage

How to train your model

  • For Iseg-2017 :
python ./examples/train_iseg2017_new.py --args
  • For MR brains 2018 (4 classes)
python ./examples/train_mrbrains_4_classes.py --args
  • For MR brains 2018 (8 classes)
python ./examples/train_mrbrains_9_classes.py --args
  • For MICCAI 2019 Gleason Challenge
python ./examples/test_miccai_2019.py --args
  • The arguments that you can modify are extensively listed in the manual.

Inference

How to test your trained model in a medical image

python ./tests/inference.py --args

Covid-19 segmentation and classification

We provide some implementations around Covid-19 for humanitarian purposes. In detail:

Classification model

  • COVID-Net A Tailored Deep Convolutional Neural Network Design for Detection of COVID-19 Cases from Chest Radiography Images

Datasets

Classification from 2D images:

3D COVID-19 segmentation dataset

Latest features (06/2020)

  • On the fly 3D total volume visualization
  • Tensorboard and PyTorch 1.4+ support to track training progress
  • Code cleanup and packages creation
  • Offline sub-volume generation
  • Add Hyperdensenet, 3DResnet-VAE, DenseVoxelNet
  • Fix mrbrains,Brats2018,Brats2019, Iseg2019, IXI,MICCAI 2019 gleason challenge dataloaders
  • Add confusion matrix support for understanding training dynamics
  • Some Visualizations

Support

If you really like this repository and find it useful, please consider (★) starring it, so that it can reach a broader audience of like-minded people. It would be highly appreciated :) !

Contributing to Medical ZOO

If you find a bug, create a GitHub issue, or even better, submit a pull request. Similarly, if you have questions, simply post them as GitHub issues. More info on the contribute directory.

Current team

Ilias Papastatis, Sergios Karagianakos and Nikolas Adaloglou

License , citation and acknowledgements

Please advice the LICENSE.md file. For usage of third party libraries and repositories please advise the respective distributed terms. It would be nice to cite the original models and datasets. If you want, you can also cite this work as:

@MastersThesis{adaloglou2019MRIsegmentation,
author = {Adaloglou Nikolaos},
title={Deep learning in medical image analysis: a comparative analysis of
multi-modal brain-MRI segmentation with 3D deep neural networks},
school = {University of Patras},
note="\url{https://github.com/black0017/MedicalZooPytorch}",
year = {2019},
organization={Nemertes}}

Acknowledgements

In general, in the open source community recognizing third party utilities increases the credibility of your software. In deep learning, academics tend to skip acknowledging third party repos for some reason. In essence, we used whatever resource we needed to make this project self-complete, that was nicely written. However, modifications were performed to match the project structure and requirements. Here is the list of the top-based works: HyperDenseNet model. Most of the segmentation losses from here. 3D-SkipDenseNet model from here. 3D-ResNet base model from here. Abstract model class from MimiCry project. Trainer and Writer class from PyTorch template. Covid-19 implementation based on our previous work from here. MICCAI 2019 Gleason challenge data-loaders based on our previous work from here. Basic 2D Unet implementation from here.Vnet model from here

Owner
Adaloglou Nikolas
Human-Centered AI PhD Researcher.
Adaloglou Nikolas
SASM - simple crossplatform IDE for NASM, MASM, GAS and FASM assembly languages

SASM (SimpleASM) - простая кроссплатформенная среда разработки для языков ассемблера NASM, MASM, GAS, FASM с подсветкой синтаксиса и отладчиком. В SA

Dmitriy Manushin 5.6k Jan 06, 2023
This repository includes the official project for the paper: TransMix: Attend to Mix for Vision Transformers.

TransMix: Attend to Mix for Vision Transformers This repository includes the official project for the paper: TransMix: Attend to Mix for Vision Transf

Jie-Neng Chen 130 Jan 01, 2023
PyTorch Implementation of CycleGAN and SSGAN for Domain Transfer (Minimal)

MNIST-to-SVHN and SVHN-to-MNIST PyTorch Implementation of CycleGAN and Semi-Supervised GAN for Domain Transfer. Prerequites Python 3.5 PyTorch 0.1.12

Yunjey Choi 401 Dec 30, 2022
Python scripts for performing road segemtnation and car detection using the HybridNets multitask model in ONNX.

ONNX-HybridNets-Multitask-Road-Detection Python scripts for performing road segemtnation and car detection using the HybridNets multitask model in ONN

Ibai Gorordo 45 Jan 01, 2023
Why Are You Weird? Infusing Interpretability in Isolation Forest for Anomaly Detection

Why, hello there! This is the supporting notebook for the research paper — Why Are You Weird? Infusing Interpretability in Isolation Forest for Anomal

2 Dec 14, 2021
Convex optimization for fun and profit.

CFMM Optimal Routing This repository contains the code needed to generate the figures used in the paper Optimal Routing for Constant Function Market M

Guillermo Angeris 183 Dec 29, 2022
A simple baseline for 3d human pose estimation in PyTorch.

3d_pose_baseline_pytorch A PyTorch implementation of a simple baseline for 3d human pose estimation. You can check the original Tensorflow implementat

weigq 312 Jan 06, 2023
CVPR 2021 Challenge on Super-Resolution Space

Learning the Super-Resolution Space Challenge NTIRE 2021 at CVPR Learning the Super-Resolution Space challenge is held as a part of the 6th edition of

andreas 104 Oct 26, 2022
A library for Deep Learning Implementations and utils

deeply A Deep Learning library Table of Contents Features Quick Start Usage License Features Python 2.7+ and Python 3.4+ compatible. Quick Start $ pip

Achilles Rasquinha 1 Dec 12, 2022
A pyparsing-based library for parsing SOQL statements

CONTRIBUTORS WANTED!! Installation pip install python-soql-parser or, with poetry poetry add python-soql-parser Usage from python_soql_parser import p

Kicksaw 0 Jun 07, 2022
Implementing a simplified copy of Shazam application from scratch using MinHashing and LSH.

Building Shazam from scratch In this repository we tried to implement a simplified copy of the Shazam application able to tell you the name of a song

Arturo Ghinassi 0 Nov 17, 2022
Code in PyTorch for the convex combination linear IAF and the Householder Flow, J.M. Tomczak & M. Welling

VAE with Volume-Preserving Flows This is a PyTorch implementation of two volume-preserving flows as described in the following papers: Tomczak, J. M.,

Jakub Tomczak 87 Dec 26, 2022
Code for "Human Pose Regression with Residual Log-likelihood Estimation", ICCV 2021 Oral

Human Pose Regression with Residual Log-likelihood Estimation [Paper] [arXiv] [Project Page] Human Pose Regression with Residual Log-likelihood Estima

JeffLi 347 Dec 24, 2022
Data from "HateCheck: Functional Tests for Hate Speech Detection Models" (Röttger et al., ACL 2021)

In this repo, you can find the data from our ACL 2021 paper "HateCheck: Functional Tests for Hate Speech Detection Models". "test_suite_cases.csv" con

Paul Röttger 43 Nov 11, 2022
This repository contains the code and models necessary to replicate the results of paper: How to Robustify Black-Box ML Models? A Zeroth-Order Optimization Perspective

Black-Box-Defense This repository contains the code and models necessary to replicate the results of our recent paper: How to Robustify Black-Box ML M

OPTML Group 2 Oct 05, 2022
Python implementation of Lightning-rod Agent, the Stack4Things board-side probe

Iotronic Lightning-rod Agent Python implementation of Lightning-rod Agent, the Stack4Things board-side probe. Free software: Apache 2.0 license Websit

2 May 19, 2022
Lazy, a tool for running things in idle time

Lazy, a tool for running things in idle time Mostly used to stop CUDA ML model training from making my desktop unusable. Simply monitors keyboard/mous

N Shepperd 46 Nov 06, 2022
Curvlearn, a Tensorflow based non-Euclidean deep learning framework.

English | 简体中文 Why Non-Euclidean Geometry Considering these simple graph structures shown below. Nodes with same color has 2-hop distance whereas 1-ho

Alibaba 123 Dec 12, 2022
Official Pytorch implementation of Online Continual Learning on Class Incremental Blurry Task Configuration with Anytime Inference (ICLR 2022)

The Official Implementation of CLIB (Continual Learning for i-Blurry) Online Continual Learning on Class Incremental Blurry Task Configuration with An

NAVER AI 34 Oct 26, 2022
Bringing sanity to world of messed-up data

Sanitize sanitize is a Python module for making sure various things (e.g. HTML) are safe to use. It was originally written by Mark Pilgrim and is dist

Alireza Savand 63 Oct 26, 2021