# DoDNet
**Repository Path**: sususu3/DoDNet
## Basic Information
- **Project Name**: DoDNet
- **Description**: No description available
- **Primary Language**: Python
- **License**: GPL-3.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-02-22
- **Last Updated**: 2022-02-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# DoDNet
This repo holds the pytorch implementation of DoDNet:
**DoDNet: Learning to segment multi-organ and tumors from multiple partially labeled datasets.**
(https://arxiv.org/pdf/2011.10217.pdf)
## Requirements
Python 3.7
PyTorch==1.4.0
[Apex==0.1](https://github.com/NVIDIA/apex)
[batchgenerators](https://github.com/MIC-DKFZ/batchgenerators)
## Usage
### 0. Installation
* Clone this repo
```
git clone https://github.com/jianpengz/DoDNet.git
cd DoDNet
```
### 1. MOTS Dataset Preparation
Before starting, MOTS should be re-built from the serveral medical organ and tumor segmentation datasets
Partial-label task | Data source
--- | :---:
Liver | [data](https://competitions.codalab.org/competitions/17094)
Kidney | [data](https://kits19.grand-challenge.org/data/)
Hepatic Vessel | [data](http://medicaldecathlon.com/)
Pancreas | [data](http://medicaldecathlon.com/)
Colon | [data](http://medicaldecathlon.com/)
Lung | [data](http://medicaldecathlon.com/)
Spleen | [data](http://medicaldecathlon.com/)
* Download and put these datasets in `dataset/0123456/`.
* Re-spacing the data by `python re_spacing.py`, the re-spaced data will be saved in `0123456_spacing_same/`.
The folder structure of dataset should be like
dataset/0123456_spacing_same/
├── 0Liver
| └── imagesTr
| ├── liver_0.nii.gz
| ├── liver_1.nii.gz
| ├── ...
| └── labelsTr
| ├── liver_0.nii.gz
| ├── liver_1.nii.gz
| ├── ...
├── 1Kidney
├── ...
### 2. Model
Pretrained model is available in [checkpoint](https://drive.google.com/file/d/1qj8dJ_G1sHiCmJx_IQjACQhjUQnb4flg/view?usp=sharing)
### 3. Training
* cd `a_DynConv/' and run
```
CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 --master_port=$RANDOM train.py \
--train_list='list/MOTS/MOTS_train.txt' \
--snapshot_dir='snapshots/dodnet' \
--input_size='64,192,192' \
--batch_size=2 \
--num_gpus=2 \
--num_epochs=1000 \
--start_epoch=0 \
--learning_rate=1e-2 \
--num_classes=2 \
--num_workers=8 \
--weight_std=True \
--random_mirror=True \
--random_scale=True \
--FP16=False
```
### 4. Evaluation
```
CUDA_VISIBLE_DEVICES=0 python evaluate.py \
--val_list='list/MOTS/MOTS_test.txt' \
--reload_from_checkpoint=True \
--reload_path='snapshots/dodnet/MOTS_DynConv_checkpoint.pth' \
--save_path='outputs/' \
--input_size='64,192,192' \
--batch_size=1 \
--num_gpus=1 \
--num_workers=2
```
### 5. Post-processing
```
python postp.py --img_folder_path='outputs/dodnet/'
```
### 6. Citation
If this code is helpful for your study, please cite:
```
@inproceedings{zhang2021dodnet,
title={DoDNet: Learning to segment multi-organ and tumors from multiple partially labeled datasets},
author={Zhang, Jianpeng and Xie, Yutong and Xia, Yong and Shen, Chunhua},
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
pages={},
year={2021}
}
```
### Contact
Jianpeng Zhang (james.zhang@mail.nwpu.edu.cn)