Adversarial sample enhanced training method for wind-solar power prediction model

CN122677952BActive Publication Date: 2026-10-20STATE GRID JIANGSU ELECTRIC POWER CO LTD RESEARCH INSTITUTE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611162924.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-20
Estimated Expiration
2046-08-03

AI Technical Summary

Technical Problem

[0006]本发明所要解决的技术问题是:提供一种风光功率预测模型的对抗性样本增强训练方法,通过设计针对风光功率预测特性的对抗性扰动生成机制,将对抗性样本融入模型训练过程,解决了现有预测模型在面对输入数据扰动时鲁棒性不足、预测精度急剧下降的技术问题,显著提升了模型在极端气象条件和潜在攻击场景下的稳定性和可靠性

Benefits of technology

[0021]本发明的有益效果为:本发明引入对抗性训练机制,通过在训练过程中生成并融入对抗性样本,使模型参数在训练阶段同时适应正常输入和扰动输入;且通过快速梯度符号法或投影梯度下降法生成扰动样本,与直接添加随机噪声的增强方式相比,所述对抗性训练样本由预测损失的输入梯度确定,能够针对模型对输入敏感的方向进行训练;同时,扰动范数约束和气象特征取值约束能够减少违反气象物理意义的训练样本,为新能源场站功率预测系统提供了有效的抗扰动训练方案,从而提高扰动输入场景下的预测稳定性,增强了高比例可再生能源并网场景下电力系统的安全可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122677952B_ABST
    Figure CN122677952B_ABST
Patent Text Reader

Abstract

The present application relates to new energy electric data processing technical field, especially to a kind of wind and light power prediction model's adversarial sample enhancement training method, comprising: obtaining historical wind and light power data and corresponding numerical weather forecast data, pre-processing forms original training sample;According to the gradient of the input feature of the prediction loss of wind and light power prediction model for original training sample, generate corresponding adversarial training sample with original training sample in the range of meeting preset perturbation constraint condition, preset perturbation constraint condition includes perturbation norm constraint and meteorological feature value constraint;Original training sample and adversarial training sample are composed into enhanced training sample set, to simultaneously constrain the training target of original training sample prediction loss and adversarial training sample prediction loss, train wind and light power prediction model, obtain trained wind and light power prediction model;Significantly improve stability and reliability under extreme weather and potential attack scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of new energy power data processing technology, and in particular to an adversarial sample augmentation training method for wind and solar power prediction models. Background Technology

[0002] Wind and solar power generation are significantly affected by meteorological conditions, resulting in fluctuating and random power output. New energy power plants typically use historical power data and numerical weather prediction data to train power prediction models, and then apply the prediction results to power generation planning, grid dispatching, and reserve capacity allocation. With the application of deep learning models in wind and solar power prediction, these models can learn the nonlinear mapping relationship between meteorological factors and power generation, improving prediction accuracy under normal operating conditions.

[0003] In real-world scenarios, numerical weather prediction data contains forecast errors, and extreme weather events can cause the distribution of input data to deviate from the distribution of training samples. Furthermore, deep learning models are highly sensitive to minor changes in input features. When the input data is disturbed, existing wind and solar power prediction models may produce significant prediction biases. Ordinary noise enhancement methods struggle to construct training samples targeting the model's weaknesses and also fail to account for the physical range of meteorological characteristics.

[0004] Therefore, how to ensure that the training samples cover the sample distribution corresponding to the disturbance input without compromising the physical rationality of meteorological data, and thereby improve the robustness of the wind and solar power prediction model under disturbance input, is a technical problem that needs to be solved in this field.

[0005] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the present invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide an adversarial sample augmentation training method for wind and solar power prediction models. By designing an adversarial perturbation generation mechanism targeting the characteristics of wind and solar power prediction, adversarial samples are integrated into the model training process. This solves the technical problem that existing prediction models are not robust enough and the prediction accuracy drops sharply when faced with input data perturbations, and significantly improves the stability and reliability of the model under extreme weather conditions and potential attack scenarios.

