Understanding Behavioral Cloning of Human Car Driving
Neural Networks! This old technique, now enabled by the availability of cheap storage and processing infrastructure, has become so popular lately that everyday we hear about some or the other application where it demonstrates its usefulness with outstanding results. It has particularly been contributing in giving the 'machines', at the cost of sounding exaggerating, a sense of vision and the ability to understand human language. A couple of years ago, Data Science, with all its applications was the way forward for any organization to make crucial decisions or solve business problems. Neural nets, on the other hand, have opened gates to an altogether different set of solutions to, till recently difficult to solve, real world problems and applications.
The most popular applications of neural nets are into the computer vision sector where they take on the shape of Deep Learning Convolutional Neural Networks(CNN). I have tried to tackle the problem of behavioral cloning of human car driving behavior with this magical tool. I would try to represent this project in a simplistic manner here for the benefit of all my readers. CNN's, by using their magical words (they actually say "I convolute you!" to the images), find out the important things in an image. While they are doing their job, we provide them something called as "target" for each image, to associate these important things with.
I tried associating the steering angle that a car should steer with and in which direction, given what scene is in front of the car using CNN, which I modeled on Keras with TensorFlow backend. I collected data from the platform so generously provided by Udacity to its students. Data consisted of what images the car saw (if it could see!) and the associated steering angle with that view. Then, I asked my friends, the "Convolutions", to do their magic and create a network among their other "Convolutional" friends (One must come up with an optimum architecture for each problem.), to associate the important things in each image that the car saw, with the corresponding steering angle. This took a while actually as the more powerful one is, the heavier and bulkier one becomes (I am talking about you Mr. Convolution!).
After the training of my CNN, I tried running the model with the real time image input from the Udacity platform. Following is the video which shows the car driving in autonomous mode with steering angles being fed to it by the model I made.
We see that the model is able to keep the car inside the driving area all the time and keeping it stable on the road without any abrupt or wavy movements. It is also able to keep the car near the center line of the road. At 1 minute 21 seconds in the video, the car moves slightly towards the right. But based on the image input, the model is quickly able to send sharper left steering angles to the car to bring it again at the center of the road. Similar thing happens at 1:32 in the video. The model is able to make the car drive through the whole circuit without letting it go outside the driving area.
We see how effectively CNN is able to tackle the given problem. I did all my modeling and required processing of data on my personal laptop (8GB memory without any high-end GPU in it). With the proven effectiveness of this tool, we can just imagine the real world problems we want to solve and through some clever implementation, we can very well use it to derive the solutions.
In the end, I would say it was an exhilarating experience trying to solve this problem. I sincerely thank Sebastian Thrun, David Silver, Oliver Cameron, Ryan Keenan and the whole team at Udacity for making excellent course material available to the world. For more technical readers, the simplistic code for this project appears here.