Data Augmentation

Expanding a dataset by creating modified versions of existing examples.

Would flipping this photograph preserve its label?

Imagine training two classifiers from the same mug photograph. One predicts the object type. The other reports which side of the image contains the handle. A transformation has to respect the particular target.

Object type

A modest crop that keeps the complete mug and a horizontal flip can both preserve “mug.” A tight crop showing only the tabletop removes the evidence for the label.

Handle position

A horizontal flip moves a left-side handle to the right. The transformed image is usable only if its directional label changes with it. A crop hiding the handle leaves the target ambiguous.

When should the split happen?

Assign original objects or photographs to training and evaluation groups before generating variants. An original in training and a near-identical crop in the test set can make the evaluation reward recognition of the same photograph.

A teal mug stands with its handle visible on the left.
A mirror image would still show a mug, but its handle would appear on the opposite side.

Check the transformation against the task

Inspect several transformed examples with their labels. For detection or segmentation, bounding boxes and masks may also need to move. Variations should resemble conditions the deployed model is expected to handle.

Follow the idea

Computer Vision · See where visual labels enter a recognition task.

Model Evaluation · Assess the result on independently collected examples.

Source · TensorFlow tutorial on image data augmentation

Return to Data Augmentation in the A–Z glossary