# 🟢 Applied AI — Beginner Level
# Session 2: How does AI learn?

**Program:** Applied AI — Yann Isola
**Public:** general public, accessible from 12 years old, no technical prerequisites
**Recommended duration:** 2 hours (adaptable 1h30 – 2h30)
**Equipment:** video projector, the interactive web page of the session (`webpage/index.html`, works offline), ideally 1 computer or tablet for 2 participants, a webcam if using Teachable Machine.

---

## 1. Educational objectives

At the end of the session, each participant should be able to:

1. **Explain in your own words** the 3 main ways in which an AI learns: supervised, unsupervised, by reinforcement — each with a real-life analogy.
2. **Understand the role of data**: the “fuel” of AI, and why quality matters as much as quantity.
3. **Distinguish training and use** (inference): learning takes time and is expensive, using is quick.
4. **Describe an artificial neuron** as a small calculator, and a neural network as layers of connected calculators.
5. **Recognize overfitting** (overlearning): when the AI ​​learns “by heart” instead of understanding.
6. **Train a mini-model yourself** (Teachable Machine or simulator integrated into the web page).

> 🎯 **The central message of the session:** AI is not magically “intelligent” — it learns from examples, like us, but differently. And like a student, she can learn poorly!

---

## 2. Express reminder of Session 1 (5 min)

Ask the question: *“Last time, we saw what an AI was. Who can remind me of that in one sentence? »*

Expected answer (or to be given): **a program that learns from examples instead of just following hand-written rules.**

Today, we open the hood: **HOW exactly does she learn?**

---

## 3. Timed unfolding

| Time | Sequence | Format |
|---|---|---|
| 0:00 – 0:05 | Home + reminder Session 1 | Discussion |
| 0:05 – 0:15 | Hook: the game of “teacher and student” | Collective game |
| 0:15 – 0:35 | The 3 ways of learning (supervised, unsupervised, reinforcement) | Presentation + analogies |
| 0:35 – 0:45 | Data: the fuel of AI | Presentation + discussion |
| 0:45 – 0:55 | Training vs. Use | Presentation + analogy |
| 0:55 – 1:10 | Artificial neurons + neural network (web page: visualizer) | Interactive demo |
| 1:10 – 1:20 | ☕ Break | — |
| 1:20 – 1:30 | Overfitting: the student who learns by heart (web page: demo) | Demo + discussion |
| 1:30 – 1:55 | 🖐️ Hands-on activity: training a mini-model | Pair workshop |
| 1:55 – 2:00 | Quiz + summary + teaser Session 3 | Quiz |

---

## 4. Detailed content, sequence by sequence

### 4.1 Hook: the “teacher and student” game (10 min)

**Goal:** bring supervised learning to life BEFORE naming it.

**Unfolded:**
1. Choose a volunteer: he becomes the “AI”. He leaves the room (or closes his eyes).
2. The group chooses a simple secret rule, for example: *“Round objects are in category A, square objects in category B”*.
3. The animator shows objects (or drawings) one by one to the “AI” and announces the correct category: *“Balloon → A. Book → B. Orange → A…”*
4. After 6-8 examples, we show a NEW object without giving the answer: *“Plate →?” »*
5. If the "AI" answers A: it has **generalized**! She learned the rule without being told.**Debriefing (essential):**
- *“Did I give him the rule? »* → No!
- *“How did he/she find it?” »* → By observing the **examples + the correct answers**.
- *“This is EXACTLY how an AI learns. »*

> 💡 **Facilitator tip:** if the volunteer doesn't find it, that's even better! We can say: *“It needs more examples — like an AI!” »* and continue. Failure is part of the demonstration.

---

### 4.2 The 3 ways of learning (20 min)

This is the heart of the session. An analogy by fashion, to be hammered home.

#### A. Supervised learning 👩‍🏫 — “the teacher who corrects papers”

**The idea:** we give the AI examples **with the correct answers** (we say that the data is "labeled"). The AI ​​makes a prediction, we compare it to the correct answer, and it corrects itself. Thousands, millions of times.

**The analogy to develop:** imagine a student doing math exercises. He suggests an answer, the teacher corrects: * “Wrong, the correct answer was 12.”* The student adjusts his method. Through corrections, he ends up knowing how to solve exercises **that he has never seen**.

