Solar Radiation Prediction Method and System Based on Dual-Branch Feature Extraction

Through the dual-branch feature extraction method, the meteorological and timing characteristics were extracted respectively using multi-scale CNN and BiGRU-GRU models, and weighted fusion was carried out in combination with attention mechanisms, which solved the problem of difficult separation of meteorological factors and time factors in the existing technology, and significantly improved the accuracy of solar radiation prediction.

CN115099461BActive Publication Date: 2025-05-27CHINA JILIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210576696.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2025-05-27
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

The existing solar radiation prediction methods are difficult to clearly separate meteorological and temporal factors, resulting in a decrease in prediction accuracy.

Method used

Using a method based on dual-branch feature extraction, meteorological and timing features were extracted respectively through multi-scale CNN and BiGRU-GRU models, and the weighted fusion of each branch was optimized in combination with attention mechanism.

Benefits of technology

It significantly improves the accuracy of solar radiation prediction, adapts to complex and changeable meteorological characteristics, divides the data to improve prediction accuracy, and reduces network parameters through parallel superposition convolutional layers to prevent overfitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115099461B_ABST
    Figure CN115099461B_ABST
Patent Text Reader

Abstract

The present invention discloses a solar radiation prediction method and system based on dual-branch feature extraction, in the field of solar radiation prediction technology, and the key points of the technical solution are: based on K-means++, the pre-processed solar radiation data is classified into types; a measurement data set is constructed; a multi-scale convolutional neural network is used to extract dynamically changing multi-dimensional meteorological features from a meteorological data set; a bidirectional gated recurrent network is used to preliminarily extract time series features from a time series data set, and learn the potential laws of bidirectional time series features; based on the attention mechanism, the weights of the meteorological branch and the time series branch are adaptively assigned, and the extraction operation of the multi-scale convolution and the fusion process of the multi-dimensional meteorological features and the bidirectional time series features are optimized to obtain the fusion features; the fusion features are flattened and input into the fully connected layer to obtain the prediction results. The present invention effectively extracts meteorological features and time series features, and optimizes the weighted fusion of each branch in combination with the attention mechanism, and the prediction accuracy is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of solar radiation prediction, and more specifically, to a solar radiation prediction method and system based on dual-branch feature extraction. Background Art

[0002] Solar radiation is vulnerable to environmental influences, showing strong volatility and randomness. Accurate prediction of solar radiation has important guiding significance for real-time monitoring of photovoltaic power, grid connection scheduling of photovoltaic systems, and intelligent planning of photovoltaic power plants. There are three types of solar radiation prediction methods: physical models, empirical models, and machine learning. Among them, machine learning does not need to combine complex calculation principles, and the prediction results have strong applicability, which is the most commonly used prediction method for solar radiation at present.

[0003] Existing machine learning models such as support vector machines, gradient boosting decision trees, and extreme learning machines are difficult to flexibly adjust their structures. In the solar radiation prediction task with fewer input features, there is a problem of reduced accuracy. Convolutional Neural Network (CNN) is suitable for learning input features such as grid measurements for prediction modeling; Recurrent Neural Network (RNN) can analyze the temporal changes of solar radiation according to the radiation sequence. Among them, the RNN variants Long Short Term Memory Network (LSTM) and Gate Recurrent Unit (GRU) show good non-linear representation ability and time series analysis ability during the prediction process. In the CNN-LSTM combined model, CNN is used to extract features of the prediction variable, and the LSTM model is used to learn the temporal rules of the extracted features, which has better prediction accuracy than a single model.

[0004] However, in the above solar radiation prediction methods, the influences of meteorological factors and time factors on solar radiation are not clearly separated, and the serial superposition of CNN-based and RNN-based models is likely to confuse the contributions of the two types of features to the output of solar radiation. Therefore, how to research and design a solar radiation prediction method that can overcome the above defects is an urgent problem for us to solve at present. Summary of the Invention

[0005] To solve the deficiencies in the prior art, the object of the present invention is to provide a solar radiation prediction method and system based on dual-branch feature extraction, which fully excavates and utilizes the meteorological features and temporal features of the original data, completely separates the temporal factors and meteorological factors when constructing the dataset, effectively extracts meteorological features and temporal features using multi-scale CNN and BiGRU-GRU models, and combines the attention mechanism to optimize the weighted fusion of each branch, resulting in a significant improvement in prediction accuracy.

[0006] The above technical object of the present invention is achieved through the following technical solutions:

[0007] In a first aspect, a solar radiation prediction method based on dual-branch feature extraction is provided, including the following steps:

[0008] Based on K-means++, the preprocessed solar radiation data is classified to obtain weather types;

[0009] Construct a prediction data set for the corresponding same-kind weather, and the prediction data set includes a meteorological data set and a time series data set;

