code: def build_linknet(
      backbone,
      decoder_block,
      skip_connection_layers,
      decoder_filters=(256, 128, 64, 32, 16),
      n_upsample_blocks=5,
      classes=1,
      activation="sigmoid",
      use_batchnorm=True,
  ):
      input_ = backbone.input
      x = backbone.output
  
      # extract skip connections
      skips = [
          backbone.get_layer(name=i).output
          if isinstance(i, str)
          else backbone.get_layer(index=i).output
          for i in skip_connection_layers
      ]
  
      # add center block if previous operation was maxpooling (for vgg models)
      if isinstance(backbone.layers[-1], layers.MaxPooling2D):
          x = Conv3x3BnReLU(512, use_batchnorm, name="center_block1")(x)
          x = Conv3x3BnReLU(512, use_batchnorm, name="center_block2")(x)
  
      # building decoder blocks
      for i in range(n_upsample_blocks):
          if i < len(skips):
              skip = skips[i]
          else:
              skip = None
  
          x = decoder_block(
              decoder_filters[i], stage=i, use_batchnorm=use_batchnorm
          )(x, skip)
  
      # model head (define number of output classes)
      x = layers.Conv2D(
          filters=classes,
          kernel_size=(3, 3),
          padding="same",
          use_bias=True,
          kernel_initializer="glorot_uniform",
      )(x)
      x = layers.Activation(activation, name=activation)(x)
  
      # create keras model instance
      model = models.Model(input_, x)
  
      return model
  
file_path: segmentation_models/segmentation_models/models/linknet.py
imports: from keras_applications import get_submodules_from_kwargs
  from ._common_blocks import Conv2dBn
  from ._utils import freeze_model, filter_keras_submodules
  from ..backbones.backbones_factory import Backbones
label_desc: Use image node_id 6 for calling a global function with example usage: build_linknet(backbone, decoder_block, skip_connection_layers, decoder_filters, n_upsample_blocks, classes, activation, use_batchnorm) and returns: model