Skip to content

FCN

FCN class

dlf.models.fcn.FCN(
    feature_extractor,
    num_classes,
    output_shape,
    skip_layers=None,
    interpolation_bilinear=True,
    model_weights=None,
    summary=False,
    optimizer=None,
    loss=None,
    **kwargs
)

A implementation of a Fully Convolutional Network

Aliases

  • FCN
  • fcn

Arguments

  • feature_extractor: dict. A feature extractor
  • num_classes: int. Number of classes used for segmentation
  • output_shape: tuple or list. Output dimension (width, height) of the FCN
  • skip_layers: list of str, optional. A list of layer which should be used for FCN skip connections. Defaults to None.
  • interpolation_bilinear: bool, optional. If true bilinear instead of nearest is used as upsampling method. Defaults to True.
  • model_weights: str, optional. Path to the pretrained model weights. Defaults to None.
  • summary: bool, optional. If true a summary of the model will be printed to stdout. Defaults to False.
  • optimizer: list of dict, optional. Name of optimizer used for training.
  • loss: list of dict, optional. List of loss objects to build for this model. Defaults to None.

YAML Configuration

Example usage of a FCN model in an experiment configuration. This example initiaizes the ResNet50 from tf.keras.applications package as feature extractor and an input shape of 512x512x3. Three layer of ResNet50 where used as skip connection.

model:
    fcn:
        feature_extractor:
            model_name: ResNet50
            input_shape:
                - 512
                - 512
                - 3
        output_shape:
            - 512
            - 512
        skip_layers:
        - conv3_block4_out
        - conv4_block6_out
        - conv5_block1_out
        interpolation_bilinear: True
        num_classes: 7
        summary: True
        optimizer:
        - Adam:
            learning_rate: 0.0001