Next Article in Journal
Radian Scaling and Its Application to Enhance Electricity Load Forecasting in Smart Cities Against Concept Drift
Previous Article in Journal
Hypervector Approximation of Complex Manifolds for Artificial Intelligence Digital Twins in Smart Cities
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Solar Power Generation Forecasting in Smart Cities and Explanation Based on Explainable AI

1
St. Petersburg State University, 7-9 Universitetskaya Embankment, St Petersburg 199034, Russia
2
Faculty of Applied Mathematics-Control Processes, St. Petersburg State University, Universitetskiy Prospekt, 35, St Petersburg 198504, Russia
*
Author to whom correspondence should be addressed.
Smart Cities 2024, 7(6), 3388-3411; https://doi.org/10.3390/smartcities7060132
Submission received: 2 October 2024 / Revised: 1 November 2024 / Accepted: 4 November 2024 / Published: 7 November 2024

Abstract

:

Highlights

What are the main findings?
  • LightGBM, among the selected black-box models, was identified as requiring explanation due to its performance in solar power generation forecasting.
  • “Distance from the Noon” and its interaction with “Sky Cover” were highlighted as the primary environmental factors influencing solar power generation.
What is the implication of the main finding?
  • Understanding the key environmental factors enables more accurate placement and optimization of solar power stations in smart cities.
  • The use of Explainable AI provides valuable insights that can guide policymakers and engineers in enhancing solar energy infrastructure.

Abstract

The application of black-box models, namely ensemble and deep learning, has significantly advanced the effectiveness of solar power generation forecasting. However, these models lack explainability, which hinders comprehensive investigations into environmental influences. To address this limitation, we employ explainable artificial intelligence (XAI) techniques to enhance the interpretability of these black-box models, while ensuring their predictive accuracy. We carefully selected 10 prominent black-box models and deployed them using real solar power datasets. Within the field of artificial intelligence, it is crucial to adhere to standardized usage procedures to guarantee unbiased performance evaluations. Consequently, our investigation identifies LightGBM as the model that requires explanation. In a practical engineering context, we utilize XAI methods to extract understandable insights from the selected model, shedding light on the varying degrees of impact exerted by diverse environmental factors on solar power generation. This approach facilitates a nuanced analysis of the influence of the environment. Our findings underscore the significance of “Distance from the Noon” as the primary factor influencing solar power generation, which exhibits a clear interaction with “Sky Cover.” By leveraging the outcomes of our analyses, we propose optimal locations for solar power stations, thereby offering a tangible pathway for the practical.

1. Introduction

In the face of rapid urbanization and the rise of smart city initiatives, the need for efficient, sustainable energy management systems has become increasingly urgent [1,2,3,4]. Solar power, a renewable and clean energy source, offers a promising solution to meet these needs. However, effectively incorporating solar power into smart city energy grids requires precise and understandable forecasts to optimize its use [5,6]. Accurate forecasting improves the reliability of solar power, supports real-time decision-making, reduces operational costs, and maximizes energy efficiency. Additionally, clear and interpretable forecasting models promote transparency, enabling stakeholders to comprehend the factors influencing predictions. This fosters trust and aids in making informed policy decisions. As smart cities continue to develop, enhancing these forecasting techniques is crucial to support their growth and sustainability goals [7,8,9]. The abbreviations used in this work can be found in Table 1.
As AI systems continue to permeate various industries and domains, the need for explainability and transparency has become paramount. XAI [10,11,12,13], a field dedicated to developing AI models that can provide human-understandable explanations for their decisions and outputs, holds the key to unlocking the full potential of AI while ensuring its secure and responsible deployment. One of the primary obstacles hindering the widespread adoption of XAI is the scarcity of real-world application scenarios. By investigating the application of XAI in the solar power generation industry, this research aims to contribute to the advancement of XAI technology and foster its practical implementation.
Solar power, as a clean and renewable energy source, provides numerous environmental and economic benefits [14]. It effectively minimizes carbon emissions and enhances energy security by reducing reliance on fossil fuels. The optimization of energy trading, reduction in operational costs, improvement of system reliability, and facilitation of the integration of solar power into the grid [15] can be achieved through accurate long-term forecasting. Predictions for solar power generation can be made using statistical methods, traditional machine learning techniques, and deep learning (Figure 1). Statistical methods offer a straightforward approach, while traditional machine learning techniques like decision trees, shallow neural networks, and ensemble learning, provide more sophisticated methods. Deep learning [16], an evolution of shallow neural networks, is capable of handling complex and nonlinear tasks by increasing the network’s depth. Section 2 will discuss the differences and relationships between these approaches in detail.
Linear regression and ARIMA [17] are two commonly employed methodologies for time series forecasting. Linear regression is utilized to model the overall trend in data by assuming a linear association between input and output variables. However, this technique may not be suitable for adequately capturing the cyclicality or seasonality observed in the data, which presents a limitation when attempting to predict solar power generation. Conversely, ARIMA is extensively used in time series forecasting and possesses the capability to effectively capture both seasonal patterns and trends within the data. Nonetheless, obtaining a stationary dataset can pose challenges when dealing with solar power generation due to the inherent variability of solar energy, which constitutes a prerequisite for applying ARIMA. These limitations become particularly pronounced in long-term forecasting scenarios, thus motivating the application of machine learning and deep learning algorithms within this domain.
Ensemble learning [18] and deep learning techniques have proven to be highly effective for handling nonlinear and non-stationary data. Ensemble learning involves combining the predictions of multiple models in order to improve accuracy, while deep learning utilizes intricate network structures to identify relationships between input and output variables. These approaches hold particular significance in domains such as solar and wind energy forecasting [19], where nonlinear relationships and patterns are frequently observed. Ensemble learning encompasses Boosting and Bagging algorithms, with Boosting algorithms such as XGBoost [20], LightGBM [21], and CatBoost [22] being widely utilized. On the other hand, Deep Learning can be classified into three distinct types based on their network structure: ANN [23], CNN [24], and RNN [25].
XGBoost, LightGBM, and CatBoost have exhibited remarkable efficacy in time series forecasting competitions. Notably, XGBoost has been extensively employed in the M4 competition [26]. LightGBM has proven its effectiveness in handling vast datasets and achieving rapid training times, rendering it a popular selection in diverse competitions. In fact, LightGBM surpassed other frameworks and emerged victorious in the M5 forecasting competition [27], thus highlighting its exceptional performance in real-world scenarios. CatBoost is also widely utilized in Kaggle time series forecasting competitions. All three frameworks have demonstrated their potency for long-term time series forecasting, with each possessing unique advantages that render them suitable for distinct use cases [28,29]. Bae D.J. et al. [30] proposed an XGBoost-based load forecasting algorithm, which enhanced accuracy by 21% and 29% in 2019 and 2020, respectively, when compared with previous models. Zhang Y. et al. [31] assessed mainstream prediction methods across various datasets, including solar power generation. The experimental results indicated that LightGBM was the superior algorithm overall, outperforming others in the three datasets. As another notable Boosting algorithm, CatBoost also exhibits evident potential in solar power generation forecasting [32]. Deep learning techniques are frequently employed for time series forecasting, particularly ANNs [33], RNN-based models (RNN [34], LSTM [35]) and bidirectional RNN-based models [36] (Bi-RNN, Bi-LSTM and Bi-GRU). These models possess the capacity to automatically extract pertinent features from input data, providing an advantage over ensemble learning, which relies on manual feature engineering. ANN excels at capturing intricate nonlinear patterns in scenarios where the relationships between input features and target variables are unclear or nonlinear. While RNN-based and Bi-RNN-based models were initially devised for natural language processing [37], they have become extensively adopted in solar power generation forecasting due to their ability to capture temporal dependencies. Given that different models may possess varying abilities to learn from data, it is imperative to conduct comprehensive comparisons and analyses tailored to specific cases [31].
Ensemble learning and deep learning represent prominent methodologies for time series forecasting, particularly in the context of intricate and long-term predictions. Nevertheless, their opaque nature poses a challenge to discerning the factors that impact the accuracy of these forecasts [38]. Conversely, the identification of such factors assumes great importance when optimizing solar energy systems. Factors such as weather conditions [39], shading [40] and equipment characteristics [41] assume a pivotal role in system performance, cost reduction and site selection. Scrutinizing these factors can mitigate risks, optimize energy generation and facilitate the selection of the most suitable location for a solar power plant. Consequently, successful solar power generation necessitates the critical analysis of influential factors alongside effective forecasting techniques. XAI presents an opportunity to analyze the influential factors associated with black-box models. Developed to augment transparency, accountability and trust in AI systems, XAI empowers users by providing insights into the decision-making processes underlying these models. This is achieved through the provision of explanations or justifications for their outputs or decisions. By adopting XAI methods, AI systems become more comprehensible and accessible to users. An exemplary technique in the field of XAI is SHAP [42,43], which exhibits consistency, model-agnosticism and local interpretability. SHAP operates by utilizing SHAP values, derived from Shapley values [44] within cooperative game theory, to elucidate the output of a machine learning model. These values quantify the contribution of each variable towards a prediction, accounting for the interactions between variables. Consequently, SHAP offers a reliable and transparent approach to expounding machine learning models, thereby enabling users to enhance their understanding and trust in the decision-making processes of AI systems.
Several studies have been conducted to forecast solar power generation using various methods. However, such studies require attention to some issues that can affect their consistency and reliability. Firstly, there is a lack of standard process in applying these methods, which leads to inconsistencies in results [15]. Secondly, there is an insufficient analysis of factors affecting solar power generation [15,19,30,32,33,34,35,36,45]. Future research should address these issues to enhance the quality and reliability of such studies. This is crucial for developing accurate and effective methods for forecasting solar power generation, which supports the growth and sustainability of renewable energy.
This research makes a significant contribution to the field by focusing on the long-term forecasting of solar power generation and analyzing various environmental factors that affect it. To conduct this study, we obtained data from the Berkeley Power Plant. In Section 2, we present the methodology employed in our investigation. Section 2.1 outlines the standardized procedures for utilizing machine learning techniques. We then introduce ensemble learning in Section 2.2, followed by an exploration of deep learning methods in Section 2.3. Moving on to Section 2.4, we discuss the objective function utilized in our research. Additionally, we provide an overview of explainable AI and SHAP techniques in Section 2.5. In Section 3, we delve into the visualization of data and analyze the variables involved. Finally, in Section 4, we present our results and engage in a comprehensive discussion. We initiate this section by describing the process of data preprocessing in Section 4.1, followed by an evaluation of the forecasting performance in Section 4.2. Furthermore, we conduct an analysis of the factors that influence solar power generation in Section 4.3. In Section 6, we further elaborate on and discuss the outcomes derived from our study.
We emphasize two main contributions made by this research: (1) the establishment of a standardized usage process for machine learning techniques to ensure fair performance comparisons; and (2) an exploration of real-world applications of XAI technology for solar power generation.

