Open In App

Machine Learning Model with Teachable Machine

Last Updated : 22 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Teachable Machine is a web-based tool developed by Google that allows users to train their own machine learning models without any coding experience. It uses a web camera to gather images or videos, and then uses those images to train a machine learning model. The user can then use the model to classify new images or videos.

The process of creating a machine learning model with Teachable Machine is relatively simple and straightforward. It involves the following steps:

  1. Gather data: Use a web camera to gather images or videos of the objects you want to classify.
  2. Train the model: Use the gathered images or videos to train a machine learning model. Teachable Machine provides a simple interface for labeling the images and training the model.
  3. Test the model: Use the trained model to classify new images or videos, and see how accurate the model is.
  4. Fine-tune the model: If the model is not accurate enough, you can go back and fine-tune it by gathering more data or adjusting the training parameters.
  5. Teachable Machine is a great tool for individuals, educators and students to learn the basics of machine learning and computer vision. It can be used to train simple models for a wide range of applications such as image classification, object detection and gesture recognition.
  6. Machine Learning and Artificial Intelligence have raised the level of applications. Many organizations are working on Artificial Intelligence to create an impact on society. Machine learning is the backbone of Artificial Intelligence. But everyone doesn’t know how machine learning works and how to create models that can be used in artificial intelligence. Don’t worry; it is possible now. You might be wondering how? It is super easy for non-coders or coders not from machine learning backgrounds to create a machine learning model and integrate it within the application. In this article, we are going to build a machine learning model without coding a single line.

We are going to create a model for the classification of food items. So, we will be using a food dataset from Kaggle that consists of different food items like Cake, Salad, Potato, etc. You can download the dataset from https://www.kaggle.com/cristeaioan/ffml-dataset.

Teachable Machine

Yes, we are going to do it with the help of a teachable machine. A teachable machine is a web-based application that creates models easily and fastly. It serves three purposes – image, sound, and pose recognition. The good part is it is flexible. It can teach a model to classify images or poses through images or a live webcam. It is free of cost and best for students. The model that is created through Teachable Machine is a real Tensorflow model that one can integrate with a web app, Android app, or any platform. Neither requires a need to create an account. It made everything so simple. 

Let’s Build a Model

Step 1: Go to  Teachable Machine(https://teachablemachine.withgoogle.com/train). You should be directed to the below-shown screen that consists of three options – Image, Audio, and Pose.

Step 2: Choose the image project. You will again see two options, standard and embedded. Choose standard because we are not making it for the purpose of micro-controllers. Well, if you are, then choose Embedded Image Model. Even if you choose Embedded, the entire process will be the same, just the model will be different.

After clicking on Standard Image Project, you will be directed to the below-shown screen, where we will add classes we want to classify with the help of the model. There are two options – either you upload images from the dataset or use the live camera to capture the images.  

Step 3: Now, create classes and start uploading the images, like I am doing. For simplicity, I am creating only three classes – Cake, Salad, and Potato. So, I am replacing class1 with Cake, class2 name with Salad, and class3 name with Potato. You can create as many as you want.

After uploading the images, click on Train Model. You will see different options – Epochs, Batch Size and Learning rate. Don’t worry if you haven’t heard about these in your life. To make the model more efficient, it’s important to play with them and find out at which values model gives the highest accuracy. Of course, there is no meaning in a model if it is not accurate enough. So, you can change their values and find out the best one. Here, I am going with default values.

Step 4: After the model is trained, it’s time to export the model.

When you click Export Model again, you will get several options. Even the code snippets are given to help you integrate the model with your application. Tensorflow.js models work with every JavaScript library or framework. Some frameworks support only a particular type of model. So,  check which ones your framework or library supports.

Downloading the model might take a while, so sit back and enjoy your Coffee. You just created a machine learning model without coding.

Similar to image poses, we can create models for audio and poses also. Let us see how we can do it.

Poses Model

To create the pose model, we have to choose pose project in the teachable machine. In the example, we are creating two different classes for standing and sitting and uploading the respective images. We start training the model after.

When the training is finished, we preview the output of the model by uploading any image to see the output and see the efficiency of the model before exporting it. In the below image, we can see that the output of an image that we uploaded for preview is correct i.e, sitting. It means the model is doing good.

Audio Model

To create a model that detects sound, we will create an audio project. We created three classes – Background Noise, Clapping, Rain and Thunderstorm. After training the model, in the preview section, we used noise to test the model efficiency. And in output of the preview, we can see that the percentage of background noise is higher. To make the model more efficient, we need to add thousands of samples for better learning of the model from the data.

Teachable Machine is a web-based platform for creating machine learning models without any coding. It is a Google project that provides a graphical user interface for training and exporting models that can be used in various applications.

Here are the steps to create a machine learning model with Teachable Machine:

  1. Gather data: Collect a dataset of images, sounds, or other inputs that you want to train the model on. You will need to have at least two classes of data to train a binary classification model.
  2. Upload data: Upload the data to Teachable Machine and label each class. You can also use the built-in data augmentation tools to increase the size of your dataset.
  3. Train the model: Teachable Machine provides three different training options: image, sound, or pose. Select the appropriate training type based on the type of data you are using. The platform will automatically train a model using a pre-trained deep learning algorithm and show you the accuracy of the model.
  4. Test the model: Test the model by uploading new images, sounds, or poses that were not included in the training dataset. The model will classify the new inputs into one of the trained classes.
  5. Export the model: Export the model to use it in your own application. Teachable Machine supports several export options, including TensorFlow.js, TensorFlow Lite, and Core ML.

Here are some of the advantages of using Teachable Machine for machine learning model creation:

  • Easy to use: Teachable Machine has a user-friendly interface that does not require any coding skills.
  • No data science expertise required: Teachable Machine automates many of the tasks involved in creating a machine learning model, making it accessible to non-experts.
  • Supports multiple input types: Teachable Machine supports image, sound, and pose training, making it versatile for a range of applications.
  • Quick iteration: Teachable Machine provides real-time feedback on model accuracy, making it easy to iterate and improve the model.
  • Supports multiple export options: Teachable Machine supports several export options, making it easy to integrate the model into your application.

References:

  1. Teachable Machine website: https://teachablemachine.withgoogle.com/
  2. Teachable Machine documentation: https://developers.google.com/teachable-machine
  3. Google blog post on Teachable Machine: https://ai.googleblog.com/2017/11/teachable-machine-simple-way-to-make.html


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads