Wind Power Prediction considering Ramping Events Based on Generative Adversarial Network

,


Introduction
Energy powers the progress of human society. It brings people abundant material comforts and enjoyment. However, in the meantime, it may also cause serious environmental pollution to the earth. For example, traditional fossil fuels produce greenhouse gases such as carbon dioxide and sulfur oxides and toxic heavy metal particles such as mercury. Apart from that, fossil energy is exhaustible and faces the threat of resource depletion. erefore, renewable clean energy has become the focus of research at home and abroad [1]. Wind energy, featured by large reserves, wide distribution, little pollution, and well-rounded technology, is widely favored among the power system [2]. However, it can be easily affected by wind speed, which is naturally random and intermittent, unstable, and difficult to control [3]. Especially the wind power ramping events occurring in extreme weather have posed great challenges to the safe and stable operation of power grid. Wind power ramping events here refer to the large fluctuation of output power in a short time caused by climate change happening in wind power stations, which may lead to large fluctuation of system frequency and even serious blackouts afterwards [4]. For this reason, improving the prediction accuracy of wind power is of great significance to the regular service of power system [5].
Wind power ramping prediction can be divided into direct prediction and indirect prediction [6]. e former is to directly predict the characteristics of ramping events according to the recognition mechanism trained by historical data [7]. e latter refers to the detection and identification based on the wind power prediction method using the definition of ramping [8][9][10][11]. Zheng and Kusiak [12] predicted the ramp rate of wind power directly based on data mining algorithm and compared the prediction performance of five algorithms from different time scales. Zareipour et al. [13] introduced an SVM-based trainer on the basis of historical data to directly classify and predict the ramping range of wind power. Cui et al. [14] used statistical models to analyze the probability distribution of ramp amplitude, rate, and duration of wind power ramping time at different time scales. Besides, Mingjian et al. [15] also decomposed the original ramp power considering the strong tracking and prediction ability of Atomic Sparse Decomposition (ASD) to nonstationary signals, and the decomposed atomic components are self-predicted. Ouyang et al. [16] proposed a prediction method of correcting wind power according to the similar characteristics of the same type of ramping event under the same meteorological conditions. e direct prediction method is intuitive and accurate, but it requires a lot of historical data as the training model [17]. However, wind power ramping events are part of lowprobability events and the lack of historical data restricts the development of this method.
In this paper, a wind power prediction method considering ramping events based on Generative Adversarial Network (GAN) is proposed. According to its definition, the set of ramping events is separated from historical wind power data. In consideration of meteorological factors, the historical ramping feature set is obtained after feature extraction. In order to enrich the number of samples, GAN is used to generate more simulated ramping data. GAN is composed of two parts: the generator and the discriminator. e generator continuously produces simulated ramping data according to the input feature set. e discriminator is designed to distinguish whether the data image is historical data or simulated data. rough the adversarial training of generator and discriminator, the authenticity of simulated ramping images is continuously improved. Adversarial training means that the generator generates simulated data similar to historical data, while the discriminator tries to distinguish historical data from simulated data. When the feature distribution of the simulated data image generated by the generator is basically the same as that of the historical data and the discriminator cannot distinguish it, the training is finally completed. Simulated ramping data are then added to the historical set to realize the expansion of the database.
en, re-extraction of the feature set is achieved by using it as the input of the LSTM neural network to predict the power of ramping events. Taking the wind power dataset of a certain region in Northwest China as the basis, the feasibility of the proposed method is verified through simulated experiments.

Characteristics Analysis of Wind Power Ramping Events
Wind power ramping events refer to the large fluctuation of wind power in a short time when wind farms are affected by extreme weather. ey pose a serious threat to the quality of the power grid and the safe and stable operation of the system and even cause problems such as frequency instability and load shedding [18]. Ramping events are divided into ramping up and ramping down. When low-altitude rapids, thunderstorm, or typhoon happens, the power of the wind farm will increase sharply in a short time and therefore ramping-up events will occur. Ramping down comes when some wind turbines gradually quit operation due to weather reasons, and the power of the wind farm drops sharply in a short period of time. is chapter is to conduct qualitative and quantitative analysis on ramping events, summarize the evaluation indexes of commonly used prediction methods, and lay a theoretical foundation for the research on wind power ramping prediction methods based on Generative Adversarial Network.

