Urban traffic congestion is a persistent challenge in rapidly growing sub-Saharan African cities, where limited sensing infrastructure constrains predictive traffic management. This study presents a data-driven intelligent traffic routing framework for real-time route optimization in Kampala, Uganda, integrating geospatial traffic data from the Google Maps Directions API with a Random Forest Classifier (RFC) deployed through a Node.js and Python microservice architecture. Traffic congestion is quantified using a ratio-based congestion score derived from baseline and traffic-adjusted travel durations. Model evaluation on 421 route samples yields an overall classification accuracy of 78%, with a Receiver Operating Characteristic–Area Under the Curve (ROC–AUC) of 0.87, indicating strong threshold-independent separability, and a precision–recall average precision of 0.92, demonstrating robust positive-class performance under class imbalance. The deployed system achieves near-real-time responsiveness, with average end-to-end response times below two seconds. The results demonstrate that lightweight and interpretable machine learning models can effectively support congestion-aware routing in data- and resource-constrained urban environments.
Tamale et al. (Sun,) studied this question.