Unit 05.03: Augmentation that changes the label
Augmentation is free only when the transformation preserves the thing you are predicting.
Seven augmentations, four of which corrupt the label
The same transformation is safe for one task and destructive for another.
The code pairs each with a task.
AUGMENTATIONS = [
("horizontal flip", "cat vs dog", True),
("horizontal flip", "reading a serial number", False),
("horizontal flip", "left vs right shoe", False),
("rotate 90", "aerial imagery", True),
("rotate 90", "handwritten digits (6 vs 9)", False),
("brightness jitter", "damage detection", True),
("heavy blur", "detecting fine scratches", False),
]
print(f"{'augmentation':18} {'task':28} label survives?")
for aug, task, safe in AUGMENTATIONS:
print(f"{aug:18} {task:28} {'yes' if safe else 'NO -- changes the answer'}")
unsafe = sum(1 for *_, s in AUGMENTATIONS if not s)
print(f"\n{unsafe} of {len(AUGMENTATIONS)} would corrupt the label")
# Augmentation is only free when the transformation preserves the thing you are
# predicting. A flipped 6 is a 9, and a blurred scratch is a clean surface --
# so the model learns from an image whose label is now wrong.
A horizontally flipped 6 is a 9. A flipped left shoe is a right shoe. A heavily blurred scratch is a clean surface. In each case the image is now labelled with the wrong answer, and the model learns from it.
Nothing detects this - the pipeline runs, the loss decreases, and the model is being taught something false at whatever rate the augmentation fires.
The mistake this prevents
The mistake is enabling a standard augmentation set because it is standard. The standard set was chosen for natural-image classification, where flips and rotations are safe. Check each one against your specific label.
Takeaway
Check every augmentation against the label it must preserve. A flipped 6 is a 9, and nothing in the training loop notices.
