A Maximum Load Capacity Prediction Method Based on EMD-KPCA-Improved BP Neural Network
Through EMD-KPCA-improving BP neural network method, combined with LSTM and BP neural network, the shortcomings of traditional load prediction methods in nonlinear changes and emergencies are solved, and more accurate prediction of the maximum load volume of the power system is achieved.
Patent Information
- Application Number
- CN202510131931.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-02-06
AI Technical Summary
Traditional load prediction methods rely on historical data and linear models, and are difficult to adapt to the rapid changes in power demand and uncertainty of new energy access, especially when dealing with nonlinear changes and emergencies.
EMD-KPCA-improved BP neural network method is adopted to perform data preprocessing through EMD decomposition and linear core KPCA analysis, and combined with LSTM and BP neural network for training, to build a nested power load prediction model, and obtain basic data in real time for maximum load prediction.
It improves the accuracy of the prediction of maximum power load data, can effectively handle nonlinear changes and emergencies, provides more accurate data preprocessing and rich fitted data sets, and improves the prediction accuracy of maximum load data of the power system.
Smart Images

Figure CN120124786B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and in particular to a maximum load prediction method based on an EMD (Empirical Mode Decomposition)-KPCA (Kernel Principal Component Analysis)-improved BP (Back Propagation) neural network. Background Art
[0002] Power load forecasting is a crucial component of power system planning and operation, playing an irreplaceable role in ensuring safe, stable, and economical operation. Accurate load forecasting can help grid operators rationally schedule generator starts and stops, ensuring sufficient reserve capacity to respond to emergencies at various times, thereby maintaining the continuity and stability of power supply. Load forecasting forms the foundation for generation scheduling decisions and promotes the orderly development of the power market.
[0003] Since renewable energy sources such as wind and solar energy are highly intermittent and volatile, traditional load forecasting methods rely on historical data and linear models. Their performance is limited when dealing with nonlinear changes and emergencies. They are unable to adapt to the rapid changes in current electricity demand and the uncertain load forecasting requirements of new energy access. Traditional load forecasting can no longer meet actual needs. Summary of the Invention
[0004] In view of the above analysis, an embodiment of the present invention aims to provide a maximum load prediction method based on EMD-KPCA-improved BP neural network to solve the technical problems that traditional load forecasting methods rely on historical data and linear models, have limited performance when dealing with nonlinear changes and emergencies, and are difficult to adapt to the rapid changes in power demand and the uncertainty of new energy access.
[0005] The purpose of the present invention is mainly achieved through the following technical solutions:
[0006] The present invention provides a maximum load prediction method based on EMD-KPCA-improved BP neural network, comprising the following steps:
[0007] Obtain basic data and corresponding maximum load data affecting the power system load in a region over multiple historical periods, perform data preprocessing including EMD decomposition and linear kernel KPCA analysis, and generate a first training sample set based on the preprocessed basic data and maximum load data;
[0008] Training the LSTM network using the first training sample set, obtaining predicted values of each variable in the basic data and the corresponding maximum load data for a future time period using the trained LSTM network, and sequentially performing inverse linear kernel KPCA analysis and EMD decomposition processing on the predicted values for the future time period to obtain predicted basic data and maximum load data;
[0009] The basic data affecting the power system load during the historical period and the corresponding maximum load data are combined with the predicted basic data and maximum load data to generate a second training sample set; the BP neural network is trained using the second training sample set to obtain a trained power load prediction model; wherein the power load prediction model is a BP neural network with a nested LSTM network;
[0010] The basic data affecting the load of the power system in the region is obtained in real time and input into the trained power load prediction model to obtain the predicted value of the maximum load data of the regional power system.
[0011] Furthermore, EMD data preprocessing is performed on each variable of the basic data and maximum load data in each historical period, including:
[0012] The first step is to define the m historical data of each variable as the original time series x(t), the residual component r0(t) = x(t), and initialize the number of iterations i = 1;
[0013] Step 2: In each iteration, after extracting an IMF from the current residual component, the current residual component is updated to the residual component after the previous iteration minus the currently extracted IMF;
[0014] Step 3: Find the current residual component r i-1 All local maximum and local minimum points in (t);
[0015] The fourth step is to use the cubic spline interpolation method to fit all the local maximum and local minimum points of the current residual component to obtain the upper envelope e max (t) and the lower envelope e min (t), calculate the average value of the upper and lower envelopes
[0016] Step 5: Subtract the average value of the upper and lower envelopes from the current residual component to obtain the component h i (t) = r i-1 (t)-m i (t); if the component h i (t) satisfies the preset conditions, then it is taken as the i-th IMF component c i(t), otherwise it will be regarded as a new residual component and steps 2 to 5 will be repeated until the i-th IMF component is obtained;
[0017] Step 6: Update the residual component r based on the obtained i-th IMF component i (t) = r i-1 (t)-c i (t); if r i If (t) is not a monotonic function or a constant, then i = i + 1 and return to the second step to continue processing. Otherwise, the EMD decomposition process is stopped and the m data in each historical period of each variable are expressed as the sum of p IMF components and the residual signal of the last iteration. as the IMF component for each variable in each historical period;
[0018] For the basic data and the n variables corresponding to the maximum load data in each historical period, each containing m data, they are decomposed by EMD to obtain p×n×m IMF components.
[0019] Furthermore, a linear kernel KPCA analysis is performed on the p×n×m IMF components, including:
[0020] For p×n×m IMF variables as sample points C=[c1,c2,...c pnm ], construct the kernel matrix K of the sample point, whose matrix elements K ij Expressed as K ij =C T *C=k(c i , c j );
[0021] Construct a centralized kernel matrix K′=HKH, where I is the identity matrix, B is the all-1 vector;
[0022] Perform eigenvalue decomposition on the centralized kernel matrix K′ to obtain eigenvalues λ1, λ2, ...λ N and its corresponding eigenvectors α1, α2, ..., α n ;
[0023] Select the first k largest eigenvalues and corresponding eigenvectors as principal components, and obtain the principal component values after projection into the principal component space. Among them, α j is the eigenvector corresponding to the jth principal component, λ j is the corresponding eigenvalue, c new is a sample point in C.
[0024] Furthermore, the principal component values corresponding to the basic data and the principal component values corresponding to the maximum load data are used as labels to form sample data, and all the sample data form a first training sample set.
[0025] Furthermore, the LSTM network is trained using the first training sample set, including:
[0026] Initialize the weights and biases of the LSTM network;
[0027] Input the principal component value corresponding to each historical data in the first training sample set into the LSTM network to obtain a predicted value, and compare it with the corresponding true value in the first training sample set to construct a loss function;
[0028] Perform gradient descent training and perform weight and bias updates;
[0029] When the loss function is less than the first preset value, the iteration is stopped, and the weight matrix and bias vector values of the input gate, forget gate, and output gate are determined to obtain a trained LSTM network.
[0030] Furthermore, in the process of training the BP neural network using the second training sample set, an adaptive weighted composite loss function is used as follows:
[0031]
[0032]
[0033] L total =μ1L1+μ2L2;
[0034] Among them, x m,i is the i-th true value, z 2,i is the i-th predicted value, f is the number of samples in the second training sample set, μ1 and μ2 are the adaptive weights of the two loss functions L1 and L2 respectively.
[0035] Furthermore, after each iteration of training the BP neural network, μ1 and μ2 are updated as follows:
[0036]
[0037] is the adaptive weight of the L1 function at the tth iteration, is the L1 loss function value at the tth iteration, is the L2 loss function value at the tth iteration; is the adaptive weight value of the L1 function at the t+1th iteration, is the adaptive weight value of the L2 function at t+1 iteration;
[0038] After each iterative update, calculate the total loss value L in the current iteration process total .
[0039] Furthermore, during each iteration of training the BP neural network, weights and biases are updated as follows:
[0040]
[0041]
[0042] Where η is the learning rate, W1 and W′1 are the weight matrices before and after the update from the input layer to the hidden layer, W2 and W′2 are the weight matrices before and after the update from the hidden layer to the output layer, b1 is the bias vector of the hidden layer, and b2 is the bias vector of the output layer.
[0043] Furthermore, the loss function of the LSTM network is as follows:
[0044]
[0045] Among them, c is the sample data size, y zs,i is the i-th true value, h t,i is the corresponding i-th predicted value, δ is the threshold parameter;
[0046] The threshold parameter δ is determined using the quantile method.
[0047] Furthermore, the preset conditions include: within the m data of each variable of the basic data and the maximum load data, the number of the local maximum points and the number of the minimum points and the number of zero-crossing points are equal to or differ by at most one, and the average values of the upper envelope formed by the local maximum points and the lower envelope formed by the local minimum points are zero at any time.
[0048] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0049] 1. By combining EMD, KPCA and improved BP neural network, the present invention can effectively handle nonlinear changes and emergencies, and improve the accuracy of maximum power load data prediction;
[0050] 2. It provides a more accurate data preprocessing method. Through EMD decomposition as the first data preprocessing method and KPCA dimensionality reduction as the second data preprocessing method, the idea of dimensionality increase and dimensionality reduction of the original data is applied to maximize the screening of heterogeneous characteristics of the data and relevant historical data that has the most significant impact on the dependent variable. It can effectively extract key features from multivariate data, remove redundant information and noise, reduce the dimensionality of the data, and retain the main information, providing a more refined data foundation for subsequent prediction steps.
[0051] 3. An improved BP neural network prediction model is provided. By nesting the LSTM network in the BP neural network for prediction, various factors affecting the power load are comprehensively considered, a richer fitting data set is provided, and the prediction accuracy of the power load prediction model for the maximum load data of the power system is improved.
[0052] In the present invention, the above-mentioned technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of the present invention will be described in the following description, and some advantages will become apparent from the description or be learned through practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like parts throughout the drawings.
[0054] Figure 1 This is a flow chart of a maximum load prediction method based on EMD-KPCA-improved BP neural network in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, and are not used to limit the scope of the present invention.
[0056] Compared with the existing methods, the present invention first adds preprocessing of the original data to determine the data in the historical data of each influencing factor that significantly affects the change of power load. Secondly, it uses an improved BP neural network to take into account the impact of each influencing factor on the power load, thereby improving the accuracy of power load prediction.
[0057] A specific embodiment of the present invention discloses a maximum load prediction method based on EMD-KPCA-improved BP neural network, comprising the following steps:
[0058] Step S1, obtaining basic data affecting the power system load and corresponding maximum load data in a region over multiple historical periods and performing data preprocessing including EMD decomposition and linear kernel KPCA analysis in sequence, and generating a first training sample set based on the preprocessed basic data and maximum load data;
[0059] Step S2: using the first training sample set to train the LSTM network, using the trained LSTM network to obtain the predicted value of each variable in the basic data and the corresponding maximum load data in the future time period, and performing inverse linear kernel KPCA analysis and EMD decomposition processing on the predicted values of the future time period in turn to obtain the predicted basic data and maximum load data;
[0060] Step S3: generating a second training sample set by combining the basic data affecting the power system load and the corresponding maximum load data during the historical period with the predicted basic data and maximum load data; training a BP neural network using the second training sample set to obtain a trained power load prediction model; wherein the power load prediction model is a BP neural network with a nested LSTM network;
[0061] Step S4: acquiring in real time the basic data affecting the load of the power system in the region and inputting it into the trained power load prediction model to obtain the predicted value of the maximum load data of the regional power system.
[0062] Step S1 includes steps S11-S14.
[0063] Step S11: Obtain basic data affecting the power system load and corresponding maximum load data in a region during multiple historical periods.
[0064] Determine the basic data and corresponding maximum load data that affect the load conditions of the regional power system over multiple historical periods. The basic data includes short-term climate change characteristics and long-term climate change characteristics within the same specific time period t.
[0065] Short-term climate change characteristics are climate characteristics that affect the load of the power system, specifically including the highest temperature, lowest temperature, average temperature, highest humidity, lowest humidity and average humidity in the same time period as the maximum load data in the historical period;
[0066] Long-term change characteristics are characteristics that affect the load in the same time period as the maximum load data in the historical period, for example, the total industrial output value and the installed capacity of power plants.
[0067] Obtain basic data for multiple time periods in a certain area, as well as the corresponding maximum load data.
[0068] The above data are derived from the National Bureau of Statistics, local statistical bureaus, the National Energy Statistical Yearbook, local energy statistical yearbooks, and data published by the National Meteorological Administration or local meteorological bureaus.
[0069] Maximum load data within the historical period, obtained from the National Bureau of Statistics, the National Energy Statistical Yearbook, and the regional statistical bureau or the regional energy statistical yearbook;
[0070] The maximum temperature, minimum temperature, average temperature, maximum humidity, minimum humidity and average humidity of the region during the same period of time were obtained from the National Meteorological Service or the meteorological bureau of the region;
[0071] The total industrial output value and installed power generation capacity of the region in the same period were obtained from the National Bureau of Statistics, the National Energy Statistical Yearbook, and the regional statistical bureau or the regional energy statistical yearbook.
[0072] Assume that this step ultimately obtains basic data and corresponding maximum load data totaling n variables, and each variable contains m data.
[0073] In the present invention, the obtained n-1 basic data are illustratively 8 as shown in Table 1.
[0074] The basic data obtained above can be expanded or deleted according to the needs of the research.
[0075] The maximum load data corresponding to the basic data also includes the corresponding m pieces of data within a historical period.
[0076] Table 1: Example of obtaining basic data and corresponding maximum load data for n variables
[0077]
[0078] The function of step S11 is to collect and determine the basic data and corresponding maximum load data in the historical period that affects the load of the power system, and provide a data basis for subsequent data preprocessing and training of the power load prediction model.
[0079] Next, data preprocessing is performed on the acquired basic data and the n variables corresponding to the maximum load data, including the first data preprocessing (EMD data preprocessing in step S12) and the second data preprocessing (principal component analysis data preprocessing in step S13).
[0080] In step S12, the basic data affecting the power system load and the corresponding maximum load data determined in step S11 are subjected to EMD decomposition for the data set containing m (m ≥ 1) historical data for each variable, and the first data preprocessing is performed.
[0081] The purpose of the first data preprocessing is to disassemble the above-mentioned basic data and the m historical data of each variable corresponding to the maximum load data, so that the historical data of each variable can be decomposed into p IMF (Intrinsic Mode Function) components, so as to facilitate the second data preprocessing of principal component analysis in step S13.
[0082] Illustratively, p≥5.
[0083] The EMD data preprocessing is performed on each variable of the basic data and maximum load data in each historical period, including:
[0084] The first step is to define the m historical data of each variable as the original time series x(t), the residual component r0(t) = x(t), and initialize the number of iterations i = 1;
[0085] Step 2: In each iteration, after extracting an IMF from the current residual component, the current residual component is updated to the residual component after the previous iteration minus the currently extracted IMF;
[0086] Step 3: Find the current residual component r i-1 All local maximum and local minimum points in (t);
[0087] The fourth step is to use the cubic spline interpolation method to fit all the local maximum and local minimum points of the current residual component to obtain the upper envelope e max (t) and the lower envelope e min (t), calculate the average value of the upper and lower envelopes
[0088] Step 5: Subtract the average value of the upper and lower envelopes from the current residual component to obtain the component h i (t) = r i-1 (t)-m i (t); if the component h i (t) satisfies the preset conditions, then it is taken as the i-th IMF component c i (t), otherwise it will be regarded as a new residual component and steps 2 to 5 will be repeated until the i-th IMF component is obtained;
[0089] Step 6: Update the residual component r based on the obtained i-th IMF component i (t) = r i-1 (t)-c i (t); if r i If (t) is not a monotonic function or a constant, then i = i + 1 and return to the second step to continue processing. Otherwise, the EMD decomposition process is stopped and the m data in each historical period of each variable are expressed as the sum of p IMF components and the residual signal of the last iteration. as the IMF component for each variable in each historical period;
[0090] For the basic data and the n variables corresponding to the maximum load data in each historical period, each containing m data, they are decomposed by EMD to obtain p×n×m IMF components.
[0091] The first step is to be specific.
[0092] Each variable contains m (m ≥ 1) historical data sets for EMD decomposition. Taking the first variable (e.g., average temperature) as an example, let the m data sequence be x(t), let the initial residual component r0(t) = x(t), and initialize the number of iterations;
[0093] At the beginning of EMD decomposition, the residual component is equal to the original data sequence, and x(t) is the time series data of the original data.
[0094] In the EMD decomposition process, the residual component represents the residual component after extracting an intrinsic mode function, which contains the original data that has not been decomposed and combines all parts of the original data that have not been extracted as IMF.
[0095] The second step is to be specific.
[0096] In each iteration, after extracting an IMF from the current residual component, the updated residual component is the current residual component minus the newly extracted IMF, as shown in formula (1):
[0097] r i-1 (t) = r i-2 (t)-IMF i-1 Formula (1);
[0098] Among them, r i-1 (t) is the current residual component, r i-2 (t) is the residual component of the i-2th iteration, IMF i-1 is the IMF extracted in the current iteration.
[0099] The significance of the residual component in EMD decomposition is that it allows complex nonlinear and non-stationary time series data to be decomposed into a series of simple IMF components with different frequencies. These IMF components can be analyzed independently and can also be used for further data processing and analysis. The residual component is an intermediate product in the EMD decomposition process and is updated with each IMF extraction until the decomposition process is completed.
[0100] The third step is to be specific.
[0101] For the current residual component r i-1 (t), find all local maximum and local minimum points.
[0102] For example, this is achieved using the built-in findpeaks function in Matlab. The code is as follows:
[0103] % Assume that the signal data is x(t) and the time axis is t
[0104] t(1:500);% time axis
[0105] x(t)=fault_data(:,1);%
[0106] x(t)=x(t)(1:500,:)′; % Ensure that x(t) is a row vector
[0107] This code first defines the time axis t and signal data x(t), and then calls the findpeaks function to obtain the indices of local maximum and local minimum points respectively.
[0108] Among them, for the local minimum point, the problem is converted into solving the local maximum point by negating the signal.
[0109] % Solve local maximum and local minimum points
[0110] [~, indmax] = findpeaks(x(t)); % local maximum point index
[0111] [~, indmin] = findpeaks(-x(t)); % local minimum point index
[0112] Step 4: Be specific.
[0113] Use the cubic spline interpolation method to fit all the local maximum and local minimum points of the current residual signal respectively, and obtain the upper envelope e max (t) and the lower envelope e min (t).
[0114] For example, it is implemented by the spline function in Matlab. The code is as follows:
[0115] %Cubic spline interpolation fitting (including endpoints)
[0116] s_max=spline([1,indmax,length(y)],[y(1),y(indmax),y(end)],1:length(y)); % Upper envelope code
[0117] s_min=spline([1,indmin,length(y)],[y(1),y(indmin),y(end)],1:length(y)); % Code for the lower envelope
[0118] The first parameter of the spline function is a vector containing the indices of all points involved in the interpolation; the second parameter is the corresponding signal value; and the third parameter specifies the time axis on which the interpolation result is to be calculated.
[0119] Finally, the average of the upper and lower envelopes is calculated.
[0120] Step 5. Be specific.
[0121] Determine the component h obtained by subtracting the average value of the upper and lower envelopes from the current residual component i (t), whether the preset conditions are met, determine whether to repeat steps 2 to 5 to further decompose the IMF components.
[0122] The preset conditions include: within each variable of the basic data and m data of the maximum load data, the number of the local maximum points and the number of the minimum points and the number of zero-crossing points are equal to or differ by at most one, and the average values of the upper envelope formed by the local maximum points and the lower envelope formed by the local minimum points are zero at any time.
[0123] The average values of the upper envelope formed by the local maximum and the lower envelope formed by the local minimum are both zero at any time, that is, the upper and lower envelopes are locally symmetric about the time axis.
[0124] Step 6. Specifically.
[0125] When the remaining residual component r n When (t) is a monotonic function or a constant, the EMD decomposition ends.
[0126] At this time, the m data of the first variable are expressed as the sum of p IMF components and the final residual component, as follows:
[0127]
[0128] Repeat the process from the first step to the sixth step for n variables to obtain m data in each of the n variables. The sum of the p IMF components decomposed by the EMD of the m data plus the final residual signal is the result of EMD decomposition for each variable.
[0129] After EMD decomposition, corresponding to n variables, p×n×m components are obtained.
[0130] The purpose of step S12 is to decompose the historical data of each variable of the basic data and the corresponding maximum load data into multiple simple IMF components. Each variable is represented as the sum of multiple IMF components and the final residual component for subsequent principal component analysis (KPCA). This decomposition helps to explain the inherent patterns and trends in the data and provide a more refined data basis for maximum load prediction.
[0131] Step S13: Perform a second data preprocessing on the data after EMD decomposition using the linear kernel KPCA (kernel principal component analysis) method.
[0132] The data after EMD decomposition are mapped to a high-dimensional space, and then a linear kernel KPCA analysis is performed in the high-dimensional space to determine the component values that significantly affect the historical daily maximum load data among the p×n×m components obtained after EMD decomposition.
[0133] Perform linear kernel KPCA analysis on the p×n×m IMF components, including:
[0134] For p×n×m IMF variables as sample points C=[c1,c2,...c pnm ], construct the kernel matrix K of the sample point, whose matrix elements K ij Expressed as K ij =C T *C=k(c i , c j );
[0135] Construct a centralized kernel matrix K′=HKH, where I is the identity matrix, B is the all-1 vector;
[0136] Perform eigenvalue decomposition on the centralized kernel matrix K′ to obtain eigenvalues λ1, λ2, ...λ N and its corresponding eigenvectors α1, α2, ..., α n ;
[0137] Select the first k largest eigenvalues and corresponding eigenvectors as principal components, and obtain the principal component values after projection into the principal component space. Among them, α j is the eigenvector corresponding to the jth principal component, λ j is the corresponding eigenvalue, c new is a sample point in C.
[0138] The element K of the kernel matrix K ij It can be expressed as K ij =C T *C=k(c i , c j ), that is, the sample matrix C and its transpose C T The result of multiplication is: Apply K′=HKH to realize the centering of the kernel matrix.
[0139] Perform eigenvalue decomposition on the centralized kernel matrix K′. Find all eigenvalues of K′ and their corresponding eigenvectors. These eigenvectors will be used in the subsequent dimensionality reduction process. Obtain eigenvalues λ1, λ2, ...λ N and its corresponding eigenvectors α1, α2, ..., α n .
[0140] Specifically, the following system of equations is solved: K′α=λα, which can be solved by using existing library functions, such as numpy.linalg.eigh or scipy.linalg.eigh in Python, where α is the eigenvector and λ is the corresponding eigenvalue.
[0141] According to the order of the eigenvalues, the eigenvectors corresponding to the first k largest eigenvalues are selected as principal components. This model sets all eigenvalues that can explain 95% of the variation in the data as principal components.
[0142] In the linear kernel KPCA principal component analysis, the value of k depends on the cumulative explained variance of the data. For example, the general steps to determine the value of k are:
[0143] (1) Calculate eigenvalues: Perform eigenvalue decomposition on the kernel matrix to obtain a series of eigenvalues.
[0144] (2) Cumulative contribution rate: Calculate the cumulative contribution rate of the variance of each eigenvalue. This is usually achieved by dividing each eigenvalue by the sum of all eigenvalues.
[0145] (3) Cumulative contribution rate: Starting from the largest eigenvalue, the variance contribution rate of each eigenvalue is accumulated until the cumulative contribution rate reaches or exceeds 95%.
[0146] (4) Determine the k value: The serial number corresponding to the last eigenvalue used in the accumulation process is the k value.
[0147] For example, if the cumulative variance contribution of the first three largest eigenvalues is 90%, and the cumulative variance contribution of the first four eigenvalues is 96%, then the value of k should be 4, because this is the smallest integer that makes the cumulative variance contribution reach 95%.
[0148] In practical applications, the value of k may vary from 2 to 10 or more, depending on the characteristics of the dataset and the degree of information retention required. It is usually necessary to determine the most appropriate value of k by calculating and comparing the cumulative variance contribution rate under different k values.
[0149] The basic data and the corresponding maximum load data are divided into n variables. Each variable contains m data. After EMD decomposition, the total p×n×m IMF components are projected into the kernel function. new , and its value after projection in the principal component space is Among them, α j is the eigenvector corresponding to the jth principal component, λ j is the corresponding eigenvalue.
[0150] Step S14: Generate a first training sample set using the preprocessed basic data and maximum load data.
[0151] The principal component values corresponding to the basic data and the principal component values corresponding to the maximum load data are used as labels to form sample data, and all the sample data form a first training sample set.
[0152] The first training sample set is used to train the LSTM network, with 70% of the sample set used as the training set and 30% used as the test set.
[0153] The function of step S1 is to collect and preprocess historical data that affect the load of the power system, including climate characteristics, economic characteristics and maximum load data, and extract key features through the EMD-KPCA method to prepare the first training sample set for building the power load forecasting model.
[0154] Step S2, specifically.
[0155] First, build an LSTM network. The LSTM network consists of three gates: forget gate, input gate, output gate, and a cell state.
[0156] The forget gate determines which information should be discarded as follows:
[0157] f t =sigmoid(W1*[h t-1 , x t ]+b1) formula (3);
[0158] Among them, f t is the output of the forget gate, W1 is the weight matrix of the forget gate output data, b1 is the bias vector of the forget gate output data, h t-1 is the hidden state at the previous moment, x t is the current input.
[0159] The input gate determines what new information should be added to the cell state. The formula consists of two parts: the activation value of the input gate, as follows:
[0160] i t =sigmoid(W2*[h t-1 , x t ]+b2) Formula (4);
[0161] Among them, i t is the activation value, W2 is the weight matrix of the activation value, and b2 is the bias vector of the activation value.
[0162] The new candidate values are as follows:
[0163] C′ t =tanh(W3*[h t-1, x t ]+b3) Formula (5);
[0164] Among them, C′ t is the new candidate value, W3 is the weight matrix of the new candidate value, and b3 is the bias vector of the new candidate value.
[0165] The updated value of the cell state is as follows:
[0166] C t =f t *C t-1 +i t *C t Formula (6);
[0167] Among them, C t The updated value of the cell state.
[0168] The output gate determines which part of the cell state is output, as follows:
[0169] o t =sigmoid(W4*[h t-1 , x t ]+b4) Formula (7);
[0170] Among them, t is the cell state output by the output gate, W4 is the weight matrix of the cell output state, and b4 is the bias vector of the cell output state.
[0171] The final output value is as follows:
[0172] h t =o t *tan h(C t ) formula (8);
[0173] Among them, h t is the output value of the LSTM model.
[0174] Training the LSTM network using the first training sample set includes:
[0175] Initialize the weights and biases of the LSTM network;
[0176] Input the principal component value corresponding to each historical data in the first training sample set into the LSTM network to obtain a predicted value, and compare it with the corresponding true value in the first training sample set to construct a loss function;
[0177] Perform gradient descent training and perform weight and bias updates;
[0178] When the loss function is less than the first preset value, the iteration is stopped, and the weight matrix and bias vector values of the input gate, forget gate, and output gate are determined to obtain a trained LSTM network.
[0179] The loss function is used to measure the difference between the predicted output and the true label. The gradient descent method is used for training until the loss function L is less than the first set value. The iteration is stopped and the weight matrix and bias vector values of the input gate, forget gate, and output gate are determined at this time.
[0180] Set the initial weights and biases, weight W i (i=1,2,3,4) are the weights of each link involved in this step. The weights are drawn from a standard normal distribution and initialized with a weight initialization of 0.01 and a bias initialization of 0.
[0181] At this time, the time series x corresponding to a historical data in the first training sample set is t Input, you will get an output prediction value h t . For each time series x t The predicted value h of the LSTM training model t,i Compared with the corresponding true value, a loss value function is constructed.
[0182] The loss function of the LSTM network is as follows:
[0183]
[0184] Among them, c is the sample data size, y zs,i is the i-th true value, h t,i is the corresponding i-th predicted value, δ is the threshold parameter;
[0185] The threshold parameter δ is determined using the quantile method.
[0186] The gradient is then calculated as follows:
[0187] For the forget gate:
[0188]
[0189] For the input gate:
[0190]
[0191] Among them, i t is the activation value of the input gate.
[0192] For candidate memory:
[0193]
[0194] For the output gate:
[0195]
[0196]
[0197] For cell status:
[0198]
[0199] Among them, C t is the updated value of the cell state, C t+1 In order to update the value of the cell state by combining the cell state of the previous moment and the new information of the current moment through the joint action of the forget gate and the input gate.
[0200] Then the weights and biases are updated. The general formula is as follows:
[0201]
[0202] Where W' is the updated weight; b' is the updated bias, and η is the learning rate.
[0203] Exemplarily, the learning rate η is set to 0.001.
[0204] The iteration stops until the loss function Loss is less than the first set value.
[0205] Exemplarily, the first preset value is set to 0.01; when the iteration stops, the weight matrix and bias vector values of the input gate, forget gate, and output gate are determined to obtain a trained LSTM network.
[0206] Use the trained LSTM model to predict the predicted values of n variables in the basic data and the corresponding maximum load data in the next T time periods. Take the first variable as an example for prediction, assuming that the time series corresponding to the next T time periods is x1 to x T , that is, the input x t From t=1 to t=T, input x1 and output the first predicted value h1.
[0207] Add h1 to the original data sequence X1 and remove the earliest input value to keep the length of the input sequence unchanged. This can be achieved using the sequence formula:
[0208] X t-1 =X t-1 [1:]+[h t ] (At this time t=2) Formula (21);
[0209] Then repeat this step until the prediction for the next T time periods is completed, and the predicted value of the first variable in the next T time periods is obtained. Then, the same process is repeated to obtain the other basic data and n-1 variables corresponding to the maximum load data, and the predicted value of each variable in the next T time periods.
[0210] Using the trained LSTM network to obtain the predicted value of each variable in the basic data and the corresponding maximum load data in the future time period, the predicted value obtained by the trained LSTM network is the data after EMD decomposition and linear kernel KPCA analysis data preprocessing;
[0211] The predicted values for the future time period are subjected to inverse linear kernel KPCA analysis and then EMD decomposition to obtain the predicted basic data and maximum load data.
[0212] The function of step S2 is to train the LSTM network using the first training sample set that has undergone EMD decomposition and then linear kernel KPCA analysis data preprocessing, and iteratively optimize the network parameters until the loss function Loss of the LSTM network is less than a first preset value, thereby obtaining a trained LSTM network. The trained LSTM network can accurately predict the basic data and maximum load data of the power system load in the future time period based on the basic data and maximum load data that affect the power system load in the historical period.
[0213] Step S3 includes steps S31-S32.
[0214] Step S31: Generate a second training sample set.
[0215] Generate a second training sample set by combining the basic data and the corresponding maximum load data that affect the load of the power system in the historical period with the predicted basic data and the maximum load data;
[0216] Step S32: Use the second training sample set to train the BP neural network to obtain a trained power load prediction model.
[0217] First, initialize the BP neural network, which includes an input layer, a hidden layer and an output layer.
[0218] The hidden layer activation function is tan-sigmoid, as follows:
[0219]
[0220] Among them, x is the input sample of BP neural network.
[0221] The output range of this function is C-1, 1], and it has good gradient characteristics near the origin, which helps to accelerate the training process. The output layer activation function is purelin linear mapping, as follows:
[0222] f(x)=x Formula (23);
[0223] Then set the initial weights and biases as follows:
[0224] w ij ~N(0,σ 2 ) formula (24);
[0225] The weights are drawn from a standard normal distribution, which is set to 0.01 in this model, and the bias is initialized to 0. uv and x m The first 70% of the historical data is used as the training set, and the last 30% of the data is used as the test set.
[0226] Next, we set the formulas for the input layer, hidden layer, and output layer. During the forward propagation process, the input data is passed through the network layer by layer until it reaches the output layer. The specific steps are as follows:
[0227] The input layer to the hidden layer is as follows:
[0228] z1=W1x+b1 formula (25);
[0229] a1=tanh(z1) Formula (26);
[0230] Among them, W1 is the weight matrix from the input layer to the hidden layer, b1 is the bias vector of the hidden layer, z1 is the net input of the hidden layer, and a1 is the activation output of the hidden layer.
[0231] The hidden layer to the output layer is as follows:
[0232] z2=W2*a1+b2 formula (27);
[0233] Among them, W2 is the weight matrix from the hidden layer to the output layer, b2 is the bias vector of the output layer, and z2 is the net input of the output layer, which is also the final output.
[0234] Train BP neural network and predict the load change trend of power system based on BP neural network.
[0235] Construct a loss function for the BP neural network, which is used to measure the difference between the predicted output and the true label. Use the gradient descent method for training until the loss function is less than the second set value, then stop the iteration and determine the weight matrix and bias vector from the input layer to the hidden layer, as well as the weight matrix and bias vector from the hidden layer to the output layer.
[0236] In the process of training the BP neural network using the second training sample set, an adaptive weighted composite loss function is used, as follows:
[0237]
[0238] L total =μ1L1+μ2L2 formula (30);
[0239] Among them, x m,i is the i-th true value, z 2,i is the i-th predicted value, f is the number of samples in the second training sample set, μ1 and μ2 are the adaptive weights of the two loss functions L1 and L2 respectively.
[0240] The adaptive weights μ1 and μ2 of the two loss functions L1 and L2 are initially set to 0.5. μ1 and μ2 reflect the importance of the two loss terms in the current batch of data.
[0241] After each iteration of training the BP neural network, μ1 and μ2 are updated as follows:
[0242]
[0243] is the adaptive weight of the L1 function at the tth iteration, is the L1 loss function value at the tth iteration, is the L2 loss function value at the tth iteration; is the adaptive weight value of the L1 function at the t+1th iteration, is the adaptive weight value of the L2 function at the t+1 iteration.
[0244] After each iterative update, calculate the total loss value L in the current iteration process total .
[0245] During each iteration of training the BP neural network, weights and biases are updated as follows:
[0246]
[0247]
[0248] Where η is the learning rate, W1 and W′1 are the weight matrices before and after the update from the input layer to the hidden layer, W2 and W′2 are the weight matrices before and after the update from the hidden layer to the output layer, b1 is the bias vector of the hidden layer, and b2 is the bias vector of the output layer.
[0249] Exemplarily, the learning rate η is set to 0.001.
[0250] When the total loss value is less than the second preset value, the iteration ends.
[0251] Exemplarily, the second preset value is set to 0.01. When the iteration ends, the weight matrix and bias vector from the input layer to the hidden layer, and the weight matrix and bias vector from the hidden layer to the output layer are determined.
[0252] The function of step S3 is to train the BP neural network using the second training sample set generated by combining historical data and LSTM network prediction data, optimize the BP neural network parameters through adaptive weighted composite loss function and gradient descent method, and finally obtain a BP neural network model of nested LSTM network that can accurately predict the power load as the trained power load prediction model.
[0253] Step S4, specifically.
[0254] The basic data that affects the load of the power system in the region is obtained in real time, and input into the trained power load prediction model to obtain the predicted value of the maximum load data of the regional power system.
[0255] The power load prediction model is a BP neural network nested with an LSTM network, which is an improved BP neural network.
[0256] The original basic data within a specific historical period in the area obtained in real time is first input into the LSTM network to obtain the predicted basic data, and the predicted basic data is then input into the BP neural network to obtain the predicted value of the maximum load of the power system in the future time period.
[0257] In summary, the maximum load prediction method based on EMD-KPCA-improved BP neural network in the embodiment of the present invention has the following beneficial effects:
[0258] 1. By combining EMD, KPCA and improved BP neural network, the present invention can effectively handle nonlinear changes and emergencies, and improve the accuracy of maximum power load data prediction;
[0259] 2. It provides a more accurate data preprocessing method. Through EMD decomposition as the first data preprocessing method and KPCA dimensionality reduction as the second data preprocessing method, the idea of dimensionality increase and dimensionality reduction of the original data is applied to maximize the screening of heterogeneous characteristics of the data and relevant historical data that has the most significant impact on the dependent variable. It can effectively extract key features from multivariate data, remove redundant information and noise, reduce the dimensionality of the data, and retain the main information, providing a more refined data foundation for subsequent prediction steps.
[0260] 3. An improved BP neural network prediction model is provided. By nesting the LSTM network in the BP neural network for prediction, various factors affecting the power load are comprehensively considered, a richer fitting data set is provided, and the prediction accuracy of the power load prediction model for the maximum load data of the power system is improved.
[0261] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed by the present invention should be covered by the scope of protection of the present invention.
Claims
1. A maximum load prediction method based on EMD-KPCA-improved BP neural network, characterized in that: The steps include: Obtain basic data and corresponding maximum load data affecting the power system load in a region over multiple historical periods, perform data preprocessing including EMD decomposition and linear kernel KPCA analysis, and generate a first training sample set based on the preprocessed basic data and maximum load data; Training the LSTM network using the first training sample set, obtaining predicted values of each variable in the basic data and the corresponding maximum load data for a future time period using the trained LSTM network, and sequentially performing inverse linear kernel KPCA analysis and EMD decomposition processing on the predicted values for the future time period to obtain predicted basic data and maximum load data; The basic data affecting the load of the power system in the historical period and the corresponding maximum load data are combined with the predicted basic data and maximum load data to generate a second training sample set; Using the second training sample set to train the BP neural network, a trained power load prediction model is obtained; wherein the power load prediction model is a BP neural network with a nested LSTM network; The basic data affecting the load of the power system in the region is obtained in real time and input into the trained power load prediction model to obtain the predicted value of the maximum load data of the regional power system.
2. The method according to claim 1, characterized in that The EMD data preprocessing is performed on each variable of the basic data and maximum load data in each historical period, including: The first step is to define the m historical data of each variable as the original time series x(t), the residual component r0(t) = x(t), and initialize the number of iterations i = 1; Step 2: In each iteration, after extracting an IMF from the current residual component, the current residual component is updated to the residual component after the previous iteration minus the currently extracted IMF; Step 3: Find the current residual component r i-1 All local maximum and local minimum points in (t); The fourth step is to use the cubic spline interpolation method to fit all the local maximum and local minimum points of the current residual component to obtain the upper envelope e max (t) and the lower envelope e min (t), calculate the average value of the upper and lower envelopes Step 5: Subtract the average value of the upper and lower envelopes from the current residual component to obtain the component h i (t) = r i-1 (t)-m i (t); if the component h i (t) satisfies the preset conditions, then it is taken as the i-th IMF component c i (t), otherwise it will be regarded as a new residual component and steps 2 to 5 will be repeated until the i-th IMF component is obtained; Step 6: Update the residual component r based on the obtained i-th IMF component i (t) = r i-1 (t)-c i (t); if r i If (t) is not a monotonic function or a constant, then i = i + 1 and return to the second step to continue processing. Otherwise, the EMD decomposition process is stopped and the m data in each historical period of each variable are expressed as the sum of p IMF components and the residual signal of the last iteration. as the IMF component for each variable in each historical period; For the basic data and the n variables corresponding to the maximum load data in each historical period, each containing m data, they are decomposed by EMD to obtain p×n×m IMF components.
3. The method according to claim 2, characterized in that Perform linear kernel KPCA analysis on the p×n×m IMF components, including: For p×n×m IMF variables as sample points C=[c1,c2,...c pnm ], construct the kernel matrix K of the sample point, whose matrix elements K ij Expressed as K ij =C T *C=k(c i , c j ); Construct a centralized kernel matrix K′=HKH, where I is the identity matrix, B is the all-1 vector; Perform eigenvalue decomposition on the centralized kernel matrix K′ to obtain eigenvalues λ1, λ2, ...λ N and its corresponding eigenvectors α1, α2, …, α n ; Select the first k largest eigenvalues and corresponding eigenvectors as principal components, and obtain the principal component values after projection into the principal component space. Among them, α j is the eigenvector corresponding to the jth principal component, λ j is the corresponding eigenvalue, c new is a sample point in C.
4. The method according to claim 1, characterized in that The principal component values corresponding to the basic data and the principal component values corresponding to the maximum load data are used as labels to form sample data, and all the sample data form a first training sample set.
5. The method according to claim 4, characterized in that: Training the LSTM network using the first training sample set includes: Initialize the weights and biases of the LSTM network; Input the principal component value corresponding to each historical data in the first training sample set into the LSTM network to obtain a predicted value, and compare it with the corresponding true value in the first training sample set to construct a loss function; Perform gradient descent training and perform weight and bias updates; When the loss function is less than the first preset value, the iteration is stopped, and the weight matrix and bias vector values of the input gate, forget gate, and output gate are determined to obtain a trained LSTM network.
6. The method according to claim 1, characterized in that In the process of training the BP neural network using the second training sample set, an adaptive weighted composite loss function is used, as follows: L total =μ1L1+μ2L2; Among them, x m,i is the i-th true value, z 2,i is the i-th predicted value, f is the number of samples in the second training sample set, μ1 and μ2 are the adaptive weights of the two loss functions L1 and L2 respectively.
7. The method according to claim 6, characterized in that After each iteration of training the BP neural network, μ1 and μ2 are updated as follows: is the adaptive weight of the L1 function at the tth iteration, is the L1 loss function value at the tth iteration, is the L2 loss function value at the tth iteration; is the adaptive weight value of the L1 function at the t+1th iteration, is the adaptive weight value of the L2 function at t+1 iteration; After each iterative update, calculate the total loss value L in the current iteration process total .
8. The method according to claim 7, characterized in that: During each iteration of training the BP neural network, weights and biases are updated as follows: Where η is the learning rate, W1 and W′1 are the weight matrices before and after the update from the input layer to the hidden layer, W2 and W′2 are the weight matrices before and after the update from the hidden layer to the output layer, b1 is the bias vector of the hidden layer, and b2 is the bias vector of the output layer.
9. The method according to claim 5, characterized in that: The loss function of the LSTM network is as follows: Among them, c is the sample data size, y zs,i is the i-th true value, h t,i is the corresponding i-th predicted value, δ is the threshold parameter; The threshold parameter δ is determined using the quantile method.
10. The method according to claim 2, characterized in that: The preset conditions include: within the m data of each variable of the basic data and the maximum load data, the number of the local maximum points and the number of the minimum points and the number of zero-crossing points are equal to or differ by at most one, and the average values of the upper envelope formed by the local maximum points and the lower envelope formed by the local minimum points are zero at any time.
Citation Information
Patent Citations
Power load prediction method based on empirical mode decomposition and long-short-term memory network
CN112488415A
Short-term power load prediction method based on CNN-LSTM-ARIMA combination
CN113705915A