**Vocabulary to introduce (simply):**
- **Input**: what we give to the AI (a photo, a text, etc.)
- **Label**: the correct associated response (“cat”, “dog”, “spam”…)
- **Error**: the gap between what the AI answered and the correct answer. Learn = reduce this error.

**Concrete examples to cite:**
- Recognize photos of cats/dogs (photos + “cat”/”dog” labels)
- Filter spam (emails + "spam"/"not spam" labels)
- Predict the price of an apartment (features + real price)

#### B. Unsupervised learning 🍬 — “sort candy without instructions”

**The idea:** this time, NO correct answers. We just give a bunch of data, and the AI ​​must find **by itself** groups, similarities, structures.

**The analogy to develop:** you are poured a huge bag of candy on the table and you are just told: * “Sort. »* Nobody tells you the categories. You will naturally group by color, or by shape, or by size. You **discovered categories** that no one had given you.

> 🎲 **Lightning mini-activity (2 min):** ask the group: *“If I gave you 1000 songs without any information, how would you sort them? »* (rhythm, ambiance, voice/instrumental…). This is what a streaming platform does to create automatic playlists.

**Concrete examples:**
- Group a store's customers by purchasing habits
- Detect “bizarre” behavior (bank fraud: an expense that does not resemble any usual group)
- Suggest “people who like X also like Y”

#### C. Reinforcement learning 🎮 — “learn a video game”

**The idea:** AI tries actions in an environment. Good deed → **reward** (points). Bad action → **punishment** (loss of points). She starts again millions of times and discovers the strategy that maximizes her points.

**The analogy to develop:** your first game of a video game. Nobody gave you the manual. You press buttons: you fall into a hole → “punishment”, you start again. You grab a coin → “reward”, you do it again. After 50 games you are much better. **Test → result → adjustment.****Concrete examples:**
- AlphaGo (the AI that beat the world go champion in 2016) has played millions of games against itself
- Robots that learn to walk (they fall thousands of times... in simulation!)
- Self-driving cars first train in simulators

**Summary table to be constructed by the group:**

| Fashion | We give him… | She learns… | Analogy |
|---|---|---|---|
| Supervised 👩‍🏫 | Examples + correct answers | To predict the correct answer | The teacher who corrects |
| Unsupervised 🍬 | Examples without answers | To find groups | Sort candy |
| Strengthening 🎮 | A playing field + points | The best strategy | Learn a video game |

> ⚠️ **Frequently asked question:** *“And how does ChatGPT learn? »* Honest and simple answer: **a mix!** First a form of learning on huge amounts of text (predicting the next word), then fine-tuning with humans writing down the answers (which is similar to reinforcement). ⚠ The exact methods are evolving quickly — it's a dynamic field.

---

### 4.3 Data: the fuel of AI (10 min)

**Message 1 — No data, no AI.** An AI that has never seen cats will never recognize a cat. Data is its fuel: it is from them, and from them alone, that it learns.

**Message 2 — More data = (often) better learning.** A student who has done 1000 exercises is generally better than one who has done 10.

**Message 3 — BUT not just any messages!** This is the most important point. Three traps:

1. **False data** → Fake AI. If the teacher corrects with a wrong answer key, the student learns wrong. (*“Garbage in, garbage out”*: waste in, waste out.)
2. **Non-varied data** → AI with blinders. If the AI ​​only saw black cats, it might miss white cats.
3. **Unbalanced or biased data** → Unfair AI. Real example to cite: recruitment AI disadvantaged women because they had been trained on predominantly male hiring histories. **AI reproduces flaws in its data.**

> 💬 **Discussion (3 min):** *“You want to create an AI that recognizes dogs. You only show him pictures of Labradors. What will happen with a chihuahua? »* → She may not recognize him as a dog. Moral: the **diversity** of data matters.

---

### 4.4 Training vs. use (10 min)

Two VERY different moments in the life of an AI:

| | 🏋️ Workout | ⚡ Usage (inference) |
|---|---|---|
| It's what ? | AI learns from data | AI answers a question |
| How long ? | Weeks, months | Less than a second |
| How much does it cost? | Very expensive (⚠ millions, or more, for the biggest AIs — the numbers change quickly) | Very few per query |
| How many times? | Once (then updates) | Billions of times a day |
| Analogy | The years of study of a doctor | A 20 minute consultation |

