Skip to content

Develop a deep learning model capable of predicting traffic flow in urban environments. The model will utilize historical traffic data, weather conditions, and road configurations to forecast traffic patterns. This information can be invaluable for traffic management systems, helping to optimize traffic signals and reduce congestion, ultimately.

License

Notifications You must be signed in to change notification settings

karimosman89/traffic-flow-prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intelligent Traffic Flow Prediction System

Overview

The Intelligent Traffic Flow Prediction System leverages deep learning techniques to predict traffic flow in urban environments. By analyzing historical traffic data and weather conditions, the system helps in optimizing traffic management, reducing congestion, and promoting sustainable mobility.

Table of Contents

Project Description

The project predicts future traffic flow using a Long Short-Term Memory (LSTM) model. The model is trained on historical traffic data and weather conditions to make real-time predictions. The resulting predictions can help city planners and traffic management systems improve traffic efficiency and reduce travel times.

Objectives

  • Develop a predictive model for traffic flow using deep learning techniques.
  • Integrate historical traffic data with real-time weather data.
  • Visualize predictions and historical trends using a user-friendly web application.

Key Features

  • Data Preprocessing: Scripts to clean and prepare the dataset for training.
  • Model Development: A robust LSTM model for time series forecasting.
  • Model Evaluation: Performance metrics to assess prediction accuracy.
  • Web Application: An interactive Streamlit app for traffic flow predictions.

Data Sources

Installation

To set up the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/karimosman89/traffic-flow-prediction.git
    cd traffic-flow-prediction
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  3. Install dependencies:

     pip install -r requirements.txt
    

Usage

Data Preparation

   python src/data_preprocessing.py

Model Training

 python src/model_training.py

Streamlit App

 streamlit run src/streamlit_app.py

Model Training

The model uses an LSTM architecture to predict traffic flow. The training process involves:

  1. Splitting the data into training and testing sets.
  2. Fitting the model on the training data and evaluating it on the test data.
  3. Calculating Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE) as evaluation metrics.

Streamlit App

The Streamlit app allows users to input traffic volume, temperature, and precipitation, and receive real-time predictions of future traffic flow. This interactive interface enhances usability for traffic planners and researchers.

Future Enhancements

  1. Incorporate real-time traffic data from sensors or APIs for live predictions.
  2. Extend the model to include more features like public transportation data, special events, and road construction.
  3. Develop visualizations for historical traffic trends using libraries like Matplotlib or Seaborn.
  4. Implement more complex models such as GRU or CNN for time series forecasting.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Develop a deep learning model capable of predicting traffic flow in urban environments. The model will utilize historical traffic data, weather conditions, and road configurations to forecast traffic patterns. This information can be invaluable for traffic management systems, helping to optimize traffic signals and reduce congestion, ultimately.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages