본문 바로가기

TORCS

Self-driving car that learns from human drivers - part 2

반응형

In the previous post (see 2017/07/31 - [TORCS] - Self-driving car that learns from human drivers - part 1), I show you the racing cars that drive according to a simple driving policy. The driving policy described in the post consists of several algorithms, each utilizes the information about the status of the car and the road. For example, the anti-collision breaking system utilizes 'the speed of the host car', 'the speed of the neighboring car in front of the host car', 'the distance between the host car and the neighboring car', ect in order to reduce the speed of the host car.

 

In this post, I will show you the result of replacing the steering wheel control algorithm with an artificial neural network. The input to the neural network is an 1-D vector, whose elements are the status of the car and road as well as the target lane. Note that the target lane indicates the lane position where the host car wants to stay. The output of the neural network is the steering wheel angle. The racing car changes its direction according to the steering wheel angle.

 

<Multilayer perceptron for steering wheel control>

 

 

Collecting training data


The training data is collected by using a racing car shown in the previous post. From 3 3-lanes tracks, about 40,000 'car/road status-steering wheel angle' pairs were collected. (For more details about data collection, visit 2017/07/28 - [TORCS] - End-to-end learning for autonomous driving.) The 90% of the data is used for training and the rest is used for test.

 

 

Training Multilayer Perceptron


The multilayer perceptron of depth 3 is trained via AdamOptimizer. As the activation function, Relu is used for the first two layer, tanh is used for the last. The following shows the training result. The average MSE of test dataset converges to a certain value rapidly. The neural network that produces the minimum avearge MSE was saved during the training and finally used for the demonstration shown in the following video.

 

 

 

Demonstration


The following video shows the racing car that drives according to the output of the trained neural network. The red empty box inside the empty black box (located at the upper left corner of the video) indicates the output of the neural network, steering wheel angle. The target lane means the position where the car want to stay. During the demonstration, the position is chosen randomly every few seconds.