DilatedNoduleNet

Architercture with dilated convolutions for 3D images segmentation implemented on tensorflow.

class radio.models.DilatedNoduleNet(*args, **kwargs)[source]

Bases: radio.dataset.dataset.models.tf.base.TFModel

Implementation of custom encoder-decoder architecture with dilated convolutions.

Architecture is inspired by VNet (Milletari et al., https://arxiv.org/abs/1606.04797).

Configuration

inputs : dict
dict with keys ‘images’ and ‘masks’ (see _make_inputs())
body : dict
num_blocks : int
number of encoder/decoder blocks (default=4)
filters : list of int
number of filters in each block (default=[128, 256, 512, 1024])
head : dict
num_classes : int
number of semantic classes
classmethod body(inputs, name='body', **kwargs)[source]

Base layers.

Parameters:
  • inputs (tf.Tensor) – input tensor
  • filters (tuple of int) – number of filters in encoder_block
  • name (str) – scope name
Returns:

Return type:

tf.Tensor

build_config(names=None)[source]

Build config.

classmethod central_block(inputs, filters, name, **kwargs)[source]

Block that situated between encoder and decoder branches.

Block consists of 1x1x1 followed by 3x3x3. Note that 3x3x3 convolution can contain several branches with different dilation rate.

Parameters:
  • inputs (tf.Tensor) – input tensor
  • filters (int) – number of output filters
  • name (str) – scope name
Returns:

Return type:

tf.Tensor

classmethod decoder_block(inputs, filters, name, **kwargs)[source]

3x3 convolution and 2x2 transposed convolution or upsampling

Each of two 3x3x3 convolutions contains several branches with different dilation rate.

Parameters:
  • inputs (tuple(tf.Tensor, tf.Tensor)) – two input tensors
  • filters (int) – number of output filters
  • name (str) – scope name
Returns:

Return type:

tf.Tensor

classmethod default_config()[source]

Default config.

classmethod dilated_branches(inputs, filters, kernel_size, dilation_rate, name, **kwargs)[source]

Convolutional block with parallel branches having different dilation rate.

Parameters:
  • inputs (tf.Tensor) – input tensor
  • filters (tuple(int, ..)) – number of filters corresponding to branches with different dilation rate.
  • kernel_size (tuple(int, ..)) – size of convolutional kernel corresponding to branches with different dilation rate. Kernel size is considered to be the same along [zyx] dimensions.
  • dilation_rate (tuple(int, ..)) – dilation rate for convolutional branches. Dilation rate is considered to be the same along [zyx] dimensions.
  • activation (tensorflow activation function) –
  • padding (str) – padding to use in convolution operation. Can be ‘same’ or ‘valid’.
  • is_training (bool or bool tensor) – indicator of training or prediction mode.
  • name (str) – name of the block that will be used as argument of tf.variable_scope.
Returns:

Return type:

tf.Tensor

classmethod encoder_block(inputs, filters, name, **kwargs)[source]

Two 3x3x3 convolutions and 2x2x2 max pooling with stride 2.

Each of two 3x3x3 convolutions contains several branches with different dilation rate.

Parameters:
  • inputs (tf.Tensor) – input tensor
  • filters (int) – number of output filters
  • name (str) – scope name
Returns:

Return type:

tf.Tensor

classmethod head(inputs, num_classes, name='head', **kwargs)[source]

Conv block followed by 1x1 convolution.

Parameters:
  • inputs (tf.Tensor) – input tensor
  • num_classes (int) – number of classes (and number of filters in the last 1x1 convolution)
  • name (str) – scope name
Returns:

Return type:

tf.Tensor