[0007] To achieve the above objectives, the technical solution adopted by this invention is: an adversarial sample augmentation training method for a wind and solar power prediction model, comprising the following steps: Historical wind and solar power data and corresponding numerical weather forecast data are acquired, and the historical wind and solar power data and the numerical weather forecast data are preprocessed to form original training samples. Based on the gradient of the prediction loss of the wind and solar power prediction model for the original training samples with respect to the input features, adversarial training samples corresponding to the original training samples are generated within the range of satisfying preset perturbation constraints. The preset perturbation constraints include perturbation norm constraints and meteorological feature value constraints. The original training samples and the adversarial training samples are combined to form an enhanced training sample set; Based on the enhanced training sample set, the wind and solar power prediction model is trained with the training objective of simultaneously constraining the prediction loss of the original training samples and the prediction loss of the adversarial training samples, resulting in the trained wind and solar power prediction model.

[0008] Furthermore, the preprocessing of the historical wind and solar power data and the numerical weather forecast data to form original training samples includes: Time alignment processing is performed on the historical wind and solar power data and the numerical weather forecast data; Perform missing value imputation, outlier detection, and outlier correction on the time-aligned data; The corrected data is then normalized or standardized for exchange. Training samples between the input feature sequence and the power label are constructed according to the input time window and the prediction step size, and the training set, validation set and test set are divided in chronological order.

[0009] Furthermore, the expression for the normalization process is: ; The expression for the standardized exchange process is: ; in, The feature values ​​to be processed The mean, Standard deviation, To be the minimum value, This is the maximum value.

[0010] Furthermore, the numerical weather forecast data includes at least one of wind speed, wind direction, temperature, air pressure, air density, irradiance, cloud cover, and humidity; the input feature sequence includes features from the numerical weather forecast data and historical wind and solar power features.

[0011] Furthermore, the step of generating adversarial training samples corresponding to the original training samples based on the gradient of the prediction loss of the wind and solar power prediction model with respect to the input features, within a range that satisfies preset perturbation constraints, includes: For input features and its power label Calculate the loss function Relative to the input features The gradient of, where This represents the wind and solar power prediction model; Candidate adversarial training samples are generated using the fast gradient sign method: ; in, This represents the input data after adversarial processing. This indicates the disturbance amplitude control parameter. Represents a symbolic function. This represents the gradient of the loss function with respect to the input x; The candidate adversarial training samples are projected or cropped to a range that satisfies the preset perturbation constraint conditions to obtain the adversarial training samples.

[0012] Furthermore, the step of generating adversarial training samples corresponding to the original training samples based on the gradient of the prediction loss of the wind and solar power prediction model with respect to the input features, within a range that satisfies preset perturbation constraints, includes: For input features and its power label Calculate the loss function Relative to the input features The gradient of, where This represents the wind and solar power prediction model; Input features of the original training samples Using the initial sample, adversarial samples are generated using the gradient method, expressed as: ; in, Indicates the number of iterations. Indicates the iteration step size. This indicates that candidate adversarial training samples are projected onto the set. Inside, set Determined by the preset perturbation constraint conditions. This represents the adversarial sample generated in the (t+1)th iteration; This represents the adversarial sample generated in the t-th iteration; Represents a symbolic function. Let L(·,·) represent the gradient of the loss function with respect to the input x. Let f(·) represent the loss function, f(·) represent the wind and solar power prediction model, and y represent the true power value corresponding to the input sample.

[0013] Furthermore, in the adversarial sample generation process, the perturbation norm constraint is: ; ; ; in, express norm, Indicates the disturbance amplitude control parameters; The constraints on the meteorological characteristic values ​​include: Set an upper limit for feature perturbation for each meteorological feature, and restrict the values ​​of the corresponding meteorological features in the generated adversarial training samples to the physical allowable range of that meteorological feature.

[0014] Furthermore, the disturbance amplitude control parameters Based on the prediction errors of normal samples and adversarial samples on the validation set, the prediction errors of the trained wind and solar power prediction model on normal samples and adversarial samples are determined to satisfy a preset balance condition.

[0015] Furthermore, the step of combining the original training samples with the adversarial training samples to form an enhanced training sample set includes one of the following methods: Before model training, generate adversarial training samples corresponding to at least a portion of the original training samples, and add the adversarial training samples to the original training samples; Alternatively, during model training, adversarial training samples can be generated online for the original training samples in each training batch, and the original training samples and the online-generated adversarial training samples in that training batch can be combined to form an enhanced training batch.

[0016] Furthermore, the loss function corresponding to the training objective is: ; in, The input features are those of the original training samples. To and The corresponding adversarial training samples, For power labels, It is the balance coefficient, and Determined based on the validation set.

