Our implementation used for the MICCAI 2021 FLARE Challenge titled 'Efficient Multi-Organ Segmentation Using SpatialConfiguartion-Net with Low GPU Memory Requirements'.

Overview

Efficient Multi-Organ Segmentation Using SpatialConfiguartion-Net with Low GPU Memory Requirements

Our implementation used for the MICCAI 2021 FLARE Challenge titled Efficient Multi-Organ Segmentation Using SpatialConfiguartion-Net with Low GPU Memory Requirements.

You need to have the MedicalDataAugmentationTool framework by Christian Payer downloaded and in your PYTHONPATH for the scripts to work.

If you have questions about the code, write me a mail.

Dependencies

The following frameworks/libraries were used in the version as stated. If you run into problems with the libraries, please verify that you have the same version installed.

  • Python 3.9
  • TensorFlow 2.6
  • SimpleITK 2.0
  • Numpy 1.20

Dataset and Preprocessing

The dataset as well as a detailed description of it can be found on the challenge website. Follow the steps described there to download the data.

Define the base_dataset_folder containing the downloaded TrainingImg, TrainingMask and ValidationImg in the script preprocessing/preprocessing.py and execute it to generate TrainingImg_small and TrainingMask_small.

Also, download the setup folder provided in this repository and place it in the base_dataset_folder, the following structure is expected:

.                                       # The `base_dataset_folder` of the dataset
├── TrainingImg                         # Image folder containing all training images
│   ├── train_000_0000.nii.gz            
│   ├── ...                   
│   └── train_360_0000.nii.gz            
├── TrainingMask                        # Image folder containing all training masks
│   ├── train_000.nii.gz            
│   ├── ...                   
│   └── train_360.nii.gz  
├── ValidationImg                       # Image folder containing all validation images
│   ├── validation_000_0000.nii.gz            
│   ├── ...                   
│   └── validation_360_0000.nii.gz  
├── TrainingImg_small                   # Image folder containing all downsampled training images generated by `preprocessing/preprocessing.py`
│   ├── train_000_0000.nii.gz            
│   ├── ...                   
│   └── train_360_0000.nii.gz  
├── TrainingMask_small                  # Image folder containing all downsampled training masks generated by `preprocessing/preprocessing.py`
│   ├── train_000_0000.nii.gz            
│   ├── ...                   
│   └── train_360_0000.nii.gz  
└── setup                               # Setup folder as provided in this repository

Train Models

To train a localization model, run localization/main.py after defining the base_dataset_folder as well as the base_output_folder.

To train a segmentation model, run scn/main.py. Again, base_dataset_folder and base_output_folder need to be set accordingly beforehand.

In both cases in function run(), the variable cv can be set to 0, 1, 2, 3 or 4. The values 1-4 represent the respective cross-validation fold. When choosing 0, all training data is used to train the model, which also deactivates the generation of test outputs.

Further parameters like the number of training iterations (max_iter) and the number of iterations after which to perfrom testing (test_iter) can be modified in __init__() of the MainLoop class.

Generate a SavedModel

To convert a trained network to a SavedModel, the script localization/main_create_model.py respectively scn/main_create_model.py can be used after a model was trained.

Before running the respective script, the variable load_model_base needs to be set to the trained models output folder, e.g., .../localization/cv1/2021-09-27_13-18-59.

Furthermore, load_model_iter should be set to the same value as max_iter used during training the model. The value needs to be set to an iteration for which the network weights have been generated.

Generate tf_utils_module

The script inference/inference_tf_utils_module.py can be used to trace and save the tf.functions used for preprocessing during inference into a SavedModel and generate saved_models/tf_utils_module.

To do so, the input_path and output_path need to be defined in the script. The input_path is expected to contain valid images, we suggest to use the folder ValidationImg.

Inference

The provided inference script can be used to evaluate the performance of our method on unseen data efficiently.

