Augmentation is regularization disguised as data
The more (slightly perturbed) views of each training image the model sees, the harder it is to memorize and the better it generalizes. Augmentation is the single most cost-effective regularizer in computer vision.
Standard image augmentations
RandomResizedCrop— crop a random scale and aspect ratio, resize to fixed output. The standard ImageNet-style crop.RandomHorizontalFlip(p=0.5)— universal for natural images.RandomVerticalFlip— only when up/down doesn't change semantics (medical images, satellite, abstract patterns).ColorJitter— brightness, contrast, saturation, hue perturbation.RandomRotation,RandomAffine— small rotations and translations.RandomErasing— zero out a random rectangle (a.k.a. Cutout). Surprisingly effective.
Batch-level augmentation: MixUp and CutMix
These take TWO images and blend them — and blend the labels too. The model is forced to predict a soft label corresponding to the mix. Standard in modern image-classification training (any ImageNet baseline from 2020+ has them).
- MixUp — pixel-wise linear interpolation between two images with weight α from a Beta distribution.
- CutMix — cut a rectangle from image B and paste into image A; label is weighted by the area of the paste.
The cardinal rule
Train transforms apply augmentation; val/test transforms apply only deterministic resize + normalize. Augmenting validation data means you're measuring against a moving target. Two separate Compose pipelines.