[0017] Furthermore, the wind and solar power prediction model includes, but is not limited to: long short-term memory network, gated recurrent unit network, convolutional neural network, Transformer network, physical information based neural network, or any combination of the above.

[0018] Furthermore, after obtaining the trained wind and solar power prediction model, the method further includes: Calculate at least one of the following evaluation metrics on the test set and the adversarial test set generated from the test set: root mean square error, mean absolute error, mean absolute percentage error and coefficient of determination. The robustness improvement is determined based on the root mean square error of the baseline model on the adversarial test set and the root mean square error of the trained wind and solar power prediction model on the adversarial test set.

[0019] Furthermore, the robustness improvement magnitude The expression is: ; in, This represents the root mean square error of the benchmark model on the adversarial test set; This represents the root mean square error of the trained wind and solar power prediction model on the adversarial test set.

[0020] Furthermore, after obtaining the trained wind and solar power prediction model, the method further includes: The trained robust prediction model is deployed to the power prediction system of new energy power plants. It takes numerical weather forecast data as input in real time and outputs wind and solar power prediction results with disturbance resistance, providing decision support for power grid dispatch.

[0021] The beneficial effects of this invention are as follows: This invention introduces an adversarial training mechanism, which generates and incorporates adversarial samples during the training process, enabling the model parameters to adapt to both normal and perturbation inputs simultaneously during the training phase. Furthermore, perturbation samples are generated using the fast gradient sign method or projective gradient descent method. Compared to enhancement methods that directly add random noise, these adversarial training samples are determined by the input gradient of the prediction loss, allowing for training targeting the model's sensitivity to input. Simultaneously, perturbation norm constraints and meteorological feature value constraints reduce training samples that violate meteorological and physical meanings, providing an effective anti-perturbation training scheme for new energy power station power prediction systems. This improves prediction stability under perturbation input scenarios and enhances the safety and reliability of the power system in scenarios with a high proportion of renewable energy grid connection. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating the adversarial sample augmentation training method for the wind and solar power prediction model in Embodiment 1 of the present invention. Figure 2 This is a schematic diagram of the steps of the adversarial sample augmentation training method for the wind and solar power prediction model in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the meteorological parameter distribution required in Embodiment 2 of the present invention. Detailed Implementation

[0024] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0025] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly attached to the other element or there may be an intervening element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementation.

[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0027] Example 1 like Figures 1 to 2 The adversarial sample augmentation training method for the wind and solar power prediction model shown includes the following steps: Step S1: Construct the original training samples Acquire historical wind and solar power data, as well as corresponding numerical weather prediction data. Historical wind and solar power data can be measured power data from wind farms, photovoltaic power plants, or wind-solar hybrid power plants. Numerical weather prediction data can include one or more of the following: wind speed, wind direction, temperature, air pressure, air density, irradiance, cloud cover, and humidity.

[0028] The historical wind and solar power data and the numerical weather forecast data are preprocessed to form original training samples, specifically including: Time alignment is performed on historical wind and solar power data and numerical weather prediction data to map meteorological features and power labels in the same training sample to time points with the same or a pre-defined lag relationship. For single-point missing data, linear interpolation can be used for imputation; for consecutive missing data, forward imputation, backward imputation, or statistical values ​​from the same time period can be used for imputation. The processing expression is as follows:

[0029] Where, x t This represents the data value obtained by interpolation at the missing time point t; t1 and t2 represent the time points of the most recent valid data before and after the missing point, respectively; x t1 and x t2 These represent the valid data values ​​at the corresponding times.

[0030] Missing value imputation, outlier detection, and outlier correction are performed on the time-aligned data. As a specific implementation method, the mean is calculated within a sliding window. and standard deviation When the data points satisfy If the data point is identified as an outlier, it is corrected using the middle value of the sliding window or adjacent valid values.

[0031] The corrected data is standardized or normalized to reduce the impact of differences in the dimensions of different meteorological characteristics on model training. The expressions for standardization and normalization are as follows: ; ; in, The feature values ​​to be processed To obtain the mean of this feature in the training set, To determine the standard deviation of this feature in the training set, and These are the minimum and maximum values ​​of this feature in the training set, respectively.

[0032] According to the input time window and prediction step size Construct training samples between the input feature sequence and the power labels. For time... The input feature sequence can be represented as The power label can be represented as The training set, validation set, and test set are divided into sets according to chronological order to reduce data omissions.

