Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

Science project idea

AI literacy: train an image classifier on stationery items

A free browser tool learns to tell a pencil, an eraser and a sharpener from webcam examples, and testing shows how the number and variety of examples change accuracy. It teaches how machine learning learns from data.

What it shows

A free browser tool learns to tell a pencil, an eraser and a sharpener from webcam examples, and testing shows how the number and variety of examples change accuracy. It teaches how machine learning learns from data.

The science

In machine learning a program is not told the rules. It is shown many labelled examples and adjusts itself until it can predict the label of new pictures. With too few or too similar examples it learns the wrong clues, for example the background instead of the object, and fails on new conditions. More varied examples give better accuracy.

Materials

Cost: free. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.

  • A computer, laptop or phone with a browser (free)
  • A computer with a webcam and Google’s Teachable Machine at teachablemachine.withgoogle.com (free, runs in the browser)
  • Three stationery items: a pencil, an eraser and a sharpener
  • A plain background such as a sheet of white paper
  • A notebook and a pencil

Safety

For this project: Point the camera only at the objects and not at faces. Read what the tool says about where images are stored and do not save the project online with images of people.

Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.

All the safety rules

Step by step

8 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.

  1. Open the Teachable Machine site, choose Image Project and then Standard image model.

  2. Rename Class 1 to pencil, Class 2 to eraser and add Class 3 for sharpener.

  3. For the first test collect only 5 webcam samples per class, held in one position, using Hold to Record.

  4. Click Train Model and wait; when done, hold each object up in new positions and write down what the preview predicts and how sure it is.

  5. Test 10 times per object and record how many were right in a table.

  6. Now add 50 samples per class from many angles and distances and under different light, and train again.

  7. Test another 10 times per object and compare accuracy with the first model.

  8. Test with the objects on a different background to see if the model was using the background as a clue, and write your conclusions.

What you should see

The second model with many varied samples is clearly more accurate than the first, and the background test shows how a model can learn the wrong clue.

Viva questions

A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.

1What is machine learning?

A program learning patterns from labelled examples instead of being given rules.

2Why does more varied data help?

The model sees more situations and relies less on accidental clues.

3What is the training data here?

The webcam pictures of each object you recorded.

4What can go wrong with little data?

The model may learn the background or lighting rather than the object.

Free ebook: Viva Questions for Science Projects

Take it further

Add a fourth class called nothing with only the empty background so the model can say that no object is present.

Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.

Free ebooks for this project

WhatsApp us