Principles of AI · Unit 1: Inside the Machine · Project 1.1.4

Deep Dive: Classifier & Model Card

🔬 Deep Dive
This is your textbook for this project. Take your time. Read it more than once.
Principles of AI · 1.1.4Concept

What a Model Card Is

model card = what it does · what it learned from · how it was tested · where it fails

A model card is a short report that travels with a trained model. It answers the questions a stranger would need answered before deciding whether to rely on it. The idea comes from AI researchers who noticed that models were being shared with a single score and no explanation.

In 1.1.2 you saw why one number can mislead. A model card is the fix: it puts the number next to the data it came from, the test it passed, and the situations where it breaks.

A card, line by line

Example model card · Desk-side recycling sorter
What it does
Looks at a photo of one item and says paper, plastic bottle, metal can.
Intended use
A classroom demo that helps students practice sorting. A person checks every answer.
Not for
Sorting at a real recycling plant, anything with food residue, anything not on the list of three, or any decision where a mistake costs money or safety.
Training data
75 photos taken by the team (25 per class), on two desks, indoors, in daylight and under ceiling lights.
Test data
30 different photos (10, 10, 10 per class) taken a day later on a third desk. None were used for training.
Results
Overall accuracy 77% (23 of 30). Recall: paper 90%, plastic bottle 70%, metal can 70%.
Known failures
Most common mistake: a metal can labeled as plastic bottle (3 times). Crushed cans and shiny plastic look alike in dim light.
Limits
Only 30 test images, so these numbers could move a lot with a different set. Never tested outdoors.
The matrix behind that card
actual ↓ / predicted →paperplastic bottlemetal cantotalrecall
paper9101090%
plastic bottle1721070%
metal can0371070%
precision90%64%78%accuracy 77%

Green cells are correct. Orange cells are mistakes. Recall asks: of the items that really were this class, how many did it find? Precision asks: when it said this class, how often was it right?

ExampleCheck the card against the matrix

The card says accuracy was 77%. Can you get that from the matrix yourself?

Step 1 — Add up the correct answers
The green diagonal is 9 + 7 + 7 = 23.
🔑A good card is allowed to say "not good at this." A card that lists only strengths is an ad, not a report.
Principles of AI · 1.1.4Skill

Pick a Problem Worth Solving

Start with a real need, not a cool model. Ask who would use this, what they do now, and what happens when the classifier is wrong. If a wrong answer is harmless, a student project is a fair place to try it. If a wrong answer could hurt someone, it is not.

The project has four rules for a reason. No people or faces keeps everyone's privacy safe and avoids the biased-data problems you met in 1.1.2. Nothing medical, safety-critical or about security keeps mistakes cheap. Collectable means you can actually photograph enough. Distinct classes means the label is a fact, not an opinion.

Idea screener · pick an idea and see which rules it passes
  • ✓Objects only: no photos of people or faces
  • ✓Low stakes: no medical, safety or security use
  • ✓You can collect at least 35 photos per class in the time you have
  • ✓The classes are visibly different and the label is not a matter of opinion
Good project idea. Photos are easy to take, the tools look different, and a mistake is harmless.
💡Each class needs at least 25 training and 10 test images, so a 3-class project needs 105 photos at minimum. Choose two classes if your idea is hard to photograph.
Principles of AI · 1.1.4Skill⚠ Watch Out

Collect Data Fairly

Where images are allowed to come from

  • Photos you take yourselves. The simplest option, and you know exactly what is in them.
  • Photos someone gave you permission to use. Ask first, and write down who said yes.
  • Openly licensed images. Some licenses, such as Creative Commons, allow reuse if you follow their terms, which often include giving credit. Read the specific license; they are not all the same.

Seeing an image online does not mean you may use it. Keep a simple source list: where each group of images came from and what permission you had. Your model card will refer to it.

Keep the test set honest

The test set exists to answer one question: how does the model do on things it has never seen? If any test image, or a near copy of one, was used in training, the answer is meaningless. This is called leakage. The safest plan is to collect test images separately, on a different day or place, and put them away before you train.

collect the test set separately · lock it away · train only on training
Spot the problem · is this test trustworthy?

1. A team takes 40 photos of mugs in one session, holding the camera steady and nudging each mug a little between shots. They randomly put 30 in training and 10 in test.

2. A team takes training photos on Monday at the lab bench. On Wednesday they take test photos at a different table with different items of the same kind.

3. A team downloads one openly licensed photo of a wrench and uses it as a training image. Later they use the same photo as a test image.

4. A team's first model scores poorly. They add the test images to training, retrain, and report the new score on the same test images.

5. A team photographs every ripe banana on a white desk and every unripe banana on the green classroom carpet.

⚠️Balance matters too. If one class has 60 images and another has 25, the model can lean toward the big one. Aim for similar counts, and vary lighting, angle and background inside every class.
Principles of AI · 1.1.4Skill⚠ Watch Out

Failures, Claims, and Honest Limits

After testing, go through the images the model got wrong. Each mistake is a clue. For every failure case, write what the item was, what the model said, and your best guess why. A guess is fine as long as you call it a guess.

Common reasons a classifier fails
CauseWhat it looks likeWhat you can do
Look-alikesTwo classes share shape, color or texture.Add more varied examples of both, or admit the model can't tell them apart.
Lighting and backgroundIt learned the setting instead of the object.Photograph each class in the same mix of places and light.
Angle and sizeTop-down shots in training, side views in test.Collect the angles a user would actually use.
Too little dataA class with few examples gets mistaken often.Add training images, and report the limit honestly if you can't.
Wrong labelA photo was put in the wrong folder.Re-check labels. A single wrong label in a small set matters.

Make claims the data can carry

Every sentence on your card should be checkable against your matrix. Watch for three traps: a high overall score that hides a weak class, a perfect score on a small test set (which is more likely luck or leakage than perfection), and a claim about the real world from a classroom test.

Claim checker · does the matrix back it up?
actual ↓ / predicted →healthy leafspotted leaftotalrecall
healthy leaf1912095%
spotted leaf461060%
precision83%86%accuracy 83%

"Overall, our checker was right on about 83% of the test images."

"It's good at finding spotted leaves."

"When it says a leaf is healthy, it is usually right."

"This can be trusted to protect a farmer's crop."

🔑If another team can't find a claim on your card that the numbers fail to support, you wrote an honest card.
← Back to Project 1.1.4📋 Project Page →