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 Rahat.)
Rahat 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.
Learn it
Weed in Dal Lake, smoky winter air in Srinagar, waste across the city: before anyone can fix these, someone has to measure them. AI helps in three ways. Sensors measure (an air monitor records the air hour by hour), satellites watch (they photograph the lake from above), and classifiers sort (they label what is in a photo). All three make data people can act on. But measuring is not mending.
Words to know
- Sensor a device that measures something, such as an air-quality monitor recording PM2.5 (tiny smoke and dust particles) every hour.
- Satellite image a photo taken from space, showing changes too big to see from the ground, like weed spreading across a lake.
- Classifier a model that sorts things into fixed groups, such as wet, dry or hazardous waste.
- Wet waste food, peels and leaves. Dry waste — paper, plastic, glass, metal. Hazardous waste — batteries, medicine strips, bulbs, paint.
- Balanced classes about the same number of examples in each class. A bigger class pulls the model towards itself.
- Maintenance keeping a system working and up to date after it is built.
Step by step: one problem, three jobs
Take the weed in Dal Lake:
- Watch: satellite images in spring and late summer show how far the green has spread. A machine measures the area far faster than a person.
- Measure: sensors in the water record its temperature and how clean it is, hour by hour.
- Sort: a classifier labels photos of what is caught in the weed: bottles, packets, peels.
- Act: none of this removes one bottle. The data tells people and the municipality where and how bad, and they must act.
The five environmental problems AI is most used on: plastic pollution · air quality · waste management · wildlife loss · soil degradation.
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 |
| India's forests, 2024 | Anavaran compared satellite pictures every fortnight to flag forest loss; reports say its alerts stopped being updated in 2025 | Watching, until nobody maintained it |
🕌 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).
Careful: more photos do not always make a better model, only photos that add something new. Fifty more pictures of the same peel on the same sheet teach it nothing. And keep the classes balanced: a class with three times as many photos pulls the model towards itself.
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.
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.
Typing practice
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