The script inference/inference.py requires that all SavedModels are present in the saved_models folder, i.e., saved_models/localization, saved_models/segmentation and saved_models/tf_utils_module need to contain the respective SavedModel. Either, use the provided SavedModels for inference by copying them from submitted_saved_models to saved_models, or use your own models generated as described above.

Additionally, the input_path and output_path need to be defined in the script. The input_path is expected to contain valid images, we suggest to use the folder ValidationImg.

.                                       # The base folder of this repository.
├── saved_models                        # Required by `inference.py`.
│   ├── localization                    # SavedModel of the localization model.
│   │   ├── assets
│   │   ├── variables
│   │   └── saved_model.pb
│   ├── segmentation                    # SavedModel of the segmentation (scn) model.
│   │   ├── assets
│   │   ├── variables
│   │   └── saved_model.pb
│   └── tf_utils_module                 # SavedModel of the tf.functions used for preprocessing during inference.
│       ├── assets
│       ├── variables
│       └── saved_model.pb
...

Docker

The provided Dockerfile can be used to generate a docker image which can readily be used for inference. The SavedModels are expected in the folder saved_models, either copy the provided SavedModels from submitted_saved_models to saved_models or generate your own. If you have a problem with setting up docker, please refer to the documentation.

To build a docker model, run the following command in the folder containing the Dockerfile.

docker build -t icg .

To run your built docker, use the command below, after defining the input and output directories within the command. We recommend to use ValidationImg as input folder.

If you have multiple GPUs and want to select a specific one to run the docker image, modify /dev/nvidia0 to the respective GPUs identifier, e.g., /dev/nvidia1.

docker container run --gpus all --device /dev/nvidia0 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl --name icg --rm -v /PATH/TO/DATASET/ValidationImg/:/workspace/inputs/ -v /PATH/TO/OUTPUT/FOLDER/:/workspace/outputs/ icg:latest /bin/bash -c "sh predict.sh" 

Citation

If you use this code for your research, please cite our paper.

Efficient Multi-Organ Segmentation Using SpatialConfiguartion-Net with Low GPU Memory Requirements

@article{Thaler2021Efficient,
  title={Efficient Multi-Organ Segmentation Using SpatialConfiguartion-Net with Low GPU Memory Requirements},
  author={Thaler, Franz and Payer, Christian and Bischof, Horst and {\v{S}}tern, Darko},
  year={2021}
}
Owner
Franz Thaler
Franz Thaler
Do Neural Networks for Segmentation Understand Insideness?

This is part of the code to reproduce the results of the paper Do Neural Networks for Segmentation Understand Insideness? [pdf] by K. Villalobos (*),

biolins 0 Mar 20, 2021
Authors implementation of LieTransformer: Equivariant Self-Attention for Lie Groups

LieTransformer This repository contains the implementation of the LieTransformer used for experiments in the paper LieTransformer: Equivariant self-at

35 Oct 18, 2022
Tooling for converting STAC metadata to ODC data model

手语识别 0、使用到的模型 (1). openpose,作者:CMU-Perceptual-Computing-Lab https://github.com/CMU-Perceptual-Computing-Lab/openpose (2). 图像分类classification,作者:Bubbl

Open Data Cube 65 Dec 20, 2022
Python library for science observations from the James Webb Space Telescope

JWST Calibration Pipeline JWST requires Python 3.7 or above and a C compiler for dependencies. Linux and MacOS platforms are tested and supported. Win

Space Telescope Science Institute 386 Dec 30, 2022
This code is for our paper "VTGAN: Semi-supervised Retinal Image Synthesis and Disease Prediction using Vision Transformers"

ICCV Workshop 2021 VTGAN This code is for our paper "VTGAN: Semi-supervised Retinal Image Synthesis and Disease Prediction using Vision Transformers"

Sharif Amit Kamran 25 Dec 08, 2022
An attempt at the implementation of Glom, Geoffrey Hinton's new idea that integrates neural fields, predictive coding, top-down-bottom-up, and attention (consensus between columns)

GLOM - Pytorch (wip) An attempt at the implementation of Glom, Geoffrey Hinton's new idea that integrates neural fields, predictive coding,

