Computer Vision Basics + More deeplearning.ai Progress! | Learning Intelligence 16

Daniel Bourke completes Deep Learning Specialization Course 2 on hyperparameter tuning and moves into Course 3 on ML strategy, covering orthogonalization and error analysis through an autonomous-driving case study. He hand-codes a convolutional neural network in Course 4, explaining how CNNs extract features using visual filters, and shares insights from interviews with Andrej Karpathy and Ruslan Salakhutdinov on AI's future directions.
Chapters
Woo-hoo! Check it out, guys. Just passed the second course on Coursera's Deep Learning Specialization, Improving Deep Neural Networks: Hyperparameter Tuning, Regularization, and Optimization. And look how beautiful that certificate is. And that's something I can put on my LinkedIn or other profiles and whatnot. You're gonna have about 4 or 5 of these, 5, there you go, by the end of this course. So welcome to Learning Intelligence 15. This week, or this episode, is gonna be all about the Deep Learning Specialization on Coursera. I just passed course 2, And tomorrow I'm going to be getting into course 3, which is on, I think, improving machine learning models, but we'll get into that tomorrow. I'll show you then. But otherwise, the last project of part 2 was on TensorFlow. And now I've got a special guest for this episode. So I'm going to go try and find him and then he's going to explain what exactly TensorFlow is.
Whoa, I cannot believe that worked. Shh, don't tell Daniel I'm here, but I'm from the year 2045. You could consider me Future Dan, and I just found a time portal. I know why I'm talking like a Batman, but I must say the future is great, and I'm going to explain TensorFlow for you. So if you imagine TensorFlow is a, is a library, it's a framework, right? So if you wanted to build something out of Lego, you don't build the Lego blocks yourself, You buy the Lego set and you put it together and you make something amazing. So if you want to build a really advanced deep learning model like they do at Google, you don't build it from the ground up when you have TensorFlow available, which is your Lego set, and you can use the same library as Google, TensorFlow, to build your deep learning models. It's like creating a Lego feature out of your brand new Lego set, but you're doing it with your deep learning model. Oh, P.S. from the future, all the Rick and Morty episodes are practically true. Those guys are like fortune tellers. Back to Dan.
All right, so I couldn't find my friend, and maybe TensorFlow will have to be explained in another episode. But that's all right. Tomorrow, we're going to get into part 3 of the deep learning specialization.
Let's do it.
I'm going to finish up today about halfway through week 2 of course 3 on the Coursera deep learning specialization. Check it out here. What are we up to? ML Strategy 2. So this part of the course, or Course 3 of the deep learning specialization, let me just put you down here, is all about improving your machine learning model. So once you've sort of built it, and once you've hit the target of, or got some good results at least, or maybe you've got some bad results, this week is teaching us all about how to improve those results, or how to take the results you've got from uh, hitting the wrong thing and adjust them so that they can be moved more towards the thing you're— or towards the answer you're really after. Actually, one of my favorite takeaways from this so far has been that I know there's, there's a lot of content on sort of— look at this, actually, I'll show you my notes— on a lot of technical stuff on how to improve your models, whatnot, doing tests, evaluating ideas in parallel, a whole bunch of quiz notes there. There's, look, there's a quiz question that I got wrong. And then we go up here. I can't even pronounce this almost. Orthogonalization. Orthogonalization. Comment below if you can pronounce that better than I can. So there's a lot of in-depth stuff and a lot of stuff that you can definitely, definitely use to improve your models. But one of my favorite parts of it was the interview with Andrej Karpathy. If you haven't heard of Andrej Karpathy, he's a computer science PhD who taught a course at Stanford on computer vision. I'll put a link below, uh, to his, to his course actually. His, his insight— he's currently head of AI at Tesla, and one of his insights that he said at the end, towards the end of the interview, was that when they were trying to— he thinks the field of AI are going in two different directions. One will be more so, uh, building, building models for different tasks, and the models keep getting better and better and better. And there'll be another sort of another branch off of AI, which will be the teams working towards artificial general intelligence. And what his insight was, was he said that when they were first getting into computer vision, and he's definitely an expert on computer vision, he taught a course on it at Stanford, he said they were trying to do it in like compartmentalized pieces. So for example, they do facial structures, and then do maybe animals and then do cars or something. So, different subsets of computer vision tasks. And I may be getting that wrong, but just imagine different subsets rather than doing it as a whole piece. And he thinks that's maybe the key to artificial general intelligence is rather than nailing natural language, nailing speech, nailing computer vision, and then trying to merge them all together, it might be better to work on it as a system as a whole. That was really cool for me. Actually, there's a blog post. Let me find it and I'll show it to you quickly because I'm going to read it and I'll link it in the description so you can read it too and comment below what you think. So, here it is. A short story on AI, A Cognitive Discontinuity. I can't speak tonight. So, just pretend I pronounced that word correctly. But this is on Andrej Karpathy's blog. I'll link this below. I'm going to read it and I'll let you know what I think. That's it for me for study tonight. I'm actually— I'm not going to read that because I don't like looking at screens while I'm in bed. This is the book that I'm reading at the moment. It's incredible. Absolutely highly recommend it. It's a short read. It's only about 150 or so pages, but Viktor Frankl was actually a prisoner in Auschwitz, and some of the insights in this book are incredible. So, if you're looking for a new book to read, I'd check this one out. It's only, I think, $9 or something on Amazon or something like that, or Book Depository, but I'll leave a link in the description so you can check it out. And if you have read it, Comment below. What do you think? I want to show you possibly one of my favorite parts of this course so far. So this is a quiz, or actually it's a case study. So I'm at the end of week 3, or the— no, sorry, course 3, and it's an autonomous driving. You can imagine it as a flight— Andrew refers to it as a flight simulator for machine learning. And as you can see, I failed it the first attempt, so I got 11 out of 15. But the beauty is I can try it 3 times every 8 hours. So this is an autonomous driving case study. So to help you practice strategies for machine learning, and this week we'll present another scenario and ask you how you would act. We think this simulator of working in a machine learning project will give you a task of what lending— of what leading machine learning project could be like. I'm reading this through the camera screen, by the way. I should really just read it normally. So essentially, you're employed by a startup building self-driving cars. Amazing. You're in charge of detecting road signs, stop signs, pedestrian signs, construction signs ahead, etc., and traffic signals, red and green lights, and images. The goal is to recognize which of these objects appear in each image. As an example, the above image— or the below image, it should be— contains a pedestrian crossing, a sign with red traffic lights. So there we go, example image, example output. And so what the questions are is, imagine you're in this scenario. Say, for example, I'm going to show you one. Rather than me explain it. Let's go here. First question would be, you were just getting started on this project, what is the first thing you would do? Assume each of the steps below would take an equal amount of time, a few days. And I got this one right. So the first thing you should do is spend a few days training a basic model and see what mistakes it makes. So correct. As discussed in the lecture, applied ML is highly— is a highly iterative process. If you train a basic model and carry out error analysis, see what mistakes it makes, it will help point you in the promising directions. That's one example of the questions you go through, and I'm really enjoying it because it's sort of— it really feels like as if I'm working on the self-driving car project. It's like someone's coming to me and asking, hey, we've got this scenario, what should we do here? And of course, I haven't got it all down pat yet because I only got 14— I mean, 11 out of 15. I'm going to do the quiz again in a second. But I think it's really good to get this type of experience. And as Andrew says, he's I haven't— he hasn't come across any kind of scenarios like this before in other courses, and neither have I actually. And so it's really good to get hands-on experience with what a case study would be like in, in working in some sort of startup or some sort of company on these deep learning projects, which is, which is what I intend to do in the near future. So let's look at an example of what I got wrong. I got 2 wrong in a row. For example, your goal is to detect road signs, stop signs, pedestrian crossing signs, a bunch of signs and traffic signals. The goal is to recognize which of these objects appear in each image. You plan to use a deep neural network with ReLU units in the hidden layers. For the output layer, a softmax activation would be a good choice for the output layer because this is a multitask learning problem. True or false? So I selected true, but it should be false. So maybe a softmax shouldn't be used for the, the final layer. I'll find out where I went wrong and catch up on the next attempt. Hooray, we made it. So, second attempt, I got 100% because I went over my errors. I took some screenshots of the questions I got wrong and put them in here so that when I was going back over the question, I could choose a different answer. Follow-up to the question I got wrong before, question 2. So it was actually false. So softmax would be a good choice if one and only of the possibilities, stop sign, speed bump, pedestrian crossing, green light, and red light, was present in each image. But we need more than one possibility. Softmax would be good if this was red light, traffic light was a 0 and there was only one output, but softmax doesn't help when we need more than one potential output. Onto the next course. So before getting into course 4, I was watching this interview with Andrew and Ruslan Salakhutdinov, probably pronouncing that wrong, but Ruslan is the head of AI and/or director of AI research at Apple, which is really cool. And it's amazing to get all these insights from some of the, what's it called, it's heroes of deep learning in this course. And it's good to get their perspective and how they got into the field because, I don't know, they all came from such different backgrounds. Like for example, Ruslan did his master's in computer science and then he went and worked in the finance sector and then he randomly bumped into Geoffrey Hinton, if you remember from either the last video or the one before, who's the godfather of deep learning. And then Hinton got him into deep learning and what he was working on in artificial intelligence and whatnot. Maybe not deep learning at the time, but got him into AI, and that's when he did his PhD. Fast forward a few years, he's now head of, director of research, AI research at Apple. So that's amazing. And I took a few notes on what his favorite parts of deep learning are and his advice on how to get into deep learning. One of his main takeaways was that when he teaches a class, where is it? Yeah, when Russland teaches a class on deep learning, He practices, he gets his students to practice coding a backpropagation algorithm, algorithm for a convolutional network yourself. So I'm excited to do that. I think I'm doing that in the next course. And he says deep reinforcement learning is very exciting. Training agents in virtual environments. That's something I'm really excited about too. I wrote an article on Medium actually about deep reinforcement learning. It's, it's a high-level article. So it's not, it doesn't go in depth on to what deep reinforcement learning actually is, but it was on how DeepMind trained AlphaGo Zero— sorry, AlphaGo, not AlphaGo Zero— and they've released a new environment for StarCraft II to help train deep reinforcement learning agents. But I'm on to the fourth course of the deep learning specialization, which is on convolutional neural networks, and we're gonna start off with some computer vision. So I'm gonna jump into this. and then once I've made some progress, I'll let you know. Alright guys, so we just finished the first project of week 1 of course 4 on the Coursera deeplearning.ai deep learning specialization, and it was essentially coding a convolutional neural network by hand, forward propagation and back propagation. So we see all the way down, that scroll, look how small that scroll bar is. So this was, this is probably the hardest project yet. In the whole, whole specialization, just because it was probably the most programming-intensive one so far as well. And the fact that convolutional neural nets are, if you've, they're kind of hard to understand if you haven't been over them before. So what I've done is I've drawn a very basic overview of how I see convolutional neural nets so far. And mind you, I'm still a beginner, so don't take this as gospel, but this is how I, I think about it, and maybe if you check it out, you could leave a comment and you know more about it than I do, you could tell me how to improve on it. Here's what we have. Say a convolutional neural net, by the way, is used to recognize images. So that's the main thing, or video or images. Just imagine it for convolutional, C for computer vision. So that's what it's used for. So imagine if we had a million pictures of trees. And convolutional neural network starts off by making a little filter. Little box, and it's going to go across this image and fill in the gap there. And then it's going to keep going, going, going, moving across and all the way through the image till it's done it layer by layer. And then what it's going to produce over here is a matrix of zeros and significant values. So if you notice the ones, treat them as significant values. It may not necessarily be ones, but it could be something else. So this means that the filter has picked up that there's something here in the image. Alright, so the rest is all zeros, and this is very roughly drawn, so forgive me for that. And then it's going to convert it even further into eventually being a vector. So it's going to be zeros, zeros, zeros, and then some ones throughout there, because after all, what do computers understand best? They understand numbers. So a computer can't necessarily understand understand a picture of a tree, so it turns it into numbers. And then what do we do with those numbers? Well, say we did that— this process a million times, right? And from what— from that, what you would get is a whole bunch of these that you can use to recognize other pictures of trees. What the computer could do is find patterns in those vectors, so find patterns in the zeros and ones, and then use those patterns to recognize future images or, or scan over future images or images that you feed it, and it will give back whether there's a tree in there or not, because that new image will have similar significant features, aka same amount of ones and zeros, as other images you fed it, aka the millions of images you fed it as, as the initial data. And remember, deep learning networks love a lot of data. If there's ever one thing you want to do to improve your machine learning network, or deep learning network, or especially deep learning network, it's get more data, get some good data, make sure it's good labeled data because bad data will make it worse, of course, and understand that computers don't understand what, what a picture of a tree exactly is. So, or anything really for that matter. The facial recognition on your iPhone X or iPhone X doesn't recognize your face. It recognizes, it turns your face into numbers and it recognizes the numbers. So that's the two main takeaways for deep learning as a whole and convolutional neural nets. And that's how I understand them. If you have a better understanding of them, please leave a comment below and help some other people out. As I learn more about it, I'll bring more to you. After, after this, I've got to— or my next step in the deep learning specialization is another, another project— programming assignment— program— can't speak— programming assignment. But instead of coding it, convolutional neural networks, by hand or step by step, going to use TensorFlow. And as I've said before, pro— deep learning libraries help take out a lot of the code. So a lot of these functions are built into libraries like TensorFlow and Keras. And that was a really long clip, but we're going to wrap up this video. Let's see, I think it's the end of Learning Intelligence 16. We'll finish up with some shoutouts and then my plans for the next week. By the way, did you finish reading that story I linked? I finished that story by Andrej Karpathy. It was a really great read. Took me a little while, probably about half an hour at least. I won't spoil it for you, but it's definitely something as I, as I learn more and more about artificial intelligence and smart agents and whatnot, smart systems, it's definitely something that I can see happening in the future. Alright, shoutouts for the week. These people reached out to me on various social media platforms, Instagram, Twitter, all the links will be in the bio, emails, commented on YouTube, and by the way, you can email me anytime. My email is daniel@mrdbourke.com. If you have any questions, if you have any emails, everyone has emails. If you have any questions about AI or anything in general, you just want to talk, you want to meet, happy to hear from you and I'll do my best to answer it. Thank you to Savina, Shaikh, Gregory, Kenny, and Madison. I really appreciate it, guys. Thank you so much for reaching out. It means a lot to me. And so, what's the plans for the next week? Well, as this video comes out, I'm probably going to be on an island, so I won't necessarily be doing much, much study at all. I'm gonna be on holidays with my family and friends, so I'm gonna take the week off, and then starting early 2018, I'm gonna continue on with the deep learning specialization on Coursera, what you've been seeing in the past couple of videos, and then of course, moving through my AI master's degree. So, we checking off the steps there. I think the AI Nanodegree term 2, which is based on deep learning, starts on January 11th, 2018, so I'm really excited to that. That's going to be my main, main thing, or main, main squeeze. Main squeeze, is that even the right word to say? Probably not, but oh well, we're gonna roll with it. Main squeeze for the first few months of 2018. So happy New Year, and thanks for watching. Leave a like, subscribe if you want to, and as always, keep learning.
More from Daniel

Small Language Models (SLMs) Are the Future: Fine-Tuning AI That Runs on Your iPhone

Introducing Sunny - A MedGemma-Powered Skin Health Tracking App (Kaggle Competition Entry)

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 4 - Comparing the results

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 3 - Running LLMs on the RTX 4090

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 2 - Formalizing the tests

Benchmarking: NVIDIA DGX Spark & NVIDIA RTX 4090 | Part 1 - Creating a series of tests

Local Multimodal RAG on the NVIDIA DGX Spark | Part 4 - Publishing our demo to Hugging Face

Local Multimodal RAG on the NVIDIA DGX Spark | Part 3 - Putting it all together


