niftynet.network.deepmedic module

class DeepMedic(num_classes, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, acti_func='prelu', name='DeepMedic')[source]

Bases: niftynet.network.base_net.BaseNet

### Description reimplementation of DeepMedic:

Kamnitsas et al., “Efficient multi-scale 3D CNN with fully connected CRF for accurate brain lesion segmentation”, MedIA ‘17

### Building blocks [CONV] - 3x3x3 convolutional layer [denseCONV] - 1x1x1 convolutional layer

### Diagram INPUT –> CROP ——-> [CONV]x8 ——> [SUM] —-> [denseCONV]x3 –> OUTPUT

DOWNSAMPLE —> [CONV]x8 —> UPSAMPLE

### Constraints: - The downsampling factor (d_factor) should be odd - Label size = [(image_size / d_factor) - 16]* d_factor - Image size should be divisible by d_factor

# Examples: - Appropriate configuration for training: image spatial window size = 57, label spatial window size = 9, d_ factor = 3 - Appropriate configuration for inference: image spatial window size = 105, label spatial window size = 57, d_ factor = 3

__init__(num_classes, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, acti_func='prelu', name='DeepMedic')[source]
Parameters:
  • num_classes – int, number of channels of output
  • 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
layer_op(images, is_training, layer_id=-1, **unused_kwargs)[source]
Parameters:
  • images – tensor, input to the network, size should be divisible by d_factor
  • is_training – boolean, True if network is in training mode
  • layer_id – not in use
  • unused_kwargs
Returns:

tensor, network output