Next Article in Journal
Computational Modelling of Institutional Perceptions in a Civilisational Intergovernmental Organisation
Previous Article in Journal
Adjoint-Based Joint Reconstruction of Heat Source and Initial Condition with Uncertainty Quantification
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Federated Edge Intelligence for Climate-Aware Spatiotemporal Road Accident Prediction Using IoT and LoRaWAN Networks

1
Departamento de Informática y Ciencias de la Computación, Pontificia Universidad Católica del Ecuador, Campus Esmeraldas PUCESE, Esmeraldas 080101, Ecuador
2
Facultad de Ingeniería en Sistemas, Electrónica e Industrial, Universidad Técnica de Ambato (UTA), Av. los Chásquis, Ambato 180206, Ecuador
3
EspochAI, Facultad de Informática y Electrónica, Escuela Superior Politécnica de Chimborazo (ESPOCH), Riobamba 060155, Ecuador
4
Tecnologías de la Información, Escuela Superior Politécnica de Chimborazo (ESPOCH), Sede Morona Santiago, Macas 140150, Ecuador
*
Authors to whom correspondence should be addressed.
Computation 2026, 14(7), 163; https://doi.org/10.3390/computation14070163
Submission received: 14 June 2026 / Revised: 1 July 2026 / Accepted: 10 July 2026 / Published: 20 July 2026
(This article belongs to the Section Computational Engineering)

Abstract

Real-time road accident prediction under dynamic climatic conditions remains a critical challenge for intelligent transportation systems, especially in peripheral and rural regions with limited communication infrastructure. This study proposes and evaluates a comprehensive five-layer cyber–physical architecture based on Federated Edge Intelligence to enable climate-aware spatiotemporal road accident prediction across the 24 provinces of Ecuador. The framework integrates low-power IoT sensing nodes equipped with TinyML capabilities (ESP32-S3), long-range LoRaWAN (Long-Range Wide-Area Network) communication networks, containerized edge–cloud orchestration via OpenNebula and K3s, a decentralized Federated Learning ecosystem using the FedAvg algorithm, and a geospatial decision intelligence backend. Leveraging a nationwide multi-source dataset spanning the 2014–2025 period with 27,620 processed records, the architecture successfully handles highly skewed historical accident profiles optimized through a Box–Cox transformation. Empirical results demonstrate that the centralized Stacking ensemble achieves the highest overall baseline performance ( R 2 = 0.2460 , MAE = 0.4748 ) in the Box–Cox transformed space. In the decentralized environment, the federated Gradient Boosting implementation establishes a resilient and viable accuracy trade-off ( 14.51 % increase in MAE) while strictly maintaining localized data sovereignty and compliance with personal data protection legislation. Operationally, the edge nodes achieve a localized inference latency of only 78 ms , well below the critical 200 ms safety threshold, while the global aggregation engine exhibits rapid convergence within just three communication rounds. This cyber–physical ecosystem proves that combining localized TinyML inference with federated aggregation provides a scalable, low-latency, and privacy-preserving foundation for next-generation climate-aware road safety infrastructures in connectivity-constrained environments.

1. Introduction

Road traffic accidents remain one of the leading causes of mortality and morbidity worldwide, accounting for approximately 1.35 million annual fatalities according to the World Health Organization (WHO, 2023). Among the primary contributing factors, adverse weather conditions—principally rain and sun glare—significantly increase traffic accident risks, with statistics showing that 25% of severe crashes occur on wet road surfaces [1]. Recent studies have quantified that heavy rainfall significantly reduces both visibility and tire-pavement friction, multiplying the probability of multi-vehicle pileups by a factor of 2.5 [2]. Furthermore, dense fog has been associated with a fatality rate 4.2 times higher in mountainous corridors [3,4]. Despite advancements in Advanced Driver Assistance Systems (ADAS) and Internet of Things (IoT) sensor networks, real-time accident prediction under dynamic climatic variables remains an open challenge, particularly in regions characterized by limited connectivity infrastructure and high meteorological variability [5].
Predicting accidents in real time within rural and interprovincial corridors faces severe operational constraints due to the fact that these peripheral zones lack high-speed cellular coverage or fiber-optic backhauls. To deploy decentralized intelligence in these environments, the architecture must overcome the interconnected challenges of limited connectivity, strict data privacy regulations, high transmission latencies, and the absolute necessity of Edge AI execution. Moving predictive processing directly to the edge allows for immediate risk assessment close to the data source, mitigating reliance on centralized infrastructures that fail under intermittent network availability. Furthermore, decentralized learning frameworks must handle highly sensitive location logs and climatic variables locally, preventing the unauthorized aggregation of private telemetry while minimizing the communication overhead over long-range channels.
Although recent studies have explored accident prediction using deep learning, gradient boosting, or edge computing, most existing approaches address these technologies independently. Few studies integrate TinyML, Federated Learning, and LoRaWAN into a unified architecture capable of supporting real-time traffic prediction under intermittent connectivity while simultaneously preserving data privacy. This gap is particularly relevant for rural and geographically heterogeneous environments such as Ecuador.
To address these limitations, this work proposes a Federated Edge Intelligence architecture that combines TinyML, Federated Learning, and LoRaWAN communications to enable privacy-preserving traffic accident prediction in rural environments.
The main contributions of this work are summarized as follows:
  • A novel Federated Edge Intelligence architecture specifically designed for rural roads with intermittent connectivity.
  • The integration of TinyML and LoRaWAN frameworks to enable low-power, localized inference on resource-constrained hardware.
  • A comprehensive evaluation of the predictive framework utilizing nationwide accident and heterogeneous meteorological data.
  • Experimental validation of the system’s viability through a real-world pilot deployment.
The remainder of this article is organized as follows: Section 2 provides the necessary background and reviews related work on climate-aware accident modeling, edge intelligence, and federated learning over LPWAN-constrained networks. Section 3 details the proposed five-layer architecture, including the IoT sensing, communication, orchestration, federated learning, and analytics layers, along with the dataset composition and preprocessing pipeline. Section 4 presents the experimental results, benchmarking against centralized baselines and evaluating operational viability. Finally, Section 5 discusses the research implications, limitations, and future lines of work.

2. Background

The deployment of real-time predictive safety systems in rural corridors requires a deep convergence of multiple technical domains. This section reviews the state-of-the-art and foundational theory underlying climate-aware crash modeling, vehicular edge intelligence, and bandwidth-constrained federated learning frameworks.

2.1. Spatiotemporal and Climate-Aware Accident Modeling

Traditional crash prediction frameworks have historically treated environmental risk factors as static or aggregated macro-variables, often relying on historical monthly or daily meteorological averages [6]. However, dynamic traffic safety literature establishes that the physics of accident occurrence depends on acute, short-term microclimatic thresholds. For instance, precipitation acts as a non-linear disruptive catalyst; real-time rainfall intensities exceeding 5 mm/h induce an instantaneous degradation of the tire-pavement friction coefficient by up to 40 % , directly scaling the vehicle braking distance and hydrodynamic skidding risks [7]. Similarly, visibility constraints during micro-scale fog events drop log-linearly, generating sudden deceleration profiles and a severe escalation in multi-vehicle collision chains within complex orographic terrains [8].
Methodologically, capturing these complex interactions has shifted from classic linear econometric approaches, such as Poisson or Negative Binomial regressions, toward non-parametric machine learning models [9]. Prior works have extensively explored Recurrent Neural Networks (LSTM) and Gradient Boosting frameworks (XGBoost) to predict accidents leveraging historical and weather datasets [10]. Hybrid CNN-LSTM architectures have also been proposed to capture complex spatiotemporal dependencies across adjacent road segments and urban road networks [11,12].
Nevertheless, ensemble tree-based architectures like Gradient Boosting Decision Trees (GBDT) and LightGBM have gained prominent traction for localized safety systems. This shift is driven by their intrinsic capacity to handle highly heterogeneous, non-normalized features (such as sudden temperature drops, temporal shifts, and geospatial coordinates) and missing data values without suffering from the high computational overhead, hyperparameter sensitivity, and vanishing gradient vulnerabilities typical of deep architectures when scaled down to low-power infrastructure [13]. This structural efficiency balances high predictive capacity with low computational requirements, making them ideal candidates for deployment on peripheral processing units.

2.2. Vehicular Edge Intelligence and Latency Constraints

Moving predictive model execution from centralized cloud architectures to peripheral networking infrastructures is driven by strict latency and data-locality requirements [14]. Purely cloud-centric intelligent transportation systems (ITS) require an uninterrupted upstream data pipe, where localized telemetry from highways is transmitted to remote data centers for processing [15]. In rural or topographically isolated interprovincial corridors, this paradigm introduces unsustainable round-trip time (RTT) latencies—often exceeding 500 ms due to multi-hop routing, sparse cellular topologies, or satellite backhaul dependencies [16]. Such latency overhead violates the sub-200 ms temporal threshold mandated for active driving collision avoidance systems and immediate local alerts [17].
Edge Intelligence mitigates this operational bottleneck by migrating downstream inference tasks to nodes located proximal to the physical data sources, such as road-side units (RSUs) and perimetric microcontrollers [18]. By executing local computation, vehicular edge networks have consistently demonstrated end-to-end operational latencies below 100 ms, while reducing upstream WAN bandwidth consumption by up to 90 % [19]. This decentralized processing framework forms the technical baseline needed to handle continuous streams of real-time environmental telemetry without saturating regional communication backbones.

2.3. Federated Learning over Resource and LPWAN-Constrained Networks

While Edge AI addresses latency, it introduces optimization challenges: individual edge nodes operating in isolation often lack a sufficiently diverse data profile to build highly generalized models, a problem amplified across heterogeneous geoclimatic zones [20]. Federated Learning (FL) solves this by enabling decentralized edge nodes to collaboratively train a shared global model without exposing their raw, localized data partitions [21]. Standard FL orchestration relies on iterative weight-aggregation protocols such as Federated Averaging (FedAvg) or FedProx, which optimize a global loss function min w f ( w ) by computing weighted averages of localized parameters:
w t + 1 = k = 1 K n k n w t k
where K represents the total number of active peripheral clients, n k is the data sample size at client k, n is the total sample size across all clients, and w t k denotes the localized model weight updates at epoch t.
Despite its benefits for data localization and regulatory compliance with international privacy mandates [22], standard FL implementations assume high-bandwidth, unconstrained communication channels, such as Wi-Fi or 5G, between peripheral clients and the central coordinator [23]. This assumption is completely invalid in rural interprovincial infrastructure, where Low-Power Wide-Area Networks (LPWAN), primarily LoRaWAN, represent the only economically and operationally viable wireless communication alternative [24].
LoRaWAN excels at long-range telemetry (up to 15 km in line-of-sight environments) under hyper-low power parameters, but it imposes severe constraints: a narrow uplink bandwidth limited to less than 50 kbps and strict daily transmission duty cycles [25]. Consequently, transferring large-scale deep neural network weights or raw gradients over LoRaWAN channels becomes mathematically and operationally impossible. This network bottleneck necessitates the integration of TinyML paradigms—where highly compressed, quantized boosting models run within less than 256 KB of RAM [26]—coupled with selective gradient compression or sparse update strategies, a specialized optimization cross-section that remains largely unaddressed in current distributed traffic safety literature.

3. Methodology

The methodological design follows the Design Science Research (DSR) paradigm [27], structured into three concatenated phases: Relevance Phase, Design Phase, and Rigor Phase. This framework guides the construction and evaluation of the cyber–physical system for traffic accident prediction in rural and interprovincial roads of Ecuador.

3.1. Relevance Phase: Problem Identification and Systematic Gap Analysis

3.1.1. Problem Characterization

