Produce Image Classifier Confusion Matrix
This example evaluates an image classifier trained to identify apples, oranges and bananas. The diagonal values are the correctly classified images. Apples and oranges create more confusion with each other than either does with bananas, which can guide a review of the training images, lighting conditions or class definitions. A confusion matrix is valuable because a single overall accuracy can hide this pattern. Before drawing conclusions, check that the test set contains representative images and that no class is much smaller than the others. This is a teaching example, so it uses simple labels and a compact three-class layout.
Open it in the AI editor with a prompt pre-filled — keep what works, change what doesn't.
Scenario
Students inspect how an image classifier makes class-specific errors.
Key decisions
- Use class labels: Make mistakes understandable.
- Read row patterns: See where each actual class goes.
- Compare diagonal counts: Find strong and weak classes.
When to reuse this
Use for a labeled test set where every image has one class.
Frequently asked questions
Why are rows actual classes?
What can cause class confusion?
Is accuracy enough?
Tweak it with chat, export PNG/SVG, or fork it for your own use case.