Foundations to Frontier
Tests
E. Deep Learning › E4 Regularization Techniques (one page each)

Spatial Dropout

In convolutional feature maps neighbouring positions are strongly correlated, so standard dropout's scattered holes are easily filled in by the next convolution and remove little information. Spatial dropout instead drops entire channels (feature maps) at once, and DropBlock drops contiguous square regions. This page covers both, why correlation defeats element-wise dropout, how DropBlock sets its drop probability, and where these layers go. In the exercises you show that values removed by element-wise dropout from smooth maps can be rebuilt from their neighbours to within about 20% while dropped channels cannot be rebuilt at all, then train a small 1-D convolutional network on correlated signals and find element-wise dropout did not help while channel dropout raised accuracy and cut the test cross-entropy from 0.33 to 0.21.

Level 0: Foundation

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

Drop whole feature maps

In an image, a pixel looks almost like its neighbours, and the same is true of the feature maps inside a convolutional network. If dropout removes scattered single values, the next layer, which looks at small neighbourhoods, can guess the missing values from the ones around them, so very little is lost. Spatial dropout removes entire channels instead: a whole feature map vanishes, and nothing nearby can stand in for it. DropBlock removes contiguous patches, a middle ground.

Structured masking: what gets removed, and can it be recovered?
fraction dropped 0.25 · error recovering dropped values from their 3 × 3 neighbours 1.00 (0 = fully recoverable, 1 = nothing left)
Feature maps of images are smooth, so a single dropped value is almost determined by its neighbours and the next convolution can fill it in: element-wise dropout removes little information. Dropping whole channels (spatial dropout) or contiguous blocks (DropBlock) removes information the network cannot interpolate. Cutout erases a patch of the input; CutMix pastes in a patch of another image and mixes the labels by area; mixup blends whole images and labels.
Why engineers care

Image, audio, radar and time-series networks are mostly convolutional, and plain dropout is weak in their convolutional layers. Spatial dropout (Dropout2d, SpatialDropout2D) and DropBlock give the same kind of regularisation that dropout gives fully connected layers.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Spatial dropout drops…
  2. 2. Element-wise dropout is weak in conv layers because…
  3. 3. DropBlock drops…

Level 1: Beginner

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

By hand

  • Spatial dropout on a map H of shape (C, height, width): draw one mask per channel, mₖ ~ Bernoulli(1 − p), and output mₖHₖ/(1 − p). Example: three channels of ones, mask (1, 0, 1), p = 0.5 gives channels of 2, 0, 2.
  • Random draws: C per example instead of C × height × width: 64 against 65 536 for 64 channels of 32 × 32.
  • Expected channels kept: C(1 − p): 48 of 64 at p = 0.25.
  • DropBlock: choose block centres with probability γ and zero a b × b square around each. To drop a fraction p of a map of side s on average, γ = (p/b²)·s²/(s − b + 1)². It is usually scheduled from 0 up to its final value during training.
  • Neighbour correlation: a smooth map has correlation near 1 between neighbouring positions; white noise has about 0.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Spatial dropout draws per example…
  2. 2. Channels kept of 64 at p = 0.25:
  3. 3. Neighbour correlation of white noise is about…

Level 2: Intermediate

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

Spatial dropout in code

Exercise 1. On 16 smooth maps of length 200, values removed by element-wise dropout (p = 0.3) were rebuilt from kept neighbours within two positions with a relative error of 0.18. Dropped channels could not be rebuilt at all (error 1). On uncorrelated maps the element-wise error was 1.14: there, element dropout really removes information.

Practice.

  • Use nn.Dropout2d (or Dropout1d, Dropout3d) after convolution blocks, typically p = 0.1–0.3.
  • DropBlock with block size 7 and drop rate about 0.1 on the last stages of a ResNet was the original recipe, with the rate increased linearly during training.
  • In segmentation and detection networks, channel dropout is often placed before the prediction head.
