Quiz: regularisation and data augmentation

Short questions on overfitting, regularisation and augmentation. Try each on paper first, then open the answer.


Q1. A network reaches 100 % on its 20 training images and 68 % on validation images. Weight decay raises the validation loss less, but the accuracy stays at 68 %. Why can weight decay not fix this?

What is missing from the 20 training images?

Weight decay makes memorising harder, but it cannot add information. If the training images lack some variation (here: cells in other directions), the network cannot learn that this variation does not matter. Augmentation (or more data) supplies it.


Q2. Name the augmentation that tells the network each of the following does not matter: (a) the direction of a cell; (b) the brightness of the microscope; (c) the exact shape of the cell outline; (d) focus.

Geometric or intensity?

  1. Rotations and flips. (b) Gain and offset (and gamma). (c) Elastic deformation. (d) A small random blur.

Q3. For a segmentation network, which augmentations must also be applied to the mask, and which must not?

Do the pixels move, or only their values?

Geometric ones (flips, rotations, zoom, elastic) must be applied to the mask with exactly the same transformation (nearest-neighbour sampling for labels). Intensity changes, noise and blur change only the image; the mask stays.


Q4. You measure GFP expression from the mean intensity of each cell. Is random gain (±30 %) a good augmentation for the cell segmentation network? For a network that predicts the expression level?

Augment with what varies, never with what you measure.

For segmentation, yes: the outline does not depend on the brightness. For predicting the expression level, no: intensity is the readout, and the augmentation would teach the network to ignore it.


Q5. Why is it a leak to augment the whole data set first and split it into training and test sets afterwards?

Where do the copies of a test image end up?

Rotated and flipped copies of the test images land in the training set: the network has seen them, and the test accuracy is too optimistic. Split first, then augment only the training images, on the fly.


Q6. The microscope has a fixed, known pixel size. Why can a zoom augmentation by ×0.5 to ×2 hurt?

What does the apparent size of an object tell the network?

At a fixed pixel size, size is information: a nucleus of 50 pixels is a nucleus, one of 100 pixels may be something else. Zooming by 2 creates objects of sizes that never occur and makes size useless as a cue. Zoom only within the real variation.


Q7. (math) Weight decay \lambda = 0.001 with plain gradient descent and \eta = 0.1. By which factor is every weight shrunk per step? After 10,000 steps without any data gradient?

The gradient of \lambda w^2 is 2\lambda w.

1 - 2\eta\lambda = 0.9998 per step; 0.9998^{10000} = e^{-2} \approx 0.14.