Artificial Intelligence · Grade 6 · Chapter 7
How AI Learns
Machine learning paradigms, dataset curation, features vs labels, model evaluation, and algorithmic bias.
Lesson Overview
Learning Objectives
- ML Paradigms: Differentiate Supervised, Unsupervised, and Reinforcement Learning.
- Features & Labels: Extract input feature vectors and ground-truth target labels from raw data.
- Dataset Splitting: Understand why training data must be separated from testing data.
- Identify Model Pitfalls: Recognize Overfitting, Underfitting, and Algorithmic Bias (GIGO).
Connecting Concepts
How Does Data Become "Intelligence"?
Human Learning
A child sees 20 different dogs, notices 4 legs, barking, and fur, and recognizes a dog forever after.
Machine Learning
An algorithm processes 50,000 labeled images, calculates mathematical feature weights, and builds a prediction model.
Case Study
The Failed Apple Sorting AI
A factory trained an AI to sort apples by feeding it 10,000 photos of pristine Red Delicious apples. On day 1 of factory operations, a farmer brought a crate of Green Granny Smith apples — and the AI rejected ALL of them as "rocks"!
Smartboard Challenge: What was wrong with the training data? Did the AI learn "apple", or did it only learn "red"?
ML Paradigm #1
Supervised Learning (Teacher & Answer Key)
The algorithm learns from labeled training data where every input comes with its ground-truth answer.
EXAMPLE
Email Spam Classifier
Inputs: Email messages
Labels: Spam or Not Spam
MECHANISM
Error Minimization
Model predicts a label, checks the correct answer, and adjusts mathematical weights to reduce error.
ML Paradigm #2
Unsupervised Learning (Pattern Discovery)
The algorithm explores unlabeled data to discover hidden groupings or patterns on its own.
CLUSTERING
Customer Segmentation
Group shopping habits into 4 clusters without human predefined labels.
ANOMALY DETECTION
Fraud Detection
Flags unusual credit card transactions that deviate from normal spending patterns.
Data Anatomy
Features vs Target Labels
🔍 FEATURES (Inputs)
Measurable attributes extracted from data. Example for Fruit: Weight: 150g, Color: Yellow, Shape: Curved.
🏷️ LABELS (Outputs)
The ground-truth answer category the model learns to predict. Example: "Banana".
Engineering Lifecycle
The 5 Steps of Machine Learning
STEP 1
Collect Data
Gather 10,000 diverse sample items.
STEP 2
Label Features
Extract features & annotate ground truth.
STEP 3
Train Model
Algorithm learns weights on 80% data.
STEP 4
Evaluate Test
Test accuracy on 20% unseen data.
Interactive Exploration
Teachable Machine Mechanics
How browser-based vision training works step-by-step:
1. Sample Capture
Webcam records 50 snapshots of Class A (Pen) and 50 of Class B (Eraser).
2. Feature Extraction
Pre-trained neural net converts webcam pixels into numeric feature vectors.
3. Real-Time Inference
Outputs live confidence percentages (e.g. 96% Pen / 4% Eraser).
Evaluation Standard
Why We Split Data (80% / 20%)
📚 Training Set (80%)
Used strictly by the algorithm to adjust internal weights and learn pattern associations.
🧪 Testing Set (20%)
Held back in secret! Used to test if the model can accurately generalize to UNSEEN data.
Model Quality
Overfitting: The Memorization Trap
❌ Overfitted Model
Memorizes the exact noise of training images (like background wallpaper). Gets 100% on training, but FAILS on new test images!
✅ Well-Generalized Model
Learns genuine core concepts (e.g. cat ear shapes). Performs accurately on fresh real-world images.
Ethics & Data
Algorithmic Bias (Garbage In, Garbage Out)
If training data is incomplete, unbalanced, or reflects historical human prejudices, the AI model will amplify those unfair errors.
Real Example: A facial recognition system was trained on 85% light-skinned male faces. When deployed, it had a 35% error rate on darker-skinned female faces!
ML Paradigm #3
Reinforcement Learning (Trial & Reward)
AGENT & ENVIRONMENT
Learning by Playing
An AI agent plays millions of games of Chess or Mario, receiving +1 points for winning moves and -1 for losing moves.
POLICIES
Optimal Strategy
Discovers superhuman strategies that humans never conceived!
Smartboard Challenge
Feature Extraction Matrix
Complete the Feature Table for sorting vehicles:
Item A: 2 Wheels, No Motor, Has Pedals ➔ Label: Bicycle
Item B: 4 Wheels, Electric Motor, Has Steering Wheel ➔ Label: Car
Solve on smartboard: What features would distinguish a Motorcycle from a Bicycle?
Smartboard Challenge
Spot the Dataset Flaw
A school builds an AI to predict student athletic performance. They collect data ONLY from the school's Senior Basketball Team (ages 17-18).
They test the AI model on Grade 6 students (ages 11-12).
Group Discussion: Why will this AI fail completely? Name two types of bias present!
Myth Buster
"More Data Solves Everything"
❌ Quantity Myth
Adding 1,000,000 pictures of the exact same brown dog does NOT help the model recognize white or black dogs!
✅ Diversity Matters
Dataset variety, cleanliness, and balanced representation are far more critical than raw volume.
Model Evaluation
Calculating Test Set Accuracy
// Testing 100 unseen images:
Correctly Predicted: 88 images
Incorrectly Predicted: 12 images
Accuracy Rate = (88 / 100) * 100 = 88% Accuracy
Class Exercise: Is 88% accuracy good enough for a hospital medical scanner? What about a movie recommendation app?
Spot The Error
Why is this AI Engineer Cheating?
An engineer trained an image AI on 500 car photos. To show off to their boss, they tested the AI using the exact same 500 car photos and reported 100% accuracy!
Debug Prompt: Why is testing on training data invalid? (Hint: Memorization vs True Learning).
Design Challenge
Designing a Wildlife Camera AI
Design an automated camera model to detect endangered Desert Gazelles at night.
• What inputs are collected? (Infrared thermal images).
• What features should be extracted? (Horn curvature, body height, tail shape).
• How do you ensure no dataset bias? (Include images in fog, rain, sandstorms, and night lighting).
Interactive Quiz · Question 1
What defines Supervised Machine Learning?
ATraining an AI using unlabeled data without ground-truth targets
BTraining an AI using labeled datasets containing inputs and correct answer targets
CWriting step-by-step if/else rules manually
DAllowing robots to move around without software
Click to reveal answer
Interactive Quiz · Question 2
Why must a separate Testing Dataset be kept secret during model training?
ATo save computer memory space
BTo measure how well the AI model generalizes to new, unseen real-world data
CBecause testing data contains corrupted file formats
DTo prevent the model from learning too fast
Click to reveal answer
Interactive Quiz · Question 3
What is a Feature in Machine Learning?
AThe final answer label returned by the AI
BA measurable property or attribute extracted from input data
CA hardware component inside a graphics card
DA software bug in Python
Click to reveal answer
Lesson Recap
Summary of Key Takeaways
- Paradigms: Supervised (labeled), Unsupervised (unlabeled), Reinforcement (rewards).
- Features & Labels: Features are input metrics; Labels are prediction targets.
- Dataset Split: Train on 80% to learn weights; Test on 20% unseen data for true accuracy.
- Data Quality: Biased, skewed training data produces flawed, discriminatory AI models.
Exit Ticket
Before You Leave
Write down in your notebook:
1. Name 2 features and 1 label for an AI system that identifies healthy vs sick plant leaves.
2. Explain what happens when a machine learning model is overfitted.
Next Chapter: AI in Action — Ethics, Deepfakes, Generative AI & Future Impact!