Loading...
Hello, My name is Mrs. Holborow, and welcome to Computing.
I'm so pleased you've decided to join me for the lesson today.
In today's lesson, we're going to be looking at how movement samples are created and labelled to create a model.
Welcome to today's lesson from the unit Machine Learning Using the micro:bit.
This lesson is called Gathering Data for a Model.
And by the end of today's lesson, you'll be able to record and label movement data.
Shall we make a start?
We will be exploring these keywords throughout today's lesson.
Sample.
Sample, a single set of data used for training or testing.
Class.
Class, a category or label given to samples.
Model.
Model, a system that uses patterns in data to represent something in the real world and can be used to make predictions.
Look out for these keywords throughout today's lesson.
Today's lesson is split into two parts.
We'll start by describing how a movement sample is created and then we'll move on to label movements to create a model.
Let's make a start by describing how a movement sample is created.
Movement is measured in three directions: x, side to side, y, forward and backward, and z, up and down.
These motion values change as you tilt, shake, or move your device.
So you can see here with a device like the micro:bit, I can use the coordinates to judge whether the micro:bit is being moved in different directions across different axes.
The micro:bit motion values are displayed on a graph.
Values for x, y, and z are plotted against time.
Watch this video and notice the different motion values.
Time to check your understanding.
Which of these motion values changes the most with a side to side movement?
Is it A, x, B, y, or C, z?
Watch the video and look carefully.
Did you select C?
Well done.
The other motion values changed just a little because the movement was not perfectly side to side.
Okay, we're moving on to our first task of today's lesson.
I'd like you to describe how movements are plotted.
You could use these keywords: combination, motion values, axes, measured, and time.
Pause the video here whilst you answer the question.
How did you get on?
Did you manage to answer the question?
Here's a sample answer.
The combination of the motion values on all axes are measured over time.
So remember, those movements are plotted on the graph over time.
Okay, we are now moving on to the second part of today's lesson, where we're going to label movements to create a model.
What is a model?
Maybe pause the video here whilst you have a think.
Izzy says, "This is a computer game model of a football match.
" Lucas says, "It's a way of representing a real thing.
" X, y, and z motion values are combined to record a sample of movement.
For example, a side to side movement.
When you have lots of samples of a movement, you can group them together into a labelled class.
True or false, an x value is a sample of movement?
Pause the video whilst you have a think.
Did you select false?
Well done.
The combination of an x, y, and Z values over time creates a sample of a movement.
An x value on its own is just a position or a single data point.
Which one of these describes a model?
A, an application that uses a prediction, B, a data value, e.
g.
from the x, y or z axes, or C, a representation of a movement?
Pause the video whilst you have a think.
Did you select C?
Well done.
A model is a representation of a movement.
You could build a data-driven AI application to predict if someone is moving well or not to support health.
The first step in a data-driven approach is to decide what data to gather.
For example, to build an application that predicts whether a tennis shot is good, you need to gather samples of a tennis shot movement.
We could use the micro:bit to measure whether or not the movement is good or not.
For the second task of today's lesson, I'd like you to choose a movement to use with your application.
Note, you can choose something other than tennis, so maybe think about a hobby or sport or interest that you're interested in.
Really important though that each sample can only be one-second long.
Pause the video here whilst you think of some ideas and choose a movement to use with your application.
Did you manage to choose a movement?
Let's have a look at some examples.
So Andeep says, "I've chosen stride length to help people train to run.
" That's a really great idea 'cause sometimes you can overstretch when you're running and that leads to bad movement.
Jacob says, "I've chosen a movement to help people learn a new dance.
" Again, that's another great idea.
We can record whether the person is completing the correct dance move or not.
Okay, for part two, I'd like you to open the machine learning platform at oak.
link/createai, and then I'd like you to click Get started.
Click on New session and follow the instructions to connect your micro:bit.
Pause the video here whilst you go and have a go at the activity.
Okay, so I've clicked on the link oak.
link/createai.
We start by clicking on the blue Get started button.
We then click the New session button, so the plus icon here.
This is also where you come to to open a previous session or continue to a saved session if you've done a session previously.
So it tells me at the bottom of the screen that my micro:bit is not connected.
I'm going to hit the blue Connect button.
It then tells me what I need to connect using Web Bluetooth.
So I'll need a micro:bit, I'll need a computer with internet, a USB port, and Web Bluetooth.
I'll need a micro USB cable, and then I'll also need a battery holder with batteries.
Once I've got all of these things, I'm going to hit Next.
It then asks me to connect the micro:bit to the computer with a USB cable.
So I'm gonna follow that instruction now.
Once I've connected my micro:bit, I'm going to hit Next.
It then shows me what will appear in the next popup.
So I should get the micro:bit appear.
I can select it and then hit Connect.
So as expected, I have the popup, I have the micro:bit, I'm going to select it and then I'm going to hit Connect.
It then downloads the data.
It now asks me to disconnect the USB and connect the battery pack to the micro:bit.
So I'm going to follow that instruction now.
I'm now going to hit Next.
It then asks me to copy the pattern displayed on the micro:bit.
The pattern may already be correct, so you may not have to change anything.
Click Next.
It then tells me the next popup that will appear to connect the micro:bit using Web Bluetooth.
The popup has appeared, so I'm going to select the micro:bit, I'm going to hit Pair, and it will start to connect using Web Bluetooth.
You can now see along the bottom of the screen, I have my live data graph, so my micro:bit is connected.
If I start to move the micro:bit around, you can see the axes of x, y and z start to move around.
We've successfully connected the micro:bit to create AI, and we can now move on to the next step.
Once you've connected your micro:bit, you can then name the first action good.
Note that the CreateAI system calls movements actions.
Then, record at least 10 samples of your good movement.
Note, you'll have to hold the micro:bit the same way for each sample.
So for example, if you're doing a tennis shot, you'll need to hold the micro:bit in exactly the same way each time you represent the tennis shot.
So I'm going to name the first action good.
Where it says Name of action, I can replace this with the word Good, and then I can hit the Record button.
At least three are required, but for this activity, you need to record 10.
So it says press to record a data sample or press button B on your data collection on the micro:bit.
I'm going to hit record and Record one sample now.
Okay, it says that I've recorded my first sample.
To train the machine learning model, you need at least three samples for two different actions.
So let's record the next one.
So I'm gonna hit Record again.
I'm gonna press Record again And again.
And again.
And I'm gonna keep going until I have 10 samples.
Then click the blue Add action button.
You're going to name the second action bad, and then you're going to record at least 10 samples of your bad movement, and then click the white Save button.
Pause the video whilst you go and complete the activities.
I now need to record the bad action, so I'm going to click the blue button which says Add action, and this will add another action underneath.
I'm going to name this action Bad.
I then have to record the samples for the bad action.
So like I did before, I'm going to hit Record and I'm going to record some samples.
Remember, you have to do at least three, but we suggest you do 10 for this activity.
So I'm gonna keep going until I've recorded 10.
I'd like you to explain why we create good and bad labels.
Pause the video whilst you have a think and write your answers.
Did you have a think about why we create both good and bad labels?
Let's have a look at a sample answer together.
There are two patterns of movement that the model needs to predict so that the application can produce one output when a bad movement is predicted.
For example, we might show the sad face on the LEDs of the micro:bit when a bad tennis shot is played and a different output when a good movement is detected, so we may put a smiley face on instead.
Without both good and bad, there would just be good and unknown or bad and unknown, which isn't helpful for our model.
Okay, we've come to the end of today's lesson and you've done a fantastic job, so well done.
I hope you've enjoyed recording some movements for your model.
Let's summarise what we've learned.
The first step in a data-driven approach to problem solving is to decide what data is needed.
A data-driven application requires a large number of data samples.
Samples are labelled to create classes and can be used to train a model which represents something in the real world.
I hope you've enjoyed today's lesson, and I hope you'll join me again soon.
Bye.