Giter VIP home page Giter VIP logo

gustavomoers / e2e-carla-reinforcementlearning-ppo Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 314 KB

An end-to-end (E2E) reinforcement learning model for autonomous vehicle collision avoidance in the CARLA simulator, using a recurrent PPO algorithm for dynamic control. The model processes RGB camera inputs to make real-time acceleration and steering decisions.

License: MIT License

Python 51.53% Jupyter Notebook 48.47%
autonomous-vehicles carla-simulator collision-avoidance computer-vision end-to-end-learning machine-learning ppo recurrent-ppo reinforcement-learning stablebaselines3

e2e-carla-reinforcementlearning-ppo's Introduction

E2E-CARLA-ReinforcementLearning-PPO

Overview

This project is an end-to-end application of reinforcement learning for collision avoidance in autonomous vehicles using the CARLA simulator. It uses the Proximal Policy Optimization (PPO) algorithm, within the CARLA environment (version 0.9.12) to teach a virtual car to avoid collisions at several speeds. This is an end-to-end approach where the input is a camera RGB image and the outputs are directly control values for acceleration and steering.

Model

The reinforcement learning model used in this project is the recurrent version of the Proximal Policy Optimization (PPO) algorithm, implemented through the Stable Baselines3 library. This version allows the model to maintain a memory of its past decisions, improving its decision-making process over time, particularly in environments that require understanding sequences of events for optimal actions.

For more information on Stable Baselines3, visit their official website: Stable Baselines3.

Training

The model was trained for 80,000 steps at a speed of 90 km/h. This initial training allowed the model to successfully learn collision avoidance strategies. It is important to note that further training could potentially improve the model's performance and effectiveness in avoiding collisions under various conditions.

Results

Below are the results showcasing the model's ability to avoid collisions:

  • Reward vs. Step Graph: The following graph displays the model's learning progress over 80,000 steps. It highlights the improvement in the model's ability to avoid collisions as training progresses.

Reward vs. Step Graph

  • Model in Action: Here is a GIF demonstrating the model successfully avoiding collisions at 90 km/h in the CARLA simulator.

Model Working 90 km/h

Dependencies

  • CARLA Simulator (version 0.9.12)
  • Stable Baselines3
  • Other dependencies (requirements.txt)

How to Run

To train the model, execute train.py which supports adjustable parameters via --arg (for details, see argparser within the script). Additionally, direct adjustments may be needed in World.py.Note that self.distance_parked should be set to allow the ego car to reach desired speeds effectively.

Conclusion

The PPO model trained on CARLA 0.9.12 for collision avoidance at 90 km/h shows promising results. While the initial training of 80,000 steps demonstrates the model's capability to learn effective avoidance strategies, further training could improve its performance.

Contributions

I welcome contributions and suggestions to improve this project. Feel free to fork the repository, submit pull requests, or open issues to discuss potential improvements. I plan to train this model in dynamic scenarios as well. I am also working on a hybrid approach where I use reinforcement learning as path planner and a MPC controller to control the ego car, soon I will also publish this approach.

e2e-carla-reinforcementlearning-ppo's People

Contributors

gustavomoers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fqf0901

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.