Autonomous driving with deep Q learning in Carla Urban Simulator

Key tools: Carla simulator 0.9.6, Tensorflow, Python, Keras

Github Link


Project goal:

The goal of this independent research is to create a deep Q learning model for a vehicle in Carla Urban Simulator. The target pipeline is to make spawned vehicle learn the environment and drive itself without collide under no traffic or line following rules. To save the randomness time, guided waypoints are generated near the spawned location and add them to reward function.

My major work:

Demo:

The video showed below is the agent performance in simulator using policy trained after certain episodes. If there is a collision, the episode will terminate. If there is no collision at all, episode will terminate after set episode period. The green dots in the video are waypoints generated to guide the vehicle to save random action time. Since I have no traffic and line following policies, I generated the waypoints on both sides of road.

Policy trained with 100 episodes (the best one so far)

Policy trained with 50 episodes:

Policy trained with 20 episodes:

Plots generated from Tensorboard from 100 episodes. (corresponds to the best performance):

Epsilon as first plot's y axis is randomness. All four plots' x axis are epidoes.

Deep Q learning algorithms:

Three actions:

Rewards:

Data:

Collision sensor:

I add the collision sensor and camera at the front of the car. The collision sensor will detect the collision and send the message. I have a list called collision_list and is initialized to be an empty list. During the process, I will decide if there is a collision based on the collision list is empty or not.

Camera:

CNN flowchart:

Reinforcement learning flowchart:

Xception base model used in CNN:

Result

pd

Future work: