← Neural NetworksToolsInVisionLearning Center
Generalization and Regularization · Lesson 18

Overfitting

See why excellent training scores can hide poor real-world performance.

Watch the lesson

Overfitting explained visually

1:55

Follow a memorizing student and a wolf classifier to see how models learn shortcuts.

Lesson overview

What you will learn

Recognize overfitting and improve generalization with dropout, regularization, and augmentation.

  1. Memory is not understanding
  2. Watch the performance gap
  3. Recognize the causes
  4. Respond deliberately
01

Memory is not understanding

A model overfits when it learns training-specific details instead of patterns that survive new conditions.

02

Watch the performance gap

Decreasing training loss alongside worsening validation loss is a common warning sign.

03

Recognize the causes

Small datasets, excessive complexity, repeated images, noise, and narrow conditions increase risk.

04

Respond deliberately

Varied data, simpler models, early stopping, and regularization can reduce overfitting.

Knowledge check

Quick check: test your understanding

What is overfitting?

Learning training-specific details that fail on new data.

What performance pattern warns us?

Training improves while validation stops improving or worsens.

Name one response.

Use more varied data, simplify the model, stop early, or regularize.

Accessible referenceLesson 18 transcript236 words · Matches the published narration and captionsOpen transcript

A model can earn excellent scores during training and still fail in the real world. This happens when it learns details that belong only to the training examples.

Imagine a student preparing for an exam by memorizing the position of every answer on one practice sheet. The student appears perfect when the same sheet returns. Change the questions, and the performance collapses. The student memorized the sheet instead of learning the subject.

A neural network can behave the same way. Suppose every training image of a wolf contains snow, while every dog appears on grass. A powerful network may use the background as a shortcut. It predicts wolf when it sees snow, even when the animal is a dog.

Overfitting usually appears as a growing gap between training and validation performance. Training loss keeps decreasing, while validation loss stops improving or begins to rise.

Small datasets and overly complex models increase this risk. Noise, accidental marks, repeated images, or narrow camera conditions can also create misleading patterns.

We can respond in several ways. More varied data gives the model better evidence. A simpler model has fewer opportunities to memorize noise. Early stopping ends training when validation performance stops improving. Regularization discourages fragile solutions.

The goal is not perfect memory. The goal is a pattern that survives new conditions. In the next lesson, we will meet a regularization method that temporarily removes random neurons during training: dropout.