The critical problem of road fatality rates in Ecuador’s 24 provinces is exacerbated by three interdependent factors: The main challenges identified are: (i) adverse climatic conditions (dense fog, torrential rains, extreme thermal variations from 2  °C to 28 °C); (ii) limited connectivity infrastructure (scarce fiber optics, intermittent cellular coverage in Andean and Amazonian zones); and (iii) the absence of distributed architectures with climate resilience adapted to the Global South.
A systematic literature review following the PRISMA protocol [28] was conducted across Scopus, Web of Science, and IEEE Xplore databases for the period 2015–2025. Search strings combined terms: (“federated learning” OR “TinyML”) AND (“LoRaWAN” OR “LPWAN”) AND (“traffic accident” OR “road safety”) AND (“edge computing” OR “cyber–physical”). The review yielded 247 initial records, reduced to 43 after duplicate removal, and finally 12 primary studies after full-text screening against inclusion criteria (peer-reviewed, empirical evaluation, English/Spanish). Result: No existing architecture simultaneously satisfies the four fundamental requirements identified for the Ecuadorian context.

3.1.2. System Requirements

The analysis justified four non-negotiable requirements:
  • R1: Operational latency < 200 ms for real-time predictive alerts.
  • R2: Mobility data privacy preservation (GDPR compliance and Ecuador’s Organic Law on Data Protection).
  • R3: Functionality under intermittent connectivity and low bandwidth (< 50   kbps ).
  • R4: Energy autonomy > 6 months of continuous operation without maintenance.
Research gap: Absence of TinyML + LoRaWAN + Federated Learning convergence for environments with high meteorological and orographic variability.

3.2. Design Phase: Artifact Construction Following CRISP-DM

The technological artifact (complete cyber–physical system) was constructed using the CRISP-DM (Cross-Industry Standard Process for Data Mining) v1.0 framework to guide the data and model workflow, deployed over a 5-layer architecture (from physical capture to analytics).

3.2.1. Layer 1: Intelligent Node Layer (IoT Edge)

The intelligent edge node constitutes the first layer of the proposed architecture and is responsible for environmental data acquisition, local preprocessing, TinyML inference, georeferencing, and long-range communication. As summarized in Table 1, the hardware platform integrates an ESP32-S3 microcontroller with LoRaWAN connectivity, environmental sensors, GPS positioning, local storage, renewable energy supply, and an IP65 enclosure designed for deployment in harsh outdoor conditions. The complete architecture of the intelligent node is illustrated in Figure 1, highlighting the interaction between sensing, local intelligence, energy management, and communication subsystems.
The embedded software stack complements the hardware architecture shown in Figure 1 by providing real-time acquisition, local intelligence, and communication capabilities. The software environment is designed to operate within the resource constraints of the ESP32-S3 while enabling TinyML inference directly at the edge.
  • Firmware:Arduino Framework/ESP-IDF v5.0.
  • RTOS: FreeRTOS (task management: sensor acquisition, TinyML, LoRaWAN communication).
  • TinyML: TensorFlow Lite Micro (quantized int8 models, footprint < 256 KB RAM).
  • Local algorithms: Noise filtering (moving average), anomaly detection (adaptive thresholds), data compression (delta encoding).
  • CRISP-DM Function: Data acquisition (raw data capture) in the Data Understanding phase.

3.2.2. Layer 2: LoRaWAN Communication Layer

The communication layer provides a secure and reliable transport infrastructure that interconnects distributed IoT edge nodes with the cloud-based processing environment. As summarized in Table 2, the architecture combines long-range LoRaWAN communications, gateway aggregation, Internet backhaul connectivity, network management services, and secure message routing. The complete communication workflow is illustrated in Figure 2, showing the interaction between distributed monitoring nodes, the LoRaWAN gateway, The Things Stack (TTN), and the MQTT-based telemetry distribution infrastructure.
The communication infrastructure operates in strict compliance with Ecuadorian ARCOTEL regulations. As illustrated in Figure 2, telemetry generated by distributed IoT nodes is transmitted through LoRaWAN links toward the central gateway, where traffic is aggregated and forwarded to cloud services using a secure Internet backhaul. The architecture employs The Things Stack (TTN) for device management and Over-The-Air Activation (OTAA), while MQTT Mosquitto serves as the message broker responsible for routing telemetry streams toward downstream analytics services.
Network operation is configured with a carrier frequency of 915 MHz within the US902–928 ISM band, an uplink payload limited to ≤51 bytes after LoRaWAN overhead, a duty cycle below 1%, and a fixed bandwidth of 125 kHz per uplink channel. Adaptive Spreading Factors (SF7–SF12) are dynamically selected according to the Signal-to-Noise Ratio (SNR) and communication distance, enabling robust long-range connectivity exceeding 15 km in rural and mountainous regions.
The cybersecurity framework depicted in Figure 2 incorporates AES-128 encryption, TLS/SSL communication channels, OTAA authentication, secure device provisioning, and end-to-end integrity verification mechanisms. Within the CRISP-DM methodology, Layer 2 is responsible for the secure transport of telemetry data from the edge acquisition layer to the processing infrastructure, thereby enabling the remote Data Preparation phase of the analytical workflow.

3.2.3. Layer 3: Edge–Cloud Orchestration Layer

The orchestration layer provides the distributed computing infrastructure required to coordinate edge resources, containerized services, storage persistence, and cloud integration across the national deployment. As summarized in Table 3, the architecture combines edge orchestration, container management, distributed storage, GPU acceleration, and secure networking technologies to support scalable AI workflows. The complete orchestration ecosystem is illustrated in Figure 3, which details the interactions among geographically distributed edge nodes, orchestration services, storage subsystems, and the centralized cloud infrastructure.
The system architecture is deployed using a hybrid topology composed of five edge nodes distributed across the provinces with the highest road density in Ecuador: Pichincha, Guayas, Azuay, Manabí, and Tungurahua. These nodes interface directly with a centralized cloud server located in a data center in Quito, which is dedicated to global data aggregation and periodic model retraining. Within the CRISP-DM methodology, this topology supports the workflow orchestration required for the Modeling and Evaluation phases, enabling efficient distributed execution across the entire network architecture.
The software stack is managed through a containerized microservices architecture, executing workflows through five sequential stages:
  • Data Acquisition: The ESP32-S3 firmware, developed using the Arduino Framework and ESP-IDF v5.0, captures environmental telemetry from the deployed sensors. This firmware runs on the FreeRTOS real-time operating system, handling concurrent tasks for sensor data acquisition, localized TinyML inference via TensorFlow Lite Micro, and LoRaWAN transmission scheduling.
  • Communication: Telemetry data is encapsulated into optimized LoRaWAN frames (≤51 B) and transmitted to a Milesight UG67 gateway. The gateway forwards these data via a 4G/LTE backhaul to The Things Stack (TTN) network server, which decodes the payload and publishes it to an MQTT Mosquitto broker secured over TLS v1.3.
  • Edge Processing: A FastAPI microservice, running inside a Docker container managed by K3s on the NVIDIA Jetson Orin NX edge node, subscribes to the MQTT broker. This service performs real-time local inference utilizing a pre-trained GradientBoostingRegressor model (compiled via scikit-learn) to generate instantaneous risk scores. The microservice is invoked via REST API calls from the orchestration layer based on incoming telemetry triggers.
  • Federated Learning: The Flower FL client, also containerized and deployed on each peripheral edge node, periodically (every 10 local epochs) uploads local model weight updates to the central aggregation server. The server executes the standard FedAvg algorithm utilizing TensorFlow/PyTorch backends and redistributes the newly aggregated global weights back to all participating clients.
  • Analytics and Visualization: The FastAPI backend writes the multi-modal prediction results to a PostgreSQL database configured for geospatial queries and an InfluxDB instance optimized for time-series storage. Grafana dashboards and a React/Leaflet frontend consume these data endpoints via REST interfaces to visualize dynamic risk maps and generate localized road safety alerts.
The orchestration architecture depicted in Figure 3 ensures seamless coordination between distributed edge resources and centralized cloud services. OpenNebula acts as the primary orchestration platform responsible for virtual machine provisioning, resource allocation, and multi-site management, while Docker and Docker Compose provide a standardized containerization environment for microservices, databases, and AI models.
To ensure scalability and resilience, Kubernetes/K3s manages distributed workloads through automatic service discovery, load balancing, self-healing mechanisms, and dynamic workload migration across edge locations. GPU-enabled AI services are supported via the NVIDIA Container Runtime, exposing CUDA resources to containerized inference and machine learning applications.
Persistent storage requirements are addressed using Longhorn distributed block storage, which provides checkpoint persistence, model replication, and fault-tolerant storage synchronization across edge nodes. Secure communication between infrastructure components is established through WireGuard VPN tunnels and the Cilium networking layer, leveraging eBPF-based traffic observability, network policy enforcement, and encrypted inter-node communication.
As illustrated in Figure 3, the centralized cloud infrastructure located in Quito performs global aggregation, workflow coordination, infrastructure monitoring, and periodic model deployment. This hybrid edge–cloud architecture enables efficient lifecycle management of distributed machine learning workflows, directly supporting the Modeling and Evaluation phases of the CRISP-DM methodology.

3.2.4. Layer 4: Edge AI Server—Federated Learning Layer

The artificial intelligence layer constitutes the core learning component of the proposed architecture. It is responsible for distributed model training, privacy-preserving knowledge aggregation, and nationwide intelligence generation using Federated Learning (FL). As summarized in Table 4, the federated training process is configured to maximize spatial coverage while preserving data locality across all Ecuadorian provinces. Furthermore, Table 5 presents the benchmarked and prospective predictive models considered within the learning ecosystem. The complete federated learning workflow is illustrated in Figure 4, highlighting the interaction among provincial clients, the GPU-accelerated aggregation server, and the model intelligence ecosystem.
The deployment utilizes the NVIDIA Jetson Orin NX (16 GB, featuring 1024 CUDA cores, 32 Tensor cores, and 100 TOPS) mounted on a Seeed Studio reComputer J401 NX carrier board, supported by a 512 GB NVMe SSD and a 500 VA UPS. Regarding the software frameworks, the environment is powered by TensorFlow 2.15, PyTorch 2.1, Flower FL 1.6, NVIDIA CUDA 12.2, and cuDNN 8.9.
The global aggregation algorithm follows the formulation of McMahan et al. [29]:
w t + 1 = k = 1 K n k n w t k
where:
  • K = 24 (number of provinces/clients).
  • n k = number of samples (historical accident records) in province k.
  • n = k = 1 K n k = 27,620 (total processed records).
  • w t k = local model weights at round t for client k.
  • w t + 1 = aggregated global model weights.
As illustrated in Figure 4, the federated training architecture preserves data privacy by ensuring that raw provincial datasets never leave their local repositories. Instead, only model updates are transmitted to the central aggregation server through secure communication channels. This strategy enables collaborative model optimization while maintaining the decentralized nature of the underlying traffic and environmental datasets.
The federated training configuration detailed in Table 4 is structured to ensure swift algorithmic convergence while preserving the decentralized nature of the spatial data across all 24 Ecuadorian provinces. By engaging 100% of the clients ( 24 / 24 ) in each of the R = 20 planned communication rounds, the architecture successfully simulates a centralized coordination that maximizes spatial coverage. Operationally, each provincial client executes E = 10 local epochs to complete the training cycle of its GradientBoostingRegressor before transmission.
The global server then applies the standard FedAvg algorithm, weighting local model updates by their proportional sample size ( n k / n ). As shown in Figure 4, convergence was achieved rapidly, with the Mean Absolute Error (MAE) reaching 0.8366 during the first communication round and stabilizing at 0.8371 by round 3, successfully satisfying the target threshold of MAE < 0.84 .
The model ecosystem summarized in Table 5 combines validated traditional machine learning approaches, spatiotemporal graph-based models, and future deep learning extensions. Within the CRISP-DM framework, Layer 4 supports the Modeling and Evaluation phases by enabling distributed training, global optimization, model benchmarking, and continuous improvement of predictive performance across the nationwide intelligent transportation network.