[0010] Use a multi-scale convolutional neural network to extract dynamic and changing multi-dimensional meteorological features from the meteorological data set;

[0011] Use a bidirectional gated recurrent network to initially extract time series features from the time series data set, and input the learned bidirectional time series features into the gated recurrent network to continue learning potential laws to obtain the final bidirectional time series features;

[0012] Based on the attention mechanism, adaptively assign weights to the meteorological branch and the time series branch, optimize the extraction operation of multi-scale convolution and the fusion process of multi-dimensional meteorological features and bidirectional time series features, and then obtain the fusion features;

[0013] Flatten the fusion features and input them into the fully connected layer to obtain the prediction result of solar radiation.

[0014] Furthermore, the preprocessing process of the solar radiation data is specifically as follows:

[0015] The solar radiation data includes multiple meteorological features, a time feature, and the solar radiation value of the current day;

[0016] Split the time feature into year, season, month, and date, and use the season factor and the month factor as the time series features for solar radiation prediction;

[0017] After normalizing the data, divide the training set and the test set according to the ratio of 4:1 of the data set.

[0018] Furthermore, the process of dividing the weather types is specifically as follows:

[0019] Adopt the Pearson correlation coefficient to measure the correlation between meteorological features and solar radiation;

[0020] Divide the data with the total cloud amount less than the preset threshold in the meteorological features into sunny weather types, and use the clustering method to divide the remaining data, and form the clustering feature vector after removing the meteorological data with weak correlation and below;

[0021] Determine the value of K in the clustering method by the elbow method, and classify the radiation data after clustering analysis into corresponding weather types according to meteorological characteristics.

[0022] Furthermore, the construction formula of the prediction dataset is specifically:

[0023] Sample = {R S(t) , R W(t)}

