Sheet 1 - First Steps With Micro - Bit
Sheet 1 - First Steps With Micro - Bit
1 Presentation
4 Model generation
1 Presentation
This file includes basic definitions on Artificial Intelligence and Machine Learning and
their differences.
Traditional programming and Machine Learning concepts are presented and contrasted.
To apply these concepts, we propose a step-by-step guide on how to create a model
using the Teachable Machine platform, which supports data in image and audio format,
to create your own projects. Best practice tips are offered to be used in your first steps.
What are Artificial Intelligence and Machine Learning (ML)? How do these concepts
differ?
In this sheet, we will approach two concepts that usually seem extremely complex:
Artificial Intelligence (AI) and Machine Learning (ML). Although it may seem difficult to
create projects with AI or ML, we invite you to get to work; we will accompany you step
by step through different tools that will allow you to explore some of the infinite
possibilities offered by this universe.
AI is a set of skills that a computer has in order to perform activities that simulate human
intelligence, that is, the ability to run algorithms, learn from data and use what they learn
in decision making just as a person would.
On the other hand, Machine Learning is a subfield of AI, one of its possible applications.
More specifically, it is the ability of a computer to learn or recognize patterns. The basis
of this skill lies in the entry of data into the system, which will allow it to make
predictions and suggestions.
The first step is to understand how Traditional Programming and Machine Learning
work, and how they are different:
● Traditional programming: Data is entered into the system< the system applies a
series of rules; an output is obtained. For example, in a calculator you enter numbers
and a rule (to add, multiply, divide, subtract, etc.). New data is the output (a new number,
the result). In this type of programming, for the same input data, the output will always
be the same.
The result of the “training” of a computer or model can be called Machine Learning. The
computer is given, through algorithms or instructions, the ability to identify “patterns”
and, based on these, predict how a given input data should be classified.
One of the tools available for this type of projects and one used in this file is Teachable
Machine.
On this platform users can generate Machine Learning models according to the project
to be carried out. In order to use it, you must access the Teachable Machine website.
This programming environment will allow you to train a model through the following
stages:
a. Data collection Enter information into the system and classify it by classes
or categories.
c. Model export: Generate a link using the model and then use it with a
micro:bit board.
4 Model generation
On the Teachable Machine platform, data tagging refers to assigning data a category or
class. For example, two sets of pictures of dogs and cats are provided. Each of these
series or classes is tagged with a title or a name. By doing this, these categories will
help the model to establish what are the common characteristics among the data
entered for each class, so that it can decide, once a new image is presented, which
class it belongs to.
.
Step 2: Choose the type of model to be created.
This environment allows projects to be carried out using three types of data:
● image
● audio
● poses (through the webcam)
Stage 1:
As an example, we can choose categories such as “Right Hand”, and place a set of
images that show one or more people raising their right hand. Then, in the next
category, “Left Hand”, we can do the same but with the left hand. Finally, a third
category, “Hands Down”, will contain images of a person with both hands down.
The application allows you to add images from a camera or from the image database of
your device (computer, cell phone, etc.).
If the webcam is used, data collection can be defined through set up. Tip: Take 4 FPS
(frames per second) for 3 seconds (12 pieces of data in total). There is a time frame
before recording starts; it is advisable to select 2 seconds. Those images that we do not
consider representative of the class should be discarded.
● The higher the number of images or samples, the better the Machine Learning
model will work. However, the more images we add, the longer the training of the
model will take.
● Another way to reduce the margin of error is to add several images from each
category. For example, images of different people from different angles can be added,
and so on. The more information the model provides, the better it will sort data.
● The model depends on the quality of the data entered. It is important that the
image is well framed. It is also advisable not to include confusing images.
Stage 2:
Stage 3:
In the “Preview” window, test the model and check its operation. For
this you must activate the input device (in this case, the webcam)
and test whether images are correctly sorted out.
Tip:
● Links generated by the application only contain the trained model. When the
link is shared, only the model could be used. That is to say, you can test the model,
but cannot modify the data with which it was trained.
Stage 1:
Go to “New Project” and select “Audio Project”. Similarly to what happened with the
webcam, when the data type is sound, Teachable Machine allows you to enter data
through the microphone.
IMPORTANT: In the case of audio, there is a preset
class called Background Noise. Samples should be
recorded in this category so that the model
understands that there is a base noise and that the
commands will be recorded with that sound in the
background.
Tips:
● In the “Background Noise” category, store at least 20 samples. For all other
classes or categories, store at least 8 samples of each.
● In each class, modify the tones and the speed of the audios to generate a more
robust model. This allows the model to understand different ways of saying the same
data. For example, as in the case above, different ways of saying “right” and “left”.
Stage 2:
Preparing the model: click on this option once you have finished recording the
different model classes or commands.
Stage 3:
Stage 4:
Tip:
● Links generated by the application only contain the trained model. When the
link is shared, the model can only be used. That is to say, you can test the model, but
cannot modify the data with which it was trained.
4.3 Pose project:
Stage 1:
Stage 3:
This sheet details the procedure to create Machine Learning models. In this case,
simple models will identify, through images or audio samples, which hand the user
raises.
However, the possible applications of this tool are countless. We invite you to
continue testing Teachable Machine, adding more categories and generating new
models.
In the following sheet we will explain how to link these models with a micro:bit board
to expand the possibilities even more.