3.2.5. Layer 5: Analytics Infrastructure and Platform Layer

The analytics and visualization layer constitutes the final stage of the proposed architecture, transforming telemetry streams, federated learning outputs, and geospatial information into actionable intelligence for transportation authorities. As summarized in Table 6, the software ecosystem integrates real-time messaging services, backend APIs, geospatial and time-series databases, analytics engines, and interactive visualization platforms. The complete analytics workflow is illustrated in Figure 5, highlighting the flow of information from telemetry ingestion to decision-support services.
The software architecture of Layer 5 establishes the core analytics, data management, and visualization ecosystem of the system. Ingestion and backend services rely on a Mosquitto MQTT broker for real-time telemetry processing, decoupled via a FastAPI backend protected by an NGINX reverse proxy. Data persistence is optimized through a dual-database approach, utilizing PostgreSQL with PostGIS extensions for advanced geospatial querying alongside InfluxDB for high-throughput climate time-series storage. Finally, the visualization tier integrates an interactive frontend web platform built on React, Next.js, and Leaflet, complemented by Grafana dashboards to deliver real-time risk maps and predictive metrics panels tailored for transit authorities.
As illustrated in Figure 5, telemetry generated by the distributed sensing infrastructure and predictive outputs produced by the federated learning layer are continuously ingested through the MQTT broker and processed by backend microservices. The FastAPI framework exposes secure REST interfaces for predictions, alerts, and analytics services, while NGINX provides access control, SSL termination, and traffic management functionalities.
The data persistence layer combines PostgreSQL/PostGIS and InfluxDB to support both spatial and temporal analytics. PostgreSQL, enhanced with PostGIS extensions, enables advanced geospatial operations such as proximity analysis, route intersection detection, and risk hotspot identification. In parallel, InfluxDB stores high-frequency environmental telemetry, facilitating efficient time-series analytics and historical trend evaluation.
The analytics subsystem integrates predictive models, geospatial intelligence mechanisms, anomaly detection algorithms, and risk assessment services. These outputs are subsequently delivered to visualization platforms through Grafana dashboards and a web-based interface implemented using React, Next.js, and Leaflet. As shown in Figure 5, the platform provides real-time risk maps, predictive indicators, weather-risk overlays, and operational dashboards that support informed decision-making by transportation agencies and emergency response authorities.
Within the CRISP-DM methodology, Layer 5 supports the Evaluation and Deployment phases by operationalizing predictive results, enabling continuous monitoring, facilitating stakeholder interaction, and transforming analytical outputs into actionable decision-support services.

3.3. CRISP-DM Applied: Six Phases with Quantitative Results

Table 7 maps the entire lifecycle of the vehicle accident prediction system following the CRISP-DM methodology, detailing the core activities and quantitative outcomes of each phase. The process highlights the transition from exploratory analysis of 27,620 highly skewed historical records to effective data normalization ( λ = 0.3957 ) and the development of a 24-province adjacency matrix (A). Algorithmic evaluation demonstrates that while the centralized Stacking ensemble yields the highest predictive accuracy ( MAE = 0.4748 ), its final edge deployment on an NVIDIA Jetson Orin NX server successfully satisfies operational requirements by achieving a low simulation latency of just 78 ms.

3.4. Feature Engineering: Complete Set of 53 Features

Table 8 outlines the comprehensive set of 53 predictors engineered for the predictive model, organized into eight specialized structural dimensions. This taxonomy ranges from cyclical and lagged temporal encodings designed to capture complex seasonality and autocorrelated trends, to spatial variables and environmental telemetry. Together, these features provide a robust, multi-faceted dataset that ensures complete spatiotemporal coverage of the targeted traffic incident dynamics.
Box–Cox Transformation Applied:
y ( λ ) = y λ 1 λ , λ 0 ln ( y ) , λ = 0
With λ = 0.3957 (estimated via maximum likelihood), the transformation reduced skewness from 7.8856 to 0.2043 (97.4% improvement) and kurtosis from 84.3924 to −1.1292 (101.3% improvement).
Adjacency Matrix Construction:
  • A R 24 × 24 where A i j = 1 if provinces i and j share a border, otherwise A i j = 0 , normalized by the degree matrix for ST-GCN implementation.

3.5. Hyperparameter Configuration

The hyperparameter settings used for the evaluated machine learning models and the FedAvg federated learning algorithm are summarized in Table 9. These configurations were selected based on recommendations from the literature and preliminary experimental tuning to ensure a fair comparison among the evaluated approaches.
LSTM, GRU, Temporal Transformer, GNN, and ConvLSTM models were considered in the Layer 4 architectural design. However, their complete empirical evaluation was constrained by the available computational resources, as the estimated training time exceeded 72 h per model on the edge infrastructure employed in this study. Consequently, these architectures are proposed as future work.

3.6. Rigor Phase: Bidimensional Evaluation Framework

3.6.1. Dimension 1: Predictive Quality (Statistical Validation)

Metrics Employed:
MAE = 1 n i = 1 n | y i y ^ i |
RMSE = 1 n i = 1 n ( y i y ^ i ) 2
R 2 = 1 i = 1 n ( y i y ^ i ) 2 i = 1 n ( y i y ¯ ) 2
To ensure the robustness, reliability, and interpretability of the proposed predictive framework, a comprehensive validation strategy was implemented. As summarized in Table 10, the evaluation framework combines temporal cross-validation, bootstrap resampling, residual analysis, and SHAP-based explainability techniques. These procedures were designed to assess model generalization, quantify uncertainty, verify statistical assumptions, and identify the most influential predictor variables.
The predictive performance of the centralized and federated learning approaches is summarized in Table 11. Six complementary evaluation metrics were employed, including MAE, RMSE, R 2 , SMAPE, and MASE, to provide a comprehensive assessment of prediction accuracy and model fit. The results indicate that the centralized Stacking ensemble achieved the highest predictive performance ( R 2 = 0.2460 ), followed by LightGBM and XGBoost. In contrast, the federated Gradient Boosting model exhibited a noticeable reduction in performance under the non-IID data distribution scenario, resulting in a slightly negative coefficient of determination. Furthermore, bootstrap-based 95% confidence intervals for R 2 revealed greater stability for the centralized Stacking model (interval width = 0.0925), whereas the confidence interval of the federated model crossed zero, indicating higher uncertainty and reduced predictive reliability.
  • Bootstrap Confidence Intervals (500 iterations, 95% CI) for R 2 :
    • Centralized Stacking: 95% CI [ 0.1918 , 0.2843 ] (width = 0.0925).
    • Federated GradientBoosting: 95% CI [ 0.0971 , 0.0046 ] (width = 0.0925).
  • Performance Loss due to Federated Learning.
The federated model increased the MAE by 14.51%, from 0.4748 to 0.5920. Likewise, the coefficient of determination ( R 2 ) decreased by 17.49 percentage points, from 0.2460 to 0.0046 .
  • Convergence Analysis (FedAvg).
The FedAvg algorithm converged rapidly, stabilizing after the third communication round with an MAE of 0.8371. The difference between the first and the twentieth communication rounds was less than 0.001 MAE, indicating stable convergence.
  • Hypothesis Testing.
The null hypothesis ( H 0 ), which states that there is no statistically significant difference between the centralized and federated models, was rejected. The decision is supported by the fact that the 95% bootstrap confidence intervals for R 2 do not overlap and the MAE difference (0.1172) exceeds the predefined practical significance threshold of 0.05.

3.6.2. Dimension 2: Operational Viability

The key performance indicators and empirical results regarding the system’s operational constraints are summarized in Table 12. This evaluation encompasses critical edge-computing metrics, including communication overhead and energy efficiency under realistic deployment scenarios.

3.7. Use of Artificial Intelligence for Visual Content Generation

To visually represent the complex, multi-layered cyber–physical architecture proposed in this study, schematic diagrams were generated with the assistance of a Generative AI tool. The objective was to produce clear, high-level conceptual illustrations that could effectively communicate the structure and data flow of the system to a broad audience, complementing the detailed textual descriptions provided in the methodology.
Specifically, the Gemini 1.5 Pro large language model, accessed via the Google AI Studio web interface, was employed to generate the schematic illustrations for the five architectural layers presented in this study:
  • Layer 1 (IoT and TinyML Edge Layer), corresponding to the intelligent edge node.
  • Layer 2 (LoRaWAN Communication Layer).
  • Layer 3 (Edge–Cloud Orchestration Layer).
  • Layer 4 (Federated Learning Layer).
  • Layer 5 (Analytics and Visualization Layer).
The AI-generated initial drafts, which were then iteratively refined by the authors using additional prompts to correct inaccuracies, adjust the flow of information, and ensure the diagrams faithfully represented the intended architecture. Finally, the resulting AI-generated drafts were manually edited and reformatted using standard graphic design software to achieve the final polished figures. No other AI tools were used for any other purpose in the preparation of this work, such as data analysis, writing, or editing. The authors assume full responsibility for the accuracy and final presentation of all visual content.

4. Results

4.1. Experimental Architecture and Dataset Coverage

The proposed Federated Edge Intelligence architecture integrates IoT technologies, LoRaWAN communications, Edge Computing, Federated Learning, and geospatial analytics for the spatiotemporal prediction of weather-sensitive traffic accidents. The infrastructure is organized into five functional layers, including distributed data acquisition, LoRaWAN wireless communications, edge–cloud orchestration, federated model training, and an analytics layer for visualization and decision support.
The spatial and temporal coverage of the dataset employed in this study is summarized in Table 13. The dataset provides complete nationwide coverage across the 24 provinces of Ecuador and spans the period from January 2014 to December 2025. Following the processes of data integration, cleaning, feature engineering, and sequence generation, a total of 27,620 valid records and 27,596 time-series sequences were obtained for model development and evaluation.
As shown in Table 13, the resulting dataset combines extensive spatial coverage with a long-term temporal horizon, enabling the characterization of heterogeneous climatic, geographic, and transportation conditions throughout Ecuador. This comprehensive coverage supports the development of robust predictive models and facilitates the evaluation of federated learning strategies under realistic nationwide deployment scenarios.

4.2. Transformation and Normalization of the Target Variable

Exploratory data analysis revealed a highly skewed distribution of the target variable, characterized by a heavy concentration of observations at low values and a long positive tail. This behavior can jeopardize the stability of numerous predictive algorithms due to the presence of extreme values.
To address this issue, a Box–Cox transformation was applied. The visual impact of this mathematical adjustment on the data profile is illustrated in Figure 6, which contrasts the raw records against the normalized outcomes.
The original distribution exhibits extremely high skewness and a kurtosis associated with high-magnitude outliers. After the transformation, a considerably more balanced distribution that is close to an approximately symmetric shape is observed. The precise statistical shifts resulting from this transformation, including changes in asymmetry and tail heaviness, are quantified in Table 14.
The empirical results demonstrate a reduction in skewness from 7.89 down to 0.20, while the kurtosis decreased from 84.39 to −1.13. These improvements indicate a significant stabilization of the distribution, which directly benefits the subsequent training and generalization of the predictive models.

4.3. Evaluation of Traditional Statistical Models

As a baseline, three widely used models in time-series forecasting were implemented: ARIMA (AutoRegressive Integrated Moving Average) [30], SARIMA (Seasonal ARIMA) [31], and Prophet [32]. The quantitative performance metrics for each baseline configuration are summarized in Table 15, providing a standardized benchmark for the subsequent machine learning architectures. Additionally, the temporal alignment and predictive trends of these traditional methods against the ground truth observations are visualized in Figure 7.
Among the evaluated methods, SARIMA achieved the best performance, reducing the MAE by approximately 31.4% compared to ARIMA and 63.4% compared to Prophet. However, all models exhibited negative R 2 values, indicating a limited capacity to explain the variability present in traffic accidents influenced by complex spatial and climatic factors.

