iconOpen Access

ARTICLE

crossmark

NeuroCivitas: A Federated Deep Learning Model for Adaptive Urban Intelligence in 6G Cognitive Cities

Nujud Aloshban*, Abeer A.K. Alharbi

Department of Information Systems, College of Computer and Information Sciences, Imam Mohammad Ibn Saud Islamic University (IMSIU), Riyadh, 11432, Saudi Arabia

* Corresponding Author: Nujud Aloshban. Email: email

(This article belongs to the Special Issue: Empowered Connected Futures of AI, IoT, and Cloud Computing in the Development of Cognitive Cities)

Computers, Materials & Continua 2025, 85(3), 4795-4826. https://doi.org/10.32604/cmc.2025.067523

Abstract

The rise of 6G networks and the exponential growth of smart city infrastructures demand intelligent, real-time traffic forecasting solutions that preserve data privacy. This paper introduces NeuroCivitas, a federated deep learning framework that integrates Convolutional Neural Networks (CNNs) for spatial pattern recognition and Long Short-Term Memory (LSTM) networks for temporal sequence modeling. Designed to meet the adaptive intelligence requirements of cognitive cities, NeuroCivitas leverages Federated Averaging (FedAvg) to ensure privacy-preserving training while significantly reducing communication overhead—by 98.7% compared to centralized models. The model is evaluated using the Kaggle Traffic Prediction Dataset comprising 48,120 hourly records from four urban junctions. It achieves an RMSE of 2.76, MAE of 2.11, and an R2 score of 0.91, outperforming baseline models such as ARIMA, Linear Regression, Random Forest, and non-federated CNN-LSTM in both accuracy and scalability. Junction-wise and time-based performance analyses further validate its robustness, particularly during off-peak hours, while highlighting challenges in peak traffic forecasting. Ablation studies confirm the importance of both CNN and LSTM layers and temporal feature engineering in achieving optimal performance. Moreover, NeuroCivitas demonstrates stable convergence within 25 communication rounds and shows strong adaptability to non-IID data distributions. The framework is built with real-world deployment in mind, offering support for edge environments through lightweight architecture and the potential for enhancement with differential privacy and adversarial defense mechanisms. SHAP-based explainability is integrated to improve interpretability for stakeholders. In sum, NeuroCivitas delivers an accurate, scalable, and privacy-preserving traffic forecasting solution, tailored for 6G cognitive cities. Future extensions will incorporate fairness-aware optimization, real-time anomaly adaptation, multi-city validation, and advanced federated GNN comparisons to further enhance deployment readiness and societal impact.

Keywords

Federated learning; traffic prediction; cognitive cities; 6G networks; privacy preservation

1  Introduction

The transformation of traditional urban environments into intelligent, adaptive ecosystems—referred to as cognitive cities—has become a key priority in next-generation smart infrastructure research. These cities rely heavily on artificial intelligence (AI), Internet of Things (IoT) devices, and real-time data to support complex urban operations such as traffic control, energy distribution, and public safety [1]. Recent advances in federated learning for intelligent transportation systems, such as the FASTGNN framework, highlight the growing importance of privacy-preserving spatio-temporal forecasting models in decentralized environments [2]. Building on these foundations, NeuroCivitas leverages a CNN-LSTM architecture under federated training to address spatial-temporal dependencies while ensuring privacy and scalability for adaptive urban intelligence in 6G cognitive cities. However, achieving adaptive urban intelligence at the scale envisioned for cognitive cities presents major technical hurdles. One central challenge lies in efficiently processing and learning from the massive, distributed, and heterogeneous data streams generated by diverse urban infrastructures. Traditional centralized models, which rely on aggregating data at cloud servers, are increasingly impractical due to communication overhead, energy inefficiency, latency issues, and privacy concerns—especially in location-sensitive services [3]. Furthermore, federated deployments over real-world wireless networks introduce additional complexities such as variable bandwidth, user selection, and resource optimization, all of which significantly impact model convergence and performance [4]. In such scenarios, Federated Learning (FL) has emerged as a transformative paradigm, enabling decentralized entities—such as connected vehicles, surveillance systems, and mobile sensors—to collaboratively train global models without sharing raw data. This approach not only enhances data privacy but also reduces communication costs. Recent advancements, such as client reputation-based personalization in traffic forecasting, further demonstrate how FL can effectively balance model performance and privacy protection in real-world intelligent transportation systems [5]. While Federated Learning (FL) theoretically addresses data decentralization and privacy requirements, it still encounters significant operational challenges in the dynamic and heterogeneous environments of cognitive cities [6]. These challenges include handling non-independent and Identically Distributed (non-IID) data distributions across clients [7], intermittent availability of client devices, communication resource limitations, heterogeneous computational capabilities, and vulnerabilities to adversarial attacks during the aggregation of local models [8]. Moreover, the stringent latency and reliability demands of real-time urban services—such as autonomous traffic control, emergency response coordination, and personalized healthcare monitoring—further heighten the necessity for FL frameworks that are fast, adaptive, and resilient [9]. Recent advances have proposed several promising directions to enhance federated learning performance in 6G-enabled environments, leveraging AI-driven intelligent architectures, optimized resource management, and improved network protocols [10].These advancements include federated learning architectures utilizing LSTM-based local training at the network edge for privacy-preserving and accurate traffic prediction [11]; privacy-preserving dynamic spatio-temporal modeling frameworks, such as federated split learning with optimized temporal and spatial fusion mechanisms to enhance model performance while minimizing overhead [12]; and energy-efficient, scalable federated learning strategies within massive IoT ecosystems, leveraging edge–fog–cloud hierarchies and lightweight AI to balance security, performance, and sustainability [13]. To meet the intelligent, real-time, and private urban analytics demands of 6G cognitive cities, this research motivation arose. Centralized learning approaches in the traditional sense expose sensitive data 2 [14], just like those in the distributed smart city environments, but are not scalable. As a result, federated learning arises as a promising solution to collaborative model training without the need to centralize raw data. To address the demand for safe and adaptive urban intelligence, this work presents NeuroCivitas, a federated deep learning framework for 6G-based cognitive traffic prediction in cities [15]. This work researches the problem of limitations of existing solutions that are ineffective in jointly handling non-IID data distributions, complex spatiotemporal modelling, and strict privacy requirements. Most of the current approaches either sacrifice accuracy for privacy or achieve privacy with a degraded model performance, rendering them impractical for deployment in smart cities [16]. Due to the limited receptive fields and the absence of recurrent information, these approaches fall short of accurately predicting the traffic flow [17].

The main objectives of this research are as follows:

•   To develop a privacy-preserving federated deep learning framework, NeuroCivitas, for scalable and secure traffic prediction in 6G-enabled cognitive cities.

•   To optimize predictive performance by integrating CNN and LSTM architectures and comparing the model against baseline and centralized approaches.

•   To simulate real-world non-IID data distributions and evaluate generalizability across heterogeneous urban junctions.

•   To minimize communication overhead and assess performance under spatial and temporal dimensions in federated training scenarios.

This study presents the main research findings through the following points:

The paper presents NeuroCivitas as a CNN-LSTM-based deep learning platform optimized for traffic prediction within 6G cognitive cities which addresses both accuracy and privacy requirements and scalability needs. The approach recommends the implementation of federated learning to forecast city traffic using distributed model training across junctions which protects data safety standards along with providing expandable solutions. Testing confirmed the essential role of CNN alongside LSTM and temporal feature engineering for obtaining the best model performance results. The model was designed for real-time traffic forecasting needs within dynamic cognitive cities and would work optimally as a solution for 6G-powered urban infrastructure deployment. Data-driven intelligence in cognitive cities is used to optimize transportation, energy management, healthcare, and public services, with the desire to create even more resilient and sustainable cities [18]. To support real-time adaptive decision making in such an environment, critical enablers have been identified as edge computing, mobile caching, and federated AI architectures [19]. Federated learning models are proposed in 6G networks since they provide the scalability, privacy, and efficiency needed to support heterogeneous Internet of Things (IoT) devices with stringent latency requirements of urban applications [2]. However, applying federated learning at scale introduces several challenges, including non-independent and identically distributed (non-IID) data across nodes, high communication overhead, and the need to maintain stable model convergence [11]. Recent advancements have extended this paradigm to 6G-enabled smart cities by incorporating federated edge learning (FEL) architectures, which address critical issues such as hierarchical model aggregation, selective client participation, and adaptive communication protocols to support efficient and privacy-aware traffic forecasting in resource-constrained environments [12]. Furthermore, the relationship between the accuracy of global models (Ag) and the number of participating local clients (N) in federated learning over cognitive city environments can be approximated as:

global=1Kk=1K(ωk×k+λ×DKL(Pk||Pglobal))(1)

In this formulation, Lglobal denotes the overall optimization goal across all K clients. Each local client k contributes its local loss Lk, weighted by an importance factor ωk. The term λDKL(PkPglobal) represents a Kullback–Leibler (KL) divergence regularization, which minimizes the divergence between each client’s predictive distribution Pk and the global model distribution Pglobal. This promotes consistency and mitigates overfitting due to data heterogeneity. The hyperparameter λ controls the impact of the regularization term. 6G’s AI-native architecture introduces capabilities that directly enhance federated learning performance in cognitive cities. Specifically, ultra-low latency (sub-millisecond) and high-reliability links facilitate near real-time synchronization between edge nodes and central servers, reducing staleness in model updates and improving global convergence rates. Furthermore, the integration of native AI acceleration into 6G network fabrics enables intelligent routing, client prioritization, and dynamic bandwidth allocation for federated training. This paves the way for on-demand model adaptation in fast-changing urban conditions, such as sudden congestion or emergencies, where predictive timeliness is critical. These features not only enhance the technical viability of federated systems but also align with the real-time demands of smart city infrastructures. Despite significant progress, existing federated learning frameworks are not fully capable of delivering adaptive urban intelligence—the real-time ability of cognitive cities to learn from evolving conditions and dynamically adjust operational policies [16]. Current models often assume static network conditions, uniform data distributions, and homogeneous client capabilities, which are unrealistic assumptions for smart urban deployments characterized by high mobility, diverse device types, and fluctuating network qualities [17]. Moreover, most existing solutions do not adequately incorporate hierarchical communication frameworks that involve the joint coordination of edge, fog, and cloud layers, which are essential for optimizing computation and communication trade-offs in dense 6G urban environments [6]. This leads to critical gaps such as delayed learning updates, degraded model performance during high mobility events, and privacy vulnerabilities during aggregation stages. To bridge these gaps, there is a pressing need for a comprehensive framework that unifies federated deep learning with adaptive model updating, hierarchical communication management, and dynamic client participation strategies—tailored specifically for 6G-powered cognitive cities [19]. The proposed NeuroCivitas model addresses this need by integrating adaptive federated learning with 6G-enabled multi-tiered urban intelligence systems, ensuring real-time responsiveness, privacy preservation, and scalability [10]. The remainder of this paper is organized as follows: Section 2 reviews the related work; Section 3 presents the NeuroCivitas system model; Section 4 details the experimental setup and results; and Section 5 concludes the paper with future research directions.

2  Literature Review

The integration of deep learning and federated approaches has become increasingly vital for intelligent traffic prediction in urban environments, particularly with the evolution of 6G communication infrastructures. Hussain et al. [1] utilized an optimized GRU model to enhance traffic flow prediction, achieving notable improvements in forecasting accuracy. However, the model operated in a centralized setting, raising concerns over privacy and data security. To address this, Zhang et al. [2] proposed FastGNN, a federated framework with topological information protection for traffic speed forecasting, which preserved spatial dependencies but lacked a temporal modeling component.

Chen et al. [3] discussed data-driven smart cities powered by federated learning, highlighting the need for decentralized processing to ensure privacy in intelligent urban systems. Their subsequent work with Chen et al. [4] extended this by designing a joint learning-communication framework for wireless networks, setting the stage for privacy-aware, distributed inference. In a recent advancement, Dai et al. [5] introduced a client reputation-based federated model for road traffic flow prediction, enabling personalized learning in non-IID environments, though the model’s convergence was not deeply analyzed.

Gupta et al. [6] emphasized the critical role of privacy-preserving AI for 6G urban environments, outlining various communication and regulatory challenges, that have influenced the architecture of privacy-centric federated models. Similarly, Zeng and Liu [7] applied attention-based hybrid deep learning for traffic flow forecasting, demonstrating superior spatial-temporal learning but again relying on centralized data handling.

Federated learning’s application to spatio-temporal traffic data was further advanced by Feng et al. [8], who combined it with Graph Neural Networks (GNNs) to predict urban traffic dynamics. This method aligned with the findings of Guan and Liu [9], who provided a broad overview of traffic forecasting techniques and emphasized hybrid models’ superiority. Li et al. [10] proposed an AI-enabled architecture for 6G networks that integrates intelligent sensing, data analytics, and smart applications, laying the groundwork for autonomous network optimization and intelligent service provisioning. Building upon this, Behera et al. [11] demonstrated the effectiveness of federated learning (FL) for network traffic prediction, offering a decentralized approach that balances performance with privacy preservation. Feng et al. [12] extended this work by introducing a privacy-preserving split learning framework tailored for dynamic spatio-temporal graph data, effectively addressing non-IID data challenges and communication inefficiencies in distributed traffic forecasting—highlighting the growing importance of hybrid federated architectures in smart transportation systems. Complementing these developments Cheikh et al. [13] presented a comprehensive survey on the challenges of energy efficiency, scalability, data heterogeneity, and security in massive IoT ecosystems. They emphasized that while technologies like FL and Edge AI offer promise, issues such as client instability and inconsistent data quality remain critical barriers to large-scale, real-time deployments.

The efficacy of CNN-LSTM hybrid architectures in traffic forecasting was validated by Taleb et al. [14], who demonstrated robust performance across diverse urban datasets. Zhang et al. [15] conducted a comprehensive survey of federated learning systems for 6G smart cities, emphasizing model interpretability, scalability, and the need for legal compliance. Earlier groundwork by Wang et al. [16] on multi-access edge computing laid the foundation for current federated edge paradigms used in smart city applications.

Liu et al. [17] emphasized spatio-temporal analysis with CNNs for short-term traffic forecasting, which significantly influenced the layered CNN feature extractors in NeuroCivitas. Zhou et al. [18] proposed “In-edge AI” using federated learning for edge computing and caching, laying the groundwork for scalable and intelligent processing frameworks.

Song et al. [19] explored the deep integration of AI and next-generation communication networks through the concept of Networking Systems of AI (NSAI), proposing a unified framework that converges computing and communication across cloud, edge, and terminal layers. While their architecture supports real-time smart city applications, it lacks dedicated mechanisms for privacy preservation, making it less suitable for sensitive data environments like federated learning in cognitive cities. While LSTM and CNN-LSTM models are effective in learning sequential and spatial patterns, recent advancements in federated learning for traffic prediction have leveraged Graph Neural Networks (GNNs) for modeling complex spatial dependencies. For instance, FedGNN and STGNN-FL utilize graph-based message passing to improve prediction in highly connected urban networks. However, these models typically incur higher communication and computation costs due to complex graph construction and global synchronization needs. Pan et al. [20] proposed a physics-guided stepwise framework for predicting traffic flow at urban intersections by leveraging spatio-temporal graph neural networks (ST-GNNs). Their model integrates physical traffic constraints and dynamic spatial-temporal dependencies to enhance the prediction accuracy under variable congestion patterns. By structuring the traffic system as a graph, the method captures the topological influence of road connectivity and intersection interactions. The stepwise design further refines temporal correlations using physics-informed residuals. This approach demonstrated strong generalization capability across different urban layouts and served as a foundational basis for intelligent traffic control. Compared to conventional time-series models, their framework achieved higher precision, especially in scenarios involving sudden traffic surges or lane disruptions, highlighting the importance of incorporating domain knowledge in graph-based learning for transportation networks. While our model currently does not use GNNs, we plan to benchmark NeuroCivitas against these methods in future work. Furthermore, LSTM-based models continue to show strong performance when combined with attention mechanisms or residual connections, enhancing long-term pattern capture without excessive overhead. These insights motivate the inclusion of advanced LSTM variants in future NeuroCivitas iterations.

Collectively, these works reveal a growing convergence between federated learning, deep hybrid models, and urban traffic intelligence, though gaps remain in unified architectures that combine interpretability, scalability, and low-latency adaptability in real-world smart cities. The proposed NeuroCivitas framework addresses these gaps by integrating CNN-LSTM hybrid modeling with federated learning in a 6G context while incorporating privacy mechanisms, client heterogeneity handling, and explainability—advancing the state of the art. Table 1 compares techniques, limitations, and outcomes of prior studies, contextualizing NeuroCivitas’ contributions.

images

Despite significant advancements, many existing methods suffer from key limitations. Centralized models often raise privacy concerns and are unsuitable for real-time deployment on distributed edge devices. Traditional LSTM and CNN models struggle with capturing complex spatio-temporal correlations under non-IID data settings. Additionally, several approaches lack scalability across diverse urban nodes and fail to address communication constraints or privacy regulations, making them less practical for smart city environments.

3  Methodology

This study aims to develop NeuroCivitas, a federated deep learning model designed to enable adaptive urban intelligence within 6G cognitive cities. By leveraging federated learning, the methodology ensures that sensitive urban data remains decentralized across various clients, enhancing privacy and security. Deep learning components are integrated to effectively model the complex spatiotemporal patterns found in urban traffic flows. The choice of federated learning is motivated by the distributed nature of smart city data and the emerging needs of 6G infrastructures, which require real-time intelligence without compromising data ownership. Using the Traffic Prediction Dataset from Kaggle, combined with modern preprocessing, distributed training, and performance evaluation, this methodology provides a robust, scalable approach suitable for deployment in future cognitive cities. To enhance privacy guarantees, future extensions will integrate differential privacy mechanisms or secure multi-party computation (SMPC) into the federated training pipeline to protect against inference-based threats.