**The doctor analogy is the most effective:** training a doctor takes 10 years and is very expensive. But once trained, each consultation is quick. We do not re-train the doctor for each patient!

**The learned word to give:** the use is called **inference**. When you ask ChatGPT a question, it doesn't "relearn": it **uses** what it has already learned.This is why the response arrives within seconds.

> 💡 **Trick question to ask the group:** *“When I chat with ChatGPT, does it learn from our conversation? »* → No, not during the conversation: his “brain” is frozen after training. He remembers the current conversation (like notes on a draft), but he does not learn a permanent lesson from it. ⚠ Some services may use conversations for FUTURE training — hence the privacy issues (we'll talk about this in a dedicated session).

---

### 4.5 Artificial neurons and the network (15 min)

**⚠ Warning from the outset:** the analogy with the brain is **an inspiration, not a copy**. An artificial neuron is infinitely simpler than a real neuron.

#### The artificial neuron = a small calculator

An artificial neuron is a tiny box that does 3 things:
1. **It receives** signals (numbers) from other neurons.
2. **He weighs them**: some signals count a lot (high weight), others little (low weight).
3. **It decides**: if the total exceeds a threshold, it "turns on" and sends a signal in turn.

**Analogy of the nightclub bouncer:** the bouncer receives several pieces of information (age, outfit, attitude, etc.), he gives more or less importance to each (the **weights**), and he makes a decision: enter/do not enter. A neuron, that’s it.

**The key point: learn = adjust the weights.** When the AI ​​makes a mistake, it slightly modifies the importance given to each signal, in the right direction. Millions of small adjustments → AI gets better. This is the WHOLE secret of learning.

#### The network = layers of connected neurons

- **Input layer**: receives the raw data (e.g.: the pixels of an image).
- **Hidden layers**: each layer detects increasingly complex things (features → shapes → ears/whiskers → “it’s a cat!”).
- **Output layer**: gives the final answer.

**Impressing figure:** our visualizer shows around ten; ⚠ large conversational AIs have the equivalent of **hundreds of billions of weights** (parameters) — the orders of magnitude change every year.

#### 🖥️ Demo: the network viewer (web page, tab 1)

1. Project the page. Show the signals flowing from left to right, layer by layer.
2. Move the **weight sliders**: show that the output changes. *“That’s what learning does: adjust these sliders automatically. Except there are billions of them. »*
3. Use the “Autotrain” button to show self-adjusting weights.
4. Allow 2-3 volunteers to handle.

---

### 4.6 Overfitting: the student who learns by heart (10 min)

The most subtle concept of the session — but the analogy makes it crystal clear.

**The story to tell:** two students prepare for a math test with the same book of 50 corrected exercises.
- **Student A** seeks to **understand the method** behind each exercise.
- **Student B** **learns the 50 answers by heart**: “exercise 12 → answer 42”.

On the day of the test, the teacher gives **new** exercises (but of the same type).
- Student A: succeeds. He **generalized**.
- Student B: totally fails. He only knew how to recite.

**Student B is overfitting**. The AI ​​sticks so closely to its training examples that it's great at them...and terrible at anything new.But an AI is ONLY used for new things!

**How ​​do we detect it?** We keep secret exercises (the **test data**) that the AI ​​never sees during training. If she is brilliant on the practice but bad on the test → she learned by heart.

#### 🖥️ Demo: the overfitting curve (web page, tab 3)

1. Start the animation: two curves rise together at the beginning (the AI progresses over everything).
2. Then the "test" curve **stagnates and goes back down** while the "training" curve continues to rise → **the curves diverge: this is the moment when the AI begins to learn by heart.**
3. Ask: *“At what point should you have STOP training? »* → at the top of the test curve. (Pros call it early termination.)

> 💡 **Bonus discussion:** the opposite also exists — the student who has not worked enough and who is bad everywhere (**underfitting**, underlearning). The goal: balance.

---

### 4.7 🖐️ Practical activity: training a mini-model (25 min)

**Option A — Teachable Machine (recommended if Internet available)**
⚠ Free tool from Google, the interface can evolve: [teachablemachine.withgoogle.com](https://teachablemachine.withgoogle.com)

1. In pairs: create an “Image Project”.
2. Create 2 classes, e.g. : “open hand ✋” / “fist ✊” (or two objects: pen / eraser).
3. Capture ~30 images per class with the webcam (vary the angles! remember the lesson on diversity of data).
4. Click “Train” (≈ 30 seconds — point out: *“you are experiencing a REAL training, in miniature”*).
5. Test live: the model recognizes gestures!
6. **The educational twist:** ask to test with the OTHER hand, or another person, or another light. Often, it works less well → *“Why? »* → data not varied enough. **The entire theory of the session has just been verified before their eyes.**

**Option B — Integrated simulator (without Internet)**
Use tab 2 of the web page ("Supervised learning simulator"): we train a classifier of labeled shapes, then we test it on shapes never seen before. Follow the instructions on the screen. The twist: the “little varied data” button shows the failure of generalization.

**Joint debriefing (5 min):** Verbalize: *“What made your model good? Bad ? »* → number of examples, diversity, quality. Full circle.

---

### 4.8 Summary + teaser (5 min)

**The 6 ideas to remember (have the group recite):**
1. AI learns from **examples**, not magic rules.
2. **3 modes**: supervised (teacher), unsupervised (candy), reinforcement (video game).
3. **Data** is the fuel: quantity, quality, diversity.
4. **Train** = long and expensive. **Use** = fast. (The doctor: 10 years of study, 20 minutes of consultation.)
5. A neural network = layers of small computers; **learn = adjust the weights**.
6. **Overfitting** = learning by heart instead of understanding. The test on something never seen before is the justice of the peace.

**Teaser Session 3:** *“Now that we know how AI learns… we’re going to meet the star: generative AI. How can a machine WRITE, DRAW, COMPOSE? Answer next time. »*

---

## 5. Frequently asked questions from participants (and ready answers)

**“Does AI have a real brain? "**
No. Artificial “neurons” are very simple calculations, just *inspired* by the brain.A real biological neuron is thousands of times more complex. It's a useful metaphor, not a copy.

**“If AI learns on its own, can it become uncontrollable? »**
It does not learn “alone” in the free sense: it learns what its data and its objective make it learn, within a framework defined by humans. The real current risks are more concrete: errors, data bias, misuse. (Session dedicated to ethics later.)

**“Why does the AI still make mistakes even though it has seen millions of examples?” »**
Because the real world always contains cases that she has never seen, and that she does not "understand" like us: she spots statistical regularities. Novelty + imperfect regularities = possible errors.

**“What is the difference between AI, machine learning and deep learning? »**
Russian dolls 🪆: the **AI** is the big family; **machine learning** is the part that learns from data (the topic of the day!); **deep learning** is the part that uses BIG neural networks with many layers.

**“Are my photos used to train AI? »**
Possibly, depending on the services you use and their terms of use. ⚠ Rules (and laws, like the European AI Act) are evolving — good question to dig into in the ethics/privacy session.

---

## 6. Adaptations according to the audience

- **Middle school students (12-15 years old):** insist on games (catchphrase + video game + Teachable Machine). Reduce the "biased data" part to a simple example. Quiz in team mode.
- **Adults general public:** develop professional examples (spam, fraud, recruitment) and the discussion on personal data.
- **Quick group:** add the notion of underfitting and the IA/ML/DL table in Russian dolls.
- **Without Internet / without webcam:** everything is planned — the web page works 100% offline, option B replaces Teachable Machine.

## 7. Animation pitfalls to avoid

- ❌ Getting into math (activation functions, gradients, etc.): NO formulas in this session.
- ❌ Say “AI understands” without quotation marks: prefer “it identifies regularities”.
- ❌ Let us believe that brain = neural network.
- ❌ Skip too quickly to the practical activity: it's the most memorable moment, protect your 25 minutes.
- ❌ Give precise figures on the costs/sizes of the models without the marker ⚠: these figures expire in a few months.

---

*Applied AI — Yann Isola · Beginner Level 🟢 · Session 2/…*
*⚠ = volatile information, to be re-checked before each session.*