niftynet.network.unet_2d module¶
-
class
UNet2D
(num_classes, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, acti_func='relu', name='UNet2D')[source]¶ Bases:
niftynet.network.base_net.BaseNet
- ### Description
- A reimplementation of 2D UNet:
- Ronneberger et al., U-Net: Convolutional Networks for Biomedical Image Segmentation, MICCAI ‘15
### Building blocks [dBLOCK] - Downsampling Block (conv 3x3, Relu + conv 3x3, Relu + Max pooling) [BLOCK] - Two layer Block (conv 3x3, Relu + conv 3x3, Relu) [uBLOCK] - Upsampling Block (deconv 2x2 + crop and concat + conv 3x3, Relu + conv 3x3, Relu) [CONV] - Classification block (conv 1x1)
### Diagram
- INPUT –> [dBLOCK] - - - - - - - - - - - - - - - - [BLOCK] –> [CONV] –> OUTPUT
-
- [dBLOCK] - - - - - - - - - - - - [uBLOCK]
-
- [dBLOCK] - - - - - - - [uBLOCK]
-
- [dBLOCK] - - - [uBLOCK]
-
—-[BLOCk] —-
### Constraints
-
class
TwoLayerConv
(n_chns, conv_params)[source]¶ Bases:
niftynet.layer.base_layer.TrainableLayer
Two convolutional layers, number of output channels are
n_chns
for both of them.–conv–conv–
-
class
CropConcat
(name='crop_concat')[source]¶ Bases:
niftynet.layer.base_layer.Layer
This layer concatenates two input tensors, the first one is cropped and resized to match the second one.
This layer assumes the same amount of differences in every spatial dimension in between the two tensors.