Seeing as computation / 2 of 6
Image classification
What you’ll learn
- Explain the main idea of “Image classification” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
Image classification assigns one or more labels to an image. The target may describe an object or scene, but classification does not specify where an object is located. Labels and sampling must match the intended environment.
Begin with the numeric image representation and the exact target the model must predict. Image classification, detection, and segmentation use different labels and evaluation rules. Changes in lighting, camera, geography, and resolution can create distribution shifts even when the subject appears unchanged to a person.
Under the hood
Single-label classification often uses softmax with cross-entropy. Multilabel classification commonly uses independent sigmoid outputs. Augmentations should preserve the label; some rotations or crops can change meaning.
A model may exploit backgrounds rather than the intended object.
A worked example
A photo containing both a bicycle and a person needs multilabel targets if both categories matter.
How to use this way of thinking
Inspect inputs after preprocessing, not only the original files. Visualize labels and predictions together. Evaluate small objects, rare classes, and unfamiliar capture conditions separately. If a transformation changes the label meaning, it is not a valid augmentation for that task.
Try it yourself
How would you check whether a cow classifier relies on grass backgrounds?
Key takeaways
- Image-level labels or probabilities
- A model may exploit backgrounds rather than the intended object.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Stanford CS231n notes (opens a new tab)Hugging Face Diffusers documentation (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.