All Projects → MLJejuCamp2017 → Drl_based_selfdrivingcarcontrol

MLJejuCamp2017 / Drl_based_selfdrivingcarcontrol

Deep Reinforcement Learning (DQN) based Self Driving Car Control with Vehicle Simulator

Projects that are alternatives of or similar to Drl based selfdrivingcarcontrol

Easy Rl
强化学习中文教程,在线阅读地址:https://datawhalechina.github.io/easy-rl/
Stars: ✭ 3,004 (+1106.43%)
Mutual labels:  deep-reinforcement-learning, dqn
Airsim
Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
Stars: ✭ 12,528 (+4931.33%)
Mutual labels:  self-driving-car, deep-reinforcement-learning
Deep Rl Tensorflow
TensorFlow implementation of Deep Reinforcement Learning papers
Stars: ✭ 1,552 (+523.29%)
Mutual labels:  deep-reinforcement-learning, dqn
Deeprl
Modularized Implementation of Deep RL Algorithms in PyTorch
Stars: ✭ 2,640 (+960.24%)
Mutual labels:  deep-reinforcement-learning, dqn
Machine Learning Is All You Need
🔥🌟《Machine Learning 格物志》: ML + DL + RL basic codes and notes by sklearn, PyTorch, TensorFlow, Keras & the most important, from scratch!💪 This repository is ALL You Need!
Stars: ✭ 173 (-30.52%)
Mutual labels:  deep-reinforcement-learning, dqn
Torchrl
Highly Modular and Scalable Reinforcement Learning
Stars: ✭ 102 (-59.04%)
Mutual labels:  deep-reinforcement-learning, dqn
Minimalrl
Implementations of basic RL algorithms with minimal lines of codes! (pytorch based)
Stars: ✭ 2,051 (+723.69%)
Mutual labels:  deep-reinforcement-learning, dqn
Ml In Tf
Get started with Machine Learning in TensorFlow with a selection of good reads and implemented examples!
Stars: ✭ 45 (-81.93%)
Mutual labels:  deep-reinforcement-learning, dqn
Deep Rl Trading
playing idealized trading games with deep reinforcement learning
Stars: ✭ 228 (-8.43%)
Mutual labels:  deep-reinforcement-learning, dqn
Drl
Repository for codes of 'Deep Reinforcement Learning'
Stars: ✭ 172 (-30.92%)
Mutual labels:  deep-reinforcement-learning, dqn
Learning To Communicate Pytorch
Learning to Communicate with Deep Multi-Agent Reinforcement Learning in PyTorch
Stars: ✭ 236 (-5.22%)
Mutual labels:  deep-reinforcement-learning, dqn
Pytorch Drl
PyTorch implementations of various Deep Reinforcement Learning (DRL) algorithms for both single agent and multi-agent.
Stars: ✭ 233 (-6.43%)
Mutual labels:  deep-reinforcement-learning, dqn
Deep Reinforcement Learning With Pytorch
PyTorch implementation of DQN, AC, ACER, A2C, A3C, PG, DDPG, TRPO, PPO, SAC, TD3 and ....
Stars: ✭ 1,345 (+440.16%)
Mutual labels:  deep-reinforcement-learning, dqn
Reinforcement Learning
🤖 Implements of Reinforcement Learning algorithms.
Stars: ✭ 104 (-58.23%)
Mutual labels:  deep-reinforcement-learning, dqn
Deeprl algorithms
DeepRL algorithms implementation easy for understanding and reading with Pytorch and Tensorflow 2(DQN, REINFORCE, VPG, A2C, TRPO, PPO, DDPG, TD3, SAC)
Stars: ✭ 97 (-61.04%)
Mutual labels:  deep-reinforcement-learning, dqn
Keras Rl2
Reinforcement learning with tensorflow 2 keras
Stars: ✭ 134 (-46.18%)
Mutual labels:  deep-reinforcement-learning, dqn
Parl Sample
Deep reinforcement learning using baidu PARL(maze,flappy bird and so on)
Stars: ✭ 37 (-85.14%)
Mutual labels:  deep-reinforcement-learning, dqn
Deep Q Learning
Minimal Deep Q Learning (DQN & DDQN) implementations in Keras
Stars: ✭ 1,013 (+306.83%)
Mutual labels:  deep-reinforcement-learning, dqn
Deep Reinforcement Learning Algorithms
31 projects in the framework of Deep Reinforcement Learning algorithms: Q-learning, DQN, PPO, DDPG, TD3, SAC, A2C and others. Each project is provided with a detailed training log.
Stars: ✭ 167 (-32.93%)
Mutual labels:  deep-reinforcement-learning, dqn
Hands On Intelligent Agents With Openai Gym
Code for Hands On Intelligent Agents with OpenAI Gym book to get started and learn to build deep reinforcement learning agents using PyTorch
Stars: ✭ 189 (-24.1%)
Mutual labels:  deep-reinforcement-learning, dqn

