3.2.13 · D1Training Deep Networks

Foundations — Data augmentation strategies

1,911 words9 min readBack to topic

Before you can read the parent note Data augmentation strategies without stumbling, you need to own every symbol it throws at you. Below, each symbol is introduced only after the one it depends on. Nothing is used before it is built.


1. What is a training example?

The little subscript in just means "the -th example." If we have examples, runs .


2. The label as a list of numbers: one-hot

Computers can't store the word "cat." So a label with, say, 2 possible classes (cat, dog) becomes a short list:

The reason the parent note can later write ("70% cat, 30% dog") is that a label is already a list of numbers, so we are allowed to make those numbers fractions. You could not do that with the plain word "cat."


3. The network as a function:

If you've met Convolutional Neural Networks, that is one specific design of the box that is especially good at images.


4. Measuring "how wrong": the loss

Picture a bathroom scale that weighs mistakes: feed in "guessed dog, truth was cat" and it reads a big number.


5. Summing over the dataset: and the average

Divide that sum by (the number of examples) and you get the average. So

reads in plain words: "the average mistake over all training examples." (big script-L) is the total loss we try to make small; the little was one example's loss.


6. Randomness: and the expectation

This is the one genuinely new piece of machinery, so we go slow.


7. Putting it together: the augmented risk

Now every symbol in the parent's headline formula is defined:

Compare with plain ERM: the only new thing is the inner — "average over augmentations." That single insertion is the entire mathematical content of data augmentation.


8. Why one random transform per batch is "unbiased": Monte-Carlo

Since we can't compute the infinite average , each epoch we draw one fresh per image and use its loss. Because was drawn from the correct recipe , its expected value is the quantity we wanted. So ordinary SGD, run over many epochs, silently averages out to .

The little hat means "an estimate of," not the exact thing.


9. The Greek letters in the mixing formulas: and

The tilde (as in ) just means "the new, augmented version."


10. The two words the whole topic exists for


Prerequisite map

input x and label y

one-hot label as numbers

network f theta

loss l compares guess vs truth

ERM average over dataset

random transform t from P of T

expectation E averages over transforms

augmented risk L aug

Monte Carlo one transform per batch

mixing lambda and Beta alpha

invariance and regularization

Data augmentation strategies


Equipment checklist

Self-test: can you say each in one plain sentence before revealing?

What does mean?
The -th input image; a grid of pixel numbers.
What does mean?
The true label of example , written as a one-hot list of numbers.
What does the subscript in stand for?
All the tunable knobs (weights) inside the network.
What does compute?
A single number measuring how wrong the network's guess was on example .
What does do?
Adds up a quantity over all examples and takes the average.
What does mean?
A single transformation is randomly drawn from the recipe over the family .
What does mean?
The long-run average value if you repeated the random draw of forever.
Why is one transform per minibatch "unbiased"?
It's a Monte-Carlo sample from the correct recipe, so its expected value equals the true augmented loss.
What is in Mixup?
A blending weight in : how much of the first image (and its label) to keep.
Where does come from?
Drawn from a Beta distribution.
Define invariance in one line.
A change to the input that should leave the answer unchanged.
Define regularization in one line.
Any method that curbs memorization and improves generalization.