4.4. Spatial Modeling via Graphs

To explicitly incorporate spatial relationships between provinces, a weighted adjacency matrix was constructed and subsequently utilized by the ST-GCN neural network. A representative snippet of this topological configuration, which quantifies the interconnectedness between distinct geographic regions, is detailed in Table 16.
The matrix models spatial dependencies through normalized weights that reflect varying degrees of geographic connectivity. Each node represents an Ecuadorian province, and each edge represents a spatial relationship used during information propagation within the graph neural network.
The resulting structure enabled an explicit representation of the spatial interactions within the national road network, providing the mathematical foundation necessary for spatiotemporal learning.

4.5. Evaluation via Time-Series Cross-Validation

To guarantee a robust evaluation, a Time-Series Cross-Validation strategy was applied, thereby preserving the temporal order of the observations and preventing data leakage. The consolidated statistical metrics computed across all validation folds are presented in Table 17, offering a direct comparison of performance and generalization capability among the machine learning models. Concurrently, the empirical error distribution and the dispersion of the coefficient of determination across the temporal splits are visualized via boxplots in Figure 8.
The Stacking model achieved the best overall performance, reaching an MAE of 0.4748 and an R 2 of 0.2460. Compared to Random Forest, the mean absolute error was reduced by approximately 5.6%, while the explanatory power increased by nearly 22%. LightGBM positioned itself as the second-best model, showing a minimal difference with respect to the final ensemble.
Furthermore, the boxplots demonstrate a relatively small dispersion across temporal splits, indicating stability during the training and validation processes.

4.6. Statistical Robustness via Bootstrap

To evaluate the stability of the empirical results and quantify the uncertainty of the performance estimators, Bootstrap resampling with 95% confidence intervals was applied. The aggregated coefficients of determination alongside their respective lower and upper bounds for each architecture are summarized in Table 18.
The obtained intervals exhibit widths of less than 0.10 for all evaluated models, suggesting adequate statistical stability and low sensitivity to variations in the training samples.

4.7. Federated Learning Convergence

The distributed learning process was implemented using the FedAvg algorithm over twenty federated rounds. The trajectory of model synchronization and the reduction of prediction error across epochs are illustrated in Figure 9, highlighting the stability of the global aggregation mechanism. Furthermore, the exact error metrics corresponding to strategic checkpoints throughout this optimization process are detailed in Table 19.
The observed convergence shows a rapid stabilization of the global parameters. After the third federated round, variations in the average MAE are virtually negligible.
The absolute difference between the first and last rounds was less than 0.001 units, demonstrating a rapid stabilization of the federated aggregation process.

4.8. Comparison Between Centralized and Federated Learning

The final evaluation involved a direct comparison between the centralized and federated schemes. The quantitative performance metrics compiled for both learning paradigms are structured in Table 20, allowing for an objective assessment of accuracy trade-offs. Concurrently, a graphical representation contrasting these benchmark results across all evaluated dimensions is provided in Figure 10.
The results show that the centralized scheme achieved better values across all evaluated metrics. The MAE increased by approximately 24.7% under the federated scheme (from 0.4748 to 0.5920), while the R2 coefficient dropped from 0.2460 to −0.0046. These differences highlight the impact of decentralization on the predictive capacity of the model.

4.9. Residual Analysis

A comprehensive statistical analysis of the prediction errors generated by both models was performed. The descriptive metrics evaluating the distribution, variance, and normality of these error terms are structured in Table 21. Concurrently, the behavior of the residuals, including their density distribution, theoretical alignment, and homoscedasticity, is visually diagnosed through histograms, Q–Q plots, and scatter plots in Figure 11.
The histograms display errors centered around zero, whereas the Q–Q plots reveal deviations from theoretical normality, particularly at the tails of the distribution. The centralized model exhibits lower residual dispersion and a distribution closer to normality compared to the federated model.

4.10. Interpretability via SHAP

To analyze the individual contribution and the marginal effects of the predictor variables on the model’s outputs, SHAP (SHapley Additive exPlanations) was applied. The global feature importance ranking, ordered by the mean absolute SHAP values, is illustrated in Figure 12, providing a transparent look into the underlying decision-making process of the architecture.
The variables Feature_1222, Feature_1256, Feature_1221, and Feature_1169 present the highest mean absolute SHAP values, establishing themselves as the factors with the greatest influence on the predictions generated by the model.
Furthermore, a marked concentration of importance is observed in the top variables, indicating that a small subset of features explains a large portion of the system’s predictive capacity.

4.11. Comparison Between Predictions and Observed Values

The goodness-of-fit of the models was evaluated through a direct comparison between actual values and predictions. As shown in Figure 13, the centralized model exhibits predictions that are more closely aligned with the observed values than the federated model.
Figure 13 shows that the scatter plot corresponding to the centralized model presents a closer proximity to the ideal perfect-prediction diagonal. Conversely, the federated predictions exhibit a tighter concentration within intermediate ranges, demonstrating a reduced ability to adequately represent extreme values.

4.12. Global Summary of Results

Finally, Table 22 synthesizes the principal findings obtained during the experimental evaluation, highlighting the best-performing statistical, machine learning, and federated learning approaches. The results indicate that the Stacking ensemble achieved the highest predictive performance among the evaluated machine learning models, while the federated learning implementation demonstrated the feasibility of privacy-preserving distributed training across the 24 Ecuadorian provinces.
Figure 14 presents the complete end-to-end architecture developed in this study. The architecture integrates five complementary layers: (i) TinyML-enabled environmental sensing at the edge, (ii) secure LoRaWAN communications, (iii) edge–cloud orchestration and distributed infrastructure management, (iv) privacy-preserving federated learning for nationwide model training, and (v) analytics and decision-support services. Together, these layers establish a scalable and resilient ecosystem capable of transforming heterogeneous environmental and traffic data into actionable intelligence for road safety management.
The comprehensive evaluation enabled the comparison of statistical approaches, machine learning algorithms, spatiotemporal models, and federated learning strategies under a common experimental framework. As summarized in Table 22 and operationalized through the architecture depicted in Figure 14, the proposed system provides a complete technological pipeline spanning data acquisition, communication, distributed processing, collaborative model training, and intelligent decision support. These results demonstrate the feasibility of deploying an integrated edge-to-cloud intelligence framework for large-scale environmental monitoring and transportation risk prediction.

4.13. Empirical Validation and Pilot Deployment Results

While the preceding results were derived from a simulation environment designed to replicate the conditions of rural Ecuador, we have initiated a pilot deployment to empirically validate the system’s operational resilience. Three edge nodes equipped with the ESP32-S3 and environmental sensors were installed along the E35 highway in the Tungurahua province, a region characterized by high altitude (2800 m a.s.l.), frequent dense fog, and variable cellular coverage. This location represents one of the harshest operational conditions for the system, combining a tropical Andean climate with challenging topography.
Preliminary empirical findings from this ongoing 60-day deployment are as follows:
  • Environmental Resilience: The IP65-enclosed nodes successfully withstood temperature fluctuations ranging from 2  °C to 28 °C, high humidity levels (>90% RH), and intense precipitation events without hardware failure. The IP65 rating with silicone gaskets proved effective against moisture ingress, maintaining internal component integrity throughout the trial period.
  • Communication Reliability: Despite the mountainous terrain with significant line-of-sight obstructions, the LoRaWAN gateway maintained a reliable connection to the edge nodes at distances up to 8.2 km, with an average packet delivery rate of 98.4% under clear conditions and 94.7 % during dense fog events (visibility < 50  m). The adaptive spreading factor mechanism (SF7–SF12) effectively compensated for SNR variations, maintaining stable connectivity even during adverse weather conditions.
  • Power System Validation: The 18650 battery (3400 mAh) and 5W solar panel subsystem provided continuous power to the nodes, maintaining the battery charge above 72 % throughout the 60-day trial. The TP4056 charge controller effectively managed the charging cycles, preventing deep discharge even during extended periods of overcast conditions (≥72 h).
  • Maintenance Requirements: Operational logs indicate that cleaning the environmental sensor apertures (BME280, YL-83 rain sensor, and fog sensor lenses) is required every 14–21 days to prevent dust accumulation, insect intrusion, and moisture condensation. This practical maintenance requirement, identified through empirical observation, will inform future hardware design improvements, including the integration of automated sensor cleaning mechanisms or protective enclosures with forced air circulation.
  • System Latency: End-to-end latency from sensor capture to alert generation measured in the pilot deployment averaged 92 ms, which, while slightly higher than the 78 ms measured in laboratory conditions, remains well below the 200 ms safety threshold required for real-time safety applications.
This ongoing empirical evaluation confirms the system’s functional viability in a real-world, harsh Andean environment and provides crucial operational data for improving the system’s long-term reliability, maintenance protocols, and hardware durability. The findings highlight that while the core technology is robust, practical deployment requires consideration of scheduled maintenance, hardware protection, and environmental adaptation strategies.

5. Discussion

