Photovoltaic power prediction method and system based on KAN
By adopting a KAN-based method in the photovoltaic power prediction model, using the learnable activation function and multi-head attention mechanism, the high-dimensional complex features are extracted, and the existing model is solved in the prediction accuracy and achieved higher photovoltaic power Prediction accuracy and a more stable training process.
Patent Information
- Application Number
- CN202510059930.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2045-01-15
AI Technical Summary
When existing photovoltaic power prediction models deal with deep-level complex high-dimensional input features, it is difficult to capture sufficient detailed information, resulting in limited prediction accuracy.
Using the photovoltaic power prediction method based on KAN (Kolmogolov-Arnold Network), the photovoltaic output prediction model is constructed, and the approximation ability to high-dimensional complex functions is improved by using the learnable activation function, combined with the improved depth KAN and multi-head attention mechanisms to extract spatial and temporal features.
It significantly enhances the nonlinear fitting effect of the model, can capture deeper input features, improves the accuracy of photovoltaic power prediction, and improves training efficiency and model stability.
Smart Images

Figure CN119482456A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wind power prediction, and in particular to a photovoltaic power prediction method and system based on KAN. Background Art
[0002] Deep learning methods have now become the research object of many scholars in the field of photovoltaic prediction. Existing models such as Long Short-Term Memory Neural Network (LSTM), Bidirectional Long Short-Term Memory Neural Network (BiLSTM), Convolutional Neural Network (CNN), and their hybrid models CNN-LSTM and CNN-BiLSTM are often used to capture the complex mapping relationship between climate characteristics and actual photovoltaic output power, thereby achieving the purpose of prediction. However, the shortcomings of the above existing models are that they all place non-learnable activation functions on neurons, which limits the nonlinear fitting ability of the model. When encountering deep, complex, and high-dimensional input features, the above models often find it difficult to capture enough detailed information, resulting in limited prediction accuracy. Summary of the invention
[0003] The purpose of the present invention is to propose a photovoltaic power prediction method and system based on KAN, which takes KAN (Kolmogorov-Arnold network) as the basic framework, constructs a photovoltaic output day-ahead prediction model, and uses learnable activation functions to improve the approximation ability of high-dimensional complex functions, significantly enhancing the nonlinear fitting effect of the model, so that the model can capture deeper input features, thereby improving the accuracy of photovoltaic power prediction.
[0004] The present invention is achieved by at least one of the following technical solutions.
[0005] A photovoltaic power prediction method based on KAN includes the following steps: 1) Collect the startup capacity values, weather forecasts and actual power data of the photovoltaic power station as the original data set, preprocess the data of the original data set, and divide it into a training set and a test set; 2) Construct a photovoltaic output day-ahead prediction model and train the photovoltaic output day-ahead prediction model; 3) Test and evaluate the trained photovoltaic output day-ahead prediction model; 4) Use the photovoltaic output day-ahead prediction model to predict photovoltaic power.
[0006] Furthermore, in step 1), preprocessing the data of the original data set includes the following steps: a) Set the weather characteristics corresponding to the output power of 0 to 0; b) Replace the data points where weather characteristics and output power are missing or outside the normal range with the average value of two adjacent moments; c) Perform the following operations on the same type of data respectively: Normalization: ; in is the original dataset The u-th data in Represents data at a moment in time, the original data set It includes all the startup capacity values, weather forecasts and actual power data at a certain moment. U is the number of data in the original data set. and The original data sets The maximum and minimum values of the same type of data, for Normalized data value; d) Remove the data corresponding to the time when the normalized power value is greater than 1 or less than 0; e) Take the data of the same day as a sample, divide the data processed by steps a) to d) into 600-1200 samples, and divide the samples into training set and test set according to the proportion.
[0007] Furthermore, in step 2), the photovoltaic output day-ahead prediction model includes a spatial feature extraction module, a temporal feature extraction module, a spatiotemporal feature fusion and predicted power output module; the spatial feature extraction module and the temporal feature extraction module extract features in parallel, and the extracted features are input into the spatiotemporal feature fusion and predicted power output module to output the photovoltaic power prediction result.
[0008] Furthermore, the spatial feature extraction module includes an improved deep KAN, the improved deep KAN includes multiple basic units, the multiple basic units are connected in sequence, each basic unit is composed of two KAN layer stacks and a jump connection; the spatial feature extraction module finally outputs a result vector.
[0009] Furthermore, the temporal feature extraction module combines the multi-head attention mechanism with KAN, specifically including: (1) Use three independent two-layer KANs to map the input features to the query, key, and value vector spaces respectively, and obtain the query matrix , key matrix , value matrix : ; in The dimension is The input feature matrix is , , The dimensions of , , , The dimensions are KAN, is the number of time points of the input sample, is the input feature dimension, is the number of heads of the multi-head attention mechanism; (2) The query matrix , key matrix , value matrix The blocks are divided into columns respectively. The block matrices with the same subscript belong to the same head attention mechanism, and each head performs attention calculation independently: ; ; in is the calculation result of the g-th attention mechanism, , , They are the query matrix, key matrix, and value matrix of the g-th attention mechanism, and there are a total of G-head attention mechanisms; is the activation function, is a matrix, It means Operate on each row vector of A row vector is ,but The calculation is: ; Pair Vector Using activation functions , used to adjust the sum of each element of the vector to 1, For vector No. elements, J is the length of the vector, ; (3) Concatenate the calculation results of the multi-head attention mechanism and output the time series feature extraction results through the fully connected layer: ; ; in It is the concatenated matrix of the calculation results of the multi-head attention mechanism. is the calculation result of the G-th attention mechanism, , is the weight matrix and bias of the fully connected layer, It is the output result of the time series feature extraction module.
[0010] Furthermore, the spatiotemporal feature fusion and predicted power output module splices the extraction results of the spatial feature extraction module and the temporal feature extraction module, and outputs the photovoltaic power prediction result through the fully connected layer: ; in , The output results of the spatial feature extraction module and the temporal feature extraction module are respectively, , is the weight matrix and bias of the fully connected layer, is the predicted photovoltaic power.
[0011] Furthermore, in step 2), the training of the photovoltaic output day-ahead prediction model includes: The weather characteristics of the training set are input into the photovoltaic output day-ahead prediction model. The photovoltaic output day-ahead prediction model outputs the predicted photovoltaic power. The loss function value is calculated according to the following formula. With the goal of minimizing the loss function, the model parameters are updated repeatedly until the loss function no longer changes significantly: ; in, for The root mean square error, is the true output power sequence in the training set, is the first of the real output power series p elements, Output a prediction sequence for the model, Output prediction sequence for the model p element, is the loss function value, P is and The length of the sequence.
[0012] Furthermore, in step 3), the photovoltaic output day-ahead prediction model test includes: The weather characteristics of the test set are input into the trained photovoltaic output day-ahead prediction model, and the photovoltaic output day-ahead prediction model outputs the predicted photovoltaic power. The prediction accuracy of the photovoltaic output day-ahead prediction model is evaluated by the evaluation index:
[0013]
[0014] in is the monthly average root mean square error, for Actual power at any moment, for The photovoltaic power predicted at any moment, for Always-on capacity, Count the moments for the entire month, is the monthly average accuracy, is the monthly average pass rate, for Predict the qualified judgment results at all times, Equal to 1 means qualified. A value of 0 means failure.
[0015] Furthermore, in step 4), predicting the photovoltaic output on the day to be predicted specifically includes the following steps: 41) Collect real-time weather forecast data for the day to be predicted; 42) The real-time weather forecast data is preprocessed as described above; 43) Input the pre-processed weather characteristic data into the photovoltaic output day-ahead prediction model that meets the test requirements, and obtain the initial prediction through model calculation ,in Represents the day o The predicted value at each time point; 44) According to the startup capacity at each moment, the initial prediction output is denormalized to obtain the final power prediction value, denormalized calculation: ; in For the o The final prediction result at a time point is for o Always on capacity.
[0016] A system for implementing the photovoltaic power prediction method based on KAN includes a photovoltaic output day-ahead prediction model, wherein the photovoltaic output day-ahead prediction model includes a spatial feature extraction module, a temporal feature extraction module, a spatiotemporal feature fusion and a power output prediction module; The spatial feature extraction module is used to extract the spatial features of variables at the same time point in the sample data; The time series feature extraction module is used to extract the time series features of variables at different time points in the sample data; The function of the spatiotemporal feature fusion and predicted power output module is to fuse the spatial feature with the temporal feature and output the predicted photovoltaic power.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1) Higher prediction accuracy: Compared with traditional LSTM, BiLSTM, CNN-LSTM, CNN-BiLSTM and other models, the present invention adopts KAN as the basic architecture to construct a photovoltaic output day-ahead prediction model. It uses learnable activation functions to improve the approximation ability of high-dimensional complex functions and significantly enhances the nonlinear fitting effect of the model, so that the model can capture deeper input features, thereby improving the accuracy of photovoltaic power prediction.
[0018] 2) Higher training efficiency and stability: Compared with the original deep KAN, the present invention effectively alleviates the gradient vanishing problem caused by the increase in the number of network layers by introducing a residual structure in KAN, thereby ensuring the training efficiency of the deep network and the stability of the model.
[0019] 3) Capability of extracting spatiotemporal features: This invention not only uses the improved deep KAN to extract the spatial features of the data, but also combines the attention mechanism with the powerful nonlinear fitting ability of KAN to extract the temporal features of the data, and integrates the spatiotemporal features to output the prediction results. In this way, the photovoltaic output day-ahead prediction model can simultaneously capture the interaction relationship of the data in the spatial dimension and the dynamic change law in the temporal dimension, showing higher prediction accuracy and stronger generalization ability.
[0020] 4) Wide applicability: The method of the present invention can not only be used for photovoltaic power prediction, but can also be extended to other time series prediction tasks that need to process high-dimensional complex inputs, such as wind power prediction and load demand prediction, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a schematic diagram of the shallow KAN structure of the embodiment; Figure 2 The present invention is a schematic diagram of a photovoltaic power prediction system based on KAN according to an embodiment of the present invention; Figure 3 This is a comparison chart of the training effect before and after the improvement of Deep KAN; Figure 4 The results of power prediction for each model using Scheme 4 are shown in the figure. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0023] A photovoltaic power prediction system based on KAN in this embodiment includes a photovoltaic output day-ahead prediction model. The photovoltaic output day-ahead prediction model is based on the Kolmogorov-Arnold Networks (KAN) as the basic architecture. The structural diagram of the entire model is as follows: Figure 2 As shown in the figure, the entire photovoltaic output day-ahead prediction model is divided into three modules: spatial feature extraction module, temporal feature extraction module, spatiotemporal feature fusion and predicted power output module. The photovoltaic output day-ahead prediction model takes weather characteristics as input and photovoltaic power prediction value as output. The weather characteristics include humidity, temperature, irradiance, pressure, wind speed, wind direction, etc.
[0024] Kolmogorov-Arnold Networks (KAN) is a neural network model inspired by the Kolmogorov-Arnold Representation Theorem (KART). Unlike LSTM, BiLSTM, CNN-LSTM, CNN-BiLSTM and other neural network models, KAN places a learnable activation function on the weights, making it more powerful in approximating high-dimensional complex continuous functions. Taking the multivariate continuous function on the bounded domain in equation (1) as an example, according to KART, Represented as two layers of nested superposition of finite univariate continuous functions: ; ; ; ; Among them, the function The independent variable The dimension is , ∈ , the range of the independent variable is , is the set of real numbers; the function The range of values of the independent and dependent variables is R , q is the function number; function The range of the independent variable is [0,1], and the range of the dependent variable is R, p The number of the function.
[0025] Formula (1) is the calculation principle of shallow KAN. Taking two-dimensional input variables and one-dimensional output variables as an example, the schematic diagram of the shallow KAN network structure is as follows: Figure 1 As shown, is a learnable activation function , the expression is: ; in is a B-spline curve, is the independent variable , is the number of the B-spline curve, The corresponding learnable parameters are , Used to control the overall size of the learnable activation function.
[0026] In order to generalize the network and enhance the nonlinear mapping ability of KAN, a two-dimensional univariate function matrix is used To define the KAN layer, it is proved that the KAN layer can be stacked to construct a deep KAN to fit more complex functions. The two-dimensional univariate function matrix is shown in formula (3): ; in is a two-dimensional univariate function matrix No. Line The elements of the column, Corresponding to the activation function shown in formula (2), is the input dimension of the KAN layer, is the output dimension of the KAN layer, , .
[0027] Figure 1 The KAN shown is composed of two stacked KAN layers. The input of the first KAN layer is , the output is , the second KAN layer input is and the output is .
[0028] The function of the spatial feature extraction module described in the present invention is to extract the variable features at the same time point in the sample data, and to learn the influence of the interaction between the various input weather variables at the same time point on the photovoltaic power at that time point. Since the mapping relationship between weather features and output power time is very complex, the spatial feature extraction module needs to have a strong nonlinear fitting ability to fully learn the key rules. Therefore, the present invention uses the improved deep KAN as a spatial feature extraction module, but when the number of KAN layers increases, the training efficiency of the photovoltaic output day-ahead prediction model will usually decrease. The reason is that when the number of KAN layers increases, the gradient will become smaller or even disappear as the number of layers increases, resulting in very slow parameter updates and difficulty in model convergence. To address this problem, the present invention adds a residual structure on the basis of the original deep KAN, and introduces skip connections (such as Figure 2 The skip connection shown in the spatial feature extraction module in the previous section directly adds the outputs between layers, so that the gradient can be more directly passed back to the shallower layers during the back propagation process, thereby alleviating the problem of gradient disappearance.
[0029] As an embodiment, the improved deep KAN of this embodiment uses two KAN layers (Kanlayer) and a skip connection as basic units, such as Figure 2 The basic unit shown in the spatial feature extraction module is followed by a number. n KAN layers, a total of n Basic units, this network structure is the residual structure, and the spatial feature extraction module finally outputs the result vector , whose dimension depends on the output dimension of the last KAN layer. By stacking multiple basic units, an improved deep KAN is formed. The improved deep KAN solves the problem of difficult training and can well extract the spatial relationship between input features.
[0030] The function of the time series feature extraction module is to extract the variable features at different time points in the sample data, mainly to learn the impact of weather characteristics at different time points on the output power at the current time point. Therefore, the output of the photovoltaic time series features at each time point needs to use the weather characteristics at all time points as input. The multi-head attention mechanism is combined with the improved deep KAN to build a time series feature extraction module. The specific process is as follows: (1) Use three independent two-layer KANs to map the input features to the query, key, and value vector spaces respectively, and obtain the query matrix , key matrix , value matrix : ; in The dimension is The input feature matrix is , , The dimensions of , , , The dimensions are KAN, is the number of time points of the input sample, is the input feature dimension, is the number of heads of the multi-head attention mechanism; (2) The query matrix , key matrix , value matrix The blocks are divided into columns respectively. The block matrices with the same subscript belong to the same head attention mechanism, and each head performs attention calculation independently: ; ; in is the calculation result of the g-th attention mechanism, , , They are the query matrix, key matrix, and value matrix of the g-th attention mechanism, and there are a total of G-head attention mechanisms; is the activation function, let the vector , The calculation is: ; Pair Vector Using activation functions , used to adjust the sum of each element of the vector to 1, For vector No. elements, J is the length of the vector, ; (3) Concatenate the calculation results of the multi-head attention mechanism and output the time series feature extraction results through the fully connected layer: ; ; in It is the concatenated matrix of the calculation results of the multi-head attention mechanism. is the calculation result of the G-th attention mechanism, , is the weight matrix and bias of the fully connected layer, It is the output result of the time series feature extraction module.
[0031] The function of the spatiotemporal feature fusion and predicted power output module is to fuse the temporal features extracted by the temporal feature extraction module with the spatial features extracted by the spatial feature extraction module, and output the predicted photovoltaic power value at the same time.
[0032] In order to avoid further deepening the depth of the entire model, the present invention adopts a network model structure that extracts spatial features and temporal features in parallel. Compared with the serial extraction of spatiotemporal features, parallel extraction is conducive to reducing the network depth and the difficulty of network model training. After extracting the spatiotemporal features, the extraction results are spliced and the photovoltaic output prediction results are output through the fully connected layer. The process is as follows: ; in , The output results of the spatial feature extraction module and the temporal feature extraction module are respectively, , is the weight matrix and bias of the fully connected layer, is the predicted photovoltaic power.
[0033] To implement the photovoltaic power prediction method of the photovoltaic power prediction system based on KAN, the entire photovoltaic power prediction process can be divided into historical data collection, historical data preprocessing, model offline training, model testing and real-time data collection, real-time data preprocessing, and model real-time prediction stages. The input data needs to be preprocessed before model offline training, model testing, and model real-time prediction. The data used in model offline training and model testing are historical data, while the data used in model real-time prediction is real-time data obtained from photovoltaic stations. The model can only be used for real-time prediction after passing the test requirements after offline training. The photovoltaic power prediction method based on KAN of this embodiment specifically includes the following steps: 1) Collect historical data; Historical data are obtained from the photovoltaic sites to be applied as the original data set. These data need to include weather characteristics, actual photovoltaic output power, and actual startup capacity.
[0034] 2) Data preprocessing: perform data preprocessing according to the following steps; a) Set the weather feature corresponding to the output power of 0 to 0, because the photovoltaic generator set has not started working at this time. Setting the weather feature to zero can eliminate the impact of this human factor on the model training logic.
[0035] b) Replace the missing or abnormal data points of weather characteristics and output power with the average value of two adjacent moments. If there are too many missing data points in a day (more than 20% of all data points in a day), the sample will be discarded. Abnormal data points are data points that are beyond the normal range. The data points in the normal range are provided by the photovoltaic station.
[0036] c) Different types of data have different units and values. In order to reduce the difficulty of learning data features for the photovoltaic output day-ahead prediction model, the same type of data is analyzed according to the following formula Normalization: ; in is the original dataset The u-th data in Represents data at a moment, the original data set Includes all weather forecast values and actual power values at a certain moment, U is the number of data in the original data set, and The original data sets The maximum and minimum values of the same type of data, for Normalized data values.
[0037] For power data, Take the startup capacity at that moment, Take 0.
[0038] d) Remove the data corresponding to the time when the normalized power value is greater than 1 or less than 0.
[0039] e) After the data is processed from step a) to step d), the data belonging to the same day is divided into N samples, of which H samples are training sets and m samples are test sets.
[0040] 3) Build and train a photovoltaic output day-ahead prediction model. The model training uses the data in the training set to optimize the model parameters.
[0041] The weather characteristics of the training set are input into the photovoltaic output day-ahead prediction model. The photovoltaic output day-ahead prediction model outputs the predicted photovoltaic power. The loss function value is calculated according to the following formula. With the goal of minimizing the loss function, the model parameters are updated repeatedly until the loss function no longer changes significantly: ; in, for The root mean square error, is the true output power sequence in the training set, is the first of the real output power seriesp elements, Output a prediction sequence for the model, Output prediction sequence for the model p element, is the loss function value, for and The length of the sequence.
[0042] 4) Model testing; The photovoltaic output day-ahead prediction model is tested using the data from the test set. The purpose is to evaluate the performance of the photovoltaic output day-ahead prediction model, verify the generalization ability of the photovoltaic output day-ahead prediction model on unknown data, and find out whether the photovoltaic output day-ahead prediction model is overfitting. Then, the photovoltaic output day-ahead prediction model is selected and adjusted and optimized to ensure that the performance of the photovoltaic output day-ahead prediction model in actual applications meets the requirements. It is essentially a simulation experiment that simulates the actual application effect of the photovoltaic output day-ahead prediction model.
[0043] Specifically, the weather characteristics of the test set are input into the trained photovoltaic output day-ahead prediction model, which outputs the predicted photovoltaic power, and the photovoltaic output day-ahead prediction model is evaluated by the prediction accuracy. According to national standards, the monthly average accuracy is used. (accuracy defined by national standards), monthly average pass rate Evaluation of the prediction accuracy of the photovoltaic output day-ahead prediction model:
[0044]
[0045] in is the monthly average root mean square error, for Actual power at any moment, for The photovoltaic power predicted at any moment, for Always-on capacity, Count the moments for the entire month, for Predict the qualified judgment results at all times, Equal to 1 means qualified. A value of 0 means failure.
[0046] According to national standards, the prediction accuracy of the photovoltaic output day-ahead prediction model must reach the monthly average accuracy rate. The monthly average pass rate is above 85%.
[0047] 5) Real-time data collection; The photovoltaic output day-ahead prediction model that meets the test requirements can be used in actual projects. In practical applications, it is necessary to obtain the weather characteristics of the numerical weather forecast in real time as the input of the photovoltaic output day-ahead prediction model to perform photovoltaic output prediction.
[0048] 6) Data preprocessing; Before inputting the weather characteristic data into the photovoltaic output day-ahead prediction model, the weather characteristic data needs to be processed in step 2). Normalization operation, where , The value is the same as in step 2).
[0049] 7) Real-time prediction of photovoltaic output day-ahead prediction model; The processed weather characteristics are input into the photovoltaic output day-ahead prediction model for prediction, and the initial prediction is output through model calculation. ,in Represents the day o The predicted values at each time point are 96 time points in total. Then, the initial prediction is denormalized according to the startup capacity at each moment to obtain the final power prediction value. The denormalization calculation formula is as follows: ; in For the o The final prediction result at a time point is for o Always on capacity.
[0050] As a specific embodiment, this embodiment conducts simulation experiments based on the above-mentioned system and method. The original data of the simulation comes from a photovoltaic power prediction competition. The original data of the simulation includes 66,720 data of a photovoltaic power plant from 2016 to 2018. The time interval between each data is 15 minutes, including six weather characteristic forecast values of irradiance, wind speed, wind direction, temperature, pressure, and humidity, as well as the numerical characteristics of actual power generation. After preprocessing the original data of the simulation, 66,720 data are obtained; among the 66,720 data, the data of the same day are taken as a sample, and a total of 695 samples are divided, of which 600 samples are training sets and 95 samples are test sets. Since the data set is desensitized data, the simulation experiment results shown later are all based on the data values normalized by min_max, and since the data set lacks startup capacity data, the maximum output power value in the data is taken to approximate the startup capacity at all times.
[0051] The present invention proposes an improved deep KAN to solve the problem that the original deep KAN has difficulty in training. The improved deep KAN is used as a spatial feature extraction module in the photovoltaic output day-ahead prediction model of the present invention to extract the features of the input data. In order to highlight the improvement effect, six weather feature forecast values of irradiance, wind speed, wind direction, temperature, pressure, and humidity are used as inputs of the improved deep KAN and the original deep KAN, and the predicted power is output. The loss values of the improved deep KAN and the original deep KAN in the training process are recorded as the number of iterations. Figure 3 .
[0052] from Figure 3 It can be seen that in the first round of training, the loss value of the improved deep KAN is larger than that of the original deep KAN. This may be caused by the unreasonable initial value setting of the improved deep KAN parameters, but it does not affect the final training effect. Starting from the second round of iteration, the improved deep KAN can basically converge to the optimal value, while the loss value of the original deep KAN is always maintained at a high value and cannot be further reduced. This shows that the improvement of the original deep KAN by the present invention alleviates the problem of training difficulties, so that the improved deep KAN can fit the data more accurately and quickly.
[0053] In order to highlight the powerful extraction ability of deep-level features of the improved deep KAN of the present invention, a feature ablation experiment is carried out on the existing day-ahead prediction models (long short-term memory neural network model (Long Short-Term Memory, LSTM), bidirectional long short-term memory neural network model (Bidirectional Long Short-Term Memory, BiLSTM), convolution-long short-term memory neural network model CNN-LSTM, convolution-bidirectional long short-term memory neural network model CNN-BiLSTM) and the photovoltaic output day-ahead prediction model constructed by the present invention.
[0054] The feature ablation experiment studies the influence of each input feature on the prediction results of the model by increasing or decreasing the input features, and then reflects the ability of each model to extract different input features. The following formula is used to calculate the Pearson correlation coefficient and Spearman correlation coefficient between the output power and each input variable, screen the effective input features, and further distinguish the shallow and deep features as different input schemes to evaluate the model's ability to extract input features at different levels. The calculation results are shown in Table 1. The Spearman correlation coefficients of each input feature are greater than or close to 0.8, indicating that each feature is a valid input feature, and in theory, it can play a role in improving the prediction accuracy; however, the Pearson correlation coefficient has a large difference, and the higher the Pearson correlation coefficient value, the higher the linear correlation between the input feature and the output power, the shallower the level, and the easier it is to be extracted by the model. Therefore, the Pearson correlation coefficient is used as the judgment standard to divide the input features into four parts according to the depth of the level: shallow input features (irradiance), ordinary input features (temperature, pressure), deeper input features (wind direction), and deep input features (wind speed, humidity). The corresponding four input feature schemes are as follows: Solution 1: Only shallow input features are used as input variables of the model; Solution 2: Use shallow input features and common input features as model input variables; Solution 3: Use shallow input features, common input features, and deeper input features as model input variables; Solution 4: Use shallow-level input features, ordinary input features, deeper-level input features, and deep-level input features as model input variables.
[0055] The Pearson correlation coefficient and Spearman correlation coefficient of each input variable are calculated using the following formula: ; in For variables X and Y Pearson correlation coefficient, and The variables are X and Y The sample mean of and The variables are X and Y No. samples, and E is the number of samples.
[0056] variable X and variables Y Spearman correlation coefficient for: ; in is the corresponding rank difference, is a variable X Middle The rank of the samples, is a variable Y Middle The rank of the samples, E is the number of samples.
[0057] Table 1 Calculation results of weather characteristics and output power correlation characteristics
[0058] The trained photovoltaic output day-ahead prediction model is used to make predictions on the test set. The evaluation index calculation results of the experimental results of the above four schemes are shown in Table 2. The change rate refers to the difference between the current solution and the previous solution in the same model. The rate of change of feature input is to add features from shallow to deep, so it can be The rate of change is used to reflect the change in the model's feature extraction capability.
[0059] Table 2. Feature ablation experimental results
[0060] The bold words in Table 2 represent the optimal indicators of all models in this scheme. Since the CNN-LSTM model, CNN-BiLSTM model and the model of the present invention are all models for multiple input features, and scheme one has only one input feature, scheme one only experiments on the BiLSTM model and the LSTM model.
[0061] 1) Monthly average root mean square error from scheme 1 to scheme 4 It can be seen that the performance of the models of the present invention is the best, which shows that when the input features are the same, the model of the present invention has a stronger feature extraction ability than the existing models (LSTM model, BiLSTM model, CNN-LSTM model, CNN-BiLSTM model), and can better learn the potential rules between input features and output power, thereby achieving higher prediction accuracy.
[0062] 2) From the adjacent schemes From the perspective of the rate of change, when the model of the present invention adds new effective features, When changing from Scheme 2 to Scheme 3, the performance of LSTM model and CNN-BiLSTM model is improved. The BiLSTM model remains unchanged. The deterioration indicates that the three cannot effectively extract the newly added input features; although the CNN-LSTM model The change rate is better than the model of the present invention, but When changing from Scheme 3 to Scheme 4, the deepest features are added, the LSTM model index optimization is not obvious, and the CNN-LSTM model and CNN-BiLSTM model appear The deterioration of the situation indicates that the three methods are not capable of extracting the deep-level features; and the model of the present invention The optimization degree is the highest, which shows that the model of the present invention has a strong ability to extract the new deepest input features. The optimization range is the largest, which shows that the model of the present invention has a strong feature extraction capability, which is also one of the key factors for the highest prediction accuracy of the model designed by the present invention.
[0063] Figure 4 The figure shows the prediction results of the power values of each model on a typical day in the test set using Scheme 4, which allows you to see the prediction effect more intuitively.
[0064] The model of the present invention is trained by using scheme 4 as input features, and the trained model is tested with samples from three months in the 95 samples of the test set to obtain the monthly average accuracy of the model of the present invention ( )、Monthly average pass rate( ) As shown in Table 3, it is obvious that the model of the present invention can meet the requirements of national industry standards after training.
[0065] Table 3 Model test results
[0066] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well.
Claims
1. A photovoltaic power prediction method based on KAN, characterized in that: The following steps are involved: 1) Collect the startup capacity values, weather forecasts and actual power data of the photovoltaic power station as the original data set, preprocess the data of the original data set, and divide it into a training set and a test set; 2) Construct a photovoltaic output day-ahead prediction model and train the photovoltaic output day-ahead prediction model; 3) Test and evaluate the trained photovoltaic output day-ahead prediction model; 4) Use the photovoltaic output day-ahead prediction model to predict photovoltaic power.
2. A photovoltaic power prediction method based on KAN according to claim 1, characterized in that: In step 1), the data preprocessing of the original data set includes the following steps: a) Set the weather characteristics corresponding to the output power of 0 to 0; b) Replace the data points where weather characteristics and output power are missing or outside the normal range with the average value of two adjacent moments; c) Perform the following operations on the same type of data respectively: Normalization: ; in is the original dataset The u-th data in Represents data at a moment, the original data set It includes all the startup capacity values, weather forecasts and actual power data at a certain moment. U is the number of data in the original data set. and The original data sets The maximum and minimum values of the same type of data, for Normalized data value; d) Remove the data corresponding to the time when the normalized power value is greater than 1 or less than 0; e) Take the data of the same day as a sample, divide the data processed by steps a) to d) into 600-1200 samples, and divide the samples into training set and test set according to the proportion.
3. The photovoltaic power prediction method based on KAN according to claim 1, characterized in that: In step 2), the photovoltaic output day-ahead prediction model includes a spatial feature extraction module, a temporal feature extraction module, a spatiotemporal feature fusion and predicted power output module; the spatial feature extraction module and the temporal feature extraction module extract features in parallel, and the extracted features are input into the spatiotemporal feature fusion and predicted power output module to output the photovoltaic power prediction result.
4. The photovoltaic power prediction method based on KAN according to claim 3 is characterized in that: The spatial feature extraction module includes an improved deep KAN, which includes a plurality of basic units, the plurality of basic units are connected in sequence, and each basic unit is composed of two stacked KAN layers and a skip connection; The spatial feature extraction module finally outputs the result vector.
5. The photovoltaic power prediction method based on KAN according to claim 4, characterized in that: The temporal feature extraction module combines the multi-head attention mechanism with KAN, specifically including: (1) Use three independent two-layer KANs to map the input features to the query, key, and value vector spaces respectively, and obtain the query matrix , key matrix , value matrix : ; in The dimension is The input feature matrix is , , The dimensions of , , , The dimensions are KAN, is the number of time points of the input sample, is the input feature dimension, is the number of heads of the multi-head attention mechanism; (2) The query matrix , key matrix , value matrix The blocks are divided by columns. The block matrices with the same subscript belong to the same attention mechanism, and each head performs attention calculation independently: ; ; in is the calculation result of the g-th attention mechanism, , , They are the query matrix, key matrix, and value matrix of the g-th attention mechanism, and there are a total of G-head attention mechanisms; is the activation function, is a matrix, It means Operate on each row vector of A row vector is ,but The calculation is: ; Pair Vector Using activation functions , used to adjust the sum of each element of the vector to 1, For vector No. elements, is the vector length, ; (3) Concatenate the calculation results of the multi-head attention mechanism and output the time series feature extraction results through the fully connected layer: ; ; in It is the concatenated matrix of the calculation results of the multi-head attention mechanism. is the calculation result of the G-th attention mechanism, , is the weight matrix and bias of the fully connected layer, It is the output result of the time series feature extraction module.
6. The photovoltaic power prediction method based on KAN according to claim 3, characterized in that: The spatiotemporal feature fusion and predicted power output module combines the extraction results of the spatial feature extraction module and the temporal feature extraction module, and outputs the photovoltaic power prediction result through the fully connected layer: ; in , The output results of the spatial feature extraction module and the temporal feature extraction module are respectively, , is the weight matrix and bias of the fully connected layer, is the predicted photovoltaic power.
7. The photovoltaic power prediction method based on KAN according to claim 1, characterized in that: In step 2), the training of the photovoltaic output day-ahead prediction model includes: The weather characteristics of the training set are input into the photovoltaic output day-ahead prediction model. The photovoltaic output day-ahead prediction model outputs the predicted photovoltaic power. The loss function value is calculated according to the following formula. With the goal of minimizing the loss function, the model parameters are updated repeatedly until the loss function no longer changes significantly: ; in, for The root mean square error, is the true output power sequence in the training set, is the first of the real output power series p elements, Output a prediction sequence for the model, Output prediction sequence for the model p element, is the loss function value, P is and The length of the sequence.
8. The photovoltaic power prediction method based on KAN according to claim 1, characterized in that: In step 3), the photovoltaic output day-ahead prediction model test includes: The weather characteristics of the test set are input into the trained photovoltaic output day-ahead prediction model, and the photovoltaic output day-ahead prediction model outputs the predicted photovoltaic power. The prediction accuracy of the photovoltaic output day-ahead prediction model is evaluated by the evaluation index: in is the monthly average root mean square error, for Actual power at any moment, for The photovoltaic power predicted at any moment, for Always-on capacity, Count the moments for the entire month, is the monthly average accuracy, is the monthly average pass rate, for Predict the qualified judgment results at all times, Equal to 1 means qualified. A value of 0 means failure.
9. The photovoltaic power prediction method based on KAN according to claim 1, characterized in that: In step 4), predicting the photovoltaic output on the day to be predicted specifically includes the following steps: 41) Collect real-time weather forecast data for the day to be predicted; 42) The real-time weather forecast data is preprocessed as described above; 43) Input the pre-processed weather characteristic data into the photovoltaic output day-ahead prediction model that meets the test requirements, and obtain the initial prediction through model calculation ,in Represents the day o The predicted value at each time point; 44) According to the startup capacity at each moment, the initial prediction output is denormalized to obtain the final power prediction value, denormalized calculation: ; in For the o The final prediction result at a time point is for o Always on capacity.
10. A system for implementing a photovoltaic power prediction method based on KAN according to any one of claims 1 to 9, characterized in that: It includes a photovoltaic output day-ahead prediction model, which includes a spatial feature extraction module, a temporal feature extraction module, a spatiotemporal feature fusion and a power output prediction module; The spatial feature extraction module is used to extract the spatial features of variables at the same time point in the sample data; The time series feature extraction module is used to extract the time series features of variables at different time points in the sample data; The function of the spatiotemporal feature fusion and predicted power output module is to fuse the spatial feature with the temporal feature and output the predicted photovoltaic power.
Citation Information
Patent Citations
Wind-light-load power short-term prediction method based on multi-task progressive learning
CN117421971A
New frame photovoltaic power prediction method and system, and computer readable storage medium
CN118586442A
Wind power prediction method and device based on interpretability and model fusion
CN118713065A
Photovoltaic power ultra-short-term prediction method and system based on itransfomer
CN119312054A
Cited By
Power load prediction method based on dual-channel cross attention network
CN119669732A
A Power Load Forecasting Method Based on a Dual-Channel Cross-Attention Network
CN119669732B
Att-KAN neural network model-based sound velocity distribution forecasting method
CN119918581A
Short-term load prediction method and system based on trending and seasonal modeling
CN120222324A