Skip to content

Latest commit

 

History

History
60 lines (51 loc) · 1.6 KB

README.md

File metadata and controls

60 lines (51 loc) · 1.6 KB

PyTorch implementation of UNet++ (Nested U-Net)

MIT License

This repository contains code for a image segmentation model based on UNet++: A Nested U-Net Architecture for Medical Image Segmentation implemented in PyTorch.

Requirements

  • PyTorch 1.x or 0.41

Installation

  1. Create an anaconda environment.
conda create -n=<env_name> python=3.6 anaconda
conda activate <env_name>
  1. Install PyTorch.
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
  1. Install pip packages.
pip install -r requirements.txt

Training on ica dataset

Make sure to put the files as the following structure (e.g. the number of classes is 2):

inputs
└── <ica>
    ├── images
    |   ├── nj_100_1_LCA_RAO.png
    │   ├── nj_100_2_LCA_RAO.png
    │   ├── nj_100_1_LCA_RAO.png
    │   ├── ...
    |
    └── masks/0
        ├── nj_100_1_LCA_RAO.png
        ├── nj_100_2_LCA_RAO.png
        ├── nj_100_1_LCA_RAO.png
        ├── ...
  1. Train the model.
python train.py --dataset <dataset name> --arch NestedUNet --img_ext .jpg --mask_ext .png
  1. Evaluate.
python val.py --name <dataset name>_NestedUNet_woDS

Results

ica (512x512)

Here is the results on ica dataset (96x96) .

Model IoU Loss
ica_NestedUNet_1000 0.839 0.365
ica_NestedUNet_woDS 0.842 0.354