Sustainable Traffic Congestion Forecasting Through Lightweight Explainable AI and TinyML Edge Deployment: A Casablanca Case Study

Traffic congestion in urban areas poses substantial challenges to transportation management, urban planning, and environmental sustainability. This study introduces an explainable artificial intelligence (XAI) framework for predicting traffic congestion in Casablanca, Morocco, by integrating gradient boosting models with lightweight XAI techniques that are suitable for edge deployment. Employing SUMO-simulated traffic data comprising 30,000 data points across 30 scenarios, we implemented a GradientBoostingRegressor (scikit-learn) enhanced with native feature importance analysis, permutation importance, and partial dependence plots, achieving R2=0.9939, MAE = 0.015, and RMSE = 0.019. The XAI analysis reveals that lag features (32.0%), temporal patterns (35.0%), and infrastructure features (15.0%) are the primary contributors to congestion prediction, with culturally relevant factors, such as Friday prayers, accounting for 8.7% of the total feature importance. The model was deployed through a knowledge-distillation TinyML pipeline, achieving 31× compression (2.4 MB → 76 KB) on ESP32 microcontrollers with 2.1 ms inference latency and a 667× reduction in per-inference energy consumption compared to cloud-based deployment. This lightweight XAI approach directly addresses the gap between interpretability requirements and edge deployment constraints, facilitating sustainable intelligent transportation systems in developing countries with limited infrastructure and energy resources. The proposed framework is transferable to other rapidly urbanizing cities in the Global South, offering a replicable template for data-driven interpretable traffic management that can directly inform infrastructure investment prioritization, adaptive signal-control policy design, and culturally aware urban mobility planning strategies.

Authors

Institutions

Publication Details

Journal
Sustainability
Published
2026-05-01
DOI
https://doi.org/10.3390/su18094439
Primary Topic
Traffic Prediction and Management Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Sustainable Traffic Congestion Forecasting Through Lightweight Explainable AI and TinyML Edge Deployment: A Casablanca Case Study

Mohamed Lahby, Mehdi Attioui
Sustainability
Traffic Prediction and Management Techniques
article

Sustainable Traffic Congestion Forecasting Through Lightweight Explainable AI and TinyML Edge Deployment: A Casablanca Case Study

Mohamed Lahby, Mehdi Attioui
article en

Abstract

Traffic congestion in urban areas poses substantial challenges to transportation management, urban planning, and environmental sustainability. This study introduces an explainable artificial intelligence (XAI) framework for predicting traffic congestion in Casablanca, Morocco, by integrating gradient boosting models with lightweight XAI techniques that are suitable for edge deployment. Employing SUMO-simulated traffic data comprising 30,000 data points across 30 scenarios, we implemented a GradientBoostingRegressor (scikit-learn) enhanced with native feature importance analysis, permutation importance, and partial dependence plots, achieving R2=0.9939, MAE = 0.015, and RMSE = 0.019. The XAI analysis reveals that lag features (32.0%), temporal patterns (35.0%), and infrastructure features (15.0%) are the primary contributors to congestion prediction, with culturally relevant factors, such as Friday prayers, accounting for 8.7% of the total feature importance. The model was deployed through a knowledge-distillation TinyML pipeline, achieving 31× compression (2.4 MB → 76 KB) on ESP32 microcontrollers with 2.1 ms inference latency and a 667× reduction in per-inference energy consumption compared to cloud-based deployment. This lightweight XAI approach directly addresses the gap between interpretability requirements and edge deployment constraints, facilitating sustainable intelligent transportation systems in developing countries with limited infrastructure and energy resources. The proposed framework is transferable to other rapidly urbanizing cities in the Global South, offering a replicable template for data-driven interpretable traffic management that can directly inform infrastructure investment prioritization, adaptive signal-control policy design, and culturally aware urban mobility planning strategies.

SustainabilityVol. 18(9)
University of Hassan II Casablanca (MA)
Industry, innovation and infrastructure
Openalex Percentile: Top 9%
Traffic Prediction and Management Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Sustainable Traffic Congestion Forecasting Through Lightweight Explainable AI and TinyML Edge Deployment: A Casablanca Case Study — Mohamed Lahby, Mehdi Attioui · Sustainability (2026) | TGRS Research Map | TGRS