Foundations to Frontier
Tests
E. Deep Learning › E10 Segmentation Architectures

DeepLab v1–v3+

DeepLab (Chen and colleagues, 2015–2018) keeps segmentation maps dense by replacing the last poolings of a classifier with atrous (dilated) convolutions, which widen the field of view without losing resolution or adding weights. Version 1 added a fully connected CRF; version 2 introduced atrous spatial pyramid pooling (ASPP); version 3 added image-level features and BatchNorm and dropped the CRF; version 3+ added a light decoder. This page covers atrous convolution, output stride, ASPP and the decoder. In the exercises you implement atrous convolution and receptive fields, then measure two failure modes: equal rates leave 71% of the field unseen (gridding), and on a 65 × 65 map a 3 × 3 filter at rate 64 has only its centre tap valid at 94% of positions.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Seeing wide without shrinking

Classifiers shrink an image 32 times before deciding what it shows, which is fine for one label and bad for labelling every pixel. DeepLab stops shrinking early and instead spreads each filter’s taps apart, leaving gaps (holes, trous in French) between them. A 3 × 3 filter with gaps of 1 looks at a 5 × 5 area with the same 9 weights. Spreading wider sees more context; several spreads side by side see objects of several sizes at once.

Segmentation lab
Receptive field 13 × 13; positions that reach the output: 29.0%. Equal rates such as (2, 2, 2) leave a regular grid of holes; rates without a common factor, such as (1, 2, 5), cover the whole field.
Segmentation labels every pixel. Coarse score maps lose boundaries when upsampled; skip connections from finer layers (FCN, U-Net) and dilated convolutions (DeepLab) recover detail. Judge masks by IoU or Dice, not pixel accuracy, which background inflates.
Why engineers care

DeepLab’s ideas (dilated backbones, ASPP and a light decoder) became standard parts of segmentation for driving, satellite imagery and medical scans.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Atrous convolution…
  2. 2. A 3 × 3 filter with rate 2 covers…
  3. 3. ASPP runs…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Atrous convolution: y[i] = Σₖ w[k] · x[i + r·k]. Rate r = 1 is ordinary convolution.
  • Effective kernel size: k + (k − 1)(r − 1). For k = 3: rate 2 gives 5, rate 6 gives 13, rate 12 gives 25. The number of weights stays 9.
  • Output stride (OS): the ratio of input to feature-map size.
    • A ResNet classifier has OS 32.
    • DeepLab replaces the strides of the last one or two stages with rates 2 (and 4), giving OS 16 or 8.
    • For a 513 × 513 crop: OS 32, 16 and 8 give 17, 33 and 65 pixels per side.
  • Receptive field of a stack: RF = 1 + Σ (effective kernel − 1) × (product of earlier strides).
    • three 3 × 3 convolutions at rate 1: 7;
    • three at rate 2: 13;
    • rates (1, 2, 5): 17.
  • Gridding: three rate-2 convolutions only ever touch even offsets, so in 2-D only 49 of the 169 positions in the 13 × 13 field reach the output (29%).
📝 Quick check (Level 1)
0/3 answered
  1. 1. Effective size of a 3 × 3 filter at rate 6:
  2. 2. Feature map side for a 513 crop at OS 16:
  3. 3. Receptive field of three 3 × 3 rate-2 convolutions:

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

DeepLab in code

Exercise 1.

  • Atrous convolution of a centred impulse with a 3 × 3 all-ones filter at rate 2 lit 9 pixels spread over 5 × 5.
  • The receptive-field function reproduced 7, 13 and 11 for the test stacks.

Practice.

  • PyTorch: nn.Conv2d(c, c, 3, padding=r, dilation=r) keeps the size.
  • torchvision’s deeplabv3_resnet50 uses replace_stride_with_dilation=[False, True, True] (OS 8) and ASPP rates 12, 24 and 36.
  • DeepLabv3 trains at OS 16 with rates 6, 12 and 18 and evaluates at OS 8 with doubled rates for a small gain at about 4 times the compute in the last stages.
  • The ASPP head has 5 branches: a 1 × 1 convolution, three 3 × 3 atrous convolutions and image pooling. They are concatenated and projected to 256 channels. With 2048 input channels it has 15,535,104 parameters (matching torchvision).
  • DeepLabv3+ decoder:
    • upsample ASPP features 4 times;
    • concatenate stride-4 backbone features reduced to 48 channels by a 1 × 1 convolution;
    • refine with two 3 × 3 convolutions;
    • upsample 4 times to full size.
backbone = resnet50(replace_stride_with_dilation=[False, True, True])  # OS 8
aspp = [conv1x1, atrous(12), atrous(24), atrous(36), image_pool]      # five branches
x = project(torch.cat([b(f) for b in aspp], 1))                      # 1280 → 256 channels
logits = F.interpolate(classifier(x), size=img.shape[-2:], mode="bilinear")
🐍 Exercise 1: atrous convolution and receptive fields
Implement 2-D atrous convolution, the effective kernel size and the receptive field of a stack.
📝 Quick check (Level 2)
0/3 answered
  1. 1. PyTorch keeps size for a 3 × 3 conv at rate r with padding…
  2. 2. torchvision's DeepLabv3 output stride:
  3. 3. The v3+ decoder fuses backbone features at stride…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Why atrous instead of pooling.

  • Pooling and striding enlarge the receptive field but lose resolution, which upsampling cannot fully restore (E10-1).
  • Atrous convolution enlarges the receptive field at full resolution with the same weights. A pretrained classifier’s stride-2 layer can be converted by removing the stride and dilating every later filter by 2, which computes the same values on a denser grid.
  • The cost is compute and memory: features at OS 8 have 16 times as many positions as at OS 32.

