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.
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.
| Data | Typical augmentations |
|---|---|
| Images | Small translations, rotations, crops, brightness changes, horizontal flips |
| Audio | Time shifts, added background noise |
| Tabular | Small 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
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.