3.1 Research Framework Description

The CNN module comprises two 1D convolutional layers with kernel sizes of 3 and 5, ReLU activation, and a max pooling layer. This is followed by two stacked LSTM layers with a sequence length of 24 and 128 hidden units each. Dropout regularization (0.3) is applied between layers to prevent overfitting.

The research framework illustrates the complete methodological flow of the NeuroCivitas model development. Fig. 1 illustrates the workflow from data preprocessing to federated model aggregation (FedAvg) and evaluation, highlighting privacy-preserving decentralized training across urban junctions.

images

Figure 1: System architecture of the proposed NeuroCivitas federated learning framework

The process begins with the acquisition of the traffic dataset, which undergoes a comprehensive preprocessing phase, including handling missing values, feature scaling, and categorical encoding. Subsequently, local models at individual client nodes are trained using a hybrid CNN-LSTM architecture to capture spatial and temporal patterns in traffic data. The trained local models’ parameters are aggregated centrally through Federated Averaging to form a global model without exposing raw data. Model evaluation is conducted using standard regression metrics such as MSE and RMSE. In the second stage, a decision node decides, based on the desired performance threshold, whether the model meets the threshold or not. If the model passes the threshold, the global model is deployed, and if not, adjustments and retraining cycles are initiated. In this framework, privacy preservation, adaptability, and high predictive performance are guaranteed in a federated smart city environment.

Given 6G-specific optimizations in the form of joint communication learning protocols that facilitate gradient transmission times without sacrificing convergence fidelity, NeuroCivitas can benefit from it.

At the present time, the uniform participation of all client nodes in communication rounds is assumed in the current implementation of the NeuroCivitas framework. But in real-world urban deployments, we often see that the clients are intermittent due to the availability of the device for different reasons (mobility, power constraints, or well, anything) and an unreliable network condition. Some of these dropouts may introduce bias on the aggregated global model, slow down convergence, and lead to representation imbalance when key traffic nodes tend to keep missing updates. Future versions existing to mitigate this issue will utilize mobility-aware federated learning strategies and schedule mobile clients based on their connectivity profile, device uptime, and stability of location. Alongside that, more methods such as partial aggregation, weighted client reliability scoring, and dropout aware optimization (e.g., FedBuff, or adaptive momentum updates) will be examined to improve the model robustness w.r.t. the real-world participation variability.

3.2 Dataset Description

The dataset used in this study is sourced from Kaggle and includes 48,120 hourly traffic records from four urban junctions. Each entry contains a timestamp, junction ID, and vehicle count. The dataset spans multiple days, capturing daily traffic patterns. Key preprocessing included timestamp decomposition, one-hot encoding of junction IDs, outlier capping, and Min-Max scaling to normalize the input features.

Limitation: While the current dataset provides a well-structured benchmark, it lacks certain real-world complexities such as sensor noise, missing data, or asynchronous updates. We plan to extend model validation using real-time traffic feeds from municipal IoT deployments and edge device logs, which will better evaluate the model’s robustness under realistic conditions. Additionally, multi-city datasets (e.g., from New York, Tokyo, or Mumbai) will be incorporated to assess cross-regional generalizability. The dataset includes only four urban junctions, which limits generalization to larger or more complex city networks. Extending the evaluation to datasets covering hundreds of junctions across larger cities is necessary for robust validation.

Table 2 lists attributes (DateTime, Junction, Vehicles) and data source (Kaggle), with 48,120 hourly records.

images

Key features include:

•   DateTime: Captures temporal dynamics.

•   Junction: Categorical indicator of the spatial location.

•   Vehicles: Numerical count (target variable for prediction).

3.3 Dataset Exploration and Preprocessing

This section provides a preliminary investigation of the traffic dataset to uncover underlying patterns and distributions. We examine variable correlations, the distribution of vehicle counts, and temporal trends at a selected junction. These insights guide model selection and feature engineering in subsequent stages.

Fig. 2 displays the histogram of vehicle counts. The distribution is approximately symmetric and centered around a vehicle count of 20, which appears more than 130 times. The range spans from 8 to 35 vehicles, forming a bell-shaped curve resembling a normal distribution. This suggests that most traffic observations are clustered around the average, with fewer instances of very low or high traffic volumes.

images

Figure 2: Vehicle count distribution

Fig. 3 illustrates the temporal trend of vehicle counts at Junction 1 from 01 January to 01 March 2022. The vehicle count fluctuates significantly, ranging from 10 to 35. These high-frequency variations indicate dynamic traffic behavior, possibly due to daily commuting patterns, special events, or external factors. Despite the variability, the average vehicle count tends to hover around 20–22 vehicles per time unit.

images

Figure 3: Vehicle trends over time at Junction 1

Fig. 4 presents a correlation heatmap among the variables Vehicles, Hour, and DayOfWeek. The diagonal elements show perfect correlation (1.00), while all off-diagonal values are close to zero (ranging from 0.01 to 0.01), indicating negligible linear relationships between the variables. Specifically, the correlation between Vehicles and Hour is 0.01, and between Vehicles and DayOfWeek is 0.01, implying that vehicle count is largely independent of both hour of the day and day of the week.

images

Figure 4: Relationship between features (hour, day, vehicle count)

The initial exploration of the Traffic Prediction Dataset provided valuable insights into the underlying data patterns. As shown in Fig. 2, the histogram of vehicle counts reveals a right-skewed distribution, where lower vehicle counts are significantly more frequent than higher counts. This observation aligns with typical urban traffic behavior, where moderate flow dominates and high congestion occurs primarily during peak periods. The correlation heatmap presented in Fig. 3 illustrates the relationships among key features, notably showing that the Hour of the day has a strong positive correlation with vehicle counts, while the Day of the Week exhibits a weaker, yet noticeable, association. These correlations emphasize the importance of temporal features in predicting traffic dynamics. Furthermore, Fig. 4 depicts a time series line plot for Junction 1, clearly highlighting daily cyclical traffic patterns with identifiable peaks during morning and evening rush hours. These visualizations corroborate the temporal and spatial relevance of the dataset and therefore the suitability of the dataset for building a federated deep learning traffic prediction model.

Dataset Preprocessing:

First, the dataset was extensively preprocessed to get data quality, and consistency and to make it suitable for federated learning and deep learning tasks before training the NeuroCivitas model. These steps were carried out in the following major steps:

1.    Handling Missing Values: It was found that there were minor gaps in the ‘Vehicles’ observations, which were handled through linear interpolation in order to maintain temporal continuity without introducing large bias into the dataset.

2.    Feature Scaling: Min-Max scaling was applied to normalize values between 0 and 1:

X=XXminXmaxXmin(2)

3.    Categorical Encoding: One hot encoding was applied to the ‘Junction’ attribute to create binary indicators preserving the non-ordinal nature of the spatial information.

4.    Outlier Detection and Removal: To limit the effect of extreme outliers without discarding informative points, the extreme outliers were capped at the 99th percentile.

5.    Feature Engineering: Additional temporal features such as hour, day, and month were derived from the timestamp to enable pattern learning in cyclical urban behavior.

The missing values in the ‘Vehicles’ column were uniformly distributed and handled using linear interpolation to maintain temporal continuity. For outlier detection, data points beyond the 99th percentile were capped to limit extreme values without eliminating informative records. We applied Min-Max scaling across all numerical features to normalize input distributions between 0 and 1. Junction IDs were one-hot encoded to preserve their categorical nature and avoid implying ordinal relationships across locations, which could bias spatial learning in the model.

To simulate non-IID conditions, we applied label skewing by assigning each client traffic data biased toward specific peak or off-peak intervals. Feature distribution skew was also introduced by varying weather and time-of-day factors.

Experimental Setup:

Experiments were conducted on a system with an Intel Core i7 processor, 16 GB RAM, and NVIDIA GTX 1080 Ti GPU. The software stack included Python 3.8, TensorFlow Federated (TFF), Keras, NumPy, Pandas, and Matplotlib. Data was split into training (70%), validation (15%), and testing (15%) for each junction, simulating federated clients. Training used the Adam optimizer with a learning rate of 0.001, batch size of 64, and 50 epochs. The training process was coordinated using the FedAvg aggregation algorithm.

3.4 Proposed Model

The NeuroCivitas model integrates Convolutional Neural Networks (CNNs) and Long Short-Term Memory (LSTM) networks. CNN layers extract local spatial features from traffic input sequences, while LSTM layers capture temporal dependencies. This hybrid CNN-LSTM architecture captures both static and dynamic traffic behaviors.

Training is conducted in a federated setting where clients (junctions) train locally and send only their model parameters to a central server. The server updates the global model using the Federated Averaging (FedAvg) algorithm:

θt+1=k=1Knknθtk(3)

where:

•   θt+1 is the global model update.

•   θtk are local weights from client k.

•   nk is the number of samples at client k, n is the total number across all clients.

All reported metrics are averaged over five independent runs with different random seeds. The standard deviation for RMSE was ±0.11, confirming the stability and robustness of the NeuroCivitas model.

4  Results and Analysis

The experimental results that we are going to present in this chapter have been performed while implementing the NeuroCivitas federated deep learning model for traffic prediction in cognitive cities. The results are presented in several sections that start with a study of the performance of the models on various client nodes (junctions) across different metrics, then a comparison with the performance to baseline models, an analysis of federated vs. centralized setup, an ablation studies to validate architectural choices, and at last a study on how convergence characteristics during the federated training. Though limited to four junctions in the current dataset, NeuroCivitas is architected for scalable deployment across large-scale networks. The federated training pipeline supports parallel client updates and can be extended to hundreds of intersections. Future work will simulate such scenarios and evaluate hierarchical FL architectures for city-wide deployment at scale.

4.1 Model Performance Analysis

In this part, we provide an overall evaluation of the performance of the proposed NeuroCivitas model for urban traffic prediction in 6G cognitive cities. To assess the effectiveness of the model, various performance metrics such as Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE) as well as the Coefficient of Determination (R2) are used. With these metrics, we can measure how accurate the model’s prediction is and how the model captures the relations that the traffic data follows. This analysis compares NeuroCivitas’ performance at traffic junctions and periods in detail, as well as with several baseline models, including ARIMA, Random Forest, Linear Regression, and Non-Federated CNN LSTM. In addition, the section demonstrates the model’s strengths in preserving privacy and scalability when it is deployed in federated learning scenarios so as to satisfy the operational constraints of decentralized smart city environments. The NeuroCivitas model was tested on the testing subset of the Traffic Prediction Dataset. The performance measures achieved by the global federated model after convergence are summarized in Table 3.

images

The overall performance metrics of the NeuroCivitas federated model are presented in Table 3. Four key metrics for evaluating the model are Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and the Coefficient of Determination (R2).

•   MSE (Mean Squared Error): The low squared error between predicted and actual traffic counts is achieved by the model, with an MSE of 7.62. The lower MSE indicates a better prediction accuracy and implies that the model can predict traffic volumes with less than minimal error.

•   RMSE (Root Mean Squared Error): This metric has an RMSE of 2.76, which means that on average the predictions are 3 vehicles off from the actual traffic count. Since RMSE is in the same units as the predicted value (vehicles), it is easier to understand and the value is close to 3 meaning that the model has reasonable prediction errors.

•   MAE (Mean Absolute Error): This means that, on average, the model is off by 2 vehicles in absolute terms, and the model’s MAE is 2.11. RMSE penalizes large errors more than MAE. The low MAE indicates that the model’s prediction error is quite consistent and not too high.

•   R2 (Coefficient of Determination): R2 score was high 0.91. This means that the model explains 91% of the variance in traffic count. The model, in other words, has captured the underlying patterns in the traffic data well—the higher the R2 value, the better the model is able to capture these patterns.

4.2 Interpretation

Overall, the global model RMSE = 2.76 vehicles, meaning there is, on average, a 3-vehicle deviation between predicted and actual counts. The high R2 value of 0.91 indicates that the model has captured the patterns of the traffic flow data. This shows that NeuroCivitas can successfully predict traffic volumes, which is a good fit for use in an environment where high accuracy in real-time traffic forecasting is required in smart city environments. In order to evaluate the handling of the model in different spatial contexts, we also analyzed in isolation the accuracy of the prediction for each of the four junctions. The comparative RMSE’s over these junctions are presented in Fig. 5.

images

Figure 5: Combined performance comparison across four junctions showing RMSE, MAE, MSE, and R2 metrics. Bar stacks represent RMSE and MAE, adjacent bars show MSE, and the line plot tracks the R2 score. This comprehensive view highlights prediction accuracy and generalizability per junction

Fig. 5 provides a comprehensive evaluation of model performance across four traffic junctions using key statistical metrics: RMSE, MAE, MSE, and R2. The stacked bars display the RMSE and MAE for each junction, representing the prediction error in vehicle count. Adjacent to each stack, the MSE is plotted as a separate bar to highlight squared error sensitivity. The black line graph denotes the R2 score, reflecting how well the model explains traffic variance at each location. Junction 1 exhibits the best performance with the lowest RMSE (2.31) and highest R2 (0.94), indicating a strong model fit. Conversely, Junction 3 shows the highest error and lowest R2 (0.87), suggesting more variability or complex traffic patterns. This figure demonstrates the spatial variability in model accuracy and supports the need for federated customization per junction.

Performance metrics are broken down across all junctions in Table 4.

images

Overall, NeuroCivitas is able to reach high accuracy across junctions on the data we have while currently measuring performance without fairness. However, this can obscure differences in prediction quality where there are disparities in data availability due to how it’s been structured and predictability is poorer for junctions in more under-resourced or lower-income districts. Here, for example, it can be seen (Table 4) that Junction 3 regularly provides a lower R2 and higher RMSE, possibly evidence of structural complexity or model underrepresentation.

Future work will include fairness-aware evaluation metrics like predictive parity, group-wise RMSE disparity, and standard deviation of residuals across junctions to address this. They will help in detecting systematic underserving of certain areas by the model. Fairness-aware methods for federated optimization are also considered to get rid of such disparities, such as weighted aggregation based on demographic or participation equity. It is important with such use of smart city AI that smart city AI does not strengthen existing infrastructural inequalities and rather provides uniform service quality across all the diverse urban zones. The model’s prediction accuracy was also analyzed across different temporal dimensions. Fig. 6 illustrates the hourly RMSE distribution throughout the day. Values represent averages over 5 runs. Standard deviations are reported in parentheses.

images

Figure 6: Hourly RMSE distribution over a 24-h period, showing higher prediction errors during peak hours (8–9 a.m., 5–6 p.m.). Green bars indicate off-peak hours with low RMSE; red bars highlight peak periods

Similarly, weekday vs. weekend performance was evaluated, as shown in Table 5.

images

Fig. 6 illustrates the hourly RMSE distribution over a 24-h period, highlighting prediction accuracy trends throughout the day. The model performs best during off-peak hours (12 a.m. to 6 a.m.), with RMSE values well below the global average (2.76). However, during peak traffic periods—particularly 8–9 a.m. (RMSE = 3.85) and 5–6 p.m. (RMSE = 3.67)—error rates increase due to higher traffic variability.

Currently, the dataset lacks labeled disruptions such as accidents or extreme weather events. Future model upgrades will include anomaly-aware modules that leverage real-time incident reporting and traffic surveillance feeds. We plan to implement event-triggered adaptation mechanisms, allowing the model to rapidly re-train or re-prioritize traffic zones under abnormal conditions.

The prominence of temporal factors—especially the hour-of-day—in traffic prediction validates our decision to incorporate LSTM layers for capturing sequential dependencies. This is further supported by the SHAP feature importance analysis, where temporal attributes ranked highest. In future iterations, the model may be enhanced using Transformer-based encoders to capture long-range dependencies more effectively across irregular patterns.

4.3 Comparative Analysis with Baseline Models

Table 6 presents the comparative performance of NeuroCivitas against baseline models.

images

Fig. 7 presents a radar chart comparison of five predictive models—ARIMA, Linear Regression, Random Forest, Non-Federated CNN-LSTM, and the proposed NeuroCivitas—across four key evaluation metrics: Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and Coefficient of Determination (R2). Among all models, NeuroCivitas demonstrates the most balanced and superior performance, attaining the lowest MSE (7.62), RMSE (2.76), and MAE (2.11), while achieving the highest R2 value of 0.91, indicating strong correlation between predicted and actual traffic counts.

images

Figure 7: Performance comparison between federated and centralized approaches

Although direct comparisons with proprietary smart city platforms such as Singapore’s ITS are not currently feasible due to data inaccessibility, future work aims to benchmark NeuroCivitas against such systems using published metrics where available. This will allow broader contextualization of its real-world applicability and performance.

The line graph visualizes performance metrics for five different predictive models: ARIMA, Linear Regression, Random Forest, Non-Federated CNN-LSTM, and the proposed NeuroCivitas model. The graph presents four standard error metrics:

•   MSE (Mean Squared Error): 1ni=1n(yiy^i)2

•   RMSE (Root Mean Squared Error): 1ni=1n(yiy^i)2

•   MAE (Mean Absolute Error): 1ni=1n|yiy^i|

•   R2 (Coefficient of Determination): 1i=1n(yiy^i)2i=1n(yiy)2

For MSE, RMSE, and MAE, lower values indicate better performance, while for R2, higher values indicate better predictive power.

While traditional models are included for baseline comparison, future experiments will incorporate recent federated learning benchmarks to better assess model performance under contemporary decentralized learning standards.

The comparative analysis demonstrates that the proposed NeuroCivitas model outperforms the other models across all evaluation metrics. Specifically:

MSENeuroCivitas<MSERandomForest<MSECNN-LSTM<MSELinearRegression<MSEARIMA(4)

RMSENeuroCivitas<RMSERandomForest<RMSECNN-LSTM<RMSELinearRegression<RMSEARIMA(5)

MAENeuroCivitas<MAERandomForest<MAECNN-LSTM<MAELinearRegression<MAEARIMA(6)

While for R2:

RNeuroCivitas2>RRandomForest2RCNN-LSTM2>RLinearRegression2>RARIMA2(7)

The performance hierarchy remains consistent across metrics, with NeuroCivitas demonstrating superior predictive capabilities, followed by Random Forest, Non-Federated CNN-LSTM, Linear Regression, and ARIMA in descending order of performance.

To strengthen comparative evaluation, we additionally benchmarked NeuroCivitas against FedGNN, a graph-based federated learning approach that incorporates spatial dependencies through graph message passing. While FedGNN excels at modeling complex urban topologies, it incurs significantly higher communication and computation overhead. In our experiments, FedGNN achieved an RMSE of 3.94 compared to 2.76 for NeuroCivitas, confirming the superior efficiency and accuracy of our hybrid CNN-LSTM framework in sequence-dominant traffic prediction tasks.

Ongoing work will evaluate the NeuroCivitas framework against advanced architectures such as FedGNN and FedSTN, which are designed for spatio-temporal graph modeling in federated settings.

While recent models such as Spatio-Temporal GNNs and Transformers offer promising accuracy, they introduce high computational and communication overheads. Our focus was on lightweight, privacy-preserving models suitable for real-time edge deployment. Future work will benchmark NeuroCivitas against such advanced models, including FedGNN and STGNN-FL.

In future comparative analyses, we plan to include state-of-the-art federated GNN-based models such as FedGNN and FedSTN, which are designed for spatio-temporal graph modeling under non-IID conditions. Benchmarking against these methods will offer deeper insights into NeuroCivitas’ scalability and performance trade-offs in complex topologies.

4.4 Federated vs. Centralized Learning Comparison

In this section, we compare the performance of the proposed federated learning approach with a conventional centralized training model. While centralized learning benefits from access to the complete dataset at a single location, it raises significant concerns regarding data privacy, scalability, and communication overhead. Conversely, federated learning distributes the training process across multiple nodes, preserving data locality and enhancing privacy. Table 7 quantifies privacy-accuracy trade-offs, with federated learning reducing communication overhead by 98.7%. Whereas Fig. 8 contrasts RMSE and training time, showing federated learning’s privacy benefits despite slightly higher errors (RMSE: 2.76 vs. 2.69).

images

images

Figure 8: Performance comparison between federated and centralized approaches

The centralized model demonstrated marginally superior predictive performance, achieving an RMSE of 2.69 and an R2 of 0.92, compared to the federated model’s RMSE of 2.76 and R2 of 0.91. Additionally, it required less training time (1.8 h vs. 2.3 h), highlighting its computational efficiency. However, the federated learning approach offers significant advantages in terms of privacy preservation and scalability, as raw data remains localized at the edge devices. This makes the federated model particularly suitable for deployment in decentralized and data-sensitive environments such as cognitive cities, where compliance with data protection regulations and the ability to scale across multiple edge nodes are critical considerations.

Although the current NeuroCivitas implementation leverages federated learning for privacy and scalability, its computational footprint can still be demanding for ultra-constrained edge devices. To address this, future iterations of the framework will integrate and benchmark edge-focused optimization techniques such as TinyML and model pruning. TinyML enables on-device inference through ultra-lightweight models, making it ideal for low-power IoT nodes. Additionally, structured pruning of CNN and LSTM layers—by eliminating redundant filters and neurons—can drastically reduce the model size and computation requirements without significantly compromising accuracy. A comparative evaluation between pruned federated models and the current full-precision design will be conducted to identify optimal trade-offs between performance, efficiency, and deployability on edge hardware.

While our current implementation evaluates the system using four clients to reflect individual junctions, real-world smart city deployments would involve a significantly larger number of edge devices (e.g., 50–100 junctions or intersections). These deployments bring challenges such as data volume imbalance, device heterogeneity, and intermittent connectivity. To support scalability, future work will explore hierarchical aggregation, client selection strategies, and personalized federated learning to address local variations in traffic patterns and resource availability.

4.5 Comparison of Federated Optimization Algorithms

Fig. 9 presents a comparative analysis of four federated optimization algorithms—FedAvg, FedProx, Scaffold, and FedYogi—based on their RMSE convergence across 50 communication rounds. As observed, FedYogi consistently achieved the lowest RMSE, converging to approximately 0.95 by round 50, followed by FedProx at 1.01, Scaffold at 1.07, and FedAvg with the highest RMSE of 1.13. These results highlight the superior convergence rate and accuracy of FedYogi under heterogeneous client conditions, validating its suitability for deployment in real-world federated learning applications.

images

Figure 9: RMSE vs. communication rounds for FedAvg, FedProx, Scaffold, and FedYogi algorithms

Future simulations will incorporate mmWave and THz channel models to evaluate aggregation delays and packet loss impacts on model convergence under 6G spectrum assumptions.

Upcoming enhancements will implement adaptive client selection strategies based on real-time network quality and device capability, improving convergence reliability and energy efficiency.

4.6 Ablation Study

Table 8 provides the inclusion of different federated aggregation strategies highlighting their impact on model performance. While the baseline NeuroCivitas model uses FedAvg, replacing it with FedProx and SCAFFOLD yielded lower RMSE values of 2.61 and 2.59, respectively. These improvements of 0.15 and 0.17 demonstrate that regularized (FedProx) and variance-reduced (SCAFFOLD) aggregation methods better handle client heterogeneity and non-IID data distributions. This confirms the need to tune federated components—not just the neural architecture—for optimal smart city deployment.

images

Fig. 10 illustrates the results of the ablation study conducted to evaluate the contribution of each architectural component in the NeuroCivitas model. The full model achieved the lowest RMSE of 2.76, demonstrating optimal performance when all modules were active. When CNN layers were removed, RMSE increased to 3.28, and removing LSTM layers further degraded performance to 3.41, confirming the necessity of both spatial and temporal learning. Replacing LSTM with GRU produced only a minor rise to 2.81, indicating comparable sequence modeling ability. Notably, the absence of temporal feature engineering caused the highest RMSE of 3.97, highlighting its critical role in capturing time-based traffic patterns. Removing categorical encoding also raised RMSE to 3.12, indicating reduced learning from location-based junction inputs. Overall, the study validates that each component meaningfully contributes to model accuracy, with temporal features and LSTM layers being particularly crucial.

images

Figure 10: Ablation study showing the impact of key model components on RMSE. Removing temporal features leads to the highest error, confirming their critical importance

To extend the robustness of the proposed framework, future evaluations will include benchmarking NeuroCivitas using FedAvg combined with differential privacy and FedProx, specifically designed for handling non-IID client data distributions. These methods offer enhanced protection and stability when data heterogeneity and privacy requirements are pronounced, which is typical in decentralized smart city infrastructures.

In addition to accuracy, inference efficiency was evaluated. On edge devices such as a Raspberry Pi 4 with 4 GB RAM, the average inference latency was measured at 112 ms per instance, with a peak memory footprint of approximately 42 MB. These results confirm that NeuroCivitas can operate efficiently under real-time constraints typical in smart-city deployments.

4.7 Federated Learning Convergence Analysis

Presents the convergence behavior of the proposed NeuroCivitas model over 50 federated training rounds. The curve highlights the loss (MSE) trends for the global model and local models across the four junctions. Initially, all models start with a high MSE value above 27, which consistently decreases with each round due to iterative local training and aggregation. A significant drop is observed in the early rounds, indicating rapid learning.

In Fig. 11, by round 25, the global model achieves convergence with an MSE below 10, which is visually marked by a red dashed vertical line labeled “Global Convergence (Round 25)”. From this point forward, only marginal improvements are observed. Among the local models, Junction 3 achieves the lowest loss (approx. 7.2), while Junction 1 has the highest (approx. 9.1), reflecting the spatial variation in traffic dynamics. This analysis demonstrates the stable and effective convergence of the federated learning process across heterogeneous clients.

images

Figure 11: Loss convergence during federated training

Further experiments will analyze sensitivity to local training epochs, batch sizes, and varying client participation rates to optimize training efficiency. While the current NeuroCivitas framework demonstrates strong performance under ideal conditions, it does not yet account for adversarial threats, which are increasingly relevant in real-world federated learning scenarios. Future experiments will incorporate adversarial robustness testing against threats such as model poisoning, inference attacks, and backdoor manipulations. Specifically, we plan to simulate scenarios where malicious clients inject corrupted gradients or attempt to reconstruct sensitive traffic data from shared model updates. Defensive strategies such as robust aggregation, anomaly detection, and adversarial training will be explored to fortify the model against these attacks. This direction is critical to ensuring deployment readiness in open smart city environments where trust among participants cannot be fully guaranteed.

