[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:01.24,0:00:08.19,Default,,0000,0000,0000,,To create your AI activity timer, you \Nwill train a machine learning, or ML, model Dialogue: 0,0:00:08.19,0:00:13.08,Default,,0000,0000,0000,,to recognise when you’re doing \Ndifferent movements or activities. Dialogue: 0,0:00:13.08,0:00:18.96,Default,,0000,0000,0000,,You’ll then combine that model with some \Nready-made code for an activity timer,   Dialogue: 0,0:00:18.96,0:00:26.80,Default,,0000,0000,0000,,before downloading it to your \Nmicro:bit and using it in real life. Dialogue: 0,0:00:26.80,0:00:33.96,Default,,0000,0000,0000,,Click ‘Open in micro:bit CreateAI’ to launch the project. Dialogue: 0,0:00:33.96,0:00:41.12,Default,,0000,0000,0000,,This project comes with 6 samples of movement \Ndata for walking, 6 samples of movement data   Dialogue: 0,0:00:41.12,0:00:47.20,Default,,0000,0000,0000,,for jumping up and down, and 6 samples of \Nmovement data for staying fairly still. Dialogue: 0,0:00:47.20,0:00:54.20,Default,,0000,0000,0000,,You will add more samples by \Nrecording your own movement data. Dialogue: 0,0:00:54.20,0:01:02.70,Default,,0000,0000,0000,,micro:bit CreateAI collects movement data\Nsamples using the accelerometer,  \Nor movement sensor, on the micro:bit. Dialogue: 0,0:01:05.73,0:01:09.73,Default,,0000,0000,0000,,You will wear a micro:bit and battery pack on your wrist or ankle Dialogue: 0,0:01:09.73,0:01:15.12,Default,,0000,0000,0000,,so that you can move freely\Nto record your own movement data samples. Dialogue: 0,0:01:15.12,0:01:20.40,Default,,0000,0000,0000,,To get started, connect the \Nankle-worn micro:bit to CreateAI.  Dialogue: 0,0:01:20.40,0:01:23.82,Default,,0000,0000,0000,,We call this the data collection micro:bit. Dialogue: 0,0:01:23.82,0:01:31.64,Default,,0000,0000,0000,,If your computer has Bluetooth enabled then you will just need 1 micro:bit with a battery pack and a USB data lead. Dialogue: 0,0:01:31.64,0:01:36.64,Default,,0000,0000,0000,,If you don’t have a Bluetooth connection, \Nyou’ll be prompted to use 2 micro:bits. Dialogue: 0,0:01:36.64,0:01:41.40,Default,,0000,0000,0000,,The second micro:bit will remain \Nconnected to the USB cable and act as   Dialogue: 0,0:01:41.40,0:01:50.60,Default,,0000,0000,0000,,a radio link to the data collection micro:bit.\NFollow the instructions on screen to connect. Dialogue: 0,0:01:50.60,0:01:57.82,Default,,0000,0000,0000,,Once your micro:bit is connected, you will see the lines on the live graph change as  you move your micro:bit about. Dialogue: 0,0:01:57.82,0:02:02.30,Default,,0000,0000,0000,,You’re now ready to add your own movement data samples. Dialogue: 0,0:02:02.30,0:02:06.26,Default,,0000,0000,0000,,As this project already includes some data samples, Dialogue: 0,0:02:06.26,0:02:16.91,Default,,0000,0000,0000,,we suggest you just add 1 more sample for each action for now, and spend more time collecting and analysing data later. Dialogue: 0,0:02:16.91,0:02:24.80,Default,,0000,0000,0000,,Make sure your data collection micro:bit is attached to the inside of the ankle, with button B on top. Dialogue: 0,0:02:24.80,0:02:29.28,Default,,0000,0000,0000,,To add data to a specific action, \Nselect it by clicking on it.  Dialogue: 0,0:02:29.28,0:02:34.44,Default,,0000,0000,0000,,You will get a 3 second countdown \Nbefore a 1 second recording starts.  Dialogue: 0,0:02:34.44,0:02:40.08,Default,,0000,0000,0000,,Click record and start moving right away \Nto ensure you get a clean data sample.  Dialogue: 0,0:02:40.08,0:02:43.96,Default,,0000,0000,0000,,A clean sample is one where you \Nare moving for the entire sample,   Dialogue: 0,0:02:43.96,0:02:48.59,Default,,0000,0000,0000,,you don’t start late or finish moving early. Dialogue: 0,0:02:48.59,0:02:55.52,Default,,0000,0000,0000,,Next try adding an extra data sample to the ‘jumping’ data set and the ‘being still’ data set. Dialogue: 0,0:02:55.52,0:03:05.04,Default,,0000,0000,0000,,Select them by clicking on the action, then click record and jump or stay quite still as you record the samples.  Dialogue: 0,0:03:05.04,0:03:16.52,Default,,0000,0000,0000,,You’ll notice on the 'being still' samples \Nthat the x,y,z lines change places depending on the angle of the attached micro:bit. Dialogue: 0,0:03:16.52,0:03:26.08,Default,,0000,0000,0000,,We don’t have a lot of data right now, but we do have enough to train our own  machine learning model using CreateAI.  Dialogue: 0,0:03:26.08,0:03:33.72,Default,,0000,0000,0000,,So click ‘Train model’ to use the \Ncurrent data to build an ML model. Dialogue: 0,0:03:33.72,0:03:41.36,Default,,0000,0000,0000,,The tool now builds a mathematical model that should recognise different actions when you move your micro:bit. Dialogue: 0,0:03:41.36,0:03:45.65,Default,,0000,0000,0000,,As soon as the model has been trained, you will see the Testing model page. Dialogue: 0,0:03:45.65,0:03:50.72,Default,,0000,0000,0000,,Now use the data collection micro:bit to test how well the model is working. Dialogue: 0,0:03:50.72,0:03:59.72,Default,,0000,0000,0000,,It should still be connected to the tool, and you’ll see that as you move it, CreateAI is estimating what action you are doing. Dialogue: 0,0:04:02.36,0:04:09.70,Default,,0000,0000,0000,,Try out each of the actions to see \Nboth the estimated action and the certainty bar graph change. Dialogue: 0,0:04:11.26,0:04:19.13,Default,,0000,0000,0000,,The % on the certainty bar graph shows how confident the model is that you are doing each action.  Dialogue: 0,0:04:21.60,0:04:26.52,Default,,0000,0000,0000,,You may notice your model is not estimating \Nsome actions accurately, or maybe it is   Dialogue: 0,0:04:26.52,0:04:32.72,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:32.72,0:04:40.36,Default,,0000,0000,0000,,it is a good idea to click on ‘Edit \Ndata samples’ and improve your model.  Dialogue: 0,0:04:40.36,0:04:46.36,Default,,0000,0000,0000,,Machine learning models usually work best with \NMORE data, so record some extra samples for each   Dialogue: 0,0:04:46.36,0:04:54.96,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:54.96,0:05:01.94,Default,,0000,0000,0000,,You can record one sample at a time or \Nyou can record 10 samples in sequence.  Dialogue: 0,0:05:10.16,0:05:23.08,Default,,0000,0000,0000,,Clean data samples also help an ML model work \Nbetter so examine your data set and identify any data samples that could confuse the model. Dialogue: 0,0:05:26.00,0:05:29.64,Default,,0000,0000,0000,,You can delete these by pressing X. Dialogue: 0,0:05:30.84,0:05:39.42,Default,,0000,0000,0000,,Once you’ve added more data and checked your data set, click ‘Train model’ again to use your amended data set.  Dialogue: 0,0:05:40.48,0:05:45.99,Default,,0000,0000,0000,,Then test the model again on the ‘Testing model’ page. Dialogue: 0,0:05:48.56,0:05:54.64,Default,,0000,0000,0000,,Once you’re happy with how the ML model is behaving, you can use it with the ready-made project code.  Dialogue: 0,0:05:54.64,0:06:02.48,Default,,0000,0000,0000,,Click on ‘Edit in MakeCode’ to see the code \Nblocks in a special version of Microsoft MakeCode.  Dialogue: 0,0:06:02.48,0:06:09.56,Default,,0000,0000,0000,,You can always return to CreateAI using \Nthe arrow in the top left of the screen.  Dialogue: 0,0:06:09.56,0:06:19.24,Default,,0000,0000,0000,,These code blocks use the model you \Nhave created within an exercise timer.  Dialogue: 0,0:06:19.24,0:06:26.16,Default,,0000,0000,0000,,The code uses 3 variables to keep track \Nof how long you've been doing each action.  Dialogue: 0,0:06:26.16,0:06:33.68,Default,,0000,0000,0000,,When the program first runs it \Nsets these timer variables to 0.  Dialogue: 0,0:06:33.68,0:06:40.12,Default,,0000,0000,0000,,The 'on ML start' blocks are triggered when the ML \Nmodel decides you have started a specific action.  Dialogue: 0,0:06:40.12,0:06:49.25,Default,,0000,0000,0000,,They show different icons on the micro:bit's LED display depending on the action it has estimated you are doing. Dialogue: 0,0:06:50.29,0:07:01.28,Default,,0000,0000,0000,,The 'on ML stop' blocks are triggered when the ML model decides you have finished an action, \Nin this case walking, jumping or being still.  Dialogue: 0,0:07:01.28,0:07:06.88,Default,,0000,0000,0000,,Code inside each block clears the screen and \Nadds the duration of the action that has just   Dialogue: 0,0:07:06.88,0:07:13.44,Default,,0000,0000,0000,,finished to the variable storing \Nthe total times for each action.  Dialogue: 0,0:07:13.44,0:07:19.44,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:07:19.44,0:07:23.04,Default,,0000,0000,0000,,Press button A to see the estimate \Nof how long you were walking.  Dialogue: 0,0:07:23.04,0:07:28.16,Default,,0000,0000,0000,,Press button B to see how long the \Nmodel estimated you were jumping.  Dialogue: 0,0:07:28.16,0:07:34.08,Default,,0000,0000,0000,,To see the estimated duration you have \Nbeen still press A and B together.  Dialogue: 0,0:07:34.08,0:07:44.11,Default,,0000,0000,0000,,The timer counts in milliseconds, thousandths of a second, so the number shown is divided by 1000 to show a time in seconds. Dialogue: 0,0:07:44.11,0:07:53.16,Default,,0000,0000,0000,,To make your AI activity timer run on your micro:bit, you just need to download this code to a micro:bit.  Dialogue: 0,0:07:53.16,0:08:00.64,Default,,0000,0000,0000,,If you don’t have another micro:bit available,\Nsimply replace the code currently on the data collection micro:bit with the project code. Dialogue: 0,0:08:01.65,0:08:05.00,Default,,0000,0000,0000,,Now you can test the project out in real life. Dialogue: 0,0:08:05.00,0:08:10.04,Default,,0000,0000,0000,,Do the correct icons display \Nwhen you are exercising or not?  Dialogue: 0,0:08:10.04,0:08:15.80,Default,,0000,0000,0000,,You can test if the timer code is working \Nwell with the model in 3 easy steps: Dialogue: 0,0:08:15.80,0:08:19.16,Default,,0000,0000,0000,,Press the reset button.\NJump for 30 seconds. Dialogue: 0,0:08:19.16,0:08:25.54,Default,,0000,0000,0000,,Then press button B.\NYou should see the number 30 scroll across your display. Dialogue: 0,0:08:25.54,0:08:28.56,Default,,0000,0000,0000,,You’re now ready to connect to CreateAI,   Dialogue: 0,0:08:28.56,0:08:34.56,Default,,0000,0000,0000,,collect your own data, use it to train, test and \Nimprove a machine learning model, and then you   Dialogue: 0,0:08:34.56,0:08:40.60,Default,,0000,0000,0000,,can combine this model with the ready-made \Ncode and try it out on your own micro:bit.  Dialogue: 0,0:08:40.60,0:08:48.38,Default,,0000,0000,0000,,If you’re looking for ways to personalise this even more try adding some different actions like running or dance steps. Dialogue: 0,0:08:48.38,0:08:52.48,Default,,0000,0000,0000,,Enjoy!