Earth surface solar radiation short-term prediction method based on residual network and channel attention
By constructing a convolutional neural network model based on residual networks and channel attention, and combining meteorological and topographic data, the problem of insufficient spatial accuracy in photovoltaic power generation prediction was solved, achieving high spatiotemporal resolution solar radiation prediction, and improving the accuracy of photovoltaic power prediction and the generalization ability of the model.
Patent Information
- Application Number
- CN202511484341.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies for photovoltaic power generation forecasting suffer from insufficient spatial precision, inadequate accuracy in predicting small areas, and poor anti-interference capabilities of traditional models, making it difficult to accurately predict local cloud shading information. This results in low accuracy in photovoltaic power generation forecasting, which is particularly challenging for grid dispatching in the context of large-scale grid connection.
A high-precision solar radiation prediction model is constructed by using a convolutional neural network model based on residual network and channel attention, combined with meteorological and topographic data, through spatiotemporal embedding and feature fusion. The model is then trained and optimized using Huber loss function and cosine annealing learning rate scheduling strategy.
It achieves high spatiotemporal resolution solar radiation prediction, improves the accuracy of photovoltaic power prediction, and can adaptively select features, reduce dependence on unimportant features, enhance the weight of important features, and improve the model's generalization ability and real-time forecasting ability.
Smart Images

