Back to paper library
arXiv 2014CVPR 2015SegmentationPaper notes

FCN

Fully Convolutional Networks

Original paper

Fully Convolutional Networks for Semantic Segmentation

Paper authors

Jonathan Long · Evan Shelhamer · Trevor Darrell

Publication
CVPR 2015Conference
First submitted to arXiv
arXiv:1411.4038
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{segmentationfcn2014,
  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.4038}
}
On this page

This is one of the most influential papers in deep learning, especially for image segmentation, and it's definitely a must-read.

Defining the Problem

Image segmentation has been an evolving field for several years. With the rise of convolutional networks (CNNs), more and more approaches have shifted towards using CNNs to solve the segmentation problem. Traditional methods would often break the system into separate stages, making the whole process disjointed and heavily reliant on manual design.

Fully convolutional computation had precedents. This paper adapted pretrained classification networks into end-to-end pixelwise segmentation models, combining in-network upsampling and skip fusion without separate region-proposal or refinement stages.

Solving the Problem

Model Architecture

At the time, some of the most popular CNN architectures were AlexNet, VGG16, and GoogLeNet, mainly used for image classification tasks. To adapt these models for image segmentation, the authors modified the final "fully connected layers," replacing them with convolutional layers, as shown in the diagram above.

When using fully connected layers, the input image size is restricted, because although convolutional layers can handle images of arbitrary sizes, fully connected layers cannot. The authors solved this issue by replacing fully connected layers with convolutional ones. This permits variable spatial input sizes, subject to minimum-size, padding and output-alignment requirements.

The equivalent convolution depends on the full input shape. A fully connected layer mapping C×H×WC\times H\times W inputs to 4096 units becomes an H×WH\times W convolution with 4096 output channels. It is a 1×1 convolution only when the original spatial input is 1×1. For example, VGG16 fc6 becomes a 7×7 convolution and fc7 becomes a 1×1 convolution; kernel size is not an arbitrary choice.

The authors use a 1×1 convolution to produce a score map for each class, then upsample those maps to the input image size. Upsampling restores spatial resolution and alignment.

In this paper, the final output contains 21 channels because they used the PASCAL VOC 2011 dataset, which has 20 classes plus one for the background, totaling 21 classes.

Upsampling

In the paper, the authors mention a technique called Shift-and-Stitch, which allows dense predictions from coarse outputs without interpolation. This method was originally introduced in OverFeat:

When the output is downsampled by a factor of ff, the input can be shifted by xx pixels to the right and yy pixels down, and predictions are made for each pair (x,y)∈{0,…,f−1}×{0,…,f−1}(x, y) \in \{0, \dots, f-1\} \times \{0, \dots, f-1\}. The f2f^2 input sets are processed through the network, and the outputs are interleaved to align predictions with the center of the receptive field of each pixel.

Although the authors conducted preliminary experiments with Shift-and-Stitch, they ultimately chose deconvolution (transposed convolution, not the mathematical inverse of convolution) for upsampling, finding it more efficient, especially when combined with the skip connection technique mentioned later.

The complete network architecture is shown below:

Multi-Scale Fusion

Using only the deepest, lowest-resolution features results in coarse outputs when scaled back to the original image size. To improve this, the authors proposed multi-scale fusion.

As shown above, features from different resolutions were first projected to class-score maps with 1×1 convolutions, then aligned and summed. The smallest feature map is 1/321/32 of the original size, and the largest is 1/81/8. The fusion process involves upsampling the 1/321/32 feature map to match the 1/161/16 feature map, then summing them, followed by upsampling the result to match the 1/81/8 feature map and summing them as well, before upsampling to the original size.

This technique is referred to as a "skip layer," and it helps the model achieve better results. Below is a comparison:

The left image shows FCN-32s directly upsampled to the input size. The two middle images show FCN-16s after adding pool4 scores, then FCN-8s after also adding pool3 scores. The right image is the annotation. The fused predictions retain more detail.

Training Dataset and Strategy

The authors used the PASCAL VOC 2011 Segmentation Challenge dataset for training and validation. They trained using per-pixel multinomial logistic loss, and the evaluation metric was mean intersection-over-union (mean IU). All models were trained and tested using the Caffe framework on a single NVIDIA Tesla K40c.

  1. Learning Rate: The model was trained with stochastic gradient descent (SGD) with momentum set to 0.9, and weight decay set to 5×10−45 \times 10^{-4} or 2×10−42 \times 10^{-4}. The learning rates were set to 10−310^{-3}, 10−410^{-4}, and 5×10−55 \times 10^{-5} for FCN-AlexNet, FCN-VGG16, and FCN-GoogLeNet, respectively. These values were determined through a linear search. The class-score convolution was zero-initialized; random initialization improved neither performance nor convergence. Dropout was retained where present in the original classification network.

  2. Training Data: Whole-image training effectively batches overlapping receptive fields without physically cropping each patch. Sampling spatial loss locations did not improve convergence and took longer, so the authors used the full image.

  3. Class Balancing: Class balancing could be done through weighting or sampling, but results showed no need for balancing, even with some label imbalance (approximately 3/4 of the data was background).

  4. Dense Prediction: Outputs were upsampled via learned deconvolution layers. The final upsampling filters were fixed to bilinear interpolation; intermediate upsampling filters were initialized as bilinear and then learned. Shift-and-stitch and sparse filters were not used.

  5. Data Augmentation: Random flipping and shifting (up to 32 pixels) were tried, but no significant improvements were observed.

  6. Additional Training Data: Initially, 1,112 images from PASCAL VOC 2011 were used for training, but later, the authors used the larger set of 8,498 annotated PASCAL training images collected by Hariharan et al., improving FCN-VGG16's mean IU by 3.4 points to 59.4. This was measured on the non-overlapping subset of 736 validation images, excluding images shared with the expanded training set.

