Skip to content
SR-Forge

FSRCNN Model

FSRCNN

Bases: Model

Fast Super-Resolution Convolutional Neural Network (FSRCNN).

An implementation of the model from the paper "Accelerating the Super-Resolution Convolutional Neural Network" by Dong et al.

Reference

https://arxiv.org/abs/1608.00367

__init__(channels: int = 1, upscale_factor: int = 3, non_linear_mapping_layers: int = 4, feature_dimensions: int = 56, feature_shrinking: int = 16)

Initializes the FSRCNN model.

Parameters:

Name Type Description Default
channels int

The number of input and output image channels (e.g., 1 for grayscale, 3 for RGB). Defaults to 1.

1
upscale_factor int

The target upscaling factor. Defaults to 3.

3
non_linear_mapping_layers int

The number of mapping layers (m in the paper). Defaults to 4.

4
feature_dimensions int

The number of feature dimensions in the extraction layer (d in the paper). Defaults to 56.

56
feature_shrinking int

The number of channels in the shrinking layer (s in the paper). Defaults to 16.

16

calculate_padding(kernel_size: int) -> int

Calculates padding for a 'same' convolution.

Parameters:

Name Type Description Default
kernel_size int

The size of the convolutional kernel.

required

Returns:

Name Type Description
int int

The padding required to keep the output dimensions the same as the input.

Raises:

Type Description
RuntimeError

If the kernel size is even.