An intelligent power detection method based on load forecasting
The IMFO-ELM model addresses low power audit accuracy by optimizing the moth-to-flame algorithm for faster convergence and better load forecasting, enabling precise identification of abnormal power consumption.
Patent Information
- Application Number
- CN202210456062.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-04-28
AI Technical Summary
Current power audit methods suffer from low accuracy and inefficiency in load detection and power consumption inspection, particularly in areas with dispersed electricity consumption, leading to economic losses and resource wastage.
An improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model is proposed, combining chaotic mapping and adaptive updates to initialize weights and thresholds, enhancing the convergence speed and accuracy of load forecasting, enabling rapid identification of abnormal power consumption.
The IMFO-ELM model accurately predicts power load, quickly identifies abnormal data points, and facilitates efficient power inspection by comparing predicted values with actual consumption, thereby improving detection accuracy and reducing the scope of inspections.
Smart Images

Figure CN114707422B_ABST
Abstract
Description
Technical Field
[0001] The technical solution of the present invention belongs to the technical field of power audit, and specifically is a method for power audit based on a load forecasting model based on an improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM). Background Art
[0002] In today's society, people's demand for electricity is constantly increasing, and the difficulty of electricity inspection in the power sector is also increasing. In order to save costs, many users adopt methods such as modifying lines, high-tech electricity stealing devices, and changing the performance of electricity meters, which has caused a lot of economic losses to power companies. In addition, in some areas where electricity consumption is not concentrated, it is not economical to install corresponding inspection equipment, and human inspection is inefficient and wastes resources. These problems have increased the difficulty of power inspection. Therefore, researching new power inspection methods with lower costs has become an urgent problem that needs to be solved.
[0003] Due to the rapid economic development in Europe and the United States, the reform of power auditing also has an early history. As an economically developed country, most of the power departments in the United States have established a power auditing system with a high degree of automation; European countries such as Britain, France and Germany have also carried out reforms of power companies earlier, and their power auditing systems are more complete and the auditing efficiency is higher. Due to the late development in China, the corresponding power auditing system and system are not yet perfect. In order to improve the quality of service, the State Grid established a big data center in 2019, which will help establish a new power auditing method and promote the development of power grid business.
[0004] At present, the commonly used power audit method at home and abroad is to analyze the power consumption of users according to the power consumption of users, including active power, reactive power, voltage, current, power consumption, and environmental parameters such as humidity, temperature, and time. In recent years, with the rapid progress of science and technology, information technology represented by computer technology and communication technology is promoting the development of power grids in the direction of digital informationization, among which big data technology has been widely used. Using big data to conduct intelligent analysis and monitoring of users can reduce the difficulty of work of relevant power grid staff and improve accuracy. Since power audit is actually to analyze the user's load, obtain the power load curve, and combine it with other methods for monitoring and analysis, most of the current load analysis is combined with intelligent algorithms. In early studies, scholars used K-means clustering algorithm, Bayesian information criterion (BIC), weighted Pearson distance and support vector machine model in fuzzy cluster analysis to integrate and analyze load curves, improve the accuracy of pattern recognition in cluster analysis and long short-term memory network, and use the classification function of support vector machine to conduct in-depth detection of users with large load deviations. However, there is still room for improvement in model prediction accuracy and detection accuracy.
[0005] Therefore, there is an urgent need for a method that can improve the accuracy of electricity consumption audits, predict the power load curve based on the real-time environment and compare it with the actual load curve, accurately screen out data anomalies and suspected anomalies, and facilitate further detection by the power department. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide an intelligent power inspection method based on load forecasting. In view of the problem that the current load detection and power consumption inspection accuracy is not high enough, an improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) load forecasting model is proposed for power inspection. The model is designed to accurately predict power load data, and by comparing it with the actual power consumption of users, abnormal power consumption data points of users can be quickly and efficiently screened out. The present invention combines a moth-to-fire algorithm (MFO) with an extreme learning machine (ELM), uses the moth-to-fire algorithm (MFO) to initialize the weight and threshold of the extreme learning machine (ELM), proposes an improved moth-to-fire algorithm-optimized extreme learning machine (IMFO-ELM) load forecasting model, uses chaotic mapping to initialize the moth-to-fire algorithm (MFO) population, and modifies the iterative update formula of the linear decreasing weight, so that the algorithm converges to the optimal value faster, reduces the calculation amount of the algorithm, and avoids falling into the local optimum; the improved moth-to-fire algorithm-optimized extreme learning machine (IMFO-ELM) load forecasting model proposed by the present invention can effectively narrow the scope of electricity inspection, and can directly and effectively find abnormal data in massive electricity data by comparing the relative errors of the inspection value and the actual value, which is conducive to the rapid and efficient advancement of power inspection work, and makes up for the shortcomings of low inspection accuracy and inspection efficiency in the existing method.
[0007] The technical solution adopted by the present invention to solve the technical problem is: an intelligent power inspection method based on load forecasting, specifically a method for power inspection based on the load forecasting model of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM), and the specific steps are as follows:
[0008] Step 1: Train the IMFO-ELM model
[0009] (1.1) Using known data to determine test samples and training samples
[0010] The load data of known non-abnormal users in the area to be audited are divided into training samples and prediction samples. The non-abnormal users refer to users who have no abnormal electricity consumption behavior. The training samples are used to train the IMFO-ELM model, and the prediction samples are used to test the prediction effect of the trained IMFO-ELM model.
[0011] (1.2) Set the relevant parameters of the Improved Moth-to-Flame Algorithm-Optimized Extreme Learning Machine (IMFO-ELM) model
[0012] Set the initial parameters of the improved moth-to-fire algorithm (IMFO): maximum number of iterations max_It, current number of iterations It, moth population size N, etc. The initial parameters of the extreme learning machine (ELM), i.e., weights and thresholds, are obtained by optimizing and iterating the improved moth-to-fire algorithm (IMFO) in the present invention, so there is no need to initialize these parameters.
[0013] (1.3) Introducing chaotic mapping to initialize the population of the moth-to-fire algorithm (MFO)
[0014] Chaotic mapping is introduced to initialize the population of the moth-to-fire algorithm (MFO), improve the performance of the algorithm, enable the algorithm to converge to the optimal value faster, reduce the amount of calculation of the algorithm, and avoid falling into the problem of local optimality. The specific expression of chaotic mapping is as follows:
[0015] POS i =pos max +M i (pos max -pos min ) (1)
[0016] where pos max Indicates the maximum value of the search space, pos min Represents the minimum value of the search space, M i is the chaos factor corresponding to the i-th individual.
[0017] (1.4) Calculate the population fitness value and update the positions of moths and flames
[0018] Since the weights and thresholds of the extreme learning machine (ELM) model need to be initialized and kept at a constant value during training, but random initialization will affect the speed and accuracy of the calculation, the improved moth-to-fire algorithm (IMFO) is used in the present invention to optimize the initial parameters.
[0019] In the Improved Moth-to-Fire Algorithm (IMFO), the position of the moth is defined as the problem to be solved, and the flame is defined as the local optimal position searched by the moth. The optimal solution is searched by updating the position of the moth in the iterative process. The position of the moth is expressed as follows:
[0020]
[0021] In the formula, pmo N,D represents the position of the Nth moth in the Dth dimensional space, N represents the size of the moth population, and D is the dimension of the problem represented by the moth. Substituting the position of the moth into the fitness function, the resulting moth fitness matrix is as follows:
[0022]
[0023] In the formula, is the fitness corresponding to the Nth moth. Similarly, each moth corresponds to a flame when flying, and the flame position matrix and fitness matrix are as follows:
[0024]
[0025]
[0026] Among them, POS fla is the position matrix corresponding to the flame, fla i,j Corresponding to the position of the i-th flame in the j-dimensional space; Fit fla is the fitness matrix corresponding to the flame position. Each vector in the matrix is the fitness corresponding to a flame position. Each iteration of the moth and the flame position is undergoing a different update process, that is, the update strategy is different. The moth moves towards the flame in a spiral and cannot exceed the search space during the flight. The position update formula is as follows:
[0027] pmo i =Dis i *e bt *cos(2πt)+fla j (6)
[0028] Where b is the defined spiral factor; fla j is the position corresponding to the jth flame; Dis i is the distance between the ith moth and the flame; t is used to define the distance between the moth and the flame. When the value of t is 1, the moth is farthest from the flame, and when the value of t is -1, the moth is closest to the flame. The mathematical expression of t is as follows:
[0029] t=(a-1)*rand+1 (7)
[0030] In the formula, rand is used to represent a random number between 0 and 1, and a decreases linearly with the number of algorithm iterations. The mathematical model of a is as follows:
[0031]
[0032] Where It is the current iteration number, and max_It represents the maximum iteration number. Since the parameter a affects t, which will affect the position update of the moth and the flame, in the actual process, a should be smaller and change slower in the later stage of the iteration to increase the local search capability. Therefore, in the present invention, the mathematical model formula of the parameter a is modified as follows:
[0033]
[0034] Update the current positions of the moth and flame according to the fitness value, reorder the updated moth position and flame position according to the fitness value, and select the spatial position with a better fitness value to update it as the position of the next generation flame.
[0035] At the same time, considering that the moth always updates its position according to the flame, it will reduce the ability to search for the global optimal solution. In order to ensure that IMFO has a higher convergence speed and better global search ability, the moth-to-fire algorithm (MFO) adopts an adaptive update mechanism for the number of flames. The number of flames will be adaptively reduced as the iteration increases. The mathematical expression is as follows:
[0036]
[0037] Among them, s n is the number of adaptive flame reduction, N is the maximum number of flames, It is the current iteration number, and max_It is the maximum iteration number.
[0038] (1.5) Determine whether to terminate the improved moth-to-fire algorithm (IMFO) and send the weights and thresholds found by the algorithm to the extreme learning machine (ELM) module
[0039] Determine whether the current number of iterations It is equal to the set maximum number of iterations max_It. If not, proceed to the next round of iterations. Otherwise, the optimal extreme learning machine (ELM) weights and thresholds obtained by the improved moth-to-fire algorithm (IMFO) are sent to the extreme learning machine (ELM) module for training.
[0040] (1.6) Use the training samples to train the parameters β of the extreme learning machine (ELM)
[0041] The ELM network structure consists of an input layer, a hidden layer, and an output layer. The input layer contains n neurons, the hidden layer contains l neurons, and the output layer contains m neurons. i ,h i ), where x i represents the i-th data example, h i represents the label corresponding to the i-th data example. If an activation function f(x) is differentiable in any interval, the output expression of any hidden layer node is as follows:
[0042]
[0043] Among them, ω i =[ω i1 ,ω i2 ,…,ωin ] T is the connection weight between the input layer and the hidden layer; h i =[h i1 ,h i2 ,…,h in ] T is the label corresponding to the i-th data example; e i is the node threshold of the i-th hidden layer, β i =[β i1 , β i2 , ..., β in ] T is the weight between the hidden layer and the output layer, due to the connection weight ω i =[ω i1 ,ω i2 ,…,ω in ] T and threshold e i It has been determined by the Improved Moth-to-Fire Algorithm (IMFO), so now we only need to train the weight β. The output expression of the hidden layer node can be converted into the following formula:
[0044] Qβ=H T (12)
[0045] Where H is the target matrix of the training data, and Q is the output matrix as follows:
[0046]
[0047] The formula for the least squares solution β is as follows:
[0048]
[0049]
[0050] (1.7) Using test samples to test the effect of IMFO-ELM model
[0051] Suppose there are P test samples (x i ,h i ), where x i represents the i-th data example, h i Indicates the label corresponding to the i-th data example. Input the data example of the test sample into formula (12) to obtain the corresponding prediction value The predicted value Compare with the actual value h1h2. If the training result meets the expectation, the training of IMFO-ELM model ends. Otherwise, the training of extreme learning machine (ELM) model continues. In formula (12), the weight ω i =[ω i1 ,ωi2 ,…,ω in ] T and the i-th node threshold e i They are all obtained by iteratively implementing the improved moth-to-fire algorithm (IMFO), and the weight β is obtained by training the training samples using the extreme learning machine (ELM).
[0052] Step 2: Test the effect of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model on load forecasting sample data and compare it with the prediction effect of the traditional forecasting model.
[0053] The present invention uses relative error (RE), root mean square error (RMSE) and mean absolute percentage error (MAPE) to test the effect of the model in load forecasting and compare it with the prediction effect of the traditional forecasting model, where the relative error formula is as follows:
[0054]
[0055] The root mean square error formula is as follows:
[0056]
[0057] The mean absolute percentage error formula is as follows:
[0058]
[0059] Where Num is the number of samples, V i and U i The actual sample value and the predicted value are shown on the computer screen. The prediction effect of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model trained in step 1 is displayed on the computer screen, as well as the root mean square error comparison table, relative error curve comparison chart and power load prediction result comparison chart with the traditional MFO-ELM model and PSO-ELM model. The results are analyzed and it is determined whether the prediction accuracy of the model meets the standard, and whether the improved algorithm model can be applied to abnormal data detection in the audit.
[0060] Step 3: Use the IMFO-ELM model to predict power load
[0061] After the IMFO-ELM model is trained in step one and the prediction effect of the model is verified to be satisfactory through the method described in step two, the trained IMFO-ELM model will be used to predict the electricity load in the audited area.
[0062] Step 4: Use the IMFO-ELM model to compare the power load prediction value with the user's actual power consumption to determine the user's power consumption abnormal points.
[0063] Define the predicted value as the audit value and the predicted curve as the audit curve. Compare the audit value with the actual value to obtain a comparison chart between the audit curve and the actual data curve. The determination of abnormal data points is determined by the relative error percentage (RE) between the predicted value and the actual value, which is defined as follows:
[0064]
[0065] According to formula (19), abnormal points and suspected abnormal points can be found quickly and efficiently from the massive electricity consumption data, and the users at the points can be marked to facilitate the investigation by the power department. The reasons for the generation of abnormal data points include: abnormal data collection by the power department, abnormal power consumption by users, etc. The model proposed in the present invention can effectively narrow the scope of electricity consumption inspection. By comparing the relative error between the inspection value and the actual value, abnormal data can be directly and effectively found in the massive electricity consumption data, which is conducive to the rapid and efficient promotion of power inspection work.
[0066] The above-mentioned intelligent power audit method based on load forecasting provides an intelligent power audit method based on load forecasting. In view of the problem that the current load detection and electricity consumption audit accuracy is not high enough, an improved moth-to-fire algorithm-optimized extreme learning machine (IMFO-ELM) model is proposed for load forecasting. The improved moth-to-fire algorithm (IMFO) in the model is based on the original moth-to-fire algorithm (MFO), and improves the initialization and update methods. The weights and thresholds obtained by IMFO are sent to the extreme learning machine (ELM), which can accurately predict the power load data, and by comparing it with the actual power consumption of the user, the abnormal power consumption data points of the user can be quickly and efficiently screened out.
[0067] The above-mentioned intelligent power audit method based on load forecasting, the moth-to-flame algorithm (MFO) and the extreme learning machine (ELM) model in the IMFO-ELM model are existing technologies and are well known to those skilled in the art.
[0068] In the above-mentioned intelligent power audit method based on load forecasting, the construction of the forecasting model and the input method of each model parameter are well-known methods, and the computer and display are both commercially available.
[0069] The beneficial effects of the present invention are as follows: compared with the prior art, the present invention has the following characteristics:
[0070] (1) The present invention combines an improved moth-in-fire algorithm (IMFO) with an extreme learning machine (ELM), and uses the optimization ability of the improved moth-in-fire algorithm (IMFO) to optimize the weights and thresholds of the extreme learning machine (ELM). When the extreme learning machine (ELM) model is used for load forecasting, the weights and thresholds optimized by the improved moth-in-fire algorithm (IMFO) are used to make the extreme learning machine (ELM) have faster calculation speed and better generalization ability than traditional methods.
[0071] (2) The present invention introduces chaotic mapping into the moth-to-fire algorithm (MFO) to initialize the population, thereby further improving the performance of the algorithm, enabling the algorithm to converge to the optimal value more quickly, reducing the amount of calculation of the algorithm, and avoiding falling into the problem of local optimality.
[0072] (3) The present invention modifies the linear decreasing weight iterative update formula in the moth-to-fire algorithm (MFO) so that the weight is smaller and changes more slowly in the later stage of the iteration, thereby improving the local search capability and further improving the convergence speed, so that the algorithm can converge to the optimal value faster.
[0073] (4) Aiming at the problem of power audit based on load forecasting, the present invention proposes to use the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model to solve the problem. By comparing the prediction results of the IMFO-ELM model with the actual power consumption of the user, the abnormal data points can be quickly and efficiently screened out, and the users at these points can be marked, and the causes of the data anomalies can be further determined, which is convenient for the power department to investigate. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0075] Figure 1 It is a schematic diagram of the audit steps in the intelligent power audit method based on load forecasting provided by the method of the present invention.
[0076] Figure 2 It is a schematic diagram of the training process of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model provided by the method of the present invention.
[0077] Figure 3 It is a schematic diagram comparing the power load prediction results of three models provided in the implementation case of the present invention.
[0078] Figure 4 It is a schematic diagram comparing relative error curves of load prediction of three models provided in the implementation case of the present invention.
[0079] Figure 5It is a schematic diagram comparing the audit curve (prediction curve) and the actual data curve provided by the implementation case of the present invention.
[0080] Figure 6 It is a relative error curve diagram of the audit value (predicted value) and the actual value provided by the implementation case of the present invention. DETAILED DESCRIPTION
[0081] Figure 1 The process of the intelligent power audit method based on load forecasting of the present invention is as follows: start → collect power load data of power users → summarize the power load data of power users → train the IMFO-ELM model → determine whether the prediction effect of the IMFO-ELM model meets the standard. If so, use the IMFO-ELM model to predict the power load; if not, continue to train the IMFO-ELM model → compare the value predicted by the IMFO-ELM for the power load with the actual power consumption of the user → determine whether the actual power consumption of the user exceeds the set value according to the conditions shown in formula (19). If it exceeds the set value, mark the user for deep detection. If it does not exceed the set value, it means that the power consumption of the user is normal.
[0082] Figure 2It shows that the process of the improved moth-to-fire algorithm-optimized extreme learning machine (IMFO-ELM) of the present invention is divided into two parts, the improved moth-to-fire algorithm (IMFO) module and the extreme learning machine (ELM) module. The specific process of the extreme learning machine (ELM) module is to start → determine the test sample and the training sample using known data → initialize the parameters of ELM → use the improved moth-to-fire algorithm (IMFO) to find the optimal ELM model weight and threshold → use the training sample to train the weight between the hidden layer and the output layer of the ELM model, and save the weight → use the test sample to test the improved moth-to-fire algorithm-optimized extreme learning machine (IMFO-ELM) model effect → determine whether the prediction result of the test sample meets the expectation, if so, end, otherwise re-use the training sample to train the weight between the hidden layer and the output layer of the ELM model and save the new weight. The improved moth-to-fire algorithm (IMFO) module specifically initializes the parameters of the improved moth-to-fire algorithm (IMFO): the maximum number of iterations max_It, the current number of iterations It, the moth population size N, etc. → uses the chaotic mapping formula to initialize the population, calculates the corresponding fitness value vector → sorts the moth spatial positions in the order of increasing fitness values and assigns them to the flame as the initial position of the flame → updates the position of the moth according to formula (6), re-sorts the updated positions of the moth and the flame according to the fitness → updates the position of the next generation of flames with the position with a better fitness value, and updates the number of flames according to formula (6) → determines whether the termination condition It=max_It is satisfied. If so, the iteration is terminated, and the weight and threshold obtained by the improved moth-to-fire algorithm (IMFO) are sent to the extreme learning machine (ELM) module for training, otherwise, the next round of iteration is performed and It=It+1.
[0083] In order to illustrate the technical solution of the present invention, a specific implementation case is provided below for illustration.
[0084] Step 1: Train the IMFO-ELM model
[0085] (1.1) Using known data to determine test samples and training samples
[0086] The load forecasting samples from the European Network of Intelligent Technologies (EUNITE) competition were selected, and the power load data for the week from January 1 to 7, 1999 were selected, including a total of 336 sample points. The data of the first five days were used as training samples, and the data of the last two days were used as prediction samples.
[0087] (1.2) Set the relevant parameters of the Improved Moth-to-Flame Algorithm-Optimized Extreme Learning Machine (IMFO-ELM)
[0088] Set the maximum number of iterations max_It=1000, the current number of iterations It=1, the moth population size N=100, etc.
[0089] (1.3) Introducing chaotic mapping to initialize the population of the moth-to-fire algorithm (MFO)
[0090] Although the moth-to-fire algorithm (MFO) has higher solution accuracy than most optimization algorithms, some improvements are still needed to improve the performance of the algorithm. In order to enable the algorithm to converge to the optimal value faster, reduce the amount of calculation of the algorithm, and avoid falling into the local optimum, this study uses chaotic mapping to initialize the population. The specific expression is shown in formula (1).
[0091] where pos max Indicates the maximum value of the search space, pos min Represents the minimum value of the search space, M i is the chaos factor corresponding to the i-th individual.
[0092] (1.4) Calculate the population fitness value and update the positions of moths and flames
[0093] Since the weights and thresholds of the extreme learning machine (ELM) model need to be initialized and kept at a constant value during training, but random initialization will affect the speed and accuracy of the calculation, the improved moth-to-fire algorithm (IMFO) is used in the present invention to optimize the initial parameters.
[0094] In the IMFO algorithm, the position of the moth is defined as the problem to be solved, and the flame is defined as the local optimal position searched by the moth. The optimal solution is searched by updating the position of the moth in the iterative process. The expression of the moth position is shown in formula (2). N,D represents the position of the Nth moth in the Dth dimensional space, N represents the size of the moth population, and D is the dimension of the problem represented by the moth. Substituting the position of the moth into the fitness function, the fitness matrix of the moth is shown in formula (3). In the formula, is the fitness corresponding to the Nth moth. Similarly, each moth corresponds to a flame during flight, and the flame position matrix and fitness matrix are shown in equations (4) and (5). fla is the position matrix corresponding to the flame, fla i,j Corresponding to the position of the i-th flame in the j-dimensional space; Fit fla is the fitness matrix corresponding to the flame position, and each vector in the matrix is the fitness corresponding to the flame position. The positions of the moth and the flame are updated differently in each iteration, that is, the update strategy is different. The moth moves towards the flame in a spiral and cannot exceed the search space during the flight. The position update formula is shown in formula (6). Where b is the defined spiral factor; fla j is the position corresponding to the jth flame; Dis iis the distance between the ith moth and the flame; t is used to define the size of the distance between the moth and the flame. When the value of t is 1, the moth is farthest from the flame, and when the value of t is -1, the moth is closest to the flame. The mathematical expression of t is shown in formula (7). In the formula, rand is used to represent a random number between 0 and 1, and a decreases linearly with the number of algorithm iterations. The mathematical model of a is shown in formula (8). Where It is the current number of iterations, and max_It represents the maximum number of iterations. Since t affected by parameter a will affect the position update of moths and flames, in the actual process, a should be smaller and change slower in the later stage of iteration to increase the local search capability. Therefore, in the present invention, the mathematical model formula of parameter a is modified as shown in formula (9). The positions of the current moth and flame are updated according to the fitness value, and the updated moth position and flame position are reordered according to the fitness value, and the spatial position with a better fitness value is selected to update the position of the next generation of flames. At the same time, considering that the moth always updates its position according to the flame, it will reduce the ability to search for the global optimal solution. In order to ensure that IMFO has a higher convergence speed and better global search ability, the moth-to-fire algorithm (MFO) adopts an adaptive update mechanism for the number of flames. The number of flames will be adaptively reduced with the increase of iterations. The mathematical expression is shown in formula (10), where s n is the number of adaptive flame reduction, N is the maximum number of flames, It is the current iteration number, and max_It is the maximum iteration number.
[0095] (1.5) Determine whether to terminate the improved moth-to-fire algorithm (IMFO) and send the weights and thresholds found by the algorithm to the extreme learning machine (ELM) module
[0096] Determine whether the current number of iterations It is equal to the set maximum number of iterations max_It. If not, proceed to the next round of iterations. Otherwise, the optimal extreme learning machine (ELM) model weights and thresholds obtained by the improved moth-to-fire algorithm (IMFO) are sent to the extreme learning machine (ELM) module for training.
[0097] (1.6) Use the training samples to train the parameters β of the extreme learning machine (ELM) model
[0098] The ELM network structure consists of an input layer, a hidden layer, and an output layer. The input layer contains n neurons, the hidden layer contains l neurons, and the output layer contains m neurons. i ,h i ), where x i represents the i-th data example, h irepresents the label corresponding to the i-th data example. In this example, the training sample uses the data from the previous 5 days. If an activation function f(x) is differentiable in any interval, then the output expression of any hidden layer node is as shown in formula (11). i =[ω i1 ,ω i2 ,…,ω in ] T is the connection weight between the input layer and the hidden layer; h i =[h i1 ,h i2 ,…,h in ] T is the label corresponding to the i-th data example; e i is the node threshold of the i-th hidden layer, β i =[β i1 , β i2 , ..., β in ] T is the weight between the hidden layer and the output layer, due to the connection weight ω i =[ω i1 ,ω i2 ,…,ω in ] T and threshold e i It has been determined by the improved moth-to-fire algorithm (IMFO), so we only need to train the weight β now. The output expression of the hidden layer node can be converted to as shown in Equation (12), where H is the target matrix of the training data, Q is the output matrix as shown in Equation (13), and the least squares solution β is solved as shown in Equation (14) and Equation (15).
[0099] (1.7) Using test samples to test the effect of IMFO-ELM model
[0100] Suppose there are P test samples (x i ,h i ), where x i represents the i-th data example, h i Indicates the label corresponding to the i-th data example. In this example, the test sample uses the data from the last two days. Input the data instance of the test sample into formula (12) to obtain the corresponding prediction value The predicted value Compare with the actual value h1h2. If the training result meets the expectation, the training of IMFO-ELM model ends. Otherwise, the training of extreme learning machine (ELM) model continues. In formula (12), the weight ω i =[ω i1 ,ω i2 ,…,ω in ] T and the i-th node threshold ei They are all obtained by iteratively implementing the improved moth-to-fire algorithm (IMFO), and the weight β is obtained by training the training samples using the extreme learning machine (ELM).
[0101] Step 2: Test the effect of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model on load forecasting sample data and compare it with the prediction effect of the traditional forecasting model.
[0102] The root mean square error comparison table, relative error curve comparison chart and power load forecast result comparison chart of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model trained in step 1 and the traditional MFO-ELM model and PSO-ELM model are displayed on the display screen of the computer. The present invention uses relative error (RE), root mean square error (RMSE) and mean absolute percentage error (MAPE) to test the effect of the model, wherein the relative error formula, root mean square error formula and mean absolute percentage error are shown in formulas (16)(17)(18). Wherein, Num is the number of samples, V is the number of samples, and i and U i are the actual sample value and the predicted value respectively. The root mean square error comparison of the model is shown in Table 1.
[0103] Table 1. Comparison of model root mean square error
[0104]
[0105] From this table, it can be seen that the root mean square error value of the IMFO_ELM model is the smallest, and the optimization effect of the MFO algorithm is better than that of the traditional particle swarm algorithm. The error value of the ELM model optimized by the improved MFO algorithm is 1.92% smaller than that before the improvement, indicating that the prediction accuracy of the model proposed in the present invention is significantly improved.
[0106] Figure 3 , Figure 4 The graph is a graph of the power load forecast result and the relative error curve. It can be seen intuitively from the graph that compared with the PSO-ELM model and the PSO-ELM model, the predicted value obtained by the IMFO-ELM model is closest to the original value, the prediction curve almost coincides with the original load curve, and the relative error curve fluctuates slightly around the zero value, with the smallest error. This proves that the model proposed by the invention has high prediction accuracy and can be applied to abnormal data detection in power consumption inspections.
[0107] Step 3: Use the IMFO-ELM model to predict power load
[0108] The load data from January 1 to January 6, 1999 of the European Network of Intelligent Technologies (EUNITE) competition were selected. The 24-hour load data from January 1 to January 5 were taken as training data, and the load data on January 6 was taken as prediction data. The IMFO-ELM model was used and the method described in step 1 was used to train the IMFO-ELM model and then perform load prediction.
[0109] Step 4: Use the IMFO-ELM model to compare the power load prediction value with the user's actual power consumption to determine the user's power consumption abnormal points.
[0110] Define the predicted value as the audit value and the predicted curve as the audit curve. Compare the audit value with the actual value to obtain a comparison chart of the audit curve and the actual data curve. Figure 5 As shown. Figure 5 The overall trend of the audit value and the actual value at most points is consistent, but there are cases where the actual value is obviously higher or lower at some moments, which can be analyzed as the key object of power audit. Figure 6 is the relative error curve between the audit value and the actual value. The determination of abnormal data points is determined by the relative error percentage (RE) between the predicted value and the actual value, which is defined as shown in formula (19). According to formula (19), abnormal points and suspected abnormal points can be quickly and efficiently found from the massive electricity consumption data, and the users at the points can be marked to facilitate the investigation of the power department. Figure 6 It can be seen that at 17:00, 17:30, 21:00, and 23:30, the relative error between the audit value and the actual value exceeds ±10%, which is a data anomaly point; at 1:00, 2:00, 3:00, and 20:30, the relative error between the audit value and the actual value is between ±5% and ±10%, which is a suspected anomaly point. The reasons for this situation include: abnormal data collection in the power department, abnormal power consumption of users, etc. The model proposed in the present invention can effectively narrow the scope of power consumption audits. By comparing the relative error between the audit value and the actual value, abnormal data can be directly and effectively found in the massive power consumption data, which is conducive to the rapid and efficient promotion of power audit work.
[0111] The above is a relatively complete implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope published by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. An intelligent power audit method based on load forecasting, characterized in that The improved moth-to-fire algorithm-optimized extreme learning machine (IMFO-ELM) model is used to predict power load, and power inspection is performed by comparing the predicted value with the actual value. The steps are as follows: Step 1: Train the IMFO-ELM model (1.1) Using known data to determine test samples and training samples The known non-abnormal electricity load data is segmented into training samples and prediction samples. The non-abnormal user refers to the user who has no abnormal electricity consumption behavior. The training samples are used to train the IMFO-ELM model, and the prediction samples are used to test the prediction effect of the trained IMFO-ELM model. (1.2) Set the relevant parameters of the Improved Moth-to-Flame Algorithm-Optimized Extreme Learning Machine (IMFO-ELM) model The initial parameters of the improved moth-to-fire algorithm (IMFO) are set: the maximum number of iterations max_It, the current number of iterations It, and the moth population size N. The initial parameters of the extreme learning machine (ELM), i.e., the weight and threshold, are obtained by optimizing and iterating the improved moth-to-fire algorithm (IMFO) in the present invention, so there is no need to initialize these parameters; (1.3) Introducing chaotic mapping to initialize the population of the moth-to-fire algorithm Chaotic mapping is introduced to initialize the population of the moth-to-flame algorithm, improve the performance of the algorithm, enable the algorithm to converge to the optimal value faster, reduce the amount of calculation of the algorithm, and avoid falling into the problem of local optimality. The specific expression of chaotic mapping is as follows: pos i =pos max +M i (pos max -pos min ) (1) where pos max Indicates the maximum value of the search space, pos min Represents the minimum value of the search space, M i is the chaos factor corresponding to the i-th individual; (1.4) Calculate the population fitness value and update the positions of moths and flames Since the weights and thresholds of the extreme learning machine (ELM) model need to be initialized and kept at a fixed value during training, but random initialization will affect the speed and accuracy of the calculation, the improved moth-to-fire algorithm (IMFO) is used in the present invention to optimize the initial parameters; In IMFO, the position of the moth is defined as the problem to be solved, and the flame is defined as the local optimal position searched by the moth. The optimal solution is searched by updating the position of the moth in the iterative process. The expression of the moth's position is as follows: In the formula, pmo N,D represents the position of the Nth moth in the Dth dimensional space, N represents the size of the moth population, and D is the dimension of the problem represented by the moth. Substituting the position of the moth into the fitness function, the fitness matrix of the moth is as follows: In the formula, is the fitness corresponding to the Nth moth. Similarly, each moth corresponds to a flame when flying. The position matrix and fitness matrix of the flame are as follows: Among them, POS fla is the position matrix corresponding to the flame, fla i,j Corresponding to the position of the i-th flame in the j-dimensional space; Fit fla is the fitness matrix corresponding to the flame position. Each vector in the matrix is the fitness corresponding to the flame position. The positions of the moth and the flame are updated differently in each iteration, that is, the update strategy is different. The moth moves towards the flame in a spiral and cannot exceed the search space during the flight. The position update formula is as follows: pmo i =Dis i *e bt *cos(2πt)+fla j (6) Where b is the defined spiral factor; fla j is the position corresponding to the jth flame; Dis i is the distance between the ith moth and the flame; t is used to define the distance between the moth and the flame. When the value of t is 1, the moth is farthest from the flame, and when the value of t is -1, the moth is closest to the flame. The mathematical expression of t is as follows: t=(a-1)*rand+1 (7) In the formula, rand is used to represent a random number between 0 and 1, and a decreases linearly with the number of algorithm iterations. The mathematical model of a is as follows: Where It is the current iteration number, and max_It represents the maximum iteration number; since t affected by parameter a will affect the position update of the moth and the flame, in the actual process, a should be smaller and change slower in the later stage of the iteration to increase the local search capability. Therefore, in the present invention, the mathematical model formula of parameter a is modified as follows: Update the positions of the current moth and flame according to the fitness value, reorder the updated moth position and flame position according to the fitness value, and select the spatial position with a better fitness value to update it as the position of the next generation flame; At the same time, considering that the moth always updates its position according to the flame, it will reduce the ability to search for the global optimal solution. In order to ensure that IMFO has a higher convergence speed and better global search ability, the moth-to-fire algorithm adopts an adaptive update mechanism for the number of flames. The number of flames will be adaptively reduced as the iteration increases. The mathematical expression is as follows: Among them, s n is the number of adaptive flame reduction, N is the maximum number of flames, It is the current number of iterations, and max_It is the maximum number of iterations; (1.5) Determine whether to terminate the improved moth-to-fire algorithm (IMFO) and send the weights and thresholds found by the algorithm to the extreme learning machine (ELM) module Determine whether the current number of iterations It is equal to the set maximum number of iterations max_It. If not, proceed to the next round of iterations. Otherwise, the optimal extreme learning machine (ELM) model weights and thresholds obtained by the improved moth-to-fire algorithm (IMFO) are sent to the extreme learning machine (ELM) module for training. (1.6) Use the training samples to train the parameters β of the extreme learning machine (ELM) model The ELM network structure consists of an input layer, a hidden layer, and an output layer. The input layer contains n neurons, the hidden layer contains 1 neuron, and the output layer contains m neurons. There are P training samples (x i ,h i ), where x i represents the i-th data example, h i Represents the label corresponding to the i-th data example, an activation function f(x) that is differentiable in any interval, then the output expression of any hidden layer node is as follows: Among them, ω i =[ω i1 ,ω i2 ,…,ω in ] T is the connection weight between the input layer and the hidden layer; h i =[h i1 ,h i2 ,…,h in ] T is the label corresponding to the i-th data example; e i is the node threshold of the i-th hidden layer, β i =[β i1 , β i2 , ..., β in ] T is the weight between the hidden layer and the output layer, due to the connection weight ω i =[ω i1 ,ω i2 ,…,ω in ] T and threshold e i It has been determined by the Improved Moth-to-Fire Algorithm (IMFO), so now we only need to train the weight β, and the output expression of the hidden layer node can be converted into the following formula: Qβ=H T (12) Where H is the target matrix of the training data, and Q is the output matrix as follows: The formula for the least squares solution β is as follows: (1.7) Using test samples to test the effect of IMFO-ELM model Suppose there are P test samples (x i ,h i ), where x i represents the i-th data example, h i represents the label corresponding to the i-th data example; input the data instance of the test sample into formula (12) to obtain the corresponding prediction value The predicted value Compare with the actual value h1h2. If the training result meets the expectation, the training of IMFO-ELM model ends, otherwise the training of extreme learning machine (ELM) model continues. In formula (12), the weight ω i =[ω i1 ,ω i2 ,…,ω in ] T and the i-th node threshold e i They are all obtained by iteratively applying the improved moth-to-fire algorithm (IMFO), and the weight β is obtained by training the training samples through the extreme learning machine (ELM); Step 2: Test the effect of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model on load forecasting sample data and compare it with the prediction effect of the traditional forecasting model. The present invention uses relative error (RE), root mean square error (RMSE) and mean absolute percentage error (MAPE) to test the effect of the model in load forecasting and compare it with the prediction effect of the traditional forecasting model, where the relative error formula is as follows: The root mean square error formula is as follows: The mean absolute percentage error formula is as follows: Where Num is the number of samples, V i and U i The actual value and predicted value of the samples are displayed on the computer screen. The root mean square error comparison table, relative error curve comparison chart and power load forecast result comparison chart of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model trained in step 1 and the traditional MFO-ELM model and PSO-ELM model are displayed. The results are analyzed and it is determined whether the prediction accuracy of the model meets the standard, and whether the improved algorithm model can be applied to abnormal data detection in the audit. Step 3: Use the IMFO-ELM model to predict power load After the IMFO-ELM model is trained in step 1 and the prediction effect of the model is verified to be up to standard by the method described in step 2, the trained IMFO-ELM model is used to predict the power load; Step 4: Use the IMFO-ELM model to compare the power load prediction value with the user's actual power consumption to determine the user's power consumption abnormality point; Define the predicted value as the audit value, and the predicted curve as the audit curve. Compare the audit value with the actual value to obtain a comparison chart between the audit curve and the actual data curve. The determination of abnormal data points is determined by the relative error percentage (RE) between the predicted value and the actual value, which is defined as follows: According to formula (19), abnormal points and suspected abnormal points can be found quickly and efficiently from massive electricity consumption data, and the users at the points can be marked to facilitate the investigation by the power department. The reasons for the abnormal data points are: abnormal data collection by the power department and abnormal power consumption by users. The model proposed in the present invention can effectively narrow the scope of electricity consumption audit. By comparing the relative error between the audit value and the actual value, abnormal data can be directly and effectively found in massive electricity consumption data, which is conducive to the rapid and efficient promotion of power audit work.
2. According to claim 1, a smart power audit method based on load forecasting is characterized in that: The improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model improves the prediction effect of the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model by introducing chaotic mapping to initialize the population and modifying the linear decreasing weight iterative update formula, so that the improved moth-to-flame algorithm-optimized extreme learning machine (IMFO-ELM) model can accurately and quickly predict power load data, which is convenient for power departments to conduct power inspections.