Figure CN121614718A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of remote sensing technology applications, and in particular to a short-term prediction method for surface solar radiation based on residual networks and channel attention. Background Technology
[0002] Driven by policies promoting dual-carbon development and energy structure transformation, increasing the proportion of renewable energy sources has become a crucial means to achieve dual-carbon goals and drive energy structure transformation. Photovoltaic power generation is highly susceptible to significant fluctuations due to weather uncertainties such as cloud cover and localized rainfall, especially with rapid changes in output at midday. With large-scale grid connection, the random fluctuations and short-term abrupt changes in photovoltaic power generation are amplified, posing significant challenges to the grid's rapid optimization and balancing of power during midday hours. This exacerbates grid dispatching, operation, and stability issues caused by the uncertainty of photovoltaic output. Improving the accuracy of photovoltaic power prediction is one of the most effective and economical solutions given the increasing penetration rate of photovoltaic power year by year.
[0003] The current challenge in directly applying numerical weather prediction to photovoltaic (PV) forecasting lies in the insufficient spatial precision and inadequate accuracy for small-area predictions. Traditional regional assessment methods for solar energy resources include interpolation and climatological models, which can extend limited observation point data to larger areas. Currently, mainstream numerical weather prediction PV forecasting models suffer from inherent errors in their physical formulas, resulting in poor model robustness. Furthermore, the coarse resolution of the model grid weakens their ability to predict local cloud cover and cloud amount, failing to accurately predict cloud obstruction within small areas. Simulation errors of small-scale clouds in southern summers can significantly impact the accuracy of PV power generation forecasts. Statistical models require extensive historical data, leading to weak generalization capabilities and applicability only to stations with long operating histories. With the rapid development of centralized and distributed PV systems, ground meteorological observation stations are increasingly dispersed, and historical data for newly established stations is scarce. Therefore, achieving high spatial resolution solar radiation monitoring and forecasting in Guangxi is one of the key challenges this project needs to address.
[0004] Machine learning techniques, especially deep learning methods, are gaining popularity due to their superior ability to handle massive datasets and identify complex nonlinear patterns. Deep learning network models do not require establishing specific analytical formulas between solar radiation and meteorological variables; instead, they can capture these complex nonlinear relationships through training on large amounts of data, making them particularly suitable for assessing hourly and daily solar radiation resources. While artificial intelligence methods offer significant advantages in improving model accuracy, they suffer from insufficient interpretability compared to physical and empirical models. The output of physical models (numerical forecasts) can be used as input to machine learning models, combining the advantages of both to construct more accurate and physically interpretable scientific prediction models.
[0005] The information disclosed above in the 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 implication in any way that such information constitutes prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide a short-term prediction method for surface solar radiation based on residual networks and channel attention, which can solve the problems existing in the background technology.
[0007] To achieve the above objectives, this invention provides a short-term prediction method for surface solar radiation based on residual networks and channel attention, comprising the following steps:
[0008] S1: Obtain weather forecast product data and terrain data;
[0009] S2: Preprocessing of meteorological and topographic data;
[0010] S3: Construct the sample set;
[0011] S4: Construct a convolutional neural network prediction model that includes a residual network module and a channel attention module;
[0012] S5: Train and optimize the prediction model;
[0013] S6: Obtain and apply a short-term prediction model for surface solar radiation.
[0014] In one or more embodiments, step S1 includes:
[0015] S11: Obtain surface and upper-air meteorological forecast product data from the D1D numerical forecast of the European Centre for Medium-Range Weather Forecasts (ECMWF);
[0016] S12: Obtain 1km topographic data for the entire country;
[0017] S13: Write weather forecast product data and terrain data into the storage unit.
[0018] In one or more embodiments, step S2 includes:
[0019] S21: Cumulative variable processing, converting cumulative variables of weather forecast product data into instantaneous variables;
[0020] S22: Spatiotemporal matching processing, selecting ECMWF forecast data of a 5×5 grid centered on the nearest grid point in the prediction space as input, where the input features include physical features, geographic features, and classification features;
[0021] S23: Data quality control, screening observation data and removing abnormal and unreasonable data;
[0022] S24: Write the preprocessed meteorological and topographic data into the storage unit.
[0023] In one or more embodiments, step S3 includes:
[0024] S31: Construct a temporal embedding layer, converting the 25-dimensional vector into 5*5 grid points as spatial classification feature input, and continuously learning from the mbedding layer to derive the temporal embedding layer;
[0025] S32: Feature Normalization: Normalize each daytime feature of the obtained data sample using mean-standard deviation normalization.
[0026]
[0027] In the above formula: x is the original feature value, μ is the mean of the feature, σ is the standard deviation of the feature, and x′ is the standardized feature value.
[0028] In one or more embodiments, the convolutional neural network prediction model in step S4 includes:
[0029] Feature transformation module; Leadtime embedding and transformation module; Feature fusion and backbone network; Prediction head (MLP Head); Daytime gate branch; Output layer.
[0030] In one or more embodiments, step S5, training and optimizing the prediction model, includes:
[0031] Custom Loss Function: Based on Huber Loss, a custom model loss function is defined. The basic HuberLoss formula for smoothing L1 loss is as follows:
[0032]
[0033] In the above formula, y is the true value, y' is the predicted value, and δ is the hyperparameter control smoothing interval, with an initial value of 1.
[0034] The custom loss function defines the weighting coefficient of the Huber Loss part as 0.7; the radiation peak interval with a prediction time of 11:00 to 14:00 daily is calculated separately and weighted as the peak error Peak_Loss with a coefficient of 0.3; the smoothed relative error Relative_Loss is added with a coefficient of 0.2.
[0035] The custom loss function is calculated as 0.7×Huber_Loss + 0.3×Peak_Loss + 0.2×Relative_Loss;
[0036] The convolutional neural network prediction model adopts a learning rate scheduling strategy with cosine annealing and hot restart. The learning rate is dynamically adjusted in each training cycle. The initial learning rate is 0.0005, the minimum learning rate is 0.00001, the initial cycle length for hot restart is 10, and the cycle multiplication factor is 2.
[0037] In one or more embodiments, the method for processing the accumulated variable in step S21 is as follows:
[0038] The cumulative variable Cum includes forecast values such as ssrd, strc, ssrc, ssr, tsrc, tsr, cdir, fdir, strd, str, and ttrc. These cumulative variables need to be converted to instantaneous variables using the following conversion formula:
[0039]
[0040] In the above formula, EC forecast The instantaneous variables of the converted ECMWF forecast are expressed in W / m³. 2 Cum is one of the cumulative variables mentioned above, with units of J / m. 2 ;Cum t Let Cum be the predicted value of ECMWF at time t. t-3 This is the predicted value from the ECMWF forecast three hours prior to this moment.
[0041] In one or more embodiments, step S22 involves spatiotemporal matching processing, selecting ECMWF forecast data of a 5×5 grid centered on the nearest grid point in the prediction space as input for 104 physical features; there are 6 geographic features, including longitude, latitude, altitude, aspect, slope, and curvature. Longitude and latitude are input into the model at a numerical forecast resolution of 0.1°×0.1°, and the longitude and latitude of the middle grid point are replaced with the longitude and latitude of the prediction station; for altitude, slope, aspect, and curvature, a 5×5 grid with a resolution of 1km×1km is selected for input into the model.
[0042] In one or more embodiments, the specific method for data quality control in step S23 is as follows: automatically detect and filter abnormal irradiance data (i.e., data greater than 50 W / m²) from 22:00 at night to 04:00 the next day; remove stations or samples with the same observation value for a long time; remove samples that do not have complete three-hour continuous observation data from 0 to 72 hours; and fill out abnormal values of variables such as topographic height around coastal stations with 0.
[0043] In one or more embodiments, the convolutional neural network prediction model specifically comprises:
[0044] (1) Feature transformation module:
[0045] The number of input channels is the number of variables, the number of output channels is 128, the kernel size is 1×1, and the stride is 1.
[0046] Normalization layer: Performs BatchNorm2d normalization on the feature channels of each batch to improve training stability;
[0047] Activation function: ReLU, used to introduce nonlinearity;
[0048] Dropout2d: Dropout probability is 0.2 to prevent overfitting;
[0049] (2) Leadtime embedding and transformation module:
[0050] Leadtime first passes through the Embedding layer, which takes 25 as input and outputs 64, then passes through LayerNorm, Linear(64,32), ReLU, and LayerNorm again;
[0051] Then, through Linear(32,25), ReLU, LayerNorm, and Dropout, it is finally reshaped to [batch, 1,5, 5] and concatenated with the main feature branch;
[0052] (3) Feature fusion and backbone network:
[0053] The feature transformation output and the leadtime embedded features are concatenated along the channel dimension and then input into the backbone network. The backbone network consists of three sets of residual blocks (ResBlock) and channel attention blocks (SEBlock), stacked together, as shown in the following structure:
[0054] ResBlock1: 129 input channels, 256 output channels, 3×3 convolution kernels, stride 1, includes BatchNorm2d and ReLU, with a 1×1 convolution shortcut branch;
[0055] SEBlock1: 256 input channels, channel attention mechanism, including global pooling, fully connected, GELU, and Sigmoid;
[0056] Dropout2d (p=0.2), MaxPool2d (2×2);
[0057] ResBlock2: 256 input channels, 256 output channels, 3×3 convolution kernel, stride 1, includes BatchNorm2d and ReLU;
[0058] SEBlock2: Input channel 256, channel attention mechanism;
[0059] Dropout2d(p=0.2);
[0060] ResBlock3: 256 input channels, 128 output channels, 3×3 convolution kernels, stride 1, including BatchNorm2d and ReLU;
[0061] SEBlock3: Input channel 128, channel attention mechanism;
[0062] Dropout2d(p=0.2);
[0063] (4) Predictive Head MLP Head:
[0064] The backbone network output is processed by global average pooling (AdaptiveAvgPool2d(1)) and Flatten, and then sequentially through four fully connected layers and ReLU activation, as follows:
[0065] Fully connected layer 1: Input 128, Output 256, BatchNorm1d, ReLU, Dropout(0.3);
[0066] Fully connected layer 2: Input 256, Output 128, BatchNorm1d, ReLU, Dropout(0.3);
[0067] Fully connected layer 3: Input 128, Output 64, BatchNorm1d, ReLU, Dropout(0.2);
[0068] Fully connected layer 4: Input 64, Output 1;
[0069] (5) Daytime Gate gated branches:
[0070] Concatenate the flattened feature vector with the is_daytime flag and input it into the gating network:
[0071] Fully connected layer 1: Input 129 (128+1), output 64, BatchNorm1d, ReLU, Dropout(0.2);
[0072] Fully connected layer 2: Input 64, Output 1, Sigmoid activation;
[0073] (6) Output layer:
[0074] The final output is "prediction head output × gating output × is - "daytime" is forced to output 0 at night.
[0075] Compared with the prior art, the various technical solutions and embodiments provided by the present invention include at least the following technical effects or advantages:
[0076] The technical solution of this invention integrates numerical forecast data, topographic data, and station observation data, and combines a convolutional neural network model based on spatiotemporal embedding, channel attention, and residual structure to achieve real-time prediction of regional solar irradiance.
[0077] The technical solution of this invention incorporates a prediction structure of spatiotemporal relationships. The prediction model embeds time information and adds spatial features of the stations, enabling the model to have a better learning ability for the spatiotemporal attributes of the prediction points.
[0078] The technical solution of this invention has high spatiotemporal resolution. In terms of time, the prediction model can predict the same long-term series as the numerical weather prediction model. In terms of space, after improving the accuracy through site prediction, it can realize the estimation of solar radiation at any specified spatial location within the region.
[0079] This invention enables adaptive feature selection by introducing a channel attention module, SE-Block. SE-Block dynamically adjusts the weights of feature maps in each channel, thereby continuously and adaptively adjusting the weights of each meteorological feature through learning. This reduces the model's dependence on unimportant features and enhances the weights of important features, achieving adaptive feature selection. Simultaneously, a skip connection module structure of a residual network is introduced, allowing original features to be directly passed to subsequent layers. This preserves basic meteorological information while learning higher-order features, solving the gradient vanishing problem and enabling the model to be scalable to deeper architectures.
[0080] The technical solution of this invention has real-time forecasting capability. By accessing daily numerical forecasts, the model can predict the solar irradiance of the region from 0 to 72 hours on a rolling basis, thereby improving the accuracy of photovoltaic power prediction.
[0081] The technical solution of this invention can combine optimization strategies. By using the training and optimization strategy of "Huber loss + cosine annealing + gradient pruning", the model training error is stabilized and the convergence speed is fast, while avoiding getting trapped in local optima. In the loss function, the Gaussian weighting of the daytime peak value is used to improve the prediction standard deviation and prevent the model from over-tending to the prediction average. Attached Figure Description
[0082] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and are intended to explain the invention. They are intended to be seen as illustrative of various combinations of preferred embodiments and do not constitute an undue limitation of the invention. In the drawings:
[0083] Figure 1 A schematic diagram illustrating the overall steps of a short-term prediction method for surface solar radiation based on residual networks and channel attention provided by this invention;
[0084] Figure 2 This invention provides a time embedding layer transformation diagram using the method of Embodiment 1.
[0085] Figure 3 This invention provides a neural network prediction model architecture diagram using the method of Embodiment 1.
[0086] Figure 4 This invention provides a distribution map of the overall sample tested at the Guangxi 103 radiation site using the method described in Embodiment 1.
[0087] Figure 5 A comparison chart of radiation predictions from the Guangxi GFP07069 site and the European Centre for Medium-Range Nuclear Forces (ECMWF) using the method of Embodiment 1 provided by this invention;
[0088] Figure 6 A comparison chart of radiation predictions from the Guangxi GFP07086 field station and the European Centre for Medium-Range Nuclear Forces (ECMWF) using the method of Embodiment 1 provided by this invention;
[0089] Figure 7 A comparison chart of radiation prediction errors at the Guangxi GFP07042 field station using the method of Embodiment 1 provided by this invention;
[0090] Figure 8 A comparison chart of radiation prediction errors at the Guangxi GFP07232 field station using the method of Embodiment 1 provided by this invention. Detailed Implementation
[0091] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises", "made for", etc., shall be understood to include the stated elements or components, without excluding other elements or other components.
[0092] The purpose of this invention is to provide a short-term prediction method for surface solar radiation based on residual networks and channel attention, which overcomes the shortcomings of existing technologies and achieves high-precision, short-term prediction. It integrates multiple data to improve the accuracy and adaptability of surface solar radiation prediction, and the prediction model improves the generalization ability and engineering applicability.
[0093] Example 1:
[0094] This embodiment provides a short-term prediction method for surface solar radiation based on residual networks and channel attention, including the following steps:
[0095] S1: Obtain weather forecast product data and terrain data;
[0096] S2: Preprocessing of meteorological and topographic data;
[0097] S3: Construct the sample set;
[0098] S4: Construct a convolutional neural network prediction model that includes a residual network module and a channel attention module;
[0099] S5: Train and optimize the prediction model;
[0100] S6: Obtain and apply a short-term prediction model for surface solar radiation.
[0101] This embodiment integrates numerical weather prediction data, topographic data, and site observation data, and combines it with a convolutional neural network model based on spatiotemporal embedding, channel attention, and residual structure to achieve real-time prediction of regional solar irradiance. This embodiment has real-time forecasting capabilities; by incorporating daily numerical weather predictions, the model can provide daily rolling forecasts of regional solar irradiance from 0 to 72 hours, thereby improving the accuracy of photovoltaic power prediction.
[0102] As a preferred embodiment of this example, step S1 includes:
[0103] S11: Obtain surface and upper-air meteorological forecast product data from the D1D numerical forecast of the European Centre for Medium-Range Weather Forecasts (ECMWF);
[0104] S12: Obtain 1km topographic data for the entire country;
[0105] S13: Write weather forecast product data and terrain data into the storage unit.
[0106] The surface and upper-air forecast products of the D1D numerical weather prediction data obtained from the European Centre for Medium-Range Weather Forecasts (ECMWF) are as follows: (1) Number of forecast elements: 33; (2) Time range: 2023-2024 (all year); (3) Start time: 00 UTC; (4) Forecast interval: 0-3 days, 3 hours at a time; (5) Spatial range: 70-140°E, 0-55°N; (6) Spatial resolution: 0.1° × 0.1°; (7) Vertical layers of some variables: 6 layers (1000, 950, 900, 850, 500, 100). The variables included are shown in Table 1 below:
[0107] Serial Number Variables 1 Visibility 2 Surface net short-wave (solar) radiation (SSR) 3 Zonal wind (6) (U component of wind (6)) 4 Total sky direct short-wave (solar) radiation at the surface (fdir) 5 Relative humidity (6) 6 Total precipitation 7 Medium cloud cover 8 Total column water content 9 Maximum temperature at 2 meters in the last 6 hours 10 Snowfall 11 Net long-wave (thermal) radiation of the Earth's surface, clear sky (strc) 12 Surface long-wave (thermal) radiation downwards (strd) 13 Direct solar radiation 14 Vertical velocity 15 Net long-wave (thermal) radiation (str) of the Earth's surface 16 Maximum 10-meter wind gust in the last 3 hours 17 Meridional wind (6) (V component of wind (6)) 18 Low cloud cover 19 Surface direct short-wave radiation, clear sky (cdir) 20 Surface short-wave (solar) radiation downwards (SSRD) 21 Top net short-wave solar radiation, clear sky (TSRC) 22 Total cloud cover 23 Convective precipitation 24 Downward UV radiation at the Earth's surface 25 100-meter zonal wind component 26 100-meter meridional wind component 27 Instantaneous total lightning flash density 28 Net short-wave solar radiation (SSRC) of the Earth's surface (clear sky). 29 Convective available potential energy shear 30 High cloud cover 31 Minimum total precipitation rate in the last 3 hours 32 10-meter meridional wind component 33 Convective available potential energy 34 Minimum temperature at 2 meters in the last 3 hours 35 Maximum 10 metre wind gust in the last 6 hours 36 Top net short-wave solar radiation (TSR) 37 Maximum temperature at 2 meters in the last 3 hours 38 Minimum temperature at 2 meters in the last 6 hours 39 Temperature (6) 40 Average total lightning flash density in the last 3 hours 41 2-meter dew point temperature 42 Top net long-wave (thermal) radiation 43 Large-scale precipitation 44 2-meter temperature 45 Total column vertically-integrated water vapor 46 Specific humidity (6) 47 10m zonal wind speed (10 metre U wind component) 48 Potential vorticity (6) 49 Precipitation type 50 Predicted reflectance (Forecast albedo) 51 Geopotential height 52 Surface pressure 53 Divergence (6) 54 Mean sea level pressure 55 Maximum total precipitation rate in the last 3 hours 56 Temperature of snow layer 57 Average total lightning flash density in the last 6 hours 58 Accumulated freezing rain 59 Top net long-wave (thermal) radiation, clear sky (ttrc)
[0108] Table 1: Variables in D1D numerical weather prediction data from the European Centre for Medium-Range Weather Forecasts (ECMWF)
[0109] Table 1 lists the variables with multiple pressure layers: Temperature, Relative humidity, U component of wind, V component of wind, Geopotential height, Vertical velocity, Specific humidity, Divergence, and Potential vorticity. Each of these variables includes data from six pressure layers: 1000 hPa, 950 hPa, 900 hPa, 850 hPa, 500 hPa, and 100 hPa. This yields a total of 104 variables from the original ECMWF numerical forecast; hourly observation data from 153 national surface radiation stations; and data from 103 radiation stations in Guangxi.
[0110] As a preferred embodiment of this example, step S2 includes:
[0111] S21: Cumulative variable processing, converting cumulative variables in weather forecast product data into instantaneous variables; the method for cumulative variable processing is as follows:
[0112] The cumulative variable Cum includes forecast values such as ssrd, strc, ssrc, ssr, tsrc, tsr, cdir, fdir, strd, str, and ttrc. These cumulative variables need to be converted to instantaneous variables using the following conversion formula:
[0113]
[0114] In the above formula, EC forecast The instantaneous variables of the converted ECMWF forecast are expressed in W / m³. 2 Cum is one of the cumulative variables mentioned above, with units of J / m. 2 ;Cum t Let Cum be the predicted value of ECMWF at time t. t-3 This is the predicted value from the ECMWF forecast three hours prior to this moment.
[0115] S22: Spatiotemporal matching processing. ECMWF forecast data of a 5×5 grid centered on the nearest grid point in the prediction space is selected as input. The input features include physical features, geographic features, and classification features. 104 physical features are selected from the 5×5 ECMWF forecast data of the nearest grid point in the prediction space, i.e., the observation data in Table 1. There are 6 geographic features, including longitude, latitude, altitude, aspect, slope, and curvature. Longitude and latitude are input into the model according to the numerical forecast resolution of 0.1°×0.1°, and the longitude and latitude of the middle grid point are replaced with the longitude and latitude of the prediction station. For altitude, slope, aspect, and curvature, a 5×5 grid with a resolution of 1km×1km is selected as the input to the model.
[0116] S23: Data quality control involves screening observation data and removing abnormal and unreasonable data; automatic detection and filtering of abnormal irradiance data (greater than 50W / m²) from 22:00 to 04:00 the next day; removal of stations or samples with the same observation values over a long period; removal of samples that do not have complete three-hourly continuous observation data from 0 to 72 hours; filling out abnormal values of variables such as topography and elevation around coastal stations with 0, such as missing elevation measurement data.
[0117] S24: Write the preprocessed meteorological and topographic data into the storage unit.
[0118] As a preferred embodiment of this example, step S3 includes:
[0119] S31: Construct a time embedding layer, such as Figure 2 As shown, the 25-dimensional vector is converted into 5*5 grid points as spatial classification feature input, and the temporal embedding layer is continuously learned by the mbedding layer.
[0120] S32: Feature Normalization: Normalize each daytime feature of the obtained data sample using mean-standard deviation normalization.
[0121]
[0122] In the above formula: x is the original feature value, μ is the mean of the feature, σ is the standard deviation of the feature, and x′ is the standardized feature value.
[0123] As a preferred embodiment of this example, Figure 3 As shown, the convolutional neural network prediction model in step S4 includes:
[0124] The convolutional neural network prediction model consists of: a feature transformation module; a leadtime embedding and transformation module; a feature fusion and backbone network; an MLP head; a daytime gate branch; and an output layer.
[0125] (1) Feature transformation module:
[0126] The number of input channels is the number of variables, the number of output channels is 128, the kernel size is 1×1, and the stride is 1.
[0127] Normalization layer: Performs BatchNorm2d normalization on the feature channels of each batch to improve training stability;
[0128] Activation function: ReLU, used to introduce nonlinearity;
[0129] Dropout2d: Dropout probability is 0.2 to prevent overfitting;
[0130] (2) Leadtime embedding and transformation module:
[0131] Leadtime first passes through the Embedding layer, which takes 25 as input and outputs 64, then passes through LayerNorm, Linear(64,32), ReLU, and LayerNorm again;
[0132] Then, through Linear(32,25), ReLU, LayerNorm, and Dropout, it is finally reshaped to [batch, 1,5, 5] and concatenated with the main feature branch;
[0133] (3) Feature fusion and backbone network:
[0134] The feature transformation output and the leadtime embedded features are concatenated along the channel dimension and then input into the backbone network. The backbone network consists of three sets of residual blocks (ResBlock) and channel attention blocks (SEBlock), stacked together, as shown in the following structure:
[0135] ResBlock1: 129 input channels, 256 output channels, 3×3 convolution kernels, stride 1, includes BatchNorm2d and ReLU, with a 1×1 convolution shortcut branch;
[0136] SEBlock1: 256 input channels, channel attention mechanism, including global pooling, fully connected, GELU, and Sigmoid;
[0137] Dropout2d (p=0.2), MaxPool2d (2×2);
[0138] ResBlock2: 256 input channels, 256 output channels, 3×3 convolution kernel, stride 1, includes BatchNorm2d and ReLU;
[0139] SEBlock2: Input channel 256, channel attention mechanism;
[0140] Dropout2d(p=0.2);
[0141] ResBlock3: 256 input channels, 128 output channels, 3×3 convolution kernels, stride 1, including BatchNorm2d and ReLU;
[0142] SEBlock3: Input channel 128, channel attention mechanism;
[0143] Dropout2d(p=0.2);
[0144] (4) Predictive Head MLP Head:
[0145] The backbone network output is processed by global average pooling (AdaptiveAvgPool2d(1)) and Flatten, and then sequentially through four fully connected layers and ReLU activation, as follows:
[0146] Fully connected layer 1: Input 128, Output 256, BatchNorm1d, ReLU, Dropout(0.3);
[0147] Fully connected layer 2: Input 256, Output 128, BatchNorm1d, ReLU, Dropout(0.3);
[0148] Fully connected layer 3: Input 128, Output 64, BatchNorm1d, ReLU, Dropout(0.2);
[0149] Fully connected layer 4: Input 64, Output 1;
[0150] (5) Daytime Gate gated branches:
[0151] Concatenate the flattened feature vector with the is_daytime flag and input it into the gating network:
[0152] Fully connected layer 1: Input 129 (128+1), output 64, BatchNorm1d, ReLU, Dropout(0.2);
[0153] Fully connected layer 2: Input 64, Output 1, Sigmoid activation;
[0154] (6) Output layer:
[0155] The final output is "prediction head output × gating output × is - "daytime" is forced to output 0 at night.
[0156] In the overall model framework, the ResBlock in the backbone network is a residual block that enhances feature representation; the SEBlock is a channel attention module used to improve channel feature selection; it also includes 2D convolutional modules, pooling, and fully connected modules. This includes modules for optimizing model training such as Dropout layers and activation layers. The Daytime Gate is a daytime or nighttime gate used to control the output during the day.
[0157] This embodiment incorporates a spatiotemporal relationship prediction structure, embedding temporal information into the prediction model and adding spatial features of the stations, enabling the model to learn better about the spatiotemporal attributes of the prediction points. This invention has high spatiotemporal resolution; temporally, the prediction model can predict the same long-term series as numerical weather prediction models; spatially, by improving accuracy through station predictions, it can estimate solar radiation at any specified spatial location within a region.
[0158] This embodiment enables adaptive feature selection by introducing a channel attention module, SE-Block. This module dynamically adjusts the weights of feature maps in each channel, thereby continuously and adaptively adjusting the weights of each meteorological feature through learning. This reduces the model's dependence on unimportant features and enhances the weights of important features, achieving adaptive feature selection. Simultaneously, a skip connection structure of the residual network is introduced, allowing original features to be directly passed to subsequent layers. This preserves basic meteorological information while learning higher-order features, solving the gradient vanishing problem and enabling the model to be scalable to deeper architectures.
[0159] As a preferred embodiment of this invention, step S5, which involves training and optimizing the prediction model, includes:
[0160] Custom Loss Function: Based on Huber Loss, a custom model loss function is defined. The basic HuberLoss formula for smoothing L1 loss is as follows:
[0161]
[0162] In the above formula, y is the true value, y' is the predicted value, and δ is the hyperparameter control smoothing interval, with an initial value of 1.
[0163] The custom loss function defines the weighting coefficient of the Huber Loss part as 0.7; the radiation peak interval with a prediction time of 11:00 to 14:00 daily is calculated separately and weighted as the peak error Peak_Loss with a coefficient of 0.3; the smoothed relative error Relative_Loss is added with a coefficient of 0.2.
[0164] The custom loss function is calculated as 0.7×Huber_Loss + 0.3×Peak_Loss + 0.2×Relative_Loss;
[0165] The convolutional neural network prediction model employs a cosine annealing learning rate scheduling strategy with hot restart, dynamically adjusting the learning rate within each training cycle. The initial learning rate is 0.0005, the minimum learning rate is 0.00001, the initial hot-start cycle length is 10, and the cycle multiplication factor is 2. This embodiment combines optimization strategies, using a training and optimization strategy of "Huber loss + cosine annealing + gradient pruning" to stabilize the model training error, achieve fast convergence, and avoid getting trapped in local optima. The loss function uses Gaussian weighting of the diurnal peak values to increase the prediction standard deviation, preventing the model from overly tending towards the predicted average.
[0166] The technical solution in this embodiment integrates multi-source features. The model integrates meteorological reanalysis data, spatiotemporal information and observation data, comprehensively characterizes various factors affecting solar radiation, and improves the physical interpretability and generalization ability of the model.
[0167] The technical solution of this embodiment has a deep feature extraction and gating mechanism. It adopts multi-layer residual blocks and channel attention modules to automatically extract complex spatial meteorological features. It introduces a Daytime Gate gating network to effectively distinguish between day and night, improve the model's adaptability to day and night changes, and reduce false alarms at night.
[0168] The technical solution in this embodiment features efficient and robust training. By combining Huber loss, cosine annealing hot restart learning rate, and gradient pruning, it improves the model's convergence speed and stability.
[0169] The technical solution in this embodiment enables automated operation and efficient modeling. The training process includes data filtering, batch loading, and an early stopping mechanism to ensure efficient training and accurate results. In practical applications, the model can provide rolling radiation forecasts from 0 to 72 hours.
[0170] The short-term prediction model (RMSE) of Example 1 was used for pre-training and regional testing. The pre-training test aimed to initially determine the model's convergence and predictive capabilities, providing a basis for further model adjustments and parameter tuning. The pre-training test dataset consisted of 159 national radiation observation stations across China in 2023. Preliminary evaluation results showed that, without further parameter tuning, the model reduced the average predicted RMSE by more than 21.5% across a wide range of diverse national radiation stations. In the final regional test, data from January to September 2024 was used to predict 103 radiation stations in Guangxi. A total of 68,454 samples were tested. The regression coefficient for all test samples was 0.895, with an RMSE of 128.37 W / m². The predicted RMSE for daytime (8:00–20:00) irradiance was 135.78 W / m², compared to the corresponding ECMWF prediction errors of 172.50 W / m² and 203.70 W / m², respectively, both significantly better than the ECMWF prediction results. For a detailed comparison, see [link / reference]. Figure 4 Therefore, it can be concluded that the accuracy of the prediction model in this embodiment is significantly higher than the ECMWF forecast value from the European Centre for Medium-Range Nuclear Forces (ECMWF).
[0171] In short-term operational forecasting applications, considering the delays and lags in data transmission and operational scheduling, greater emphasis may be placed on the forecast accuracy on the third day from the initial reporting time, i.e., approximately 48 hours after the initial reporting time. Therefore, the method described in this embodiment is used to plot forecast results for some stations with a continuous 7-day lead time of 48-60 hours, as shown below. Figure 5 and Figure 6 Taking the forecast from January 5th to January 12th, 2024 as an example, the short-term forecast model in this embodiment can predict irradiance more accurately, significantly better than the EC forecast results. Figure 7 and Figure 8 As shown, the prediction error of the prediction results in this embodiment is compared, showing that the prediction results of this embodiment have higher accuracy than the ECMWF forecast value from the European Centre for Medium-Range Nuclear Forces (ECMWF).
[0172] Example 2:
[0173] This embodiment provides a short-term prediction system for surface solar radiation based on residual networks and channel attention. Based on the same concept, this embodiment implements a short-term prediction method for surface solar radiation based on residual networks and channel attention as described in Embodiment 1, including:
[0174] The data acquisition module is used to collect and preprocess data on factors influencing solar radiation on the Earth's surface, including satellite data, meteorological station data, and topographic data.
[0175] The configuration module is used to configure the logic for estimating Earth's surface solar radiation.
[0176] The acquisition module is used to obtain the predicted target time and predicted location;
[0177] The prediction module is used to predict the surface solar radiation result based on the short-term prediction logic of surface solar radiation based on residual network and channel attention.
[0178] The optimization module is used to train and optimize the short-term prediction logic of surface solar radiation based on residual network and channel attention.
[0179] The application module is used to obtain and apply short-term prediction methods for surface solar radiation.
[0180] Example 3:
[0181] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the short-term prediction method for surface solar radiation based on residual networks and channel attention as described in Embodiment 1.
[0182] Example 4:
[0183] A non-transitory computer-readable storage medium storing a computer program thereon, characterized in that, when the computer program is executed by a processor, it implements the short-term prediction method for surface solar radiation based on residual networks and channel attention as described in Embodiment 1.
[0184] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A method for short-term prediction of surface solar radiation based on residual network and channel attention, characterized in that, It comprises the following steps: S1: obtaining meteorological forecast product data and terrain data; S2: preprocessing meteorological and terrain data; S3: constructing a sample set; S4: constructing a convolutional neural network prediction model comprising a residual network module and a channel attention module; S5: training and optimizing the prediction model; S6: obtaining a short-term surface solar radiation prediction model and applying it.
2. The short-term surface solar radiation forecasting method based on residual network and channel attention according to claim 1, wherein, The step S1 comprises: S11: obtaining ground and high-altitude meteorological forecast product data of the D1D numerical forecast of the European Center ECMWF; S12: obtaining national 1km terrain data; S13: writing meteorological forecast product data and terrain into a storage unit.
3. The short-term surface solar radiation forecasting method based on residual network and channel attention according to claim 1, wherein, The step S2 comprises: S21: cumulative variable processing, converting the cumulative variables of the meteorological forecast product data into instantaneous variables; S22: spatio-temporal matching processing, selecting the 5*5 grid of the nearest grid point as the center of the prediction space as the input, wherein the input features include physical elements, geographical elements and classification elements; S23: data quality control, screening the observation data to eliminate abnormal and unreasonable data; S24: writing the preprocessed meteorological and terrain data into a storage unit.
4. The short-term surface solar radiation forecasting method based on residual network and channel attention according to claim 1, wherein, The step S3 comprises: S31: constructing a time embedding layer, converting a 25-dimensional vector into a 5*5 grid as a spatial classification feature input, and continuously learning the time embedding layer by the mbedding layer; S32: feature normalization: normalizing each daytime feature of the obtained data sample, the method being mean-standard deviation normalization: , In the formula, x is the original feature value, μ is the mean of the feature, σ is the standard deviation of the feature, and x' is the normalized feature value.
5. The short-term surface solar radiation forecasting method based on residual network and channel attention according to claim 1, wherein, The convolutional neural network prediction model in step S4 comprises: a feature transformation module, a leadtime embedding and transformation module, a feature fusion and backbone network, a prediction head MLPHead, a daytime gate gating branch, and an output layer.
6. The surface solar radiation short-term prediction method based on residual network and channel attention according to claim 1, wherein, The step S5 of training and optimizing the prediction model comprises: customizing a loss function: based on Huber Loss, the model loss function is customized, and the basic HuberLoss formula of smooth L1 loss is as follows, , In the formula, y is the true value, y' is the predicted value, and δ is a hyperparameter controlling the smooth interval, and its initial value is 1; the customized loss function defines the weighting coefficient of the Huber Loss part as 0.7; the radiation peak value interval of 11-14 points per day is calculated and weighted as the peak error Peak_Loss, and the coefficient is 0.3; the relative error Relative_Loss after smoothing is added, and the coefficient is 0.2; the customized loss function calculation method is 0.7×Huber_Loss + 0.3×Peak_Loss + 0.2×Relative_Loss. The convolutional neural network prediction model adopts a cosine annealing with warm restart learning rate scheduling strategy, and the learning rate is dynamically adjusted in each training period; the initial learning rate is 0.0005, the minimum learning rate is 0.00001, the initial period length of warm start is 10, and the period multiplication coefficient is 2.
7. The short-term surface solar radiation forecasting method based on residual network and channel attention according to claim 3, characterized in that, The method for processing the cumulative variable in the step S21 is: The forecast values involved in the cumulative variable Cum include ssrd, strc, ssrc, ssr, tsrc, tsr, cdir, fdir, strd, str, and ttrc; the above cumulative variables need to be converted into instantaneous variables, and the conversion formula is as follows: , In the above formula, EC forecast is the instantaneous variable of the converted ECMWF forecast, in W / m 2 ; Cum is one of the above cumulative variables, in J / m 2 ; Cum t is the forecast value of the ECMWF forecast at time t, Cum t-3 is the forecast value of the ECMWF forecast three hours before the time t.
8. The short-term ground surface solar radiation prediction method based on the residual network and channel attention according to claim 3, wherein, The step S22 is a space-time matching processing, 5*5 grid ECMWF prediction data centered on the nearest grid point in the prediction space is selected as the input of 104 physical elements; there are 6 geographical elements, including longitude, latitude, altitude, slope direction, slope, and curvature, the longitude and latitude are input into the model according to the numerical prediction resolution of 0.1*0.1, and the longitude and latitude of the middle grid point are replaced by the longitude and latitude of the prediction site; the altitude, slope, slope direction, and curvature select the 1km*1km resolution 5*5 grid of the site and the adjacent site to input the model.
9. The surface solar radiation short-term prediction method based on residual network and channel attention according to claim 3, characterized in that, The specific method of the data quality control in the step S23 is: automatically detecting and filtering the abnormal irradiance data greater than 50W / m2 from 22:00 to 04:00 of the next day; removing the sites or samples with the same observation value for a long time; removing the samples that do not have complete 0-72 hour continuous observation data every three hours; and filling the abnormal values of the terrain height and other variables around the coastal site with 0.
10. The method for short-term surface solar radiation prediction based on residual network and channel attention according to claim 5, wherein, The convolutional neural network prediction model is specifically: (1) Feature transformation module: The input channel number is the variable number, the output channel number is 128, the convolution kernel size is 1*1, and the step is 1; Normalization layer: BatchNorm2d standardization is performed on each batch of feature channels to improve the training stability; Activation function: ReLU, used to introduce nonlinearity; Dropout2d: The dropout probability is 0.2 to prevent overfitting; (2) Leadtime embedding and transformation module: The Leadtime first passes through the Embedding layer, with an input of 25 and an output of 64, and then passes through LayerNorm, Linear(64,32), ReLU, and LayerNorm; Then through Linear(32,25), ReLU, LayerNorm, Dropout, and finally reshape to [batch, 1, 5,5], and splice with the feature main branch; (3) Feature fusion and main network Backbone: The feature transformation output and the leadtime embedded feature are spliced in the channel dimension, and then input into the main network; the main network is composed of three groups of residual blocks ResBlock and channel attention blocks SEBlock, and the structure is as follows: ResBlock1: input channel 129, output channel 256, kernel 3x3, stride 1, with BatchNorm2d and ReLU, with 1x1 convolution shortcut branch; SEBlock1: input channel 256, channel attention mechanism, containing global pooling, fully connected, GELU, Sigmoid; Dropout2d (p=0.2), MaxPool2d (2x2); ResBlock2: input channel 256, output channel 256, kernel 3x3, stride 1, with BatchNorm2d and ReLU; SEBlock2: input channel 256, channel attention mechanism; Dropout2d (p=0.2); ResBlock3: input channel 256, output channel 128, kernel 3x3, stride 1, with BatchNorm2d and ReLU; SEBlock3: input channel 128, channel attention mechanism; Dropout2d (p=0.2); (4) Prediction head MLP Head: After the backbone network output is globally averaged pooled AdaptiveAvgPool2d(1) and flattened, it is sequentially passed through four fully connected layers and ReLU activations, as follows: Fully connected layer 1: input 128, output 256, BatchNorm1d, ReLU, Dropout(0.3); Fully connected layer 2: input 256, output 128, BatchNorm1d, ReLU, Dropout(0.3); Fully connected layer 3: input 128, output 64, BatchNorm1d, ReLU, Dropout(0.2); Fully connected layer 4: input 64, output 1; (5) Daytime Gate gating branch: Concatenate the flattened feature vector with the is_daytime flag and input the gating network: Fully connected layer 1: input 129 (128+1), output 64, BatchNorm1d, ReLU, Dropout(0.2); Fully connected layer 2: input 64, output 1, Sigmoid activation; (6) Output layer: The final output is "prediction head output x gated output x is - daytime", and the nighttime forced output is 0.