All Projects → lee-zq → 3dunet Pytorch

lee-zq / 3dunet Pytorch

3DUNet implemented with pytorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to 3dunet Pytorch

Relaynet pytorch
Pytorch Implementation of retinal OCT Layer Segmentation (with trained models)
Stars: ✭ 63 (-25%)
Mutual labels:  segmentation
Pointclouddatasets
3D point cloud datasets in HDF5 format, containing uniformly sampled 2048 points per shape.
Stars: ✭ 80 (-4.76%)
Mutual labels:  segmentation
Dlcv for beginners
《深度学习与计算机视觉》配套代码
Stars: ✭ 1,244 (+1380.95%)
Mutual labels:  segmentation
Multiclass Semantic Segmentation Camvid
Tensorflow 2 implementation of complete pipeline for multiclass image semantic segmentation using UNet, SegNet and FCN32 architectures on Cambridge-driving Labeled Video Database (CamVid) dataset.
Stars: ✭ 67 (-20.24%)
Mutual labels:  segmentation
Cnn Paper2
🎨 🎨 深度学习 卷积神经网络教程 :图像识别,目标检测,语义分割,实例分割,人脸识别,神经风格转换,GAN等🎨🎨 https://dataxujing.github.io/CNN-paper2/
Stars: ✭ 77 (-8.33%)
Mutual labels:  segmentation
Prin
Pointwise Rotation-Invariant Network (AAAI 2020)
Stars: ✭ 81 (-3.57%)
Mutual labels:  segmentation
Tensorflow Fcn
An Implementation of Fully Convolutional Networks in Tensorflow.
Stars: ✭ 1,116 (+1228.57%)
Mutual labels:  segmentation
Rgbd semantic segmentation pytorch
PyTorch Implementation of some RGBD Semantic Segmentation models.
Stars: ✭ 84 (+0%)
Mutual labels:  segmentation
Seg By Interaction
Unsupervised instance segmentation via active robot interaction
Stars: ✭ 78 (-7.14%)
Mutual labels:  segmentation
Litiv
C++ implementation pool for computer vision R&D projects.
Stars: ✭ 82 (-2.38%)
Mutual labels:  segmentation
Deep Segmentation
CNNs for semantic segmentation using Keras library
Stars: ✭ 69 (-17.86%)
Mutual labels:  segmentation
Mit Deep Learning
Tutorials, assignments, and competitions for MIT Deep Learning related courses.
Stars: ✭ 8,912 (+10509.52%)
Mutual labels:  segmentation
Handy
Hand detection software built with OpenCV.
Stars: ✭ 81 (-3.57%)
Mutual labels:  segmentation
Torch Points3d
Pytorch framework for doing deep learning on point clouds.
Stars: ✭ 1,135 (+1251.19%)
Mutual labels:  segmentation
Vnet Tensorflow
Tensorflow implementation of the V-Net architecture for medical imaging segmentation.
Stars: ✭ 84 (+0%)
Mutual labels:  segmentation
Pointcnn
PointCNN: Convolution On X-Transformed Points (NeurIPS 2018)
Stars: ✭ 1,120 (+1233.33%)
Mutual labels:  segmentation
Fcn.tensorflow
Tensorflow implementation of Fully Convolutional Networks for Semantic Segmentation (http://fcn.berkeleyvision.org)
Stars: ✭ 1,230 (+1364.29%)
Mutual labels:  segmentation
Brats17
Patch-based 3D U-Net for brain tumor segmentation
Stars: ✭ 85 (+1.19%)
Mutual labels:  segmentation
Caffe Model
Caffe models (including classification, detection and segmentation) and deploy files for famouse networks
Stars: ✭ 1,258 (+1397.62%)
Mutual labels:  segmentation
Cws
Source code for an ACL2016 paper of Chinese word segmentation
Stars: ✭ 81 (-3.57%)
Mutual labels:  segmentation

3DUNet implemented with pytorch

Introduction

The repository is a 3DUNet implemented with pytorch, referring to this project. I have redesigned the code structure and used the model to perform liver and tumor segmentation on the lits2017 dataset.
paper: 3D U-Net: Learning Dense Volumetric Segmentation from Sparse Annotation

Requirements:

pytorch >= 1.1.0
torchvision
SimpleITK
Tensorboard
Scipy

Code Structure

├── config.py        # Configuration information for training and testing
├── dataset          # Training and testing dataset
│   ├── dataset_lits_faster.py 
│   ├── dataset_lits.py
│   └── test_dataset.py
├── models           # Model design
│   ├── nn
│   └── Unet.py
├── output           # Trained model
├── preprocess
│   └── preprocess_LiTS.py
├── test.py          # Test code
├── train_faster.py  # Quick training code
├── train.py         # Standard training code
└── utils            # Some related tools
    ├── common.py
    ├── init_util.py
    ├── logger.py
    ├── metrics.py

Quickly Start

1) LITS2017 dataset preprocessing:

  1. Download dataset from google drive: Liver Tumor Segmentation Challenge.
    Or from my share: https://pan.baidu.com/s/1WgP2Ttxn_CV-yRT4UyqHWw Extraction code:hfl8
  2. Then you need decompress the dataset. It is recommended to use batch1(0~27) of the LiTS dataset as the testset and batch2(28~130) as the trainset. Please put the volume data and segmentation labels of trainset and testset into different local folders, such as:
raw_dataset:
    ├── LiTS_batch1  # (0~27)
    │   ├── data
    │   │   ├── volume-0.nii
    │   │   ├── volume-10.nii ...
    │   └── label
    │       ├── segmentation-0.nii
    │       ├── segmentation-10.nii ...
    │       
    ├── LiTS_batch2 # (28~130)
    │   ├── data
    │   │   ├── volume-28.nii
    │   │   ├── volume-29.nii ...
    │   └── label
    │       ├── segmentation-28.nii
    │       ├── segmentation-29.nii ...
  1. Finally, you need to change the root path of the volume data and segmentation labels in preprocess/preprocess_LiTS.py, such as:
    row_dataset_path = './raw_dataset/LiTS_batch2/'  # path of origin dataset
    fixed_dataset_path = './fixed_data/'  # path of fixed(preprocessed) dataset
  1. Run python preprocess/preprocess_LiTS.py
    If nothing goes wrong, you can see the following files in the dir ./fixed_data
│  train_name_list.txt
│  val_name_list.txt
│
├─data
│      volume-28.nii
│      volume-29.nii
│      volume-30.nii
│      ...
└─label
        segmentation-28.nii
        segmentation-29.nii
        segmentation-30.nii
        ...

2) Training 3DUNet

  1. Firstly, you should change the some parameters in config.py,especially, please set --dataset_path to ./fixed_data
    All parameters are commented in the file config.py.
  2. Secondely,run python train.py --save model_name
  3. Besides, you can observe the dice and loss during the training process in the browser through tensorboard --logdir ./output/model_name.

In addition, during the training process you will find that loading train data is time-consuming, you can use train_faster.py to train model. train_faster.py calls ./dataset/dataset_lits_faster.py, which will crop multiple training samples from an input sample to form a batch for quickly training.

3) Testing

run test.py
Please pay attention to path of trained model and cut parameters in test.py.
(Since the calculation of the 3D convolution operation is too large, I use a sliding window to block the input tensor before prediction, and then stitch the results to get the final result. The size of the sliding window can be set by yourself in test.py)

After the test, you can get the test results in the corresponding folder:./output/model_name/result

You can also read my Chinese introduction about this 3DUNet project here.
If you have any suggestions or questions, welcome to open an issue to communicate with me.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].