niftynet.network.simulator_gan module¶
-
class
SimulatorGAN
(name='simulator_GAN')[source]¶ Bases:
niftynet.layer.gan_blocks.GANImageBlock
- ### Description
- implementation of
- Hu et al., “Freehand Ultrasound Image Simulation with Spatially-Conditioned Generative Adversarial Networks”, MICCAI RAMBO 2017 https://arxiv.org/abs/1707.05392
### Building blocks [GENERATOR] - See ImageGenerator below [DISCRIMINATOR] - See ImageDiscriminator below Note: See niftynet.layer.gan_blocks for layer_op
### Diagram
RANDOM NOISE –> [GENERATOR] –> [DISCRIMINATOR] –> fake logits TRAINING SET ——————> [DISCRIMINATOR] –> real logits
### Constraints
-
class
ImageGenerator
(name)[source]¶ Bases:
niftynet.layer.gan_blocks.BaseGenerator
- ### Description
- implementation of generator from
- Hu et al., “Freehand Ultrasound Image Simulation with Spatially-Conditioned Generative Adversarial Networks”, MICCAI RAMBO 2017 https://arxiv.org/abs/1707.05392
### Building blocks [FC] - Fully connected layer [CONV] - Convolutional layer, conditioning is concatenated to input before the convolution
(if conditioning is used) kernel size = 3, activation = relu- [UPCONV] - Upsampling block composed of upsampling deconvolution (stride 2, kernel size = 3,
- activation = relu) and concatenation of conditioning
[fCONV] - Final convolutional layer, with no conditioning. Kernel size = 3, activation = tanh
### Diagram
RANDOM NOISE –> [FC] –> [CONV] –> [UPCONV]x3 –> [fCONV] –> OUTPUT IMAGE
### Constraints
-
layer_op
(random_source, image_size, conditioning, is_training)[source]¶ Parameters: - random_source – tensor, random noise to start generation
- image_size – output image size
- conditioning – tensor, conditioning information (e.g. coordinates in physical space)
- is_training – boolean, True if network is in training mode
Returns: tensor, generated image
-
class
ImageDiscriminator
(name)[source]¶ Bases:
niftynet.layer.gan_blocks.BaseDiscriminator
- ### Description
- implementation of discrimator from
- Hu et al., “Freehand Ultrasound Image Simulation with Spatially-Conditioned Generative Adversarial Networks”, MICCAI RAMBO 2017 https://arxiv.org/abs/1707.05392
### Building blocks [FEATURE BLOCK] - Convolutional layer (kernel size = 5, activation = selu)
- residual convolutiona layer (kernel size = 3, activation = selu, batch norm)
- convolutional layer (kernel size = 3, activation = selu, batch norm)
- [DOWN BLOCK] - Downsampling block with residual connections:
- Downsampling convolutional layer (stride = 2, kernel size = 3, activation = selu, batch norm) + residual convolutiona layer (kernel size = 3, activation = selu, batch norm) + convolutional layer (kernel size = 3, activation = selu, batch norm)
[FC] - Fully connected layer
If conditioning is used, it gets concatenated to the image at the discriminator input
### Diagram
INPUT IMAGE –> [FEATURE BLOCK] –> [DOWN BLOCK]x5 –> [FC] –> OUTPUT LOGITS
### Constraints