Javatpoint Logo
Javatpoint Logo

Machine Learning Model with Teachable Machine

Machine Learning and Artificial Intelligence are bringing new applications to the table. Artificial Intelligence is a topic of great interest to many organizations. Artificial Intelligence is built on machine learning. However, not everyone is familiar with machine learning and how to make models that can be used for intelligence. Non-coders and coders who are not familiar with machine learning can create a machine intelligence model and integrate it into an application. It is possible, and it is happening now. Perhaps the users might be wondering how to do it.

This tutorial will show us how to create a machine-learning model without writing code.

We will create a model to classify food items. We will use a Kaggle food dataset that includes different food items such as Salads, Potatoes, and Cakes. You can download the dataset from https://www.kaggle.com/cristeaioan/ffml-dataset.

Teachable Machine

Yes, it is possible with the help of a teaching machine. A teachable machine is a web-based tool that quickly and easily creates models. It can be used for image, sound and pose recognition. It is also flexible. It can be used to teach a model how to identify images and pose through images or live webcam. It is free and best for students. Teachable Machine creates a Tensorflow model, which can be integrated with any website app, Android application, or other platforms. There is no need to create an account. It was so easy.

Let's Build a Model

Step 1: Go to Teachable Machine: https://teachablemachine.withgoogle.com/train

We will be directed to the below-shown screen that consists of three options - Image, Audio, and Pose.

Machine Learning Model with Teachable Machine

Step 2: Choose an image project. We will see two options again: standard or embedded. We aren't making this for micro-controllers, so we recommend choosing a standard. If the users are interested, then select Embedded Image Model. Even if they choose Embedded, the process will remain the same. It is only the model that will differ.

Machine Learning Model with Teachable Machine

Clicking on Standard Image Project will take us to the screen below. Here we can add classes to the model. we have two choices: upload images from the databank or use the live camera to capture images.

Machine Learning Model with Teachable Machine

Step 3: Now create classes and upload the images. We will only create three classes: Salad, Potato, and Cake. We have replaced class1 with Salad and class2 with Potato and class3 is now called Cake. The user can make classes as many as they like.

Machine Learning Model with Teachable Machine

Click on Train Model after we have uploaded the images. There are three options available: Batch Size, Epochs and Learning rate. These options are not something we have ever heard of, so we don't be alarmed if they're new to us. It's important that we play with the models and determine which values give the best accuracy to make it more efficient. A model is useless if it's not accurate. We can adjust their values to find the best model. Here we will use default values.

Machine Learning Model with Teachable Machine

Step 4: After the model has been trained, it is time to export it.

Machine Learning Model with Teachable Machine

We will see several options when we click Export Model. The code snippets can help integrate the model into our application. Tensorflow.js models are compatible with all JavaScript libraries and frameworks. Some frameworks only support a specific type of model. We will check to see if our library or framework supports this model.

The download of the model can take some time. This is how we create a machine-learning model.

We can also create models for audio and pose, similar to the image project. Let's see what we can do.

Poses Model

We started training the model. The pose project must be selected in the teachable machine to create the pose model. We will create two classes, one for sitting and one for standing. Then we will upload the images.

Machine Learning Model with Teachable Machine

After the training is complete, we can preview the model's Output by uploading any image. This allows us to check the model's efficiency and Output before exporting it. The below image shows that the Output from an image we uploaded to preview is correct, i.e., sitting. This means that the model is doing well.

Machine Learning Model with Teachable Machine

Audio Model

An audio project will create a model capable of detecting sound. We created three classes: Background Noise, Clapping Rain, and Thunderstorm. In the preview section, after training the model, we tested the model's efficiency using noise. In the Output of the preview, we can see more background noise. We need to increase the number of samples to improve the model's learning.

Machine Learning Model with Teachable Machine





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA