{"id":26906729,"url":"https://github.com/saurabhjalendra/reinforcement-learning-based-traffic-optimization","last_synced_at":"2026-05-03T15:35:14.403Z","repository":{"id":285343506,"uuid":"957789226","full_name":"SaurabhJalendra/Reinforcement-Learning-based-Traffic-Optimization","owner":"SaurabhJalendra","description":"An intelligent traffic optimization system using Deep Reinforcement Learning (DQN \u0026 Actor-Critic) to control vehicle speed and lane changes for improved traffic flow and safety.","archived":false,"fork":false,"pushed_at":"2025-03-31T06:33:11.000Z","size":744,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T14:17:15.401Z","etag":null,"topics":["actor-critic","deep-learning","dqn","keras","reinforcement-learning","tensorflow","traffic-optimization"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SaurabhJalendra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-31T06:11:58.000Z","updated_at":"2025-03-31T06:33:15.000Z","dependencies_parsed_at":"2025-03-31T07:40:15.966Z","dependency_job_id":null,"html_url":"https://github.com/SaurabhJalendra/Reinforcement-Learning-based-Traffic-Optimization","commit_stats":null,"previous_names":["saurabhjalendra/reinforcement-learning-based-traffic-optimization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SaurabhJalendra/Reinforcement-Learning-based-Traffic-Optimization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaurabhJalendra%2FReinforcement-Learning-based-Traffic-Optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaurabhJalendra%2FReinforcement-Learning-based-Traffic-Optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaurabhJalendra%2FReinforcement-Learning-based-Traffic-Optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaurabhJalendra%2FReinforcement-Learning-based-Traffic-Optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaurabhJalendra","download_url":"https://codeload.github.com/SaurabhJalendra/Reinforcement-Learning-based-Traffic-Optimization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaurabhJalendra%2FReinforcement-Learning-based-Traffic-Optimization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273100341,"owners_count":25045697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actor-critic","deep-learning","dqn","keras","reinforcement-learning","tensorflow","traffic-optimization"],"created_at":"2025-04-01T11:18:23.056Z","updated_at":"2026-05-03T15:35:14.344Z","avatar_url":"https://github.com/SaurabhJalendra.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reinforcement Learning-based Traffic Optimization\n\nThis project implements an intelligent traffic flow optimization system using Deep Reinforcement Learning (DRL) techniques. The system adaptively controls vehicle speed and lane changes to enhance traffic efficiency, reduce congestion, and improve road safety.\n\n## Project Overview\n\nThe project develops and compares two Reinforcement Learning approaches:\n- Deep Q-Network (DQN)\n- Actor-Critic Network\n\nBoth agents learn to optimize traffic flow by making real-time decisions about vehicle speed and lane changes based on the surrounding traffic conditions.\n\n## Features\n\n- Real-time vehicle control optimization\n- Multi-agent reinforcement learning\n- Adaptive speed regulation\n- Intelligent lane change decisions\n- Safety-aware decision making\n- High-frequency state updates (10 Hz)\n\n## State Space\n\nThe environment state consists of 8 key features:\n\n| Feature | Description | Unit |\n|---------|-------------|------|\n| Vehicle Speed | Current velocity | m/s |\n| Vehicle Acceleration | Rate of speed change | m/s² |\n| Lane Position | Current lane identifier | - |\n| Space Headway | Distance to preceding vehicle | m |\n| Time Headway | Time gap to preceding vehicle | s |\n| Vehicle Class | Type of vehicle | - |\n| Global X | X-coordinate in global frame | m |\n| Global Y | Y-coordinate in global frame | m |\n\n## Action Space\n\nThe agent can perform 5 distinct actions:\n\n| Action | Description | Conditions | Change |\n|--------|-------------|------------|---------|\n| 0 | Maintain speed | No conditions | 0 m/s |\n| 1 | Increase speed | Space_Headway ≥ 15m | +2 m/s |\n| 2 | Decrease speed | Space_Headway \u003c 10m | -2 m/s |\n| 3 | Change left | Left lane exists \u0026 unoccupied | Lane shift |\n| 4 | Change right | Right lane exists \u0026 unoccupied | Lane shift |\n\n## Safety Parameters\n\n- **Safe Following Distance**: Minimum 15 meters from preceding vehicle\n- **Collision Risk Zone**: Less than 5 meters gap\n- **Target Speed**: 27 m/s (approximately 60 mph)\n\n## Reward Function\n\nThe reward function balances optimal speed maintenance with collision avoidance:\n\nR = (10 - |V_t - V_optimal|) - P_collision\n\nWhere:\n- V_t = Current vehicle speed (m/s)\n- V_optimal = 27 m/s (target speed)\n- P_collision = Penalty factor\n  - 20 if Space_Headway \u003c 5m (high collision risk)\n  - 0 otherwise\n\n## Implementation Details\n\n### Dependencies\n- TensorFlow/Keras for DRL implementation\n- NumPy for numerical computations\n- Pandas for data handling\n- Matplotlib for visualization\n\n### Dataset\n- High-frequency trajectory data (10 Hz)\n- Each frame represents 0.1-second interval\n- Rich vehicle state information\n\n## Getting Started\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/Reinforcement-Learning-based-Traffic-Optimization.git\n```\n\n2. Install required dependencies:\n```bash\npip install tensorflow numpy pandas matplotlib\n```\n\n3. Run the Jupyter notebook:\n```bash\njupyter notebook \"Traffic_Flow_Optimization final.ipynb\"\n```\n\n## Results\n\nThe project demonstrates:\n- Improved traffic flow efficiency\n- Reduced congestion through intelligent speed control\n- Enhanced safety through collision avoidance\n- Adaptive behavior in various traffic conditions\n\n## Documentation\n\nDetailed documentation is available in:\n- `Traffic_Flow_Optimization final.ipynb` - Main implementation notebook\n- `Group_111-TrafficOptimization.pdf` - Project documentation\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Dataset provided by [Dataset Source]\n- Based on research in Deep Reinforcement Learning for traffic optimization\n- Inspired by modern traffic management systems","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhjalendra%2Freinforcement-learning-based-traffic-optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaurabhjalendra%2Freinforcement-learning-based-traffic-optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhjalendra%2Freinforcement-learning-based-traffic-optimization/lists"}