[0033] Step S2: Generate adversarial training samples Based on the gradient of the prediction loss of the wind and solar power prediction model with respect to the input features of the original training samples, adversarial training samples corresponding to the original training samples are generated within a range that satisfies preset perturbation constraints, including the following steps: Establish a wind and solar power prediction model And define the prediction loss function. ,in This represents the input features of the original training samples. This represents the corresponding power label. The prediction loss function can be mean squared error, mean absolute error, or a weighted combination of both. Taking mean squared error as an example:

[0034] The perturbation direction is determined based on the gradient of the predicted loss function with respect to the input features.

[0035] In one implementation, a fast gradient sign method is used to generate candidate adversarial training samples:

[0036] in, Indicates candidate adversarial training samples, This indicates the disturbance amplitude control parameter. Represents a symbolic function. The loss function represents the loss function applied to the input features. The gradient.

[0037] In another implementation, candidate adversarial training samples are generated using a projection gradient iteration method:

[0038] in, Indicates the number of iterations. Indicates the iteration step size. This indicates that candidate adversarial training samples are projected onto the set. Projection operations within, collection Determined by preset perturbation constraints. The projection operation is used to restrict the candidate samples obtained in each iteration to the original samples. Within the allowed neighborhood, This represents the adversarial sample generated in the (t+1)th iteration; This represents the adversarial sample generated in the t-th iteration; Represents a symbolic function; L(·,·) represents the gradient of the loss function with respect to the input x; f(·) represents the loss function; y represents the wind and solar power prediction model; and y represents the true power value corresponding to the input sample.

[0039] To ensure the physical validity of the adversarial training samples, pre-defined perturbation constraints are imposed on the candidate adversarial training samples. These constraints include perturbation norm constraints and meteorological feature value constraints. The perturbation norm constraint can be expressed as: ; ; ; in, express norm, Indicates the disturbance amplitude control parameters; Meteorological feature value constraints are used to set physical allowable ranges and feature perturbation limits for each meteorological feature. For example, the perturbed value of wind speed is not less than 0, and the perturbed value of irradiance is not less than 0; for normalized features, the perturbed feature values ​​can be limited to the range [0,1]. For different meteorological features, perturbation limits can be set separately so that the perturbed samples retain the variation patterns of the corresponding station's meteorological data.

[0040] Disturbance amplitude control parameters This can be determined using a validation set. One implementation approach is to consider the set of candidate values. Adversarial validation samples corresponding to the validation set are generated respectively, and the prediction errors of the model on normal validation samples and adversarial validation samples are calculated; a preset balance condition is selected. This serves as a perturbation amplitude control parameter for training. The balance condition can be either minimizing the weighted error or minimizing the error of normal samples while minimizing the error of adversarial samples.

[0041] Step S3: Constructing an enhanced training sample set The original training samples and adversarial training samples are combined to form an augmented training sample set. This augmented training sample set can be constructed offline or online.

[0042] In the offline method, adversarial training samples are first generated from all samples in the training set or from a subset of samples selected according to preset rules, and then these generated adversarial training samples are added to the training set. This method facilitates the reuse of already generated adversarial training samples. The procedure is as follows: ; Where N is the number of original training set samples, M is the number of generated adversarial samples, and γ is the ratio coefficient between adversarial samples and original samples. This indicates rounding down to the nearest integer.

[0043] In the online approach, adversarial training samples are dynamically generated for each training batch during model training. Let a training batch be... Then, the enhanced training batch can be represented as: ; in, Indicates batch size, Indicates and Corresponding adversarial training samples. The online method can generate new perturbation samples as the model parameters are updated, ensuring that the training process continuously covers the input directions that the model is currently sensitive to.

[0044] Step S4: Train the model based on the augmented training sample set Based on the enhanced training sample set, the wind and solar power prediction model is retrained or fine-tuned. The wind and solar power prediction model can be a Long Short-Term Memory (LSTM) network, a Gated Recurrent Unit (GRU) network, a Convolutional Neural Network (CNN), a Transformer network and its variants, a Physically Based Neural Network (PINN), or any combination of the above. Specifically, the following steps are included: The training objective simultaneously constrains the prediction loss for both the original training samples and the prediction loss for adversarial training samples. As one implementation, the training loss function is:

