In plain words
AI models learn from examples, and more varied examples usually mean a better model. But collecting and labelling new examples is slow and costly. Data augmentation makes new examples out of the ones you already have.
Take one labelled photo of a mango. Flip it, turn it a little, zoom in, make it darker. Each version is still a mango, so each one becomes another labelled example, for free. For text, people swap in synonyms, drop a word, or translate a sentence into another language and back.
The model now sees mangoes in more positions and lighting than the original photos showed, so it learns what really makes a mango rather than one camera angle. That helps it work on new photos and makes overfitting less likely. The changes are applied fresh each time training runs over the data, and only during training, never when the model is used.
Everyday example
Teaching a new cashier to spot a ₹500 note
A shop owner has just a few notes to train a new cashier with. So he shows each one many ways: upside down, folded, crumpled, under the tube light and in sunlight. It is the same note every time, yet the cashier learns to recognise it however a customer hands it over. Augmentation does this with training data.
Where the example breaks: The cashier knows a folded note is still ₹500. A model only learns that if the change truly keeps the answer the same, and the copies are variations, not new information: augmentation cannot show the model things that were never in the data.
How it actually works
Augmentation applies label-preserving transformations: changes that alter the input but not the right answer.
Choose safe changes for the task
For photos: flips, small rotations, crops, zoom, brightness and colour shifts, blur. A cat is still a cat after any of these. What is safe depends on the task, and label-preserving changes are easier to design for images than for language.
Apply them randomly, on the fly
Tools such as TensorFlow's Keras layers apply random transformations each time an example is loaded, so the model rarely sees exactly the same input twice. Augmentation is switched off when the model is evaluated or used.
Text, audio and more
Text augmentation includes synonym swaps, inserting or deleting words, paraphrasing, and back-translation: translating to another language and back. For speech recognition, a 2019 method called SpecAugment hides random blocks of time and frequency in the audio features. Gains tend to be largest when labelled data is scarce.
Generated examples
A newer approach uses generative models to create fresh variations. That blurs into synthetic data, which is made from scratch rather than by editing a real example.
A building block elsewhere
Augmentation is also central to some self-supervised methods, which create two altered views of one image and train a model to recognise that they match.
- Landmark use
- AlexNet (2012) cropped and flipped ImageNet photos, multiplying its training set by 2,048, and reported heavy overfitting without it
- Back-translation
- Sennrich, Haddow and Birch (2015) used it to add training data for machine translation
- When it runs
- Training only, not when the model is tested or used
- Related ideas
- Regularisation and synthetic data
Questions people ask
What is the purpose of data augmentation?
To give a model more varied training examples without collecting new data. That helps it learn the real pattern instead of memorising the exact examples it saw, so it does better on new inputs.
Is data augmentation the same as synthetic data?
They overlap. Augmentation edits real examples slightly. Synthetic data is usually made from scratch, for example by a simulator or a generative model. Both add training examples.
Can data augmentation hurt a model?
Yes, if a change alters the right answer or creates inputs that never occur in real life. A change must keep the label true: swapping in a word that flips a review from good to bad, for example, teaches the model something false.
Is data augmentation used on the test set?
No. It is applied only to training data. The model is tested on untouched examples so the score reflects real use. Some systems average predictions over a few altered copies at test time, but that is a separate trick.
Was this clear?
1 is confusing, 5 is crystal clear. One tap, no account needed.
Spotted something wrong, or know a better example? Suggest a change
Further reading
- Data augmentation (tutorial)TensorFlow
- ImageNet Classification with Deep Convolutional Neural Networks (Krizhevsky, Sutskever and Hinton)NeurIPS, 2012
- Text Data Augmentation for Deep Learning (Shorten, Khoshgoftaar and Furht)Journal of Big Data, 2021
- Improving Neural Machine Translation Models with Monolingual Data (Sennrich, Haddow and Birch)arXiv, 2015