Multi-Model Machine Learning Framework for Urban Traffic Signal Optimization Using CNN, ANN and KNN
Multi-Model Machine Learning Framework for Urban Traffic Signal Optimization Using CNN, ANN and KNN
Keyvan Barati1 Yasaman Qasempour2
1) PhD student in Electronics, Lorestan University - Khorramabad - Iran
2) Bachelor s degree student in Computer Engineering, Lorestan University - Khorramabad - Iran
IOI Code
:
AAHE-ABAFCA
Publication :
National Conference on Civil Engineering, Design and Construction Technologies, Energy, Materials and Advanced Machinery(icaeu.ir)
Abstract :
Urban traffic signal optimization is a critical challenge in intelligent transportation systems, especially at congested intersections where both vehicle and pedestrian flows are high. This study presents a comparative analysis of three machine learning approaches—Convolutional Neural Networks (CNN), Artificial Neural Networks (ANN), and K-Nearest Neighbors (KNN)—for predicting traffic volumes and optimizing signal timing. Real-world traffic data including geographic coordinates, vehicle counts, and pedestrian volumes were collected, preprocessed, and normalized for model training. The CNN model utilized four-dimensional input with convolutional and fully connected layers to extract spatial and temporal features, while the ANN model employed multi-layer perceptrons with ReLU activation functions to capture nonlinear relationships. KNN was implemented as a fast, similarity-based prediction method. Models were evaluated using metrics including Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and coefficient of determination (R²). Comparative results show that CNN achieved the highest predictive accuracy (MSE: 4.2%, RMSE: 6.5%, MAE: 5.1%, R²: 93.8%), followed by ANN and KNN. Residual analysis, error histograms, and correlation matrices further highlight the performance differences among models. The proposed multi-model framework enables effective traffic signal optimization, reduces prediction errors, and supports real-time decision-making in urban intersections. Results are summarized in a comparative table alongside recent literature, demonstrating the superior performance of the proposed CNN-based approach in capturing complex traffic patterns.