Overfitting
See why excellent training scores can hide poor real-world performance.
Overfitting explained visually
Follow a memorizing student and a wolf classifier to see how models learn shortcuts.
What you will learn
Recognize overfitting and improve generalization with dropout, regularization, and augmentation.
Memory is not understanding
A model overfits when it learns training-specific details instead of patterns that survive new conditions.
Watch the performance gap
Decreasing training loss alongside worsening validation loss is a common warning sign.
Recognize the causes
Small datasets, excessive complexity, repeated images, noise, and narrow conditions increase risk.
Respond deliberately
Varied data, simpler models, early stopping, and regularization can reduce overfitting.
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.