Phil Wang 173 Dec 14, 2022
Unofficial TensorFlow implementation of Protein Interface Prediction using Graph Convolutional Networks.

[TensorFlow] Protein Interface Prediction using Graph Convolutional Networks Unofficial TensorFlow implementation of Protein Interface Prediction usin

YeongHyeon Park 9 Oct 25, 2022
CVPR2021 Content-Aware GAN Compression

Content-Aware GAN Compression [ArXiv] Paper accepted to CVPR2021. @inproceedings{liu2021content, title = {Content-Aware GAN Compression}, auth

52 Nov 06, 2022
This package implements the algorithms introduced in Smucler, Sapienza, and Rotnitzky (2020) to compute optimal adjustment sets in causal graphical models.

optimaladj: A library for computing optimal adjustment sets in causal graphical models This package implements the algorithms introduced in Smucler, S

Facundo Sapienza 6 Aug 04, 2022
Go from graph data to a secure and interactive visual graph app in 15 minutes. Batteries-included self-hosting of graph data apps with Streamlit, Graphistry, RAPIDS, and more!

✔️ Linux ✔️ OS X ❌ Windows (#39) Welcome to graph-app-kit Turn your graph data into a secure and interactive visual graph app in 15 minutes! Why This

Graphistry 107 Jan 02, 2023
DTCN IJCAI - Sequential prediction learning framework and algorithm

DTCN This is the implementation of our paper "Sequential Prediction of Social Me

Bobby 2 Jan 24, 2022
DC3: A Learning Method for Optimization with Hard Constraints

DC3: A learning method for optimization with hard constraints This repository is by Priya L. Donti, David Rolnick, and J. Zico Kolter and contains the

CMU Locus Lab 57 Dec 26, 2022
DeepLabv3+:Encoder-Decoder with Atrous Separable Convolution语义分割模型在tensorflow2当中的实现

DeepLabv3+:Encoder-Decoder with Atrous Separable Convolution语义分割模型在tensorflow2当中的实现 目录 性能情况 Performance 所需环境 Environment 注意事项 Attention 文件下载 Download

Bubbliiiing 31 Nov 25, 2022
TransMorph: Transformer for Medical Image Registration

TransMorph: Transformer for Medical Image Registration keywords: Vision Transformer, Swin Transformer, convolutional neural networks, image registrati

Junyu Chen 180 Jan 07, 2023
QA-GNN: Question Answering using Language Models and Knowledge Graphs

QA-GNN: Question Answering using Language Models and Knowledge Graphs This repo provides the source code & data of our paper: QA-GNN: Reasoning with L

Michihiro Yasunaga 434 Jan 04, 2023
Public Models considered for emotion estimation from EEG

Emotion-EEG Set of models for emotion estimation from EEG. Composed by the combination of two deep-learing models learning together (RNN and CNN) with

Victor Delvigne 21 Dec 23, 2022
This is the official code release for the paper Shape and Material Capture at Home

This is the official code release for the paper Shape and Material Capture at Home. The code enables you to reconstruct a 3D mesh and Cook-Torrance BRDF from one or more images captured with a flashl

89 Dec 10, 2022
Collection of TensorFlow2 implementations of Generative Adversarial Network varieties presented in research papers.

TensorFlow2-GAN Collection of tf2.0 implementations of Generative Adversarial Network varieties presented in research papers. Model architectures will

41 Apr 28, 2022
No-Reference Image Quality Assessment via Transformers, Relative Ranking, and Self-Consistency

This repository contains the implementation for the paper: No-Reference Image Quality Assessment via Transformers, Relative Ranking, and Self-Consiste

Alireza Golestaneh 75 Dec 30, 2022
Research on controller area network Intrusion Detection Systems

Group members information Member 1: Lixue Liang Member 2: Yuet Lee Chan Member 3: Xinruo Zhang Member 4: Yifei Han User Manual Generate Attack Packets

Roche 4 Aug 30, 2022