1. Introduction
The world is moving towards sustainable energy systems, and the uptake of solar PV has been greatly accelerated. Solar energy is one of the renewable sources, which is appealing because of its modularity, cost reduction, and zero emissions. The Middle East countries are well endowed with solar resources and Oman is the most suitable country to develop PV due to its long sunshine period with high levels of irradiance annually [
1,
2,
3]. Oman’s capital city (Muscat) has undergone an accelerated urbanization and rising electricity demand. Smart structures with PV systems on the roof, smart meters, battery storage and automated control systems are becoming significant features of low-carbon cities of the future [
4]. But the randomness of solar power makes generation scheduling uncertain. Cloud cover, temperature, humidity, haze, and dust buildup can vary significantly, impacting output power [
5].
Accurate solar prediction is thus needed in: grid balancing, battery charge scheduling, demand response programs, energy trading markets, reduction in reserve generation costs, and reliable smart building operation. Centralized machine learning in which the data of two or more buildings are consolidated into a single server is frequently used in traditional forecasting approaches [
6,
7]. Despite potential benefits of centralized learning in prediction accuracy, this approach has significant concerns: exposing user energy profiles to privacy risk, data transmission through large-scale data transfer, data ownership issues, cybersecurity issues, and legal limitations on data sharing [
8]. FL is a new distributed learning paradigm enabling a number of clients to cooperatively train a common model without exchanging raw data. The participants also train locally and send updated parameters. This predisposes FL to be very applicable in smart building ecosystems [
9].
The solar energy forecasting and integrated energy systems literature has widely discussed the use of advanced machine learning, statistical and optimization-based methods to tackle the intrinsic intermittency and uncertainty that comes with renewable energy sources. To measure the single-vessel fishing capacity in the South China Sea, Generalized Additive Models (GAMs) were used to quantify the individual-vessel fishing capacity based on operational survey data. The research showed high predictive validity as the use of key predictors explained up to 63.52 percent variance and had an R
2 of 0.76 with cross-validation [
10]. A Knowledge Assisted Differential Evolution-XGBoost (KADE-XGBoost) model was suggested to estimate mangrove aboveground biomass using a combination of evolutionary optimization and gradient boosting. The method demonstrated better predictive performance, with a maximum R
2 of 0.8413 and a more effective way of investigating features and hyperparameter optimization in comparison to the reference models [
11]. It proposed a hybrid forecasting system that uses EEMD, SCM, Genetic Algorithms, and a Light Gradient Boosting Machine (LGBM) to make high-accuracy solar radiation forecasts. The model was very effective as it had an R
2 of 0.99 and was vastly superior to traditional MLP and Long Short-Term Memory (LSTM) models; hence, it is highly applicable in solar energy optimization [
12]. An ensemble forecasting model combines the use of FFT-based noise reduction, Singular Spectrum Analysis (SSA), and GRU networks that have been suggested as green hydrogen predictors using solar irradiance. The model enhanced the multi-step forecast accuracy and was reliable in estimating hydrogen generation which is applicable in low-carbon energy [
13]. A forecasting model based on LSTM was created to predict solar power in the short term taking into account weather variability within large-scale solar power plants. The analysis showed better prediction accuracy when the input features were optimized and the MAPE decreased to 9.881% compared to 10.857% in real-life application conditions [
14]. A better LSTM-based forecasting method was suggested to predict the short-term photovoltaic power during curtailment in industrial scale solar plants. The approach used better data preprocessing, and parameter optimization, with 6.059% and 6.710% reductions in forecasting error and MAPE and RMSE improvement, respectively [
15]. The grid search optimization of a Random Forest Regressor was designed to predict and optimize real-time performance of a power tower concentrated solar system. The model provided very accurate predictions and an R
2 of 0.9999, and a high level of robustness to different weather and operational conditions [
16]. To enhance renewable energy trading decisions, a risk-averse forecasting framework of Conditional Value-at-Risk (CVaR) and convex optimization was suggested. The approach led to a decrease in the average and extreme forecasting errors, decreasing the imbalance costs and increasing financial robustness in case of uncertain energy markets [
17].
An integrated optimization and forecasting model were proposed that incorporates BWO-FLANN to predict load and NS-MOTLBO to predict economic load dispatch to the grid and solar-grid in one. The algorithm successfully managed multi-objective constraints and obtained higher quality Pareto optimal solutions than those of the state-of-the-art methods in the presence of different levels of solar radiation [
18]. The predictive model of solar thermal energy based on long-term field data was created in the form of an Artificial Neural Network (ANN). The model was highly predictive with R
2 = 0.93 and its implementation with thermal storage systems showed considerable energy savings up to 43% [
19]. The model of forecasting solar energy production trends in the Mediterranean countries was built using a Convolutional Neural Network (CNN) to analyze and predict trends as far as 2050. The model proved to be a good forecasting tool by considering climatic and technological variables which showed significant increase in solar energy production due to policy attractiveness and reduced cost of installing the equipment [
20]. The Direct Normal Irradiance (DNI) was simulated using a Weather Research and Forecasting coupled chemistry (WRF-Chem) model that included the effects of aerosols over the UAE. The experiment showed that explicit aerosol modeling was much more effective at predicting the results, the rRMSD decreased by as much as 33.33% relative to the standard WRF model [
21]. The new AI-based solar irradiance forecasting model was presented based on a ProbSparse attention encoder–decoder model which has been optimized by a redesigned dingo algorithm. The technique was efficient in capturing time-dependencies and showed a better forecasting accuracy with less MAE and RMSE and increased the efficiency of forecasting solar energy [
22]. To manage uncertainty in solar radiation in integrated energy systems, a model predictive control (MPC)-based energy management scheme was suggested to include a Hidden Markov Model (HMM). The method enhanced energy reliability and self-sufficiency because it was able to cope with forecast uncertainty and also perform better than deterministic and robust optimization methods when used in long-term simulations [
23]. The new AI-based solar irradiance prediction model was trained with a ProbSparse attention encoder–decoder structure and trained with a redesigned dingo optimization algorithm. The method showed good predictive skills and better MAE, RMSE, and R
2, which is effective in improving the accuracy of the short-term solar forecasting of the energy management system [
22].
Table 1 presents the summary of limitations and research gaps in existing studies.
The research plans to present an optimistic federated learning-solar forecasting system that incorporates GRU networks with distributed smart buildings. The key focus is to overcome the shortcomings of centralized forecasting systems, especially when it comes to data privacy, scalability, and the response to heterogeneous environmental conditions. The proposed solution builds on cooperative learning in multi-building in Muscat, Oman, to provide the necessary precision, efficiency in communication, and privacy of solar power prediction. The most important novel contributions to this work can be summarized as:
GRU-based Solar Forecasting Architecture. The paper introduces a new application of GRU networks with federated learning towards distributed solar forecasting, which allows joint model training in smart buildings without the need to collect data centrally.
Distributed Learning Framework Privacy-Preserving. This approach has a high level of data privacy, as model parameters are only shared rather than raw photovoltaic or meteorological data, and is therefore applicable to smart city energy systems.
Strong Learning in Non-IID Data Setting. The FL-GRU model proposed is effective in managing heterogeneous and non-identically distributed solar data across buildings, and the convergence is kept steady and forecasting results are consistent.
Improved Accuracy of Forecasting with Distributed Temporal Modeling. GRU temporal learning, when used in combination with federated aggregation, provides the model with a higher prediction accuracy existing method.
Communication-Efficient and Scalable Framework. The system minimizes communication overhead since only model weights are exchanged and it is better the more buildings are involved in the system, making it scalable to the deployment of smart cities.
The remainder of this paper is organized as follows.
Section 2 presents the mathematical modeling and theoretical foundation of the proposed FL-GRU framework, including solar energy modeling, GRU-based temporal learning, and federated optimization.
Section 3 describes the methodological framework and stepwise implementation of the distributed forecasting system.
Section 4 presents the simulation setup, results, and detailed performance analysis under various scenarios.
Section 5 is a comparative analysis. Finally,
Section 6 concludes the paper and highlights future research directions.
2. Mathematical Modeling and Theoretical Foundation
This section presents the theoretical foundation and mathematical formulation of the proposed FL-GRU. The modeling framework is divided into three sub-sections: (i) solar photovoltaic generation modeling, (ii) GRU-based temporal forecasting model, and (iii) federated learning optimization and aggregation mechanism. Together, these components define the complete analytical structure of the proposed distributed forecasting system.
2.1. Theoretical Foundation of Solar PV Generation Modeling
Solar PV power generation is primarily driven by solar irradiance, temperature, and environmental conditions such as dust, humidity, and cloud cover. In a distributed smart-building environment, each building
generates a time-dependent power output
, which can be expressed as a nonlinear function of meteorological and system parameters. The general physical representation of solar power generation can be written as:
where
is the conversion efficiency of the PV system,
is, the panel area,
represents solar irradiance,
is ambient temperature,
is reference temperature, and
is the temperature coefficient. In real-world conditions such as in Muscat, Oman, this relationship becomes highly nonlinear due to atmospheric variability caused by dust storms and coastal humidity. Therefore, deterministic physical models are insufficient for accurate forecasting. Instead, data-driven approaches such as deep learning are preferred to approximate the nonlinear mapping:
where
denotes humidity,
represents dust concentration, and
captures stochastic disturbances unique to each building. This motivates the use of recurrent neural networks, particularly GRU, which are capable of learning temporal dependencies in such nonlinear and noisy environments [
26,
27].
2.2. GRU-Based Temporal Forecasting Model
The core forecasting engine of the proposed framework is the GRU, which is a variant of recurrent neural networks designed to efficiently capture temporal dependencies in sequential data while avoiding vanishing gradient problems. For each building
, the input sequence of historical solar observations is defined as:
where each input vector includes irradiance, temperature, humidity, and past power output. The GRU architecture consists of two main gating mechanisms.
The candidate hidden state is computed as:
The final hidden state is updated using:
where
is the sigmoid function and
denotes element-wise multiplication. The final solar power prediction for each building is obtained through:
The GRU model is particularly suitable for solar forecasting because it effectively captures:
Short-term fluctuations in irradiance;
Long-term seasonal dependencies;
Temporal correlations in PV output.
This makes it highly effective for Muscat’s highly variable climatic conditions, where solar radiation exhibits both daily periodicity and stochastic disturbances. Algorithm 1 presents the step-by-step pseudocode of the proposed GRU-based temporal forecasting model used for short-term solar power prediction.
| Algorithm 1 Algorithm of the GRU-Based Temporal Forecasting Model |
Input: , learning rate , epochs, window size
Output: Forecasted solar power
Step 1. Normalize dataset using Min-Max scaling:
Step 2. Construct input sequences using sliding window:
Step 3. Initialize GRU parameters
, set
Step 4. FOR each epoch = 1 to Epochs DO
Step 5. FOR each training sample DO
Step 6. Set
Step 7. FOR each time step in sequence DO
Step 8. Compute update gate:
Step 9. Compute reset gate:
Step 10. Compute candidate state:
Step 11. Update hidden state:
Step 12. END FOR
Step 13. Compute output:
Step 14. Compute loss:
Step 15. Apply Backpropagation Through Time (BPTT)
Step 16. Update parameters:
Step 17. END FOR
Step 18. END FOR
Step 19. Forecasting Phase: Feed new input sequence into trained GRU model
Step 20. Compute predicted output
Return: Forecasted solar PV power |
The mathematical formulations of the update gate, reset gate, candidate hidden state, and hidden state update presented in Equations (4)–(8) follow the standard GRU architecture reported in the existing recurrent neural network literature. In this work, the conventional GRU framework is adapted and integrated within a federated learning-based distributed solar forecasting environment to enable privacy-preserving collaborative temporal prediction across heterogeneous smart buildings [
28].
2.3. Federated Learning Optimization and Aggregation Mechanism
To enable distributed learning across multiple smart buildings without sharing raw data, the system adopts a federated learning framework. Each building independently trains its local GRU model and communicates only model parameters to a central server. Let the local model parameters of building
at communication round
be represented as
. Each client minimizes its local loss function:
where
is the number of samples at client
. After local training, the server aggregates all client updates using a weighted averaging strategy:
where
is the number of participating clients and
is the total number of samples across all clients. This aggregation ensures that clients with larger datasets have a proportionally higher influence on the global model. The updated global model is then redistributed to all clients for the next training round. The federated optimization process minimizes the global objective function:
This formulation ensures that the system converges toward a globally optimal model without requiring centralized data access. From a theoretical perspective, federated learning introduces three major advantages:
Privacy preservation, since raw solar data never leave local devices.
Communication efficiency, because only model weights are exchanged.
Robust generalization, achieved through exposure to diverse distributed datasets.
In the context of Muscat smart buildings, this framework is particularly effective because solar generation patterns vary significantly across locations due to differences in rooftop orientation, shading, and microclimatic conditions. The federated approach allows the model to learn these variations collectively while maintaining decentralization. Visual illustration of the proposed FL-GRU-based federated learning optimization and aggregation mechanism is shown in
Figure 1 for distributed solar forecasting in the smart buildings of Muscat, Oman, where multiple clients perform local GRU training and transmit updated parameters to the central server for FedAvg-based global model refinement.
Some meteorological parameters can be retrieved from freely available databases of the environment, while energy generation profiles, operational energy usage, rooftop energy system behavior, and locally measured environmental parameters are typically controlled by the operations of specific smart buildings. In real-world smart city applications, these datasets can come from various sources, including utility providers, campus managers, commercial buildings, and building owners. Centralized data collection can be difficult to manage in practice because in real-world applications such datasets are owned by different stakeholders, including utility providers, campus managers, commercial building operators, and private building owners. In addition, new intelligent energy systems will face increasingly tough cybersecurity, data-governance, and decentralized infrastructure management demands. Hence, the adoption of federated learning in this work is driven not only by preserving privacy but also by the following advantages: communication efficiency, scalability to large multi-building smart cities, decentralized data ownership, low cyber-risk exposure for the central entity, and future friendly operational framework of smart cities in Oman and other distributed renewable energy systems.
3. Methodological Framework for Implementation of Proposed FL-GRU System
The given federated learning-based distributed solar forecasting system based on GRU networks is elaborated with the help of the multi-phase methodological pipeline elaborated in smart buildings in Muscat, Oman. The architecture incorporates the environmental data acquisition, statistical preprocessing, distributed client-based learning, federated optimization, and model refinement through iteration and performance evaluation at the end. The flowchart of the proposed methodological framework is illustrated in
Figure 2. All phases are well organized so that they have the ability to be scaled, maintain privacy and have high forecasting accuracy in heterogeneous solar conditions.
3.1. Phase 1: Data Acquisition
The initial stage involves the gathering of relevant meteorological and photovoltaic information in many sources in order to create a complete dataset on solar forecasting. The hourly data of solar irradiance of Muscat is collected as the key driver of photovoltaic generation. Also, atmospheric parameters like temperature, humidity, and wind speed are supported to allow variability of the environment. At the same time, the data of rooftop photovoltaic power generation is also measured in several smart buildings (Building-1 to Building-5), which are the distributed energy nodes of individual operational and environmental peculiarities. The stage defines the baseline set of data needed to learn about the temporal dynamics of the sun. The proposed FL-GRU framework performs short-term next-step solar photovoltaic power forecasting (t + 1)) using historical PV generation and meteorological time-series data obtained from distributed smart-building clients. The objective of the model is predictive energy forecasting rather than anomaly or fault detection.
3.2. Phase 2: Data Preprocessing
During the preprocessing stage, raw data is processed to clean it and transform it to make it suitable for deep learning-based forecasting. The data integrity is preserved by removing or interpolating missing or inconsistent values. Then all the input features are normalized with min–max scaling to bring the values to a homogenous range, which enhances more stable convergence in GRU training. Once the time-series data has been normalized, it is then converted into supervised learning sequences by building input output pairs, with past environmental conditions serving to predict future output solar power.
3.3. Phase 3: Client Partitioning
During this stage, the processed data is divided between several clients, who represent single smart buildings. The data is assigned to each building (Building-1 to Building-5) to simulate a realistic distributed energy environment. The data distribution is also purposely kept heterogeneous to capture the reality of the situation in the real world where each building has a different shading pattern, rooftop orientation, and local weather variations. Such non-identical data distribution (non-IID) provides a real-world challenge to the federated learning framework.
3.4. Phase 4: Local Training
The global GRU model is initialized at the central server at the beginning of the training process, and the corresponding parameters are sent to all of the participating buildings. The model received is then independent of each client, which trains it on its own local dataset. The epochs of the training process are fixed, E, with each building optimizing the model with backpropagation through time (BPTT) to reduce prediction error. Such local training will enable every client to acquire unique temporal trends of solar generation without affecting data privacy because no raw data is exchanged beyond the building.
3.5. Phase 5: Federation Round and Aggregation Federated
Following the local training, only the updated weights of the model are sent to the central server by each building, with no raw solar or meteorological data being transferred. The server combines these updates with a federated averaging (FedAvg) algorithm, which calculates weighted average of all client models according to their datasets. The resultant world model provides an aggregate knowledge of all buildings and is subsequently re-shared with all the clients. This round of communication guarantees collaborative learning without violating the privacy of data and minimizing communication overhead.
Figure 3 illustrates secure aggregation techniques integrated with the proposed FL-GRU framework.
3.6. Phase 6: Iterative Optimization
The training is carried out in several areas of communication. During each round, the clients do local training, submit updates to the server and get the newly aggregated global model. The global model is gradually refined over multiple iterations as it learns various patterns of the environment in all buildings. The process repeats until convergence, identified by a negligible decrease in loss or error measures or a specified number of rounds of communication.
3.7. Phase 7: Forecasting Phase
After convergence of the model, the final optimized global GRU model is implemented on all smart buildings. This model is applied in real time solar power forecasting and used to predict the photovoltaic output over the next hour in response to meteorological inputs. The global model guarantees the same forecasting performance among all distributed buildings and flexibility to the local environmental conditions.
3.8. Phase 8: Performance Evaluation
The last step implies extensive testing of the suggested FL-GRU model by various statistical measures of performance. RMSE, MAE, MAPE, and coefficient determination R
2 are used to measure the accuracy of the forecasts. The given model is also compared to conventional and deep learning-based models such as Local GRU, centralized GRU, FL-LSTM, and FL-ANN architectures. This comparative study confirms the superiority of the suggested federated learning method, regarding precision, robustness, and scalability of distributed solar forecasting conditions. For ease of understanding, the detailed parameters are presented in
Appendix A.
Four benchmark models (ANN, SVR, LSTM, GRU) were chosen, as they are famous and widely used conventional machine learning and deep learning methods that are frequently found in solar PV forecasting literature. ANN and SVR are well-known nonlinear regression models, while LSTM and GRU are two sophisticated architectures for recurrent neural networks that are used for temporal sequence prediction. These models were chosen to allow for the consistent comparison of the conventional regression-based, neural-learning and recurrent temporal forecasting methods in the proposed federated learning scenario. In the recent literature, there are advanced ensemble-learning methods that have been found to outperform traditional methods in forecasting, such as XGBoost, Random Forest and Generalized Additive Models (GAM); however, for the purpose of methodological focus in the present study, these methods were not included given their advanced nature. Future large-scale comparative studies will also include the use of other ensemble-learning benchmark models.
In practical deployment scenarios, secure communication channels, encrypted model-update transmission, authenticated client participation, and secure aggregation techniques can be integrated into the proposed FL-GRU framework to mitigate data tampering, malicious client updates, and poisoning attacks while preserving decentralized privacy in distributed smart-building environments.
4. Simulation Results and Discussion
In this section, the proposed FL-GRU networks for smart buildings in Muscat, Oman are comprehensively evaluated. The results are categorized into five large themes of discussion in order to enhance readability and quality of the manuscript: distributed architecture and convergence behavior, scalability and robustness, communication and privacy performance, environmental sensitivity analysis, and comparative benchmark validation. All numerical values adhered to the final MATLAB 2022b simulation results to be consistent in with rest of the manuscript. The received findings verify that the combination of federated optimization with GRU temporal learning yields a forecasting model that can achieve high prediction accuracy, a good generalization, privacy protection, and realistic scalability to the multi-building renewable energy system.
The proposed federated learning architecture is shown in
Figure 1 with smart buildings taking part as distributed clients linked with a central aggregation server. Every building prepares a local GRU model with the help of personal rooftop PV information and only sends the learned parameters to the server. Raw data does not leave the client side thus maintaining privacy without compromising collaborative forecasting.
4.1. Proposed Scheme Validation Under Various Conditions
4.1.1. FL-GRU Architecture and Convergence Performance
Figure 4 indicates the local forecasting performance of the representative buildings, with the subplots comparing the actual and the predicted hourly solar generation prior to global aggregation. The local models effectively reproduce the daily solar cycle, but there are moderate variations at sunrise ramping, noon peak variations and sunset transitions. Such errors are anticipated since every client is trained in its localized information and thus cannot train the general patterns of the environment as can be found in other buildings.
Figure 5 illustrates the advantage of collaborative learning, where it is shown that the predictions made prior to and after global aggregation are different. As aggregation occurs, the forecasted curve is much closer to the actual generation profile, particularly around peak production periods. This is due to the fact that federated averaging uses complementary knowledge acquired in more than one building and minimizes local estimation bias.
Figure 6 shows the convergence properties of the proposed framework. The loss of training is reduced from almost 0.40 to less than 0.02 in 50 communication rounds. At the same time, RMSE is reduced to 0.129, MAE to 0.100, and the forecasting accuracy is increased to about 97%. These trends affirm stable and efficient distributed optimization. The contribution of both buildings is also illustrated in
Figure 7, where the update norms decrease gradually with the training rounds. This decrease shows that there is a gradual consensus between clients and a successful convergence to a shared forecasting model.
4.1.2. Scalability and Robustness Analysis
The impact of increasing participants is presented in
Figure 8a. The higher the number of clients, the lower the RMSE, the more the clients the lower the RMSE; therefore, from 2 to 10 the difference is 28.73. This shows that greater involvement improves forecasting results because it adds more diversity to the data among buildings.
Figure 8b examines the strength of the proposed model in the case of heterogeneous data distributions. The model has the lowest RMSE of 0.129 under uniform data sharing. The higher the heterogeneity, the higher the RMSE becomes (0.148, 0.156 and 0.167, respectively). Even though non-IID data generate incompatible client updates, the suggested FL-GRU is steady, which proves its great tolerance to the real-world distributed setting. The impact of temporary unavailability of a client. When dropout increases from 0 % to 50 %, RMSE rises from 0.129 to 0.172. The negative impairment is not disastrous but progressive, which points to the fact that past acquired international experience and active clientele maintain satisfactory performance even in case of a breakdown in communication. The sensitivity to local training epochs is analyzed. The optimal performance is five local epochs with RMSE = 0.129. The local models are under-trained by too few epochs, and they drift to the local clients without synchronization by too many.
4.1.3. Communication Efficiency and Privacy Tradeoff
Less communication overhead is one of the key benefits of federated forecasting, which is demonstrated in
Figure 9. Repeated transfer of entire datasets is necessary to centralized learning, causing a quickly growing bandwidth consumption. By comparison, federated learning interactions only model parameters, generating much less communication traffic. This renders the suggested framework more feasible than huge smart-building networks.
Figure 10 shows the privacy–performance tradeoff. As privacy noise increases, RMSE changes from 0.129 to 0.133, 0.141, and 0.158. This is theoretically anticipated since greater privacy protection obscures valuable gradient information. Nevertheless, moderate levels of privacy give high forecasting accuracy, indicating that without significant performance compromise, it is possible to preserve privacy.
4.1.4. Seasonal Operating Conditions
Figure 11a demonstrates prognostic ability when Muscat operating conditions are seasonal. The optimal RMSE of 0.122 is given by winter, and the remaining seasons (summer and humid) give 0.131 and 0.136, respectively. Dust season is the most challenging one with RMSE = 0.148 because of inconsistent attenuation of irradiance by airborne particles. These findings show that environmental volatility is a strong predictor of forecasting complexity. The effect of rooftop PV capacity is shown in
Figure 11b. The error of forecasting reduces to 0.149 on 10 kW systems and to 0.124 on 100 kW systems. Larger installations combine the output of several panels, and this leads to a smoother generation signal that can be more easily predicted.
4.2. Quantitative Analysis
Table 2 summarizes all the tested simulation results of the proposed Federated Learning-based GRU-distributed solar forecasting framework in various operating conditions. The converged global model obtained a final RMSE = 0.129, MAE = 0.100, and 97.0% accuracy in the forecast and this confirms that the proposed architecture provides high accuracy in prediction with low absolute error. These values are the main point of departure toward further comparative analysis. Scalability-wise, the more clients were added to the number of participating smart buildings, the smaller RMSE became, going down to 0.129 out of 0.181 (a 28.73% change). This trend clearly shows that generalization of models with increased federation is more appropriate since more clients bring variation in environmental patterns and rooftop generation patterns. The error alleviation is particularly significant after six clients, meaning that broader cooperation is a big plus to distributed forecasting systems.
The proposed framework showed constant performance under statistical heterogeneity. The increase in RMSE between 0.129 with uniform data and 0.167 with highly random non-IID data is only a moderate degradation of 29.46 when the client is extremely inconsistent. This proves that the FL-GRU model is also sound even when it is used with buildings that have very dissimilar distributions of solar generation. Operational resilience is further confirmed with client dropout experiments. The RMSE at a 50% increment of an inactive client ratio was 0.172, as compared to 0.129 at a 0% inactive client ratio. The decrease in performance was not disastrous but gradual, although some loss of participation was anticipated. The forecasting system continued to operate with half of the clients unreachable, which is very pertinent in real-world smart-building implementations where communication outages can happen intermittently.
5. Comparative Discussion
Table 3 shows the comparative analysis of the proposed FL-GRU framework outperforms conventional ANN, SVR, LSTM, and standalone GRU models in terms of prediction accuracy, error minimization, and correlation performance. The lower RMSE, MAE, and MAPE values indicate improved forecasting precision, while the higher R
2 score confirms stronger agreement between predicted and actual photovoltaic power outputs. Although the federated implementation introduces moderate communication overhead, the proposed FL-GRU model maintains competitive training efficiency while providing improved distributed learning capability and privacy-preserving operation for smart-building solar forecasting environments.
While in this study, we used the conventional preprocessing methods of Z-score normalization and sequence framing using a sliding window, heuristic and metaheuristic methods can further enhance the computational efficiency and the optimization of communication in large-scale federated forecasting environments. The features selected for training and the number of features, the number of samples used for training and the information passed to the client, and the use of heuristic mechanisms to choose between subsets of clients can be adapted to minimize training overhead and communication cost without compromising forecasting accuracy. Addressing issues of training overhead and communication cost, adaptive feature selection, intelligent sampling, dimensionality reduction and heuristic client-selection mechanisms are potentially applicable. So, heuristic-based preprocessing techniques are essential for the future to be considered as a significant improvement for scalable FL-GRU-based smart-building energy forecasting systems.
6. Conclusions
This paper proposed FL-GRU networks to be used in smart buildings in the city of Muscat, Oman. The key goal was to build a high-precision prediction model that would not compromise user privacy, minimize communication costs and be resilient to distributed and heterogeneous real-world scenarios. The proposed system allows collaboration between buildings to perform intelligence by integrating GRU-based temporal learning with federated optimization without the need to share data centrally. The effectiveness of the proposed approach was validated in the experimental results on various dimensions of performance. Final forecasting performance of the global FL-GRU model was RMSE = 0.129, MAE = 0.100 and accuracy = 97, which means high predictive ability. Scalability analysis showed that the higher the number of participating buildings, the better the performance, as RMSE is decreased with an increase in the number of clients, with 0.181 (2 clients) to 0.129 (10 clients), which is quite significant, approximately 29. This validates the fact that increasing the scale of involvement improves generalization through the introduction of a variety of solar generation patterns into the urban environment. The strength of the suggested framework was also confirmed in the hard conditions. In non-IID data cases, the RMSE ranging between 0.129 and 0.167 indicates that the model is still stable with client data distributions that are highly heterogeneous. On the same note, with client dropout rates as high as 50, the system still achieved reasonable performance with RMSE slightly rising to 0.172, showing high fault tolerance of partially connected networks. The analysis of efficiency in communication revealed a significant benefit of the federated approach compared to centralized learning, where only the parameters of the model are shared rather than the raw data, and this will reduce communication overhead. Privacy analysis also revealed that as the noise level is increased, a slight degradation in accuracy is induced but the model still has a high predictive power, thus indicating a viable tradeoff between accuracy and privacy. The relative analysis with benchmark models showed that the proposed FL-GRU always achieves better performance than Local GRU, centralized GRU, FL-LSTM, and FL-ANN architectures. The largest improvement was 22.29% in RMSE minimization compared to FL-ANN, and the highest correlation strength of R 2 = 0.957, which means that the values of the predicted and actual solar generation are very similar. To sum up, the FL-GRU model is a powerful, scalable, communication-efficient, and privacy-saving system to support distributed solar forecasting in smart cities. The fact that it can deal with heterogeneous data is highly accurate when clients drop out and is much more efficient than traditional centralized and federated baselines makes it very appropriate to real-world application in renewable-integrated city energy systems like in Muscat or other climates. Furthermore, hardware-level implementation and real-time deployment on distributed smart-building platforms have been identified as part of the future research direction.