← Open Source
lee-zq

3DUNet-Pytorch

3DUNet implemented with pytorch.

Model DevelopmentArchitecturePython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
553
Stars
107
Forks
+0
This week
1
Contributors
Created 2020-03-14 · Updated 2026-07-19 · #17160 today
Top developers

lee-zq/3DUNet-Pytorch is ranked 17,160 with 553 stars.

Same-category comparison

lee-zq/3DUNet-Pytorch is ranked 17,160 among these 8 peers; facebookresearch/SymbolicMathematics is ranked 17,158.

Same-category comparison
NameRankMetrics
HannesStark/EquiBind17,150
Language:
Python
Stars:
553
Forks:
117
Description:
EquiBind: geometric deep learning for fast predictions of the 3D structure in which a small molecule binds to a protein.
broadinstitute/keras-rcnn17,154
Language:
Python
Stars:
553
Forks:
218
Description:
Keras package for region-based convolutional neural networks (RCNNs).
dome272/Wuerstchen17,157
Language:
Jupyter Notebook
Stars:
553
Forks:
34
Description:
Official implementation of Würstchen: Efficient Pretraining of Text-to-Image Models.
facebookresearch/SymbolicMathematics17,158
Language:
Python
Stars:
553
Forks:
121
Description:
Deep Learning for Symbolic Mathematics.
taki0112/Self-Attention-GAN-Tensorflow17,163
Language:
Python
Stars:
553
Forks:
147
Description:
Simple Tensorflow implementation of "Self-Attention Generative Adversarial Networks" (SAGAN).
uber-research/LaneGCN17,164
Language:
Python
Stars:
553
Forks:
132
Description:
[ECCV2020 Oral] Learning Lane Graph Representations for Motion Forecasting.
YudeWang/SEAM17,167
Language:
Python
Stars:
552
Forks:
94
Description:
Self-supervised Equivariant Attention Mechanism for Weakly Supervised Semantic Segmentation, CVPR 2020 (Oral).
dclambert/Python-ELM17,170
Language:
Python
Stars:
552
Forks:
249
Description:
Extreme Learning Machine implementation in Python.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryArchitecture
Keywords3D, Medical
Stars553
Forks107
Contributors1
Created date2020-03-14
Updated date2026-07-19
Stars in 1 day0
Stars in 7 days0
Rank17,160
Previous rank16,944
Rank change-216
7-day stars rank15,939
Previous 7-day stars rank15,947
7-day stars rank change8
Total stars rank17,899
Previous total stars rank17,873
Total stars rank change-26
CountryChina
README summary

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: Code Structure Quickly Start 1) LITS2017 dataset preprocessing: 1. Download dataset from google drive: Liver Tumor Segmentation Challenge. Or from my share: Extraction code:**hfl8** (The dataset consists of two parts

: batch1 and batch2) 2. Then you need decompress and merge batch1 and batch2 into one folder. It is recommended to use 20 samples(27\~46) of the LiTS dataset as the testset and 111 samples(0\~26 and 47\~131) as the trainset. Please put the volume data and segmentation labels of trainset and testset into different local folders, such as: 3. Finally, you need to change the root path of the volume data and segmentation labels in , such as

: 4. Firstly, you should change the some parameters in ,especially, please set to All parameters are commented in the file . Besides, you can observe the dice and loss during the training process in the browser through . (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 ) After the test, you can get the test results in the corresponding folder: You can also read my Chinese introduction about this 3DUNet project here. However, I no longer update the blog, I will try my best to update the github code. If you have any suggestions or questions, welcome to open an issue to communicate with me.

Frequently asked questions

How many stars and forks are recorded?

lee-zq/3DUNet-Pytorch has 553 stars and 107 forks.

What is the repository rank?

lee-zq/3DUNet-Pytorch is ranked 17,160.

What language and category are recorded?

lee-zq/3DUNet-Pytorch has 553 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

lee-zq/3DUNet-Pytorch is compared with facebookresearch/SymbolicMathematics, ranked 17,158 with 553 stars.

README

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

├── dataset          # Training and testing dataset
│   ├── dataset_lits_train.py 
│   ├── dataset_lits_val.py
│   ├── dataset_lits_test.py
│   └── transforms.py 
├── models           # Model design
│   ├── nn
│   │   └── module.py
│   │── ResUNet.py      # 3DUNet class
│   │── Unet.py      # 3DUNet class
│   │── SegNet.py      # 3DUNet class
│   └── KiUNet.py      # 3DUNet class
├── experiments           # Trained model
|── utils            # Some related tools
|   ├── common.py
|   ├── weights_init.py
|   ├── logger.py
|   ├── metrics.py
|   └── loss.py
├── preprocess_LiTS.py  # preprocessing for  raw data
├── test.py          # Test code
├── train.py         # Standard training code
└── config.py        # Configuration information for training and testing

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 (The dataset consists of two parts: batch1 and batch2)
  2. Then you need decompress and merge batch1 and batch2 into one folder. It is recommended to use 20 samples(27~46) of the LiTS dataset as the testset and 111 samples(0~26 and 47~131) as the trainset. Please put the volume data and segmentation labels of trainset and testset into different local folders, such as:
raw_dataset:
    ├── test  # 20 samples(27~46) 
    │   ├── ct
    │   │   ├── volume-27.nii
    │   │   ├── volume-28.nii
    |   |   |—— ...
    │   └── label
    │       ├── segmentation-27.nii
    │       ├── segmentation-28.nii
    |       |—— ...
    │       
    ├── train # 111 samples(0\~26 and 47\~131)
    │   ├── ct
    │   │   ├── volume-0.nii
    │   │   ├── volume-1.nii
    |   |   |—— ...
    │   └── label
    │       ├── segmentation-0.nii
    │       ├── segmentation-1.nii
    |       |—— ...
  1. Finally, you need to change the root path of the volume data and segmentation labels in ./preprocess_LiTS.py, such as:
    row_dataset_path = './raw_dataset/train/'  # path of origin dataset
    fixed_dataset_path = './fixed_data/'  # path of fixed(preprocessed) dataset
  1. Run python ./preprocess_LiTS.py
    If nothing goes wrong, you can see the following files in the dir ./fixed_data
│—— train_path_list.txt
│—— val_path_list.txt
│
|—— ct
│       volume-0.nii
│       volume-1.nii
│       volume-2.nii
│       ...
└─ label
        segmentation-0.nii
        segmentation-1.nii
        segmentation-2.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.

3) Testing 3DUNet

run test.py
Please pay attention to path of trained model 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 config.py)

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

You can also read my Chinese introduction about this 3DUNet project here. However, I no longer update the blog, I will try my best to update the github code.
If you have any suggestions or questions, welcome to open an issue to communicate with me.

Nearby in the ranking
Similar items