Class 8 · Unit 2: Building with no-code AI · Lesson 2.1 · 40 min
AI for the environment
Weed presses against the shikara. Bottles, a chips packet, a slipper caught in it. “Somebody should count all this.” A machine could.
Today you will: Build a three-class waste sorter · Test it on photos it never saw · Name three jobs AI does for the environment
Story
The shikara moves slowly, because it has to. Thick green weed presses against both sides of the boat.
—: “It was not like this when I was your age. You could see the bottom.” (the boatman tells Hiba and Bilal.)
Bilal looks at the bank: plastic bottles, a chips packet, a broken slipper, all caught in the weed. "Somebody should count all this," he says. "Then they would know how bad it is."
Hiba is already thinking. "A machine could count it. Last month we taught one to tell leaves apart. Why not bottles from bread packets?"
Today you build the first half of that machine: a waste sorter.
Watch
AI, our lake and our air — — scan code 8.2.1 in the printed book.
Warm up your fingers
Skill: accuracy at speed, Term 1 (5 min)
- On typing.com, open the accuracy practice your teacher has set for this term.
- Aim for 28–32 WPM at 93% accuracy or better. Accuracy first: a word typed wrong costs more time to fix than it saved.
- Words for this unit:
classifierhazardoussegregatesensormonitor
On the laptop
You need: Teachable Machine (no account; nothing leaves the laptop) · waste-photos/train/, waste-photos/test/ · waste-score.ods
Mission 1: Your mission
- ☐1
Teachable Machine → Image Project → Standard. Three classes:
Wet(food, peels, leaves),Dry(paper, plastic, glass, metal),Hazardous(batteries, medicine strips, bulbs, paint). - ☐2
Upload each folder. Check the classes have about the same number of photos — a bigger class pulls the model towards itself.
- ☐3
Train Model.
- ☐4
Predict: which class will it get wrong most? Then test the photos in
waste-photos/test/one at a time (Input → File). - ☐5
In
waste-score.ods: Photo · Model says · Confidence % · Real answer · Right? Count the right ones. - ☐6
Hazardous only: how many did it miss? Keep the number for Lesson 2.4.
⚠️ Photograph objects, never classmates. No faces go into any model in this book.
No laptop today?
Sort 30 printed waste pictures into three trays, swap trays with another group, and mark them against the teacher's key. A greasy paper plate belongs in the argument.
Now you know
- Three different jobs: sensors measure, satellites watch, classifiers sort.
- Sorting into wet, dry and hazardous is classification fixed groups, learned from labelled examples.
- Balanced classes matter. A class with far more examples pulls the model towards it — Unit 4 calls this bias.
- Measuring is not mending. A count changes nothing until people act on it.
Across India, one example of each job:
| Where | What it does | The job |
|---|---|---|
| Ahmedabad, 2017 | India's first city air-pollution early warning, on LED screens | Measuring |
| Himachal Pradesh, 2023 | Satellite images found 70 plastic dumping sites | Watching |
| Tiger reserves | TrailGuard AI cameras send a ranger a picture in about 30 seconds | Watching |
🕌 From our heritage
Monitoring the health of a city is not a new idea. In medieval Muslim cities an official called the muḥtasib walked the markets and streets checking the things nobody else would: that weights and scales were honest, that food was fit to eat, that fountains were covered and the roads kept clean. Ibn al-Ukhuwwa (d. 1329) wrote a whole manual for the job. He was doing what our sensors do now — collecting evidence so that someone could act.
Source: Ibn al-Ukhuwwa, Maʿālim al-Qurba fī Aḥkām al-Ḥisba (c. 14th century).
Debate it
Srinagar collects nearly all its household waste, and most homes are asked to separate wet from dry. But the separated waste is sometimes tipped into the same truck and mixed again on the way to the landfill.
If a perfect AI sorter were installed in every home tomorrow, would the lake get cleaner? What else would have to change?
Check yourself — practice, not a test
1. Sorting a photo into wet, dry or hazardous is an example of:
- ○ Regression
- ○ Clustering
- ○ Classification
- ○ Compression
2. If one class in your training data has three times as many photos as the others, it makes no difference to the model.
- ○ True
- ○ False
3. Which of these produce data a person can act on? (choose all)
- ○ An air-quality sensor recording PM2.5 each hour
- ○ A satellite photographing the lake each week
- ○ A classifier labelling 500 waste photos
- ○ A poster asking people to keep the lake clean
4. Batteries, medicine strips and broken bulbs belong in the ______ class.
5. Which are among the five environmental problems AI is most used on? (choose all that apply)
- ○ Air quality
- ○ Wildlife loss
- ○ Soil degradation
- ○ The price of petrol
6. Once a monitoring system like Anavaran is built, it keeps helping whether or not anyone maintains it.
- ○ True
- ○ False
7. Put the steps of today's build in order:
- 1. Train the model
- 2. Record the score and look at the mistakes
- 3. Test it on photos it has never seen
- 4. Name the three classes
- 5. Upload a balanced set of example photos
Remember
AI can measure the problem accurately. Only people can fix it.