3.4.15 · D5Convolutional Neural Networks

Question bank — Data augmentation for images

1,459 words7 min readBack to topic

This is a rapid-fire misconception hunt for Data augmentation for images. Each line is a trap: read the left side, commit to an answer with a reason, then reveal. If your reason was hand-wavy, that's the bug — augmentation is full of "sounds right but isn't" statements.


True or false — justify

Every claim below is stated as if confident. Decide, then justify.

Augmentation adds genuinely new information about the world to the training set.
False — it only re-expresses information already present in your labels and your assumed invariances; a flip tells the model nothing your prior "cats are flip-invariant" didn't already assert.
More augmentation always reduces overfitting further.
False — too-aggressive augmentation can push images off the true data distribution (a 90° rotated street scene), causing underfitting by making the task harder than reality. See 5.2.3-Overfitting-vs-underfitting.
A horizontal flip is safe for essentially any natural-image classification task.
Mostly true for object categories, but false whenever left/right carries meaning — reading text, distinguishing a "6" from a mirrored shape, or classifying which hand is raised.
Vertical flip is a label-preserving transform for photographs of everyday scenes.
Usually false — gravity gives scenes a canonical orientation (sky up, ground down), so upside-down photos are off-distribution; it is fine for orientation-free imagery like satellite or microscopy.
MixUp changes only the inputs, leaving labels as clean one-hot vectors.
False — MixUp interpolates the labels too: , producing soft targets, which is exactly what smooths the decision boundary.
Cutout works by adding informative content to the image.
False — it removes content (masks a region), forcing the network to spread its evidence across many features instead of one shortcut cue.
Data augmentation is applied to both the training set and the test set.
False — it is a training-time technique; the test image is normally passed unchanged (test-time augmentation exists but is a separate, optional inference trick, not part of learning).
If you have millions of labelled images, augmentation becomes pointless.
False — even large datasets benefit, because augmentation enforces invariances (rotation, lighting) that raw data may under-sample; its value shrinks but rarely vanishes.
Augmentation is an alternative to Dropout — you pick one.
False — they're complementary regularizers acting in different places (input space vs hidden units) and are routinely used together.
The rotation matrix in the parent note works directly on any point regardless of image center.
False — it rotates about the origin; that is why the formula translates by , rotates, then translates back, so the rotation happens about the image center.
Random Resized Crop teaches only scale invariance.
False — it teaches scale invariance and translation invariance (crops start at varied positions) and some aspect-ratio robustness (the sampled ratio ).
Brightness offset can be any value because pixels are just numbers.
False — pixels live in ; after you must clip, or bright regions saturate to white and dark ones clip to black, destroying structure.

Spot the error

Each statement contains a specific mistake. Name it.

"For OCR we augment with horizontal flips since flipping never changes what a photo shows."
Flips do change readable text (mirror-reversing characters), so this is not label-preserving for OCR — the transform choice is domain-specific, not universal.
"MixUp uses so mixing is evenly balanced."
Wrong distribution — it uses with small , which pushes toward 0 or 1 so most examples stay close to one original rather than a 50/50 blur.
"Augmentation increases the effective dataset from to exactly where is fixed."
With per-epoch random sampling is effectively unbounded — you draw fresh transforms each pass — so "exactly " understates it and treats a stochastic process as fixed.
"Hue is adjusted with clipping, saturation with modulo."
Reversed — hue is circular () so it wraps with modulo; saturation lives in so it is clipped.
"The augmented loss removes the expectation over and only averages over transforms ."
It keeps both expectations: over the data and over ; dropping the data expectation would mean training on one image.
"Cutout must fill the masked box with zeros; noise would leak information."
Either zeros or random values are valid fills; the point is occlusion, and random noise is a common, sometimes preferred, choice.
"A larger rotation range is strictly better because it shows more variety."
Large rotations push objects partly out of frame and off the natural orientation distribution, hurting generalization — variety must stay plausible.

Why questions

Answer the mechanism, not just the fact.

Why does augmentation help generalization rather than just slowing training?
Because it forces the model to learn features invariant to the transforms, and invariant features are precisely the ones that transfer to unseen data — the core mechanism behind generalization.
Why must augmentations be label-preserving?
If the transform changed the true label, you'd be training on wrong targets; the augmented pair is only valid supervision when a human would still assign to .
Why do we resize after cropping in Random Resized Crop?
The network expects a fixed input size; cropping creates the variation, then resizing restores the shape the architecture requires without discarding that variation.
Why does MixUp improve probability calibration?
Training on blended inputs with blended soft labels teaches the model to output graded confidence, so its predicted probabilities track true likelihood instead of collapsing to overconfident 0/1.
Why does Cutout count as regularization?
By randomly removing discriminative regions it prevents the model from relying on a single shortcut feature, penalizing over-dependence just as an explicit regularizer penalizes overfit solutions.
Why is trigonometric identity the tool used in the rotation derivation?
The angle-addition formulas convert "increase the polar angle by " into a linear map (matrix multiply), which is both exact and cheap to compute per pixel.
Why can augmentation be seen as approximating ?
Realistic transforms of a training image generate points near it that plausibly appear at test time, so they act as extra draws from the true distribution around each known example.

Edge cases

The boundaries where naive intuition breaks.

What happens when in MixUp?
You recover the original example unchanged — MixUp degenerates gracefully to standard training at the endpoints, which is why small (favoring ) stays close to normal.
What if a rotation moves the object partly outside the frame?
The cropped-away region becomes empty/padded background; if the discriminative part is lost the transform stops being label-preserving, which is why rotation ranges are kept modest.
What does (contrast) with do?
Nothing — it's the identity transform ; the augmentation library still "applies" it but the image is unchanged, the degenerate no-op case.
For a task that is genuinely rotation-invariant (e.g. round cell images), what rotation range is appropriate?
The full range is valid, because no orientation is canonical — the usual cap is a natural-image concession, not a universal law.
What happens if you augment so heavily that training accuracy stays low and matches validation?
You've crossed into underfitting — the augmented task is harder than reality; the fix is to soften the transforms, the mirror-image failure of overfitting in 5.2.3-Overfitting-vs-underfitting.
When is augmentation redundant with a good pre-trained backbone?
Rarely fully redundant, but with strong transfer learning the backbone already encodes many invariances, so aggressive augmentation adds less and can even conflict with learned features.
What is the label of a MixUp example when both parents share the same class?
It stays a (soft) one-hot for that single class since — mixing within a class only perturbs pixels, not the target.
Recall One-line self-test

Name three transforms that are label-preserving for natural photos but NOT for text/medical images. ::: Horizontal flip, vertical flip, and large rotations — each can reverse or reorient meaning that those domains treat as canonical.