[0024] R S(t) = [S t-T , S t-T+1 , …, S t-1 T

[0025] S t = [season t , month t , radiation t

[0026] R W(t) = [F 1(t) , F 2(t) , …, F 9(t)

[0027] Among them, Sample represents the prediction dataset for solar radiation prediction; R S(t) represents the time series dataset; R W(t) represents the meteorological dataset; the time series dataset R S(t) is formed by a sliding window, T is the size of the time step sliding window, and R S(t) contains the time series features S t , season t represents the season to which the t-th day belongs, month t represents the month to which the t-th day belongs, and radiation t represents the solar radiation value of the t-th day; R W(t) is composed of F 1(t) , F 2(t) , …, F 9(t) a total of 9 meteorological features.

[0028] Furthermore, the extraction process of the multi-dimensional meteorological features is specifically:

[0029] First, use the Reshape function to transform the meteorological feature matrix into a feature vector with a size of 3×3×1;

[0030] Then, perform a convolution operation with 8 convolution kernels of size 1×1 to increase the feature dimension and add non-linearity;

[0031] ​​​Then, the feature vectors of size 3×3×8 are respectively subjected to three convolution operations with different convolutional kernel sizes;

[0032] Finally, the extraction results of the three convolution operations are numerically added as the extraction result of meteorological features;

[0033] The Same strategy is adopted for all convolution operations. A single convolution operation includes a two-dimensional convolutional layer, a batch normalization layer, and an activation function layer.

[0034] Furthermore, the bidirectional gated recurrent network and the gated recurrent network both adopt the Dropout mechanism during setting, and randomly discard some hidden layer units when training the model.

[0035] Furthermore, the fusion and optimization process of the multi-dimensional meteorological features and the bidirectional temporal features is specifically as follows:

[0036] The meteorological feature map and the temporal feature map with the same size after extraction are used to obtain the preliminary fusion features by element-wise addition;

[0037] The global average pooling operation is performed on the preliminary fusion features to obtain a global information on each channel; the global information passes through a fully connected layer including an activation function and batch normalization, and creates compact features for accurate and adjusted branch weight selection;

[0038] Guided by the compact feature Z, it is upsampled through fully connected layers A and B, and the softmax function operation is used on the channel dimension to adaptively select the branch weights;

[0039] The feature maps of the meteorological branch and the temporal branch are multiplied by the branch weights element-wise to obtain the feature map containing the adaptive weights, and then element-wise addition is performed to obtain the final fusion features.

[0040] In a second aspect, a solar radiation prediction system based on dual-branch feature extraction is provided, including:

[0041] A type classification module, which is used to classify the preprocessed solar radiation data based on K-means++ to obtain weather types;

[0042] A data construction module, which is used to construct a prediction data set under the corresponding same weather. The prediction data set includes a meteorological data set and a temporal data set;

[0043] A meteorological processing module, which is used to extract dynamic multi-dimensional meteorological features from the meteorological data set by using a multi-scale convolutional neural network;

[0044] A time series processing module, which is used to initially extract time series features from a time series dataset using a bidirectional gated recurrent network, and input the learned bidirectional time series features into a gated recurrent network to continue learning potential patterns, so as to obtain the final bidirectional time series features;

[0045] A weight allocation module, which is used to adaptively assign weights to the meteorological branch and the time series branch based on the attention mechanism. After optimizing the extraction operation of multi-scale convolution and the fusion process of multi-dimensional meteorological features and bidirectional time series features, fusion features are obtained;

[0046] A radiation prediction module, which is used to flatten the fusion features and input them into a fully connected layer to obtain the prediction result of solar radiation.

[0047] In a third aspect, a computer terminal is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the solar radiation prediction method based on dual-branch feature extraction described in any one of the first aspects is implemented.

[0048] In a fourth aspect, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the solar radiation prediction method based on dual-branch feature extraction described in any one of the first aspects can be implemented.

[0049] Compared with the prior art, the present invention has the following beneficial effects:

[0050] 1. The solar radiation prediction method based on dual-branch feature extraction proposed by the present invention fully excavates and utilizes the meteorological features and time series features of the original data. When constructing the dataset, the time series factors and meteorological factors are completely separated. The multi-scale CNN and BiGRU-GRU models are used to effectively extract meteorological features and time series features, and the attention mechanism is combined to optimize the weighted fusion of each branch. Through case analysis based on the real data of the National Meteorological Data Center, the effectiveness of the dual-branch feature extraction method in solar radiation prediction is proved, and the prediction accuracy is significantly improved;

[0051] 2. The present invention divides the data according to meteorological features, adapts to the different outputs of solar radiation caused by complex and changeable meteorological features, and effectively improves the prediction accuracy;

[0052] 3. In the process of extracting features using the multi-scale convolutional neural network, the present invention can better learn features of different scales with fewer network parameters by the way of parallelly stacking convolutional layers;

[0053] 4. To prevent the problem of overfitting in the case of a small sample size, the Dropout mechanism is adopted in both the BiGRU layer and the GRU layer during setting. When training the model, some hidden layer units are randomly discarded, making the BiGRU-GRU model have stronger robustness and generalization ability.

[0054] 5. The attention mechanism in the present invention, as a weighting mechanism, can selectively focus on input variables, adaptively assign reasonable weights to each branch, optimize the feature extraction process, and can adaptively extract important features in sparse data. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, form a part of this application, and do not limit the embodiments of the present invention. In the drawings:

[0056] Figure 1 is the overall flowchart in the embodiment of the present invention;

[0057] Figure 2 is the schematic diagram of the CNN model structure in the embodiment of the present invention;

[0058] Figure 3 is the schematic diagram of the BiGRU-GRU model structure in the embodiment of the present invention;

[0059] Figure 4 is the flowchart of feature fusion based on the attention mechanism in the embodiment of the present invention;

[0060] Figure 5 is the overall prediction result comparison diagram in the embodiment of the present invention, where a is the overall comparison, b is a comparison detail, and c is another comparison detail;

[0061] Figure 6 is the prediction comparison diagram under weather types in the embodiment of the present invention, where a is a sunny sample, b is a cloudy sample, c is a rainy sample, and d is a heavy rain sample;

[0062] Figure 7 is the clustering result diagram of meteorological data in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0063] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and the drawings. The illustrative embodiments and descriptions thereof of the present invention are only used to explain the present invention and do not limit the present invention.

[0064] Embodiment 1: A solar radiation prediction method based on dual-branch feature extraction, as Figure 1 shown, is specifically implemented by the following steps.

[0065] I. Data Preprocessing

[0066] The data in this embodiment comes from the solar radiation data of the Haining station of the National Meteorological Data Center for 5 years, and the data granularity is one record per day. The data includes 9 meteorological features such as the highest temperature, the lowest temperature, precipitation, total cloud cover, air quality, etc., 1 time feature (specific date), and the solar radiation value on that day. The training set and the test set are divided according to the ratio of 4:1 of the data set. Solar radiation shows obvious periodicity on an annual basis and obvious fluctuations on a daily basis.

[0067] To further explore the influence of time factors on solar radiation, the time feature is split into year, season, month, and date. Season and month have obvious effects on solar radiation, showing the highest in summer and the lowest in winter, with stable monthly radiation means and a radiation decrease point in June; date and year have little effect on solar radiation, showing random fluctuations of radiation with the date and no obvious changes with the year. The season factor and the month factor are used as the time series features for solar radiation prediction. Since different features have different units and magnitudes, it is necessary to normalize the data first.

[0068] II. Data Partitioning Based on K-means++

[0069] Complex and variable meteorological features have different effects on the output of solar radiation. To improve the prediction accuracy, the data is partitioned according to meteorological features. The Pearson correlation coefficient is used to measure the correlation between meteorological features and solar radiation, and the calculation formula is as follows:

[0070]

[0071] In the formula, ρ X,Y is the Pearson correlation coefficient, X and Y are sample variables respectively, and the value range is [-1, 1]. When the absolute value of the correlation coefficient is 0.8 - 1.0, it is extremely strong correlation; 0.6 - 0.8 is strong correlation; 0.4 - 0.6 is medium correlation; 0.2 - 0.4 is weak correlation; 0.0 - 0.2 is extremely weak correlation. n is the sample size; X, are the means of the two samples respectively.

[0072] The data with a total cloud cover < 30% in the meteorological features is classified as sunny weather, and the remaining data is partitioned using the clustering method. The meteorological data with weak correlation or below is removed, and the constructed clustering feature vector is as follows:

[0073] V = {T m , T d , W a , H a , P a}

[0074] In the formula, V is the set of feature vectors; Tm is the highest temperature, T n is the temperature difference, W a is the total cloud cover, H a is the relative humidity, P a is the daily precipitation.

[0075] The K-means++ algorithm optimizes the selection process of cluster centers based on K-means. The core idea is to make the initial cluster centers as far away from each other as possible to accelerate the convergence process of the clustering algorithm and ensure good clustering results. The K-means++ clustering process is shown in Table 1.

[0076] Table 1 K-means++ clustering process

[0077]

[0078]

[0079] The value of K is determined by the elbow method. In this embodiment, when K is determined to be 3, the clustering effect is the best. As Figure 7 shown, using the normalized highest temperature, precipitation, and total cloud cover as x, y, and z, there is a clear clustering performance in three-dimensional space. The radiation data after clustering analysis is named cloudy, rainy, and rainy according to meteorological characteristics.

[0080] III. Construction of prediction dataset

[0081] The present invention fully considers the influence of meteorological characteristics and the fluctuations caused by temporal sequences, and constructs a solar radiation prediction dataset under the same weather conditions as follows for daily prediction of solar radiation. The construction of the dataset is as follows:

[0082] Sample = {R S(t) , R W(t)}

[0083] R S(t) = [S t-T , S t-T+1 , …, S t-1 T

[0084] S t = [season t , month t , radiation t

[0085] R W(t) = [F 1(t) , F 2(t) , …, F 9(t)

[0086] ​​​In the formula, the solar radiation prediction data set Sample consists of the time series data set R of the current day S(t) and the meteorological data set R W(t) . Among them, the time series data set R S(t) is formed by a sliding window. T is the size of the time step sliding window. R S(t) contains the time series features S of the previous T days t , season t represents the season to which the t-th day belongs, month t represents the month to which the t-th day belongs, and radiation t represents the solar radiation value of the t-th day. R W(t) consists of F 1(t) , F 2(t) , …, F 9(t) , a total of 9 meteorological features.

[0087] IV. Meteorological Feature Extraction Based on Multi-Scale CNN

[0088] The main structure of the CNN convolutional neural network is the input layer, convolutional layer, pooling layer, fully connected layer, output layer, etc. The main idea is local connection and parameter sharing. It is a deep feedforward neural network and is widely used in fields such as computer vision and natural language processing.

[0089] CNN usually uses convolutional kernels of multiple different sizes to perform convolutional operations on the original feature data to better learn features of different scales. The size of the convolutional kernel can determine the degree of abstraction of the extracted features. Convolutional kernels of different sizes are usually stacked in a serial method, which will cause the network layers to become deeper, resulting in problems such as overfitting and gradient explosion.

[0090] The present invention designs a multi-scale CNN feature extraction method to fully learn limited meteorological features. This model can better learn features of different scales with fewer network parameters by parallelly stacking convolutional layers. The structure of the multi-scale CNN model is as Figure 2 shown.

[0091] The input data is the meteorological data set R W(t), which contains 9 meteorological features. First, the meteorological feature matrix is reshaped into a feature vector of size (3×3×1) through the Reshape function; then, a convolution operation with 8 convolutional kernels of size 1×1 is performed, which changes the feature dimension and adds non-linearity; then, the feature vector of size (3×3×8) is respectively passed through three convolution operations with different convolutional kernel sizes, which helps to learn features at different levels of abstraction; finally, the extraction results of the three convolution operations are numerically added as the extraction result of the meteorological features. The same strategy is adopted for all convolution operations, ensuring that the feature vectors have the same dimension after convolution operations with different convolutional kernels, and the output meteorological feature dimension is (3×3×8).

[0092] A single convolution operation includes a two-dimensional convolution (Conv2D) layer, a batch normalization (Batch Normalization, BN) layer, and an activation function layer. Batch normalization alleviates the problem of weight changes caused by hidden layers in the network, keeping the mean and variance of each layer of the neural network unchanged. The process of batch normalization is as follows:

[0093]

[0094] In the formula, is the preliminary result of batch normalization, X i is the input batch data, μ is the mean of this batch of data, σ 2 is the variance of this batch of data, and ε is a very small value to prevent calculation errors caused by division by zero.

[0095] The preliminary result of batch normalization is basically restricted under the normal distribution, resulting in a decrease in the network's expressive ability. Therefore, the output of the batch normalization layer scales and shifts the data to ensure that the input of each layer of the neural network is in the region sensitive to the activation function, which can accelerate the network learning and convergence speed. The output formula of the batch normalization layer is specifically:

[0096]

[0097] In the formula, γ is the scaling parameter, β is the shifting parameter, and Y i is the output of batch normalization.

[0098] The activation function uses Leaky Relu, which gives a non-zero slope to negative values compared with Relu, solving the problem of gradient disappearance in the negative value range. The calculation formula of the activation function is as follows:

[0099]

[0100] In the formula, Y i is the output layer of the activation function; X i is the input layer of the activation function; a is a user-defined non-zero slope.

[0101] V. Temporal Feature Extraction Based on BiGRU-GRU

[0102] Compared with traditional neural networks, the neurons in the hidden layer of the recurrent neural network (RNN) are connected, so it shows better adaptability in the analysis and prediction of time series data. However, it is difficult for RNN to learn the long-term dependence information of time series data. Based on RNN, LSTM adds four interacting neural network layers inside the neurons, which improves the phenomenon of gradient disappearance or gradient explosion during the training of RNN. As a variant of LSTM, GRU solves the long-term dependence problem while making up for the defect of too long convergence time caused by the complex internal parameters of LSTM.

[0103] The information transfer order in neural networks such as GRU is unidirectional, but the solar radiation at a certain time point is related to the temporal features of both historical and future moments. In view of the characteristics that time series data is related to both previous and subsequent data, a step-by-step learning strategy is adopted. First, the bidirectional temporal features of the data are extracted, and then the internal laws of the bidirectional temporal features are learned. The bidirectional GRU neural network consists of a forward GRU layer and a backward GRU layer, which can effectively learn the forward and backward laws of the time series. The present invention uses the BiGRU-GRU model to extract features from the time series data set. The model structure of BiGRU-GRU includes an input layer, a BiGRU layer, a GRU layer, a Reshape layer and an output layer. The model structure is as Figure 3 shown.

[0104] The input layer of the BiGRU-GRU model is the time series data set R S(t) . For the convenience of describing the network structure, the data sequence is first simply replaced:

[0105] [X t,1 ,…,X t,i ,…,X t,T T =[S t-T ,…,S t-T+i-1 ,…,S t-1 T i∈[1,T]

[0106] In the formula, both X t,i and S t-T+i-1 represent the temporal features of the i-th time step in the time series data set R S(t) , and the value range of i is [1,T].

[0107] ​​The BiGRU layer contains a forward GRU network and a backward GRU network, which calculate the forward propagation state and the backward propagation state respectively. The hidden layer results of the two propagation states are concatenated based on the channel dimension to obtain a bidirectional time series feature set containing forward and backward rules. The calculation process of the BiGRU layer is as follows:

[0108]

[0109]

[0110]

[0111] B t =[B t,1 ,...,B t,i-1 ,B t,i ,B t,i+1 ,...,B t,T T

[0112] In the formula, is the forward propagation state at the i-th time step at time t, is the backward propagation state, and B t,i is the output unit of the i-th time step of the BiGRU layer containing the forward propagation state and the backward propagation state at time t. B t is the output matrix of the BiGRU layer at time t, and [;] is the tensor concatenation of the matrix based on the channel dimension.

[0113] The input of the GRU layer is the bidirectional time series feature B t at time t. In the present invention, two GRU networks with the same number of channels are adopted to fully learn the potential rules of the bidirectional time series features. The calculation process of the GRU layer is as follows:

[0114] G t,i =GRU(B t,i ,G t,i-1 )

[0115] G' t,i =GRU(G t,i ,G’ t,i-1 )

[0116] Y t =G' t,T

[0117] In the formula, G t,i is the hidden layer state of the first layer GRU network at the i-th time step at time t, G' t,i is the hidden layer state of the second layer GRU network at the i-th time step at time t, and Y​t is the output matrix of the GRU layer at time t, that is, the hidden layer state of the last time step of the second GRU layer.

[0118] When the BiGRU network is stacked with the GRU network, there will be problems of complex model and excessive parameters. To prevent overfitting problems in the case of a small sample size, the Dropout mechanism is adopted in both the BiGRU layer and the GRU layer. During model training, some hidden layer units are randomly discarded, making the BiGRU-GRU model have stronger robustness and generalization ability. The number of units in the BiGRU layer and the GRU layer are set to 36 and 72 respectively, meeting the size matching required for the merger of time series features and meteorological features. The output matrix Y of the GRU layer t After passing through the Reshape layer, it is transformed into a feature map of size (3×3×8), which is used as the extraction result of time series features.

[0119] VI. Optimization of Weight Assignment Based on Attention Mechanism

[0120] There are weight assignment problems in the use of the multi-scale CNN model and the fusion of meteorological features and time series features. For the output results of each branch, traditional numerical addition or tensor splicing default that the importance of each branch is basically the same, which is not applicable to the actual prediction situation. As a weighted mechanism, the attention mechanism can selectively focus on input variables and adaptively assign reasonable weights to each branch, optimizing the feature extraction process. The optimization process of the attention mechanism for the fusion of meteorological features and time series features is as Figure 4 shown, and it can adaptively extract important features from sparse data

[0121] The optimization process of the attention mechanism under the double-branch mainly includes the following four steps:

[0122] (1) Preliminary fusion of branch features

[0123] After extraction, the meteorological feature map M and the time series feature map T ensure the same size. First, the element addition method is used to obtain the preliminarily fused feature E, and the specific formula is as follows:

[0124] E = M + T

[0125] In the formula, H, W, and C respectively represent the length, width, and number of channels of the feature map. In this experiment, H = W = 3, C = 8.

[0126] (2) Calculation of weight parameters

[0127] The global average pooling operation is used for the preliminarily fused feature to obtain a global information on each channel; the global information passes through a fully connected layer including an activation function and batch normalization Achieve higher efficiency while reducing dimensions. Create compact features For the weight selection of precise and adjusted branches, the specific formula is as follows:

[0128]

[0129] Z = δ'(β(W f S))

[0130] In the formula, Ec(i,j) represents the preliminary fusion result under the c-th channel, S c represents the global information under the c-th channel, c ∈ [1, C], β represents the batch operation, and δ' represents the LeakyRelu activation function.

[0131] (3) Branch weighting

[0132] Guided by the compact feature Z, the dimension is increased through the fully connected layers A and B. The softmax operation is used in the channel dimension to adaptively select the weights of the branches. The specific formula is as follows:

[0133]

[0134] In the formula, a c , b c represent the branch weights of the meteorological feature map M and the temporal feature map T under the c-th channel. a c + b c = 1, In the case of a double branch, B is the redundant matrix of A.

[0135] (4) Branch feature weighted fusion

[0136] Multiply the feature maps of the two branches element-wise with the branch weights to obtain a feature map containing adaptive weights, and then add them element-wise to obtain the final fused feature. The specific formula is as follows:

[0137] E' c = a c · M c + b c · T c

[0138] E' = [E' 1 , E' 2 , …, E'c, …, E' C-1 , E' C

[0139] In the formula, M c , T c represent the meteorological feature and the temporal feature under the c-th channel before weighting, E'​c It represents the weighted fusion result under the c-th channel, and E' represents the feature map after weighted fusion. The situation of the attention mechanism optimizing multi-scale CNN feature fusion under multiple branches can be derived through the above analysis.

[0140] VII. Experimental Analysis

[0141] 1. Evaluation Metrics

[0142] Two evaluation metrics, Mean Absolute Percentage Error (MAPE) and Root Mean Square Error (RMSE), are used to evaluate the experimental results of the present invention. The calculation formulas for each evaluation metric are as follows:

[0143]

[0144]

[0145] In the formula, n is the number of prediction samples, is the predicted value of the sample, and y i = {y 1 , y 2 ,..., y n} is the actual value of the sample.

[0146] 2. Parameter Settings

[0147] In view of the characteristics of medium data scale and moderate number of parameters in this experiment, the limited range of each parameter is preset, and the optimal results of experimental parameters and training parameters are found through the method of grid search. Table 2 shows the parameter configuration optimized by grid search.

[0148] Table 2 Specific parameter settings after grid search optimization

[0149]

[0150] 3. Comparative Experiments

[0151] To verify the effectiveness of the dual-branch feature extraction method, one structure in the proposed model is changed in turn to ensure the uniqueness of variables in the comparative experiment. Among them, the comparative models include:

[0152] (1) Deep CNN: The deep CNN model replaces the multi-scale CNN model by cascading convolution calculations with different kernel sizes.

[0153] (2) Without BiGRU: A three-layer GRU model is used to replace BiGRU-GRU.

[0154] (3) Without Attention: The fusion strategy of direct element addition replaces the attention mechanism.

[0155] In addition, to verify the effectiveness of dual-branch feature extraction, a control case of using the CNN-LSTM model to predict under a single branch is added. The evaluation indicators RMSE and MAPE of the prediction results under four types of weather are shown in Table 3.

[0156] Table 3 Comparison of prediction errors

[0157]

[0158]

[0159] As can be seen from Table 3, under the four types of weather conditions, the RMSE and MAPE of the method of the present invention are the best. Compared with the single-branch feature extraction method, the RMSE is reduced by 11.4%, 8.7%, 11.6%, and 15.4% in sunny, cloudy, rainy, and rainy conditions, respectively, and the overall decrease is 13.7%; MAPE is reduced by 13.7%, 10.2%, 16.1%, and 20.3% in sunny, cloudy, rainy, and rainy conditions, respectively, and the overall decrease is 16.2%, and the prediction accuracy is significantly high. Further analysis shows that for more complex rainy and rainy weather, the dual-branch feature extraction method that clearly separates meteorological factors and time factors can improve the prediction accuracy of solar radiation more significantly.

[0160] like Figure 5 and Figure 6 As shown in the figure, in addition, under the method of dual-branch feature extraction, the impact of changing strategies on the prediction results is analyzed one by one. Using Deep CNN instead of multi-scale CNN, the prediction accuracy in various weather conditions has dropped significantly, indicating that multi-scale CNN can learn limited features more fully by widening the channel and superimposing convolutions of different sizes in parallel; without using the BiGRU model to learn bidirectional features first, the prediction accuracy in sunny and cloudy conditions has dropped significantly, but the prediction accuracy for rainy and rainy days with large fluctuations has dropped less, proving that for data types with more obvious temporal regularities, BiGRU can learn the inherent laws of temporal features compared to GRU; using the attention mechanism strategy instead of the default equal-weighted addition, the prediction effect has been improved to varying degrees in the four types of weather conditions, specifically, the improvement in sunny and cloudy days is greater, reflecting the effectiveness of the attention mechanism strategy.

[0161] In summary, the present invention solves the problem that meteorological factors and temporal factors cannot be fully exploited in prediction for the effect of solar radiation output. This method adopts the idea of separating and extracting meteorological and temporal features and weighted fusion of attention mechanism. Compared with the combined model in the case of a single branch, the prediction accuracy is significantly improved. In addition, through one-by-one comparative experiments, the effectiveness of multi-scale CNN and BiGRU-GRU in extracting meteorological features and temporal features is proved.

[0162] Embodiment 2: A solar radiation prediction system based on dual-branch feature extraction, which is used to implement the prediction method described in Embodiment 1, and includes a type division module, a data construction module, a meteorological processing module, a temporal processing module, a weight assignment module, and a radiation prediction module.

[0163] Among them, the type division module is used to divide the preprocessed solar radiation data based on K-means++ to obtain weather types; the data construction module is used to construct a prediction data set under the corresponding same weather, and the prediction data set includes a meteorological data set and a temporal data set; the meteorological processing module is used to extract dynamic multi-dimensional meteorological features from the meteorological data set by using a multi-scale convolutional neural network; the temporal processing module is used to initially extract temporal features from the temporal data set by using a bidirectional gated recurrent network, and input the learned bidirectional temporal features into the gated recurrent network to continue learning potential laws to obtain the final bidirectional temporal features; the weight assignment module is used to adaptively assign weights to the meteorological branch and the temporal branch based on the attention mechanism, and after optimizing the extraction operation of multi-scale convolution and the fusion process of multi-dimensional meteorological features and bidirectional temporal features, obtain fusion features; the radiation prediction module is used to flatten the fusion features and input them into a fully connected layer to obtain the prediction result of solar radiation.

[0164] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0165] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks

[0166] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means for implementing the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks

[0167] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks

[0168] The above specific implementation manners further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are only specific implementation manners of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention

Claims

1. A solar radiation prediction method based on dual-branch feature extraction, characterized in that, it includes the following steps: Based on K-means++, classify the preprocessed solar radiation data to obtain weather types; Construct a prediction data set for solar radiation prediction under the same type of weather. The prediction data set includes a meteorological data set and a time series data set; Use a multi-scale convolutional neural network to extract dynamic multi-dimensional meteorological features from the meteorological data set; Use a bidirectional gated recurrent network to initially extract time series features from the time series data set, and input the learned bidirectional time series features into the gated recurrent network to continue learning potential laws to obtain the final bidirectional time series features; Based on the attention mechanism, adaptively assign weights to the meteorological branch and the time series branch, optimize the extraction operation of multi-scale convolution and the fusion process of multi-dimensional meteorological features and bidirectional time series features, and obtain fusion features; Flatten the fusion features and input them into the fully connected layer to obtain the prediction result of solar radiation; The preprocessing process of the solar radiation data is specifically: The solar radiation data contains multiple meteorological features, one time feature, and the solar radiation value of the current day; Split the time feature into year, season, month, and date, and use the season factor and month factor as the time series features for solar radiation prediction; After normalizing the data, divide the training set and the test set according to the dataset ratio of 4:1; The extraction process of the multi-dimensional meteorological features is specifically: First, use the Reshape function to matrixize the meteorological feature matrix into a feature vector with a size of 3×3×1; Then, perform a convolution operation with 8 convolution kernels and a size of 1×1 to increase the feature dimension and add non-linear characteristics; Then, the feature vector with a size of 3×3×8 is respectively subjected to three convolution operations with different convolution kernel sizes; Finally, add the extraction results of the three convolution operations numerically as the extraction result of the meteorological features; The convolution operation all adopts the Same strategy, and a single convolution operation includes a two-dimensional convolutional layer, a batch normalization layer, and an activation function layer; Both the bidirectional gated recurrent network and the gated recurrent network adopt the Dropout mechanism during setting, and randomly discard some hidden layer units when training the model; The fusion and optimization process of the multi-dimensional meteorological features and the bidirectional time series features is specifically: Add the meteorological feature map and the time series feature map with the same size after extraction in an element-wise manner to obtain the preliminary fusion feature; Use global average pooling operation on the preliminary fusion feature to obtain a global information on each channel; the global information passes through a fully connected layer including an activation function and batch normalization, and creates a compact feature for accurate and adjusted branch weight selection; Guided by the compact feature Z, use fully connected layers A and B to increase the dimension, and use the softmax function operation on the channel dimension to adaptively select the branch weights; Multiply the feature maps of the meteorological branch and the time series branch with the branch weights element-wise to obtain a feature map containing adaptive weights, and then add the elements to obtain the final fusion feature.

2. The solar radiation prediction method based on dual-branch feature extraction according to claim 1, characterized in that, The process of dividing the weather types is specifically: The Pearson correlation coefficient is adopted to measure the correlation between meteorological characteristics and solar radiation; The data with the total cloud cover in meteorological characteristics less than the preset threshold are classified as sunny weather, and the remaining data are divided by the clustering method, and the clustering feature vectors are formed after removing the meteorological data with weak correlation or below; The elbow method is used to determine the value of K in the clustering method, and the radiation data after clustering analysis are divided into corresponding weather types according to meteorological characteristics.

3. The solar radiation prediction method based on dual-branch feature extraction according to claim 1, characterized in that, The construction formula of the prediction data set is specifically: Sample = {R S(t) , R W(t)} R S(t) = [S t-T , S t-T+1 , …, S t-1 T ​ S t = [season t , month t , radiation t ​ R W(t) = [F 1(t) , F 2(t) , …, F 9(t) ​ Among them, Sample represents the prediction dataset for solar radiation prediction; R S(t) represents the time series dataset; R W(t) represents the meteorological dataset; the time series dataset R S(t) is formed by a sliding window, where T is the size of the time step sliding window, and R S(t) contains the time series features of the previous T days, S t , season t represents the season to which the t-th day belongs, month t represents the month to which the t-th day belongs, and radiation t represents the solar radiation value on the t-th day; R W(t) is composed of F 1(t) , F 2(t) , …, F 9(t) a total of 9 meteorological features.

4. A solar radiation prediction system based on dual-branch feature extraction, characterized in that, This system is used to implement the solar radiation prediction method based on dual-branch feature extraction described in any one of claims 1-3, including: A type division module, which is used to divide the preprocessed solar radiation data based on K-means++ to obtain weather types; A data construction module, which is used to construct a prediction data set under the same kind of weather, and the prediction data set includes a meteorological data set and a time series data set; A meteorological processing module, which is used to extract dynamic multi-dimensional meteorological characteristics from the meteorological data set by using a multi-scale convolutional neural network; A time series processing module, which is used to initially extract time series characteristics from the time series data set by using a bidirectional gated recurrent network, and input the learned bidirectional time series characteristics into the gated recurrent network to continue learning potential laws to obtain the final bidirectional time series characteristics; A weight assignment module, which is used to adaptively assign weights to the meteorological branch and the time series branch based on the attention mechanism, optimize the extraction operation of multi-scale convolution and the fusion process of multi-dimensional meteorological characteristics and bidirectional time series characteristics, and then obtain the fusion characteristics; A radiation prediction module, which is used to flatten the fusion characteristics and input them into a fully connected layer to obtain the prediction result of solar radiation.

5. A computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the solar radiation prediction method based on dual-branch feature extraction described in any one of claims 1-3.

6. A computer-readable medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor, it can implement the solar radiation prediction method based on dual-branch feature extraction described in any one of claims 1-3.

Citation Information

Patent Citations

  • Ultrashort-period solar radiation predication method and ultrashort-period solar radiation predication device based on hybrid model

    CN106815659A

  • Multi-model solar normal radiation prediction method and device based on clustering algorithm

    CN110197298A