tfmri.models.UNet2D

class UNet2D(*args, **kwargs)[source]

Bases: tensorflow_mri.python.models.conv_endec.UNet

2D U-Net model.

Parameters
  • filters – A list of int. The number of filters for convolutional layers at each scale. The number of scales is inferred as len(filters).

  • kernel_size – An integer or tuple/list of 2 integers, specifying the size of the convolution window. Can be a single integer to specify the same value for all spatial dimensions.

  • pool_size – The pooling size for the pooling operations. Defaults to 2.

  • block_depth – The number of layers in each convolutional block. Defaults to 2.

  • use_deconv – If True, transpose convolution (deconvolution) will be used instead of up-sampling. This increases the amount memory required during training. Defaults to False.

  • activation – A callable or a Keras activation identifier. Defaults to 'relu'.

  • kernel_initializer – A tf.keras.initializers.Initializer or a Keras initializer identifier. Initializer for convolutional kernels. Defaults to 'VarianceScaling'.

  • bias_initializer – A tf.keras.initializers.Initializer or a Keras initializer identifier. Initializer for bias terms. Defaults to 'Zeros'.

  • kernel_regularizer – A tf.keras.initializers.Regularizer or a Keras regularizer identifier. Regularizer for convolutional kernels. Defaults to None.

  • bias_regularizer

    A tf.keras.initializers.Regularizer or a Keras regularizer identifier. Regularizer for bias terms. Defaults to None.

  • use_batch_norm

    If True, use batch normalization. Defaults to False.

  • use_sync_bn

    If True, use synchronised batch normalization. Defaults to False.

  • bn_momentum – A float. Momentum for the moving average in batch normalization.

  • bn_epsilon

    A float. Small float added to variance to avoid dividing by zero during batch normalization.

  • out_channels

    An int. The number of output channels.

  • out_kernel_size

    An int or a list of 2 int. The size of the convolutional kernel for the output layer. Defaults to kernel_size.

  • out_activation

    A callable or a Keras activation identifier. The output activation. Defaults to None.

  • use_global_residual

    A boolean. If True, adds a global residual connection to create a residual learning network. Defaults to False.

  • use_dropout

    A boolean. If True, a dropout layer is inserted after each activation. Defaults to False.

  • dropout_rate

    A float. The dropout rate. Only relevant if use_dropout is True. Defaults to 0.3.

  • dropout_type

    A str. The dropout type. Must be one of 'standard' or 'spatial'. Standard dropout drops individual elements from the feature maps, whereas spatial dropout drops entire feature maps. Only relevant if use_dropout is True. Defaults to 'standard'.

  • use_tight_frame

    A boolean. If True, creates a tight frame U-Net as described in [2]. Defaults to False.

  • **kwargs – Additional keyword arguments to be passed to base class.

References

1

Ronneberger, O., Fischer, P., & Brox, T. (2015, October). U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention (pp. 234-241). Springer, Cham.

2

Han, Y., & Ye, J. C. (2018). Framing U-Net via deep convolutional framelets: Application to sparse-view CT. IEEE transactions on medical imaging, 37(6), 1418-1429.

Creates a UNet model.