Computer Vision · Beginner level

Beginner level · Module 6: Introduction to Image Classification · Lesson 2 of 3

Evaluating Classifiers and Reading Their Errors

Learners compute a confusion matrix, build a gallery of misclassified images and group mistakes by cause.

In this lesson you will

  • Compute and interpret a confusion matrix
  • Analyse errors with an image gallery

Key concepts

confusion matrixper-class recallConfusionMatrixDisplayerror galleryerror causes

The lesson

A confusion matrix shows, for each true category, how images were classified. Per-class recall tells you which categories the model misses most often. ConfusionMatrixDisplay.from_predictions draws it.

Numbers alone hide why the model fails. An error gallery (a grid of misclassified images with true and predicted labels) often reveals the cause at a glance: dark photos, cluttered backgrounds, unusual angles or wrong labels.

Group errors by cause and fix the biggest group first, often by improving capture rules or preprocessing rather than changing the model.

Step by step

  1. Plot the confusion matrix for the best model.
  2. Build a gallery of 12 misclassified test images.
  3. Group the errors by cause.
  4. Apply one fix and re-measure.

Practice activity

Write an evaluation note with a confusion matrix, error gallery and one tested improvement.

Expected result: A clear evaluation and an improvement measured on the same test set.

Check your understanding

  1. What does per-class recall show?

    Show answer

    For each category, the share of its images that the model identified correctly.

  2. Why look at misclassified images?

    Show answer

    To see the causes of errors, which numbers alone do not reveal.

Further learning

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.