[0045] in, The input features are those of the original training samples. To and The corresponding adversarial training samples, For power labels, This is a balancing coefficient used to adjust the weights of normal samples and adversarial training samples during the training process. This can be determined through a validation set, for example, in a candidate set. The value that minimizes the overall error of the validation set is selected.

[0046] After training, the trained wind and solar power prediction model is deployed to the renewable energy power prediction system. The power prediction system receives future numerical weather forecast data and historical power data, and outputs wind and solar power prediction results for the next H prediction times.

[0047] in, , ,..., This represents the predicted power values ​​at H future moments; x t-T+1 ,x t-T+2 ,...,x t This represents the input feature sequence over the past T time steps; T represents the length of the input time window; and H represents the prediction step size.

[0048] Step S5: Robustness Assessment To verify the prediction stability of the trained wind and solar power prediction model under perturbation inputs, evaluation metrics can be calculated on both the test set and an adversarial test set generated from the test set. Evaluation metrics include root mean square error. Mean absolute error Mean absolute percentage error and coefficient of determination At least one of them, the calculation expression is respectively expressed as:

[0049]

[0050]

[0051]

[0052] Based on the root mean square error of the benchmark model on the adversarial test set The root mean square error of the trained wind and solar power prediction model on the adversarial test set The improvement in robustness can be calculated:

[0053] Example 2 like Figure 3 As shown, taking the power prediction of a wind farm as an example, historical operating data and corresponding numerical weather forecast data of the wind farm were obtained. The numerical weather forecast data includes wind speed, wind direction, temperature, air pressure, and air density, while the historical power data is the measured active power of the wind farm. The data spans 365 days, and samples are constructed with a time resolution of 15 minutes, totaling 35,040 sample points.

[0054] In the data preprocessing stage, 3 Outliers are detected in principle; for outliers, median filtering is used for correction, with a sliding window size of 15, meaning the median of the surrounding 15 points is used to replace the outlier; finally, the dataset is divided according to time sequence: the first 80% of the data (28032 samples) is used as the training set, the middle 10% as the validation set, and the last 10% as the test set, ensuring causal consistency of the time series. The basic model uses a two-layer long short-term memory network, and the model structure is as follows: Input layer: Accepts historical data sequences with a time window length of 24, that is, each sample contains numerical weather forecast features from the past 24 moments (5 features per moment, for a total of 120 input features).

[0055] LSTM layer: Set up 2 LSTM layers, with 128 hidden units in each layer, and return the sequence.

[0056] Dropout layer: Add a Dropout layer after each LSTM layer, with a dropout rate of 0.2 to prevent overfitting.

[0057] Fully connected layer: Set up a 2-layer fully connected network. The first layer has 128 neurons and the activation function is ReLU. The second layer has 1 neuron and outputs the predicted power value.

[0058] During training, mean squared error was used as the loss function, and the Adam optimizer was used to update the model parameters. The initial learning rate was set to 0.001, the batch size was set to 64, the number of training epochs was set to 100, and an early stopping mechanism was adopted, which stopped training when the validation set loss did not decrease for 10 consecutive epochs.

[0059] In the adversarial sample generation stage, the gradient of the loss function relative to the input features is calculated for each training batch. The fast gradient sign method is used to generate adversarial training samples, and the perturbed normalized features are clipped to the range [0,1]. For meteorological features such as wind speed and temperature, an upper limit for feature-level perturbation can be set based on the range of historical data from the station to avoid generating samples that do not conform to actual meteorological changes. Experimental results show that when... When the value is 0.1, the overall performance is optimal, and the disturbance amplitude of each feature does not exceed 10% of the original feature value range, ensuring that the disturbed meteorological data does not violate the laws of physical change. For example, the disturbance amplitude of wind speed is controlled within ±1.5m / s, and the disturbance amplitude of temperature is controlled within ±3℃.

[0060] Adversarial examples were generated using the projective gradient descent method to compare the effectiveness of different generation methods.

[0061] Where t=0,1,...,9, a total of 10 iterations are performed, and the projection operation constrains the perturbed samples to... Within the range.

[0062] An online data augmentation method is used to dynamically generate adversarial samples in each training batch to construct an augmented training set: In each training batch, a batch of data {(x) is randomly selected from the original training set. i , y i )}B i=1, B=64; For each sample in the batch, generate the corresponding adversarial sample x adv,i The original and adversarial samples are merged to form an enhanced batch.

