Data augmentation

Data augmentation creates modified copies of training images, flipped, cropped, recolored or resized, with their labels transformed to match, so a model sees more variation than the raw dataset holds. In Supervisely, training apps such as UNet and MMDetection augment images on the fly, and a data curation pipeline can save augmented copies as a new project.

Tasks and training

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.

Frequently asked questions.

What is data augmentation in computer vision?

Creating varied copies of training images on the fly, by flipping, rotating, cropping, scaling or changing colors, so a model sees more variety and overfits less. The labels are transformed along with the image.

Does data augmentation always help?

No. Transformations that create impossible images for your task, such as flipping text or rotating street scenes upside down, can hurt. Pick ones that match the variation you expect in real data.