block = torch.nn.Sequential(torch.nn.Conv2d(64, 64, 3, padding=1), torch.nn.BatchNorm2d(64), torch.nn.ReLU(), torch.nn.Dropout2d(0.2))
🐍 Exercise 1: can the next layer undo the drop?
Make smooth feature maps, drop elements or channels, and measure how well dropped values can be rebuilt from their kept neighbours.
📝 Quick check (Level 2)
0/3 answered
  1. 1. In exercise 1, element-dropped values on smooth maps were rebuilt with error about…
  2. 2. PyTorch's channel dropout for images is…
  3. 3. DropBlock's rate is usually…

Level 3: Advanced

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

Theory

Why correlation matters. Dropout regularises by removing information the network might otherwise rely on. If a dropped activation is nearly a linear combination of kept neighbours, the next convolution can reconstruct it, and the effective noise is small. Tompson et al. (2015) observed this when training pose-estimation networks and proposed dropping whole channels.

Spatial dropout as dropout on features. A channel is one feature detector applied everywhere. Dropping it is dropout at the level of features, the analogue of dropping a hidden unit in a fully connected layer. Each feature must be useful without the others.

DropBlock’s middle ground (Ghiasi et al., 2018). Dropping a contiguous region removes a part of an object from a feature map, which forces the network to use other parts. This is like Cutout (E4-9), but applied inside the network.

Interaction with batch normalisation. As with ordinary dropout, the variance seen by a following BN layer changes between training and test. Placing channel dropout after the last BN, or before the head, limits the effect.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Spatial dropout was proposed for…
  2. 2. Dropping a channel is the analogue of dropping…
  3. 3. DropBlock is like Cutout but…

Level 4: Expert

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

Element or channel dropout on correlated signals?

History.

  • J. Tompson, R. Goroshin, A. Jain, Y. LeCun and C. Bregler (2015) introduced spatial dropout.
  • G. Ghiasi, T.-Y. Lin and Q. Le (2018) introduced DropBlock.
  • Keras and PyTorch added SpatialDropout and Dropout2d layers.

Exercise 2. Signals of length 48 whose class is a rising or falling ramp at a random position, on noise smoothed over 5 samples. A network of convolution (1 → 8 channels, width 5), ReLU, dropout (p = 0.3), convolution (8 → 8), ReLU, global average pooling and a linear layer, trained with Adam for 400 full-batch steps on 80 signals. Means of three seeds:

dropout after the first convolution test accuracy test cross-entropy
none 0.903 0.327
element-wise 0.870 0.330
spatial (channels) 0.914 0.207
  • Element-wise dropout did not help: accuracy fell by 3 points and the loss did not improve.
  • Channel dropout helped: accuracy rose by 1 point and the cross-entropy fell by more than a third.
  • Caveat: a tiny network, one rate and three seeds; the accuracy differences are small, the loss difference clearer.
🐍 Exercise 2 (research): element or channel dropout?
Train a small 1-D convolutional network on correlated signals with no dropout, element-wise dropout and channel dropout, and compare test accuracy and cross-entropy.

Spatial dropout in AI, robotics and aerospace

  • Visual perception networks for robots and drones use channel dropout or DropBlock in their convolutional backbones and heads.
  • Radar, sonar and vibration signals processed by 1-D or 2-D convolutions share the correlation that defeats element-wise dropout.
  • Robustness to sensor channel loss: dropping whole input channels during training teaches a model to cope when one sensor stream fails.

References

  1. J. Tompson, R. Goroshin, A. Jain, Y. LeCun, C. Bregler (2015). “Efficient object localization using convolutional networks.” Proc. CVPR.
  2. G. Ghiasi, T.-Y. Lin, Q. V. Le (2018). “DropBlock: a regularization method for convolutional networks.” Advances in NeurIPS.
  3. N. Srivastava et al. (2014). “Dropout: a simple way to prevent neural networks from overfitting.” JMLR 15.