Gridding. Stacked atrous convolutions with a common factor only sample a sub-lattice:

  • three rate-2 layers reach offsets −6, −4, …, 6, so 7 of 13 positions per axis;
  • in 2-D, 29% of the field (exercise 2), with checkerboard artefacts in the output.

Hybrid dilated convolution chooses rates without a common factor, such as (1, 2, 5), which cover every position.

Large rates degenerate. On a finite map, taps far from the centre fall into the zero padding. On a 65 × 65 map:

  • at rate 24, 57% of taps are valid on average;
  • at rate 64, the centre tap alone is valid at 94% of positions, so the filter acts like a 1 × 1 convolution.

DeepLabv3 observed this and added an image-pooling branch to supply global context directly.

CRF and decoder.

  • DeepLab v1 and v2 sharpened boundaries with a fully connected CRF on pixel colours.
  • v3 dropped it once ASPP with BatchNorm was strong enough.
  • v3+ recovered boundary detail with a light decoder instead, which is cheaper and trains end to end.
📝 Quick check (Level 3)
0/3 answered
  1. 1. Gridding comes from…
  2. 2. At a rate near the map size a 3 × 3 atrous filter acts like…
  3. 3. DeepLabv3 dropped…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

When does dilation fail?

History.

  • The algorithme à trous comes from wavelet signal processing (M. Holschneider et al., 1989).
  • L.-C. Chen, G. Papandreou, I. Kokkinos, K. Murphy and A. Yuille introduced DeepLab with atrous convolution and a fully connected CRF (ICLR 2015).
  • F. Yu and V. Koltun popularised the name dilated convolution (ICLR 2016).
  • DeepLabv2 introduced ASPP with a ResNet-101 backbone (TPAMI 2018).
  • DeepLabv3 (Chen, Papandreou, Schroff and Adam, 2017) revisited ASPP with image pooling and BatchNorm.
  • DeepLabv3+ (Chen, Zhu, Papandreou, Schroff and Adam, ECCV 2018) added the decoder and an aligned Xception backbone with depthwise separable atrous convolutions.
  • P. Wang et al. (WACV 2018) analysed gridding and proposed hybrid dilated convolution.

Exercise 2. We count exactly which input positions reach one output through three stacked 3 × 3 atrous convolutions, and how many filter taps fall inside a 65 × 65 map (the OS-8 feature size of a 513 crop) as the rate grows.

rates receptive field positions reaching the output
(1, 1, 1) 7 × 7 100%
(2, 2, 2) 13 × 13 29.0%
(4, 4, 4) 25 × 25 7.8%
(1, 2, 3) 13 × 13 100%
(1, 2, 5) 17 × 17 100%
rate on a 65 × 65 map 1 6 12 24 36 48 64
valid taps (average) 0.980 0.881 0.769 0.568 0.398 0.258 0.118
positions with only the centre valid 0 0 0 0 0.012 0.227 0.939
  • Gridding is real and grows with the rate. Equal rates of 2 see 29% of their field, rates of 4 only 7.8%. Rates (1, 2, 3) and (1, 2, 5) see all of it with the same weights.
  • Very large rates stop being 3 × 3 filters. The rates 6–24 used by DeepLab stay mostly valid at this map size, but at 48 and 64 the filter collapses towards 1 × 1, which motivated DeepLabv3’s image-pooling branch.
  • These counts are about geometry only. Learned filters and earlier layers partly fill holes in practice, so the output artefacts are milder than the counts suggest.
🐍 Exercise 2 (research): when does dilation fail?
Count the positions reaching an output through stacked atrous convolutions, and the valid taps of large-rate filters on a 65 × 65 map.

DeepLab in AI, robotics and aerospace

  • Driving and robotics: DeepLabv3+ with MobileNet backbones is a common on-device segmentation baseline.
  • Remote sensing: dilation keeps the resolution needed for roads and buildings in satellite tiles; ASPP handles objects at very different scales.
  • Design caution: check stacked dilation rates for gridding and keep rates well below the feature-map size.

References

  1. L.-C. Chen, G. Papandreou, I. Kokkinos, K. Murphy, A. L. Yuille (2015). “Semantic image segmentation with deep convolutional nets and fully connected CRFs.” Proc. ICLR.
  2. L.-C. Chen, G. Papandreou, I. Kokkinos, K. Murphy, A. L. Yuille (2018). “DeepLab: semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected CRFs.” IEEE TPAMI 40(4).
  3. L.-C. Chen, G. Papandreou, F. Schroff, H. Adam (2017). “Rethinking atrous convolution for semantic image segmentation.” arXiv:1706.05587.
  4. L.-C. Chen, Y. Zhu, G. Papandreou, F. Schroff, H. Adam (2018). “Encoder-decoder with atrous separable convolution for semantic image segmentation.” Proc. ECCV.
  5. F. Yu, V. Koltun (2016). “Multi-scale context aggregation by dilated convolutions.” Proc. ICLR.
  6. P. Wang et al. (2018). “Understanding convolution for semantic segmentation.” Proc. WACV.