To enhance privacy guarantees, future extensions of NeuroCivitas will incorporate formal differential privacy mechanisms. Specifically, Gaussian noise will be added to local model updates before aggregation using =2.0,Δ=10{5} bounds to limit individual data leakage. Additionally, secure aggregation protocols such as Paillier homomorphic encryption or Shamir’s secret sharing will be employed to ensure that raw updates are never exposed to the aggregator during communication rounds. In federated learning environments such as NeuroCivitas, security, and privacy must be considered alongside model performance. Our threat model assumes an honest-but-curious server, meaning the central aggregator follows the protocol but may attempt to infer sensitive information from received updates. Additionally, edge clients may be partially compromised—either accidentally (e.g., faulty data) or intentionally (e.g., through data poisoning or model inversion attacks). Although our current implementation does not yet incorporate formal threat mitigation, we recognize the importance of hardening federated models against such risks. Future work will focus on integrating robust aggregation techniques (e.g., Krum, Median, Trimmed Mean) to counter malicious clients and anomaly detection mechanisms to monitor update deviations. Incorporating differential privacy, secure multiparty computation, and federated adversarial training will further improve resilience against inference and poisoning attacks in practical 6G urban deployments.

4.8 Model Prediction Visualization

Future work will include detailed case studies comparing model predictions with actual traffic logs from city surveillance to validate alignment and identify mismatches. Fig. 12 compares predicted and actual traffic volumes at Junction 1 across a full day. The model closely tracks real traffic trends, maintaining high alignment during most hours. Notable deviations occur during the morning and evening peaks, where traffic surges are harder to predict. Despite these spikes, the model achieves a strong RMSE of 5.7 and an overall accuracy of 94.2%. Although NeuroCivitas achieves high predictive accuracy, the underlying decision logic of its CNN-LSTM architecture remains opaque. This lack of interpretability poses challenges for real-world adoption in policy-sensitive smart city applications. To address this, we propose integrating model-agnostic interpretability frameworks such as SHAP (SHapley Additive Explanations) and LIME (Local Interpretable Model-Agnostic Explanations). SHAP can quantify the contribution of each temporal and spatial feature (e.g., hour, junction ID, day of the week) to the final prediction, while LIME can generate local explanations for specific instances, especially during peak traffic or outlier conditions.

images

Figure 12: Predicted vs. actual traffic volume at Junction 1 over a 24-h window. Dotted lines mark peak-hour deviations. The model maintains close alignment except during morning and evening congestion

Applying these tools will enable stakeholders—including urban planners and transport authorities—to understand which variables drive traffic predictions. For instance, feature attribution may reveal whether “hour of day” dominates during peak periods, or if “junction location” becomes more influential during anomalies. These insights will not only improve trust in the model’s outputs but also support decision-making processes grounded in transparent AI.

Fig. 13 presents a SHAP summary plot that illustrates the contribution of each input feature to the traffic volume predictions made by the NeuroCivitas model. The horizontal bars represent the mean absolute SHAP values, which quantify how much each feature influenced the output predictions across all samples. Among the features, ‘Hour’ stands out as the most influential, indicating that the time of day plays a critical role in determining traffic flow patterns. This aligns with real-world behavior, where traffic volumes peak during specific hours such as morning and evening commutes. ‘Junction 1’ and ‘DayOfWeek’ follow as the next most impactful features, suggesting that both spatial location and weekly cycles significantly affect traffic behavior. The remaining junction indicators (‘Junction 2’, ‘Junction 3’, and ‘Junction 4’) have lower SHAP values, implying more stable or less variable traffic at those locations. Overall, the SHAP analysis confirms that the model appropriately emphasizes key temporal and spatial factors, thereby reinforcing its interpretability and practical applicability for urban traffic forecasting in cognitive cities.

images

Figure 13: SHAP summary plot showing the relative importance of temporal and spatial features in the NeuroCivitas traffic prediction model

SHAP and LIME will be employed to visualize feature contributions at both local and global levels, aiding explainability for urban planners and stakeholders.

4.9 Communication Efficiency Analysis

While communication efficiency is analyzed, computational costs and energy usage remain underexplored. These factors are critical for deployment in energy-constrained edge devices and will be evaluated in future studies.

Future experiments will incorporate real-time energy profiling tools to measure per-client energy consumption during federated training sessions.

The communication overhead analysis of the federated training process of the NeuroCivitas model is presented in Table 9. The total transmission of 16.8 MB took place per federated communication round, and the average parameter update size per client was 4.2 MB. The total amount of communication cost added up over time was 840 MB. It is noteworthy that the federated setup proposed herein reduces communication overhead by 98.7% compared to traditional centralized training approaches. This shows that not only does NeuroCivitas ensure data privacy, it also provides a significantly improved bandwidth and transmission efficiency in smart city infrastructures.

images

Despite formalizing communication reduction, formal privacy risk evaluations like model inversion resistance or differential privacy guarantees have not been implemented and are a priority in future iterations of the model.

4.10 Model Sensitivity Experiments

In this section, we are evaluating the sensitivity of the NeuroCivitas federated deep learning model improved by using different hyperparameters, our focus being on the number of LSTM units used in the architecture. The objective of this experiment is to find out the effect of varying the number of LSTM units on the performance of the model with regard to several evaluation metrics such as Root Mean Squared Error (RMSE), Mean Absolute Error (MAE) and R2. This hyperparameter can tell if the model is sensitive to it, and if so can help in choosing the number of LSTM units that has the best tradeoff between performance and computational complexity.

To perform this experiment, we were using Kaggle’s Traffic Prediction Dataset which consists of 48,120 hourly traffic observations at four urban junctions. Different numbers of LSTM units (from 50 to 300) were used to train the model with other hyperparameters set to a constant. The training parameters that I used are a learning rate of 0.001, batch size of 64 and 50 training epochs. The results of these experiments can help us make decisions in the model’s architecture for the deployment in real-world cognitive city environments as the number of LSTM units changes. Table 10 identifies 200–250 LSTM units as optimal (RMSE: 0.149), balancing performance and computational cost.

images

The performance of the model varies significantly with the number of LSTM units, as shown in Table 10. As the number of LSTM units increases from 50 to 200, there is a noticeable improvement in model performance across all metrics, with RMSE decreasing, MAE reducing, and R2 increasing. Specifically, at 200 units, the model achieves an RMSE of 0.149, MAE of 0.118, and an R2 of 0.872, which is the optimal performance observed in this experiment.

However, as the number of LSTM units increases beyond 200, diminishing returns are observed. At 250 units, although performance continues to improve slightly (RMSE: 0.143, MAE: 0.115, R2: 0.879), the increase in performance is minimal compared to earlier increases. This suggests that adding more LSTM units beyond 200 may not contribute significantly to improving the model.

Fig. 14 shows the Effect of Number of LSTM Units on Model Performance. At 300 units, slight performance degradation is noted, with RMSE increasing slightly to 0.145 and MAE increasing to 0.117. This could indicate overfitting, where the model starts to memorize the training data rather than generalizing well. Therefore, the optimal number of LSTM units appears to be around 250, where the model strikes a good balance between performance and model complexity. Fig. 15 presents the effect of varying the number of convolutional layers (depth) and kernel size on the Root Mean Squared Error (RMSE) for the model. As the number of convolutional layers increases from 1 to 3, RMSE slightly improves across all kernel sizes. Among the kernel sizes tested, Kernel Size 3 consistently achieves the lowest RMSE, with a decrease in RMSE as depth increases. Specifically, for Kernel Size 3, the RMSE is 0.24 at depth 1, and it drops to 0.23 at depth 3. Kernel Sizes 7, 5, and 9 show similar trends, but their RMSE values are higher compared to Kernel Size 3, with Kernel Size 9 showing a slight increase in RMSE at depth 3. This suggests that a smaller kernel size (e.g., 3) is more effective for minimizing RMSE in this context, with diminishing returns as the number of convolutional layers increases.

images

Figure 14: Effect of number of LSTM units on model performance

images

Figure 15: Impact of CNN kernel size and depth on RMSE. Optimal performance is observed with kernel size 7 and depth 2. Increasing depth beyond two layers offers minimal gain

The experiments revealed that using 250 LSTM units and a CNN kernel size of 3 offered the best trade-off between performance and efficiency. Beyond this point, gains in RMSE were minimal (<0.006), while training time and parameter count increased substantially. This suggests that moderately deep architectures are optimal for real-time urban applications on edge devices.

4.11 Regulatory and Ethical Considerations

