Course contentsShow
← Machine Learning and Deep Learning
Lesson 773 of 3,53818. Regularization Techniques for Deep NetworksFree lesson

Test-Time Augmentation

Averaging predictions over multiple augmented versions of test inputs to improve accuracy.

Test-Time Augmentation

What you'll learn: How to boost model accuracy at inference time by combining predictions across multiple augmented versions of the same test input.

The Core Idea

Test-Time Augmentation (TTA) flips the script on data augmentation. Instead of augmenting training data to help the model learn robust features, you augment the test data to get more reliable predictions.

Here's how it works: when you need to predict on a single test image, you create several augmented copies (rotations, flips, crops, brightness adjustments, etc.). You run each version through your trained model, collect all the predictions, and average them together to produce a final, more stable output.

Why It Works

Think of TTA like asking several slightly different versions of the same question to an expert. If you show a doctor an X-ray from multiple angles and lighting conditions, their combined assessment is usually more accurate than a single glance.

Each augmented view gives the model a slightly different perspective on the same input. By averaging predictions, you:

  • Reduce variance in individual predictions
  • Smooth out sensitivity to minor input variations
  • Create an implicit ensemble without training multiple models

The Trade-off

TTA improves accuracy at the cost of inference time. If you use 10 augmentations, prediction takes ~10× longer. This is acceptable for scenarios where accuracy matters more than speed (medical diagnosis, competition leaderboards), but impractical for real-time applications.

Common TTA Strategy

For image classification: horizontal flip, small rotations (±5°), and slight crops. Average the predicted probabilities (or class logits) across all versions before making the final decision.

Key Takeaway: Test-Time Augmentation trades inference speed for improved accuracy by averaging predictions over multiple augmented versions of each test input—essentially creating an ensemble from a single model.