Learning Goals
5 minBy the end of this lesson you can:
- Explain that a label names the category of an example.
- Design clear, separate categories (classes) for a model.
- Explain why messy categories make a worse AI.
Warm-Up · How Many Groups?
8 minLast lesson Quick, Draw! sorted doodles into words. Those words were its categories.
How would you sort these into groups: 🍎 🍌 🐱 🐶 🍇 🐰 ? How many groups, and what would you call them?
Reveal one answer
Two groups: fruit (🍎🍌🍇) and animals (🐱🐶🐰). "Fruit" and "animals" are the labels for your categories.
New Concept · Boxes for the World
18 minLabels and categories
A category (also called a class) is a group, like "cat" or "dog". A label is the category name we attach to one example.
Think of sorting your room into boxes. The boxes are the categories; writing "LEGO" on a box is the label.
What makes a category good?
- Clear — everyone agrees what belongs in it.
- Separate — categories don't overlap.
- Balanced — roughly the same number of examples each.
The categories you pick are the only things the AI can ever say. Choose "cat" and "dog", and it can never say "rabbit".
Worked Example · A Fruit Classifier
18 minLakshmi wants an AI that names local fruit from a photo. She chooses three clear classes:
- rambutan
- durian
- mangosteen
These are good categories — clear, separate, and easy to collect balanced examples for.
A bad set of categories
Compare these poor choices and why they fail:
| Bad category | Problem |
|---|---|
| "fruit" and "rambutan" | Overlapping — a rambutan is a fruit. |
| "nice fruit" and "yucky fruit" | Not clear — people disagree. |
| "round things" | Too broad — a ball isn't fruit. |
Spend time choosing clean categories before collecting data. Good boxes make an AI that's easy to train and trust.
Try It Yourself
20 minUse your worksheet.
Sort these into two clear categories and name them: teh tarik, kopi-O, nasi lemak, roti canai, milo ais, satay.
Hint
Think "drinks" and "food".
An AI uses the classes "animal", "cat", and "pet". Explain what's wrong, then rewrite them into three clean, separate classes.
Hint
These overlap — a cat is an animal and a pet. Pick categories that don't contain each other.
Mini-Challenge · Design Three Clean Classes
12 minDesign a classifier for the contents of a school bag. Choose three clear, separate categories and give two example items for each.
It works if no item could belong to two of your categories, and a classmate agrees with your sorting.
Show one good design
Classes: "books" (textbook, notebook), "stationery" (pencil, ruler), "food" (water bottle, kuih). Clear and non-overlapping.
Recap
5 minA category is a group; a label is the category name on one example. Good categories are clear, separate and balanced. The classes you choose decide everything the AI can tell apart.
Vocabulary Card
- category (class)
- A group an AI can sort examples into, like "cat" or "dog".
- label
- The category name attached to one example.
- overlap
- When two categories share members — a sign the categories need fixing.
Homework · Categorise a Collection
≤ 20 minPick a collection at home — clothes, snacks, toys, coins. Design three clear, separate categories for it, name them, and list three example items in each.
Sample · My Snack Shelf
Sweet: kuih, chocolate, kaya toast. Savoury: keropok, peanuts, crackers. Drinks: milo, sirap, plain water.
Yours will be different — three clean, non-overlapping categories is the goal.