Features of Ramping
Events. e ramping events are identified, and the historical ramping dataset is obtained. Because of the volatility and randomness of wind power, not every power fluctuation corresponds to a ramping event. e definition of valid ramping events in this paper is expressed in the following formula: where P GN stands for the rated power of the wind farm, P i indicates the power of wind farm at the moment t i , and P j means the power of wind farm at the moment t j .
It can be seen that if the wind power is climbing 20% up or down 15% of the rated power within 4 hours, it is judged as a valid ramping event. With this method, all the ramping events in the historical data are extracted, and the set of ramping events is constructed as After obtaining the set of ramping events, waveform and corresponding meteorological characteristics are extracted. Since the standard units and dimensions are different when it comes to meteorological factors and wind power and the numerical values differ greatly, normalization is urgently needed for calculation. e formula is as follows: where y signifies the value to be normalized and y max and y min denote the corresponding maximum and minimum values. e waveform feature of normalized ramping power is extracted [19], and then seven characteristic values are defined, as shown in Figure 1. ΔP l signifies the power difference between the maximum power and the minimum power on the left side, ΔP r stands for the power difference between the maximum power and the minimum power on the right side, Δt l means the time difference when the power rises rapidly, Δt r means the time difference when the power decreases rapidly, ΔP l /Δt l is the rate of ramping up, ΔP r /Δt r is the rate of ramping down, and Δt represents the time of ramping process.
After normalizing the three typical meteorological factors, namely, temperature, wind speed, and humidity, the historical data feature set D is formed, together with the feature set extracted from the waveform. e set is as follows: where ΔP l , ΔP r , Δt l , Δt r , ΔP l /Δt l , ΔP r /Δt r , and Δt represent seven characteristic values of wind power waveform. Among them, T e , V w , and H indicate temperature, wind speed, and humidity, respectively.

Evaluation Index System.
ere are two evaluation indexes for wind power ramping prediction, namely, the prediction accuracy of ramping events and the prediction accuracy of power waveform [20,21]. e accuracy of ramping events refers to whether the prediction results are consistent with the actual observation results without false positives and false negatives [22]. e prediction results are shown in Table 1.
In Table 1, TP refers to the predicted and actual occurrence of ramp events; FN means that the event is predicted not to happen but actually happens, that is, false negatives; TN signifies predicted and actual nonoccurrence of ramp events; and FP indicates that the event is predicted to happen but actually not happens, in other words, false positives [23,24]. e prediction result is represented by N TP , N FN , N TN , and N FP . Common evaluation indexes of the accuracy of ramping prediction results are shown in formulas (4)-(6): where P R stands for the precision rate, indicating the probability of the event which is predicted to happen but actually not happens; R R means the recall rate, indicating the probability of the actual ramping event which is correctly predicted; and C SI shows the critical success index, which indicates whether the prediction result is valid. e accuracy of the ramping power waveform refers to the consistency between the predicted waveform and the actual waveform [25]. Because of the randomness and volatility of wind power and the limitations of prediction models and methods, there are inevitable errors in wind power prediction. For this reason, selecting an appropriate prediction error model is the premise and basis for quantitative analysis and verification of various evaluation indexes [26]. In this paper, Min-Max standardization is adopted to conduct linear transformation of the original data to limit the data size to [0, 1], using the normal distribution model as the basis of analysis. To evaluate the prediction accuracy of the model, mean absolute error (MAE) is applied as the standard [27]. e formula is as follows: where n represents the number of test samples and y t ′ and y t represent the predicted power and real power at time t, respectively.

Prediction Model Based on Generative
Adversarial Network

