AI Data Augmentation Tutorial: Flips, Crops, Mixup

TL;DRData augmentation expands training data with label-preserving transformations.

More data helps, and you can manufacture some: flip/rotate/crop images, add noise, change brightness; for text, paraphrase or back-translate; mixup blends examples and labels. Augmentation teaches the model invariances (a flipped cat is still a cat), reducing overfitting cheaply. The rule: transformations must preserve the label — augment in ways that keep the answer correct.

Key points

Common mistakes

Try it: Give a label-preserving and a label-breaking augmentation for digit images.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>OK:  slight rotate/shift a "3" → still a 3
bad: flip a "6" → becomes a "9" (label broken)</pre></body></html>
Open the interactive lesson →
Train · Val · Test Splits Feature Engineering · The Old Craft