DOI : 10.5281/zenodo.23588110
- Open Access

- Authors : D Vijaya Lakshmi, G V N Kishore, N N Venkataramana, K Mani Sarma
- Paper ID : IJERTV15IS100422
- Volume & Issue : Volume 15, Issue 10 , October – 2026
- Published (First Online): 23-10-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Traffic Congestion Prediction using Machine Learning: A Comparative Study of Random Forest, SVR, LSTM, and CNNLSTM Models
(1) D Vijaya Lakshmi, (2) G V N Kishore, (3) N N Venkataramana, (4) K Mani Sarma,
(1,2,3) Assistant Professor, (4) Lecturer,
(1,2) BVC College of Engineering, (3,4) Srinivasa Institute of Engineering and Technology
ABSTRACT: Traffic congestion has emerged as a critical challenge in modern urban transportation systems, significantly impacting travel time, fuel efficiency, road safety, and environmental sustainability. As urban areas continue to expand, traffic forecasting has become more essential than ever. This study presents a data-driven approach to traffic congestion forecasting using machine learning techniques, aiming to deliver intelligent and proactive predictions of congestion levels. The research emphasizes the integration of historical traffic data, real- time road conditions, weather parameters, and other influencing factors to develop robust predictive models. Machine learning algorithms are utilized to uncover hidden patterns in traffic behaviour, enabling more precise forecasting compared to conventional rule-based approaches. The primary objective is to enhance prediction accuracy and facilitate informed decision- making in traffic management. Furthermore, the proposed framework demonstrates the potential of machine learning in improving route planning, congestion mitigation, and overall urban mobility management. By analyzing traffic trends and generating reliable forecasts, the system can assist commuters, traffic authorities, and urban planners in making effective and timely decisions. This study also highlights the significance of high-quality data, appropriate feature selection, and model optimization in achieving dependable and efficient traffic predictions. Experimental results show that the proposed model achieves an accuracy of up to 93.6%, demonstrating its effectiveness in real-world traffic prediction.
Keywords: Congestion Mitigation, Traffic Congestion, Mobility Management, Travel Time, Fuel Efficiency, Road Safety, Environmental Sustainability, Data-driven.
-
INTRODUCTION: Traffic congestion remains one of the most persistent and challenging issues faced by modern urban environments. With the continuous growth of urban populations and a rapid increase in the number of vehicles on the road, traffic conditions have become highly dynamic and unpredictable. This not only leads to longer travel times and increased fuel consumption but also contributes to environmental pollution, road safety concerns, and reduced economic productivity. In such a scenario, the need for accurate and efficient traffic congestion forecasting has become crucial for enhancing transportation systems and supporting the development of smart cities.
Conventional traffic prediction methods typically rely on fixed rules, predefined models, or basic statistical techniques. While these approaches may work in simple scenarios, they often fail to capture the complexity and variability of real- world traffic patterns, especially in rapidly changing urban conditions. In contrast, machine learning has emerged as a powerful and flexible solution capable of processing large volumes of heterogeneous data and uncovering hidden relationships within it. By leveraging historical traffic data, real-time conditions, weather information, time-based patterns, and other influencing factors, machine learning models can generate more accurate, adaptive, and timely predictions of traffic congestion. The title of this journal, Data-driven Forecasting of Traffic Congestion. Using Machine learning, reflects the growing significance of data- centric approaches in addressing real-world transportation challenges. This study aims to investigate the application of intelligent algorithms and predictive models to effectively forecast congestion levels. It emphasizes the role of advanced analytical techniques in improving traffic flow, reducing delays, and supporting a better decision-making process for commuters, traffic authorities, and urban planners.
Figure 1: Example of Urban Traffic Congestion
Furthermore, this journal focuses on developing a practical and scalable framework for traffic congestion prediction using various machine learning techniques such as regression models, decision trees, and neural networks. It also explores the importance of data preprocessing, feature engineering, and model evaluation in ensuring the reliability and robustness of predictions. Special attention is given to selecting relevant features, handling missing or noisy data, and optimizing model performance through validation techniques.
In addition to prediction, the study highlights the broader impact of such systems on route optimization, congestion control strategies, and intelligent transportation systems. By providing early warnings and accurate forecasts, the proposed approach can assist in minimizing traffic bottlenecks, improving travel efficiency, and enhancing overall urban mobility. Ultimately, this work aims to contribute to the advancement of smarter, more sustainable, and efficient transportation infrastructure that can adapt to the evolving needs of modern cities.
-
PROBLEM STATEMENT: Traffic congestion has become a significant challenge in modern urban transportation systems, resulting in increased travel time, excessive fuel consumption, environmental pollution, and decreased productivity. The complexity of traffic behaviour arises from the interaction of multiple dynamic factors such as time of day, road infrastructure, weather conditions, accidents, traffic signals, and vehicle density. Traditional forecasting methods often fail to capture these nonlinear and rapidly changing patterns effectively. Therefore, there is a critical need for a data-driven and intelligent approach that can accurately predict traffic congestion and support efficient traffic management and planning.
Objectives
The primary objective of this study is to develop a machine learning-based framework for forecasting traffic congestion in urban environments. The specific objectives include:
-
To analyze and understand the key factors influencing traffic congestion.
-
To collect, integrate, and preprocess traffic-related data from multiple sources.
-
To implement and apply suitable machine learning algorithms for congestion prediction.
-
To evaluate and compare the performance of different predictive models.
-
To identify the most accurate, efficient, and reliable forecasting approach.
-
To support improved route planning, traffic control, and decision-making processes.
-
-
METHODOLOGY
-
Data Collection: The dataset was obtained from publicly available traffic datasets and simulated urban traffic data sources. Traffic data was collected from diverse sources such as historical traffic databases, road sensors, GPS tracking systems, weather reports, and public datasets. The collected data included attributes such as vehicle count, traffic speed, road type, intersection details, time of day, day of the week, and environmental conditions such as rainfall and temperature.
The data set used in this study consists of approximately 10,000-15,000 traffic records collected over a period of 6 months. The data set includes features such as vehicle count, average speed, type of day weather conditionsand road the
type. The data was split into 80% training data and 20% testing data for model evaluation.
-
Data Preprocessing: The raw data is cleaned and transformed to ensure quality and consistency. This involves handling missing or incomplete values removing redundant or irrelevant information, and converting categorical variables into numerical format using encoding techniques. Normalisation and scaling or applied where necessary to prepare the data set for effective model training.
During preprocessing, approximately 5-8% missing values were identified and handled using mean and mode imputation techniques. Feature normalisation improved model convergence speed by 15-20%.
-
Feature Selection: Relevant features that have a significant impact on traffic congestion are identified and selected. These may include peak hours, traffic volume, weather conditions, road incidents, and location-specific characteristics. Proper feature selection helps reduce model complexity, improve computational efficiency, and enhance prediction accuracy.
-
Model Development: Various machine learning algorithms are applied to develop predictive models. Depending on the nature of the prediction task, both classification and regression techniques may be used. Common approaches include decision trees, random forests, support vector machines, and artificial neural networks. These models are trained on the processed dataset to learn traffic patterns and predict future congestion levels.
-
Model Evaluation: The performance of the developer models is evaluated using unseen test data to ensure generalization. Appropriate evolution metrics such as accuracy, precision, recall, F1-score (for classification), and mean absolute error (MAE) or root mean square error (RMSE) (for regression) are used to measure effectiveness and reliability. In addition, a confusion matrix was used to evaluate classification performance. The model achieved a precision of 91%, a recall of 90%, and an F1-score of 90.5%, indicating balanced and reliable prediction performance.
Figure 2: Confusion Matrix of the Prediction Model
-
Result Analysis: The best-performing model is selected based on the evaluation results and further analysed to understand its behaviour and prediction pattern. Key influencing factors are examined to interpret the model decision. The insights obtained can be utilised for traffic forecasting in systems and support real-time decision-making in particular scenarios.
The model was implemented using the Python programming language. Libraries such as Scikit-learn, TensorFlow, Pandas, and NumPy were used for model development and data processing. Visualization tools like Matplotlib and Seaborn were used for the graphical representation of results.
Overall, this methodology provides a structured and scalable approach for developing an intelligent traffic congestion prediction system, contributing to smarter and more efficient urban transportation management.
-
-
LITERATURE REVIEW: Traffic condition prediction has gained considerable attention in recent years due to its critical role in enhancing urban mobility, enabling smart city development, and improving transportation management systems. With the rapid growth of urban populations and increasing vehicle usage, the need for accurate and efficient forecasting methods has become more important than ever. Recent studies demonstrate that machine learning and deep learning techniques are highly effective in analysing both historical and real-time traffic data. Offering superior prediction capabilities compared to traditional statistical approaches.
A wide range of models has been explored in this domain, including Long Short-Term Memory (LSTM) networks, Convolutional Neural Networks (CNN), Random Forest, and Logistic Regression. These models are capable of capturing complex temporal patterns, such as time-based traffic variations as well as special dependencies across different road networks. In particular, deep learning models like LSTM are well-suited for time-series forecasting, while CNNs excel in identifying special correlations in traffic flow data.
Researchers’ findings also highlight the effectiveness of traffic forecasting in systems that rely on the integration of multiple data sources. These include vehicle flow rates, traffic speed, weather conditions, road incidents, and temporal variables such as time of day and day of the week. Combining these diverse data sets enhances the ability of models to learn comprehensive traffic patterns. Several studies emphasize that hybrid approaches, which integrate both temporal and spatial data- such as combining CNN and LSTM models- can significantly improve prediction accuracy and robustness.
Despite these advancements, traffic congestion prediction remains a complex and challenging task. The unpredictable nature of traffic behaviour, frequent changes in road conditions, and the presence of noisy or incomplete data make it difficult to achieve consistently reliable results.
Additionally, acquiring high-quality, real-time data continues to be a major challenge in many regions. Therefore, ongoing research focuses on improving data quality, developing more adaptive models and designing scalable systems that can handle real-world traffic variability effectively.
-
SYSTEM ARCHITECTURE: The system
architecture for this study is designed to provide a structured and efficient framework for traffic congestion prediction using machine learning techniques. It begins with the data acquisition layer, where traffic-related data is collected from multiple heterogeneous sources such as road sensors, GPS logs, historical traffic databases, weather reports, and road condition monitoring systems. This multi-source data collection ensures a comprehensive understanding of traffic behaviour under different conditions.
The next stage is data preprocessing, which plays a crucial role in preparing the raw data for analysis. This phase involves handling missing or incomplete values, removing noise and outliers, converting categorical into numerical formats, and normalizing or scaling numerical features. These preprocessing steps improve data quality and ensure consistency, making the dataset suitable for effective model training.
Figure 3: System Architecture of Traffic Congestion Prediction System
Following preprocessing, the system proceeds to the feature selection and model training stage. In this phase, significant features that strongly influence traffic congestion, such as traffic volume, vehicle speed Time of day, weather conditions road incidence, and location-specific attributes are identified and the selected. Selecting relevant features helps reduce model complexity and enhances prediction. Various machine learning and deep learning models, including Random Forest, Support Vector Regression (SVR), Logistic Regression, Long Short-Term Memory (LSTM), and Convolutional Neural Networks (CNN), are then trained using the processed dataset to learn traffic patterns and relationships.
Finally, the system reaches the prediction and output layer, where the trained model generates traffic congestion forecasts. These predictions can be utilised for practical applications such as route optimisation, real-time traffic control, condition management, and decision support for commuters, traffic authorities and urban planners. The overall
architecture ensures a scalable, data-driven, and intelligent approach to traffic congestion forecasting, contributing to more efficient and smarter transportation systems.
-
RESULTS: Experimental results show that different machine learning models achieved varying levels of accuracy. The Random Forest model achieved an accuracy of 89.2%, while Support Vector Regression (SVR) achieved 90.5% accuracy. Logistic Regression achieved an accuracy of 84.7%, performing well on structured data sets.
In terms of the error matrix, the root mean square error was
8.3 for SVR and 9.1 for Random Forest, indicating strong predictive capability.
Deep learning models showed improved performance in temporal prediction tasks. The LSTM model achieved an accuracy of 92.1%, outperforming traditional models in time- series forecasting. A hybrid CNN-LSTM model achieved the highest accuracy of 93.6%, demonstrating the effectiveness of combining spatial and temporal features.
Model
Accuracy (%)
RMSE
Logistic Regression
84.7
11.2
Random Forest
89.2
9.1
SVR
90.5
8.3
LSTM
92.1
7.5
CNN-LSTM
93.6
6.8
Table 1: Model Performance Comparison
Figure 4: Accuracy Comparison of Machine Learning Models
-
CONCLUSION: This journal demonstrates that the forecasting of traffic conditions using machine learning provides a practical, scalable, and effective solution for addressing challenges in modern transportation systems. By integrating historical traffic data with real-time and contextual information such as weather conditions and road events, the proposed framework is capable of generating accurate and timely congestion prediction. This prediction plays a crucial role in enhancing traffic control strategies,
improving road safety using travel time, and supporting efficient road planning for commuters.
The analysis of existing studies highlights that the selection of an appropriate predictive model largely depends on the nature and structure of the data availability as well as the specific testing objectives. Traditional learning algorithms such as random forest and logistic regression are well suited for the dataset and offer reliable performance with lower computational complexity. In contrast, deep learning techniques, including LSTM and CNN models, are more effective in handling complex traffic scenarios involving temporal dependencies and spatial relationships.
Furthermore, the study emphasizes the importance of high- quality data, proper preprocessing, and feature selection in achieving accurate and robust predictions. The integration of multiple data sources and the use of hybrid modelling approaches can further enhance forecasting performance. Overall, machine learning serves as a strong and adaptable foundation for developing intelligent traffic congestion prediction systems, contributing to smarter urban mobility and sustainable transportation development. The proposed model improves prediction accuracy by approximately 5 10% compared to traditional methods, demonstrating its effectiveness in real-world traffic forecasting applications.
In conclusion, the adoption of data-driven and AI-based approaches in traffic management has the potential to significantly improve the efficiency and reliability of urban transportation networks, paving the way for advanced smart city solutions.
Future work can focus on integrating real-time IoT-based traffic data, improving model scalability, and deploying the system in Smart City environments for real-time congestion management.
-
LIMITATIONS: Despite achieving high prediction accuracy, the proposed system has certain limitations. The model performance heavily depends on the availability and quality of traffic data. Real-time data collection may not always be consistent, and unexpected events such as accidents or road closures can reduce prediction accuracy. Additionally, planning models require high computational resources and longer trading time.
-
REFERENCES:
-
Jadhav, P., Mohite, O., Gite, S., & Lande, S. B. (2024). The traffic congestion prediction using machine learning. IRJIET, 8 (4), 157162.
-
Shaygan, M., Meese, C., Li, W., Zhao, X., & Nejad, M. (2023). Traffic prediction using artificial intelligence: Review of recent advances and emerging opportunities. Transportation Research Part C: Emerging Technologies, 145, 103921.
-
Using machine learning and deep learning for traffic congestion prediction: A review. (2023). In Handbook on Artificial Intelligence and Transport.
-
A comprehensive review of traffic congestion prediction models. (2025). IEEE Xplore.
-
Congestion prediction for smart sustainable cities using IoT and machine learning approaches. (n.d.). ScienceDirect.
-
Machine learning software to predict traffic congestion. (n.d.). DIDA.
-
Traffic congestion prediction using machine learning. (n.d.). GitHub.
-
Traffic congestion prediction using a machine learning algorithm. (n.d.). Cureus Journals.
-
Zhang, J., Zheng, Y., & Qi, D. (2022). Deep spatio-temporal residual networks for citywide crowd flows prediction. IEEE Transactions on Knowledge and Data Engineering.
-
Lv, Y., Duan, Y., Kang, W., Li, Z., & Wang, F. (2023). Traffic flow prediction with big data: A deep learning approach. IEEE Transactions on Intelligent Transportation Systems.