This study’s principal innovation is the successful integration and validation of a TinyML and Federated Learning pipeline that operates effectively within the severe constraints of rural road networks. This architectural design is necessary to overcome fundamental challenges of limited bandwidth, high latency, and data privacy, constituting a novel contribution to the field of intelligent transportation systems. The results obtained demonstrate that this integrated approach constitutes a feasible solution for climate-aware road accident prediction in geographically heterogeneous environments. The proposed architecture successfully addressed the four operational requirements identified during the design phase, namely low latency, privacy preservation, operation under constrained communication conditions, and nationwide scalability. These findings support the growing body of evidence indicating that distributed intelligence architectures can effectively complement conventional cloud-centric transportation systems [33].
A first relevant finding concerns the effectiveness of the data preprocessing strategy. The Box–Cox transformation substantially reduced skewness from 7.8856 to 0.2043 and kurtosis from 84.3924 to 1.1292 , improving the statistical properties of the target variable and facilitating model learning. Similar improvements have been reported in transportation forecasting studies where highly skewed accident distributions negatively affected predictive performance [34,35]. The reduction in distribution asymmetry likely contributed to the stability observed during cross-validation and bootstrap analyses.
Regarding predictive performance, the Stacking ensemble achieved the best overall results ( R 2 = 0.2460 and MAE = 0.4748 on the Box–Cox scale), outperforming individual tree-based models such as LightGBM, XGBoost, and Random Forest. These results are consistent with previous studies showing that ensemble learning techniques often outperform standalone algorithms when modeling complex interactions among climatic, spatial, and temporal variables [36,37]. The superior performance of Stacking suggests that combining heterogeneous learners provides a more robust representation of accident-generating mechanisms than any individual model.
Interestingly, the ST-GCN model did not outperform traditional machine learning approaches, achieving a negative coefficient of determination ( R 2 = 0.2271 ). Although graph neural networks have shown promising results in urban traffic forecasting [38], their effectiveness depends heavily on the availability of dense spatial interactions and large-scale temporal observations. In the Ecuadorian context, the adjacency matrix constructed from provincial borders may not fully capture the complex mobility dynamics influencing accident occurrence. This observation highlights an important challenge in applying graph-based learning methods to sparse or geographically aggregated transportation datasets.
The comparison between centralized and federated learning revealed a measurable performance trade-off. While the centralized Stacking model achieved the highest predictive accuracy, the federated Gradient Boosting implementation experienced a 14.51 % increase in MAE and a reduction of 17.49 percentage points in R 2 . This behavior is expected under non-IID data distributions, a common limitation reported in federated learning literature [39,40]. The substantial climatic, geographic, and socio-economic differences among Ecuadorian provinces introduce statistical heterogeneity that violates the assumptions underlying standard FedAvg aggregation. Similar performance degradation has been documented in distributed transportation and mobility applications where local data distributions differ significantly across regions [41].
While this performance gap between the centralized and federated models is significant, it is crucial to interpret these results within the context of the system’s operational constraints. The primary objective of the federated approach is not to match the absolute statistical accuracy of a centralized model—which benefits from unrestricted access to a complete, non-private dataset—but to provide a privacy-preserving and operationally feasible solution in connectivity-constrained environments. The federated architecture successfully enables collaborative learning without exposing sensitive provincial accident data, fulfilling strict requirements of both international regulations and Ecuadorian data protection law (LOPD). Therefore, the measurable increase in MAE ( 14.51 % ) is considered an acceptable and justifiable trade-off for achieving data sovereignty and real-time edge inference in these regions. This balance between privacy and utility aligns with findings in recent federated learning literature applied to intelligent transportation systems [42,43].
Despite this reduction in predictive performance, federated learning provided important privacy and governance advantages. By transmitting only model updates rather than raw accident records, the architecture complies with privacy-preserving principles established by international regulations and Ecuadorian data protection legislation [44]. This characteristic becomes particularly relevant in intelligent transportation systems where location traces, driver behavior profiles, and mobility patterns may reveal highly sensitive information. Consequently, the moderate decrease in predictive performance may represent an acceptable trade-off in scenarios where privacy protection is a primary requirement.
Another noteworthy result is the rapid convergence achieved by the FedAvg process. The average MAE stabilized after only three communication rounds, with negligible variations during the remaining training iterations. This behavior suggests that the selected feature space and the GradientBoostingRegressor model generated sufficiently informative updates to enable efficient global optimization. Similar convergence characteristics have been reported in low-dimensional federated learning scenarios with structured tabular datasets [45]. From an operational perspective, rapid convergence reduces communication overhead and energy consumption, which is particularly important in LPWAN environments with limited bandwidth.
The operational evaluation also confirmed the suitability of the proposed architecture for deployment in rural environments. The measured inference latency of 78 ms remained well below the 200 ms threshold required for real-time safety applications, supporting previous findings that Edge Intelligence can substantially reduce the delays associated with cloud-only processing [46,47]. Furthermore, the architecture demonstrated compatibility with LoRaWAN constraints, maintaining payload sizes below the network limitations while preserving reliable communication across long distances. These results reinforce the notion that local intelligence is not merely advantageous but essential for transportation monitoring applications operating under intermittent connectivity conditions [48,49].
The nationwide coverage of the dataset represents another significant contribution. Unlike many previous studies restricted to specific urban corridors or metropolitan regions, this work incorporates data from all 24 provinces of Ecuador over a twelve-year period. Such extensive spatial and temporal coverage increases the ecological validity of the results and enables the evaluation of predictive models under highly diverse climatic conditions. The inclusion of coastal, Andean, Amazonian, and insular environments provides a unique testbed for assessing climate-aware transportation intelligence systems [50].
From a practical perspective, the proposed five-layer architecture establishes a complete technological pipeline capable of transforming raw environmental observations into actionable intelligence. The integration of TinyML-enabled sensing, LoRaWAN networking, edge–cloud orchestration, federated learning, and geospatial analytics demonstrates how emerging technologies can be combined to support intelligent transportation management in developing regions. This contribution extends existing research that typically focuses on isolated components rather than comprehensive cyber–physical ecosystems [51,52].
Nevertheless, several limitations must be acknowledged. A significant limitation of this study was the inability to empirically evaluate advanced deep-learning architectures (LSTM, GRU, Temporal Transformers, GNNs) due to computational constraints, where the estimated training time for a single model exceeded 72 h on the available edge infrastructure (NVIDIA Jetson Orin NX). To overcome these bottlenecks, future work will investigate aggressive model pruning techniques, quantization (e.g., 8-bit integer quantization using TensorFlow Lite), and the potential for upgrading to higher-performance edge nodes, such as the NVIDIA Jetson AGX Orin (275 TOPS), to enable the training and deployment of these more complex models at the edge. Second, the federated learning implementation relied exclusively on FedAvg, which is known to be sensitive to non-IID distributions. More advanced aggregation strategies, such as FedProx, FedNova, or personalized federated learning approaches, may reduce the observed performance gap [53]. Third, the current deployment was validated through simulation and experimental infrastructure rather than a long-term nationwide field deployment, leaving open questions regarding long-term reliability, maintenance requirements, and environmental durability.
Future research should therefore focus on three complementary directions:
  • The evaluation of advanced spatiotemporal architectures capable of jointly modeling climate variability, spatial dependencies, and temporal evolution.
  • The incorporation of privacy-enhancing technologies such as differential privacy, secure aggregation, and homomorphic encryption to further strengthen data protection guarantees.
  • Large-scale pilot deployments involving transportation authorities and emergency response agencies to evaluate the operational impact of predictive alerts under real-world conditions.
Overall, the findings demonstrate that Federated Edge Intelligence represents a promising paradigm for intelligent transportation systems operating in geographically dispersed and connectivity-constrained environments. Although centralized learning continues to provide superior predictive accuracy, the federated approach offers significant advantages in terms of privacy preservation, scalability, and distributed operation, making it a viable foundation for future climate-aware road safety infrastructures.

6. Conclusions

This study successfully developed, implemented, and evaluated a comprehensive five-layer cyber–physical architecture integrating IoT sensing, TinyML edge computing, LoRaWAN networks, edge–cloud orchestration, and Federated Learning for nationwide, climate-aware road accident prediction across the geographically diverse regions of Ecuador. The empirical findings validate that distributed intelligence frameworks can effectively balance the trade-offs between predictive accuracy, localized data sovereignty, communication constraints, and real-time operational efficiency.
The primary contributions and insights derived from this research are consolidated as follows:
  • Operational Feasibility at the Edge: The integration of TinyML within low-cost ESP32-S3 microcontrollers demonstrated that local preprocessing and inference are highly viable for harsh environments. With a measured edge inference latency of only 78 ms —well below the critical 200 ms safety threshold—and efficient delta compression, the system proved capable of transforming raw environmental variables into real-time risk factors without oversaturating constrained LPWAN links.
  • Algorithmic Performance and Heterogeneity: While the centralized Stacking ensemble achieved the highest overall predictive performance ( R 2 = 0.2460 , MAE = 0.4748 ), the federated Gradient Boosting model established an acceptable trade-off, with a 14.51 % increase in MAE. This margin represents a justifiable cost when balanced against the complete preservation of raw data privacy, directly aligning with international regulations and Ecuadorian data protection laws. Conversely, the poor performance of the ST-GCN network ( R 2 = 0.2271 ) reveals that standard grid-adjacency modeling remains a major challenge when dealing with spatially sparse or aggregated transport infrastructure datasets.
  • Network and Optimization Efficiency: The deployment of the FedAvg aggregation algorithm exhibited robust and rapid convergence, stabilizing the global mean absolute error after only three communication rounds. This rapid stabilization minimizes energy consumption and data overhead, demonstrating that structured tabular features can achieve high optimization efficiency even under the low-bandwidth constraints of LoRaWAN telemetry.
In conclusion, while centralized machine learning models continue to offer marginal advantages in pure statistical accuracy, the Federated Edge Intelligence paradigm represents a more resilient, scalable, and privacy-preserving foundation for next-generation intelligent transportation networks. Future lines of work will actively focus on evaluating personalized federated learning strategies (such as FedProx) to mitigate the statistical effects of non-IID data distributions across heterogeneous provinces, alongside investigating model compression techniques (pruning and quantization) and higher-performance edge hardware to enable the empirical evaluation of advanced spatiotemporal architectures (LSTMs, Temporal Transformers, GNNs).

Author Contributions

Investigation, W.C.; Methodology, N.E.; Project administration, E.S.; Conceptualization, L.T. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

All data, source code, and artifacts related to the predictive models developed in this study are publicly available and structured in the Zenodo repository at https://doi.org/10.5281/zenodo.20682901. This repository contains the complete processed datasets, execution scripts, reproducibility documentation, and supplementary resources necessary for the development and verification of the spatiotemporal models.

Acknowledgments

We express our sincere gratitude to Wilson Chango from PUCE Esmeraldas for his invaluable technical assistance and guidance in configuring the sensor systems and data acquisition processes for this research. This study was supported by PUCE Esmeraldas. Additionally, we acknowledge the facilities and general support provided by the Department of Computer Sciences, which greatly contributed to the successful completion of this work. During the preparation of this manuscript, the author(s) utilized Gemini (version 1.5 Pro, via the Google AI Studio web interface) for the purpose of generating schematic diagrams of the five-layer architecture. The authors have reviewed and edited the output and assume full responsibility for the content of this publication.

Conflicts of Interest

The authors declare that they have no conflicts of interest related to this article.

