Giter Club home page Giter Club logo

ujwal2910 / smart-traffic-signals-in-india-using-deep-reinforcement-learning-and-advanced-computer-vision Goto Github PK

View Code? Open in Web Editor NEW
175.0 9.0 57.0 76.17 MB

We have used Deep Reinforcement Learning and Advanced Computer Vision techniques to for the creation of Smart Traffic Signals for Indian Roads. We have created the scripts for using SUMO as our environment for deploying all our RL models.

License: MIT License

Python 99.24% Jupyter Notebook 0.76%
reinforcement-learning sumo simulation traffic-simulation indian-traffic deep-reinforcement-learning opencv visionprocessing video-processing shadow-removal

smart-traffic-signals-in-india-using-deep-reinforcement-learning-and-advanced-computer-vision's Introduction

Welcome to the Smart-Traffic-Signals-in-India-using-Deep-Reinforcement-Learning-and-Advanced-Computer-Vision wiki!

Smart-Traffic-Signals-in-India-using-Deep-Reinforcement-Learning-and-Advanced-Computer-Vision

With a growth in the economic sector since the early 1990s, India has been undergoing a paradigm shift in the domain of transportation as well. With the explosion in the number of road-vehicles, the surge in traffic density (especially in metropolitan cities like Bangalore and Delhi) has become a major cause of concern. It has, therefore, become really important to develop Intelligent traffic signals and systems in order to optimize the escalating traffic flow. For a developing country like India where the majority of motorists are still negligent of traffic laws and are often seen breaking them, for e.g, driving in opposite lanes, violating an indicator near turns and turning in a wrong direction, and many more such instances which eventually lead to traffic jams.

In such Indian scenarios, the power of reinforcement learning applied on traffic behavior can be leveraged to greatly reduce these traffic jams. We have designed a script for applying Deep Reinforcement Learning using SUMO simulator in the repository. We have used DQN+Target Network+Experience Replay in our project and processed frames from simulator using computer vision

SUMO Environment-

We have used SUMO as our running environment and have experimented with number of sceneraios and agents. Following image shall better help understand the scenarios used- Scenarios

Scenarios tested on single intersection.

In (a), equal traffic is supplied to all the carriageways. In (b), equal traffic is supplied to two of the carriageways, the other two carriageways are kept empty. In (c), the traffic in the two non-empty carriageways is made unequal. In (d), an obstacle (labeled in red) is introduced in one of the carriageways.


We also worked with Two junctions for multi agent RL setup- Dual intersection


Computer Vision Module-

We have used background subtraction for calculation of queue length of vehciles in a lane or section and four of these make a junction which acts as our state space. For a realistic scenario the figure below shall represent an accurate representation of the process-

Background subtraction in real life

The same we have done by taking in the frames from the simulator by recording the screen and then extracting each lane frame from the four lanes and then processing it to get the queue lenghts.

Simulator background queue calculation

Here after getting a simulator frame, we convert it bird eye view so it looks like an image taken from a traffic camera and then perform background subtraction to get the queue length.


RL model-

The Queue length obtained from the CV module goes into the RL model. We have used Queue length as our state space and the decision to switch green signal to the next lane or not is decided by the RL model.


State space - Queue lengths+ Phases

Action Space - Switch || Not Switch


Results-

Following graphs show our results when put against Round Robin 40 seconds. We also experimented with various reward functions also. graphs


smart-traffic-signals-in-india-using-deep-reinforcement-learning-and-advanced-computer-vision's People

Contributors

ishan-maheshwari avatar ujwal2910 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smart-traffic-signals-in-india-using-deep-reinforcement-learning-and-advanced-computer-vision's Issues

Impact of road width

Your work looks very interesting. In India, one of the key reason for traffic jam is non-uniform road width. A 4 lane highway could have a right turn and the width of the right turn road could support only 1 lane. Is it possible in check How does this impact the traffic and how can it be detected as the bottleneck?

i found error in your code

AttributeError: 'MSS' object has no attribute 'get_pixes' in module readScreen
line 113 sct.get_pixes(mon)

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.