Lesson prep · computer vision
Everything you need to run the session: the concepts (with the parts students get wrong), a timed lesson flow, experiments mapped to ideas, discussion prompts, and a glossary. Skim it once; teach from the flow.
01 · The big picture
Students use a robot's live camera to build a system that finds faces and recognizes who's who, then greets them by voice. Along the way they discover the real engineering: it isn't “does it work” but “what's the right tradeoff.”
02 · Concepts (the teacher's version)
A detector finds faces and draws boxes; it doesn't care who. A recognizer takes each face and figures out who it is. They're separate, swappable models. The detector runs in both modes (you always find a face first); the recognizer only matters when you want a name.
You can't compare faces pixel-by-pixel — light and angle change every pixel. A neural network (trained on millions of faces) turns a face into a faceprint: a fixed list of numbers, i.e. a point in a high-dimensional space. Same person → nearby points; different people → far apart. Identity becomes geometry: measure the distance.
The match threshold is the largest distance still counted as “same person.” It belongs to the recognizer, not the detector. Crucially it's a distance, not a confidence percentage, so:
| Move | Effect | Failure it causes |
|---|---|---|
| threshold DOWN | only near-perfect matches count — stricter | false negative (misses a real person) |
| threshold UP | loose matches count — more forgiving | false positive (mistakes a stranger) |
Lower = stricter. Each recognizer produces embeddings on its own scale, so each needs its own threshold (e.g. Facenet512 ≈ 0.30, ArcFace ≈ 0.68). The lab sets this automatically when you change the recognizer — that's why arbitrary detector×recognizer pairings “just work” here.
Heavier models are usually more accurate but slower and use more memory. Two live numbers tell the story: camera fps (frames arriving) vs. process fps (frames finished). When camera fps > process fps, the compute is the bottleneck, not the camera. Two levers: pick a lighter model, or shrink the image (Full → Fast).
The same task can run on a laptop (big models) or on the robot's own small computer (light models, tiny memory). Running on the device means millisecond answers, no internet needed, and the video never leaves the robot — the direction phones, cars, and robots are all heading.
Misconceptions to pre-empt
03 · Run of show
recognize ms change. Point: this only answers where, not who.04 · Experiments → concepts
| Activity | Concept | What to look for | Ask the class |
|---|---|---|---|
| Switch detectors | speed vs. accuracy | recognize ms swings; some detectors miss faces | Why is the fast one sometimes wrong? |
| Tune threshold | false neg vs. false pos | the same face flips between known/unknown | Which error is worse here, and why? |
| Full → Fast | resolution & compute cost | picture blurs; process fps jumps up | What did we trade away for speed? |
| Laptop vs. device | edge AI tradeoffs | different recognize ms and mem MB | When would you run on the robot itself? |
| Draw a zone | scoping / triggers | faces outside the box are ignored | Where is “only react in this area” useful? |
05 · Talk about it
Q. Which control decides “who is it” — detector or recognizer?
A. The recognizer. The detector only finds where faces are.
Q. You lower the threshold. Does the robot recognize more people or fewer?
A. Fewer — lower is stricter (more false negatives).
Q. Camera fps is 25 and process fps is 2. What's the bottleneck?
A. Compute — frames arrive faster than the model can process them.
Q. Switching to a faster detector but it now misses a far-away face. What happened?
A. You traded accuracy (especially on small/distant faces) for speed.
06 · Curriculum fit
This lab lines up with the standard face-pipeline framing — with one correction worth making explicit to students:
| Your term | In this lab |
|---|---|
| Enrollment | Click a face → type a name. Stores that person's faceprint (embedding). |
| Inference | The live loop: make a faceprint of each face, compare to enrolled ones. |
| Confidence thresholding | Present, but it's a distance, not a percentage: lower = stricter. Frame the “thresholding game” that way so students tune in the right direction. |
| Feature template / signature | The faceprint/embedding — produced by the deep recognizer, not from facial landmarks (landmarks just align the face first). |
07 · Glossary
| Detection | Finding that a face is present and where (a box). No identity. |
| Recognition | Deciding whose face it is, by comparing to known people. |
| Detector / Recognizer | The model that finds faces / the model that identifies them. |
| Embedding / faceprint | A face turned into a fixed list of numbers (a point in space). |
| Distance | How far apart two faceprints are; small = alike. |
| Match threshold | Max distance still counted as the same person. Lower = stricter. |
| False positive / negative | Wrongly matching a stranger / wrongly missing a known person. |
| Enrollment | Registering a person by saving their faceprint. |
| Inference | Running the model live to get an answer. |
| Edge / on-device / NPU | Running the model on the device itself; an NPU is a chip built for that. |