1 00:00:00,00 --> 00:00:06,02 (upbeat instrumental music) 2 00:00:06,02 --> 00:00:07,01 - [Instructor] I am excited 3 00:00:07,01 --> 00:00:08,09 to give you the solution 4 00:00:08,09 --> 00:00:12,01 for the Dripping Water 5 00:00:12,01 --> 00:00:15,09 Audio Classification Model challenge 6 00:00:15,09 --> 00:00:18,01 that I'd given you. 7 00:00:18,01 --> 00:00:19,09 I actually thought about it. 8 00:00:19,09 --> 00:00:22,00 I told you about dripping water, 9 00:00:22,00 --> 00:00:26,05 and I was wondering what if we used a cup of tea, 10 00:00:26,05 --> 00:00:29,07 and made it drip? 11 00:00:29,07 --> 00:00:35,01 Machine learning with an AI is so accurate 12 00:00:35,01 --> 00:00:38,05 that if you actually had dripping water 13 00:00:38,05 --> 00:00:40,01 versus dripping tea, 14 00:00:40,01 --> 00:00:41,04 it will know the difference, 15 00:00:41,04 --> 00:00:43,06 provided you give it enough sample set. 16 00:00:43,06 --> 00:00:46,02 Anyway, coming back to a dripping water problem, 17 00:00:46,02 --> 00:00:50,06 we are looking at water dripping in a pipe, 18 00:00:50,06 --> 00:00:53,07 and you are creating an HJI device, 19 00:00:53,07 --> 00:00:57,00 and it is going to have this HJI model, 20 00:00:57,00 --> 00:00:59,07 which is going to identify the sound 21 00:00:59,07 --> 00:01:01,02 of this dripping water. 22 00:01:01,02 --> 00:01:03,02 That's what we are going here for. 23 00:01:03,02 --> 00:01:06,01 I want you to remember that though 24 00:01:06,01 --> 00:01:07,09 I'm teaching you to actually 25 00:01:07,09 --> 00:01:09,09 build a training model, 26 00:01:09,09 --> 00:01:11,04 and it is going to train, 27 00:01:11,04 --> 00:01:13,04 and then you can export it. 28 00:01:13,04 --> 00:01:14,05 When you export it, 29 00:01:14,05 --> 00:01:16,02 it is an inference model, 30 00:01:16,02 --> 00:01:18,06 so what will sit on your edge device 31 00:01:18,06 --> 00:01:19,09 is an inference AI. 32 00:01:19,09 --> 00:01:21,07 So I just want you to keep that in mind 33 00:01:21,07 --> 00:01:23,05 that when you're dealing with training AI, 34 00:01:23,05 --> 00:01:25,05 that's not what the customer is seeing. 35 00:01:25,05 --> 00:01:28,00 What the customer is seeing is the inference AI. 36 00:01:28,00 --> 00:01:29,08 Now, let's look at the demo. 37 00:01:29,08 --> 00:01:31,09 The My Solution demo. 38 00:01:31,09 --> 00:01:32,07 Okay,. 39 00:01:32,07 --> 00:01:37,06 So we have background sound. 40 00:01:37,06 --> 00:01:41,06 We made this using the mic, 41 00:01:41,06 --> 00:01:44,06 and I just recorded for 20 seconds, 42 00:01:44,06 --> 00:01:47,03 so let me delete this and start again. 43 00:01:47,03 --> 00:01:52,00 And I basically said record for 20 seconds, 44 00:01:52,00 --> 00:01:55,09 kept quiet and then I said, extract sample, 45 00:01:55,09 --> 00:01:58,02 and it extracted the samples for me. 46 00:01:58,02 --> 00:02:00,08 It's actually showing 30 samples and out of 20 47 00:02:00,08 --> 00:02:02,01 because I deleted some, 48 00:02:02,01 --> 00:02:06,00 and added more samples to be extracted. 49 00:02:06,00 --> 00:02:06,08 Okay. 50 00:02:06,08 --> 00:02:10,02 So you can add any number of background noise, 51 00:02:10,02 --> 00:02:12,00 but it expects a minimum 52 00:02:12,00 --> 00:02:14,07 of 20 in teachable machine. 53 00:02:14,07 --> 00:02:16,03 Then the bell sound, 54 00:02:16,03 --> 00:02:19,02 I literally used the mic, 55 00:02:19,02 --> 00:02:24,08 and I did what we did in our demo, 56 00:02:24,08 --> 00:02:26,07 and I said, record. 57 00:02:26,07 --> 00:02:28,07 Let me start again. 58 00:02:28,07 --> 00:02:32,00 (bell dinging) 59 00:02:32,00 --> 00:02:34,03 And then I said extract, 60 00:02:34,03 --> 00:02:36,03 and I got a bunch of samples, 61 00:02:36,03 --> 00:02:39,01 and I got about 12 samples. 62 00:02:39,01 --> 00:02:40,01 Okay. 63 00:02:40,01 --> 00:02:41,06 Then I made a new class. 64 00:02:41,06 --> 00:02:43,06 This is a dripping water class. 65 00:02:43,06 --> 00:02:45,03 I just called it water. 66 00:02:45,03 --> 00:02:46,04 Again, the name doesn't matter. 67 00:02:46,04 --> 00:02:51,04 It's just a name for this group of data, 68 00:02:51,04 --> 00:02:53,08 just named as water in this case. 69 00:02:53,08 --> 00:02:54,08 Okay. 70 00:02:54,08 --> 00:02:57,07 So again, it says you need eight minimum. 71 00:02:57,07 --> 00:03:00,03 So I'm going to use the mic, 72 00:03:00,03 --> 00:03:03,06 and I'm going to record, 73 00:03:03,06 --> 00:03:05,06 and this is dripping water. 74 00:03:05,06 --> 00:03:06,05 Okay. 75 00:03:06,05 --> 00:03:11,02 So I have a cup with water in a spoon, 76 00:03:11,02 --> 00:03:19,08 and as soon as I hit record, 77 00:03:19,08 --> 00:03:21,03 I didn't like it. 78 00:03:21,03 --> 00:03:22,05 I think I started slow, 79 00:03:22,05 --> 00:03:25,05 so I'm going to get rid of it. 80 00:03:25,05 --> 00:03:26,09 See what I did here? 81 00:03:26,09 --> 00:03:28,09 I don't need to extract the sample. 82 00:03:28,09 --> 00:03:30,03 I can just ignore it. 83 00:03:30,03 --> 00:03:31,07 So I wanted to show you, 84 00:03:31,07 --> 00:03:33,03 you don't have to be perfect. 85 00:03:33,03 --> 00:03:35,03 You can try this any number of time. 86 00:03:35,03 --> 00:03:36,09 When you extract the sample, 87 00:03:36,09 --> 00:03:38,03 then it extracts the sample. 88 00:03:38,03 --> 00:03:39,03 Even at that point, 89 00:03:39,03 --> 00:03:41,05 you didn't like it, you can d delete it. 90 00:03:41,05 --> 00:03:43,02 See, it's that simple. 91 00:03:43,02 --> 00:03:44,00 Okay. 92 00:03:44,00 --> 00:03:45,05 So I'm going to do it again, 93 00:03:45,05 --> 00:03:50,03 and I'm holding a spoon of water over a cup. 94 00:03:50,03 --> 00:03:53,00 I'm going to let it drip, 95 00:03:53,00 --> 00:03:55,03 and at the same time I'm going to press 96 00:03:55,03 --> 00:04:01,02 record two seconds. 97 00:04:01,02 --> 00:04:02,02 Okay. 98 00:04:02,02 --> 00:04:04,07 Now extract the sample. 99 00:04:04,07 --> 00:04:07,04 Now I need eight of them. 100 00:04:07,04 --> 00:04:11,03 I'm going to repeat this. 101 00:04:11,03 --> 00:04:12,08 Okay, I've got 10 samples. 102 00:04:12,08 --> 00:04:15,03 You don't have to have an exact equal number. 103 00:04:15,03 --> 00:04:19,04 I have 12 in the bell and 10 in here. 104 00:04:19,04 --> 00:04:20,03 It doesn't matter. 105 00:04:20,03 --> 00:04:22,06 It has to be kind of close. 106 00:04:22,06 --> 00:04:23,04 Okay. 107 00:04:23,04 --> 00:04:25,01 So what did we do in our training? 108 00:04:25,01 --> 00:04:28,00 We collected our samples in three classes. 109 00:04:28,00 --> 00:04:29,05 That's what we've done here. 110 00:04:29,05 --> 00:04:32,06 And then I taught you about epoch is the number 111 00:04:32,06 --> 00:04:33,09 of times the training data 112 00:04:33,09 --> 00:04:35,05 is going to be scanned. 113 00:04:35,05 --> 00:04:38,08 And if you look closely, you can see 114 00:04:38,08 --> 00:04:40,05 the sound is digitized, 115 00:04:40,05 --> 00:04:43,05 and the frequency is captured here beautifully. 116 00:04:43,05 --> 00:04:46,06 Okay, so I just press click, 117 00:04:46,06 --> 00:04:49,07 and it'll train the model, 118 00:04:49,07 --> 00:04:54,04 and it says preparing training and it's done. 119 00:04:54,04 --> 00:04:55,02 Yeah. 120 00:04:55,02 --> 00:04:56,00 Okay. 121 00:04:56,00 --> 00:04:58,02 So now as I'm talking, 122 00:04:58,02 --> 00:05:00,00 it's trying to hear my voice 123 00:05:00,00 --> 00:05:02,07 because I've turned input here 124 00:05:02,07 --> 00:05:03,08 from the mic, 125 00:05:03,08 --> 00:05:05,04 and it's trying to guess 126 00:05:05,04 --> 00:05:07,00 the sound that it is hearing. 127 00:05:07,00 --> 00:05:08,04 Is that background? 128 00:05:08,04 --> 00:05:11,01 Is that the bell or is it the water? 129 00:05:11,01 --> 00:05:13,02 As I taught you during the demo, 130 00:05:13,02 --> 00:05:15,07 this AI's world is very narrow. 131 00:05:15,07 --> 00:05:18,09 It knows only three classes of sounds, 132 00:05:18,09 --> 00:05:19,09 the background noise, 133 00:05:19,09 --> 00:05:22,01 the bell sound and the water sound. 134 00:05:22,01 --> 00:05:24,01 So anything else it hears 135 00:05:24,01 --> 00:05:26,02 is going to fit under that. 136 00:05:26,02 --> 00:05:29,04 See, if I go and go add a different sound. 137 00:05:29,04 --> 00:05:31,01 (sounds tapping) 138 00:05:31,01 --> 00:05:36,02 I'm tapping my spoon to my cup, 139 00:05:36,02 --> 00:05:38,04 and it's just trying to fit in one of them. 140 00:05:38,04 --> 00:05:40,02 Okay, now for the real test. 141 00:05:40,02 --> 00:05:41,01 I'm going to be quiet, 142 00:05:41,01 --> 00:05:45,00 and see whether it recognize the background. 143 00:05:45,00 --> 00:05:45,08 Okay. 144 00:05:45,08 --> 00:05:47,06 So 99% or 97%, 145 00:05:47,06 --> 00:05:49,01 it thinks it's background. 146 00:05:49,01 --> 00:05:50,04 That's good. 147 00:05:50,04 --> 00:05:52,05 Now I'm going to test for the dripping water. 148 00:05:52,05 --> 00:05:54,05 That is our real use case, right. 149 00:05:54,05 --> 00:05:57,03 Pipe is leaking and you need to find 150 00:05:57,03 --> 00:05:59,04 the AI needs to recognize it 151 00:05:59,04 --> 00:06:02,07 so that it can notify you 152 00:06:02,07 --> 00:06:05,09 or turn on the water, turn off the water, 153 00:06:05,09 --> 00:06:08,01 do something meaningful, some automation. 154 00:06:08,01 --> 00:06:10,03 It gives you the power to do that, right. 155 00:06:10,03 --> 00:06:17,02 Here we go. 156 00:06:17,02 --> 00:06:19,01 So the number goes up. 157 00:06:19,01 --> 00:06:22,01 It could be another viscous fluid, 158 00:06:22,01 --> 00:06:25,08 which will have a different sound when it drips. 159 00:06:25,08 --> 00:06:27,09 And so if you want to capture that, 160 00:06:27,09 --> 00:06:29,01 and you want your AI model 161 00:06:29,01 --> 00:06:30,03 to capture that, 162 00:06:30,03 --> 00:06:32,00 you want to train for that, 163 00:06:32,00 --> 00:06:34,04 and you want to create the inference model, 164 00:06:34,04 --> 00:06:35,09 which you're going to automate. 165 00:06:35,09 --> 00:06:38,09 Maybe you have a full automation done 166 00:06:38,09 --> 00:06:42,08 from the HJI device or it sends you notification 167 00:06:42,08 --> 00:06:46,02 or it's integrated into your broader workflow 168 00:06:46,02 --> 00:06:47,05 into other systems. 169 00:06:47,05 --> 00:06:49,01 So there's so many possibilities, 170 00:06:49,01 --> 00:06:50,08 but what you have learned here 171 00:06:50,08 --> 00:06:52,06 is the foundation knowledge 172 00:06:52,06 --> 00:06:55,06 of how that machine learning classification 173 00:06:55,06 --> 00:06:56,04 is done, 174 00:06:56,04 --> 00:06:59,03 how it is so easy to collect data. 175 00:06:59,03 --> 00:07:01,02 So in instead of thinking of data 176 00:07:01,02 --> 00:07:02,05 as multiple data sets, 177 00:07:02,05 --> 00:07:04,01 and then download from here and there, 178 00:07:04,01 --> 00:07:05,06 and things like that, 179 00:07:05,06 --> 00:07:06,09 it's very simple, 180 00:07:06,09 --> 00:07:10,03 and you just create different class of data, 181 00:07:10,03 --> 00:07:12,07 and you train it, you export it, 182 00:07:12,07 --> 00:07:14,02 and you've got the answer. 183 00:07:14,02 --> 00:07:15,03 So let me show the export 184 00:07:15,03 --> 00:07:19,04 to finish up the challenge solution. 185 00:07:19,04 --> 00:07:23,08 All I did is press export and I said, 186 00:07:23,08 --> 00:07:26,02 upload my model, 187 00:07:26,02 --> 00:07:28,08 and it's uploading to the cloud. 188 00:07:28,08 --> 00:07:32,09 I copy that and this is where it is going 189 00:07:32,09 --> 00:07:34,06 to put the inference model. 190 00:07:34,06 --> 00:07:37,05 This inference model that you copy, 191 00:07:37,05 --> 00:07:39,05 you could also download it, 192 00:07:39,05 --> 00:07:41,00 and you can download it 193 00:07:41,00 --> 00:07:42,08 and burn it into your edge device. 194 00:07:42,08 --> 00:07:46,04 Edge AI typically sits on the Edge, 195 00:07:46,04 --> 00:07:47,07 and that is why it's call Edge AI 196 00:07:47,07 --> 00:07:48,08 in the first place, 197 00:07:48,08 --> 00:07:50,04 and then it runs inference from there. 198 00:07:50,04 --> 00:07:52,05 So it receives data like the sound 199 00:07:52,05 --> 00:07:53,07 of a dripping water 200 00:07:53,07 --> 00:07:56,02 or whatever your model is supposed to do, 201 00:07:56,02 --> 00:07:57,06 and it'll recognize 202 00:07:57,06 --> 00:07:59,09 and then it'll say, yes, 203 00:07:59,09 --> 00:08:01,01 I identified a water. 204 00:08:01,01 --> 00:08:02,05 Now what do you do with it 205 00:08:02,05 --> 00:08:04,01 is where you build the product 206 00:08:04,01 --> 00:08:05,07 of a notification integration 207 00:08:05,07 --> 00:08:06,05 into your workflow 208 00:08:06,05 --> 00:08:08,09 or whatever you action you want to take. 209 00:08:08,09 --> 00:08:10,00 Okay.