A hybrid method for day‐ahead photovoltaic power forecasting based on generative adversarial network combined with convolutional autoencoder

IET Renewable Power GenerationVolume 17, Issue 3 p. 644-658 ORIGINAL RESEARCHOpen Access A hybrid method for day-ahead photovoltaic power forecasting based on generative adversarial network combined with convolutional autoencoder Xueping Pan, Corresponding Author Xueping Pan [email protected] orcid.org/0000-0001-9756-8089 College of Energy and Electrical Engineering, HoHai University, Nanjing, China Correspondence Xueping Pan, College of Energy and Electrical Engineering, HoHai University, Nanjing, 210098, China. Email: [email protected]Search for more papers by this authorJieyang Zhou, Jieyang Zhou College of Energy and Electrical Engineering, HoHai University, Nanjing, ChinaSearch for more papers by this authorXiaorong Sun, Xiaorong Sun College of Energy and Electrical Engineering, HoHai University, Nanjing, ChinaSearch for more papers by this authorYang Cao, Yang Cao College of Energy and Electrical Engineering, HoHai University, Nanjing, ChinaSearch for more papers by this authorXiaomei Cheng, Xiaomei Cheng Department of Research and Development, Yara International, Oslo, NorwaySearch for more papers by this authorHossein Farahmand, Hossein Farahmand orcid.org/0000-0003-1125-8296 Department of Electric Power Engineering, Norwegian University of Science and Technology, Trondheim, Norway Contribution: Supervision, Writing - original draft, Writing - review & editingSearch for more papers by this author Xueping Pan, Corresponding Author Xueping Pan [email protected] orcid.org/0000-0001-9756-8089 College of Energy and Electrical Engineering, HoHai University, Nanjing, China Correspondence Xueping Pan, College of Energy and Electrical Engineering, HoHai University, Nanjing, 210098, China. Email: [email protected]Search for more papers by this authorJieyang Zhou, Jieyang Zhou College of Energy and Electrical Engineering, HoHai University, Nanjing, ChinaSearch for more papers by this authorXiaorong Sun, Xiaorong Sun College of Energy and Electrical Engineering, HoHai University, Nanjing, ChinaSearch for more papers by this authorYang Cao, Yang Cao College of Energy and Electrical Engineering, HoHai University, Nanjing, ChinaSearch for more papers by this authorXiaomei Cheng, Xiaomei Cheng Department of Research and Development, Yara International, Oslo, NorwaySearch for more papers by this authorHossein Farahmand, Hossein Farahmand orcid.org/0000-0003-1125-8296 Department of Electric Power Engineering, Norwegian University of Science and Technology, Trondheim, Norway Contribution: Supervision, Writing - original draft, Writing - review & editingSearch for more papers by this author First published: 21 October 2022 https://doi.org/10.1049/rpg2.12619AboutSectionsPDF ToolsRequest permissionExport citationAdd to favoritesTrack citation ShareShare Give accessShare full text accessShare full-text accessPlease review our Terms and Conditions of Use and check box below to share full-text version of article.I have read and accept the Wiley Online Library Terms and Conditions of UseShareable LinkUse the link below to share a full-text version of this article with your friends and colleagues. Learn more.Copy URL Share a linkShare onFacebookTwitterLinkedInRedditWechat Abstract Photovoltaic (PV) generation has high impact on the decarbonization pathways of power systems. Accuracy of day-ahead PV power forecasting has become crucial in the operation and control of power system with high PV penetration. This paper develops a hybrid approach based on generative adversarial network (GAN) combined with convolutional autoencoder (CAE) to improve PV power forecasting accuracy. Self-organizing map method is first utilized as data pre-processing to classify target days into different weather types based on solar irradiance. With the ability of GAN to reduce the burden of loss and the advantages of CAE to extract multi-scale effective features from the weather and PV power, PV power forecasting model consisting of GAN and CAE is proposed. The developed method has been tested on a real dataset in a Chinese PV station and compared with base reference PV forecasting methods. Numerical testing results demonstrate the effectiveness of our method with high accuracy. 1 INTRODUCTION Decarbonization of the energy sector plays an important role in mitigating the effects of climate change and global warming. In this respect, solar energy has been intensively investigated, given its positive contribution to the most pressing energy problems [1]. It is reported that in the first quarter of 2021, the installed capacity of photovoltaic (PV) in China has been increased by 5.33 million kW, and its cumulative installed capacity has reached 260 million kW [2]. High-level penetration of PV power generation to the electric grid leads to many technical challenges in the power grid stability and safety [3]. With the continuous expansion of the grid-connected PV systems, the precision of day-ahead PV power forecasting plays a crucial role in scheduling power production and procuring enough reserve capacity in power systems. Considering the variability and intermittency in PV production, the forecasting problems become even difficult. In this paper, a hybrid method based on the generative adversarial network (GAN) combined with convolutional autoencoder (CAE) is developed for day-ahead PV power forecasting. The CAE is applied before the fully connected neural network in the generator of the GAN in the forecasting model. Its robustness and denoising ability based on spatial correlation extraction is utilized to improve the performance of PV power forecasting. The excellent performances of convolutional neural networks have directly contributed to the creation of CAEs. CAE is applied to dimensionality reduction and anomaly detection, which can handle two-dimensional spatial information well and improve the accuracy of input information. Combining CAE with the powerful unlabelled input data processing capability of GAN and the adversarial training process, the combination of the CAE and GAN can reduce the prediction error. The main contributions of this paper are summarized below To analyze and extract different features of weather types, time series correlation analysis and the self-organizing map (SOM) method are applied. Weather types are clustered according to the ratio of diffuse horizontal irradiance (DHI) and global horizontal irradiance (GHI), and each type will be forecast individually to capture the features of different weather types. A hybrid method combining GAN with CAE is applied for the day-ahead PV power forecasting. The CAE is applied to dimensionality reduction and anomaly detection, which can improve the accuracy of input information. Combining this with the powerful unlabelled input data processing capability of GAN, the hybrid approach can reduce the prediction error. Validation, testing and analysis of a real dataset in China as well as comprehensive comparisons with base references are conducted to demonstrate the efficiency and high precision of the developed method. The rest of the paper is organized as follows. Section 2 summarizes and reviews the main methods for PV power forecasting. Section 3 illustrates the PV power data and relevant weather factors to investigate the features and extract the appreciate input for the forecasting model. The developed hybrid model of GAN combined with CAE is described in detail in Section 4. The numerical testing and analysis are provided in Section 5 followed by the concluding remarks in Section 6. 2 LITERATURE REVIEW The PV power forecasting methods have been variously investigated and analyzed [4-7] in recent decades. The most popular forecasting methods can be categorized into three types: the statistical time-series based methods, machine learning methods and the hybrid methods. A summarization of reviewed references and methods is presented in Table 1. TABLE 1. List of reviewed forecasting methods Statistical time-series methods Linear regression [8] Exponential smoothing [9] Autoregressive moving average [10] Autoregressive integrated moving average [11] Machine learning methods Decision tree [12] Support vector regression [13] Artificial neural network [14, 17, 18] RNN [15] CNN [20] LSTM [19] Deep learning [16, 21] DBN(deep belief networks) [22] DCNN(deep convolutional neural network) [23] AE, CAE [24, 25] GAN [26] Hybrid methods LSTM-RNN [27] CNN-LSTM [28-30] CAE-CNN [31] CNN-GAN [32] LSTM-GAN [33] Statistical time-series-based methods With the development of data mining technology, statistical methods based on historical data have been widely concerned in academia and industry. Time series provide statistical information to anticipate the characteristics of quantified elements and to predict the upcoming situation by evaluating past information [7]. The most popular statistical methods include simple linear regression [8], exponential smoothing [9], autoregressive moving average (ARMA) [10] and autoregressive integrated moving average (ARIMA) [11]. Machine learning methods Machine learning methods can learn from historical data and improve their predictive power through continuous iterative training, which can obtain the final prediction results through powerful training without predetermined formulas. The main methods of machine learning are decision tree [12], support vector regression [13], artificial neural network (ANN) [14], recurrent neural network (RNN) [15] and deep learning methods [16]. To capture the non-linear mapping between the input and output targets, ANN has been used in PV forecasting. Reference [17] compared the ANN model with three traditional mathematical schemes for PV output prediction and found that the ANN had much higher prediction accuracy. In [18], four different architectures of ANN are compared and it demonstrated high forecasting accuracy of ANN. In the last few decades, ANN forecasting methods have been modified and developed, for instance, the RNN method with consideration of time correlation in data sequence, the long short-term memory (LSTM) method with super memory [19] and the CNN approach with strong ability to extract spatiotemporal correlation [20]. The non-linear processing capability of ANN facilitates PV power prediction, while the neural networks with shallow structure have the shortcomings of network instability and parameters non-convergence, which remain a problem that needs to be addressed, and the emergence of deep learning methods provides a good way to solve this problem [21]. Deep learning methods can learn from voluminous input data, use numerous hidden layers and better parameters to enhance the ability of forecast. A variety of research have concluded that application of deep learning methods in PV power forecasting has greatly improved the forecasting accuracy because of their strong feature extraction ability. The deep belief network (DBN) method has high-level abstraction extraction ability [22], the deep convolutional neural network (DCNN) approach can fit complex non-linear mappings and processing different data sets [23], and the autoencoder (AE) approach have the characteristic of dimensionality reduction and denoising [24]. Furthermore, the encoding and decoding structure of CAE also has already demonstrated strong sky image prediction ability for spatiotemporal information in PV power forecasting [25]. Recently, a new deep learning model named GAN is proposed, which acts as a dominated approach in image synthesis and language processing. The GAN approaches, for example, the convolutional GANs and the conditional GANs, have been widely applied into different scenarios. For instance, the convolutional GAN performs outstandingly in PV power forecasting [26]. However, the small-scale timing information for detailed forecasting might be lost during the deep convolution process when high-frequency features are converted into low-frequency features. Hybrid methods To incorporate different advantages of ANNs and to avoid their possible disadvantages, hybrid methods have been proposed and widely used recently in PV forecasting. In [27], a hybrid method with a combination of LSTM-RNN was proposed for PV power forecasting, and the coupling between weather and electricity was incorporated into the forecasting model, the proposed hybrid method had shown better performance than individual LSTM and RNN. In [28], the authors proposed a novel multivariate hybrid deep neural model named WPD-CNN-LSTM-MLP for 1-h-ahead solar irradiance forecasting. In [29, 30], two hybrids of CNN-LSTM and ConvLSTM were applied and the PV forecasting results show better forecasting accuracy than a normal LSTM model. Besides, in the hybrid of CAE and CNN, the CAE method can enhance the network depth and widen the network through establishing long skip connections in deep CNN [31]. In [32], the method of using GAN to enhance the training dataset and then training by CNN not only improves the accuracy of prediction but also has high efficiency compared with traditional methods. Meanwhile, the generator of GAN can be substituted with LSTM structures to avoid the mean trap in time series forecasting. However, with multiple input variables consideration, spatial correlations extracted through convolutions by CNN have better performance than temporal correlations extracted by LSTM in PV power forecasting [33]. Compared with CNN, CAE has stronger feature extraction and de-noising ability, and the combination of CAE and GAN may produce better predictions. 3 PV POWER AND AFFECTING VARIABLE ANALYSIS PV power data and relevant weather factors are analysed in this section to dig into the time series correlations and characteristics, and the appropriate input for the forecasting model is selected. Data analysis To analyse the features of PV power and weather data, one PV power dataset from a regional PV station with 25-MW rated power in Jiangsu Province, China is investigated. The station faces south, with a tilt angle of 29°. The PV power data is collected from 1 January, 2017 to 31 December, 2017 from 5 AM to 7 PM in step of 5 min. The corresponding meteorological data is collected from the numerical weather prediction (NWP) by climate database Solargis v2.1.21 (https://solargis.com/cn). The weather variables collected include GHI, DHI, global tilted irradiance (GTI), temperature (TEMP), wind speed (WS), and wind direction (WD). Scatter plots of the weather data versus PV power are shown in Figure 1. As can be seen, approximate linear relationships exist between the PV power and weather factors of GHI and GTI. Weather factors DHI, TEMP, and WS have highly non-linear patterns with the PV power, while WD is almost irrelevant with the PV power. The scatter plot indicates non-linear forecasting methods are necessary to capture the high non-linear features among PV power and weather variables. FIGURE 1Open in figure viewerPowerPoint Scatter plots of weather variables versus PV output Time series autocorrelation analysis is also conducted for the six weather variables, as shown in Figure 2. It can be seen that the PV power to be estimated has a strong correlation not only with the adjacent values, but also with distant values of the input data. Therefore, the local reception characteristics of traditional ANN or CNN may lose importance features in the input variables. Forecasting methods consisting of fully connected network or hybrid methods would be thus suitable for forecasting problems in view of their ability in keeping all features of the input data. FIGURE 2Open in figure viewerPowerPoint The autocorrelation results of the six input variables Model input selection The Pearson correlation coefficient is used to investigate linear correlations among time series {x} and {y}: ρ x y = ∑ t = 1 n ( x t − X ¯ ) × ( y t − Y ¯ ) ∑ t = 1 n ( x t − X ¯ ) × ∑ t = 1 n ( y t − Y ¯ ) $$\begin{equation}{\rho _{xy}} = \frac{{\sum\nolimits_{t = 1}^n {({x_t} - \bar X)} \times ({y_t} - \bar Y)}}{{\sqrt {\sum\nolimits_{t = 1}^n {({x_t} - \bar X)} } \times \sqrt {\sum\nolimits_{t = 1}^n {({y_t} - \bar Y)} } }}\end{equation}$$ (1)where n is the length of time series, X ¯ $\bar X$ and Y ¯ $\bar Y$ are the average of two time series, respectively. The parameter ρxy ∈ [−1,1] is the correlation coefficient of two time series. The Pearson correlation results between the collected historical PV power and six weather variables are shown in Figure 3. It can be seen from Figure 3 that GHI, DHI and GTI have high correlations with PV power, and this indicates that solar radiation makes great contribution to the PV power output. In addition, the correlations between TEMP, WS and PV power are relatively high, with the value of 0.303 and 0.242, respectively. This implies the positive impacts of TEMP and WS on PV power production. Furthermore, it can find that WD has a very low influence on the PV power production according to the lowest correlation between WD and PV (with the value of 0.00412). This means that WD can be removed from the dataset. Therefore, the five weather variables (GHI, DHI, GTI, TEMP and WS) with coefficient above 0.2 and historical PV power are chosen as the input factors for the day-ahead PV power forecasting. Selection criteria and threshold may vary with different testing cases. FIGURE 3Open in figure viewerPowerPoint Pearson correlation coefficient between meteorological variables and PV power 4 METHODOLOGY This section presents the forecasting methodology. Architecture of the developed method is depicted in Figure 4. The data pre-processing block focuses on clustering the weather types according to the ratio of DHI and GHI. All weather data are categorized into three parts corresponding to the sunny days, cloudy day and rainy days. Individual forecasting model GAN combined with CAE is then developed and applied to forecast the PV power for each weather type data. FIGURE 4Open in figure viewerPowerPoint Architecture of the developed forecasting method SOM-based clustering Data pre-processing is the first and mandatory step to conduct the feature extraction for PV power forecasting. Many different approaches have been used in data pre-processing. However, the clustering technologies highly depend on prior information to obtain the number of target clusters [34]. The approach of SOM neural network developed in [35] is a special type of neural network used in clustering, which does not require prior information or complicated formula and is less affected by noisy data [36]. Therefore, correlation analysis and the SOM neural network are applied for data pre-processing in this research. According to the national standard formulated by China Meteorological Administration, weather statuses (i.e. atmospheric conditions) are divided into 33 weather types [37]. Among all these weather types, sunny, cloudy and rainy are the three typical types occupying the majority of weather statuses. To reduce the complexity of classification, and to have reasonable historical data of weather types with low occurrence frequency, three typical weather types of sunny, cloudy and rainy are considered in this paper. Three typical weather types are clustered by the SOM neural network method before feeding into the forecasting engine. Clustering process of the SOM method is illustrated in Figure 5. It consists of two layers including input layer and competitive layer. The mean and standard deviation of the daily total DHI and GHI ratio for each weather type are the inputs [38], which are transformed by the SOM neural network into a two-dimensional map of features in a topological-ordered fashion in the input layer. In the competitive layer, the neurons are classified into different reaction zones through self-organizing learning. Hence, the input could be automatically classified. FIGURE 5Open in figure viewerPowerPoint Schematic of SOM Input data formulation According to the local sunrise and sunset in different seasons, including the extreme conditions in both winter days and summer days, the PV power generation of the selected PV station generally happens from 5 AM to 7 PM (time zone: GMT + 8). For simplicity, we thus consider the consistent solar hours from 5 AM to 7 PM throughout the day. The input data to the generator of GAN is conducted as a two-dimensional matrix with six rows (corresponding to six variables including five weather variables and historical PV power) and 15 columns (corresponding to 15 hourly spans from 5 AM to 7 PM), which is shown in Figure 6. The input matrix can be treated as a two-dimensional pixel map, of which the inner spatial correlation is convenient for CNN to extract. Similarly, the input data to the discriminator of GAN is also a two-dimensional map constructed from the PV power time series of the predicted day. FIGURE 6Open in figure viewerPowerPoint Two-dimensional input data The model of GAN combined with CAE Structure of CAE GAN is illustrated in the bottom red box of Figure 4. The GAN consists of two networks: the generator network and the discriminator network. The two-dimensional historical PV power and five weather variables are the input of the generator network, while the output of the generator network is the predicted PV power f. The discriminator network works as a classifier, which aims to discriminate the predicted power f from the actual PV power y. The adversarial GAN loss promotes the generator network to calculate an accurate predicted value that approximates the distribution of the actual value. After the training, the generator network of GAN will be adopted for PV power prediction. The CAE is implemented before fully connected neural networks in the generator of GAN to capture the inner feature between input data (including historical PV power and five weather variables) and the actual PV power of the forecasted day. The CAE works as a symmetrical U-shaped connected convolution network, which contains two parts. The first encoder part is used to extract low-frequency features and their interaction relationships from the input variables while the second decoder part enables precise localization using up-convolutions and reconstructs the denoised and effective feature map. As shown in Figure 4, the encoder consists of a series of blue boxes corresponding to the multi-channel feature map. The number of channels denoted on the top of the box represents the number of convolution kernels in the last convolution process. The decoder part consists of stacked blocks, which is similar to those of the encoder. Furthermore, up-convolutions (green arrow in Figure 4) are added between each two decoding blocks. Therefore, the feature maps from different layers can be unified in size and concatenated together. In addition, the encoder and decoder parts are concatenated through long jump connections, which provide different-level features for more contact information until the output map fuses effective features of all layers. The schematic of convolution and up-convolution is shown in Figure 7. FIGURE 7Open in figure viewerPowerPoint Schematic of convolution and up-convolution The discriminator network of GAN plays an adversarial role to support the generator network to predict accurate PV power. In this research, the CNN, which is based on classic LeNet architecture [39], is used for the discriminator network. The CNN comprises fully connected layers, convolutional layers and two non-linear activation functions: Leaky_Relu and Sigmoid. The main objective of the convolutional layer is to extract deep low-resolution features for accurate classification of actual values and predictions, while the fully connected layer linearly combines pixels of the feature map to a vector. The non-linear activation functions are to investigate the non-linear relationships. In GAN, the objective of the generator network is to analyze the mapping from the input x to the actual data y, which can be expressed as: G : R x → R y $G:{R^x} \to {R^y}$ . The main purpose of the discriminator is to distinguish the prediction f from the actual value y based on supervised { 0 , 1 } $\{ 0,\;1\} $ classification, which can be represented as D : R f × R y → { 0 , 1 } $D:{R^f} \times {R^y} \to \{ 0,\;1\} $ . In adversarial training, the discriminator D attempts to distinguish generator G's outputs f from the actual data y with 'fake' and 'real' labels while generator G aims to predict accurately and fools D to obtain 'real' labels. The training of GAN is a two-player minimax game, and the objective function is as follows [26, 40]. min G max D V ( G , D ) = min G max D E y [ log D ( y ) ] + E x [ log ( 1 − D ( G ( x ) ) ) ] = min G max D 1 m ∑ i = 1 m log D ( y i ) + 1 m ∑ i = 1 m log 1 − D ( G ( x i ) ) $$\begin{eqnarray} \def\eqcellsep{&}\begin{array}{l} \mathop {\min }\limits_G \mathop {\max }\limits_D V(G,D)\\[9pt] {\rm{ }} = \mathop {\min }\limits_G \mathop {\max }\limits_D \left\{ {{E_y}[\log D(y)] + {E_x}[\log (1 - D(G(x)))]} \right\}\\[9pt] {\rm{ }} = \,\,\mathop {\min }\limits_G \mathop {\max }\limits_D \left\{\! {\dfrac{1}{m}\displaystyle\sum_{i = 1}^m {\log D({y^i})} +\! \frac{1}{m}\displaystyle\sum_{i = 1}^m {\log \left[ {1 -\! D(G({x^i}))} \right]} } \right\} \end{array} \nonumber\\[-4pt] \end{eqnarray}$$ (2)where V is the training objective of GAN, E stands for averaging, m is the data number, D(y) is the possibility of actual sample y belonging to actual data and D(G(x)) is the possibility that the predicted sample G(x) belongs to the actual data. During the training process, G tries to minimize the objective against an adversarial D which tries to maximize it. When D(y) is close to 1 and D(G(x)) is close to 0, V(G, D) can be large enough. On the contrary, when D(G(x)) is close to 1, V(G, D) will be very small. The optimal solution of both G and D can be achieved when their confrontation reaches the Nash equilibrium. References [40] and [41] have shown that mixing the adversarial loss with traditional loss, such as MSE loss, can speed up the convergence through facilitating the predicted values f close to the actual values y from the point-to-point value. In this paper, the MSE loss is defined as follows: L M S E = 1 n ∑ t = 1 n ( y t − f t ) 2 $$\begin{equation}{L_{MSE}} = \frac{1}{n}\sum_{t = 1}^n {{{({y_t} - {f_t})}^2}} \end{equation}$$ (3)where n is the length of input time series, y is the actual output time series, f is the output of the GAN generator. Consequently, the ultimate training objective of the generator can be described as L G = ( 1 − λ ) min G max D V ( G , D ) + λ min L M S E ( G ) $$\begin{equation}{L_G} = (1 - \lambda )\mathop {\min }\limits_G \mathop {\max }\limits_D V(G,D) + \lambda \min {L_{MSE}}(G)\end{equation}$$ (4)where λ is the weight coefficient. Flow chart of the above developed PV power forecasting method is illustrated in Figure 8 with detailed steps as follows: Step 1: Five weather variables (GHI, DHI, GTI, TEMP and WS) are selected as input variables according to the correlation analysis between PV power generation and the weather variables. Step 2: Based on the ratio of DHI and GHI, weather types are clustered into three categories, that is, sunny, cloudy and rainy day by SOM neural network. Step 3: Two-dimensional data with time series as horizontal coordinate and the historical PV power and weather data as longitude coordinate is constructed as input to GAN's generator. Step 4: Feature extraction is attained based on CAE. The encoder extracts the deep features of the two-dimensional input data, and the multiple frequency effective features from different layers are fused in the decoder part of CAE. Step 5: The fully connected neural network in the generator of GAN linearly transforms the output map from CAE into the time series of PV power. Step 6: The discriminator of GAN with the range [0,1] works as a classifier to distinguish the predicted value of PV power from the actual value. The higher the output of discriminator, the closer between the predicted value and the actual power. Step 7: Calculation of the adversarial loss and MSE loss. Step 8: When the mixture of adversarial loss and MSE loss reaches the end of the epoch, the training ends and the PV power time series output by the generator of GAN are the forecasted values. Otherwise, the parameters of GAN are continuously updated based on the gradient feedback and correction and return to step 4 for the next training iteration. FIGURE 8Open in figure viewerPowerPoint Flow chart of the developed PV forecasting approach 5 CASE STUDY The regional PV station with 25-MW rated power in Jiangsu Province, China, is investigated for the testing and analysis. In the following, weather type clustering, model parameter tuning, the performance of the developed method and the comparison with other popular methods are presented. The PV power forecasting structure has been implemented in Python 3.6, and tested on a 64-bit i9-10900 CPU 16G RAM personal computer. Training and testing the model are based on Pytorch 1.5.0 deep learning framework. The forecasting performance is evaluated using three criteria: mean absolute error (MAE), MAPE and RMSE: M A E = 1 n ∑ t = 1 n | y t − f t | $$\begin{equation}MAE = \frac{1}{n}\sum\limits_{t = 1}^n {|{y_t} - {f_t}|} \end{equation}$$ (5) M A P E = 1 n ∑ t = 1 n | y t − f t | 1 n ∑ t = 1 n |