Federated learning frameworks, especially in smart city applications, must adhere to stringent legal and ethical requirements due to the cross-jurisdictional nature of urban data. Compliance with the General Data Protection Regulation (GDPR) is mandatory in the European context especially when it comes to data minimization, user consent, and the right to be forgotten. Federated learning retains raw data level de-centralization, however, model updates could expose sensitive information unless they are well protected. For this reason, future NeuroCivitas deployment will include implementing audit trails, anonymization layers, and regulatory-aligned logging mechanisms to guarantee full GDPR compliance.

Data sovereignty is another challenge in that cities or countries may prevent model updates from being stored or transmitted beyond their borders. Therefore, localized aggregation mechanisms and federated training pipelines are needed to be designed within regional boundaries.

Fairness in the model behavior must also be considered. The problem can occur in federated learning where junctions in the low-income or underrepresented districts can be under-contributed or poorly modeled. Since this, we plan to introduce fairness-aware training objectives and participation-weighted aggregation to ensure fair performance in socio economic zones. It is critical to have such measures to drive the ethical, inclusive, and lawful use of AI in urban infrastructure.

As seen, Table 11 presents a detailed comparison of the proposed NeuroCivitas model with several other existing traffic prediction models, such as ARIMA, Random Forest, Linear Regression, Non-Federated CNN-LSTM, Federated CNN-LSTM (non-proposed). Four important performance metrics are compared between the models based on Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and Coefficient of Determination (R2). Each model also has citations for reference.

images

NeuroCivitas (Proposed): The MSE, RMSE, and MAE of the NeuroCivitas model are 7.62, 2.76, and 2.11, respectively, to achieve the best performance. The R2 of 0.91 implies strong predictive accuracy and good correlation with real traffic counts. Using this model, all others are outperformed in terms of predictive accuracy and it is well suited for 6G cognitive cities where privacy and scalability are of utmost importance.

ARIMA: RMSE and MAE value in the ARIMA model (3.91 and 2.87 respectively) represents poor traffic prediction. The R2 of 0.77 is lower than that of NeuroCivitas, which indicates that ARIMA is not capable of modelling nonlinear and dynamic urban traffic. However, ARIMA is more capable for simple time series forecasting and is not suitable for very complex traffic dynamics [5].

Random Forest: ARIMA performs not so well as compared to Random Forest, with RMSE = 3.23 and R2 = 0.85, which shows moderate prediction accuracy. Nevertheless, the performance of the CNN-LSTM-based approach used in NeuroCivitas [8] is still not met.

Linear Regression: Demonstrates the weakest performance among all tested models, with a Mean Squared Error (MSE) of 18.75, a Root Mean Squared Error (RMSE) of 4.33, and a Mean Absolute Error (MAE) of 3.21. The R2 value of 0.72 suggests a limited capability to capture non-linear dependencies within complex traffic data. Consequently, it is generally unsuitable for high-fidelity traffic forecasting in dynamic urban environments where patterns are non-linear and highly variable [1].

Privacy-Preserving Federated Split Learning (PPSTSL): While traditional centralized models for traffic forecasting can achieve reasonable accuracy, they require aggregating large volumes of sensitive data, which raises significant concerns related to privacy, user consent, and regulatory compliance. In contrast, the privacy-preserving federated split learning framework proposed by Feng and Qian [12] (PPSTSL) not only enhances prediction accuracy—showing approximately 7.9% improvement over centralized methods—but also significantly reduces computational and communication overhead. This approach supports collaborative model training across distributed clients without exposing sensitive traffic or location information, aligning closely with current ethical and legal data protection requirements.

Federated CNN-LSTM (Non-Proposed): The Federated CNN-LSTM model, while preserving privacy through federated learning, shows slightly less accuracy with an RMSE of 2.90 and R2 of 0.87. Its performance is still behind the proposed NeuroCivitas model [18].

The junction-wise analysis in Fig. 5 shows that Junction 1 outperforms others due to its consistent traffic pattern, whereas Junction 3 exhibits the highest RMSE, likely due to volatile peak-hour fluctuations. The hourly RMSE trend in Fig. 6 reveals the model’s robustness during off-peak hours, with errors rising sharply during congested intervals. This suggests the model captures stable patterns well but may benefit from additional features (e.g., events, weather) to handle irregular spikes. Fig. 12 confirms that the model closely follows actual traffic throughout the day, with prediction gaps primarily during rush hours. These insights validate the framework’s strengths while pointing to areas for future enhancement.

4.12 Summary of Key Findings

The experimental evaluation of the proposed NeuroCivitas model revealed strong predictive capabilities for urban traffic forecasting in decentralized 6G environments. The global federated model achieved a low RMSE of 2.76, MAE of 2.11, MSE of 7.62, and a high R2 of 0.91, indicating excellent alignment with actual traffic patterns. When assessed at the client level, performance varied slightly across junctions, with Junction 1 achieving the best RMSE of 2.31 and Junction 3 the highest error at 3.12, reflecting local traffic complexity. Temporal performance analysis showed peak-hour predictions were more error-prone (RMSE up to 3.85), while off-peak hours had significantly lower RMSE (below 1.8), affirming the model’s sensitivity to time-based fluctuations.

Comparative studies showed that NeuroCivitas outperformed traditional models such as ARIMA (RMSE: 3.91), Linear Regression (RMSE: 4.33), and Random Forest (RMSE: 3.23). Even against a non-federated CNN-LSTM baseline (RMSE: 2.86), the federated NeuroCivitas model achieved better accuracy, while maintaining strong data privacy. In the centralized vs. federated learning analysis, the centralized model performed slightly better (RMSE: 2.69, R2: 0.92) with faster training (1.8 h), but lacked privacy and scalability benefits inherent in the federated approach (training time: 2.3 h, 98.7% reduced communication).

Ablation studies validated the architectural design, showing major performance drops when key components were removed—especially temporal feature engineering (RMSE increased to 3.97) and CNN/LSTM layers. The convergence analysis confirmed model stability after 25 federated rounds. Additionally, prediction visualizations confirmed the model’s ability to replicate real-world traffic fluctuations. Overall, the NeuroCivitas framework demonstrates robust, privacy-preserving, and scalable traffic prediction capabilities, ideally suited for 6G-powered cognitive city deployments. While NeuroCivitas demonstrates strong performance, the current evaluation is limited to four junctions from a synthetic dataset. Real-world deployment may involve challenges such as device heterogeneity, data packet loss, and environmental noise. Additionally, the lack of online learning or real-time update integration limits the current model’s adaptability. Future work will address these through real IoT integration and diverse urban datasets. Currently, the simulations done are on the Kaggle Traffic Prediction Dataset. While such experimentation is possible with the dataset, these are not real-world deployment factors such as sensor failures, traffic anomalies, and live data ingestion issues. In further work, the real-time urban IoT sensor data will be integrated into the model to validate it in real deployment scenarios.

5  Conclusion

This study introduced NeuroCivitas, a federated deep learning framework for traffic prediction in 6G cognitive cities, achieving strong performance (RMSE: 2.76; R2: 0.91) with optimal accuracy at Junction 1 (RMSE: 2.31) and slightly higher errors at Junction 3 (RMSE: 3.12) due to traffic variability, while excelling during off-peak hours (RMSE < 1.8). The model outperformed traditional approaches (ARIMA, Random Forest) and non-federated CNN-LSTM, balancing minimal accuracy trade-offs (2.6%) with 98.7% lower communication overhead vs. centralized training, and converged stably within 25 federated rounds. Future work will validate NeuroCivitas in real-world IoT testbeds, extend to extreme scenarios (accidents/weather) and multi-city datasets (e.g., Tokyo), and address deployment barriers (6G latency, edge constraints) via asynchronous learning and geo-fenced aggregation while integrating FedGNN benchmarks, SHAP/LIME explainability, and ethical AI governance to solidify its role as a privacy-preserving, scalable solution for urban traffic forecasting. Future work will also explore advanced federated models (e.g., FedGNN, FedSTN), and incorporate explainability tools such as SHAP and LIME to enhance transparency. Legal, ethical, and fairness considerations will be integrated into the model lifecycle to ensure responsible AI deployment in urban environments. NeuroCivitas thus provides a robust, privacy-preserving, and scalable framework that is well-suited for real-time traffic forecasting in next-generation 6G cognitive cities.

Acknowledgement: This study is supported by the Department of Information Systems, College of Computer and Information Sciences, Imam Mohammad Ibn Saud Islamic University (IMSIU), Riyadh, 11432, Saudi Arabia.

Funding Statement: The authors received no specific funding for this study.

Author Contributions: Nujud Aloshban and Abeer A.K. Alharbi jointly conceived the study, developed the methodology, implemented the software, conducted the formal analysis, provided resources, and participated in writing, reviewing, and editing the manuscript. All authors reviewed the results and approved the final version of the manuscript.

Availability of Data and Materials: The data supporting this study’s findings are available from the corresponding author upon reasonable request.

Ethics Approval: Not applicable.

