niftynet.layer.subpixel module

class SubPixelLayer(upsample_factor=2, n_output_chns=1, kernel_size=3, acti_func='tanh', feature_normalization=None, group_size=-1, with_bias=True, padding='REFLECT', use_icnr=False, use_avg=False, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, name='subpixel_cnn')[source]

Bases: niftynet.layer.base_layer.TrainableLayer

Implementation of:

SubPixel Convolution initialised with ICNR initialisation and followed by an AveragePooling

Limitations:

If ICNR initialization is used then the upsample factor MUST be an integer

Shi, W., Caballero, J., Huszár, F., Totz, J., Aitken, A.P., Bishop, R., Rueckert, D. and Wang, Z., 2016.

Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network.

In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 1874-1883).

https://www.cv-foundation.org/openaccess/content_cvpr_2016/ papers/Shi_Real-Time_Single_Image_CVPR_2016_paper.pdf ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Aitken, A., Ledig, C., Theis, L., Caballero, J., Wang, Z. and Shi, W., 2017.

Checkerboard artifact free sub-pixel convolution: A note on sub-pixel convolution, resize convolution and convolution resize.

arXiv preprint arXiv:1707.02937.

Sugawara, Y., Shiota, S. and Kiya, H., 2018, October.

Super-resolution using convolutional neural networks without any checkerboard artifacts.

In 2018 25th IEEE International Conference on Image Processing (ICIP) (pp. 66-70). IEEE.

__init__(upsample_factor=2, n_output_chns=1, kernel_size=3, acti_func='tanh', feature_normalization=None, group_size=-1, with_bias=True, padding='REFLECT', use_icnr=False, use_avg=False, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, name='subpixel_cnn')[source]
Parameters:
  • upsample_factor – zoom-factor/image magnification factor
  • n_output_chns – the desired ammount of channels for the

upsampled image :param kernel_size: the size of the convolutional kernels :param acti_func: activation function applied to first N - 1 layers :param feature_normalization: the type of feature normalization (e.g. batch, instance or group norm. Default None. :param group_size: size of the groups if groupnorm is chosen. :param with_bias: incorporate bias parameters in convolutional layers :param padding: padding applied in convolutional layers :param use_icnr: whether to use Aitken et al. initialization :param use_avg: whether to use Sugawara et al. post-processing

layer_op(lr_image, is_training=True, keep_prob=1.0)[source]