2. Methodology

2.1. Standardized Usage Procedures of Machine Learning

In our study, we have placed a strong emphasis on the adoption of standardized procedures for using machine learning techniques. This decision stems from our observation of inconsistent and irregular model comparison practices in real-world applications [46]. Such inconsistencies can lead to unreliable results and hinder meaningful comparisons between different models. Standardization in machine learning refers to implementing a uniform and methodical approach when applying algorithms. Given that machine learning models rely heavily on data, a standardized process is essential to ensure the accuracy and validity of results obtained from comparing various algorithms. Consistent methodologies not only enhance the reliability of performance evaluations but also aid in determining the most effective algorithm suited for a specific task. This standardized approach involves several key components. First, it necessitates the use of consistent training data across experiments. By ensuring that all models are trained and tested on the same dataset, we can provide an equitable basis for comparison. Additionally, the way datasets are split into training and testing subsets must be consistent to prevent biases that could skew results. Overall, adopting these measures promotes fair evaluation and improves the overall robustness of model assessments in the context of solar power generation forecasting in smart cities.

2.1.1. Consistent Training Data

Machine learning methods differ from statistical methods in that they depend on data, rather than patterns. Therefore, consistent training data are essential to ensure fair and reliable comparisons between different machine learning methods. Comparing models trained on different datasets renders any such comparisons meaningless. Regrettably, some studies in the field of solar energy prediction have violated this principle. For instance, in a particular study [47], the authors used 24 months of data for a CNN model but only 12 months of data for other models, allowing the CNN model to outperform the others. However, such results are unrealistic and unreliable because they were obtained through an unfair comparison. It is crucial to emphasize the need for consistent training data when conducting machine learning experiments to ensure fair and accurate results.

2.1.2. Splitting of the Dataset

In the field of machine learning, it is crucial to partition the dataset into three subsets: the training set, validation set, and test set. Statistical methods typically divide the data into two parts: the fitting set and the testing set (Figure 2). The fitting set is used to fit mathematical formulae with the expertise of the human brain, while the testing set is used to evaluate the performance of the fit. In contrast, machine learning methods use a process of learning to construct a simulated fit, where the machine learns a large number of parameters with nonlinear properties to achieve a near-perfect fit to the training set. However, this perfect fit is often an uninterpretable black-box model and can lead to overfitting problems [48]. To obtain a generalized model, we need to constantly and artificially adjust hyperparameters, such as the number of layers, the number of neurons and the batch size of the network. This is where the validation set comes in. By verifying the suitability of these hyperparameters, we can keep the hyperparameters that make the model perform optimally in the validation set and fix the model. Finally, the performance of this fixed model on the test set is considered as its predictive performance, ensuring the reliability of the results to a large extent. Therefore, it is crucial to include the validation set in the dataset division process to produce more accurate and reliable prediction results.
Dividing a dataset into only two parts poses the risk of authors intentionally or unintentionally reporting results in their favor, compromising the fairness of comparisons. To ensure fairness, data should be split into three parts: a training set, a validation set, and a test set. The training set allows the machine to learn, while the validation set helps find the optimal hyperparameters of the model and fixes it. Finally, all fixed models are fairly compared on the test set.

2.2. Ensemble Learning

The Boosting algorithm is the most typical ensemble learning, and its principle is very simple, i.e., numerous weak learners are connected in series to build a strong learner. This study focuses on decision tree-based Boosting algorithms, which have demonstrated excellent performance in recent competitions. The three algorithms explored are XGBoost, LightGBM and CatBoost. XGBoost [49] is an upgraded version of Gradient Boosting, which enhances generalization ability by including a regular term as the sum of k trees’ complexity and second-order derivative information utilizing Taylor’s expansion formula. This results in learning richer information compared to traditional Gradient Boosting algorithms. LightGBM is designed for large-scale datasets and high-dimensional feature spaces, using a unique technique called GOSS [50] to select informative data points for training, hence reducing memory consumption and the required computation time. CatBoost is optimized for categorical features and employs a method called Ordered Boosting that encodes categorical features preserving their ordering, allowing them to be treated as numerical features. Additionally, it uses STBS [51] to handle missing values, making it more efficient than other Boosting algorithms.
Figure 3 visualizes the difference among the three of them. XGBoost uses depth-wise leaf growth to create a tree structure that is symmetric through balancing the instances in each node at every level of the tree. In contrast, LightGBM uses leaf-wise leaf growth, meaning it grows trees by selecting the leaf with the most significant gain, leading to deep but sparse trees. It also utilizes histogram-based Gradient Boosting to efficiently train unbalanced trees. CatBoost combines both approaches by using a predefined split threshold to determine whether to grow the tree depth-wise or leaf-wise and balances the number of instances in each leaf node to prevent overfitting.

2.3. Deep Learning

2.3.1. Artificial Neural Networks

ANNs (or MLP) are effective models for learning intricate nonlinear connections between the input and output variables [52]. ANNs comprise interconnected artificial neurons that transmit data from the input layer to the output layer in a feed-forward fashion. The input layer accepts input data, while the output layer produces the model’s output. Hidden layers, situated between the input and output layers, are referred to as intermediate layers. Each neuron in an ANN is characterized by a unique set of weights and biases that regulate its output (Figure 4). The equation for the output of an MLP with L layers can be written as
y = f L ( f L 1 ( f 2 ( f 1 ( h 1 ) ) ) )
where y is the output of the MLP; f L is the activation function of the output layer; f 1 , f 2 , …, f L 1 are the activation functions of the hidden layers; h i = w i × x + b i ; w 1 , w 2 , …, w L are the weight matrices that determine the strength of the connections between layers; and b 1 , b 2 , …, b L are the bias vectors for each layer.
The activation function f can be any nonlinear function, such as the s i g m o i d [53], R e L U [54], or t a n h [55]. The weights and biases of the network are updated during training through an iterative learning algorithm known as back-propagation [56]. This algorithm employs gradient descent to minimize the discrepancy between predicted output and actual output by modifying the weights and biases accordingly.

2.3.2. RNN-Based Models