Flowchart of Prediction.
In light of the problems of low accuracy and poor reliability caused by insufficient ramping samples in the traditional method, a new prediction method based on Generative Adversarial Network is proposed. e model first collects historical wind power data and corresponding meteorological feature set. rough ramping detection, the effective ramping events are determined and the historical ramping dataset is formed. According to the definition of ramping events, seven main characteristics of them are extracted, and the three meteorological characteristics of wind speed, temperature, and humidity are combined to obtain the historical ramping feature set. A feature set which integrates similar feature values with it is used as the input of GAN. rough the adversarial training of the generator and the discriminator, simulated ramping data with high similarity to historical climbing data are generated. It can greatly expand the number of samples while ensuring the climbing characteristics and solve the problem of insufficient input samples. e expanded dataset is refeatured and input to the LSTM neural network to produce the predicted waveform value of the ramping power. e specific workflow is shown in Figure 2.

e Structure of GAN.
Generative adversarial network is used to generate simulated ramping data, which is an important part of the proposed power prediction scheme. It consists of a generator G and a discriminator D. e   generator is composed of two parts: encoder and decoder. e feature set of historical ramping events is sent to the encoder to extract image features. en, the new coding features and historical data are transmitted into the decoder in series. e decoder can generate different types of simulated ramping data by combining different feature information. e simulated ramping data and the historical data are mixed as a dataset, which is then input to the discriminator D. e discriminator distinguishes whether the data source is historical data or simulated data. rough the adversarial training, the similarity between the simulated data and the historical data is continuously improved, thus ensuring the reliability of the simulated database. e specific workflow is shown in Figure 3. e structures of the generator G and the discriminator D are shown in Figures 4 and 5, respectively. At the core of the generator G, which is demonstrated in Figure 4, two convolutional layers with 3 × 3 kernels and 64 feature maps are used, followed by batch-normalization layers and ReLU as the activation function. To distinguish historical data from simulated data, a discriminator network is trained, as is illustrated in Figure 5. Here, we use Leaky ReLU activation and avoid max-pooling throughout the network. Also, the discriminator D is trained to handle the maximization problem. It includes eight convolutional layers with an increasing number of filter kernels. Strided convolutions are used to reduce the image resolution each time the number of features is doubled. Two dense layers and a final sigmoid activation function are designed to obtain a probability for sample classification. After alternatively training D and G, the output of the discriminator is stable at about 0.5. As a result, the discriminator cannot recognize whether the input data are from the historical dataset or not when the network training ends. e cost function V(D, G) between the generator and the discriminator is as follows: Among them, the real ramping data x follow the data distribution p d (x) and noise z obeys Gaussian distribution. Traditional Generative Adversarial Network faces the problem of unstable training process and uncontrollable images resulted from that. To solve it, a common method is used to restrict the network and to introduce conditional variables y in the modeling process to guide the data generation process. e cost function is shown in the following formula: D(G(z, y), y))].
3.3. Model Learning. Given any wind power ramping waveform diagram, its corresponding characteristic value is y p . e proposed model includes two types: adversarial loss and content loss. Among them, adversarial loss refers to the image x ′ , generated by the original ramp image x through the Generative Adversarial Network. Content loss refers to ensuring the consistency between the generated image and the original image through L1 loss.
Adversarial loss signifies the loss function of generator G and discriminator D in the Generative Adversarial Network. e role of generator G is to create a new ramping image through the new feature quantity and the historical data. Discriminator D is mainly used to distinguish the historical data from the simulated data. Its input contains historical samples and simulated samples of generator. Adversarial training between the generator and the discriminator can continuously improve the similarity between them, thus ensuring the diversity of the database of ramping events. e loss function between the generator and discriminator is 3.4. LSTM Neutral Network. Long short-term memory (LSTM) network is a special cyclic neural network, which has the advantages of better information storage and more accurate access to historical information [28]. It can avoid the gradient disappearance in RNN network and is widely applied in the processing of long time series [29][30][31][32]. In addition to the external self-circulation module, one Cell is added, which contains multiple storage units and three different "gates": input gate, forgetting gate, and output gate. e three gates are nonlinear units used to control historical information, collect external data, and filter internal data [33][34][35]. is paper uses LSTM neural network algorithm as the power prediction model.

