[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:01.56,0:00:08.36,Default,,0000,0000,0000,,To create your simple AI exercise timer, \Nyou’ll train a machine learning (or ML) model.  Dialogue: 0,0:00:08.36,0:00:15.08,Default,,0000,0000,0000,,This model will recognise when you’re \Nexercising and when you’re not exercising. Dialogue: 0,0:00:15.08,0:00:23.72,Default,,0000,0000,0000,,You’ll then combine the model with some \Nready-made code for an exercise timer... Dialogue: 0,0:00:23.72,0:00:28.72,Default,,0000,0000,0000,,before downloading it to your \Nmicro:bit and using it in real life. Dialogue: 0,0:00:28.72,0:00:35.96,Default,,0000,0000,0000,,Click ‘Open in micro:bit CreateAI’ to launch the project.  Dialogue: 0,0:00:35.96,0:00:40.76,Default,,0000,0000,0000,,The project comes with 3 samples \Nof movement data for exercising Dialogue: 0,0:00:40.76,0:00:45.44,Default,,0000,0000,0000,,and 3 samples of movement \Ndata for not exercising. Dialogue: 0,0:00:45.44,0:00:51.00,Default,,0000,0000,0000,,You’ll need to add more samples by \Nrecording your own movement data. Dialogue: 0,0:00:51.00,0:00:56.48,Default,,0000,0000,0000,,micro:bit CreateAI collects movement \Ndata samples using the accelerometer   Dialogue: 0,0:00:56.48,0:01:02.24,Default,,0000,0000,0000,,(or movement sensor) on the micro:bit.\NYou will wear a micro:bit and battery   Dialogue: 0,0:01:02.24,0:01:08.84,Default,,0000,0000,0000,,pack on your wrist or ankle, so that you can move \Nfreely to record your own movement data samples.  Dialogue: 0,0:01:08.84,0:01:13.48,Default,,0000,0000,0000,,To get started, you need to set \Nup the data collection micro:bit.  Dialogue: 0,0:01:13.48,0:01:22.24,Default,,0000,0000,0000,,Connect the wrist-worn micro:bit to CreateAI. \NIf your computer has Bluetooth enabled then you   Dialogue: 0,0:01:22.24,0:01:28.68,Default,,0000,0000,0000,,will just need 1 micro:bit and a USB data lead.\NIf you don’t have a Bluetooth connection,   Dialogue: 0,0:01:28.68,0:01:33.80,Default,,0000,0000,0000,,you’ll be prompted to use 2 micro:bits.\NThe second micro:bit will remain connected   Dialogue: 0,0:01:33.80,0:01:39.64,Default,,0000,0000,0000,,to the USB cable and act as a radio \Nlink to the data collection micro:bit. Dialogue: 0,0:01:39.64,0:01:42.94,Default,,0000,0000,0000,,Follow the instructions on screen to connect. Dialogue: 0,0:01:44.50,0:01:47.32,Default,,0000,0000,0000,, Once your data collection micro:bit is connected Dialogue: 0,0:01:47.32,0:01:53.28,Default,,0000,0000,0000,,you’ll see the lines on the live graph \Nchange as you move your micro:bit about.\N Dialogue: 0,0:01:53.28,0:01:58.36,Default,,0000,0000,0000,,You’re now ready to add your \Nown movement data samples.\N Dialogue: 0,0:01:58.36,0:02:04.44,Default,,0000,0000,0000,,As this project already includes some \Ndata samples, we suggest you just add   Dialogue: 0,0:02:04.44,0:02:12.84,Default,,0000,0000,0000,,1 more sample for each action for now, and spend \Nmore time collecting and analysing data later. Dialogue: 0,0:02:12.84,0:02:16.60,Default,,0000,0000,0000,,Decide what ‘exercising’ \Naction you are going to do.  Dialogue: 0,0:02:16.60,0:02:23.04,Default,,0000,0000,0000,,This could be running, walking briskly, \Njumping, boxing, dancing, or any other exercise.  Dialogue: 0,0:02:23.04,0:02:29.92,Default,,0000,0000,0000,,Make sure the micro:bit is attached to \Nthe wrist or ankle that will be moving. Dialogue: 0,0:02:29.92,0:02:34.44,Default,,0000,0000,0000,,To add data to a specific action, \Nselect it by clicking on it.  Dialogue: 0,0:02:34.44,0:02:39.64,Default,,0000,0000,0000,,You will get a 3 second countdown \Nbefore a 1 second recording starts.  Dialogue: 0,0:02:39.64,0:02:45.20,Default,,0000,0000,0000,,Click record and start moving right away \Nto ensure you get a clean data sample.  Dialogue: 0,0:02:45.20,0:02:49.08,Default,,0000,0000,0000,,A clean sample is one where you \Nare moving for the entire sample,   Dialogue: 0,0:02:49.08,0:02:55.44,Default,,0000,0000,0000,,you don’t start late or finish moving early.\NNext try adding an extra data sample   Dialogue: 0,0:02:55.44,0:03:00.92,Default,,0000,0000,0000,,to the ‘not exercising’ data set.\NSelect it by clicking on the action,   Dialogue: 0,0:03:00.92,0:03:06.44,Default,,0000,0000,0000,,then stay still, or only move very \Nslightly as you record the sample.  Dialogue: 0,0:03:06.44,0:03:10.80,Default,,0000,0000,0000,,You’ll notice that the x,y,z \Nlines change places depending   Dialogue: 0,0:03:10.80,0:03:14.77,Default,,0000,0000,0000,,on the angle at which you hold your micro:bit. Dialogue: 0,0:03:14.77,0:03:18.32,Default,,0000,0000,0000,,The project doesn’t have a lot of data right now,  Dialogue: 0,0:03:18.32,0:03:24.40,Default,,0000,0000,0000,,but we have enough to train our own \Nmachine learning model using CreateAI.  Dialogue: 0,0:03:24.40,0:03:30.36,Default,,0000,0000,0000,,So click ‘Train’ to use the \Ncurrent data to build an ML model. Dialogue: 0,0:03:30.36,0:03:34.64,Default,,0000,0000,0000,,The tool now builds a mathematical \Nmodel that should recognise different   Dialogue: 0,0:03:34.64,0:03:39.36,Default,,0000,0000,0000,,actions when you move your micro:bit.\NAs soon as the model has been trained,   Dialogue: 0,0:03:39.36,0:03:44.08,Default,,0000,0000,0000,,you’ll see the Testing model page.\NYour data collection micro:bit can now   Dialogue: 0,0:03:44.08,0:03:50.16,Default,,0000,0000,0000,,be used to test how well the model is working.\NIt should still be connected to the tool,   Dialogue: 0,0:03:50.16,0:03:59.80,Default,,0000,0000,0000,,and you’ll see that as you move it, CreateAI \Nis estimating what action you are doing. Dialogue: 0,0:03:59.80,0:04:05.24,Default,,0000,0000,0000,,Try out different levels of exercising or \Nnot exercising to see both the estimated   Dialogue: 0,0:04:05.24,0:04:12.40,Default,,0000,0000,0000,,action and the certainty bar graph change.\NThe % on the certainty bar graph shows how   Dialogue: 0,0:04:12.40,0:04:16.84,Default,,0000,0000,0000,,confident the model is that \Nyou are doing each action. Dialogue: 0,0:04:16.84,0:04:22.24,Default,,0000,0000,0000,,You may notice your model is not estimating \Nsome actions accurately, or maybe it is   Dialogue: 0,0:04:22.24,0:04:28.56,Default,,0000,0000,0000,,working well for one action but not the other,\Nso after exploring how it is currently working,   Dialogue: 0,0:04:28.56,0:04:34.52,Default,,0000,0000,0000,,it’s a good idea to click on ‘Edit \Ndata samples’ and improve your model. Dialogue: 0,0:04:34.52,0:04:41.32,Default,,0000,0000,0000,,Machine learning models usually work best with \Nmore data, so record some extra samples for each   Dialogue: 0,0:04:41.32,0:04:48.80,Default,,0000,0000,0000,,of the actions, or focus on collecting more data \Nfor the action that was problematic in testing. Dialogue: 0,0:04:48.80,0:04:54.24,Default,,0000,0000,0000,,You can record 1 sample at a time or \Nyou can record 10 samples in sequence. Dialogue: 0,0:04:54.24,0:04:58.84,Default,,0000,0000,0000,,Clean data samples also \Nhelp an ML model work better  Dialogue: 0,0:04:58.84,0:05:05.56,Default,,0000,0000,0000,,so interrogate your data set and identify any \Ndata samples that could confuse the model.  Dialogue: 0,0:05:05.56,0:05:12.08,Default,,0000,0000,0000,,You can delete these by pressing x.\NOnce you’ve added more data and checked   Dialogue: 0,0:05:12.08,0:05:17.72,Default,,0000,0000,0000,,your data set, click Train model \Nagain to use your amended data set.  Dialogue: 0,0:05:17.72,0:05:27.00,Default,,0000,0000,0000,,Then test the model again on \Nthe ‘Testing model’ page. Dialogue: 0,0:05:27.00,0:05:30.20,Default,,0000,0000,0000,,Once you’re happy with how \Nthe ML model is behaving,   Dialogue: 0,0:05:30.20,0:05:34.12,Default,,0000,0000,0000,,you can use it with the ready-made project code. Dialogue: 0,0:05:34.12,0:05:40.92,Default,,0000,0000,0000,,Click on 'Edit in MakeCode' to see the code blocks \Nin a special version of Microsoft MakeCode. Dialogue: 0,0:05:40.92,0:05:48.56,Default,,0000,0000,0000,,You can always return to CreateAI using \Nthe arrow in the top left of the screen. Dialogue: 0,0:05:48.56,0:05:54.72,Default,,0000,0000,0000,,These code blocks use the model you \Nhave created within an exercise timer. Dialogue: 0,0:05:54.72,0:05:59.76,Default,,0000,0000,0000,,The code uses two variables to keep track \Nof how long you've been exercising and how   Dialogue: 0,0:05:59.76,0:06:04.16,Default,,0000,0000,0000,,long you've not been exercising.\NWhen the program first runs it sets   Dialogue: 0,0:06:04.16,0:06:09.36,Default,,0000,0000,0000,,these timer variables to 0.\NThe 'on ML start' blocks are   Dialogue: 0,0:06:09.36,0:06:15.40,Default,,0000,0000,0000,,triggered when the ML model decides you have \Nstarted either exercising or not exercising.  Dialogue: 0,0:06:15.40,0:06:19.24,Default,,0000,0000,0000,,They show different icons on the \Nmicro:bit's LED display depending   Dialogue: 0,0:06:19.24,0:06:25.92,Default,,0000,0000,0000,,on the action it has estimated you are doing.\NThe 'on ML stop' blocks are triggered when the   Dialogue: 0,0:06:25.92,0:06:32.96,Default,,0000,0000,0000,,ML model decides you have finished an action, \Nin this case exercising or not exercising.  Dialogue: 0,0:06:32.96,0:06:38.24,Default,,0000,0000,0000,,Code inside each block clears the screen and \Nadds the duration of the action that has just   Dialogue: 0,0:06:38.24,0:06:43.36,Default,,0000,0000,0000,,finished to the variable storing \Nthe total times for each action. Dialogue: 0,0:06:43.36,0:06:49.68,Default,,0000,0000,0000,,The ML model works with the code to allow you \Nto view the total time spent on each action.  Dialogue: 0,0:06:49.68,0:06:55.16,Default,,0000,0000,0000,,Press button A to see the total time you have \Nbeen exercising and press button B to see the   Dialogue: 0,0:06:55.16,0:07:00.68,Default,,0000,0000,0000,,total time you have been inactive.\NThe timer counts in milliseconds,   Dialogue: 0,0:07:00.68,0:07:07.88,Default,,0000,0000,0000,,thousandths of a second, so the number shown \Nis divided by 1000 to show a time in seconds. Dialogue: 0,0:07:07.88,0:07:12.64,Default,,0000,0000,0000,,To make your simple AI exercise \Ntimer run on your micro:bit, you   Dialogue: 0,0:07:12.64,0:07:19.36,Default,,0000,0000,0000,,just need to download this code to a micro:bit.\NIf you don’t have another micro:bit available,   Dialogue: 0,0:07:19.36,0:07:26.44,Default,,0000,0000,0000,,simply replace the code currently on the data \Ncollection micro:bit with the project code.\N Dialogue: 0,0:07:26.44,0:07:31.20,Default,,0000,0000,0000,,Now test the project out in real life. \NDo the correct icons display   Dialogue: 0,0:07:31.20,0:07:36.64,Default,,0000,0000,0000,,when you are exercising or not?\NYou can test if the timer code is working   Dialogue: 0,0:07:36.64,0:07:41.64,Default,,0000,0000,0000,,well with the model in 3 easy steps:\NPress the reset button. Dialogue: 0,0:07:41.64,0:07:46.04,Default,,0000,0000,0000,,Exercise for 30 seconds.\NThen press button A. Dialogue: 0,0:07:46.04,0:07:50.08,Default,,0000,0000,0000,,You should see the number 30 \Nscroll across your display. Dialogue: 0,0:07:50.08,0:07:55.24,Default,,0000,0000,0000,,You’re now ready to connect to CreateAI, \Ncollect your own data, use it to train,   Dialogue: 0,0:07:55.24,0:08:00.16,Default,,0000,0000,0000,,test & improve a machine learning model.\NAnd you can then combine this model with   Dialogue: 0,0:08:00.16,0:08:05.64,Default,,0000,0000,0000,,the ready-made code and try \Nit out on your own micro:bit.