Machine learning is not as far away from our life as you think. With the Teachable Machine extension of mBlock 5, you can create a training model, instead of programming, to enable your computer to learn.
Note: To use the Teachable Machine extension, ensure that your PC is equipped with a camera or connected to an external one and that the camera is working properly.
If your camera doesn't work properly, refer to What If My Camera or Microphone Doesn't Work Properly When I Use mBlock 5? to solve the problem.
Add the Teachable Machine extension
1. Click the Sprites tab and click + extension at the bottom of the Blocks area.
2. On the Extension center page that appears, click + Add at the bottom of Teachable Machine.
After being added, the extension and its blocks are displayed in the Blocks area.
Use the Teachable Machine blocks
Let's try to use the TM blocks. Create a training model to enable Panda to learn three basic human emotions: happiness, sadness, and excitement.
1. Choose TM in the Blocks area and click Training model. The Model Training page is displayed. Name the three categories happy, sad, and excited. Click Learn for each category to add samples. After the learning is complete, click Use the model.
2. After you create a model, new blocks are provided in the TM category.
3. Enable Panda to recognize your emotions based on the created model.
Program Panda as follows:
Panda dances and says "You're excited!" when it recognizes that you are excited.
4. Click the green flag under the stage to execute the program.
The learning window is displayed. When the recognition result is excited, Panda dances and says "You're excited!"
For more information about how to train a machine learning model, see "How to Teach and Learn Modern AI: Training Models for Machine Learning Through mBlock 5."