Monash University · FACULTY OF COMPUTER SCIENCE

ECE5179 Chap.7 Residual Networks and Batch Normalisation

- one subject, every graph, every model, every mark
8 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 7 of 12 · ECE5179

Residual Networks and Batch Normalisation

Week 7 revisits convolutional design with two ideas that made very deep networks trainable. Residual connections let a block output F(x) + x, so extra depth can default to the identity and gradients flow through the shortcut. Batch normalisation standardises features with mini-batch statistics and then rescales them with learned parameters, behaving differently in training and evaluation.

The chapter covers ResNet stages, bottleneck blocks, normalisation alternatives and the numbers behind them.

In this chapter

What this chapter covers

  • 01

    The degradation problem in deep plain networks

  • 02

    Residual blocks and identity shortcuts

  • 03

    Downsampling shortcuts and bottleneck blocks

  • 04

    ResNet-18 to ResNet-152 stage designs

  • 05

    Batch normalisation for fully connected and convolutional layers

  • 06

    Training mode versus evaluation mode

  • 07

    Group and layer normalisation

  • 08

    Why batch norm smooths the loss landscape

Worked example · free

Batch normalise a four-sample batch

Q [4 marks]. One feature takes the values 2, 4, 6 and 8 in a mini-batch. With ε = 0, γ = 2 and β = 1, compute the batch mean and variance, the normalised values after subtracting the mean and dividing by the standard deviation, and the outputs after scaling and shifting. The marks are our revision weighting, not a University-published allocation.
The same four values at three stages.The same four values at three stages. The top line shows the raw batch, the middle line the values after subtracting the mean and dividing by the standard deviation, and the bottom line after scaling by 2 and shifting by 1.raw batchnormalisedγ=2, β=1mean 5, variance 5
The same four values at three stages. The top line shows the raw batch, the middle line the values after subtracting the mean and dividing by the standard deviation, and the bottom line after scaling by 2 and shifting by 1.
  • 1Batch mean μ = 20/4 = 5.
  • 1Squared deviations 9, 1, 1, 9 give variance σ² = 5 and standard deviation about 2.236.
  • 1Normalised values (x − 5)/2.236: −1.342, −0.447, 0.447, 1.342.
  • 1Outputs 2x̂ + 1: −1.683, 0.106, 1.894, 3.683.
The batch has mean 5 and variance 5; the normalised values are ±0.447 and ±1.342, and the outputs −1.683, 0.106, 1.894 and 3.683 have mean 1 and standard deviation 2, set by β and γ.
Sia tip — Divide by m, not m − 1, when computing the batch variance, and apply γ and β only after normalising.
Glossary

Key terms

Degradation problem
The degradation problem is the rise in training error seen when plain networks are made deeper.
Bottleneck block
A bottleneck block reduces channels with a 1 × 1 convolution, applies a 3 × 3 convolution, and restores the channels with another 1 × 1 convolution.
Running statistics
Running statistics are the stored averages of batch means and variances that batch normalisation uses at evaluation time.
Group normalisation
Group normalisation computes statistics over groups of channels within each sample, independent of the batch size.
FAQ

Residual Networks and Batch Normalisation FAQ

Why do residual connections help very deep networks?

A residual block outputs F(x) + x, so learning the identity only requires F to be zero, which is easy. The derivative of the block includes an identity term, so gradients pass through the shortcut undiminished. The lectures show that plain deep networks underfit rather than overfit, so this is an optimisation fix.

Why does batch norm behave differently at test time?

During training it uses the statistics of the current mini-batch, so each output depends on the other samples. At evaluation it switches to stored running averages, so a single input always gets the same output. Forgetting model.eval() leaves the training behaviour on and makes test results noisy.

Why can a convolution placed before batch norm drop its bias?

Batch normalisation subtracts the mean of each feature, which removes any constant the convolution added, and its own β parameter supplies a learned shift instead. Keeping both biases wastes parameters without changing what the network can represent.

How does a ResNet change resolution between stages?

The first block of each stage halves the height and width with a stride-2 convolution and doubles the number of channels. Because the input no longer matches that shape, its shortcut becomes a 1 × 1 convolution with stride 2. Across ResNet-18 the maps shrink from 56 to 28, 14 and 7 pixels square.

What is the difference between batch, layer and group normalisation?

All three standardise activations and then apply a learned scale and shift; they differ in which values share statistics. Batch normalisation pools one feature across the batch, layer normalisation pools all features within one sample, and group normalisation pools groups of channels within one sample, so the last two do not depend on batch size.

Study strategy

Exam move

Draw a basic and a bottleneck residual block from memory, label the tensor shapes, and redraw the downsampling version with its 1 × 1 stride-2 shortcut. Count the weights in each for a chosen channel number to see why bottlenecks are used from ResNet-50 upwards.

Practise batch normalisation on small batches, including a shifted batch to confirm the output does not change, and write a two-sentence explanation of training versus evaluation mode, including the frozen-weights trap from the transfer-learning workshop.

For the theory question that often accompanies batch normalisation, prepare a short answer contrasting the original covariate-shift explanation with the smoother-loss-landscape view the lectures favour, and say what each predicts about learning rates.

Working through Residual Networks and Batch Normalisation in ECE5179? Sia is AskSia’s AI Computer Science tutor — ask any ECE5179 Residual Networks and Batch Normalisation question and get a clear, step-by-step explanation grounded in how ECE5179 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 161 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your ECE5179 tutor, unlimited, worked the way the exam marks it
The full 5-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works
ECE5179 · Neural networks and deep learning - independent study guide on the AskSia Library. More Monash University subjects · Microeconomics across all universities