CS PAPERS DEEP-READ · PAPER 29

Batch Normalization

Sergey Ioffe & Christian Szegedy · Google · ICML 2015

中文 →

What did this paper do?

In 2015 two Google researchers proposed Batch Normalization (BN for short) — a small component, a few lines of code, dropped into the middle of a neural network. With it, the same network reached the same accuracy in more than ten times fewer training steps; along the way they pushed the ImageNet image-recognition error rate down to 4.9%, below the roughly 5.1% estimated for humans. For the decade that followed, from ResNet onward, nearly every convolutional network has a BN sitting behind each middle layer.

The pain of the old world

A neural network is a relay team: the first layer spots edges, the second assembles parts, the third recognizes objects. The trouble is that during training everyone is changing how they work at the same time. When someone earlier in the chain shifts their conventions, the scale of what the next person receives changes wholesale: numbers that were "a fraction" yesterday are "tens" today. A layer barely adapts before the layers below it move again. To keep the chaos from running away, people back then could only take very small steps (dial the learning rate down) and pick initial values with great care. Training a deep network was slow and superstitious, like walking a tightrope.

The idea: reset the scale before each layer starts work

BN's idea is almost brutally plain: before a layer does anything, take the pile of numbers it just received and put them all back on a standard scale. However much the layers below thrash about, what reaches the next layer is always the same order of magnitude, the same range.

How? During training, data arrives in small batches (say 32 images at a time). BN uses that batch of peers as the reference: compute the batch's average and its spread, subtract the average from every number and divide by the spread — the whole batch is moved to sit "centered at zero, roughly equally wide." It is what a class does when raw scores are converted into standard scores using the class average and spread: however the exam's difficulty swings, the distribution of standard scores stays put.

But if every layer is locked to one fixed scale, doesn't that cost the network expressive power? The authors left a back door: each spot gets two extra learnable knobs, one for "how wide" and one for "shifted where." If the network decides the original scale was better, it just turns the knobs back — in the worst case it can undo the normalization entirely. Force everything to standard first, then let the network decide whether to move back — that is the key move of the whole paper.

Why this alone made things so much faster

Three things get fixed at once. First, the steps can finally be big: with the scale steady you no longer need tiny cautious steps to avoid a blow-up, so the learning rate can go up more than tenfold. Second, the learning signal stops being flattened: a squashing function popular at the time crushes numbers into the range between 0 and 1, and once a number is large it lands in the flat stretch at either end, where changing the input barely changes the output and the correction signal dies — pulling numbers back toward the middle dodges exactly that trap. Third, it discourages memorizing the answers for free: a number's standard score depends on which peers happen to share its batch, and batches are thrown together at random, so the same image comes out slightly jittered from one round to the next; that little bit of noise makes it harder for the network to memorize the training set.

One honest caveat: BN's scale is measured off "the peers in the same batch" — make the batch too small and the scale gets unreliable, and the benefit visibly shrinks.

Remember this one thing

Before each layer acts, use the current small batch to compute an average and a spread, convert the incoming numbers into standard scores, and add two learnable knobs so the network can turn it back. Once the scale holds still, the learning rate can go up more than tenfold and the signal stops being flattened — and training deep networks went from tightrope walking to routine.

Want the formula, how convolutional layers do it, which statistics inference uses, and the later rebuttal of "why it works"? → Switch to the deep read