Posts

ml5.js: KNN Classification Part 3

Image
 ml5.js: KNN Classification Part 3 - YouTube https://www.youtube.com/watch?v=JWsKay58Z2g Transcript: (00:00) [BELL RINGS] Welcome back. I'm going to finish this ml5 KNN classification example for like a gesture-based controller. So I just-- in between the last video and this one, I just sort of trained a quick KNN model where if my head is up here, it registers as up. If my head is down here, it registers as down. (00:19) Over here would be to the left, and over here would be to the right. Now, you know, interestingly enough, because I have a green screen here and I'm a sort of quite a different color than the green screen, I could probably just do this with some image processing and like pixel manipulation to sort of like check where my head is, so with a lot of if statements. (00:37) That's the sort of interesting thing about like, you can almost think of you doing machine learning as it's like this automatic if statement, I think, is one way of thinking about it. But...

ml5.js: KNN Classification Part 2

Image
 ml5.js: KNN Classification Part 2 - YouTube https://www.youtube.com/watch?v=Mwo5_bUVhlA Transcript: (00:00) [DING] All right, we are ready to continue our ml5 KNN Classification, what I'm calling game controller. I want it to be able to create an interface by which I can train a little controller for a game to move something left and right, maybe up and down. That's what I'm doing. Now the last video I left off with at this step where I load the MobileNet model, I create a feature extractor, I passed in an image from the webcam and I get the logit itself. (00:29) So one thing I do want to mention, people in the chat were helpful, I was being a little bit loosey goosey with the terminology of like scalar, vector, matrix and tensor. And so I should mention that a scalar being like a single number, is really zero dimensions. A vector is typically like a list of numbers, which is really one dimensional. (00:51) A matrix is thought of as a grid of numbers. This is 2D. And a ten...

ml5.js: KNN Classification Part 1

Image
 ml5.js: KNN Classification Part 1 - YouTube https://www.youtube.com/watch?v=KTNqXwkLuM4 Transcript: (00:00) Hello. I am back in the beginner's guide to Machine Learning with ML5. And today, I am continuing this series and I'm going to do a few videos about something called KNN Classification. And the thing that I'm going to use it and apply it to, is building your own teachable machine. Now this is the Teachable Machine Project from Google Creative Lab demonstrating this idea of transfer learning. (00:28) Taking a pre-trained model and using it as a foundation to train a new model on top of. Now you might be thinking, didn't you already make these videos? There was that whole thing with the feature extractor and classification and regression and saving the model. Yes, you are right. I did already make those videos. (00:45) However, I'm going to, basically, do the exact same thing again but with a slightly different technique. And that technique is called KNN Classi...

ml5.js: Save/Load Model

Image
 ml5.js: Save/Load Model - YouTube https://www.youtube.com/watch?v=eU7gIy3xV30 Transcript: (00:00) [BELL RINGS] Hello, and welcome to another Beginner's Guide to Machine Learning with ml5js video. Now in this video, I am going to unlock something for you. It's already unlocked for you, but I'm going to show it to you, that is incredibly powerful for what you could do now with ml5 that you couldn't do before but many of you asked about in the comments. (00:18) And what is that? It is the Save/Load feature extractor. This is a new feature that was added to ml5 just five days ago. You need to make sure that you are using ml5 0.1.3, or whatever number in the future past that. But certainly, this is the version of the library that I'm using in this video. Now what does it do? So the last example, if you've been watching these video series in order, was this example. (00:47) What this example does is it loads a pre-trained image classification model called MobileNet. ...

ml5.js: Feature Extractor Regression

Image
 ml5.js: Feature Extractor Regression - YouTube https://www.youtube.com/watch?v=aKgq0m1YjvQ Transcript: (00:00) [WHISTLE]  Hello, everyone. In the previous video, I made this example. What this example is doing, is it's using something called transfer learning. It's already been trained to recognize my happy face. And my sad face. My happy. My sad face. The process that I use is something called transfer learning, where I'm using a pre-trained model, MobileNet. (00:29) I am eliminating the last part of what it does, which is like take an image and give it a label with some probabilities. I eliminate that. But I'm using all the steps it does up until that last step where it basically boils the image down to a nice smaller array of numbers called the features. And then I assign my own labels to particular features from images that I'm giving it and train it again. (00:53) So now it knows how to recognize new images. And instead of giving me the MobileNet labels, givin...

ml5.js: Feature Extractor Classification

Image
 ml5.js: Feature Extractor Classification - YouTube https://www.youtube.com/watch?v=eeO-rWYFuG0 Transcript: (00:00) OK, it is time now. I am going to build a image classifier using my own images. I am going to teach this example to not say acoustic guitar or electric guitar, but to say ukulele. I am going to teach this example not to say syringe, but just say train whistle. OK, this is what we're going to do-- and the process that I'm going to use is transfer . (00:24) Learning I described this process in the previous video. You can go back and watch that if you want, or you can just keep following with me. I'm going to write the code for this. One thing that I want to mention is-- you might be wondering, oh, why is it called a feature extractor? How does this stuff happen? So I want to first mention it, and thank Gene Kogan for making the image classification and regression transfer learning with MobileNet examples. (00:48) You can find these sort of native TensorFlow.js v...

ml5.js: Transfer Learning with Feature Extractor

Image
 ml5.js: Transfer Learning with Feature Extractor - YouTube https://www.youtube.com/watch?v=kRpZ5OqUY6Y Transcript: (00:00) [BELL RINGS] Hello. Welcome to another ml5.js video. Now I am really very excited about this one. I have made three videos so far at the moment at the time of this recording, sort of Intro to ml5 and Machine Learning, a video about doing image classification, and a video about doing image classification with real-time images coming in from a webcam. (00:20) And both of those image classification projects use a pre-trained model called MobileNet. So just to pick off where we last left off, here it is. This is the image classification MobileNet with MobileNet example. You can see that I am, today, a-- ah, come on. I want to be a snorkel. I really feel like a snorkel. (00:39) I am kind of like an oboe. But we could see here, I think, ah, if I get this ukulele and put it in here, it's going to see it's an acoustic guitar pretty quickly. Let me put this down ov...