Paper commentary
Fully Convolutional Networks for Semantic Segmentation
- Problem Semantic segmentation needs a class label for every pixel, and earlier convnet systems reached that output only through superpixels, region proposals or post-hoc refinement.
- Method Converts AlexNet, VGG16 and GoogLeNet into fully convolutional networks, fine-tunes them end-to-end, and adds skip links from pool4 and pool3 predictions to the coarse stride-32 output, with upsampling inside the network.
- Results FCN-8s reached 62.7 mean IU on the PASCAL VOC 2011 test set and 62.2 on the 2012 test set.
Why dense labels are hard for classification convnets
Semantic segmentation assigns a class to every pixel by labeling it with the class of the object or region that encloses it. Convnets had already moved from whole-image classification to localized tasks such as detection and keypoint prediction, so per-pixel output is the natural next step. Earlier segmentation systems built on convnets relied on superpixels, region proposals or post-hoc refinement, and many used small networks trained without supervised pre-training.
The core difficulty is a tension between semantics and location: deep layers capture what an object is, while local detail captures where its boundary lies. The study asks whether a convnet trained end-to-end on whole images, with none of those pipeline stages, can reach state-of-the-art segmentation.
What makes a network fully convolutional
Each layer is a three-dimensional array with height, width and a channel dimension, and a location in a deep layer is tied to the image region it sees, its receptive field. Convolution, pooling and activation functions act on local neighborhoods and depend only on relative spatial coordinates, which is the translation invariance the design relies on.
With input \(x_{ij}\) and output \(y_{ij}\) at location \((i,j)\), a layer with kernel size \(k\) and stride \(s\) computes: \[ y_{ij} = f_{ks}\left(\{x_{si+\delta_i,\, sj+\delta_j}\}_{0\le\delta_i,\delta_j\le k}\right) \] Here \(f_{ks}\) names the layer type, and stacked layers keep the same form, with kernel sizes and strides combined by the following rule.
\[ f_{ks}\circ g_{k's'} = (f\circ g)_{k'+(k-1)s',\; ss'} \] A network built only from such layers is a nonlinear filter, which the authors call a deep filter or fully convolutional network, and its output has the spatial size corresponding to its input.
The training loss is a sum over the spatial positions of the final layer: \[ \ell(x;\theta) = \sum_{ij} \ell'(x_{ij};\theta) \] Because the gradient of this sum is the sum of the per-position gradients, stochastic gradient descent on the whole-image loss matches stochastic gradient descent on the per-position loss, with every final-layer receptive field acting as one minibatch element.
When these receptive fields overlap heavily, computing layer by layer over a whole image is much cheaper than working patch by patch.
Speed of the convolutionalized AlexNet
Converting the fully connected layers into convolutions turns the classifier into a network that outputs a map of class scores instead of one nonspatial vector. The resulting maps match evaluating the original net on particular patches, but the overlapping computation is shared across them. On a typical GPU, AlexNet takes 1.2 ms for the classification scores of a 227×227 image, while the fully convolutional version takes 22 ms for a 10×10 grid of outputs from a 500×500 image, more than five times faster than the naive approach.
The converted network's output is coarser than the input, because subsampling shrinks it by the pixel stride of the output receptive fields, and the next steps have to recover full resolution.
Connecting coarse outputs to pixels
OverFeat's shift-and-stitch trick gets dense predictions from coarse outputs without interpolation, by shifting the input over every offset within the downsampling factor, running each shifted copy through the network and interlacing the results. The rarefied filter is defined as follows, with \(i\) and \(j\) zero-based: \[ f'_{ij} = \begin{cases} f_{i/s,\, j/s} & \text{if } s \text{ divides both } i \text{ and } j \\ 0 & \text{otherwise} \end{cases} \] Reducing subsampling in this way trades finer filter inputs against smaller receptive fields and longer computation, and shift-and-stitch keeps the receptive fields but stops filters from reaching scales finer than their design.
Upsampling by a factor \(f\) equals convolution with a fractional input stride of \(1/f\), so for integral \(f\) the natural choice is backwards convolution, also called deconvolution, with output stride \(f\). Its filter need not stay bilinear, since it can be learned, and a stack of deconvolution layers with activations can learn a nonlinear upsampling.
The authors found learning through upsampling more effective and efficient than shift-and-stitch, and in limited experiments shift-and-stitch gave a worse cost-to-improvement ratio than layer fusion.
Training recipe for dense labels
Training uses the PASCAL VOC 2011 segmentation challenge with a per-pixel multinomial logistic loss, and ground-truth pixels masked as ambiguous or difficult are ignored. The standard metric is mean IU, averaged over the classes including background, where \(n_{ij}\) counts pixels of class \(i\) predicted as class \(j\), \(n_{cl}\) is the number of classes and \(t_i=\sum_j n_{ij}\).
\[ \text{mean IU} = \frac{1}{n_{cl}} \sum_i \frac{n_{ii}}{t_i+\sum_j n_{ji}-n_{ii}} \]
All layers are fine-tuned by backpropagation through the whole network, starting from the ImageNet-trained classifier weights. Tuning only the output classifier reaches just 70% of the full fine-tuning performance, and training from scratch was judged infeasible given the time needed to learn the base classification networks. Fine-tuning takes three days on a single GPU for FCN-32s, and about one day each for the upgrades to FCN-16s and FCN-8s.
Optimization uses SGD with momentum and minibatches of 20 images, with fixed learning rates of 10−3 for FCN-AlexNet and 10−4 for FCN-VGG16, chosen by line search, and a separate rate for FCN-GoogLeNet. Momentum is 0.9, biases get twice the learning rate, and the class scoring layer is zero-initialized, since random initialization gave neither better performance nor faster convergence.
All models are trained and tested with Caffe on a single NVIDIA Tesla K40c.
Three classifiers adapted to segmentation
The authors adapt AlexNet, the 16-layer VGG net and GoogLeNet, and for GoogLeNet they keep only the final loss layer and drop the final average pooling layer. On the PASCAL VOC 2011 validation set, FCN-AlexNet reaches 39.8 mean IU, FCN-VGG16 56.0 and FCN-GoogLeNet 42.5. Forward times for a 500×500 input were 50 ms, 210 ms and 59 ms, averaged over 20 trials on an NVIDIA Tesla K40c, and the table gives these as best results at a fixed learning rate.
Each fine-tuned network reached about 75% of the state-of-the-art score, with the weakest model at the low end of that range. The authors describe FCN-VGG16 as already state-of-the-art at 56.0 mean IU on validation, against 52.6 on test from prior work [16], so the two figures come from different splits. Training on extra data raised the same model to 59.4 mean IU on a subset of validation.
Despite similar classification accuracy, the authors' own GoogLeNet implementation did not match the VGG16 segmentation result. That GoogLeNet is a reimplementation trained with less extensive data augmentation, reaching 68.5% top-1 and 88.4% top-5 ILSVRC accuracy.
Adding skip links from shallower layers
The stride-32 final prediction limits how much detail the upsampled output can show, so the skip architecture adds links that combine it with lower layers of finer stride. Shallower layers see fewer pixels, so their finer-scale predictions need fewer layers and can come from shallower outputs, and combining fine and coarse layers lets local predictions respect global structure.
FCN-16s adds a 1×1 convolution on pool4 to produce extra class predictions, and fuses it with the conv7 predictions at stride 32 by applying a 2× upsampling layer and summing both predictions. The 2× upsampling is initialized to bilinear interpolation and then learned, and the new pool4 parameters are zero-initialized so the net starts from its unmodified predictions.
FCN-16s is trained end-to-end starting from the parameters of FCN-32s, with the learning rate decreased by a factor of 100.
FCN-8s repeats the step with pool3, fusing it with a 2× upsampling of the pool4 and conv7 predictions. Max fusion was avoided because it made learning difficult due to gradient switching, so the predictions are summed.
What each fusion step adds on validation
On a 736-image subset of PASCAL VOC 2011 validation that avoids the extra training images, FCN-32s reaches 59.4 mean IU, FCN-16s 62.4 and FCN-8s 62.7. The stride-16 fusion adds 3.0 mean IU over FCN-32s, and the stride-8 step adds only a small further gain. The figure shows output from the 32, 16 and 8 pixel stride nets next to the ground truth, which is the visual side of these mean IU gains.
Pixel accuracy rises from 89.1 for FCN-32s to 90.0 for FCN-16s and 90.3 for FCN-8s. FCN-32s-fixed, where only the last layer is fine-tuned, reaches 45.4 mean IU, against 59.4 for FCN-32s learned end-to-end. Learning from pool4 alone performed poorly, and lowering the learning rate without the extra link gave an insignificant change that did not improve the output quality.
The authors stopped fusing at pool3, since fusion had reached diminishing returns on mean IU and in the visible detail, so lower layers were not fused.
Other routes to finer output
Smaller pooling strides are the most direct route to finer output, but for the VGG16 net, setting pool5 to stride 1 would need a 14×14 kernel in the converted fc6 to keep its receptive field. Such large filters were costly and hard to learn, and smaller filters above pool5 did not reach comparable performance. The authors suggest that initialization of the upper layers from ImageNet-trained weights may be important, as one possible explanation.
In limited experiments, shift-and-stitch cost more for its improvement than layer fusion did. The final model therefore relies on layer fusion, and shift-and-stitch is not part of it.
Whole-image training against patch sampling
Patchwise training draws random patches from the dataset, which can produce higher-variance batches, while whole-image training processes all receptive fields of an image together, which is cheaper but reduces the set of possible batches.
Sampling does not noticeably change the convergence rate relative to whole-image training, but it takes noticeably more time because more images are considered per batch. The figure plots the loss against iteration and against relative time for full images, 50% sampling and 25% sampling. Whole-image training is therefore used in the other experiments.
The authors estimate that rejection sampling still beats patchwise training when p is large enough, at least for p > 0.2 by their Section 3.1 numbers.
Training data, augmentation and class balance
The VOC 2011 segmentation training set has 1112 images, and Hariharan et al. labeled a larger set of 8498 PASCAL training images, which trained SDS. Training on the larger set raised FCN-VGG16 validation mean IU by 3.4 points, to 59.4.
Random mirroring and translational jitter of up to 32 pixels gave no noticeable improvement. Class balancing was judged unnecessary, because about three quarters of the labels are background.
PASCAL VOC 2011 and 2012 test results
On the PASCAL VOC 2011 test set, FCN-8s reaches 62.7 mean IU, against 52.6 for SDS and 47.9 for R-CNN. On the 2012 test set FCN-8s reaches 62.2 mean IU against 51.6 for SDS, a relative margin of 20% on mean IU. The inference time column gives about 50 s for SDS and about 175 ms for FCN-8s.
The authors report that inference time falls 114 times for the convnet alone, ignoring proposals and refinement, and 286 times overall. The table gives the timing without stating that SDS was measured on the same hardware, so the speedup compares reported times. The VOC test scores come from the test server, which provides only the mean IU metric.
NYUDv2 with depth inputs
NYUDv2 has 1449 RGB-D images with labels for 40 classes, and the authors use the standard split of 795 training and 654 testing images. RGB-only FCN-32s reaches 29.2 mean IU, and early fusion of depth as a fourth input channel reaches 30.5.
Gupta et al. report 28.6 mean IU on this benchmark, which the RGB-HHA FCN-16s score of 34.0 exceeds. The authors attribute the small benefit of early fusion to the difficulty of propagating useful gradients through the whole model.
SIFT Flow with joint semantic and geometric heads
The authors train a two-headed FCN-16s with a semantic and a geometric prediction layer, each with its own loss.
FCN-16s reaches 85.2 pixel accuracy, 51.7 mean accuracy, 39.5 mean IU and 76.1 frequency weighted IU on the semantic task, and 94.3 geometric accuracy. Three of the categories are absent from the test set, so only the categories present there are scored, and an earlier version of the paper reported a lower mean IU.
Limits of the evidence
The main results cover PASCAL VOC 2011 and 2012, NYUDv2, SIFT Flow and PASCAL-Context, and the skip comparisons use a 736-image validation subset. The authors judged training from scratch infeasible given the time needed to learn the base classification networks. The stride-32 output is coarse, which limits fine detail, and no smaller-filter re-architecture above pool5 matched the fused model.
The GoogLeNet variant did not match the VGG16 result, and early fusion of depth gave little benefit on NYUDv2. Max fusion made learning difficult because of gradient switching, and augmentation by mirroring and jitter gave no noticeable gain.
The Table 1 timings are for a 500×500 input averaged over 20 trials on a Tesla K40c, while the Table 3 inference time for FCN-8s is given without the same stated conditions, so the two should not be combined. The Table 1 values are best results at fixed learning rates, not the best achievable.
Paper info
- Authors
- Jonathan Long, Evan Shelhamer, Trevor Darrell
- Venue
- arXiv · Preprint
- First published
- 2014-11-14
- Added
- 2026-10-20
- Updated
- 2015-3-8
- Version
- v2
- arXiv
- 1411.4038
- Category
- cs.CV
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Jonathan Long, Evan Shelhamer, Trevor Darrell (2014). Fully Convolutional Networks for Semantic Segmentation. arXiv:1411.4038v2. https://arxiv.org/abs/1411.4038v2
BibTeX
@misc{long2014fully,
title = {{Fully Convolutional Networks for Semantic Segmentation}},
author = {Jonathan Long and Evan Shelhamer and Trevor Darrell},
year = {2014},
eprint = {1411.4038},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1411.4038v2}
}