DRL Based Self Driving Car Control

Version 1.8

Version information of this project

Unity Project is provided! Please refer to the simulator section.


Introduction

[2018. 10. 22] Paper of this Project is accepted to Intelligent Vehicle Symposium 2018!! 😄

[2019. 05. 28] Paper of this Project is accepted to IEEE Transactions on Intelligent Vehicles!! 😄

IV2018 PPT

Link of IV2018 Paper

Link of IEEE Transactions on Intelligent Vehicles Paper

IV2018

IV2018


This repository is for Deep Reinforcement Learning Based Self Driving Car Control project in ML Jeju Camp 2017

There are 2 main goals for this project.

  • Making vehicle simulator with Unity ML-Agents.

  • Control self driving car in the simulator with some safety systems.

    As a self driving car engineer, I used lots of vehicle sensors(e.g. RADAR, LIDAR, ...) to perceive environments around host vehicle. Also, There are a lot of Advanced Driver Assistant Systems (ADAS) which are already commercialized. I wanted to combine these things with my deep reinforcement learning algorithms to control self driving car.

Simple overview of my project is as follows.

Snesor data plotting

I will use sensor data and camera image as inputs of DRL algorithm. DRL algorithm decides action according to the inputs. If the action may cause dangerous situation, ADAS controls the vehicle to avoid collision.


Software and Hardware configuration of this project

Software

  • Windows10 (64bit)
  • Python 3.6.5
  • Anaconda 5.2.0
  • Tensorflow 1.8.0

Hardware

  • CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHZ

  • GPU: GeForce GTX 1080 Ti

  • Memory: 8GB


How to Run this Project

  1. download the github repo
  2. open the ipynb file in the RL_algorithm folder
  3. Set the environment path and run it!

Environment Path Setting

Env path

You should select os between Windows, Mac and Linux.

Also, for using this environment in Linux, you should chmod to change the access mode of a .x86_64 file. Example code of chmod is as follows.

chmod -R 775 *.x86_64


Description of files

  • ***_Image.ipynb: Network using only image of vehicle.
  • ***_sensor.ipynb: Network using only sensor data of vehicle.
  • ***_image_sensor.ipynb: Network using both image and sensor of vehicle

I also upload the other DQN based algorithms which I tested with the games that I made. Check out my DRL github repo

This is my PPT file of final presentation(Jeju Camp)


Specific explanation of my simulator and model is as follows.


Simulator

Snesor data plotting

I made this simulator to test my DRL algorithms. Also, to test my algorithms, I need sensor data and Camera images as inputs, but there was no driving simulators which provides both sensor data and camera images. Therefore, I tried to make one by myself.

The simulator is made by Unity ML-agents


Unity Project of the Simulator is Provided without paid assets!!. Please open the Unity_SDK folder with Unity. Therefore, you should buy and import the following assets in the project to use it.

SimpleSky

SimpleTown

SimpleRacer


Inputs

As, I mentioned simulator provides 2 inputs to DRL algorithm. Forward camera, Sensor data. The example of those inputs are as follows.

Front Camera Image Sensor data Plotting
Snesor data plotting Snesor data plotting

Also, vehicles of this simulator have some safety functions. This functions are applied to the other vehicles and host vehicle of ADAS version. The sensor overview is as follows.

Snesor data plotting

