What a neural network is and how it’s used to learn cars to drive themselves


What a neural network is and how it’s used to learn cars to drive themselves

In: Technology

Someone gives you a task to complete, like going from a to b. You have no idea how to achieve this. Imagine a list of all things you can do right now. All options are equally good or bad for you. So you just start trying random things. Flailing your arms. You see and realize, you are not moving forward at all and your arms start hurting. So you try something else, shaking your legs. Oh, you started moving a bit. You dropped down to the floor immediately, but at least there is some progress. So you know this is the direction to go. The next time, you try shaking your legs back and forth and accidently make a step before you fall. This reinforces your idea that reaching b has something to do with moving your legs a certain way.

Basically, it goes step by step. You define the goal, give sensors to allow interpretation of the world around, define a set of possible actions, and then let it go. Each generation knows the success or failure of the ones before, together with the memory of what was done and how it worked. From there it is trial and error, many many many generations later sensory input (cameras etc) is interpreted properly and the action taken is correct.

The neutral network are the reinforced “action”-paths taken based on the sensory inputs and achievement of goals.

A neural network is lots and lots of very simple equations/algorithms connected together. These very simple units feed into other units which feed into other units. There can be anywhere from a few dozen to millions and millions of units all joined up in a huge web. When putting together a neural network, you start with a bunch of random equations – and they can’t do anything useful.

This is where training comes in – you plug in some data to the neural network where you already know the correct answer (e.g an image of a person, labelled as “person”, or an image of a cat labelled “cat”), or you have a defined goal where you have some mathematical criteria where you can say how good the response is. The answer the network gives, minus the real answer gives you an error term. You use this error to work out what adjustments you can make to the network to get you to the correct answer, and you make a very small fraction of that adjustment. You then keep showing the network hundreds, thousands or millions of other data/answer pairs, and every time make a very small adjustment. Over time the network learns its required task.

You can use neural networks to do things that classically have been very hard to program. For example they can do image recognition, or speach recognition and all sorts of other things.

With self driving, lots of neural networks are connected. You might have one for recognising cars/vehicles/pedestrians and another for road markings, and another for reading signs. These can connect to neural networks that control steering inputs and throttle (and connect to classical rule based programming too!). By meticulously training all these parts you can create a self driving car.

A neural network is a kind of computer program with millions of possible configurations. Only some of those configurations will get the program to do what you want (like drive a car). But there’s no way of knowing what the right configurations are. So, when a neural net “learns” to drive a car, what it’s actually doing is trying out lots of possible configurations to see if they help it to drive a car. It starts by trying them at random, which doesn’t help at all. By pure chance, it will try something that does actually help, a little bit. So it keeps what worked, and continues trying out different things. By trial and error, it works out the right configuration to drive a car.

For your Tesla-specific case, imagine trying to program diving. It’s very hard. You could let the system watch someone drive and learn that way, but one driver is only going to encounter so many situations, and those situations will vary slightly from what others will encounter. In a famous crash case, imagine the truck across the highway, but it happens to be lit perfectly so it blends in with the sky.

Now imagine letting it learn from a million drivers at the same time, data from billions of miles driven every year. It’s going to encounter many variations on situations and even very rare situations. It’s going to learn how the driver avoided a crash or how he crashed.

All that learning gets fed back into Autopilot so it can drive better while Autopilot itself keeps feeding new information back in.