Computer Vision Lab Models FCN ResNet-50

FCN ResNet-50

Fully convolutional network

Knowledge card: the first fully convolutional network for semantic segmentation.

SegmentationKnowledge card

ArchitectureFully convolutional network
TaskSegmentation
Training dataCOCO 2017 (subset, VOC categories)
the number of parameters35,322,218
FrameworkPyTorch
File size≈135 MB
LicenceBSD-3-Clause (torchvision code)
Where it runsKnowledge card only
Official sourcepytorch.org
Official weightsdownload.pytorch.org

Published metrics (from the official source, not measured by this site)

MetricValueEvaluation dataSource
mIoU60.5COCO val2017 subset (VOC categories)Source

Architecture diagram

Architecture diagram FCN ResNet-50InputH×W×3ResNet-50 (dilated conv4, conv5)output stride 8Features2048 × H/8 × W/8Conv 3×3, 512 + BN + ReLUDropout 0.1Conv 1×121 classesBilinear upsample ×8H×W×21Argmax per pixellabel mapAux FCN head on conv4training only
FCN ResNet-50 as implemented in torchvision: a ResNet-50 backbone with dilated convolution in the last two stages (output stride 8), a simple FCN head, then bilinear interpolation to the input size. The original network (Long et al. 2015) used VGG-16 with FCN-8s connections.
  • Input / output
  • Convolutional layer
  • Pooling / resolution change
  • Composite block
  • Memory / intermediate features
  • Output head
  • Loss / training only

Detailed model explanation

Idea and intuition

Classification networks used to end with fully connected layers that lose the spatial structure. Long and colleagues observed that a fully connected layer is equivalent to a convolution with a kernel the size of the input map, so they replaced them with 1×1 convolutions, and the network became “fully convolutional” (FCN), accepting an image of any size and outputting a score map for each class, which is then upsampled to the image resolution. This made it possible to turn any pre-trained classifier into a semantic segmentation model trained end to end.

Architecture

  • A ResNet-50 backbone; in the torchvision release the strides in the last two stages are replaced by dilated convolution, so the resolution stays at 1/8 instead of 1/32.
  • The FCN head: a 3×3 convolution, then Dropout, then a 1×1 convolution to the number of classes.
  • Bilinear upsampling to the input resolution.
  • In the original paper (on VGG), skip connections from higher-resolution layers (FCN-16s and FCN-8s) were added to improve the edges.

Mathematical formulation

The per-pixel cross-entropy loss:

\mathcal L = -\frac{1}{|\Omega|}\sum_{p\in\Omega}\log \frac{e^{z_{p,y_p}}}{\sum_{c}e^{z_{p,c}}}

where \Omega the set of pixels andz_{p,c} the score of class c at pixel p.

Performance

In torchvision: mIoU = 60.5 on a subset of COCO val2017 with the twenty VOC classes.

Strengths and limitations

  • Strength: the founding idea of all modern segmentation models (U-Net, DeepLab and others).
  • Strength: it accepts any input size.
  • Limitation: coarse edges, because the final map is low-resolution and then upsampled.
  • Limitation: limited global context; PSPNet and DeepLab addressed it with multi-scale pooling modules.

Uses

Teaching.

Runtime requirements

—

How to load

Not loaded.

References

  1. J. Long, E. Shelhamer, T. Darrell (2015).Fully convolutional networks for semantic segmentation. CVPR 2015. doi:10.1109/CVPR.2015.7298965

Related algorithms