Image Classification

test-time augmentation

Test-time augmentation improves predictions by applying augmentations at inference rather than only during training. For each test image you generate several transformed versions, for example the original plus its horizontal flip, a few crops, and maybe small scale changes, run all of them through the same model, and average the resulting class probabilities into a single, more reliable prediction.

The intuition is variance reduction by ensembling over views: each transformed view is a slightly different, noisy look at the same content, and averaging their predictions cancels out idiosyncratic errors much as an ensemble of models would, without needing to train any extra models. The classic minimal version is 'flip TTA', the original plus its horizontal mirror, and the classic heavier version is the ten-crop (four corners and centre, each plus its flip) used historically on ImageNet.

TTA reliably gives a small accuracy and calibration boost and requires no retraining, which is why it is common in competitions and high-stakes deployments. The cost is paid at inference time: averaging over n views multiplies inference compute roughly by n, so it trades latency and energy for accuracy. The augmentations used at test time should be label-preserving, meaning only transformations that do not change the correct class are valid.

Averaging the softmax outputs of an image and its horizontal flip often recovers a fraction of a percent of accuracy on ImageNet for free, at the cost of running the model twice per image.

Also called
TTA