项目作者: EsmeYi

项目描述 :
Edge-aware U-Net with CRF-RNN layer for Medical Image Segmentation
高级语言: Python
项目地址: git://github.com/EsmeYi/UNet-CRF-RNN.git
创建时间: 2019-03-26T12:04:47Z
项目社区:https://github.com/EsmeYi/UNet-CRF-RNN

开源协议:

下载


U-Net with a CRF-RNN layer

This project aims at improving U-Net for medical images segmentation.
Our model was implemented using Tensorflow and Keras, and the CRF-RNN layer refers to this repo

Introducion

  • U-Net with CRF-RNN layer paper:
  1. UNet-CRF-RNN
  • Reference paper:
  1. U-Net
  2. FCN
  3. CRF-RNN

This repo provides an U-Net with the CRF-RNN layer, and also provides some extract models for comparison, like SegNet, FCN, vanilla U-Net and so on.

  1. modelFns = {'unet':Models.VanillaUnet.VanillaUnet,
  2. 'segnet':Models.Segnet.Segnet ,
  3. 'vgg_unet':Models.VGGUnet.VGGUnet ,
  4. 'vgg_unet2':Models.VGGUnet.VGGUnet2 ,
  5. 'fcn8':Models.FCN8.FCN8,
  6. 'fcn32':Models.FCN32.FCN32,
  7. 'crfunet':Models.CRFunet.CRFunet }

Usage

  • data hierarchy
  1. Use the Keras data generators to load train and test
  2. Image and label are in structure:
  3. train/
  4. img/
  5. 0/
  6. gt/
  7. 0/
  8. test/
  9. img/
  10. 0/
  11. gt/
  12. 0/
  • Training parameters

    1. '--batch_size', type=int, default=1, help='input batch size'
    2. '--learning_rate', type=float, default=0.0001, help='learning rate'
    3. '--lr_decay', type=float, default=0.9, help='learning rate decay'
    4. '--epoch', type=int, default=80, help='# of epochs'
    5. '--imSize', type=int, default=320, help='then crop to this size'
    6. '--iter_epoch', type=int, default=0, help='# of iteration as an epoch'
    7. '--num_class', type=int, default=2, help='# of classes'
    8. '--checkpoint_path', type=str, default='', help='where checkpoint saved'
    9. '--data_path', type=str, default='', help='where dataset saved. See loader.py to know how to organize the dataset folder'
    10. '--load_from_checkpoint', type=str, default='', help='where checkpoint saved'
  • Train your model

    1. python train.py --data_path ./datasets/ --checkpoint_path ./checkpoints/
  • Visualize the train loss, dice score, learning rate, output mask, and first layer convolutional kernels per iteration in tensorboard
    1. tensorboard tensorboard --logdir=./checkpoints
  • Evaluate your model

    1. python eval.py --data_path ./datasets/ --load_from_checkpoint ./checkpoints/model-xxxx

    Result

    • Dataset
    1. Hippocampus Segmentation: ADNI
    2. Hippocampus Segmentation: NITRC
    • Parameters
param value
batch_size 5
epoch 80
iter_epoch 10
imSize 320
learning_rate 0.001
lr_decay 0.9
  • Result

    model | IU | DSC | PA
    —| — | — | —
    CNN-CRF | 68.73% | 73.22% | 51.77%
    FCN-8s | 59.61% | 65.73% | 44.26%
    Segnet | 70.85% | 79.01% | 58.03%
    Vanilla U-Net | 75.42% | 83.49% | 72.18%
    U-Net-CRF | 78.00% | 85.77% | 79.05%
    Our method | 79.89% | 87.31% | 81.27%