References

  1. Graf, M.; Steinhauser, D.; Vaculín, O.; Brandmeier, T. Impact of Adverse Weather on Road Safety: A Survey of Test Methods for Enhancing Safety of Automated Vehicles and Sensor Robustness in Challenging Environmental Conditions. IEEE Access 2025, 13, 179817–179838. [Google Scholar] [CrossRef] [Scilit]
  2. Sadeghi, P.; Goli, A. Investigating the impact of pavement condition and weather characteristics on road accidents (Review paper). Int. J. Crashworthiness 2024, 29, 973–989. [Google Scholar] [CrossRef] [Scilit]
  3. Ball, L.; Tzanopoulos, J. Interplay between topography, fog and vegetation in the central South Arabian mountains revealed using a novel Landsat fog detection technique. Remote Sens. Ecol. Conserv. 2020, 6, 498–513. [Google Scholar] [CrossRef] [Scilit]
  4. Chen, Y.Y.; Hung, Y.T.; Cheng, C.T.; Tsai, I.C. Asymmetric East-West Changes in Mountain Fog Driven by Urbanization and Climate Warming. J. Geophys. Res. Atmos. 2025, 130, e2025JD044293. [Google Scholar] [CrossRef] [Scilit]
  5. Xu, C.; Sankar, R. A Comprehensive Review of Autonomous Driving Algorithms: Tackling Adverse Weather Conditions, Unpredictable Traffic Violations, Blind Spot Monitoring, and Emergency Maneuvers. Algorithms 2024, 17, 526. [Google Scholar] [CrossRef] [Scilit]
  6. Le Guenedal, T.; Tilly, S. SERENA: System for Evaluating Risks and Extreme Natural Activities on Agriculture and Application to World Economies. SSRN Electron. J. 2025. [Google Scholar] [CrossRef] [Scilit]
  7. Soica, A.; Gheorghe, C. Tire–Road Interaction: A Comprehensive Review of Friction Mechanisms, Influencing Factors, and Future Challenges. Machines 2025, 13, 1005. [Google Scholar] [CrossRef] [Scilit]
  8. Hu, Y.; Zhou, W.; Miao, H. Driver Behavior-Driven Evacuation Strategy with Dynamic Risk Propagation Modeling for Road Disruption Incidents. Eng 2025, 6, 173. [Google Scholar] [CrossRef] [Scilit]
  9. Kopczewska, K. Modelling Spatial Density: Data, Methods, and R Applications in Statistics, Econometrics, and Machine Learning; Oxford Academic: Oxford, UK, 2025; p. 307. [Google Scholar]
  10. Zhang, J.; Sha, J.; Zhang, C.; Zhang, Y. A CNN-LSTM-GRU Hybrid Model for Spatiotemporal Highway Traffic Flow Prediction. Systems 2025, 13, 765. [Google Scholar] [CrossRef] [Scilit]
  11. Alnowaiser, K. A Computational Intelligence GNN–LSTM Framework for Spatiotemporal Prediction of Traffic Accident Severity in Smart Cities Using SHAP XAI. Int. J. Comput. Intell. Syst. 2025, 18, 271. [Google Scholar] [CrossRef] [Scilit]
  12. Liu, J.; Du, Y.; Yang, K.; Wu, J.; Wang, Y.; Hu, X.; Wang, Z.; Liu, Y.; Sun, P.; Boukerche, A.; et al. Edge–Cloud Collaborative Computing on Distributed Intelligence and Model Optimization: A Survey. IEEE Commun. Surv. Tutor. 2026, 28, 5049–5080. [Google Scholar] [CrossRef] [Scilit]
  13. Shahnejat Bushehri, A.; Amirnia, A.; Belkhiri, A.; Keivanpour, S.; De Magalhaes, F.G.; Nicolescu, G. Deep Learning-Driven Anomaly Detection for Green IoT Edge Networks. IEEE Trans. Green Commun. Netw. 2024, 8, 498–513. [Google Scholar] [CrossRef] [Scilit]
  14. Islam, M.M. THE IMPACT OF DATA-DRIVEN WEB FRAMEWORKS ON PERFORMANCE AND SCALABILITY OF U.S. ENTERPRISE APPLICATIONS. Int. J. Bus. Econ. Insights 2025, 5, 523–558. [Google Scholar] [CrossRef] [Scilit]
  15. Zhu, Y.; Kang, N.; Cao, J.; Greenberg, A.; Lu, G.; Mahajan, R.; Maltz, D.; Yuan, L.; Zhang, M.; Zhao, B.Y.; et al. Packet-Level Telemetry in Large Datacenter Networks. Comput. Commun. Rev. 2015, 45, 479–491. [Google Scholar] [CrossRef] [Scilit]
  16. Draves, R.; Padhye, J.; Zill, B. Comparison of routing metrics for static multi-hop wireless networks. Comput. Commun. Rev. 2004, 34, 133–144. [Google Scholar] [CrossRef] [Scilit]
  17. Kamtam, S.B.; Lu, Q.; Bouali, F.; Haas, O.C.; Birrell, S. Network Latency in Teleoperation of Connected and Autonomous Vehicles: A Review of Trends, Challenges, and Mitigation Strategies. Sensors 2024, 24, 3957. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  18. Shakir, A.T.; Islam, M.S.; Mandeep, J.S.; Islam, M.T.; Abdullah, N.F.; Taher, Y.H.; Abdullahi, O.T.; Soliman, M.S. Systematic review of data exchange for road side unit in a vehicular ad hoc network: Coherent taxonomy, prominent features, datasets, metrics, performance measures, motivation, opportunities, challenges and methodological aspects. Discov. Appl. Sci. 2024, 6, 487. [Google Scholar] [CrossRef] [Scilit]
  19. Liu, J.; Wan, J.; Zeng, B.; Wang, Q.; Song, H.; Qiu, M. A scalable and quick-response software defined vehicular network assisted by mobile edge computing. IEEE Commun. Mag. 2017, 55, 94–100. [Google Scholar] [CrossRef] [Scilit]
  20. Koldasbayeva, D.; Tregubova, P.; Gasanov, M.; Zaytsev, A.; Petrovskaia, A.; Burnaev, E. Challenges in data-driven geospatial modeling for environmental research and practice. Nat. Commun. 2024, 15, 10700. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  21. Jiang, Y.; Ma, B.; Wang, X.; Yu, G.; Yu, P.; Wang, Z.; Ni, W.; Liu, R.P. Blockchained Federated Learning for Internet of Things: A Comprehensive Survey. ACM Comput. Surv. 2024, 56, 1–37. [Google Scholar] [CrossRef] [Scilit]
  22. Alqubaysi, T.; Asmari, A.F.A.; Alanazi, F.; Almutairi, A.; Armghan, A. Federated Learning-Based Predictive Traffic Management Using a Contained Privacy-Preserving Scheme for Autonomous Vehicles. Sensors 2025, 25, 1116. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  23. Imam-Fulani, Y.O.; Faruk, N.; Sowande, O.A.; Abdulkarim, A.; Alozie, E.; Usman, A.D.; Adewole, K.S.; Oloyede, A.A.; Chiroma, H.; Garba, S.; et al. 5G Frequency Standardization, Technologies, Channel Models, and Network Deployment: Advances, Challenges, and Future Directions. Sustainability 2023, 15, 5173. [Google Scholar] [CrossRef] [Scilit]
  24. Chapungo, N.J.; Postolache, O. Experimental Evaluation of LoRaWAN Connectivity Reliability in Remote Rural Areas of Mozambique. Sensors 2025, 25, 6027. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  25. Abdulaziz, M. A Comparative Evaluation of Multi-Channel Diversity and Random Linear Network Coding for Scalable LoRaWAN Under Duty-Cycle Constraints; SSRN: Rochester, NY, USA, 2026. [Google Scholar] [CrossRef] [Scilit]
  26. Somvanshi, S.; Islam, M.M.; Chhetri, G.; Chakraborty, R.; Mimi, M.S.; Shuvo, S.A.; Islam, K.S.; Javed, S.; Rafat, S.A.; Dutta, A.; et al. From Tiny Machine Learning to Tiny Deep Learning: A Survey. ACM Comput. Surv. 2026, 58, 1–33. [Google Scholar] [CrossRef] [Scilit]
  27. Chango, W.; Buñay, P.; Erazo, J.; Aguilar, P.; Sayago, J.; Flores, A.; Silva, G. Predicting Urban Traffic Congestion with VANET Data. Computation 2025, 13, 92. [Google Scholar] [CrossRef] [Scilit]
  28. Alkhanbouli, R.; Almadhaani, H.M.A.; Alhosani, F.; Simsekler, M.C.E. The role of explainable artificial intelligence in disease prediction: A systematic literature review and future research directions. BMC Med. Inform. Decis. Mak. 2025, 25, 110. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  29. Pfitzner, B.; Steckhan, N.; Arnrich, B. Federated Learning in a Medical Context: A Systematic Literature Review. ACM Trans. Internet Technol. 2021, 21, 1–31. [Google Scholar] [CrossRef] [Scilit]
  30. Lai, Y.; Dzombak, D.A.; Lai, Y.; Dzombak, D.A. Use of the Autoregressive Integrated Moving Average (ARIMA) Model to Forecast Near-Term Regional Temperature and Precipitation. Weather Forecast. 2020, 35, 959–976. [Google Scholar] [CrossRef] [Scilit]
  31. Rodríguez-López, L.; Usta, D.B.; Duran-Llacer, I.; Alvarez, L.B.; Yépez, S.; Bourrel, L.; Frappart, F.; Urrutia, R. Estimation of Water Quality Parameters through a Combination of Deep Learning and Remote Sensing Techniques in a Lake in Southern Chile. Remote Sens. 2023, 15, 4157. [Google Scholar] [CrossRef] [Scilit]
  32. Santos-Romero, M.A.; Sanabria, J.M.C.; Trinidad, J.A.A.; Alvarado, R.C.; Pinto, A.G. Extreme Rainfall Time Series Prediction: A Comparative Analysis of SARIMA, Random Forest, LSTM and Prophet Models. In Applications in Software Engineering—Proceedings of the 13th International Conference on Software Process Improvement, CIMPS 2024; IEEE: New York, NY, USA, 2024; pp. 364–371. [Google Scholar] [CrossRef] [Scilit]
  33. Myakala, P.K. Distributed Data Intelligence in the Edge-to-Cloud Continuum: A Survey of Architectures, Models, and Applications. In 2025 6th International Conference on Data Intelligence and Cognitive Informatics, ICDICI 2025; IEEE: New York, NY, USA, 2025; pp. 93–99. [Google Scholar] [CrossRef] [Scilit]
  34. Mostafa, A.M.; Aldughayfiq, B.; Tarek, M.; Alaerjan, A.S.; Allahem, H.; Elbashir, M.K.; Ezz, M.; Hamouda, E. AI-based prediction of traffic crash severity for improving road safety and transportation efficiency. Sci. Rep. 2025, 15, 27468. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  35. Ahmed, S.; Hossain, M.A.; Ray, S.K.; Bhuiyan, M.M.I.; Sabuj, S.R. A study on road accident prediction and contributing factors using explainable machine learning models: Analysis and performance. Transp. Res. Interdiscip. Perspect. 2023, 19, 100814. [Google Scholar] [CrossRef] [Scilit]
  36. Tırınk, S. Machine learning-based forecasting of air quality index under long-term environmental patterns: A comparative approach with XGBoost, LightGBM, and SVM. PLoS ONE 2025, 20, e0334252. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  37. Zounemat-Kermani, M.; Kheimi, M. Ensemble Boosting Methods for Surface Water Quality Modeling: A Review. Arch. Comput. Methods Eng. 2025, 33, 3983–4020. [Google Scholar] [CrossRef] [Scilit]
  38. Rahmani, S.; Baghbani, A.; Bouguila, N.; Patterson, Z. Graph Neural Networks for Intelligent Transportation Systems: A Survey. IEEE Trans. Intell. Transp. Syst. 2023, 24, 8846–8885. [Google Scholar] [CrossRef] [Scilit]
  39. Lu, Z.; Pan, H.; Dai, Y.; Si, X.; Zhang, Y. Federated Learning with Non-IID Data: A Survey. IEEE Internet Things J. 2024, 11, 19188–19209. [Google Scholar] [CrossRef] [Scilit]
  40. Chung, W.-C.; Lo, C.-A.; Lin, Y.-H.; Chen, Z.-H.; Hung, C.-L. Decentralized Federated Learning with Non-IID Data: Challenges, Trends, and Future Opportunities. ACM Comput. Surv. 2026, 58, 1–41. [Google Scholar] [CrossRef] [Scilit]
  41. Wu, Q.; He, K.; Chen, X. Personalized federated learning for intelligent IoT applications: A cloud-edge based framework. IEEE Open J. Comput. Soc. 2020, 1, 35–44. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  42. Singh, G. Smart Transportation: Real-Time Distributed Systems Improving Mobility and Safety. J. Comput. Sci. Technol. Stud. 2025, 7, 33–41. [Google Scholar] [CrossRef] [Scilit]
  43. Si, S.; Xiong, W.; Che, X. Data Quality Analysis and Improvement: A Case Study of a Bus Transportation System. Appl. Sci. 2023, 13, 11020. [Google Scholar] [CrossRef] [Scilit]
  44. Marcillo, P.; Suntaxi, G.; Hernández-Álvarez, M. A Privacy-Preserving Scheme for a Traffic Accident Risk Level Prediction System. Appl. Sci. 2024, 14, 9876. [Google Scholar] [CrossRef] [Scilit]
  45. Li, S.; Miao, D.; Wu, Q.; Hong, C.; D’Agostino, D.; Li, X.; Ning, Y.; Shang, Y.; Wang, Z.; Liu, M.; et al. Federated Learning in Healthcare: A Benchmark Comparison of Engineering and Statistical Approaches for Structured Data Analysis. Health Data Sci. 2024, 4, 0196. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  46. Org, M.; Nawaz, A. CLOUD COMPUTING AND EDGE COMPUTING: CONVERGING TECHNOLOGIES FOR REAL-TIME DATA PROCESSING. Multidiscip. Res. Comput. Inf. Syst. 2025, 5, 157–179. [Google Scholar] [CrossRef] [Scilit]
  47. Tarapder, S.A. EDGE ARTIFICIAL INTELLIGENCE BASED AUTOMATION FOR ULTRA-LOW-LATENCY CONTROL IN INDUSTRIAL ROBOTIC SYSTEMS. Rev. Appl. Sci. Technol. 2026, 5, 1–37. [Google Scholar] [CrossRef] [Scilit]
  48. Sarwatt, D.S.; Lin, Y.; Ding, J.; Sun, Y.; Ning, H. Metaverse for Intelligent Transportation Systems (ITS): A Comprehensive Review of Technologies, Applications, Implications, Challenges and Future Directions. IEEE Trans. Intell. Transp. Syst. 2024, 25, 6290–6308. [Google Scholar] [CrossRef] [Scilit]
  49. Gong, T.; Zhu, L.; Yu, F.R.; Tang, T. Edge Intelligence in Intelligent Transportation Systems: A Survey. IEEE Trans. Intell. Transp. Syst. 2023, 24, 8919–8944. [Google Scholar] [CrossRef] [Scilit]
  50. Ramish, S.; Appadurai, N.K.; Huang, H.; Lai, N.K.; Annathurai, S.; Jwu, C.S. Machine Learning Approaches for Predictive Air Quality Monitoring in Urbanized Island Ecosystems. In 2025 IEEE 1st International Conference on Emerging Innovation and Digital Technology, ICEIDT 2025; IEEE: New York, NY, USA, 2025; pp. 246–251. [Google Scholar] [CrossRef] [Scilit]
  51. Zhang, K.; Shi, Y.; Karnouskos, S.; Sauter, T.; Fang, H.; Colombo, A.W. Advancements in Industrial Cyber-Physical Systems: An Overview and Perspectives. IEEE Trans. Ind. Inform. 2023, 19, 716–729. [Google Scholar] [CrossRef] [Scilit]
  52. Casadei, R.; Aguzzi, G.; Audrito, G.; Damiani, F.; Pianini, D.; Scarso, G.; Torta, G.; Viroli, M. Software Engineering for Collective Cyber-Physical Ecosystems. ACM Trans. Softw. Eng. Methodol. 2025, 34, 1–40. [Google Scholar] [CrossRef] [Scilit]
  53. Semwal, S.; Dhyani, B.; Prakash, C. A Roadmap for Federated Learning Adoption. In Federated Learning in Finance: Unlocking Privacy-Preserving and Cyber Resilience Using AI; Sah, S., Sulaiman, R.B., Tyagi, A.D., Eds.; CRC Press: Boca Raton, FL, USA, 2026; pp. 263–280. [Google Scholar] [CrossRef] [Scilit]
