Inside AI: Teachable Machine

Try with your child to see how computers "learn" from patterns in a mini game using Google’s Teachable Machine.
Inside AI: Teachable Machine

Ages 6+

Objective:
Try with your child to see how computers "learn" from patterns in a mini game using Google’s Teachable Machine.

Teaching your children about Artificial Intelligence doesn't require a degree in computer science. Using Google’s Teachable Machine, you can turn machine learning into a smooth mini game and understand how computer can "learn" from patterns.

Prerequisite:
How Does AI Work Technically
Understand what’s behind the scence of AI and machine learning

What is Teachable Machine?

Teachable Machine is a Google free web-based app demostrating machine learning (ML) models in a fast and easy way, and it's one of the best tools to teach your child how ML works by actually doing it from training to prediction through a mini game.

Click below link to start building ML models with images (or Teachable Machine > Get Started > Image Project > Standard image model):


Upload data

There are three sections of model training: Data, training and prediction (Preview).

In this exercise, we'll feed (update) the model with phone and flower images and then at the Preview we'll show it with a phone or a flower image to see whether it read the image correct or not!

Let's download all the images for this exercies, unzip before upload:

We upload at least two images and name them each as "Phone" and "Flower" into training section at left.


Model Training

Let's click Train Model. What it does is to build a model (upon a basic pre-trained model) to be able to classify two classes (phone and flower) so in the future, it can tell any image whether it's a phone, a flower, or in between.


Prediction

Over seconds, we had the model. Let's preview to see if the model works. We'd upload either a image of phone or flower, and please make sure it is NOT from image we just uploaded for training, otherwise, it will predict / classify it correct anyway.

Choose File to upload image(s). If it shows an error, just switch to Webcam and switch to File back.

Here from I have got a good result from predicting a phone (from a phone image).

However, if I feed the model with another flower image, it doesn't give me an accurate result. There is only 67% it assume it's a flower.

There are a couple of ways to improve the result (increate the model quality):

  1. Increase more data for each class
  2. Increase more class categorise and subcategories (roses, sunflowers, lilies, daisies, and tulips etc.)
  3. Correct the model from testing

Those are the techniques to make your model more robust. In this exercise, since we used very simple and clean images (of white background without any other objects), if we feed it with an image of noice, the model can be confused easily.

This result shows that model predict the image as a phone, and since there is no "Human" class or data being trained, the only clue that the model is predicting on was the shape, and it is exactly how the way model thinks or machine learning learns: "by all the evidence it can search from all the data it has been train upon".


Bonus: Bananameter

There is an official recommended tutorial that uesd the tool it as a banana meter to see whether the banana is good to eat or not. It followed the same process with only few complex steps. It's worth to have a look if you're looking for deeper understanding of the tool.


Images credits:
https://unsplash.com/photos/person-holding-black-iphone-5-rd183eSRVYM
https://unsplash.com/photos/a-person-holding-a-cell-phone-in-their-hand-6OF-Ly-5oJY
https://unsplash.com/photos/selective-focus-photography-of-person-using-smartphone-mw6Onwg4frY
https://unsplash.com/photos/person-holding-black-iphone-7-GaDzER4qyto
https://unsplash.com/photos/selective-focus-photography-of-pink-petaled-flower-EfhCUc_fjrU
https://unsplash.com/photos/white-and-pink-flowers-NoXUQ54pDac
https://unsplash.com/photos/photo-of-pink-petaled-flowers-9A_peGrSbZc
https://unsplash.com/photos/close-up-photo-of-common-sunflower-5lRxNLHfZOY