MakeUnet

MakeUnet[nClasses,dimIn]

Generates a UNET with one channel as input and nClasses as output.

MakeUnet[nChannels,nClasses,dimIn]

Generates a UNET with nChannels as input and nClasses as output. The number of features of the first convolution layer is set with the FeatureSchedule option. The data dimensions can be 2D or 3D and each of the dimensions should be 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 or 256. However dimensions can be different based on the network depth and the block type. The implemented block types are "Conv", "UNet", "ResNet", "DenseNet", "Inception", or "U2Net".

Details
Details and Options Details and Options
QMRITOOLS SYMBOL
QMRITools`
QMRITools`

MakeUnet

MakeUnet[nClasses,dimIn]

Generates a UNET with one channel as input and nClasses as output.

MakeUnet[nChannels,nClasses,dimIn]

Generates a UNET with nChannels as input and nClasses as output. The number of features of the first convolution layer is set with the FeatureSchedule option. The data dimensions can be 2D or 3D and each of the dimensions should be 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 or 256. However dimensions can be different based on the network depth and the block type. The implemented block types are "Conv", "UNet", "ResNet", "DenseNet", "Inception", or "U2Net".

Details

  • The following options can be given:
  • NetworkArchitecture"UNet"NetworkArchitecture is an option for MakeUnet. It defines the architecture of the network. It can be "UNet", "UNet+", or "UNet++". For "UNet+" or "UNet++" it can also be {arch, i} where i specifies how many of the top layers are connected to the mapping layer.
    BlockType"ResNet"BlockType is an option for MakeUnet. It specifies the type of block used in the network. It can be "Conv", "UNet", "ResNet", "DenseNet", "Inception", or "U2Net".
    ActivationType"GELU"ActivationType is an option for MakeUnet. It specifies which activation layer is used in the network. It can be "LeakyRELU" or any type allowed by a "name" definition in ElementwiseLayer.
    NormalizationType"Instance"NormalizationType is an option for MakeUnet. It specifies which normalization layer is used in the network. It can be "Batch" or "Instance" for either BatchNormalization or NormalizationLayer which is instance normalization.
    RescaleMethod"Conv"RescaleMethod is an option for MakeUnet. It specifies how the network rescales. It can be "Conv" or "Pool".
    CatenateMethod"Cat"CatenateMethod is an option for MakeUnet. It specifies how the network catenates the skip and upscale channel. It can be "Tot", or "Cat".
    NetworkDepth5NetworkDepth is an option for MakeUnet. It specifies how deep the UNET will be.
    DownsampleScheduleAutomaticDownsampleSchedule is an option for MakeUnet. It defines how the data is downsampled for each of the deeper layers of the Unet. By default is is a factor two for each layer. A custom schedule for a 5 layer 3D Unet could be {{2,2,2},{1,2,2},{2,2,2},{1,2,2}, 1}. The deepest layer is always downsampled by 1 and therefore not needed to be specified.
    SettingScheduleAutomaticSettingSchedule is an option for MakeUnet. It defines the settings for the Unet blocks. If one setting is given it applied to all layers. If a list of settings is given the settings can be different per layer. The following settings are the default settings. "Unet": convolution block repetitions, 2, "ResNet" -> convolution block repetitions, 2, "DenseNet" -> {dense depth, block repetitions}, {4,2}, "Inception" -> {inception width, block repetitions}, {4,2}, "U2Net"-> {Unet depth, downscale}, {5, True}.
    FeatureSchedule32FeatureSchedule is an option for MakeUnet. It defines how the number of features is up-sampled for each of the deeper layers of the Unet. By default it increases the number of features by a factor 2 each layer, i.e. {1, 2, 4, 8, 16}.
    DropoutRate0.2DropoutRate is an option for MakeUnet. It specifies how much dropout is used after each block. It is a value between 0 and 1, default is .2.
    MonitorFalseMonitor[expr,mon] generates a temporary monitor cell in which the continually updated current value of mon is displayed during the course of evaluation of expr.