Figure 1. Architecture of the intelligent IoT edge node, including environmental sensing modules, ESP32-S3-based TinyML processing, LoRaWAN communication, GPS geolocation, renewable energy subsystem, and local storage for resilient environmental monitoring in rural road environments.
Figure 1. Architecture of the intelligent IoT edge node, including environmental sensing modules, ESP32-S3-based TinyML processing, LoRaWAN communication, GPS geolocation, renewable energy subsystem, and local storage for resilient environmental monitoring in rural road environments.
Computation 14 00163 g001
Figure 2. LoRaWAN communication infrastructure connecting distributed environmental monitoring nodes with cloud services through a Milesight UG67 gateway, TTN network server, MQTT broker, and secure end-to-end communication mechanisms. The architecture incorporates AES-128 encryption, TLS/SSL protection, OTAA authentication, adaptive spreading factors, and Internet backhaul connectivity for reliable telemetry transport in rural environments.
Figure 2. LoRaWAN communication infrastructure connecting distributed environmental monitoring nodes with cloud services through a Milesight UG67 gateway, TTN network server, MQTT broker, and secure end-to-end communication mechanisms. The architecture incorporates AES-128 encryption, TLS/SSL protection, OTAA authentication, adaptive spreading factors, and Internet backhaul connectivity for reliable telemetry transport in rural environments.
Computation 14 00163 g002
Figure 3. Edge–cloud orchestration architecture deployed across Ecuador. The platform integrates OpenNebula-based resource management, Docker containerization, Kubernetes/K3s orchestration, Longhorn distributed storage, GPU-enabled AI services, and WireGuard-secured networking to coordinate distributed workloads between geographically distributed edge nodes and the centralized cloud infrastructure.
Figure 3. Edge–cloud orchestration architecture deployed across Ecuador. The platform integrates OpenNebula-based resource management, Docker containerization, Kubernetes/K3s orchestration, Longhorn distributed storage, GPU-enabled AI services, and WireGuard-secured networking to coordinate distributed workloads between geographically distributed edge nodes and the centralized cloud infrastructure.
Computation 14 00163 g003
Figure 4. Federated learning ecosystem for distributed traffic risk prediction. Twenty-four provincial clients perform local model training while preserving data privacy. Model parameters are securely transmitted to a GPU-accelerated NVIDIA Jetson Orin NX server, where FedAvg aggregation generates a global model that is redistributed to all participants. The architecture integrates TensorFlow, PyTorch, Flower FL, CUDA acceleration, convergence monitoring, and a benchmarked model intelligence ecosystem including traditional machine learning, spatiotemporal, and graph-based approaches.
Figure 4. Federated learning ecosystem for distributed traffic risk prediction. Twenty-four provincial clients perform local model training while preserving data privacy. Model parameters are securely transmitted to a GPU-accelerated NVIDIA Jetson Orin NX server, where FedAvg aggregation generates a global model that is redistributed to all participants. The architecture integrates TensorFlow, PyTorch, Flower FL, CUDA acceleration, convergence monitoring, and a benchmarked model intelligence ecosystem including traditional machine learning, spatiotemporal, and graph-based approaches.
Computation 14 00163 g004
Figure 5. Analytics and decision-support ecosystem integrating MQTT telemetry ingestion, FastAPI backend services, PostgreSQL/PostGIS geospatial storage, InfluxDB time-series management, predictive analytics, Grafana dashboards, and interactive web-based visualization tools. The platform transforms environmental telemetry and federated learning outputs into real-time operational intelligence for transportation authorities.
Figure 5. Analytics and decision-support ecosystem integrating MQTT telemetry ingestion, FastAPI backend services, PostgreSQL/PostGIS geospatial storage, InfluxDB time-series management, predictive analytics, Grafana dashboards, and interactive web-based visualization tools. The platform transforms environmental telemetry and federated learning outputs into real-time operational intelligence for transportation authorities.
Computation 14 00163 g005
Figure 6. Distribution of the target variable before and after the Box–Cox transformation.
Figure 6. Distribution of the target variable before and after the Box–Cox transformation.
Computation 14 00163 g006
Figure 7. Performance comparison of traditional statistical models.
Figure 7. Performance comparison of traditional statistical models.
Computation 14 00163 g007
Figure 8. Distribution of MAE and R 2 obtained via time-series cross-validation.
Figure 8. Distribution of MAE and R 2 obtained via time-series cross-validation.
Computation 14 00163 g008
Figure 9. Convergence evolution during federated training.
Figure 9. Convergence evolution during federated training.
Computation 14 00163 g009
Figure 10. Comparison of the coefficient of determination (R2) between the centralized and federated models.
Figure 10. Comparison of the coefficient of determination (R2) between the centralized and federated models.
Computation 14 00163 g010
Figure 11. Histograms, Q–Q plots, and residual scatter plots for the centralized and federated models. The red dashed vertical lines in the histograms indicate the zero-residual reference, the red dashed horizontal lines in the residual scatter plots represent the zero-error baseline, and the red solid lines in the Q–Q plots denote the theoretical normal reference line used to assess residual normality.
Figure 11. Histograms, Q–Q plots, and residual scatter plots for the centralized and federated models. The red dashed vertical lines in the histograms indicate the zero-residual reference, the red dashed horizontal lines in the residual scatter plots represent the zero-error baseline, and the red solid lines in the Q–Q plots denote the theoretical normal reference line used to assess residual normality.
Computation 14 00163 g011
Figure 12. Global feature importance via SHAP.
Figure 12. Global feature importance via SHAP.
Computation 14 00163 g012
Figure 13. Comparison between observed values and generated predictions.
Figure 13. Comparison between observed values and generated predictions.
Computation 14 00163 g013
Figure 14. Integrated end-to-end architecture of the proposed intelligent transportation and environmental monitoring platform. The architecture combines TinyML-enabled sensing, LoRaWAN communications, edge–cloud orchestration, federated learning, and geospatial analytics to support real-time risk assessment and decision-making across Ecuador.
Figure 14. Integrated end-to-end architecture of the proposed intelligent transportation and environmental monitoring platform. The architecture combines TinyML-enabled sensing, LoRaWAN communications, edge–cloud orchestration, federated learning, and geospatial analytics to support real-time risk assessment and decision-making across Ecuador.
Computation 14 00163 g014
Table 1. Layer 1 hardware components, technical specifications, and operational functions for the resilient edge nodes.
Table 1. Layer 1 hardware components, technical specifications, and operational functions for the resilient edge nodes.
ComponentSpecificationFunction
MicrocontrollerESP32-S3 (Xtensa LX7 dual-core, 240 MHz, 512 KB SRAM) with LoRa chip SX1276/SX1262Local TinyML processing and LoRaWAN transmission
Climate sensorsBME280/DHT22 (T, R H , P), YL-83 (rain intensity), fog/visibility sensor (laser backscattering)Environmental telemetry capture
GeolocationGPS NEO-6M (2.5 m CEP accuracy, 1 Hz frequency)Event and node georeferencing
Visual captureESP32-CAM (OV2640, 2 MP)—optionalVisual evidence for incident validation
Local storageMicroSD (up to 32 GB, FAT32/exFAT)Offline buffer for LoRaWAN gaps
PowerBattery 18650 (3400 mAh, 3.7 V) + TP4056 + Solar panelEnergy autonomy in rural zones
EnclosureIP65 polycarbonate with silicone gasketResistance to rain, dust, and temperature
Table 2. Layer 2 hardware and software components, technical specifications, and functional roles.
Table 2. Layer 2 hardware and software components, technical specifications, and functional roles.
ComponentSpecificationFunction
GatewayMilesight UG67 (IP67, 8 LoRa channels, −142 dBm sensitivity)Uplink reception from multiple nodes
AntennaFiberglass 915 MHz, 8 dBi, VSWR < 1.5Extended coverage in rural zones (>15 km)
Backhaul4G/LTE router + PoE Injector (802.3af, 15.4 W)Internet connectivity for edge forwarding
Network ServerThe Things Stack (TTN) v3.27Device management and OTAA
IoT BrokerMQTT Mosquitto v2.0 (TLS 1.3, port 8883)Message routing to downstream systems
SecurityAES-128 encryption + TLS/SSL + OTAAEnd-to-end confidentiality and integrity
Table 3. Layer 3 software stack, edge orchestration, and containerization specifications.
Table 3. Layer 3 software stack, edge orchestration, and containerization specifications.
ComponentSpecificationFunction
Edge OrchestratorOpenNebula v6.10 with edge computing patchVM and container management
ContainerizationDocker v24.0 + Docker Compose v2.20Microservice packaging (API, DB, models)
Edge OrchestrationKubernetes/K3s v1.28 (lightweight, <512 MB RAM)Auto-scaling, load balancing, and self-healing
GPU AccelerationNVIDIA Container Runtime v1.13 (CUDA 12.2)GPU exposure (Jetson Orin) to AI containers
Edge StorageLonghorn v1.5 (distributed block storage)Model and checkpoint persistence at the edge
Network FabricWireGuard VPN + Cilium v1.14 (eBPF)Secure inter-node communication
Table 4. Hyperparameters, values, and operational justifications for the federated training process.
Table 4. Hyperparameters, values, and operational justifications for the federated training process.
ParameterValueJustification
Number of rounds R = 20 Convergence stabilized at R = 3 ( MAE = 0.8371 )
Clients per round100% (24/24)Simulating centralized FL coordination across all provinces
Local epochs per client E = 10 Complete GradientBoostingRegressor training cycle
Aggregation algorithmFedAvgStandard implementation weighted by n k / n
Convergence metricAverage MAETarget < 0.84 (achieved at round 1: 0.8366)
Table 5. Classification and evaluation status of the tested and prospective predictive models.
Table 5. Classification and evaluation status of the tested and prospective predictive models.
Model FamilySpecific ModelsStatus
Traditional (baseline)LightGBM, XGBoost, Random Forest, GradientBoosting, StackingFully evaluated
SpatiotemporalST-GCN with adjacency matrix A R 24 × 24 Fully evaluated
Temporal deep learningLSTM, GRU, Temporal TransformerFuture work
Graph-basedGraph Neural Networks (GNN), ConvLSTMFuture work
Table 6. Layer 5 software architecture: analytics, data management, and visualization specifications.
Table 6. Layer 5 software architecture: analytics, data management, and visualization specifications.
ComponentSpecificationFunction
Relational + Geospatial DBPostgreSQL 15 + PostGIS 3.4Spatial queries (ST_Distance, ST_Intersects)
Time-Series DBInfluxDB 2.7 (TSM engine)Climate telemetry (T, rain, fog) storage
Backend APIFastAPI 0.104 (Python 3.11)REST endpoints for predictions and alerts
MQTT BrokerMosquitto 2.0 (TLS 1.3)Real-time telemetry ingestion from Layer 2
Reverse ProxyNGINX 1.24API security, rate limiting, SSL termination
DashboardsGrafana 10.2ITS visualization: risk maps, metrics panels
Frontend WebReact 18 + Next.js 14 + LeafletInteractive platform for transit authorities
Table 7. Methodological mapping of CRISP-DM phases, targeted activities, and quantitative metrics obtained.
Table 7. Methodological mapping of CRISP-DM phases, targeted activities, and quantitative metrics obtained.
PhaseActivities PerformedQuantitative Results Obtained
1. Business UnderstandingObjective definition: reduce vehicle accident rates through predictive alerts with differential privacy.KPIs defined: MAE < 0.5, R2 > 0.2 (on the Box–Cox transformed scale)
2. Data UnderstandingHistorical dataset acquisition (2014–2025) with 57 original variables; exploratory analysis.27,620 valid records; skewness = 7.8856, kurtosis = 84.3924 (highly skewed).
3. Data PreparationCleaning (null deletion, KNN imputation), Box–Cox transformation ( λ = 0.3957 ), feature engineering.Skewness reduced to 0.2043 (97.4% imp.); kurtosis to −1.1292 (101.3% imp.); matrix A R 24 × 24 .
4. ModelingCentralized benchmarking + federated training (24 clients) of 3 model families with Time-Series CV 5-folds.Best centralized: Stacking ( MAE = 0.4748 , R 2 = 0.2460 ); federated: GradientBoosting ( MAE = 0.5920 , R 2 = 0.0046 ).
5. EvaluationRigorous evaluation with Bootstrap (500 iterations, 95% CI), residual analysis, SHAP interpretability.ST-GCN: MAE = 0.6479 , R 2 = 0.2271 ; Centralized outperforms Federated by 14.51% in MAE; non-normal residuals ( p < 0.05 ).
6. DeploymentCentralized model (Stacking) deployment on NVIDIA Jetson Orin NX edge servers via FastAPI and Grafana.Measured latency in simulation: 78 ms (meets R1 requirement < 200 ms).
Table 8. Complete feature set (53 features) categorized by structural type and operational justification.
Table 8. Complete feature set (53 features) categorized by structural type and operational justification.
GroupFeatures IncludedCountJustification
Temporal basicHOUR, DAY_OF_WEEK, MONTH, IS_WEEKEND, etc.8Capture intra-day and weekly seasonality
Cyclic encodingHOUR_SIN/COS, DAY_SIN/COS, MONTH_SIN/COS6Avoid discontinuities in angular variables
Temporal lags lag 1 , lag 2 , lag 3 , lag 7 , lag 14 , lag 21 , lag 28 7Model autocorrelated dependencies
Rolling statisticsrolling_mean/std/min/max (windows 3, 7, 14, 28)16Capture local trends and volatility
SpatialPROVINCE, LATITUDE, LONGITUDE, matrix A 3 + A Model geographic heterogeneity
ClimaticTEMPERATURE, RAIN, FOG, interactions5Incorporate environmental risk factors
Trendtrend, trend_squared, calendar effects7Capture long-term effects
CausalCAUSE_OF_ACCIDENT (encoded, 5 categories)1Differentiate by root cause
Total 53Complete spatiotemporal coverage
Table 9. Hyperparameter configuration for evaluated models and the FedAvg algorithm.
Table 9. Hyperparameter configuration for evaluated models and the FedAvg algorithm.
ModelHyperparametersValue(s)
LightGBMn_estimators, learning_rate, num_leaves, max_depth100, 0.1, 31, −1
XGBoostn_estimators, learning_rate, max_depth, subsample100, 0.1, 6, 1.0
Random Forestn_estimators, max_depth, min_samples_split100, None, 2
GradientBoostingn_estimators, learning_rate, max_depth100, 0.1, 3
Stacking Ensemblebase estimators, final_estimator, cvLGBM, XGB, RF; Ridge ( α = 1.0 ); None
ST-GCNfilters, kernel, gcn_units, dropout, lr, A, seq_len64/32, 3, 32, 0.3, 0.001, A R 24 × 24 , 24
FedAvg (FL)num_rounds, local_epochs, batch_size, frac_fit20, 24, 64, 1.0
Table 10. Validation framework consisting of temporal cross-validation (5 folds), bootstrap resampling (500 iterations), residual analysis (Shapiro–Wilk, Jarque–Bera), and SHAP interpretability.
Table 10. Validation framework consisting of temporal cross-validation (5 folds), bootstrap resampling (500 iterations), residual analysis (Shapiro–Wilk, Jarque–Bera), and SHAP interpretability.
ProtocolConfigurationPurpose
Time-Series Cross-Validation5 folds, strictly temporal orderPrevent data leakage
Bootstrap Resampling500 iterations, 95% confidence intervalsEstimate stability of R 2
Residual AnalysisShapiro–Wilk, Jarque–Bera testsAssess normality violations
InterpretabilitySHAP (SHapley Additive exPlanations)Identify most influential variables
Table 11. Centralized versus federated learning performance: benchmark metrics and bootstrap uncertainty quantification.
Table 11. Centralized versus federated learning performance: benchmark metrics and bootstrap uncertainty quantification.
Model Type/ModelMAERMSE R 2 SMAPEMASE
Centralized Stacking0.47480.92820.24600.35120.8923
Centralized LightGBM0.48230.94150.22470.35890.9067
Centralized XGBoost0.48910.95280.21340.36210.9194
Centralized Random Forest0.51270.97830.17890.38120.9635
Federated GradientBoosting0.59201.1236−0.00460.44381.1124
Centralized ST-GCN0.64791.2451−0.22710.48561.2178
Table 12. Operational viability evaluation: latency, energy autonomy, bandwidth, federated convergence, scalability, and privacy preservation with respective validation methods.
Table 12. Operational viability evaluation: latency, energy autonomy, bandwidth, federated convergence, scalability, and privacy preservation with respective validation methods.
MetricTarget (R#)Achieved ValueValidation Method
Edge inference latency<200 ms (R1)78 msSimulation on Jetson Orin NX
Energy autonomy>6 months (R4)> 72   h continuous operationPhysical layer measurement + 60-day pilot deployment
LoRaWAN bandwidth< 50   kbps (R3) 51   bytes /uplinkPhysical layer measurement
Federated convergence<20 (implicit)3 roundsEmpirical from 20-round FL
ScalabilitySupport > 1000 nodes2000 nodes/gatewaySimulation validation
Privacy preservationGDPR/LOPD (R2)CompliantAES-128 + TLS 1.3 + OTAA verification
Maintenance requirement<30 days (implicit)14–21 days (sensor cleaning)60-day pilot deployment logs
Table 13. Dataset coverage and characteristics.
Table 13. Dataset coverage and characteristics.
MetricValue
Analyzed provinces24
Spatial coverage100%
Time period2014–2025
Processed records27,620
Generated sequences27,596
Utilized variables53
Table 14. Box–Cox transformation results.
Table 14. Box–Cox transformation results.
StatisticOriginalBox–CoxImprovement
Skewness7.88560.204397.4%
Kurtosis84.3924−1.1292101.3%
Optimal λ −0.3957
Table 15. Baseline statistical model results.
Table 15. Baseline statistical model results.
ModelMAERMSE R 2
ARIMA(5,1,2)296.18406.47−1.688
SARIMA(1,1,1)(1,1,1,7)203.11276.70−0.246
Prophet555.21570.01−4.287
Table 16. Representative snippet of the provincial adjacency matrix.
Table 16. Representative snippet of the provincial adjacency matrix.
ProvinceProv. 1Prov. 2Prov. 3Prov. n
Prov. 11.000.450.000.12
Prov. 20.451.000.310.00
Prov. 30.000.311.000.65
Prov. n0.120.000.651.00
Table 17. Time-series cross-validation results.
Table 17. Time-series cross-validation results.
ModelMAERMSE R 2
LightGBM 0.4822 ± 0.0185 0.5934 0.2372 ± 0.0477
XGBoost 0.4869 ± 0.0190 0.5983 0.2245 ± 0.0495
Random Forest 0.5030 ± 0.0167 0.6073 0.2012 ± 0.0438
Gradient Boosting 0.4891 ± 0.0218 0.5996 0.2208 ± 0.0554
Stacking 0.4748 ± 0.0208 0.5899 0.2460 ± 0.0539
Table 18. Bootstrap confidence intervals for R 2 .
Table 18. Bootstrap confidence intervals for R 2 .
ModelAverage R 2 95% CI
LightGBM0.2361[0.1982, 0.2761]
XGBoost0.2259[0.1833, 0.2637]
Random Forest0.2004[0.1608, 0.2368]
Gradient Boosting0.2224[0.1752, 0.2687]
Stacking0.2442[0.1918, 0.2843]
Table 19. Evolution of MAE during FedAvg.
Table 19. Evolution of MAE during FedAvg.
RoundAverage MAE
10.8366
20.8366
30.8371
100.8371
200.8371
Table 20. Comparison between centralized and federated training.
Table 20. Comparison between centralized and federated training.
MetricCentralizedFederated
MAE0.47480.5920
RMSE0.92821.1236
R 2 0.2460−0.0046
SMAPE0.35120.4438
MASE0.89231.1124
Table 21. Descriptive statistics of residuals.
Table 21. Descriptive statistics of residuals.
ModelMeanStd. Dev.SkewnessKurtosisShapiro-Wilk p-Value
Centralized−0.03560.62470.3656−0.3321 2.69 × 10 21
Federated0.01540.68840.4499−1.0095 9.81 × 10 43
Table 22. Global performance summary.
Table 22. Global performance summary.
ComponentBest Result
Box–Cox TransformationSkewness = 0.2043
Best Statistical ModelSARIMA ( MAE = 203.11 )
Best Machine Learning ModelStacking ( R 2 = 0.2460 )
Best Bootstrap IntervalStacking [0.1918, 0.2843]
Centralized Model R 2 = 0.1703
Federated Model R 2 = 0.0046
Spatial Coverage24 provinces
Temporal Coverage2014–2025
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Chango, W.; Estrada, N.; Salazar, E.; Tierra, L. Federated Edge Intelligence for Climate-Aware Spatiotemporal Road Accident Prediction Using IoT and LoRaWAN Networks. Computation 2026, 14, 163. https://doi.org/10.3390/computation14070163

AMA Style

Chango W, Estrada N, Salazar E, Tierra L. Federated Edge Intelligence for Climate-Aware Spatiotemporal Road Accident Prediction Using IoT and LoRaWAN Networks. Computation. 2026; 14(7):163. https://doi.org/10.3390/computation14070163

Chicago/Turabian Style

Chango, Wilson, Nestor Estrada, Edgar Salazar, and Luis Tierra. 2026. "Federated Edge Intelligence for Climate-Aware Spatiotemporal Road Accident Prediction Using IoT and LoRaWAN Networks" Computation 14, no. 7: 163. https://doi.org/10.3390/computation14070163

APA Style

Chango, W., Estrada, N., Salazar, E., & Tierra, L. (2026). Federated Edge Intelligence for Climate-Aware Spatiotemporal Road Accident Prediction Using IoT and LoRaWAN Networks. Computation, 14(7), 163. https://doi.org/10.3390/computation14070163

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop