Augmentation is free regularization
The cheapest way to make a vision model generalize is to show it more variety — not more images, but more versions of the images you have. Flip, rotate, crop, recolor: each transform teaches the model that a cat is still a cat upside-down or in shadow. KerasCV's layers do this on the fly, on the GPU, as part of the input pipeline — so it costs almost nothing and the original dataset never grows on disk.
Where KerasCV pulls ahead of basic flips and rotations is the batch-level augmentations that mix two samples together:
| Augmentation | Description |
|---|---|
CutMix | Cuts a random patch from one image and pastes it onto another, mixing labels proportionally |
MixUp | Linear interpolation between two images and their labels |
RandAugment | Applies a random policy of N transforms from a predefined set — no manual tuning |
MosaicAugmentation | Combines 4 images into a mosaic (used in YOLO training) |
Why mixing labels works
MixUp and CutMix do something that feels wrong at first: they produce images that are partly a cat and partly a dog, with a label to match (0.7 cat, 0.3 dog). This forces the model to stop being overconfident — it learns smooth decision boundaries instead of memorizing sharp ones, which is exactly what reduces overfitting. They're standard in SOTA classification recipes for that reason. The catch: they only apply during training, and they're more hyperparameter-sensitive than vanilla augmentation.