yu-to-msk / keras_bayesian_unet

Bayesian U-Net for Keras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bayesian U-Net for Keras

This is a Keras re-implementation for Bayesian U-Net

Currently, this repository only supports epistemic uncertainty...

Requirements

  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN
  • Keras and TensorFlow

Installation

  • Install from this repository
git clone https://github.com/yuta-hi/keras_bayesian_unet
cd keras_bayesian_unet
pip install .

Usage

  • Bayesian U-Net
# 2D
from keras_bcnn.models import BayesianUNet2D
input_shape = (512, 512, 1)
output_channles = 23
model = BayesianUNet2D(input_shape, output_channles).build()

# 3D
from keras_bcnn.models import BayesianUNet3D
input_shape = (128, 128, 128, 1)
output_channles = 23
model = BayesianUNet3D(input_shape, output_channles).build()
  • MC sampler
from keras_bcnn.models import MCSampler
mc_iteration = 10
sampler = MCSampler(model, mc_iteration).build()

Related repositories

About

Bayesian U-Net for Keras

License:MIT License


Languages

Language:Python 100.0%