Comprehensive energy theft detection method based on probability density regression prediction
Through the probability density regression prediction method, the energy load is decomposed and predicted by CEEMDAN and GRU neural networks, combined with the kernel density estimation to judge abnormalities, the problem of high cost and low accuracy of energy leakage detection in the existing technology is solved, and efficient Identification of stealing.
Patent Information
- Application Number
- CN202210440586.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-25
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-04-25
AI Technical Summary
The existing energy leak detection methods rely on a large amount of labeled data and the same type of data training, resulting in high detection costs and low accuracy, and data set imbalance limits the effectiveness of the detector.
Using a method based on probability density regression prediction, the energy load signal is decomposed through CEEMDAN, the MIC method is used to screen features, construct the input matrix, and the load prediction is performed using the GRU neural network. Combined with the probability density curve of the calculation error of the kernel density estimation, and set the confidence interval judgment. Exceptional load.
No large amount of labeling data is required, which improves the accuracy and efficiency of energy leakage detection, reduces detection costs, and can effectively identify leakage behavior.
Smart Images

Figure CN114692998B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of energy theft and leakage detection, and relates to a detection method based on probability density regression prediction. Background Art
[0002] The integrated energy system with electricity as the core is characterized by decentralization, diversity, complexity and real-time. It interacts through a variety of energy storage devices and conversion devices to achieve reasonable planning and coordinated response between various energy systems, effectively improving energy utilization efficiency. In terms of the development trend of the energy system, the access of a large number of distributed energy sources and the increase in energy consumption have undoubtedly brought considerable risks to the stable operation of the integrated energy system, including energy theft and leakage. Therefore, the research on the detection of energy theft and leakage in the interaction process is an important direction to promote energy structural reform.
[0003] At present, energy theft and leakage detection mainly relies on traditional methods such as physical protection of metering equipment, on-site inspection by auditors, and online monitoring of line loss in substations. Although this type of method is also quite effective, it does not fully mine energy data information, resulting in high detection costs and low accuracy. With the advancement of artificial intelligence in smart grids, data-driven electricity theft detection has attracted public attention. This method is divided into two types: classification-based and clustering-based. Among them, the classification-based detection method requires a large amount of labeled data for model training; the clustering-based detection method requires a large amount of data of the same type for training to find outliers. Due to the imbalance of the data set caused by the low incidence of energy theft cases, traditional detectors cannot be trained well and are subject to many limitations in practical applications. Summary of the invention
[0004] The purpose of the present invention is to provide a comprehensive energy theft and leakage detection method based on probability density regression prediction. This method does not require a large amount of labeled data for model training, and can effectively detect a single target, solving the problems of high cost and low accuracy of energy theft and leakage detection in the prior art.
[0005] The technical solution adopted by the present invention is:
[0006] A comprehensive energy theft detection method based on probability density regression prediction includes the following steps:
[0007] Step 1: Obtain the target historical energy load and correlation factors, and perform missing value checking and filling;
[0008] Step 2: Use CEEMDAN to decompose the target historical energy load and obtain several IMF components;
[0009] Step 3: Use the MIC method to screen the features of each IMF component after decomposition, retain the Top-k features with higher correlation coefficients, and construct the input matrix;
[0010] Step 4: Train the load forecasting model, and use the trained load forecasting model to predict the input matrix and real-time data to obtain the optimal predicted load and the predicted load of the target real-time energy data;
[0011] Step 5: Calculate the error between the optimal predicted load and the target historical energy load, obtain the probability density curve of the error, set the confidence interval of the probability density curve, obtain the abnormal load based on the error and confidence interval between the target real-time energy data predicted load and the actual load, and further determine whether the abnormal load is stolen or leaked energy.
[0012] The present invention is also characterized in that:
[0013] Specifically in step 2:
[0014] Step 2.1: Energy load signal X(t)+εn i (t) is decomposed N times using the EMD algorithm; where X(t) is the signal to be decomposed, ε is the standard white noise table, and n i (t) is the Gaussian white noise signal under the standard normal distribution, i = 1, 2, ..., N is the number of times the white noise is added, E i (·) represents the i-th IMF obtained after decomposition by the EMD algorithm;
[0015] The first CEEMDAN mode is obtained by averaging:
[0016]
[0017] in, represents the first-order eigenmode component;
[0018] Step 2.2 Calculate the residual signal r1(t) of IMF1:
[0019]
[0020] Step 2.3: Use the EMD algorithm to calculate r1(t)+εE1(n i (t)) is decomposed N times to obtain the second mode:
[0021]
[0022] Step 2.4 For k=2, ..., K, calculate the kth residual signal:
[0023]
[0024] Step 2.5 Repeat the calculation in step (3) to obtain k+1 modes:
[0025]
[0026] Step 2.6 Repeat steps 2.4 and 2.5 until the decomposition is complete and K modal components are finally obtained;
[0027] The residual is:
[0028]
[0029] The original signal is decomposed into:
[0030]
[0031] in, These are the K modal components finally obtained.
[0032] Step 3 is as follows:
[0033] Step 3.1 Assume that X and Y are the load sequence and feature sequence in the data set, where X = {x1,…,x n}、Y={y1,…,y n}, n is the number of samples; the mutual information between X and Y is defined as:
[0034]
[0035] Where p(x,y) is the joint probability density between X and Y; p(x) and p(y) represent the marginal probability densities of X and Y respectively;
[0036] Step 3.2 Draw a grid on the data scatter plot composed of X and Y, and calculate the mutual information between each grid; use different grid division standards to select the maximum value of the mutual information, and the calculation formula is:
[0037]
[0038] Where a and b represent the number of grids divided in the X and Y directions respectively, and B is the maximum value of the grid;
[0039] Step 3.3 Repeat steps 3.1 and 3.2 to calculate the correlation coefficients between all characteristic factors and loads;
[0040] Step 3.4 Select the three to six largest characteristic factors f with correlation coefficient > 0.5 for each IMF n , construct k input matrices:
[0041] Mat k =[f1f2 … f nX] (10).
[0042] Step 4 is as follows:
[0043] Step 4.1, establish a GRU neural network. The structural relationship of the GRU neural network is shown in formulas (11) to (14):
[0044] z t =σ(W z x t +U z h t-1 +b z ) (11)
[0045] r t =σ(W r x t +U r h t-1 +b z ) (12)
[0046]
[0047]
[0048] Where z t and r t are update gate and reset gate respectively, σ is Sigmoid function; tanh is hyperbolic tangent function; U z , U r , W r , W z is the training parameter matrix; For input x t And the output result h of the previous hidden layer t-1 combination of;
[0049] The parameters of GRU are set as follows: the number of hidden layers is 2, the number of neurons in the hidden layers is 50 and 32 respectively, the number of neurons in the input layer is 48, the number of neurons in the output layer is 1, and the activation function is ReLU;
[0050] Step 4.2: The input matrix obtained in step 3 is divided into a training set and a test set. The training set is trained using a GRU neural network to obtain a trained load forecasting model. The trained load forecasting model is used to predict the test set until all IMF components are effectively predicted. All results are linearly reconstructed to obtain the optimal predicted load:
[0051]
[0052] Where p k is the prediction result of the kth input matrix;
[0053] Step 4.3, obtain the target real-time energy load and correlation factors and input them into the trained load forecasting model to obtain the predicted load of the target real-time energy data.
[0054] Step 5 is as follows:
[0055] Step 5.1, in the time series, the error between the best predicted load and the target historical energy load is calculated at each time point between the predicted value and the true value, the absolute value is taken, and the kernel density estimation (KDE) method is used to fit the error function curve:
[0056]
[0057] Where x=x1,x2,x3......x n is the n time points of the load time series data, h>0 is a smoothing parameter, also known as a window; K(·) represents the kernel function, which has many forms. The most commonly used Gaussian kernel function formula is as follows:
[0058]
[0059] Step 5.2, set the confidence interval of the probability density curve;
[0060] Step 5.3, calculate the error between the load predicted by the target real-time energy data and the actual load; if the value of the error is within the confidence interval of the probability density curve, the load is a normal load, otherwise the load is an abnormal load;
[0061] Step 5.4, calculate the proportion of abnormal load in the target real-time energy load, set a threshold, and when the proportion of abnormal load in the target real-time energy load is greater than the set threshold, it is determined that the detection target has energy theft.
[0062] The beneficial effects of the present invention are:
[0063] The method of the present invention decomposes the energy load into several intrinsic mode function (IMF) components of the same length and different frequencies by using the complete empirical mode decomposition of adaptive white noise (CEEMDAN) method, and uses the maximum information coefficient (MIC) method to perform feature screening on each IMF after decomposition, and construct an input matrix. This method fully considers the information relevance of each IMF, provides data support for the regression prediction of energy load to the greatest extent possible, and improves the prediction accuracy.
[0064] The time series deep learning model gated recurrent unit (GRU) is used to regress and reconstruct the input matrices of each IMF. This method explores and extracts nonlinear laws in the data based on the mutual exchange and trust of energy information.
[0065] The error between the predicted value and the actual value of the target energy load is calculated, and the nonparametric kernel density estimation (KDE) is used for fitting to obtain the probability density function (PDF). The confidence interval is set for the PDF according to actual needs. The load beyond the confidence interval is considered abnormal. By calculating the abnormal rate, it is used to determine whether the target is stealing or leaking energy. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a flow chart of the comprehensive energy theft detection method based on probability density regression prediction of the present invention;
[0067] Figure 2 It is the GRU unit structure diagram;
[0068] Figure 3 is a prediction error function curve diagram of the present invention using kernel density estimation fitting;
[0069] Figure 4 It is the confusion matrix judged by the model of the present invention. DETAILED DESCRIPTION
[0070] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0071] Comprehensive energy theft detection method based on probability density regression prediction, such as Figure 1 , including the following steps:
[0072] Step 1: Obtain the target historical energy load and correlation factors and perform missing value checking and filling;
[0073] Step 2: Use CEEMDAN to decompose the target historical energy load and obtain several IMF components.
[0074] Step 3: Use the MIC method to screen the features of each IMF component after decomposition, retain the Top-k features with higher correlation coefficients, and construct the input matrix.
[0075] Step 4: Train the load prediction model. Substitute each IMF input matrix into the GRU neural network for training and reconstruction to obtain the best prediction model and predicted load. The best prediction model is used to predict the real-time data in the detection phase.
[0076] Obtain the target real-time energy load and correlation factors, substitute them into the best prediction model trained in step 5, and obtain the predicted load of the target real-time energy data.
[0077] Step 5: Calculate the error between the optimal predicted load and the target historical energy load, obtain the probability density curve of the error, set the confidence interval of the probability density curve, obtain the abnormal load based on the error and confidence interval between the target real-time energy data predicted load and the actual load, and further determine whether the abnormal load is stolen or leaked energy.
[0078] Specifically, the target in step 1 is generally an industrial, commercial, civil, government and other units or individuals with long-term energy consumption needs. By deploying intelligent energy metering equipment, auditors can keep track of the historical energy consumption data of the target at any time. To unify the granularity, the time series load is split and combined into a 15-minute sampling interval. Correlation factors are generally characteristics such as meteorology, geography, and policies that have a certain impact on the increase or decrease of energy consumption. Common correlation factors include temperature, humidity, wind speed, price, etc. The location of the feature sensor needs to be close to the detection target and have the same granularity as the load sequence.
[0079] Missing values refer to the loss of data in the data sampling and transmission process of the sensors of smart metering equipment. Unprocessed missing data cannot be used directly, so linear interpolation is needed to fill in the missing values reasonably;
[0080] In step 2, CEEMDAN is used to effectively decompose the energy load. The specific steps are as follows:
[0081] Step 2.1: Energy load signal X(t)+εn i (t) is decomposed N times using the EMD algorithm. Where X(t) is the signal to be decomposed, ε is the standard white noise table, n i (t) is the Gaussian white noise signal under the standard normal distribution, i = 1, 2, ..., N is the number of times the white noise is added, E i (·) represents the i-th IMF obtained after decomposition by the EMD algorithm.
[0082] The first CEEMDAN mode is obtained by averaging:
[0083]
[0084] in, represents the first-order eigenmode component.
[0085] Step 2.2 Calculate the residual signal r1(t) of IMF1:
[0086]
[0087] Step 2.3: Use the EMD algorithm to calculate r1(t)+εE1(n i (t)) is decomposed N times to obtain the second mode:
[0088]
[0089] Step 2.4 For k=2, ..., K, calculate the kth residual signal:
[0090]
[0091] Step 2.5 Repeat the calculation in step (3) to obtain k+1 modes:
[0092]
[0093] Step 2.6 Repeat steps 2.4 and 2.5 until the decomposition is completed and K modal components are finally obtained.
[0094] The residual is:
[0095]
[0096] The original signal is decomposed into:
[0097]
[0098] in, These are the K modal components finally obtained.
[0099] The correlation method in step 3 uses the maximum information coefficient to measure the degree of data association between the loading and the characteristic factors, including linear and nonlinear.
[0100] Step 3.1 Assume that X and Y are the load sequence and feature sequence in the data set, where X = {x1,…,x n}、Y={y1,…,y n}, n is the number of samples. The mutual information between X and Y is defined as:
[0101]
[0102] Where p(x,y) is the joint probability density between X and Y; p(x) and p(y) represent the marginal probability densities of X and Y respectively.
[0103] Step 3.2 Draw a grid on the data scatter plot composed of X and Y, and calculate the mutual information between each grid. Use different grid division standards to select the maximum value of the mutual information. The calculation formula is:
[0104]
[0105] Where a and b represent the number of grids divided in the X and Y directions respectively, and B is the maximum value of the grid.
[0106] Step 3.3 Repeat steps 3.1 and 3.2 to calculate the correlation coefficients between all characteristic factors and loads.
[0107] Step 3.4 Select three to six most relevant characteristic factors f for each IMF (correlation coefficient>0.5) n , construct k input matrices:
[0108] Mat k =[f1 f2 … f n X] (10)
[0109] Step 4 performs short-term energy load forecasting. A gated recurrent unit (GRU) is used to effectively predict each input matrix.
[0110] Step 4.1 Establish a GRU neural network and use the gated recurrent unit (GRU) to effectively predict each input matrix. The unit structure of GRU is as follows Figure 2 As shown in Figure 1, the update gate controls the extent to which the information from the previous moment can be transferred to the current state. The reset gate is used to select whether to use the previously retained information. The value of the reset gate indicates the degree of information retention. The smaller the value, the more information is abandoned.
[0111] z t =σ(W z x t +U z h t-1 +b z ) (11)
[0112] r t =σ(W r x t +U r h t-1 +b z ) (12)
[0113]
[0114]
[0115] Where z t and r t are update gate and reset gate respectively, σ is Sigmoid function; tanh is hyperbolic tangent function; U z , U r , W r , W z is the training parameter matrix; For input x t And the output result h of the previous hidden layer t-1 combination.
[0116] The parameters of GRU are set as follows: the number of hidden layers is 2, the number of neurons in the hidden layers is 50 and 32 respectively, the number of neurons in the input layer is 48, the number of neurons in the output layer is 1, and the activation function is ReLU.
[0117] Step 4.2: Divide the input matrix obtained in step 3 into a training set and a test set. Use the GRU neural network to train the training set to obtain a trained load forecasting model. Use the trained load forecasting model to predict the test set until all IMF components are effectively predicted. All results are linearly reconstructed to obtain the optimal predicted load:
[0118]
[0119] Where p k is the prediction result of the kth input matrix.
[0120] Step 4.3, obtain the target real-time energy load and correlation factors and input them into the trained load forecasting model to obtain the predicted load of the target real-time energy data.
[0121] The specific steps in step 5 are:
[0122] Step 5.1: In the time series, the error between the best predicted load and the target historical energy load is calculated at each time point, and the absolute value is taken. The error value is statistically calculated, and the error function curve is fitted using the kernel density estimation (KDE) method, such as Figure 3 :
[0123]
[0124] Where x=x1,x2,x3......x n is the n time points of the load time series data, h>0 is a smoothing parameter, also known as a window. K(·) represents the kernel function, which has many forms. The most commonly used Gaussian kernel function formula is as follows:
[0125]
[0126] Step 5.2, according to the loose and tight requirements of detection, set the confidence interval of the probability density curve; it is worth mentioning that the accuracy rate (FPR) and the false positive rate (TPR) of the model cannot be achieved at the same time, the formula is as follows:
[0127]
[0128]
[0129] Where, TP, FP, TN, FN are Figure 4 Confusion matrix.
[0130] The larger the confidence interval, the looser the detection model. The recommended parameters for the confidence interval are: 0.75 to 0.95.
[0131] Step 5.3, calculate the error between the load predicted by the target real-time energy data and the actual load. If the value of the error is within the confidence interval of the probability density curve, the load is a normal load, otherwise the load is an abnormal load;
[0132] Step 5.4, calculate the proportion of abnormal load in the target real-time energy load, set the threshold according to the detection loose and tight requirements, and when the proportion of abnormal load in the target real-time energy load is greater than the set threshold, it is determined that the detection target has energy theft. The larger the threshold, the looser the detection model. The recommended parameter is: 0.05~0.15.
Claims
1. A comprehensive energy theft detection method based on probability density regression prediction, characterized in that the steps include: Step 1: Obtain the target historical energy load and correlation factors, and perform missing value checking and filling; Step 2: Use CEEMDAN to decompose the target historical energy load and obtain several IMF components; Step 3: Use the MIC method to screen the features of each IMF component after decomposition, retain the Top-k features with higher correlation coefficients, and construct the input matrix; The specific steps of step 3 are as follows: Step 3.1 Assume that X and Y are the load sequence and feature sequence in the data set, where X = {x1,…,x n }、Y={y1,…,y n }, n is the number of samples; the mutual information between X and Y is defined as: Where p(x,y) is the joint probability density between X and Y; p(x) and p(y) represent the marginal probability densities of X and Y respectively; Step 3.2 Draw a grid on the data scatter plot composed of X and Y, and calculate the mutual information between each grid; use different grid division standards to select the maximum value of the mutual information, and the calculation formula is: Where a and b represent the number of grids divided in the X and Y directions respectively, and B is the maximum value of the grid; Step 3.3 Repeat steps 3.1 and 3.2 to calculate the correlation coefficients between all characteristic factors and loads; Step 3.4 Select the three to six largest characteristic factors f with correlation coefficient > 0.5 for each IMF n , construct k input matrices: Mat k =[f1 f2 … f n X] (10); Step 4: Train the load forecasting model, and use the trained load forecasting model to predict the input matrix and real-time data to obtain the optimal predicted load and the predicted load of the target real-time energy data; Step 5: Calculate the error between the optimal predicted load and the target historical energy load, obtain the probability density curve of the error, set the confidence interval of the probability density curve, obtain the abnormal load according to the error and confidence interval between the target real-time energy data predicted load and the actual load, and further determine whether the abnormal load is stolen or leaked energy; The specific steps of step 5 are as follows: Step 5.1, in the time series, the error between the best predicted load and the target historical energy load is calculated at each time point between the predicted value and the true value, the absolute value is taken, and the kernel density estimation (KDE) method is used to fit the error function curve: Where x=x1,x2,x3......x n is the n time points of the load time series data, h>0 is a smoothing parameter, also known as a window; K(·) represents the kernel function, which has many forms. The most commonly used Gaussian kernel function formula is as follows: Step 5.2, set the confidence interval of the probability density curve; Step 5.3, calculate the error between the load predicted by the target real-time energy data and the actual load; if the value of the error is within the confidence interval of the probability density curve, the load is a normal load, otherwise the load is an abnormal load; Step 5.4, calculate the proportion of abnormal load in the target real-time energy load, set a threshold, and when the proportion of abnormal load in the target real-time energy load is greater than the set threshold, it is determined that the detection target has energy theft.
2. The comprehensive energy theft detection method based on probability density regression prediction as claimed in claim 1 is characterized in that: The specific steps of step 2 are as follows: Step 2.1: Energy load signal X(t)+εn i (t) is decomposed N times using the EMD algorithm; where X(t) is the signal to be decomposed, ε is the standard white noise table, and n i (t) is the Gaussian white noise signal under the standard normal distribution, i = 1, 2, ..., N is the number of times the white noise is added, E i (·) represents the i-th IMF obtained after decomposition by the EMD algorithm; The first CEEMDAN mode is obtained by averaging: Among them, IMF1 i (t) represents the first-order eigenmode component; Step 2.2 Calculate the residual signal r1(t) of IMF1: Step 2.3: Use the EMD algorithm to calculate r1(t)+εE1(n i (t)) is decomposed N times to obtain the second mode: Step 2.4 For k=2, ..., K, calculate the kth residual signal: Step 2.5 Repeat the calculation in step (3) to obtain k+1 modes: Step 2.6 Repeat steps 2.4 and 2.5 until the decomposition is complete and K modal components are finally obtained; The residual is: The original signal is decomposed into: in, These are the K modal components finally obtained.
3. The comprehensive energy theft detection method based on probability density regression prediction as claimed in claim 1 is characterized in that: The specific steps of step 4 are as follows: Step 4.1, establish a GRU neural network, the structural relationship of the GRU neural network is shown in formulas (11) to (14): z t =σ(W z x t +U z h t-1 +b z ) (11) r t =σ(W r x t +U r h t-1 +b z ) (12) Where z t and r t are update gate and reset gate respectively, σ is Sigmoid function; tanh is hyperbolic tangent function; U z , U r , W r , W z is the training parameter matrix; For input x t And the output result h of the previous hidden layer t-1 combination of; The parameters of GRU are set as follows: the number of hidden layers is 2, the number of neurons in the hidden layers is 50 and 32 respectively, the number of neurons in the input layer is 48, the number of neurons in the output layer is 1, and the activation function is ReLU; Step 4.2: The input matrix obtained in step 3 is divided into a training set and a test set. The training set is trained using a GRU neural network to obtain a trained load forecasting model. The trained load forecasting model is used to predict the test set until all IMF components are effectively predicted. All results are linearly reconstructed to obtain the optimal predicted load: Where p k is the prediction result of the kth input matrix; Step 4.3, obtain the target real-time energy load and correlation factors and input them into the trained load forecasting model to obtain the predicted load of the target real-time energy data.