Evaluation Metrics

The paper reports four commonly used evaluation metrics from semantic segmentation and scene parsing tasks, including pixel accuracy and variations of Intersection over Union (IoU).

Let nijn_{ij} count pixels of true class ii predicted as jj, ti=∑jnijt_i=\sum_j n_{ij}, and ncln_{cl} be the number of evaluated classes. Accumulate the confusion matrix over the evaluation set and follow its rules for absent classes and ignored pixels. The metrics are:

  • Pixel Accuracy:

    ∑inii∑iti\frac{\sum_i n_{ii}}{\sum_i t_i}

    Where niin_{ii} represents the number of pixels correctly predicted for class ii (i.e., the number of pixels that belong to class ii and are predicted as class ii), and ∑iti\sum_i t_i denotes the total number of pixels in the image.

    Pixel accuracy is the most basic evaluation metric. It directly reflects the proportion of correctly predicted pixels across the entire image. However, this metric can obscure prediction errors for smaller objects when certain categories (like background) dominate the pixel count in the dataset.


  • Mean Accuracy:

    1ncl∑iniiti\frac{1}{n_{cl}} \sum_i \frac{n_{ii}}{t_i}

    Here, tit_i represents the total number of pixels that belong to class ii, and niin_{ii} is the number of pixels correctly predicted as class ii.

    Mean accuracy considers the prediction performance of each class and averages the accuracy across all classes. The advantage of this metric is that it evaluates the prediction performance for each class fairly, even for classes with fewer pixels. It is less affected by class imbalance and better reflects the consistency of the model's performance across different classes.


  • Mean Intersection over Union (Mean IoU):

    1ncl∑iniiti+∑jnji−nii \frac{1}{n_{cl}} \sum_i \frac{n_{ii}}{t_i + \sum_j n_{ji} - n_{ii}}

    The numerator niin_{ii} represents the number of correctly predicted pixels, while the denominator ti+∑jnji−niit_i + \sum_j n_{ji} - n_{ii} includes both the correctly predicted pixels and the incorrectly predicted pixels, forming the union set for the class.

    Mean IoU measures the classification performance by evaluating the overlap between predicted and actual class regions. It calculates the IoU for each class and averages the results to reflect the overall performance of the model. Compared to pixel accuracy, Mean IoU is more balanced in handling class imbalance, distinguishing between small and large objects in predictions.


  • Frequency Weighted Intersection over Union (Frequency Weighted IoU):

    1∑ktk∑itiniiti+∑jnji−nii\frac{1}{\sum_k t_k} \sum_i \frac{t_i n_{ii}}{t_i + \sum_j n_{ji} - n_{ii}}

    Frequency Weighted IoU considers the frequency of each class and uses the total number of pixels for each class tit_i as a weight to calculate the weighted average IoU for each class. The denominator ∑ktk\sum_k t_k is the total number of pixels in the dataset, and each term tiniit_i n_{ii} represents the number of correctly predicted pixels for a given class multiplied by its total pixel count. This emphasizes classes with larger pixel counts (like background).

    This metric not only evaluates the prediction accuracy for each class but also weights the classes based on their proportions in the dataset. This gives more influence to frequent classes such as background; it does not remove class-imbalance bias. Frequency Weighted IoU is particularly sensitive to performance in real-world applications, where common classes are more influential.

Discussion

PASCAL VOC Results

The table above shows the performance of FCN-8s on the PASCAL VOC 2011 and 2012 test sets, compared to previous state-of-the-art systems SDS and the well-known R-CNN.

On VOC2012, mean IoU rises from SDS’s 51.6 to FCN-8s’s 62.2: 10.6 percentage points, or about 20% relative improvement. Inference time has also significantly reduced, with the convolutional network computation being 114 times faster, and overall throughput about 286 times higher (roughly 50 s versus 175 ms per image). These are comparisons of the paper’s implementations, not universal hardware-independent ratios.

NYUDv2 Results

Initially, the authors trained the unmodified coarse model (FCN-32s) using RGB images, then incorporated depth information to upgrade the model to handle four-channel RGB-D input (early fusion), but the improvements were limited.

Building on the work by Gupta et al., the authors employed HHA depth encoding and performed "late fusion" of RGB and HHA, eventually upgrading to the 16-stride version.

SIFT Flow Results

The authors trained a dual-headed FCN-16s model that simultaneously predicted semantic and geometric labels. The model's performance on both tasks was comparable to models trained separately, but with nearly the same learning and inference speed as a single model.

The table above shows the results on the standard data split (2,488 training images and 200 test images), achieving state-of-the-art performance in both tasks at publication time.

Conclusion

The introduction of FCN represents a milestone contribution, extending the advantages of convolutional networks to semantic segmentation tasks and laying the groundwork for many subsequent image segmentation techniques. Its innovations, such as skip connections and a fully convolutional architecture, make semantic segmentation feasible as an end-to-end task.

While there is still room for improvement in output precision, resource consumption, and multi-scale feature fusion, the ideas and techniques proposed by FCN have significant implications for future research in image segmentation.