Data Augmentation: Getting More from Your Data
Data augmentation creates 'new' training data by making small, realistic changes to your existing data. It's used to fight overfitting in ML models when a dataset is small, teaching the model to generalize rather than memorize.
WHY IT EXISTS: Machine learning models can 'memorize' their training data instead of learning general patterns, a problem called overfitting. This is especially common with small datasets. Data augmentation was created to artificially expand a dataset, providing more variety to help the model generalize better to new, unseen data.
THE MENTAL MODEL: Imagine teaching a child what a 'car' is using only pictures of red sedans. They might think only red sedans are cars. Data augmentation is like showing them the same cars but colored blue, or from the side, or slightly zoomed in. You're not getting new cars, but you're creating variations to teach the underlying concept of 'car' more robustly. It's a way to get more mileage out of the data you already have.
HOW IT WORKS: Data augmentation applies a set of transformations to your existing data to create new, synthetic examples. For images, common techniques include rotating, cropping, flipping, shearing, and adjusting brightness or contrast. For text, it might involve replacing words with synonyms. The key is that these transformations must be realistic and preserve the original label. A rotated cat is still a cat.
WHEN TO USE IT: Use data augmentation when you see signs of overfitting, such as high accuracy on your training data but poor performance on new, unseen data. It is especially powerful when your dataset is small, expensive to collect, or imbalanced. It's a standard practice in most modern computer vision pipelines to improve model robustness.
WHEN NOT TO USE IT: Avoid augmentations that change the fundamental meaning or label of the data. For example, vertically flipping an image of the digit '6' could make it look like a '9', creating a mislabeled example. Similarly, some transformations don't make sense in certain domains; you wouldn't vertically flip an image of a building in most contexts. Always consider if the augmented data could plausibly appear in the real world.
ONE CANONICAL EXAMPLE: In an image classification task to identify handwritten digits, a model might be trained on a dataset of centered digits. If it then sees a digit that is slightly rotated or off-center in production, it might fail. By applying random, small rotations and translations (shifts) to the training images, the model learns that a '7' is still a '7' even if it's tilted, making it far more robust to real-world variations.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.