Lesson 9.4 · 5 min read · about 40 min to master at a very slow pace

Data Augmentation

When you can't collect more data, make more from what you have: transformed copies that keep the right label. Which transformations suit images, audio and tabular data, and which ones break the label.

Not startedJump to quiz

More data, made from the data you have

More training data is the most reliable cure for overfitting. When you can't collect it, add transformed copies of the examples, using only transformations that don't change the correct answer.

DataTypical augmentations
ImagesSmall translations, rotations, crops, brightness changes, horizontal flips
AudioTime shifts, added background noise
TabularSmall additive noise on the inputs

Make sure the label survives

Flipping a photo of a cat still gives a cat. Flipping a "6" or a word does not give the same digit or text, so don't flip digits or text. A 180° rotation turns a 6 into a 9.

  • Apply augmentations at random to each mini-batch during training, so the network rarely sees the exact same example twice.
  • Never at test time: evaluate on the real inputs.

The effect is to teach the network to be invariant to those transformations: the label shouldn't depend on where the object sits or how bright the photo is.

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passIs augmentation really regularisation if it adds data?

Yes: by the definition, it changes training to reduce generalisation error, not training error (training error usually goes up a little, because the task got harder). It encodes prior knowledge, "these changes don't matter", that the raw data alone doesn't contain.

Cheatsheet

Augmentation

Label-preserving transforms, random per mini-batch, training only. Images: shift, rotate, crop, brightness, flip (not digits/text). Audio: shift, noise.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1applyWhich augmentation would break the labels of a handwritten-digit dataset?
Q2conceptWhen are augmentations applied?
Q3conceptWhat does augmentation teach the network?
Q4applyWhich augmentation suits an audio keyword-spotting dataset?
Q5interpretAfter adding augmentation, training error rises slightly but validation error falls. What does that show?