freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #32 of 120

data augmentation · flips · crops · mixup

NeuraVSThe Overfit Ogre
Neura saysData 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.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleGive 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 comic issue
‹ Train · Val · Test SplitsFeature Engineering · The Old Craft ›