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.
- Project Description
- Objectives
- Key Features
- Data Sources
- Installation
- Usage
- Model Training
- Streamlit App
- Future Enhancements
- License
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.
- 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.
- 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.
- Historical traffic data can be sourced from publicly available datasets such as:
- Weather data can be obtained from APIs like OpenWeatherMap or historical weather datasets.
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/karimosman89/traffic-flow-prediction.git cd traffic-flow-prediction
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
python src/data_preprocessing.py
python src/model_training.py
streamlit run src/streamlit_app.py
The model uses an LSTM architecture to predict traffic flow. The training process involves:
- Splitting the data into training and testing sets.
- Fitting the model on the training data and evaluating it on the test data.
- Calculating Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE) as evaluation metrics.
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.
- Incorporate real-time traffic data from sensors or APIs for live predictions.
- Extend the model to include more features like public transportation data, special events, and road construction.
- Develop visualizations for historical traffic trends using libraries like Matplotlib or Seaborn.
- Implement more complex models such as GRU or CNN for time series forecasting.
This project is licensed under the MIT License. See the LICENSE file for more details.