[0063] The enhanced batch size is 2B=128.

[0064] During the adversarial training phase, the original training samples and adversarial training samples are combined to form an enhanced training batch, and then... As the training loss function. Determined through the validation set. and Test on the validation set. The experimental results show that λ=0.5 yields the best performance. During training, the model structure, optimizer, and hyperparameter settings are kept the same as the base model. The initial learning rate is set to 0.0005, the number of training epochs is set to 50, and the early stopping mechanism is also used. When the trained model is used to input scenarios with numerical weather forecast errors or meteorological disturbances, it can reduce the prediction error on the adversarial test set compared to the model trained only with the original training samples.

[0065] This embodiment sets up three comparison models: Model A is the basic LSTM model (without adversarial training); Model B is the model of this invention trained adversarially using FGSM (ε=0.1, λ=0.5); Model C is the model of this invention trained adversarially using PGD (ε=0.1, 10 iterations, λ=0.5). Tests are performed on both clean and adversarial test sets.

[0066] Test results show that the base model A performs well on the clean test set, but its performance drops sharply on the adversarial test set, with the RMSE increasing from 352.6 kW to 891.4 kW. Models B and C trained using the method of this invention show a slight decrease in performance on the clean test set, but their RMSE decreases to 423.5 kW and 408.7 kW respectively on the adversarial test set, with robustness improvements of 52.5% and 54.1% respectively.

[0067] Special tests were conducted on test periods that included typhoon weather, simulating input disturbance scenarios in actual operation. Test results show that, under extreme weather conditions, the prediction errors of models B and C trained by the method of this invention are significantly lower than those of the base model A, with a MAPE reduction of approximately 37%-40%, demonstrating stronger robustness and adaptability.

[0068] The trained robust prediction model is deployed to the wind farm power prediction system, and numerical weather prediction data is input in real time to output wind and solar power prediction results with disturbance resistance:

[0069] In the formula: the prediction step size is 96 (corresponding to the next 24 hours, 15-minute resolution), and the input time window length is 24 (corresponding to the past 6 hours). System operation monitoring data shows that after deploying the model of this invention, the power prediction accuracy is improved by more than 15% compared with the original system during periods when numerical weather forecasts have large errors.

[0070] The above embodiments use wind farms and long short-term memory networks as examples for illustration; in other embodiments, the method can also be used in photovoltaic power plants or wind-solar hybrid power plants, and the wind and solar power prediction model can also be replaced by gated recurrent unit networks, convolutional neural networks, Transformer networks, physical information neural networks or combinations thereof.

[0071] Those skilled in the art should understand that this invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to this invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. An adversarial sample augmentation training method for wind and solar power prediction models, characterized in that, Includes the following steps: Historical wind and solar power data and corresponding numerical weather forecast data are acquired, and the historical wind and solar power data and the numerical weather forecast data are preprocessed to form original training samples. Based on the gradient of the prediction loss of the wind and solar power prediction model for the original training samples with respect to the input features, adversarial training samples corresponding to the original training samples are generated within the range of satisfying preset perturbation constraints. The preset perturbation constraints include perturbation norm constraints and meteorological feature value constraints. The original training samples and the adversarial training samples are combined to form an enhanced training sample set; Based on the enhanced training sample set, with the training objective of simultaneously constraining the prediction loss of the original training samples and the prediction loss of the adversarial training samples, the wind and solar power prediction model is trained to obtain the trained wind and solar power prediction model. The adversarial training samples are generated using either the fast gradient sign method or the iterative gradient sign method. The perturbation norm constraint is: ; ; ; in, express norm, Indicates the disturbance amplitude control parameters; This represents the input data after adversarial processing. Input features; The constraints on the meteorological characteristic values ​​include: Set an upper limit for feature perturbation for each meteorological feature, and restrict the value of the corresponding meteorological feature in the generated adversarial training samples to the physical allowable range of that meteorological feature; The disturbance amplitude control parameters Based on the prediction errors of normal samples and adversarial samples on the validation set, the prediction errors of the trained wind and solar power prediction model on normal samples and adversarial samples are determined to satisfy a preset balance condition.

2. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 1, characterized in that, The preprocessing of the historical wind and solar power data and the numerical weather forecast data to form the original training samples includes: Time alignment processing is performed on the historical wind and solar power data and the numerical weather forecast data; Perform missing value imputation, outlier detection, and outlier correction on the time-aligned data; The corrected data is then normalized or standardized for exchange. Training samples are constructed between the input feature sequence and the true power value according to the input time window and prediction step size, and the training set, validation set and test set are divided in chronological order.

3. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 2, characterized in that, The expression for the normalization process is: ; The expression for the standardized exchange process is: ; in, The feature values ​​to be processed The mean, Standard deviation, To be the minimum value, This is the maximum value.

4. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 2, characterized in that, The numerical weather forecast data includes at least one of wind speed, wind direction, temperature, air pressure, air density, irradiance, cloud cover, and humidity; the input feature sequence includes features from the numerical weather forecast data and historical wind and solar power features.

5. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 2, characterized in that, The step of generating adversarial training samples corresponding to the original training samples based on the gradient of the prediction loss of the wind and solar power prediction model with respect to the input features, within a range that satisfies preset perturbation constraints, includes: For input features and the true power value corresponding to the input sample Calculate the loss function Relative to the input features The gradient of, where This represents the wind and solar power prediction model; Candidate adversarial training samples are generated using the fast gradient sign method: ; in, This represents the input data after adversarial processing. This indicates the disturbance amplitude control parameter. Represents a symbolic function. This indicates that the loss function applies to the input features. The gradient; The candidate adversarial training samples are projected or cropped to a range that satisfies the preset perturbation constraint conditions to obtain the adversarial training samples.

6. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 2, characterized in that, The step of generating adversarial training samples corresponding to the original training samples based on the gradient of the prediction loss of the wind and solar power prediction model with respect to the input features, within a range that satisfies preset perturbation constraints, includes: Input features of the original training samples Using the initial samples, adversarial training samples are generated through the iterative gradient method, expressed as: ; in, Indicates the number of iterations. Indicates the iteration step size. This indicates that candidate adversarial training samples are projected onto the set. Inside, set Determined by the preset perturbation constraint conditions. This represents the adversarial sample generated in the (t+1)th iteration; This represents the adversarial sample generated in the t-th generation; Represents a symbolic function. L(·,·) represents the gradient of the loss function with respect to the input x; L(·,·) represents the loss function; f(·) represents the wind and solar power prediction model; and y represents the true power value corresponding to the input sample.

7. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 1, characterized in that, The step of combining the original training samples with the adversarial training samples to form an enhanced training sample set includes one of the following methods: Before model training, generate adversarial training samples corresponding to at least a portion of the original training samples, and add the adversarial training samples to the original training samples; Alternatively, during model training, adversarial training samples can be generated online for the original training samples in each training batch, and the original training samples and the online-generated adversarial training samples in that training batch can be combined to form an enhanced training batch.

8. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 1, characterized in that, The loss function corresponding to the training objective is: ; in, Represents the loss function. This represents a wind and solar power prediction model. The input features are those of the original training samples. To and The corresponding adversarial training samples, To match the input sample The corresponding actual power value, It is the balance coefficient, and Determined based on the validation set.

9. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 8, characterized in that, After obtaining the trained wind and solar power prediction model, the following is also included: The trained robust prediction model is deployed to the power prediction system for new energy power plants, and numerical weather forecast data is input in real time to output wind and solar power prediction results with disturbance resistance capabilities. in, Indicates the length of the input time window. Indicates the prediction step size. Represents the input sample The corresponding actual power value, This represents a wind and solar power prediction model.

10. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 8, characterized in that, The wind and solar power prediction models include, but are not limited to: long short-term memory networks, gated recurrent unit networks, convolutional neural networks, Transformer networks, physical information-based neural networks, or any combination of the above.

11. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 1, characterized in that, After obtaining the trained wind and solar power prediction model, the following steps are also included: Calculate at least one of the following evaluation metrics on the test set and the adversarial test set generated from the test set: root mean square error, mean absolute error, mean absolute percentage error and coefficient of determination. The robustness improvement is determined based on the root mean square error of the baseline model on the adversarial test set and the root mean square error of the trained wind and solar power prediction model on the adversarial test set.

12. The adversarial sample augmentation training method for the wind and solar power prediction model according to claim 11, characterized in that, The robustness improvement The expression is: ; in, This represents the root mean square error of the benchmark model on the adversarial test set; This represents the root mean square error of the trained wind and solar power prediction model on the adversarial test set.