Data augmentation creates new training examples by transforming the ones you already have. A flipped photo of a cat is still a cat, and now you have two examples.
What it really teaches is invariance. Showing the model rotated, cropped and recoloured versions tells it that those changes do not alter the answer, which is exactly the generalisation you want.
Think of it like this. Think of learning to recognise a friend. You do not need photographs from a thousand angles, and having seen them in different light, from different sides, is why you recognise them anywhere.
How it works
- Transform on the fly, usually as each batch is loaded, so every epoch sees slightly different data.
- The label survives. The whole approach depends on the transformation not changing the answer.
- Randomised each time, so the model rarely sees exactly the same input twice.
- Training only. Validation and test data are left alone, or your measurements stop meaning anything.
Types
- Images: flip, rotate, crop, adjust colour, add noise, cut out patches.
- Text: synonym replacement, back-translation, random deletion. Harder, because small changes can flip meaning.
- Audio: time stretch, pitch shift, background noise, time masking.
- Tabular: oversampling techniques such as SMOTE for imbalanced classes.
Common mistakes
- "Any transformation is fine." Flipping a photo of a cat is safe. Flipping a photo of the digit 2 gives you something that is no longer a 2. Whether the label survives is domain knowledge, not a setting.
- "Augment the validation set too." Then you are measuring performance on data that does not resemble production.
- "More augmentation is always better." Distort far enough and you are training on examples that no longer represent reality.