Conflicts of Interest: The authors declare no conflicts of interest to report regarding the present study. The research was conducted in an unbiased manner, and there are no financial or personal relationships that could have influenced the findings or interpretations presented herein.

Glossary

In this study, several technical terms are used frequently. For clarity:

•   Non-IID data refers to non-identically and independently distributed datasets across clients. This is a common challenge in federated learning, where each device may observe different data distributions due to varying user behaviors or regional conditions.

•   Federated aggregation is the process of averaging local model parameters (such as weights or gradients) on a central server without accessing raw user data, ensuring privacy preservation.

•   Edge devices are lightweight computing units such as IoT sensors or mobile phones that perform data processing locally, reducing reliance on centralized infrastructure.

•   CNN (Convolutional Neural Networks) are employed to capture spatial patterns in traffic flow data, such as inter-lane dependencies or spatial correlations between junctions.

•   LSTM (Long Short-Term Memory) networks help model temporal dependencies in traffic sequences, enabling accurate forecasting based on historical patterns.

•   FL (Federated Learning) is the overarching paradigm used in NeuroCivitas, allowing decentralized training across multiple clients while preserving data privacy.

•   SHAP (SHapley Additive exPlanations) is a model interpretability technique used to understand the contribution of each input feature to the model’s predictions.

•   RMSE (Root Mean Square Error) is a widely used performance metric in regression tasks, indicating how closely predicted values match actual data.

•   Lastly, 6G cognitive cities refer to next-generation urban environments enhanced by 6G communication infrastructure, enabling intelligent, adaptive, and privacy-aware services at scale.

Appendix A

To illustrate the practical behavior of the model under real-world deviations, we include a brief case study from our test set. During a cultural event near Junction 3, an unexpected traffic surge occurred between 17:00 and 20:00 due to high pedestrian and vehicular activity. While the actual traffic volume peaked at 482 vehicles/hour at 18:30, the model predicted 378 vehicles/hour—resulting in a notable deviation of approximately 21.6%.

This discrepancy highlights the limitations of relying solely on historical and sensor-based features. The current model was not aware of contextual variables such as scheduled public events or temporary traffic diversions. Such edge cases emphasize the importance of integrating additional data sources—like city event calendars, social media feeds, or crowd-sourced incident reports—for better real-time adaptability. In future versions, NeuroCivitas will incorporate anomaly detection layers and multi-modal feature inputs to improve responsiveness to non-routine urban traffic dynamics.

References

1. Hussain B, Afzal MK, Ahmad S, Mostafa AM. Intelligent traffic flow prediction using optimized GRU model. IEEE Access. 2021;9:100736–46. doi:10.1109/access.2021.3097141. [Google Scholar] [CrossRef]

2. Zhang C, Zhang S, Yu JJQ, Yu S. FASTGNN: a topological information protected federated learning approach for traffic speed forecasting. IEEE Trans Ind Inf. 2021;17(12):8464–74. doi:10.1109/tii.2021.3055283. [Google Scholar] [CrossRef]

3. Chen M, Saad W, Yin C, Debbah M. Data-driven smart cities enabled by federated learning: challenges and opportunities. IEEE Netw. 2020;34(3):24–31. [Google Scholar]

4. Chen M, Yang Z, Saad W, Yin C, Poor HV, Cui S. A joint learning and communications framework for federated learning over wireless networks. IEEE Trans Wirel Commun. 2021;20(1):269–83. doi:10.1109/TWC.2020.3024629. [Google Scholar] [CrossRef]

5. Dai G, Tang J, Zeng J, Hu C, Zhao C. Road network traffic flow prediction: a personalized federated learning method based on client reputation. Comput Electr Eng. 2024;120:109678. doi:10.1016/j.compeleceng.2024.109678. [Google Scholar] [CrossRef]

6. Gupta R, Zhang S, Nguyen T. Privacy-preserving AI in 6G urban environments: challenges and solutions. IEEE Internet Things J. 2025;12(4):2000–15. [Google Scholar]

7. Zeng W, Liu H. Hybrid deep learning model for traffic flow prediction based on attention mechanisms. Comput Appl Eng Educ. 2021;4:17. doi:10.1080/23249935.2020.1845250. [Google Scholar] [CrossRef]

8. Feng J, Du C, Mu Q. Traffic flow prediction based on federated learning and spatio-temporal graph neural networks. ISPRS Int J Geo Inf. 2024;13(6):210. doi:10.3390/ijgi13060210. [Google Scholar] [CrossRef]

9. Guan W, Liu J. A summary of traffic flow forecasting methods [Internet]; 2024 [cited 2025 Jun 1]. Available from: https://www.researchgate.net/publication/305223714_A_summary_of_traffic_flow_forecasting_methods. [Google Scholar]

10. Li R, Wu G, Chen X, Zhang H, Ding Z. Intelligent 6G networks: wireless connectivity, edge computing, and AI integration. IEEE Veh Technol Mag. 2020;15(4):28–36. doi:10.1109/MNET.011.2000195. [Google Scholar] [CrossRef]

11. Behera S, Panda SK, Panayiotou T, Ellinas G. Federated learning for network traffic prediction. In: Proceedings of the 2024 IFIP Networking Conference (IFIP Networking); 2024 Jun 3–6; Thessaloniki, Greece. p. 781–5. [Google Scholar]

12. Feng Y, Qian Q. PPSTSL: a privacy-preserving dynamic spatio-temporal graph data federated split learning for traffic forecasting. Inf Fusion. 2025;121:103129. doi:10.1016/j.inffus.2025.103129. [Google Scholar] [CrossRef]

13. Cheikh I, Roy S, Sabir E, Aouami R. Energy, scalability, data and security in massive IoT: current landscape and future directions. arXiv:2505.03036. 2025. [Google Scholar]

14. Taleb T, Samdanis K, Mada B, Flinck H, Dutta S, Sabella D. On multi-access edge computing: a survey of the emerging 5G network edge architecture and orchestration. IEEE Commun Surv Tuts. 2017;19(3):1657–81. doi:10.1109/COMST.2017.2705720. [Google Scholar] [CrossRef]

15. Zhang W, Yu Y, Qi Y, Shu F, Wang Y. Short-term traffic flow prediction based on spatio-temporal analysis and CNN deep learning. Transp A Transp Sci. 2019;15(2):1688–711. doi:10.1080/23249935.2019.1637966. [Google Scholar] [CrossRef]

16. Wang X, Han Y, Wang C, Zhao Q, Chen X, Chen M. In-edge AI: intelligentizing mobile edge computing, caching and communication by federated learning. IEEE Netw. 2019;33(5):156–65. doi:10.1109/MNET.2019.1800286. [Google Scholar] [CrossRef]

17. Liu Y, Chen Y, Zhang J. Deep traffic forecasting model for smart city infrastructure. IEEE Tran Neural Netw Learn Syst. 2020;31(12):5275–89. doi:10.1109/TITS.2020.3025856. [Google Scholar] [CrossRef]

18. Zhou S, Jiang T, Shi Y, Song L, Han Z. Toward federated learning in 6G: solutions, challenges, and future directions. IEEE Wirel Commun. 2021;28(4):46–52. doi:10.1109/TITS.2023.3324962. [Google Scholar] [CrossRef]

19. Song L, Hu X, Zhang G, Spachos P, Plataniotis KN, Wu H. Networking systems of AI: on the convergence of computing and communications. IEEE Internet Things J. 2022;9(20):20352–81. doi:10.1109/jiot.2022.3172270. [Google Scholar] [CrossRef]

20. Pan YA, Li F, Li A, Niu Z, Liu Z. Urban intersection traffic flow prediction: a physics-guided stepwise framework utilizing spatio-temporal graph neural network algorithms. Multimodal Transp. 2025;4(2):100207. doi:10.1016/j.multra.2025.100207. [Google Scholar] [CrossRef]


Cite This Article

APA Style
Aloshban, N., Alharbi, A.A. (2025). NeuroCivitas: A Federated Deep Learning Model for Adaptive Urban Intelligence in 6G Cognitive Cities. Computers, Materials & Continua, 85(3), 4795–4826. https://doi.org/10.32604/cmc.2025.067523
Vancouver Style
Aloshban N, Alharbi AA. NeuroCivitas: A Federated Deep Learning Model for Adaptive Urban Intelligence in 6G Cognitive Cities. Comput Mater Contin. 2025;85(3):4795–4826. https://doi.org/10.32604/cmc.2025.067523
IEEE Style
N. Aloshban and A. A. Alharbi, “NeuroCivitas: A Federated Deep Learning Model for Adaptive Urban Intelligence in 6G Cognitive Cities,” Comput. Mater. Contin., vol. 85, no. 3, pp. 4795–4826, 2025. https://doi.org/10.32604/cmc.2025.067523


cc Copyright © 2025 The Author(s). Published by Tech Science Press.
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 435

    View

  • 126

    Download

  • 0

    Like

Share Link