Session 5: Face Sensing Smiles
Session Architect: Muhammad Bilal
Duration: 50–60 minutes
Equipment Required:
- M3D Robotics Kit (robot with display attachment)
- Laptops with Scratch pre-installed
- Scratch Face Detection Extension enabled
- Whiteboard or chart to show facial features
- Paper and pencils for students to note observations
Learning Objectives:
- Understand how robots detect faces and respond to facial shapes.
- Explore basic AI concepts: what the robot can and cannot detect about emotions.
- Learn to code if-then logic to make robots react to facial expressions.
- Connect biology of facial expressions with AI sensing.
Resources:
Scratch Code for the Session: AI Lab - Session 5.sb3
1. Introduction & Discussion (5 minutes)
Instructions:
- Start by asking students:
“Have you ever noticed how we can tell if someone is happy, sad, or surprised just by looking at their face?”
Ask to them list different emotions and expression they have observed around them
Teacher’s Role:
- Guide students to share examples from their daily life: smiles from friends, frowns from teachers, pets’ faces.
2. Charades: Exploring Facial Expressions (5 minutes)
Activity 1: Emotion Charades
Instructions:
- Ask students to take turns showing different facial expressions silently (smile, frown, surprise, anger).
- Classmates guess the emotion being shown.
- Discuss which parts of the face helped them identify the emotion (eyes, mouth, eyebrows).
Lead them to the discussion:
"Was it just the shape of your classmates face which helped you identify the emotions or was it something else as well?"
"If it’s just shapes, can you code the robot to identify emotions?"
Teacher’s Role:
- Highlight observations like:
“Notice how a smile is not just a curve of the lips — sometimes eyes squint too!”
- Emphasize that humans use many cues, not just one, to read emotions.
- Reinforce that emotions are more than just shapes — they involve feelings inside the person.
3. Teacher Demonstration: Robot Detecting a Face (5 minutes)
Activity 1: Face Detection Demo
Instructions:
- Turn on the robot and connect it to Scratch.
- Teacher shows their face to the camera.
- Robot detects the face and shows a smile emoji.
- Teacher exaggerates expressions (smile, neutral, frown) to show differences.
Teacher’s Role:
- Explain the session goal:
“Your task is to make the robot react to faces and their expressions using Scratch!”
4. Guided Coding: Face Detection & Reactions (20 minutes)
Part 1: Show the Face Detection Extension (5 minutes)
Instructions:
- Open Scratch and show the Face Detection Extension.
- Demonstrate face detection blocks and help them understand.
Teacher’s Role:
- Explain that face detection is about presence and shape, not feelings.
Part 2: Coding Face Detection (5 minutes)
Instructions:
- Ask students to code:
“If the robot detects a face, it will show a smiling emoji on it’s screen.”
- Test with each student moving in front of the camera.
Discussion:
- “What happens if more than one person is in front of the camera?”
- “What if the face moves quickly?”
Test out different situations to check the limitations of the robot.
Teacher’s Role:
- Ensure students see their robot respond.
- Clarify the difference between detecting a face vs. understanding emotion.
Part 3: Adding Conditional Reactions (10 minutes)
Instructions:
- Introduce if-then blocks along with face detection:
- If smile detected → wave emoji
- If no face → sad emoji
Note: Some students may experience some difficulty in understanding how the if-then logic block along with not block works. The instructor may have to help students revise their previous lecture on loops and logic blocks.
- Ask students to experiment with additional reactions:
- Robot dances if smile
- Robot tries to tell a joke if neutral.
- Robot stops if no face.
Teacher’s Role:
- Encourage creativity in combining movements, emojis, and sounds.
- Highlight: “The robot reacts to shapes, not feelings.”
5. Student Extensions & Creativity (5 minutes)
Activity: Customizing Reactions
Instructions:
- Ask students to extend the robot’s behavior such as:
- Robot waves when detecting a smile
- Robot shows “thinking” emoji for neutral
- Robot plays a sound when no face detected
- Encourage combinations of emojis, movement, and sounds.
By the end of the session, students should be able to create a robot which can detect and react to a wide range of emotions with varying reactions. A sample code of that robot is available in the attached code file.
Teacher’s Role:
- Support students in testing and refining their code.
- Celebrate creative ideas and fun reactions.
6. STEM Crossover: Emotions & AI (10 minutes)
Activity: Discussion & Reflection
Instructions (suggestive for teacher):
- Begin by wrapping up the previous activities:
“Today we learned how robots can detect faces and expressions. But, do they really understand what we feel inside?”
- Invite students to share examples of when someone’s expression didn’t match how they felt. For instance:
“Have you ever seen someone smile but you knew they were sad?”
Suggested Instructor Prompts and Questions:
- Exploring robot perception:
“What do you think the robot sees when it sees a happy face? Can it feel happy too?”
(Wait for answers, then add:)
“No, robots don’t have feelings—they only notice patterns, like curves of a smile or a frown.”
“So if someone is pretending to be happy, can a robot know the difference?”
Comparing humans and robots:
“Humans can guess feelings even without seeing a face—like when a friend sounds upset on the phone. Can robots do that? What is different between us and robots when it comes to feelings?”
Guide students toward: humans have empathy, robots do not; humans feel emotions inside, robots only notice patterns outside.
“Can robots ever care about someone being sad?”
Fun explorations / examples:
“Think about emojis on your phone. When you choose a smiley face, is the phone happy too?”
“Some apps can detect if you are smiling—why do you think they do that?”
“If a robot sees someone’s surprised face, how does it know what to do? Who taught it?”
Hint that humans “teach” robots by showing examples and deciding what shapes mean which emotions. You may explore the subject of how humans “teach” emotions to a robot or you can excite them by suggesting that they will learn it in the coming sessions.
Ethics and reflection:
“Do you think it is okay for a robot to read faces in public?”
“How would you feel if a robot was watching you all the time?”
“Why do you think people might want to use robots to detect emotions?”
Discussion Points to Highlight:
- Robots only observe patterns, humans experience feelings.
- Empathy: Humans can imagine how others feel; robots cannot.
- Teaching robots: Humans decide what a robot sees as happy, sad, or surprised.
- Limits of AI perception: Robots may make mistakes if expressions are unusual, just like a human might misread someone’s mood.
Reflection / Parting Discussion:
- Wrap up:
“So, we understand that robots don’t really understand emotions—they just match certain shapes with certain feelings. But, think about this… who or what decides what a smile means to a robot?”
“Can we, humans, teach the robot ourselves what different feelings look like? How would we do it?”
- Encourage curiosity without giving answers—let students imagine ways humans could “show” robots what each emotion is.
Teacher Tips:
- Keep the tone conversational, like a story or a curiosity-led discussion.
- Use real-life references: emojis, filters, selfie apps, video calls.
- Encourage students to think critically, but don’t worry if they give imaginative answers.
- Ask follow-ups: “Why do you think that?”, “Can you give an example?”, “What might happen if the robot gets confused?”