RNNs [57] are a specific type of neural network architecture designed to process sequential data by integrating an internal state that captures the temporal dependencies between inputs. Unlike traditional MLP models, which process input data in a single pass and do not maintain any memory of previous inputs, RNNs can process input sequences of variable lengths. At each time step, the internal state of the RNN is updated and acts as a form of memory [58], enabling the network to retain and integrate past inputs into its current processing. This characteristic makes RNNs highly adaptable for applications that require the handling of sequential data, such as speech recognition [59], natural language processing and time series forecasting. An illustration of the RNN’s capacity to incorporate past inputs into its current processing is provided in Figure 5. The equation for the output of an RNN can be written as
h t = f ( U x t + W h t 1 + b h )
O t = S o f t m a x ( V h t + b o )
where O t is the output at time step t; h t is the hidden state at time step t; f is the activation function; W is the weight matrix for the previous hidden state; b i is the bias term of each layer; U is the weight matrix for the input at time step t; and x t is the input at time step t.
However, gradients can vanish or explode during training in RNNs [60]. This happens because gradients propagate back in time and their magnitude can increase or decrease exponentially, making it difficult for the RNN to retain information from earlier inputs, which ultimately impacts network accuracy. To address this problem, LSTM was developed [61]. LSTM is a type of RNN that uses a memory cell capable of maintaining its state over extended periods. The architecture consists of three gates, which regulate the flow of information into and out of the memory cell (Figure 6, left): input gate, output gate, and forget gate. During training, the network learns how to use these gates to selectively preserve or discard information. Specifically, the input gate controls what information from the input sequence should be stored in the memory cell, the output gate decides which information from the memory cell should be outputted, and the forget gate manages what information should be discarded. This selective retention and discarding of information enable the LSTM to capture long-term dependencies in the data and provide superior performance compared to traditional RNNs.
GRU [62], another type of RNN architecture, shares similarities with LSTM but does not have a separate memory cell. Instead, it uses a single hidden-state vector that integrates the memory cell and output gate of LSTM into a single component called the update gate. Additionally, GRU also has a reset gate that controls information to be discarded from the previous hidden state. Overall, GRUs are a simpler alternative to LSTM that can achieve comparable performance on many sequence modeling tasks [63,64], while requiring fewer parameters and less computation.

2.3.3. Bi-RNN-Based Models

The Bi-RNN [65] is a neural network architecture that consists of two RNNs operating on the input sequence in opposing directions. This design aims to capture both forward and backward dependencies critical for many tasks involving sequence modeling. The final output of the Bi-RNN is produced by concatenating or combining the outputs of both RNNs. Bi-RNN models enhance the RNN framework by incorporating a second layer to capture additional temporal information more effectively. The formulations for Bi-RNN, Bi-LSTM and Bi-GRU are fundamentally similar to their unidirectional counterparts (Equations (2) and (3)) [66,67]; therefore, this work does not provide reproducible results. Figure 7 shows the structure of a Bi-RNN model.

2.4. Objective Function

In order to evaluate the performance of machine learning models, various criteria have been established. Three commonly used criteria are the Mean-Squared Error ( M S E ), Mean Absolute Error ( M A E ) and the coefficient of determination ( R 2 ). They can be calculated as follows:
M S E = 1 n i = 1 n ( y i y ^ i ) 2
M A E = 1 n i = 1 n y i y ^ i
R 2 = 1 i = 1 n ( y i y ^ i ) 2 i = 1 n ( y ^ i ) 2
where y i is the true value; y ^ i is the predicted value; and n is the number of observations.

2.5. Explainable AI

