Code Monkey home page Code Monkey logo

segtransvae's Introduction

SegTransVAE: Hybrid CNN - Transformer with Regularization for medical image segmentation

This repo is the official implementation for SegTransVAE.

SegTransVAE

Here is the network architecture of SegTransVAE, a hybrid CNN-Transformer-VAE for medical image segmentation
SegTransVAE

Requirements

  • python 3.8
  • pytorch 1.8.0
  • monai 0.6
  • pytorch lightning
  • nibabel
  • itk

Data

After downloading BraTS 2021 dataset, create a json file, which contains the path to images and the correspoding labels as follow

Then, use data/brats.py file to read the data by monai.

Training

Run the training script on BraTS dataset. Change the model hyperparameters setup in trainer.py. When everything is finish, go to lightning_train.py to config multi-gpu training or half-precision training.

python lightning_train.py --exp EXP 

EXP is the name of the experiment and it will save all the checkpoint and the logs based on that experiment name.

Testing

After finish training, you can test your model by replace the path to the checkpoints in lightning_test.py

python lightning_test.py

Then the evaluation metric will print in the terminal, including dice score and 95% hausdorff distance.

Quantitative result

Quantitive comparison of performance on BraTS 2021 (our test set)

Quantitive comparison of performance on KiTS19 with 5-fold cross validation.

Visual Comparision with SOTA Methods

Visual Comparision of our method on BraTS 2021 and KiTS19 dataset with 3D U-Net, SegresnetVAE and UNETR. brats

kits

Complexity

The complexity of SegTransVAE is compared to other models in terms of the number of parameters and the averaged inference time. The benchmark is calculated based on the input size of (4, 128, 128, 128)

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.