Experimental Results and Analysis
In order to verify the effectiveness of the proposed wind power ramping prediction model based on Generative Adversarial Network, a sample dataset of a certain area in Northwest China is selected as a study case. Also, in order to make the training of the model stable, the encoder contains five convolution layers and the decoder contains seven deconvolution layers. ere is a full connection layer between the encoder and the decoder. e discriminator consists of four convolution layers and two fully connected layers. In order to balance time and efficiency, VGG16 is used as each subconvolutional neural network. During training, the historical ramping image and the simulated ramping image are employed simultaneously. e experimental code is completed in TensorFlow framework.

Similarity Comparison between Simulated and Historical
Data. To quantitively evaluate how similar historical ramping event data and GAN-generated data are, a method is adopted to calculate the level of similarity between historical data and simulated ones and to ensure the feasibility of power prediction. e data P are regarded as the set of feature points p i , and the data Q are the set of feature points q j . Each feature point p i is used to match the corresponding q j . e formula is as follows:   Journal of Electrical and Computer Engineering 5 where d ij is defined as the cosine distance of feature points p i and q j and h represents bandwidth parameter. e distance scale is transformed into the similarity scale by exponential operation, and the standardized similarity scale is verified as shown in formulas (13) and (14). With CX(P, Q) ranging from 0 to 1, the level of similarity of the two images is indicated. After comparing the similarity between simulated data and historical ones, the results are derived as shown in Table 2. We can find that the similarity value is stable at 0.9-1, which proves that historical ramping event data and GAN-generated data are highly similar. e experiment shows that it is feasible to expand the historical climbing database by adopting simulated data.

Experiments on Different Proportions of Simulated Data.
To present the actual number of simulated data and historical data and to analyze the error rate of simulated data, we made some experiments to verify the reliability. By increasing the proportion of simulated data, the reliability of power prediction is calculated. A dataset with 1000 historical ramping events and a dataset with 100 historical ramping events are used as the input of the predictive model, and the proportion of simulated data is changed from 0% to 90%. en, MAE is calculated in Table 3. It can be seen that the accuracy of prediction will be gradually improved by increasing the number of simulated data in the historical data. However, when the simulated data are too large, the accuracy of the prediction algorithm will be limited to a certain extent. Also, when the simulated data are from 70% to 80%, the effect of the promotion algorithm is the best. When insufficient sample data (the number of historical ramping data is 100) are adopted, it can be seen that the prediction accuracy is continuously improved and the speed of improvement is faster through GAN. When the number of historical ramping data is 1000, which is relatively sufficient, the prediction accuracy is also improved, but the improvement effect is not obvious with the increase in the proportion of generative data. When 1000 historical data and 0 simulated data are used as input, the predicted MAE error is 69, and when 100 historical data and 900 simulated data are used as input, the predicted MAE error is 81.3. It can be seen that simulated data are not as effective as real sample data when used as training samples. However, when sufficient historical data are not available, data generation is still an effective method to improve the forecasting effect.

Evaluation of Ramping Events Prediction.
e ramping data of wind farms in recent years are selected for experiments. In order to ensure the quantity of ramping data and obtain a reasonable wind power prediction dataset, the model is divided into the following parts according to the steps in Figure 6.
At present, SVR, BP, and Elman neural networks have been widely used for wind farm prediction. Based on structural risk minimization, SVR has strong robustness [36]. BP is a classical neural network, which has a fast learning speed and is widely used in many fields [37]. e structure of Elman neural network is similar to BP, but the output of its hidden layer is connected with the input, which plays an important role in the global optimization of the network [38][39][40]. In this paper, a wind power ramping prediction model based on GAN is proposed and established, compared with the previous methods mentioned. In the sample set, 500 ramping data and 500 nonramping data are chosen for three groups of experiments. To evaluate the effect of ramping events' prediction, P R , R R , and C SI are calculated, respectively [41]. e results obtained are shown in Table 4.
LSTM, SVR, BP, and Elman are used to predict the ramping events. It can be found that the LSTM method has the highest prediction accuracy, which is approximately 99%, while the accuracy of other methods is only about 90%. When Generative Adversarial Network is adopted to generate data, the addition of analog data will not reduce, but will improve the prediction accuracy. e simulation results have proven the prediction accuracy of wind power prediction algorithm based on Generative Adversarial Network in ramping events.