The prevalence of black-box models in modern AI systems is a concern for users as they only offer predicted outcomes without providing information on how model variables influence these predictions. On the other hand, interpretable models like linear regression provide clear insight into variable contributions to the model output. To address this issue, XAI [11,68] has been developed to enable humans to understand AI systems’ decision-making processes. XAI methods focus on exploring feature importance and interaction within black-box models during the training process. This approach offers benefits for domain experts, especially in fields such as photovoltaic power generation, as it provides interpretative results that aid with model rationality assessment and allows users to discover interactive relationships between variables.
SHAP is a widely used method for explaining the predictions of complex machine learning models. This method is model-agnostic, making it applicable to a wide range of models, including tree-based models, neural networks and linear models. The SHAP method is rooted in Shapley values, which measure the contribution of each player in a game. Shapley value is a well-established theory in cooperative games that seeks to allocate benefits equitably among players in a coalition. In recent years, there has been growing interest in applying this theory to model explanation in machine learning [69,70]. This is because there is a correspondence between the Shapley value and model explanation: the variables used for training can be thought of as “players” and the model’s predictions as “revenues”. Shapley value is defined by the following formula:
k i = S N i S ! ( n S 1 ) ! n ! × ( v ( S i ) v ( S ) ) .
where k i is the contribution of the i- t h variable; N is the set of all players (features) (1, 2, 3 … i…n), which is the complete set; S is a subset of N, in which the explained feature i is removed, with a total of 2 N ; v is the gain function ( v ( S ) = E D ^ f ( x ) x S , where D ^ is the empirical distribution of the training data; and f is the black-model.
The SHAP method offers both a global and local perspective on feature (variable) importance, indicating how each feature influences the overall predictions as well as how it affects a particular instance’s outcome. In recent years, the SHAP method has become increasingly popular across various domains, such as healthcare, finance and image recognition. By providing intuitive and insightful explanations for complicated machine learning models, the SHAP method is known to increase the transparency and interpretability of these models, thus building trust in their predictions.

3. Data Visualization and Variable Analysis

The dataset consists of nine environmental variables and a solar power generation forecasting target. Two of the variables in the dataset contain temporal information. The first variable records the time at which data were collected, with recordings taken every three hours, eight times per day (at hours 1, 4, 7, …, and 22). The second variable indicates whether it is daylight or night, with the period from 7:00 to 22:00 recorded as daylight and the period from 22:00 to 07:00 recorded as night. The remaining seven variables, excluding time-point variables, are presented in the subsequent Data Visualization section. The original dataset from the Berkeley power plant can be accessed directly on Kaggle https://www.kaggle.com/datasets/vipulgote4/solar-power-generation (accessed on 10 January 2024).
This study used a dataset with 2920 observations, which was split into three subsets: a training set (70%), a validation set (15%), and a test set (15%). The dataset contained nine variables, with six being numeric and three being categorical. The categorical variables are “Is Daylight”, “Hour” and “Sky Cover” (the classification description is depicted in Figure 8). The distribution of the Sky Cover classes is shown in Figure 8b. Numeric variables include “Distance to Solar Noon (km)”, “Average Temperature (°F)”, “Average Wind Direction (°)”, “Average Wind Speed (m/s)”, “Relative Humidity (%)” and “Average Barometric Pressure (inHg.)”. The data distribution is shown in Figure 8c–h.
As shown in Figure 9, most variables remain independent of each other, except for a strong negative correlation between “Distance” and “Is Daylight” (−0.84), while “Humidity” and “Sky Cover” had some positive correlation (0.42).

4. Results and Discussion

4.1. Data Preprocessing

In this study, our tasks involve comparing different long-term forecasting models and analyzing factors that impact solar power generation. The data processing approaches differ for these two tasks. For the forecasting task, we set the horizons h to 56, 120 and 240, representing the forecasted solar power generation for the next 7, 15 and 240 days. The dataset is segmented into 3-h intervals, resulting in eight data points per day (at hours 1, 4, 7, 10, 13, 16, 19 and 22). Therefore, a forecast horizon of 56 data points equates to 7 days (7 days × 8 data points), a horizon of 120 data points corresponds to 15 days (15 × 8), and a horizon of 240 data points represents 30 days (30 × 8), respectively. To accomplish this task, we construct lag features for each variable, resulting in a dataset following the following form: y ^ t + h = f ( X t , y t ) , where X t = ( x t 1 , , x t n ) .
In contrast, after determining the optimal forecasting model, we employ this model to re-model the original data to explore environmental factors influencing solar power generation. In the analysis phase, the dataset follows the form: y ^ t = f ( X t , y t ) . Additional details can be obtained by accessing our experimental code: https://github.com/Zhangyuyi-0825/Solar_power (accessed on 10 January 2024).
In our research, we analyzed data from a specific location in Berkeley and introduced the concept of “Distance to the Solar Noon”. This term describes the direct distance from the recording point to the sun when it is solar noon at that location. Typically, terms such as azimuth and zenith angles are used in geography to describe the sun’s position. “Distance to the Solar Noon” also involves spatial elements since it deals with measuring distance. However, its determination is inherently linked to the timing of solar noon, making it a time-dependent measure.

4.2. Forecasting Performance

The results of the performance comparison of the 10 forecasting models are demonstrated in Table 2. The hyperparameter settings and the configuration information for these models are represented in detail in Appendix A. Overall, LightGBM and RNNs demonstrate relatively superior performance compared to other models. Evaluation results for this study’s dataset indicate that RNN performs better at a forecasting horizon of 56, while LightGBM excels at horizons 120 and 240.
Figure 10 illustrates a visual comparison between their predicted and actual results. Notably, as the forecasting horizon increases, LightGBM consistently outperforms the RNN significantly. Conversely, irrespective of the forecasting horizon, the RNN’s predictions during nighttime periods (red rectangles) exhibit noticeable noise. Specifically, during these nighttime intervals, the solar power generation values in the original data become zero, whereas the RNN generates fluctuating non-zero values at those instances. In contrast, under such circumstances, LightGBM demonstrates more stable performance during nighttime, leading to more reliable and plausible forecasts pertaining to solar power generation.
Although more suitable forecasting models were found for the solar power generation dataset through comparative experiments, these models are different from traditional statistical models in that their output logic is not transparent to us. Rather, we only know that nonlinear relationships exist within them. This lack of transparency prevents us from fully relying on their forecast results and limits our ability to analyze the factors that influence these forecasts. Influencing factor analysis is an effective tool for forecasting and managing the capacity of solar power systems. The identification of key factors that impact system performance, such as weather patterns, geographical location and shading, can enable a more precise forecast of energy generation and an optimization of system performance through improved management strategies. Furthermore, historical data and trends derived from influencing factor analysis may support informed decisions regarding investments in solar technology and infrastructure.

4.3. Influencing Factors Analysis

The study employs the SHAP algorithm as a general method for XAI to perform an influence factor analysis. The SHAP algorithm, which calculates Shapley values, is described in detail in Section 2.5. We utilized LightGBM as an exemplar to showcase the implementation of SHAP. This choice is informed by SHAP’s source code library support for ensemble learning and superior visualization capabilities, which surpass those of deep learning. It is important to acknowledge that this disparity in technical capabilities is confined to the code domains only, and SHAP retains its role as an explanation scheme for all black-box models within the theoretical framework.
It is important to emphasize that the SHAP value of a variable represents the degree of its contribution to the forecasting results, and a larger value indicates that its corresponding variable is more important. We will use Figure 11 as an example to show in detail the analysis of influencing factors using SHAP as the basis of the technique.
Figure 11 shows the SHAP explanations for two sample points with timestamps of “1 September 2008, 7:00” and “1 September 2008, 13:00”. The baseline, denoted as E f ( x ) , represents unconsidered variables and is substituted with the average value of all forecasting values. In this study, E f ( x ) = 0.579 . In Figure 11a, starting from the bottom, the model’s baseline is 0.579. The inclusion of average temperature and average wind speed does not cause a change in the forecasting value f ( x ) . However, once relative humidity is included, f ( x ) begins to vary, and each subsequent variable contributes to the forecasting. The calculation process is as follows: f ( X ) = 0.579 0 0 + 0.01 + 0.03 0.03 + 0.05 0.05 + 0.06 0.28 = 0.351 .
Thus, SHAP assigns the forecasting value f ( x ) = 0.351 to each variable. The same process applies to Figure 11b. By comparing Figure 11a and Figure 11b, it can be observed that when the time changes from 7:00 to 13:00, most variables’ contributions to the predicted value turn positive. Particularly, as the distance to solar noon decreases, its contribution significantly rises to +1.85, exerting a decisive influence. However, these are only the explanations for two sample points. In practice, it is impossible to analyze each data point individually. Therefore, SHAP also provides global explanations for variables by taking the absolute values of local explanation results and averaging them. This average serves as the global explanation, presented in Figure 12.
Global explanation can comprehensively assess the importance of these variables. Figure 12 illustrates the ranking of variable importance for forecasting outcomes, with variables arranged from top to bottom in descending order based on their importance. For the entire dataset, the “distance to the solar noon” is the most important, with its significance surpassing that of the remaining variables by a large margin. Subsequently, sky cover and relative humidity take precedence, while other variables such as wind direction, wind speed and average temperature do not stand out in this comprehensive assessment. Up to this point, the aforementioned analysis is solely based on the static explanation of SHAP values, without incorporating variable values. Next, we will explore the SHAP values under variable value changes to achieve dynamic analysis. The global dynamic explanation is presented in Figure 13.
The analysis of Figure 13 helps us to examine the presence of a strong monotonic relationship between SHAP values and variable values. The key aspect of analyzing Figure 13 lies in observing the clear distinction between the blue and red regions. For instance, considering the most important variable, i.e., distance to the solar noon, when this variable has lower values, it is represented by blue dots located on the right side. This indicates that lower values of this variable have a positive impact on the forecasting of solar power generation. Conversely, the red dots representing higher variable values are concentrated on the left side, suggesting that larger values of this variable have a negative effect on the forecasting. The more distinct the separation between the red and blue regions, the stronger the monotonic relationship between variable values and their corresponding SHAP values. In addition, SHAP provides an interactive explanation plot (Figure 14 and Figure 15), which not only presents such monotonic relationships in detail, but also illustrates the interaction effects among variables.
We begin by conducting an analysis on continuous variables. As shown in Figure 14, the trend exhibited by the data points represents the relationship between variable values and SHAP values, while the color indicates the variable value that has the most significant interaction effect with the given variable. The influential factors based on interactive plots are analyzed as follows.
Distance to Solar Noon (Figure 14a). The trend displayed by the data points indicates a strong monotonic relationship, wherein the SHAP value decreases significantly as the variable value increases. This implies a considerable reduction in its contribution to the predicted value. Additionally, when the variable value increases to approximately 0.3, its SHAP value remains at a relatively low level (around 0.5); however, when the value reaches around 0.4, its contribution becomes negative. On the other hand, the right side of the plot demonstrates the variable that exhibits a notable interaction effect, which in this case is sky coverage. It can be observed that even when the distance is within 0.3 km, the red data points representing high sky cover can still lower the SHAP value to a lower level. However, once the distance surpasses 0.3 km, due to a significant decrease in power generation, such interaction effects lose their analytical value. Overall, it can be inferred that when the distance does not exceed 0.3 km and the sky cover remains below 2, the model can generate higher forecasting values. Finally, the results of the SHAP analysis indicate that the distance to the solar noon within 0.3 km, combined with a sky cover rate not exceeding 60%, is the most crucial environmental factor for high-quality solar power generation.
Relative Humidity (Figure 14b). As the relative humidity increases, its corresponding SHAP value gradually decreases, indicating a diminishing contribution to the forecasting values. As observed from the figure, when the distance to the solar noon is within 0.3 km, relative humidity below 60% exhibits a relatively positive impact on solar power generation.
Average Wind Direction (Figure 14c). In regard to the dataset, it can be observed that when the distance to the solar noon is within 0.3 km, the average wind direction falls between 25° and 30°, thus favoring solar power generation. However, it should be emphasized that this conclusion is only applicable to the given dataset.
Average Wind Speed (Figure 14d). In reference to this dataset, when the relative humidity remains below 60% and the average wind speed ranges from 15 m/s to 25 m/s, a significant increase in corresponding SHAP values is observed. Consequently, this exerts a positive influence on solar power generation.
Average Barometric Pressure (Figure 14e). Concerning this dataset, when the distance to the solar noon is within 0.3 km, an average barometric pressure ranging from 30 inHg to 30.2 inHg can generate positive SHAP values, indicating a positive effect on the forecasting value. However, the magnitude of this influence is significantly lower than that of the aforementioned four environmental factors.
Average Temperature (Figure 14f). Overall, in comparison with other environmental factors, the average temperature has a relatively minor impact on solar power generation. Based on the results, most data points fluctuate around SHAP = 0, indicating zero contribution to solar power generation. The only notable observation is that when the average temperature drops below 45 °F, it does exert a negative influence on solar power generation. However, above this temperature threshold, its impact remains limited.
Figure 15 illustrates the analysis of discrete variables, with a particular focus on the presentation of “Is Daylight” for the sake of analytical completeness. In practice, when this value is 0, indicating nighttime, the solar power generation decreases to zero. Conversely, when the value is 1, representing daytime, the solar power generation starts to increase.
The analysis of sky cover reveals that when the distance to the solar noon is within 0.3 km, the sky cover does not exceed 2, corresponding to 60%. This situation positively affects the solar power generation capacity by enhancing its efficiency. However, conversely, it leads to a significant negative impact on solar energy generation.

4.4. Application Example

The following conclusions can be derived from the feature importance output obtained through modeling using LightGBM and XAI techniques represented by SHAP. It is evident that the distance from the sun at noon is the most significant environmental factor, forming the foundation for the positive influences of other environmental factors. Specifically, it is crucial to maintain a distance within 0.3 km from the sun at noon in order to maximize solar power generation. Additionally, the following conditions further contribute to an increase in solar energy production: relative humidity below 60%, average wind direction between 25° and 30°, average wind speed ranging from 15 m/s to 25 m/s, average barometric pressure between 30 inHg and 30.2 inHg, average temperature below 45 °F, and cloud cover not exceeding 60%.
Taking these factors into consideration, we propose two potential sites for the power plant based on the topographic map of Berkeley (Figure 16). We have identified Location 1 with an average elevation of 340 m and Location 2 with an average elevation of 370 m. Both locations are recommended as suitable options for the solar power plant site selection.

5. Discussion

5.1. Analysis of the Reasons for the Optimal Overall Performance of Long-Term Forecasting in LightGBM

Currently, AI models used for time series forecasting in smart cities commonly include ensemble learning models and neural network models. Among the ensemble learning models are XGBoost, LightGBM and CatBoost, while the neural network models consist of ANN, RNN, LSTM, GRU, Bi-RNN, Bi-LSTM and Bi-GRU.
To begin with, ensemble learning models generally exhibit superior performance compared to neural network models in this context. Neural networks were originally designed to address complex problems in natural language processing, such as understanding that the sentences “I like to play football on my days off” and “On my days off, I like to play football” convey the same meaning despite their different structures. These tasks require recognizing intricate relationships within unstructured data, a capability at which neural networks excel. However, time series forecasting involves a unidirectional relationship between data points, where earlier data points influence later ones, but not vice versa. This makes neural networks prone to overfitting, especially as the prediction horizon extends. In contrast, ensemble learning models, being less complex, are better suited for handling structured data inherent in time series forecasting.
LightGBM, in particular, stands out among ensemble learning models for several reasons. It employs an efficient histogram-based splitting algorithm, is memory-efficient, and can natively handle categorical features without needing one-hot encoding. Furthermore, LightGBM’s unique leaf-wise growth strategy differentiates it from other ensemble learning models. This approach not only accelerates training but also scales effectively with large datasets, making it particularly advantageous for longer forecasting horizons.

5.2. Limitations of SHAP Applications to Deep Neural Networks

SHAP values, which are used to interpret predictions from deep learning models, have notable limitations. One significant limitation is their computational intensity, particularly with large and complex models. Calculating the contribution of each feature requires evaluating numerous permutations, making this process especially taxing for sequential data models like RNNs and LSTMs. While ensemble learning methods may offer faster computations than neural networks, overcoming these challenges often involves developing more efficient algorithms for estimating Shapley values or employing parallel computing techniques to reduce computation time. Additionally, while SHAP can help automate the identification of interaction effects within models, its effectiveness is limited by its reliance on the dataset. This reliance means that SHAP might not capture all possible interaction combinations, leading to potential gaps in understanding model behaviors.

5.3. Scalability and Infrastructure in Smart Cities

In evaluating the scalability of our forecasting models across multiple smart cities, we leverage transfer learning and adaptive techniques. This approach allows us to fine-tune the model for each city’s unique climate and environment without starting anew for every location. The use of XAI further aids in understanding local variations, ensuring the model remains reliable and accurate across various urban settings. Regarding infrastructure requirements, robust computing resources are essential. Platforms that support distributed computing are crucial for processing extensive datasets from multiple cities efficiently. Additionally, a comprehensive data infrastructure is necessary. This includes the collection of real-time data from IoT devices, weather stations and other relevant sources, along with efficient systems for data storage, processing and transmission. Finally, to maximize efficiency, the forecasting model should seamlessly integrate with existing smart grid and energy management systems within each city.

6. Conclusions

In this study, we assessed the performance of ten ensemble and deep learning models for long-term solar power generation forecasting. We employed the SHAP method, a technique from explainable AI, to examine the influence of various environmental factors on model predictions. Our results indicate that the RNN model is best suited for a 7-day forecast horizon. However, for 15-day and 30-day forecasts, LightGBM emerges as the superior choice due to its enhanced robustness, particularly during nighttime when RNN models tend to exhibit noise. This distinction highlights the importance of selecting appropriate models based on specific forecast horizons and conditions. Through our SHAP analysis, we identified “Distance to Solar Noon”, which reflects altitude, as the most significant environmental factor affecting solar power generation. Other influential factors include maintaining relative humidity between 40% and 60%, average wind direction between 25° and 30°, wind speeds exceeding 15 m/s, sky cover below 30%, and barometric pressure ranging from 30.0 inHg to 30.2 inHg. These findings underscore the role of higher altitudes as beneficial for optimizing solar power output under these conditions. Despite these insights, challenges remain, particularly concerning the application of SHAP to deep neural networks, which can be limited in capturing complex interactions within the data. Addressing these limitations represents an important avenue for future research, alongside exploring additional environmental variables and refining model accuracy across diverse geographical regions and temporal scales. This study contributes to the ongoing discourse on renewable energy forecasting by revealing key insights into model selection and environmental impact factors. The integration of explainable AI techniques further enhances our understanding and offers guidance for policymakers and stakeholders aiming to optimize solar power generation in smart cities. Future research should build on these findings, exploring innovative approaches to overcome existing limitations and extend the applicability of these methodologies in varied contexts.

Author Contributions

Conceptualization, Y.Z. and O.P.; methodology, Y.Z. and O.P.; software, Y.Z.; validation Y.Z.; formal analysis, Y.Z. and O.P.; investigation, Y.Z. and O.P.; resources, Y.Z. and O.P.; data curation, Y.Z. and O.P.; writing—original draft preparation, O.P.; writing—review and editing, Y.Z.; visualization, Y.Z.; supervision, Y.Z.; project administration, Y.Z. and O.P.; funding acquisition, Y.Z. and O.P. All authors have read and agreed to the published version of the manuscript.

Funding

The research was carried out within the financial support for the autonomous non-profit organization “Analytical Center for the Government of the Russian Federation” (Agreement No. 70-2024-000120 dated 29 March 2024; ID: 000000D730324P540002).

Data Availability Statement

Data from publicly available datasets at https://www.kaggle.com/datasets/vipulgote4/solar-power-generation (accessed on 10 January 2024).

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Hyperparameters and Configurations

For the reproducibility and fairness of this work, the hyperparameters and configurations used for training are recorded in detail (accessed on 10 January 2024).
Details of the configuration information for training are listed below:
  • Computer configuration: 11th Gen Intel(R) Core(TM) i5-11600K @ 3.90 GHz 3.91 GHz.
  • Requirement: Tensorflow—2.7.0; Optuna—3.2.0; XGBoost—1.7.4; LightGBM—3.3.5; CatBoost—1.2; Numpy—1.23.5; Pandas—1.5.2; matplotlib—3.6.2; Seaborn—0.12.2; Sklearn—1.2.1
Hyperparameter settings for training:
A critical component of our methodology involved determining the optimal hyperparameters for each model to enhance their performance. To achieve this, we employed an automated hyperparameter tuning framework called Optuna. Optuna is a robust tool designed to efficiently explore a wide range of potential hyperparameter configurations. Its primary advantage lies in its ability to systematically search through predefined ranges of hyperparameter values, ensuring that the selected parameters maximize model accuracy and efficiency. By using Optuna, we were able to streamline the hyperparameter tuning process, which is often complex and time-consuming when performed manually. Through this approach, our models were fine-tuned to deliver more precise predictions of solar power generation. The hyperparameter settings for the ensemble model are detailed in Table A1, Table A2 and Table A3. These tables provide comprehensive information about the hyperparameters that were adjusted to optimize the performance of the model. Similarly, the neural network model’s hyperparameter settings are outlined in Table A4.
Table A1. Hyperparameter settings for XGBoost.
Table A1. Hyperparameter settings for XGBoost.
HyperpMax DepthLearning Raten EstimatorsMin Child WeightGammaSubsampleColsample BytreeReg AlphaReg Lambda
Range[1–9][0.01–1][50–500][1–10][0.001-1][0.01–1][0.01–1][0.001–1][0.001–1]
XGB20.08311760.1370.7530.8250.3290.090
Table A2. Hyperparameter settings for LightGBM.
Table A2. Hyperparameter settings for LightGBM.
HyperpMax DepthLearning Raten EstimatorsMin Child WeightSubsampleColsample BytreeReg AlphaReg Lambda
Range[1–9][0.01–1][50–500][1–10][0.01–1][0.01–1][0.001–1][0.001–2]
LGB30.01542410.9480.7090.0091.819
Table A3. Hyperparameter settings for CatBoost.
Table A3. Hyperparameter settings for CatBoost.
HyperpLearning Ratel2 Leaf RegColsample BylevelDepthBoosting TypeBootstrap TypeMin Data in LeafOne Hot Max Size
Range[0.001–1][0.01–1][0.01–1][1–10]--[2–20][2–20]
Cat0.2890.0130.0823‘Ordered’‘Bernoulli’65
Table A4. Hyperparameter settings for neural networks.
Table A4. Hyperparameter settings for neural networks.
HyperpHidden LayersActivationOptimizerLearning RateBatch SizeEpochsDropout
ANN(100–50)ReLUSGD0.011281000.1
RNN(100–50)ReLUAdam0.0011281000.1
LSTM(100–50)ReLUAdam0.0011281000.1
GRU(100–50)ReLUAdam0.0011281000.1
Bi-RNN(100)ReLUAdam0.0011281000.1
Bi-LSTM(100)ReLUAdam0.0011281000.1
Bi-GRU(100)ReLUAdam0.0011281000.1

References

  1. Hoang, A.T.; Nguyen, X.P. Integrating renewable sources into energy system for smart city as a sagacious strategy towards clean and sustainable process. J. Clean. Prod. 2021, 305, 127161. [Google Scholar] [CrossRef]
  2. Khalil, M.I.; Jhanjhi, N.Z.; Humayun, M. Hybrid smart grid with sustainable energy efficient resources for smart cities. Sustain. Energy Technol. Assess. 2021, 46, 101211. [Google Scholar] [CrossRef]
  3. Salama, R.; Al-Turjman, F. Sustainable energy production in smart cities. Sustainability 2023, 15, 16052. [Google Scholar] [CrossRef]
  4. Patrão, C.; Moura, P.; Almeida, A.T. Review of smart city assessment tools. Smart Cities 2020, 3, 1117–1132. [Google Scholar] [CrossRef]
  5. Belli, L.; Cilfone, A.; Davoli, L. IoT-enabled smart sustainable cities: Challenges and approaches. Smart Cities 2020, 3, 1039–1071. [Google Scholar] [CrossRef]
  6. Lu, Y.; Khan, Z.A.; Alvarez-Alvarado, M.S. A critical review of sustainable energy policies for the promotion of renewable energy sources. Sustainability 2020, 12, 5078. [Google Scholar] [CrossRef]
  7. Stübinger, J.; Schneider, L. Understanding smart city—A data-driven literature review. Sustainability 2020, 12, 8460. [Google Scholar] [CrossRef]
  8. Alotaibi, I.; Abido, M.A.; Khalid, M. A comprehensive review of recent advances in smart grids: A sustainable future with renewable energy resources. Energies 2020, 13, 6269. [Google Scholar] [CrossRef]
  9. Ruggieri, R.; Ruggeri, M.; Vinci, G. Electric mobility in a smart city: European overview. Energies 2021, 14, 315. [Google Scholar] [CrossRef]
  10. Arrieta, A.B.; Díaz-Rodríguez, N.; Del Ser, J. Explainable Artificial Intelligence (XAI): Concepts, taxonomies, opportunities and challenges toward responsible AI. Inf. Fusion 2020, 58, 82–115. [Google Scholar] [CrossRef]
  11. Saeed, W.; Omlin, C. Explainable AI (XAI): A systematic meta-survey of current challenges and future opportunities. Knowl.-Based Syst. 2023, 263, 110273. [Google Scholar] [CrossRef]
  12. van der Waa, J.; Nieuwburg, E.; Cremers, A. Evaluating XAI: A comparison of rule-based and example-based explanations. Artif. Intell. 2021, 291, 103404. [Google Scholar] [CrossRef]
  13. Zhang, Y.; Xu, F.; Zou, J. XAI Evaluation: Evaluating Black-Box Model Explanations for Prediction. In Proceedings of the IEEE 2021 II International Conference on Neural Networks and Neurotechnologies (NeuroNT), Saint Petersburg, Russia, 16 June 2021; pp. 13–16. [Google Scholar]
  14. Gorjian, S.; Sharon, H.; Ebadi, H. Recent technical advancements, economics and environmental impacts of floating photovoltaic solar energy conversion systems. J. Clean. Prod. 2021, 278, 124285. [Google Scholar] [CrossRef]
  15. Sharadga, H.; Hajimirza, S.; Balog, R.S. Time series forecasting of solar power generation for large-scale photovoltaic plants. Renew. Energy 2020, 150, 797–807. [Google Scholar] [CrossRef]
  16. Dong, S.; Wang, P.; Abbas, K. A survey on deep learning and its applications. Comput. Sci. Rev. 2021, 40, 100379. [Google Scholar] [CrossRef]
  17. Shadab, A.; Ahmad, S.; Said, S. Spatial forecasting of solar radiation using ARIMA model. Remote Sens. Appl. Soc. Environ. 2020, 20, 100427. [Google Scholar] [CrossRef]
  18. Zhou, Z.H. Ensemble Learning; Springer: Singapore, 2021. [Google Scholar]
  19. da Silva, R.G.; Ribeiro, M.H.D.M.; Moreno, S.R. A novel decomposition-ensemble learning framework for multi-step ahead wind energy forecasting. Energy 2021, 216, 119174. [Google Scholar] [CrossRef]
  20. Qiu, R.; Liu, C.; Cui, N. Generalized Extreme Gradient Boosting model for predicting daily global solar radiation for locations without historical data. Energy Convers. Manag. 2022, 258, 115488. [Google Scholar] [CrossRef]
  21. Ribeiro, F.; Gradvohl, A.L.S. Machine learning techniques applied to solar flares forecasting. Astron. Comput. 2021, 35, 100468. [Google Scholar] [CrossRef]
  22. Fan, J.; Wang, X.; Zhang, F. Predicting daily diffuse horizontal solar radiation in various climatic regions of China using support vector machine and tree-based soft computing models with local and extrinsic climatic data. J. Clean. Prod. 2020, 248, 119264. [Google Scholar] [CrossRef]
  23. Cabaneros, S.M.; Calautit, J.K.; Hughes, B.R. A review of artificial neural network models for ambient air pollution prediction. Environ. Model. Softw. 2019, 119, 285–304. [Google Scholar] [CrossRef]
  24. Kiranyaz, S.; Avci, O.; Abdeljaber, O. 1D convolutional neural networks and applications: A survey. Mech. Syst. Signal Process. 2021, 151, 107398. [Google Scholar] [CrossRef]
  25. Cossu, A.; Carta, A.; Lomonaco, V. Continual learning for recurrent neural networks: An empirical evaluation. Neural Netw. 2021, 143, 607–627. [Google Scholar] [CrossRef] [PubMed]
  26. Makridakis, S.; Spiliotis, E.; Assimakopoulos, V. The M4 Competition: 100,000 time series and 61 forecasting methods. Int. J. Forecast. 2020, 36, 54–74. [Google Scholar] [CrossRef]
  27. Makridakis, S.; Spiliotis, E.; Assimakopoulos, V. M5 accuracy competition: Results, findings, and conclusions. Int. J. Forecast. 2022, 38, 1346–1364. [Google Scholar] [CrossRef]
  28. Al Daoud, E. Comparison between XGBoost, LightGBM and CatBoost using a home credit dataset. Int. J. Comput. Inf. Eng. 2019, 13, 6–10. [Google Scholar]
  29. Hong, J. An Application of XGBoost, LightGBM, CatBoost Algorithms on House Price Appraisal System. Hous. Financ. Res. 2020, 4, 33–64. [Google Scholar] [CrossRef]
  30. Bae, D.J.; Kwon, B.S.; Song, K.B. XGBoost-based day-ahead load forecasting algorithm considering behind-the-meter solar PV generation. Energies 2021, 15, 128. [Google Scholar] [CrossRef]
  31. Zhang, Y.; Ma, R.; Liu, J. Comparison and explanation of forecasting algorithms for energy time series. Mathematics 2021, 9, 2794. [Google Scholar] [CrossRef]
  32. Aksoy, N.; Genc, I. Predictive models development using gradient boosting based methods for solar power plants. J. Comput. Sci. 2023, 67, 101958. [Google Scholar] [CrossRef]
  33. Pazikadin, A.R.; Rifai, D.; Ali, K. Solar irradiance measurement instrumentation and power solar generation forecasting based on Artificial Neural Networks (ANN): A review of five years research trend. Sci. Total Environ. 2020, 715, 136848. [Google Scholar] [CrossRef] [PubMed]
  34. Vu, B.H.; Chung, I.Y. Optimal generation scheduling and operating reserve management for PV generation using RNN-based forecasting models for stand-alone microgrids. Renew. Energy 2022, 195, 1137–1154. [Google Scholar] [CrossRef]
  35. Neshat, M.; Nezhad, M.M.; Mirjalili, S. Short-term solar radiation forecasting using hybrid deep residual learning and gated LSTM recurrent network with differential covariance matrix adaptation evolution strategy. Energy 2023, 278, 127701. [Google Scholar] [CrossRef]
  36. Peng, T.; Zhang, C.; Zhou, J. An integrated framework of Bi-directional long-short term memory (BiLSTM) based on sine cosine algorithm for hourly solar radiation forecasting. Energy 2021, 221, 119887. [Google Scholar] [CrossRef]
  37. Alshemali, B.; Kalita, J. Improving the reliability of deep neural networks in NLP: A review. Knowl.-Based Syst. 2020, 191, 105210. [Google Scholar] [CrossRef]
  38. Liang, Y.; Li, S.; Yan, C. Explaining the black-box model: A survey of local interpretation methods for deep neural networks. Neurocomputing 2021, 419, 168–182. [Google Scholar] [CrossRef]
  39. Alshawaf, M.; Poudineh, R.; Alhajeri, N.S. Solar PV in Kuwait: The effect of ambient temperature and sandstorms on output variability and uncertainty. Renew. Sustain. Energy Rev. 2020, 134, 110346. [Google Scholar] [CrossRef]
  40. Belhaouas, N.; Mehareb, F.; Assem, H. A new approach of PV system structure to enhance performance of PV generator under partial shading effect. J. Clean. Prod. 2021, 317, 128349. [Google Scholar] [CrossRef]
  41. Tu, J.; Qi, C.; Tang, Z. Experimental study on the influence of bionic channel structure and nanofluids on power generation characteristics of waste heat utilisation equipment. Appl. Therm. Eng. 2022, 202, 117893. [Google Scholar] [CrossRef]
  42. Lundberg, S.M.; Lee, S.I. A unified approach to interpreting model predictions. Adv. Neural Inf. Process. Syst. 2017, 30, 4765–4774. [Google Scholar]
  43. Lundberg, S.M.; Erion, G.; Chen, H. From local explanations to global understanding with explainable AI for trees. Nat. Mach. Intell. 2020, 2, 56–67. [Google Scholar] [CrossRef] [PubMed]
  44. Shapley,, L.S. A value for n person games. Contrib. Theory Games 1953, 2, 125. [Google Scholar]
  45. Wu, H.; Elizaveta, D.; Zhadan, A. Forecasting online adaptation methods for energy domain. Eng. Appl. Artif. Intell. 2023, 123, 106499. [Google Scholar] [CrossRef]
  46. Badillo, S.; Banfai, B.; Birzele, F. An introduction to machine learning. Clin. Pharmacol. Ther. 2020, 107, 871–885. [Google Scholar] [CrossRef] [PubMed]
  47. Azizi, N.; Yaghoubirad, M.; Farajollahi, M. Deep learning based long-term global solar irradiance and temperature forecasting using time series with multi-step multivariate output. Renew. Energy 2023, 206, 135–147. [Google Scholar] [CrossRef]
  48. Montesinos Lopez, O.A.; Crossa, J. Overfitting, Model Tuning, and Evaluation of Prediction Performance, Multivariate Statistical Machine Learning Methods for Genomic Prediction; Springer International Publishing: Cham, Switzerland, 2022; pp. 109–139. [Google Scholar]
  49. Liew, X.Y.; Hameed, N.; Clos, J. An investigation of XGBoost-based algorithm for breast cancer classification. Mach. Learn. Appl. 2021, 6, 100154. [Google Scholar] [CrossRef]
  50. Gao, H.; Cai, G.; Yang, D. Real-time long-term voltage stability assessment based on eGBDT for large-scale power system with high renewables penetration. Electr. Power Syst. Res. 2023, 214, 108915. [Google Scholar] [CrossRef]
  51. Chen, X.; Wang, B.; Gao, Y. Symmetric binary tree based co-occurrence texture pattern mining for fine-grained plant leaf image retrieval. Pattern Recognit. 2022, 129, 108769. [Google Scholar] [CrossRef]
  52. Niaze, A.A.; Sahu, R.; Sunkara, M.K. Model construction and optimization for raising the concentration of industrial bioethanol production by using a data-driven ANN model. Renew. Energy 2023, 216, 119031. [Google Scholar] [CrossRef]
  53. Langer, S. Approximating smooth functions by deep neural networks with sigmoid activation function. J. Multivar. Anal. 2021, 182, 104696. [Google Scholar] [CrossRef]
  54. Shen, Z.; Yang, H.; Zhang, S. Optimal approximation rate of ReLU networks in terms of width and depth. J. De Math. Pures Et Appl. 2022, 157, 101–135. [Google Scholar] [CrossRef]
  55. De Ryck, T.; Lanthaler, S.; Mishra, S. On the approximation of functions by tanh neural networks. Neural Netw. 2021, 143, 732–750. [Google Scholar] [CrossRef] [PubMed]
  56. Sun, W.; Huang, C. A carbon price prediction model based on secondary decomposition algorithm and optimized back propagation neural network. J. Clean. Prod. 2020, 243, 118671. [Google Scholar] [CrossRef]
  57. Sherstinsky, A. Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. Phys. D Nonlinear Phenom. 2020, 404, 132306. [Google Scholar] [CrossRef]
  58. Zhang, X.; Liu, L.; Long, G. Episodic memory governs choices: An rnn-based reinforcement learning model for decision-making task. Neural Netw. 2021, 134, 1–10. [Google Scholar] [CrossRef]
  59. Yang, W.; Li, P.; Yang, W. Audio-Visual Multi-modal Meeting Recording System. In International Conference on Intelligent Information Technologies for Industry; Springer Nature: Cham, Switzerland, 2023; pp. 168–178. [Google Scholar]
  60. Rehmer, A.; Kroll, A. On the vanishing and exploding gradient problem in Gated Recurrent Units. IFAC-PapersOnLine 2020, 53, 1243–1248. [Google Scholar] [CrossRef]
  61. Landi, F.; Baraldi, L.; Cornia, M. Working memory connections for LSTM. Neural Netw. 2021, 144, 334–341. [Google Scholar] [CrossRef]
  62. Niu, Z.; Yu, Z.; Tang, W. Wind power forecasting using attention-based gated recurrent unit network. Energy 2020, 196, 117081. [Google Scholar] [CrossRef]
  63. Mirzaei, S.; Kang, J.L.; Chu, K.Y. A comparative study on long short-term memory and gated recurrent unit neural networks in fault diagnosis for chemical processes using visualization. J. Taiwan Inst. Chem. Eng. 2022, 130, 104028. [Google Scholar] [CrossRef]
  64. ArunKumar, K.E.; Kalaga, D.V.; Kumar, C.M.S. Comparative analysis of Gated Recurrent Units (GRU), long Short-Term memory (LSTM) cells, autoregressive Integrated moving average (ARIMA), seasonal autoregressive Integrated moving average (SARIMA) for forecasting COVID-19 trends. Alex. Eng. J. 2022, 61, 7585–7603. [Google Scholar] [CrossRef]
  65. Wang, Z.; Li, Y.; He, X. Improved deep bidirectional recurrent neural network for learning the cross-sensitivity rules of gas sensor array. Sens. Actuators B Chem. 2024, 401, 134996. [Google Scholar] [CrossRef]
  66. Pooja, T.S.; Shrinivasacharya, P. Evaluating neural networks using Bi-Directional LSTM for network IDS (intrusion detection systems) in cyber security. Glob. Transit. Proc. 2021, 2, 448–454. [Google Scholar]
  67. Ghasemlounia, R.; Gharehbaghi, A.; Ahmadi, F. Developing a novel framework for forecasting groundwater level fluctuations using Bi-directional Long Short-Term Memory (BiLSTM) deep neural network. Comput. Electron. Agric. 2021, 191, 106568. [Google Scholar] [CrossRef]
  68. Zou, J.; Xu, F.; Petrosian, O. Explainable AI: Graph Based Sampling Approach for High Dimensional AI System. In International Conference on Intelligent Information Technologies for Industry; Springer Nature: Cham, Switzerland, 2023; pp. 410–422. [Google Scholar]
  69. Zhang, Y.; Sun, Q.; Qi, D. ShapTime: A General XAI Approach for Explainable Time Series Forecasting. In Intelligent Systems Conference; Springer Nature: Cham, Switzerland, 2023; pp. 659–673. [Google Scholar]
  70. Zhang, Y.; Sun, Q.; Liu, J. Long-Term Forecasting of Air Pollution Particulate Matter (PM2.5) and Analysis of Influencing Factors. Sustainability 2023, 16, 19. [Google Scholar] [CrossRef]
Figure 1. Components of machine learning and their constituent relationships.
Figure 1. Components of machine learning and their constituent relationships.
Smartcities 07 00132 g001
Figure 2. The modeling process of statistical and machine learning.
Figure 2. The modeling process of statistical and machine learning.
Smartcities 07 00132 g002
Figure 3. Example of growing Boosting trees. CatBoost (left); XGBoost (middle); LightGBM (right).
Figure 3. Example of growing Boosting trees. CatBoost (left); XGBoost (middle); LightGBM (right).
Smartcities 07 00132 g003
Figure 4. Network structure of an ANN.
Figure 4. Network structure of an ANN.
Smartcities 07 00132 g004
Figure 5. Network structure of a traditional RNN.
Figure 5. Network structure of a traditional RNN.
Smartcities 07 00132 g005
Figure 6. Neuron structure of LSTM (left) and GRU (right).
Figure 6. Neuron structure of LSTM (left) and GRU (right).
Smartcities 07 00132 g006
Figure 7. Network structure of a Bi-RNN-based model.
Figure 7. Network structure of a Bi-RNN-based model.
Smartcities 07 00132 g007
Figure 8. Visualization of variable information. The blue area is the histogram of the data and the orange represents the kernel density curve. (a,b) Categorical variables; (ch) numeric variables. The “Hour” variable represents time and has a fixed pattern, so it is not shown here; it is recorded every 3 h. It should be noted that the value of “Distance to Solar Noon” is normalized to [0,1] in order to make the training process of the neural network converge faster. Classification of Sky Cover in (b) 0–10%: sunny (0); 10–30%: mostly sunny (1); 30–60%: partly cloudy (2); 60–90%: mostly cloudy (3); 90–100%: overcast (4).
Figure 8. Visualization of variable information. The blue area is the histogram of the data and the orange represents the kernel density curve. (a,b) Categorical variables; (ch) numeric variables. The “Hour” variable represents time and has a fixed pattern, so it is not shown here; it is recorded every 3 h. It should be noted that the value of “Distance to Solar Noon” is normalized to [0,1] in order to make the training process of the neural network converge faster. Classification of Sky Cover in (b) 0–10%: sunny (0); 10–30%: mostly sunny (1); 30–60%: partly cloudy (2); 60–90%: mostly cloudy (3); 90–100%: overcast (4).
Smartcities 07 00132 g008
Figure 9. Correlation between variables.
Figure 9. Correlation between variables.
Smartcities 07 00132 g009
Figure 10. Visualization of the forecast results of LightGBM and RNN. The red area shows the fit performance of these models for nighttime generation.
Figure 10. Visualization of the forecast results of LightGBM and RNN. The red area shows the fit performance of these models for nighttime generation.
Smartcities 07 00132 g010
Figure 11. Example of local explanation results. Red represents positive impacts and blue represents negative impacts. The horizontal axis represents the SHAP values, while the vertical axis displays the names and values of each variable. The numerical value of f ( x ) represents the forecasting of LightGBM at that moment. In practice, it is not possible to enumerate all the factors that affect solar power generation. Therefore, a concept of BASELINE is assumed in SHAP, represented by E f ( x ) , with which those influences that are not taken into account are represented. Here, it is represented by the average of all forecast values.
Figure 11. Example of local explanation results. Red represents positive impacts and blue represents negative impacts. The horizontal axis represents the SHAP values, while the vertical axis displays the names and values of each variable. The numerical value of f ( x ) represents the forecasting of LightGBM at that moment. In practice, it is not possible to enumerate all the factors that affect solar power generation. Therefore, a concept of BASELINE is assumed in SHAP, represented by E f ( x ) , with which those influences that are not taken into account are represented. Here, it is represented by the average of all forecast values.
Smartcities 07 00132 g011
Figure 12. Example of global explanation results.
Figure 12. Example of global explanation results.
Smartcities 07 00132 g012
Figure 13. Global dynamic explanation. The left vertical axis shows the name of the variable and the right color bar from blue to red represents the variable’s value from small to large. The horizontal axis represents the SHAP value, indicating the importance or contribution of the variable to the forecasting results.
Figure 13. Global dynamic explanation. The left vertical axis shows the name of the variable and the right color bar from blue to red represents the variable’s value from small to large. The horizontal axis represents the SHAP value, indicating the importance or contribution of the variable to the forecasting results.
Smartcities 07 00132 g013
Figure 14. Interaction effects of continuous variables on forecasting results. Red represents positive impacts and blue represents negative impacts. The gray shading demonstrates the distribution of the corresponding variables, details of which can be viewed in Figure 8.
Figure 14. Interaction effects of continuous variables on forecasting results. Red represents positive impacts and blue represents negative impacts. The gray shading demonstrates the distribution of the corresponding variables, details of which can be viewed in Figure 8.
Smartcities 07 00132 g014
Figure 15. Interaction effects of discrete variables on forecasting results. Red represents positive impacts and blue represents negative impacts.
Figure 15. Interaction effects of discrete variables on forecasting results. Red represents positive impacts and blue represents negative impacts.
Smartcities 07 00132 g015
Figure 16. Suggested locations (point 1 and point 2) for power plant siting.
Figure 16. Suggested locations (point 1 and point 2) for power plant siting.
Smartcities 07 00132 g016
Table 1. Nomenclature and abbreviations.
Table 1. Nomenclature and abbreviations.
AbbreviationExplanationAbbreviationExplanation
XAIExplainable Artificial IntelligenceARIMAAutoregressive Integrated Moving Average
XGBoostExtreme Gradient BoostingANNArtificial Neural Networks
LightGBMLight Gradient Boosting MachineCNNConvolutional Neural Networks
CatBoostCategorical Gradient BoostingSHAPShapley Additive Explanations
RNNRecurrent Neural NetworksBi-RNNBidirectional RNN
LSTMLong Short-Term MemoryBi-LSTMBidirectional LSTM
GRUGated Recurrent UnitBi-GRUBidirectional GRU
GOSSGradient-Based One-Side SamplingSTBSSymmetric Tree-Based Sampling
MLPMultilayer PerceptronIoTInternet of Things
Table 2. Comparison of forecasting performance. The optimal model is filtered through the validation set and compared on the test set. The performance metric values reported here are taken from the test set.
Table 2. Comparison of forecasting performance. The optimal model is filtered through the validation set and compared on the test set. The performance metric values reported here are taken from the test set.
Metrics R 2 MSE MAE
Horizon561202405612024056120240
XGB0.89500.88030.93650.11860.14880.08950.24360.26530.1429
LGB0.88560.91800.94070.11260.10380.07990.21990.17380.1498
Cat0.91170.91530.94050.09820.10410.08320.19120.17710.1433
ANN0.88510.86350.81520.12620.18120.19890.19790.22120.2595
RNN0.91960.84860.85440.09710.18200.17420.18540.24400.2530
LSTM0.90640.86490.83930.10420.14330.16110.17720.22040.2452
GRU0.91160.87850.85350.10490.15190.16620.18730.22900.2442
Bi-R0.90950.84390.87230.10230.19880.15970.19340.25620.2439
Bi-L0.90510.86350.84260.10500.14630.15850.17620.22850.2425
Bi-G0.91310.87040.84340.10500.15860.17440.18770.23190.2565
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Petrosian, O.; Zhang, Y. Solar Power Generation Forecasting in Smart Cities and Explanation Based on Explainable AI. Smart Cities 2024, 7, 3388-3411. https://doi.org/10.3390/smartcities7060132

AMA Style

Petrosian O, Zhang Y. Solar Power Generation Forecasting in Smart Cities and Explanation Based on Explainable AI. Smart Cities. 2024; 7(6):3388-3411. https://doi.org/10.3390/smartcities7060132

Chicago/Turabian Style

Petrosian, Ovanes, and Yuyi Zhang. 2024. "Solar Power Generation Forecasting in Smart Cities and Explanation Based on Explainable AI" Smart Cities 7, no. 6: 3388-3411. https://doi.org/10.3390/smartcities7060132

APA Style

Petrosian, O., & Zhang, Y. (2024). Solar Power Generation Forecasting in Smart Cities and Explanation Based on Explainable AI. Smart Cities, 7(6), 3388-3411. https://doi.org/10.3390/smartcities7060132

Article Metrics

Back to TopTop