Three kinds of transforms
- Geometric: flips, rotations, scaling, crops and perspective changes. The pixels move, so boxes, polygons and keypoints have to move with them.
- Photometric: brightness, contrast, hue, blur and noise. Labels stay where they are.
- Mixing: mosaic, mixup and copy-paste combine several images or paste objects from one into another, along with their labels.
Labels have to follow the pixels
A rotated bounding box no longer fits its object, and the axis-aligned box around it grows larger than the object; polygons and masks rotate without that loss. Keypoints carry a subtler trap: after a horizontal flip, the point that was the left eye sits where the right eye should be, so named left and right points must swap. A keypoint dataset augmented without that swap teaches the model to mix up sides.
Online or offline
Online augmentation draws new random transforms every time an image is loaded during training, so the model rarely sees the exact same image twice and nothing extra is stored. Offline augmentation writes the transformed copies out as a dataset of their own, which is useful when the copies need review or a different training tool will read them.
Where augmentation goes wrong
- Augmenting the validation set, which turns the score into a measure of the transforms rather than of the real data.
- Transforms that create impossible scenes: an upside-down street, or a mirrored sign whose text must stay readable.
- Expecting it to cure missing data. It varies what is already there and cannot add a class or a viewpoint the dataset lacks; synthetic data or more labeling can.
Augmentation in Supervisely
Training apps augment online: UNet applies augmentations on the fly, and the MMDetection and first-generation RT-DETR apps offer a ready-made augmentation template or a custom pipeline. For offline copies, a data curation pipeline previews each transform on a real image and saves the result as a new project.