Image classification, first principles
Plan, train and honestly evaluate an image classifier, from defining classes to studying its mistakes
A taste of a lesson
My recycling classifier gets 92 percent accuracy, but users say it is often wrong on glass. How can both be true?
Overall accuracy averages across all images, so a common class that works well can hide a rare class that fails. If glass is only a small share of your test set, the model could miss half of the glass items and still score 92 percent. Look at per class recall for glass and at the confusion matrix row for glass: which class does it get mistaken for? Then open 20 of those wrong glass images and look for a pattern, such as clear bottles against white backgrounds. Quick check: if glass is 5 percent of the test set, what is the lowest overall accuracy you could get with zero glass correct and everything else right?
Written by the teacher as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong.
What you will be able to do
- Define classes and labelling rules that different people would apply the same way
- Collect and split image data so test results reflect real use
- Fine tune a pretrained model and compare it against a simple baseline
- Read a confusion matrix, per class metrics and top-k accuracy
- Run an error analysis and choose the next fix based on evidence
Lesson plan
- 1 Defining the task and the classes Turn a vague goal into a classification task with clear, testable class definitions. Start
- 2 Collecting data that matches real use Gather images that look like what the model will meet after launch. Start
- 3 Pretrained models and honest splits Fine tune a pretrained backbone and keep the test set truly unseen. Start
- 4 Metrics beyond accuracy Evaluate a classifier with per class metrics, a confusion matrix and top-k accuracy. Start
- 5 Confidence and calibration Interpret model scores sensibly and decide when to defer to a person. Start
- 6 Error analysis and distribution shift Study real failures, fix the largest cause first and watch for changing conditions. Start
Try asking
About this tutor
For beginners who want to build an image classifier that works on real photos, not just on a tutorial dataset. This tutor focuses on the task and the workflow rather than network internals: defining classes clearly, collecting images that match how the model will be used, starting from a pretrained model, splitting data honestly, and reading results beyond a single accuracy number. You will learn to use a confusion matrix, per class precision and recall, top-k accuracy and a quick look at calibration, then practise error analysis by sorting real failures into causes. Each lesson uses a running example, such as sorting photos of recyclable items, and ends with a decision you make and justify.
Reviews
4.7
3 ratingsSample
- Lucia M.Sample
The error analysis lesson changed how I work. Tagging 50 failures showed that a third were labelling mistakes from my own team, not model problems.
- Ahmed R.Sample
Very clear on metrics. I wanted more about collecting data on a tight budget, but the advice on matching real cameras was spot on for my shop project.
- Ingrid P.Sample
Free and genuinely useful. Writing class definitions before labelling saved me from redoing hundreds of labels.
About the teacher
Computer vision taught through real images, real failure cases and careful evaluation
9 tutors 406 lessons taught Sample
I teach computer vision: classification, detection, segmentation, document understanding, video and the newer models that combine images with language. Most of my work has been building vision systems that had to hold up outside the lab, under odd lighting, unusual cameras and labels that were not quite consistent. So my lessons spend as much time on data and evaluation as...
See Noor's profile and tutorsMore like this
Other tutors on the same or nearby topics.