niftynet.network.unet module¶
-
class
UNet3D
(num_classes, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, acti_func='prelu', name='UNet')[source]¶ Bases:
niftynet.layer.base_layer.TrainableLayer
- ### Description
- reimplementation of 3D U-net
- Çiçek et al., “3D U-Net: Learning dense Volumetric segmentation from sparse annotation”, MICCAI ‘16
### Building blocks [dBLOCK] - Downsampling UNet Block [uBLOCK] - Upsampling UNet Block [nBLOCK] - UNet Block with no final operation [CROP] - Cropping layer
### Diagram
- INPUT –> [dBLOCK] - - - - - - - - - - - - - - - - [nBLOCK] –> [CROP] –> OUTPUT
-
- [dBLOCK] - - - - - - - - - - - - [uBLOCK]
-
- [dBLOCK] - - - - - - - [uBLOCK]
-
——–[uBLOCk] ——
- ### Constraints
- Image size - 4 should be divisible by 8
- Label size should be more than 88
- border is 44
-
__init__
(num_classes, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, acti_func='prelu', name='UNet')[source]¶ Parameters: - num_classes – int, number of final output channels
- w_initializer – weight initialisation for network
- w_regularizer – weight regularisation for network
- b_initializer – bias initialisation for network
- b_regularizer – bias regularisation for network
- acti_func – activation function to use
- name – layer name
-
class
UNetBlock
(func, n_chns, kernels, w_initializer=None, w_regularizer=None, with_downsample_branch=False, acti_func='relu', name='UNet_block')[source]¶ Bases:
niftynet.layer.base_layer.TrainableLayer
-
__init__
(func, n_chns, kernels, w_initializer=None, w_regularizer=None, with_downsample_branch=False, acti_func='relu', name='UNet_block')[source]¶ Parameters: - func – string, type of operation to perform after convolution (Downsampling, Upsampling, None)
- n_chns – array, number of output channels for each convolutional layer of the block
- kernels – array, kernel sizes for each convolutional layer of the block
- w_initializer – weight initialisation of convolutional layers
- w_regularizer – weight regularisation of convolutional layers
- with_downsample_branch – boolean, returns also the tensor before func is applied
- acti_func – activation function to use
- name – layer name
-