The safety functions are as follows.

  • Forward warning
    • Control the velocity of host vehicle equal to velocity of the vehicle at the front.
    • If distance between two vehicles is too close, rapidly drop the velocity to the lowest velocity
  • Side warning: No lane change
  • Lane keeping: If vehicle is not in the center of the lane, move vehicle to the center of the lane.

Vector Observation information

In this simulator, size of vector observation is 373.

0 ~ 359: LIDAR Data (1 particle for 1 degree)

360 ~ 362: Left warning, Right Warning, Forward Warning (0: False, 1: True)

363: Normalized forward distance

364: Forward vehicle Speed

365: Host Vehicle Speed

0 ~ 365 are used as input data for sensor

366 ~ 372 are used for sending information

366: Number of Overtake in a episode

367: Number of lane change in a episode

368 ~ 372: Longitudinal reward, Lateral reward, Overtake reward, Violation reward, collision reward

(Specific information of rewards are as follows)


Actions

The action of the vehicle is as follows.

  • Do nothing
  • Acceleration
  • Deceleration
  • Lane change to left lane
  • Lane change to right lane

Rewards

In this simulator, 5 different kinds of rewards are used.

Longitudinal reward: ((vehicle_speed - vehicle_speed_min) / (vehicle_speed_max - vehicle_speed_min));

  • 0: Minimum speed, 1: Maximum speed

Lateral reward: - 0.5

  • During the lane change it continuously get lateral reward

Overtake reward: 0.5* (num_overtake - num_overtake_old)

  • 0.5 / overtake

Violation reward: -0.1

  • example: If vehicle do left lane change at left warning, it gets violation reward (Front and right warning also)

Collision reward: -10

  • If collision happens, it gets collision reward

Sum of these 5 rewards is final reward of this simulator


Sliders

Slider

You can change some parameters with the Slider on the left side of simulator

  • Number of Vehicles (0 ~ 32) : Change the number of other vehicles
  • Random Action (0 ~ 6): Change the random action level of other vehicles (Higher value, more random action)

Additional Options

Foggy Weather

If you change the Foggy Weather dropdown menu to on, there will be fog to disturb camera image as follows.

Foggy Option

The Driver View images of the foggy weather are as follows.

Foggy Examples

Sensor Noise

sensor Noise

Sensor noise can be applied!!

If you set the Sensor Noise dropdown to On, you can control the Noise Weight using Slider. The equation of the adding noise to parameter a is as follows.

a = a + (noise_weight * Random.Range(-a, a))


DRL Model

For this project, I read papers as follows.

  1. Human-level Control Through Deep Reinforcement Learning

  2. Deep Reinforcement Learning with Double Q-Learning

  3. Prioritized Experience Replay

  4. Dueling Network Architecture for Deep Reinforcement Learning

You can find the code of those algorithms at my DRL github.

I applied algorithms 1 ~ 4 to my DRL model. The network model is as follows.

Snesor data plotting

Result

Graphs

Average Speed Average # of Lane Change Average # of Overtake
Graph(Lane Change) Graph(Lane Change) Graph(Lane Change)
Input Configuration Speed (km/h) Number of Lane Change Number of Overtaking
Camera Only 71.0776 15 35.2667
LIDAR Only 71.3758 14.2667 38.0667
Multi-Input 75.0212 19.4 44.8

Before Training

Result(Before Training)

After Training

Result(After Training)

After Training (with fog)

Result(After Training_fog)

After training, host vehicle drives mush faster (almost at the maximum speed!!!) with little lane change!! Yeah! :happy:

Citation

@inproceedings{min2018deep,
  title={Deep Q Learning Based High Level Driving Policy Determination},
  author={Min, Kyushik and Kim, Hayoung},
  booktitle={2018 IEEE Intelligent Vehicles Symposium (IV)},
  pages={226--231},
  year={2018},
  organization={IEEE}
}
@article{min2019deep,
  title={Deep Distributional Reinforcement Learning Based High Level Driving Policy Determination},
  author={Min, Kyushik and Kim, Hayoung and Huh, Kunsoo},
  journal={IEEE Transactions on Intelligent Vehicles},
  year={2019},
  publisher={IEEE}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].