This article is mainly for a simple introduction to the principle of deep learning . Let's get to know this NBHH How to realize the method of . Then introduce how to apply deep learning in this driverless car DIY Above the project .
Before the beginning , I want to let you know three important concepts .AI（ artificial intelligence ）, machine learning , Deep learning . It's understandable ,AI It can be seen as an end , Let the machine be able to do something that used to be only human
To do intelligent work , This concept was actually put forward at the Portsmouth conference a long time ago . Then machine learning can be seen as a means , method , It's used to achieve AI Of . That's deep learning
What about it ? It is actually one of the methods of machine learning , It is developed from neural network . Because of its good effect , So it's really hot now ... The following picture can clearly reflect three
The relationship between concepts .
It's over , Now we will focus on the principle of deep learning . Because deep learning can be used in many fields , image classification , image detection , Attitude estimation , Behavior recognition , speech recognition , Natural language processing and so on . Let's start with the simplest
Single use deep learning to do image classification . Because our project actually uses image classification . Here's an image of the road in front of the car , Then decide what to do （ Turn left , Turn right ,
Stop or go straight ）.
here , Let's give a small example in our life to illustrate the analogy .N Years later , Lang Xing's son goes to kindergarten . The topic of this class is 《 Know Tyrannosaurus Rex and Stegosaurus 》. Then the teacher projected the following picture ? Ask langxing son ：“ children , Do you know what kind of dragon this is ?”.
Lang Xing's son touches his head , say ：“ With sharp teeth , Is it Stegosaurus ”.
The teacher said kindly “ No , This is Tyrannosaurus Rex ”. Lang Xing's son muttered in his heart , It turns out that whether the teeth are sharp or not has nothing to do with Stegosaurus . So the teacher took out another picture and asked “ What kind of dragon is this ?”
Lang Xing's son said confidently this time , The claws are so sharp , That must be Stegosaurus . The teacher shook his head , This is still Tyrannosaurus Rex . Langxing's son began to murmur again , It turns out that the sharp claws have nothing to do with Stegosaurus . Just at this moment , The teacher took out another picture , ask “ How about this one ?”
The son of wave star looked at this ugly monster with disgust on his face , say , Such an ugly dinosaur , Is it Stegosaurus ? The teacher said with a smile “ Right , This is Stegosaurus ”. Langxing's son muttered again , Is it not the ugly eight monsters with scales or the stegosaurus .
After so many times , After seeing all the pictures prepared by the teacher , Confident learned to distinguish Tyrannosaurus Rex and Stegosaurus .
later , Langxing bought a toy dinosaur for his son , Langxing's son recognized it at a glance , This is the ugly Stegosaurus !
okay , That's the end of the story . Let's go over the memories of langxing's son's understanding of dinosaurs to deepen the image ：
If you understand the learning process , So let's compare the process of using deep learning to let computers identify Tyrannosaurus Rex and Stegosaurus , It would be very easy It's over .
First, prepare samples . Pay attention to one small detail , In the process of learning , The teacher prepared many pictures of Tyrannosaurus Rex and Stegosaurus , And it's labeled （ The label means that the teacher knows which picture is a Stegosaurus or a tyrant
Loong , And in the wave star son predicted the results can be compared , Look, the son of langxing is right , Still wrong ）. So in deep learning , These labeled images are called samples . Here's a picture of langxinggei
Computer prepared samples . Pay attention to the label. I'll use numbers instead ,0 It means Tyrannosaurus Rex ,1 It means Stegosaurus ：
The training samples were collected , We're about to start designing training networks . We can abstract this process , Consider the image to the prediction result as a function or mapping . We are going to learn the mapping process , Make this
The first mapping becomes more accurate . And design the network , This is the process of designing the mapping rules . Let's call this mapping F（x）,x It's the input image . The output is its predicted value . So you can imagine , Just.
start F（x） I haven't learned yet , As stupid as wave star's son , So usually the output is wrong . But don't worry , We have labels , Just compare the label with the predicted value , I know F（x） forecast
What's the deviation of this method , Then let's adjust the mapping F（x） The parameters in it will do . Take a look at the flow chart below ：
It's not very similar to the learning process of langxing son above .binggo. That's how easy it is to understand !BUT, After we get to know each other at the perceptual level , If the investigation continues ,F（x） What is a mapping , as
How to design ; step 4 How to adjust according to the difference between the label value and the predicted value F（x） Of . So congratulations , You're about to get started . These two processes correspond to the network design and optimization of deep learning . Here I am
I won't go into details , Those who are interested can spend their own time . If this article can make you interested in deep learning , That wave star is also a merit .
After introducing the principle of deep learning , Let's talk about how to use deep learning technology in our driverless car . First of all, we use image classification . Because our car is relatively simple , It only needs
Turn left , Turn right , Just go straight and stop , The speed is fixed . There's no angle difference between turns . So use the simplest image classification to do it . If we take a left turn, use the label 0 To express , Right turn to label 1 Come to the table
show , Direct travel label 2 To express , Stop using labels 3 To express . So first we have to collect some training samples , Then label them , It's like this ：
After using an open source training framework ,tensorflow perhaps caffe, Then choose an open source network model , Then you can start happy It's time to train . After training , You can drive it
It's starting to work . Take a picture to the deep learning system and it will come back to tell you what to do 0（ Turn left ）, still 1（ Turn right ）, still 2（ Straight ahead ）, still 3（ stop it ）. Roar , Excited or not ...