Evaluation of Power Waveform Prediction.
In order to verify the effectiveness of the algorithm of Generative Adversarial Network in power waveform prediction, the proposed model is compared with the traditional SVR, BP, and Elman power prediction models. en, MAE is calculated, respectively, to predict and evaluate ramp events. e result is shown in Table 5.
As can be seen in Table 5, the LSTM prediction algorithm has the smallest error and a higher accuracy. e prediction model generated by the adversarial network algorithm has significantly improved the prediction accuracy [42]. e simulation experiment results prove that the wind power prediction algorithm based on the Generative Adversarial Network realizes accurate prediction on ramping power waveform. e following figures show the comparisons of power waveform prediction.
It can be seen that the power prediction waveform based on the Generative Adversarial Network algorithm shares the most similarity to the real waveform in Figures 7-9. Figures 10-12 show the predicted power fluctuation range before and after the Generative Adversarial Network algorithm. In order to quantitatively describe the application effect of probability density function of different wind power prediction errors, the evaluation results of prediction with confidence levels of 90%, 80%, and 70% are calculated within the fluctuation range of wind power. It can be observed that the Generative Adversarial Network can significantly reduce the fluctuation of power prediction and improve the accuracy of prediction. Table 6 shows four typical wind power ramping predictions of three wind farms in four quarters. It can be perceived that the prediction error in spring and autumn is slightly higher than that in summer, and the biggest error is found in winter. e results show that the Generative Adversarial Network can significantly improve the accuracy of wind power ramping prediction. e prediction accuracy is basically unaffected by seasons. LSTM with GAN is compared to other traditional algorithms in this paper, including K-Means-LSTM, SSA-ELM, and LSTM without GAN. e results are shown as Figures 13 and 14. e MAE of four seasons and different            data sources is calculated, respectively, and the results are shown below. It can be seen from the table that the prediction accuracy of the algorithm based on Generative Adversarial Network is significantly higher than other algorithms when there are few data sources.

Conclusion
In this paper, a wind power ramping prediction model based on Generative Adversarial Network (GAN) is proposed. In light of the problems of insufficient historical data samples and low accuracy of ramping prediction in wind farms, the Generative Adversarial Network is employed to create highreliability simulated ramping images, which enriches the database and improves the prediction accuracy. rough the simulation experiment of historical data of wind farms in Northwest China, the feasibility and superiority of the proposed model are verified. e main work of this paper can be summarized as follows: (1) Based on its definition, valid ramping events are extracted from wind power data. According to the waveform characteristics of seven ramping events and the three weather characteristics of wind speed, temperature, and humidity, a historical ramping feature set is constructed. (2) A method based on Generative Adversarial Network is proposed to generate data. Taking the historical ramping feature set as the input of the model, the simulated data are produced through the generator and then the discriminator determines whether the data type is historical or simulated. rough adversarial training, the similarity level of simulated data is continuously improved. Highly similar simulated data can be used to expand the historical ramping database.
(3) e similarity between the simulated data and the historical data is calculated quantitatively, and the influence of errors in simulated data on the prediction result is analyzed. Experiments show that the simulated data are highly similar to the historical ones, and the best prediction effect is obtained when the proportion is between 70% and 80%. (4) An evaluation system for the prediction of ramping events has been established. e ramping prediction model is evaluated from two aspects: the prediction accuracy of ramping events and the prediction accuracy of power waveform. Taking the historical data of wind farms in Northwest China as the sample, the proposed model is compared with the prediction models of SVR, BP, and Elman neural network to verify its superiority. rough different confidence levels and prediction evaluation in different seasons, it is confirmed that the generation of adversarial network algorithm can improve the accuracy of ramping prediction.

Data Availability
e data used to support the findings of this study were supplied by Hao Wang under license and so cannot be made freely available. Requests for access to these data should be made to Hao Wang (610897616@qq.com).

Conflicts of Interest
e author declares that there are no conflicts of interest.