Novel electric power system electricity larceny prevention early warning method based on zebra optimization algorithm and SRF-KELM model

By combining the Zebra optimization algorithm and the SRF-KELM model, the efficiency and accuracy problems of traditional power system electricity theft detection are solved, achieving efficient and accurate electricity theft early warning. It is suitable for complex scenarios in new power systems, reducing the cost of manual inspection and improving detection accuracy.

CN120951141APending Publication Date: 2025-11-14KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511174373.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Traditional methods for detecting electricity theft in power systems rely on manual inspections, which consume a lot of manpower and resources and cannot meet the detection needs of complex and diverse loads in new power systems. In particular, when the amount of data increases significantly and becomes unbalanced, the accuracy and computational resource efficiency are limited.

Method used

The SRF-KELM multi-classification model optimized by the Zebra Optimization Algorithm (ZOA) combines the features of voltage imbalance coefficient, current imbalance coefficient and current correlation coefficient. It uses a resampling strategy and Kernel Extreme Learning Machine (KELM) to provide early warning of electricity theft behavior. It uses the RFF approximation RBF kernel to reduce computational resources and optimizes the model parameters through ZOA to improve detection accuracy and efficiency.

Benefits of technology

It enables efficient and accurate early warning of electricity theft in the power system, reduces false alarms and missed alarms, supports flexible hierarchical management of different user behaviors, reduces manual inspection costs, and is suitable for edge intelligence and continuous optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120951141A_ABST
    Figure CN120951141A_ABST
Patent Text Reader

Abstract

The invention provides an electric power system electricity larceny prevention early warning method based on a zebra optimization algorithm and an SRF-KELM model, and belongs to the field of power grid electricity larceny prevention. The method comprises the following steps: firstly, extracting key power consumption behavior characteristics such as a voltage unbalance coefficient, a current unbalance coefficient and a current correlation coefficient, and grading and classifying the power consumption behaviors of a user by combining probability analysis; by applying resampling strategies such as oversampling and undersampling, the problem of sample category imbalance is effectively relieved. And a zebra optimization algorithm (ZOA) is utilized to optimize SRF-KELM multi-classification model parameters, so that the detection accuracy of the electricity stealing behavior and the operation efficiency of the system are improved. The method is suitable for a large-scale complex power consumption scene, can help a power supply enterprise to find abnormal and suspicious users in time, reduces the labor cost, reduces the economic loss caused by electricity stealing, and has good edge intelligent deployment and continuous optimization capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power grid anti-electricity theft, and more specifically relates to a novel power system anti-electricity theft early warning method based on the Zebra optimization algorithm and the SRF-KELM model. Background Technology

[0002] Electricity theft and other abnormal electricity usage behaviors are the main source of non-technical losses in the power system, posing a serious threat to the safe, stable, and reliable operation of the power grid. Traditional methods for detecting abnormal electricity usage behaviors rely on manual inspections, which consume a lot of human and material resources and can no longer meet practical needs.

[0003] In recent years, with the development of new power systems, the power sector has widely applied and deployed a large number of data acquisition sensors in six major stages: power generation, transmission, transformation, distribution, consumption, and dispatch. These sensors collect and record data from various aspects of the power system dozens of times a day. This data contains information on the electricity consumption behavior of different users and provides strong indirect evidence for detecting abnormal electricity consumption. How to quickly and effectively process this large amount of information is key to improving the detection of abnormal electricity consumption.

[0004] Previous researchers have conducted extensive studies in the fields of electricity theft and anti-theft. Deng Mingbin et al. proposed an abnormal electricity consumption model based on multi-feature fusion, combining the characteristics of electricity theft. Xiong Zeyu designed a remote electricity theft identification system based on decision trees, utilizing four features including current and voltage. After studying various electricity theft behaviors, Geng Ankun proposed a machine learning-based anti-theft method by combining multi-feature fusion and K-means clustering algorithm. Zeng Chongli designed a method for finding abnormal electricity consumption in transformer substations based on cluster correlation analysis, addressing the diverse electricity consumption characteristics of users in the substation area and the shortcomings of traditional anti-theft methods.

[0005] With the widespread adoption of emerging technologies such as electric vehicles, smart homes, and renewable energy, electricity loads have become more complex and diverse. This has led to a significant increase in data volume and introduced intermittency and unpredictability, limiting the accuracy and computational efficiency of traditional electricity consumption monitoring and theft detection methods. Summary of the Invention

[0006] This invention proposes a method combining ZOA-optimized SRF with a KELM model to improve the detection accuracy and efficiency of large-scale anti-electricity theft early warning systems. By adopting this model system, power companies can focus on checking for abnormal and suspicious users, improving the accuracy and efficiency of inspections, and ultimately reducing economic losses caused by electricity theft. In future edge cloud systems, TinyML's micro-training technology can achieve continuous device-side model optimization of this integrated framework, ensuring consistent detection performance against ever-changing electricity theft methods.

[0007] To achieve the above objectives, the present invention employs the following technical solution: the method comprises:

[0008] Electricity consumption behavior features were extracted, including voltage imbalance coefficient, current imbalance coefficient, and current correlation coefficient.

[0009] Electricity consumption behavior probability analysis assesses users' electricity consumption behavior and then classifies users accordingly;

[0010] Resampling strategies balance classes by modifying the class distribution in the dataset, and there are two methods: oversampling and undersampling.

[0011] A multi-classification model based on the Zebra Optimization Algorithm (Z0A) was constructed to provide early warning for electricity theft.

[0012] In one scheme, the voltage imbalance coefficient is used because illegal connections or unreasonable load distribution can lead to voltage imbalance when electricity theft occurs. The voltage imbalance coefficient reflects the degree of inconsistency of the three-phase voltage under insufficient voltage in the power grid, and therefore serves as a characteristic for judging whether a user is stealing electricity.

[0013] The current imbalance coefficient is used to determine whether electricity theft has occurred. Electricity theft is caused by illegal devices connected to a single phase line, which can lead to current imbalance.

[0014] The current correlation coefficient indicates that there is a small abnormal current, and vice versa.

[0015] In one approach, the electricity consumption behavior probability analysis integrates multiple features to assess users' electricity consumption behavior and then classifies users.

[0016] The data is calculated based on three features: voltage imbalance coefficient, current imbalance coefficient, and current correlation coefficient. The data is then divided into three categories through clustering. The power data is further converted into normal probability, abnormal probability, and suspicious probability by introducing a probability distribution method. User behavior is then marked based on the abnormal probability and suspicious probability.

[0017] In one approach, the SRF-KELM multi-class classification model optimized by the Zebra Optimization Algorithm (Z0A) includes:

[0018] KELM is used to implicitly map power data to a high-dimensional feature space using kernel functions, thus achieving stronger stability and generalization ability.

[0019] The computational resource reduction strategy uses RFF to approximate the RBF kernel, thereby improving computational efficiency. The purpose of RFF is to approximate the high-dimensional RBF kernel with a low-dimensional feature map through random sampling. It is expressed through the inverse Fourier transform, and the properties of the Fourier transform allow the use of low-dimensional random features for approximation.

[0020] The ZOA algorithm is used to optimize the parameters in the KELM model.

[0021] In one approach, the KELM uses a kernel function to implicitly map power data to a high-dimensional feature space, specifically:

[0022] KELM's output function is

[0023] In the formula, x is the input of the neural network; β is the weight value of the output; h(x) is the feature map; H is the output matrix of the hidden layer; T is the target expected output; and C is the penalty coefficient.

[0024] Introducing RBF:

[0025]

[0026] In the formula x i ,x j Represents two eigenvectors; γ is the kernel coefficient:

[0027]

[0028] When calculating the output matrix, the selection of the penalty coefficient C and the kernel coefficient γ has a significant impact on the performance of KELM. The coefficient C determines the trade-off between minimizing the fitting error and minimizing the standard input weights; the coefficient γ determines the nonlinear mapping from the input space to a certain high-dimensional feature space; by further optimizing these two parameters, the optimal values ​​are selected to build the KELM model.

[0029] In one approach, the optimization of parameters in the KELM model using the ZOA algorithm includes: the foraging phase and the defense phase.

[0030] In one scheme, the foraging phase includes:

[0031] During the foraging phase, each zebra individual attempts to update its location to improve fitness using the following formula:

[0032]

[0033] In the formula: This represents the new position of the i-th zebra individual in the j-th dimension during Part 1 (foraging behavior); F i Represents the fitness value; where This can be expressed by the following formula:

[0034]

[0035] In the formula: x i,j PZ represents the position of the i-th zebra in the j-th dimension at the current moment; j Let represent the position of the vanguard zebra in the j-th dimension; the range of the random number r is [0,1]; and the decision factor I is a random value taken from the set {1,2}.

[0036] In one approach, the defense phase includes:

[0037] Based on the random number P s To select a defense strategy, where P s It is a random number in the range [0,1]. If P s If the value is less than 0.5, use escape strategy S1; otherwise, use attack strategy S2; new position The calculation method is shown in equation (11):

[0038]

[0039] In the formula: R is the reaction intensity coefficient; T is the maximum number of iterations; AZ j Let zebra be the state of the zebra being attacked in the j-th dimension;

[0040] Similar to the foraging phase, when updating the zebra's position, if the zebra has a better objective function value at the new position, then the new position is accepted; otherwise, the original position is maintained.

[0041]

[0042] Beneficial effects of this invention:

[0043] This invention achieves efficient and accurate early warning of electricity theft in power systems by combining the Zebra Optimization Algorithm with the SRF-KELM model. This method effectively mines and identifies abnormal electricity consumption characteristics, improving detection accuracy in large-scale and complex scenarios. Simultaneously, it optimizes model performance to address data imbalance issues, reducing false positives and false negatives. The system supports flexible hierarchical classification of different user behaviors, facilitating precise management, reducing manual inspection costs, and ultimately helping power supply companies promptly detect electricity theft and minimize economic losses. Furthermore, this method is suitable for edge intelligence and continuous optimization, possessing broad application prospects. Attached Figure Description

[0044] Figure 1 This is a flowchart of the method of the present invention;

[0045] Figure 2 This is a flowchart of the KELM algorithm of this invention;

[0046] Figure 3 This is a flowchart of the KELM process optimized by ZOA according to the present invention;

[0047] Figure 4 This is a clustering effect diagram of one embodiment of the present invention;

[0048] Figure 5 This is a comparison chart of the test set before and after optimization in one embodiment of the present invention;

[0049] Figure 6 This is a confusion matrix of different sampling methods according to an embodiment of the present invention;

[0050] Figure 7 This is a comparison of KELM accuracy and resampling K value in one embodiment of the present invention;

[0051] Figure 8 This is a comparison chart of the running time of one embodiment of the present invention;

[0052] Figure 9 This is an accuracy comparison chart of one embodiment of the present invention;

[0053] Figure 10 This is a KernelAlignment Score Comparison Chart according to an embodiment of the present invention;

[0054] Figure 11 This is a performance comparison chart of an embodiment of the present invention. Detailed Implementation

[0055] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Typical embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

[0056] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. To facilitate understanding, the invention will now be described more fully with reference to the accompanying drawings. Typical embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the invention more thorough and complete.

[0057] like Figure 1As shown, the specific implementation steps of a novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model of the present invention are as follows:

[0058] Step 1: Extract electricity consumption behavior features, including voltage imbalance coefficient, current imbalance coefficient, and current correlation coefficient.

[0059] Electricity theft is not a random activity of electricity use, but rather a deliberate attempt by users to reduce the amount of electricity recorded by the meter in order to reduce their electricity bills. Because electricity theft has a clear objective, its voltage and current readings often follow certain patterns. Based on this observation, these regular patterns can be used as key characteristics for identifying electricity theft. The basic descriptions of these characteristics are as follows:

[0060] Feature 1: Voltage Unbalance Coefficient. When electricity theft occurs, illegal connections or improper load distribution can lead to voltage imbalance. The voltage imbalance coefficient reflects the degree of inconsistency in the three-phase voltages under insufficient voltage conditions in the power grid. Therefore, it can be used as a characteristic to judge whether a user is stealing electricity. It can be calculated using the following formula:

[0061] d=a(u) / m(u) (1)

[0062] In the formula: d represents the voltage imbalance coefficient; a(u) represents the absolute deviation of the three-phase voltage; m(u) represents the average value of the three-phase voltage.

[0063] Feature Two: Current Unbalance Coefficient. Similar to the voltage imbalance coefficient, electricity theft may involve illegal devices connected to a single phase line, causing current imbalance. The current imbalance coefficient reflects whether the three-phase currents are balanced, thus determining whether electricity theft has occurred. It can be calculated using the following formula:

[0064] l=a(I) / m(I) (2)

[0065] In the formula: l represents the current imbalance coefficient; a(I) represents the average absolute deviation of the three-phase current; m(I) represents the average value of the three-phase current.

[0066] Feature 3: Current Correlation Coefficient. The three-phase current correlation coefficient mainly refers to the synchronous operation of loads on three-phase lines. The operating trajectories of the three-phase current data differ significantly, and there is a certain correlation between the current values ​​measured on each phase line. The results show that a larger current correlation value indicates a smaller current abnormality, and vice versa.

[0067] Step 2: Electricity consumption behavior probability analysis to assess users' electricity consumption behavior and then classify users.

[0068] Since various power characteristics of a power system are independent of each other, it is necessary to integrate multiple characteristics to assess users' electricity consumption behavior and then classify users. Using the three power characteristics mentioned above, individual values ​​are calculated, and the data is divided into three categories through clustering. Then, a probability distribution method is introduced to convert the power data into normal probability, abnormal probability, and suspicious probability. These probabilities can then be used to label user behavior. For each characteristic, the probability of normal, suspicious, and abnormal occurrences is calculated using the following method. The probability of the normal characteristic is:

[0069]

[0070] In the formula: m(z) represents the probability of normal features; N(z) represents the number of times normal features appear within the recognition period; N(x) represents the number of times suspicious features appear within the recognition period; N(y) represents the number of times abnormal features appear within the recognition period.

[0071] The probability of suspect characteristics is:

[0072]

[0073] The probability of the abnormal feature is:

[0074]

[0075] Treating the abnormality of user electricity consumption behavior as a decision problem, the aforementioned feature probabilities are calculated, and all probabilities are compared to obtain a label for the user's electricity consumption status. This label can then be used to label and feed the raw data, allowing for the training of a KELM model.

[0076] Step 3: Resampling strategy, which balances the classes by modifying the class distribution in the dataset, includes two methods: oversampling and undersampling.

[0077] In new power systems, the diversity, intermittency, randomness of electricity loads, user interactivity, and system intelligence increase the complexity of electricity consumption data. Particularly in electricity theft detection, the imbalance between legal and illegal electricity consumption data significantly affects detection accuracy. To address this challenge, resampling techniques have become a key strategy. These techniques balance the categories by modifying the class distribution in the dataset, and are mainly divided into two methods: oversampling and undersampling.

[0078] Oversampling methods reduce class imbalance by increasing the number of minority class samples. This is typically done by synthesizing new minority class instances. The most well-known oversampling technique is the Synthetic Minority Over-sampling Technique (SMOTE). The basic idea of ​​SMOTE is to randomly select samples from its k nearest neighbors for each minority class sample and interpolate between them to generate new samples. The mathematical principle of SMOTE can be expressed as:

[0079] x new =x i +λ×(x nn -x i (6)

[0080] In the formula: x i It is a value in a minority class; x nn Represents x i A nearest neighbor; λ is a random number in [0,1]; x new This is the synthesized new sample value.

[0081] In oversampling techniques, variants of the SMOTE algorithm, such as Borderline-SMOTE and KMeansSMOTE, provide powerful tools for optimization in specific scenarios. Borderline-SMOTE focuses on generating new samples at the boundary between the majority and minority classes. It identifies and operates only on minority class samples at those boundaries, which are considered to have a significant impact on classifier performance due to their critical position in classification decisions. This method aims to mitigate the problem of misclassification that classifiers are prone to in boundary regions. KMeansSMOTE first clusters the data using the KMeans algorithm to establish the data community structure, and then applies the SMOTE algorithm within each minority class community. This strategy, combining clustering and oversampling, not only maintains the inherent structure of the data but also effectively generates highly representative synthetic samples, further enhancing the model's ability to identify the minority class. These two methods optimize for different aspects of the imbalanced data problem, thereby improving recognition accuracy.

[0082] Undersampling: In contrast to oversampling, undersampling techniques balance the class distribution by removing some instances of the majority class. Although this method may result in information loss, it can improve computational efficiency by removing redundant and noisy samples.

[0083] In undersampling techniques, random undersampling provides an intuitive method to achieve class distribution balance by randomly removing samples from the majority class. However, this simple method may lead to the loss of crucial information. To avoid this problem, more sophisticated techniques such as Tomek Links and Edited Nearest Neighbors (ENN) have been developed, which can more intelligently identify and remove specific samples. Tomek Links identifies and removes pairs of samples that are adjacent in the feature space but belong to different classes; by removing these samples, the clarity of the decision boundary can be enhanced. On the other hand, the ENN method reduces noise in the data by removing samples whose most nearest neighbors belong to other classes, especially for samples located near the decision boundary. This method effectively improves the accuracy of the classifier in judging boundary regions by precisely adjusting the selection of samples, while preserving important information in the dataset.

[0084] By using the methods described above, the accuracy of model predictions for minority classes can be improved without sacrificing too much information.

[0085] Step 4: Construct an SRF-KELM multi-classification model optimized based on the Zebra Optimization Algorithm (ZOA) to provide early warning for electricity theft.

[0086] (1) Nuclear Limit Learning Machine

[0087] The traditional Extreme Learning Machine (ELM) is a single-hidden-layer neural network that is easy to learn and performs well. Compared to other learning methods, ELM has advantages in learning ability and generalization. For nonlinear problems, ELM models are prone to poor generalization ability and training results. Therefore, KELM uses kernel functions to implicitly map power data to a high-dimensional feature space, thereby achieving stronger stability and generalization ability.

[0088] KELM's output function is

[0089]

[0090] In the formula, x is the input of the neural network; β is the weight value of the output; h(x) is the feature map; H is the output matrix of the hidden layer; T is the target expected output; and C is the penalty coefficient.

[0091] Introducing the Radial Basis Function (RBF):

[0092]

[0093] In the formula x i ,x jLet represent two eigenvectors; γ is the kernel coefficient. Substituting equation (2) into equation (1), we obtain the kernel limit learning machine model as follows:

[0094]

[0095] When calculating the output matrix using equation (8), the selection of the penalty coefficient C and the kernel coefficient γ has a significant impact on the performance of KELM. The coefficient C determines the trade-off between minimizing the fitting error and minimizing the input weight standard. The coefficient γ determines the nonlinear mapping from the input space to a certain high-dimensional feature space. Therefore, the optimal values ​​can be selected to establish the KELM model by further optimizing these two parameters. The KELM algorithm flowchart is shown below. Figure 2 As shown:

[0096] (2) Strategies to reduce computing resources

[0097] In new power systems, the amount of user data is often enormous. Directly using the RBF kernel in KELM may lead to excessive computation and resource consumption. Therefore, Random Fourier Features (RFF) can be used to approximate the RBF kernel to improve computational efficiency. The purpose of RFF is to approximate a high-dimensional RBF kernel with a low-dimensional feature map through random sampling. This is based on Bochner's theorem, which states that a translation-invariant kernel (such as the RBF kernel) can be expressed by the inverse Fourier transform of its Fourier transform, and the properties of the Fourier transform allow the use of low-dimensional random features for approximation. Specifically, the mapping expression of RFF is Equation (9):

[0098] In the formula: z(x) is the new mapping feature, D is the feature mapping dimension, ω1,…,ω D It is obtained by random sampling from the distribution of the Fourier transform corresponding to the RBF kernel, b1,…,b D It is the offset sampled from a uniform distribution in [0, 2π].

[0099] While random sampling offers computational convenience, it may be insufficient to capture the full complexity of highly structured power system data. To improve the uniformity of feature space coverage and reduce sampling errors, this study introduces Quasi-Random Fourier Features (QRFF). Using a low-dissimilarity sequence, the Sobol sequence, to generate weights, QRFF provides a more nuanced and uniform feature representation of the data's diversity and randomness.

[0100] Meanwhile, to further enhance performance in capturing the distributed and intermittent characteristics of electricity load data, this study also explored Structured Random Features (SRF). By applying the Hadamard transform to impose a specific structure on random weights, SRF utilizes the inherent structure of the data to enhance the accuracy of kernel approximation, especially for highly distributed load characteristics.

[0101] These three methods are all designed to meet the needs of power system load data analysis. They optimize the RBF kernel approximation process from different perspectives, ensuring that while improving computational efficiency, the accuracy of the model and its sensitivity to complex data patterns are not sacrificed. These kernel approximation methods can reduce computational resources for training KELM models.

[0102] (3) ZOA-KELM detection model

[0103] Zebra Optimization Algorithm (ZOA) is an optimization algorithm inspired by the foraging and defense behaviors of zebras. It treats problem solutions as individual zebras and guides the search process by simulating the dynamics of the zebra herd. The algorithm refines local solutions through foraging behavior and explores global solutions through defense mechanisms, thus balancing meticulous search with broad-area exploration to efficiently find the optimal solution.

[0104] The ZOA algorithm consists of two phases:

[0105] (1) Foraging stage

[0106] During the foraging phase, each zebra individual attempts to update its location to improve fitness using the following formula:

[0107] In the formula: This represents the new position of the i-th zebra individual in the j-th dimension during Part 1 (foraging behavior); F i Represents the fitness value; where Expressed using equation (11):

[0108]

[0109] In the formula: x i,j PZ represents the position of the i-th zebra in the j-th dimension at the current moment; j Let represent the position of the vanguard zebra in the j-th dimension; the range of the random number r is [0,1]; and the decision factor I is a random value taken from the set {1,2}.

[0110] (2) Defense Phase

[0111] Based on the random number P s To select a defense strategy, where P sIt is a random number in the range [0,1]. If P s If the value is less than 0.5, use escape strategy S1; otherwise, use attack strategy S2. New position. The calculation method is shown in equation (11):

[0112]

[0113] In the formula: R is the reaction intensity coefficient; T is the maximum number of iterations; AZ j Let zebra be the state of the zebra being attacked in the j-th dimension.

[0114] Similar to the foraging phase, when updating the zebra's position, if the zebra has a better objective function value at the new position, then the new position is accepted; otherwise, the original position is maintained.

[0115]

[0116] The process of using ZOA to optimize parameters in a KELM model is as follows: Figure 3 As shown.

[0117] Example:

[0118] Data provided by a provincial power grid was used as the simulation classification dataset, containing 40,992 data points. Each row includes six features: three-phase current and three-phase voltage, but does not include labels for user electricity consumption status. The electricity consumption behavior probabilistic analysis proposed above was applied to this dataset, and a label injection operation was performed.

[0119] 1. Experimental Data and Preprocessing

[0120] Three characteristic values ​​are calculated using three-phase voltage and three-phase current. Then, clustering is used to divide the data into three categories, obtaining the state under each characteristic. Finally, the state probability is calculated through electricity consumption behavior probability analysis to obtain the electricity consumption label at that moment. The clustering effect is as follows: Figure 4 As shown.

[0121] The classification results show that "abnormal" users are not evenly distributed across the three features, especially feature one, where all "abnormal" data is concentrated at the tail of the dataset. Therefore, subsequent dataset segmentation should employ a random selection method. The status of each feature and the final decision status are shown in Table 1.

[0122]

[0123] Observing the final judgment results in Table 1, there are a large number of normal data and only a very small number of abnormal data, which is reasonable. In real-world scenarios, there are not a large number of electricity theft users. Therefore, the data label injection in this study is reasonable. Based on the labeled data, the data is divided. The dataset is randomly selected using a fixed random seed of 42. Sixty percent is used as the training set, twenty percent as the validation set, and the remaining twenty percent as the test set.

[0124] 2. ZOA-KELM Anomaly Detection

[0125] The KELM kernel parameters and penalty factor were optimized using ZOA. The specific parameters of the optimization algorithm were: 30 zebra individuals; a maximum of 50 iterations; a response strength coefficient of 0.01; and the fitness function was the classification accuracy of KELM on the validation set under these parameter combinations. The initial parameters for the pioneer zebras were set to (C = 10, γ = 10), and the mapping dimension for RFF was set to 500. The specific process was as follows: Figure 3 As shown.

[0126] After 50 generations of model optimization, optimal values ​​for two key parameters were obtained. The optimal penalty coefficient was 25.28535112171948, and the optimal kernel parameter was 1.3716317778431468. With this combination, the classification accuracy on the validation set was 89.78%. Classification was performed using both the original and optimized parameters, and the classification results on the test set before and after parameter optimization are shown below. Figure 5 As shown.

[0127] In the test data, there were 6172 normal users, 1336 suspicious users, and 661 abnormal users. In the unoptimized confusion matrix, the model's classification accuracy for normal users was approximately 77.8%, while the accuracy for suspicious and abnormal users was 63.5% and 42.9%, respectively. This result indicates that while the model performs well in identifying normal users, it faces significant challenges in distinguishing between suspicious and abnormal users.

[0128] Subsequently, the parameters in KELM were adjusted using the Zebra optimization algorithm. This step significantly improved classification performance, especially in identifying abnormal users. The optimized confusion matrix showed that the accuracy of identifying normal users increased to 96.4%, while the accuracy of identifying suspicious and abnormal users increased to 66.4% and 74.6%, respectively.

[0129] Although the model's classification accuracy has been significantly improved after parameter optimization, the accuracy in identifying abnormal and suspicious users still does not meet the application standard. This is due to the imbalance of the dataset itself. As can be seen from Table 1, the proportion of abnormal users is extremely small, which is insufficient for the model to learn the patterns of abnormal users. Therefore, it is necessary to balance and retrain the data.

[0130] 3. Evaluation of resampled data

[0131] Training KELM with the unsampled raw data revealed that the model's performance fell short of expectations. This is likely due to dataset imbalance, which is particularly common in the analysis of electricity load data in new power systems. To address this issue and optimize model performance, four different resampling strategies were employed to balance the class distribution. The nearest neighbor count K was set to 3 for each sampling method. The choice of this parameter will be discussed in detail in the following study. The data distribution after resampling is shown in Table 2.

[0132]

[0133] In the table: No Resampling is the control group, which does not undergo any resampling and directly uses the original distribution of the data; Borderline+SMOTE+ENN refers to using BorderlineSMOTE and Edited Nearest Neighbours (ENN) to process samples at the boundary between the majority and minority classes, enhancing the model's ability to identify boundary samples; BorderlineSMOTE+ClusterCentroids refers to using BorderlineSMOTE to generate minority class samples close to the decision boundary and using ClusterCentroids for undersampling to reduce potential bias caused by majority class samples; KMeansSMOTE+TomekLinks refers to combining KMeansSMOTE and TomekLinks, clustering the data before performing SMOTE oversampling, and then removing nearest neighbor pairs of samples belonging to different classes using TomekLinks; SMOTE+Tomek refers to using SMOTE oversampling and TomekLinks cleanup to improve the model's identification of the minority class.

[0134] The resampled data were then used to train the optimized KELM model, and the classification accuracy for each class and the overall classification accuracy for each dataset were recorded. The formula for calculating the classification accuracy for each class is as follows:

[0135]

[0136] In the formula: P t This refers to the accuracy of class t; N to N refers to the number of elements in the t-th class in the original data; tp This refers to the amount of data correctly classified into class t. The overall classification accuracy is calculated using the following formula:

[0137]

[0138] In the formula: P a This refers to the overall classification accuracy; N a This refers to the sum of all data in the confusion matrix; N d This refers to the sum of the data values ​​on the diagonal of the confusion matrix.

[0139] The classification results for each dataset are shown in Table 3:

[0140]

[0141] Without resampling, the model achieved high accuracy in classifying normal electricity users, but performed poorly in classifying suspicious and abnormal electricity users. This reflects the negative impact of data imbalance on model performance, especially in identifying less frequently occurring categories.

[0142] After employing the KMeansSMOTE+TomekLinks resampling technique, the overall test set accuracy of the model significantly improved to 94.11%, and the classification accuracy across all categories was balanced, particularly achieving a high accuracy of 0.99 for abnormal electricity users. This demonstrates that appropriate resampling techniques can significantly improve the model's ability to handle imbalanced data, especially for detecting difficult-to-identify abnormal electricity usage behaviors. Similarly, other resampling techniques such as BorderlineSMOTE+ClusterCentroids and Borderline+SMOTE+ENN also improved the classification accuracy for suspicious and abnormal electricity users. This indicates that composite resampling techniques can effectively improve the model's identification of the minority class, thereby enhancing overall classification performance. The confusion matrix provides a more intuitive evaluation of the model's classification performance across different data types; therefore, the confusion matrix is ​​plotted as follows. Figure 6 As shown:

[0143] In-depth analysis of these confusion matrices reveals that the KMeansSMOTE+TomekLinks technique is the optimal resampling strategy for the KELM model, exhibiting high accuracy and fewer misclassifications in distinguishing between normal, suspicious, and abnormal electricity users. While other methods also improve the identification of minority classes, they are relatively insufficient in reducing misclassifications of suspicious users, especially when misclassifying suspicious users as abnormal users. Therefore, selecting an appropriate resampling strategy is crucial for improving the accuracy and practicality of electricity user classification models, which is particularly critical in real-world power monitoring and anomaly detection applications.

[0144] In summary, appropriate resampling techniques can effectively address the data imbalance problem and improve the classification accuracy of models in complex scenarios. The KMeansSMOTE+TomekLinks technique performed best in this case, particularly in improving the accuracy of identifying users with abnormal electricity consumption, demonstrating its superiority in handling imbalanced datasets. This is of great significance for the monitoring and anomaly detection of new power systems.

[0145] 4. Parameter and Approximation Method Analysis

[0146] Resampling parameter analysis

[0147] The nearest neighbor parameter K plays a crucial role in data resampling techniques. This parameter determines the number of surrounding samples to be considered when generating new synthetic samples or deleting existing ones. For SMOTE and its variants BorderlineSMOTE and KMeansSMOTE, as well as the undersampling technique ENN, this parameter specifies the number of nearest neighbor samples used in determining the sample neighborhood and subsequent operations.

[0148] To evaluate the sensitivity of K and its impact on data processing performance, this study conducted experiments using different K values ​​on the resampling strategy described in section 4.3. By comparing the overall classification accuracy of the model for each integer value of K in the range [1, 10], the degree of influence of this parameter on model performance can be assessed. Figure 7 Performance analysis charts for different sampling strategies under optimal parameters:

[0149] After analyzing different resampling methods and their impact on the number of nearest neighbors K, it was observed that KMeansSMOTE+TomekLinks performed best with high and stable accuracy in the range of smaller K values ​​(1–3), especially achieving an accuracy of 94.11% when K=3. This may be because KMeansSMOTE can maintain the structural characteristics of the data when creating synthetic samples, and the TomekLinks cleaning mechanism is relatively gentle in removing class overlap. In contrast, the Borderline+SMOTE+ENN method showed a gradual decrease in accuracy as the K value increased, from 93.51% to 87.26%, indicating that increasing the number of nearest neighbors may have led to an overly aggressive cleaning process, removing some key data points.

[0150] In the context of novel power system data, the data structure exhibits high complexity and subtle variations. This necessitates that resampling techniques not only generate high-quality synthetic samples but also employ appropriate cleaning mechanisms to ensure accurate data representation. KMeansSMOTE+TomekLinks demonstrates its ability to adapt to this complexity and maintain high model accuracy due to its balance between synthetic sample generation and data cleaning. Therefore, this method is recommended for data analysis and pattern recognition of novel power systems, with careful selection of a smaller K value to achieve stable and highly accurate classification results.

[0151] RBF approximation method and parameter analysis

[0152] As discussed earlier, the resampling strategy combining KMeansSMOTE and TomekLinks effectively balances the accuracy of user behavior recognition. However, Table 2 shows that the dataset is quite large. Directly applying the RBF kernel to such large datasets encounters computational bottlenecks and incurs high time costs. Therefore, with a fixed random seed of 42, 5000 samples were randomly selected from the dataset to evaluate the impact of QRFF, SRF, RFF, and RBF on runtime, classification accuracy, and kernel alignment degree under conditions where the number of components for kernel approximation is between 100 and 2000 (in increments of 100). Figure 8 This is a comparison chart of runtime.

[0153] like Figure 8The results show that the RBF kernel has a significantly longer execution time compared to other methods, ranging from 2.5 to 3 seconds. Conversely, the kernel approximation techniques QRFF and SRF exhibit significantly shorter execution times, both below 0.5 seconds. Although RFF has a longer execution time than QRFF and SRF, it is still significantly shorter than the RBF kernel. Therefore, considering computational resource constraints, QRFF and SRF are more suitable for processing large-scale datasets due to their lower time cost, while the RFF kernel performs slightly worse in this regard.

[0154] Figure 9 This paper demonstrates the accuracy of different kernel approximation methods in the task of user behavior recognition in novel power systems, as the number of kernel approximation components varies. Since the RBF kernel is unaffected by the number of kernel approximation components, its accuracy remains constant, exhibiting a straight line exceeding 92%. For the three approximation methods QRFF, SRF, and RFF, it can be observed that the accuracy of RFF and SRF becomes relatively stable after reaching a sufficient number of components, eventually approaching the performance of the RBF kernel, while the accuracy of QRFF exhibits greater fluctuations.

[0155] Core alignment is an indicator of the consistency between a kernel approximation method and the ideal RBF kernel. A value closer to 1 indicates that the approximate kernel is closer to the ideal RBF kernel, and thus more likely to maintain the performance of the RBF kernel. Analysis Figure 10 As can be seen, the RBF core, as a reference standard, has a constant alignment of 1. The SRF method's core alignment increases rapidly when the number of components is less than 500, and stabilizes above 0.9 after approximately 1000 components, showing a good approximation effect. The RFF core alignment starts below 0.8 and approaches 1 when the number of components increases to 2000, demonstrating the potential to approach the ideal RBF core with a sufficient number of components. QRFF, however, exhibits significant fluctuations, indicating greater instability in its alignment. In summary, the SRF and RFF approximation methods perform well in terms of core alignment and are suitable for replacing the RBF core while maintaining similar performance when resources are limited.

[0156] In the task of identifying user behavior in novel power systems, a comprehensive evaluation based on execution time, classification accuracy, and kernel alignment shows that the SRF and RFF kernel approximation methods exhibit more stable and superior performance compared to QRFF. Although the RBF kernel demonstrates the highest classification accuracy, its computational resource consumption is extremely high, making it unsuitable for large-scale data processing. The SRF and RFF methods, while maintaining accuracy close to that of the RBF kernel, significantly reduce execution time and exhibit higher kernel alignment, meaning they can better approximate the RBF kernel as the number of components increases. Therefore, SRF and RFF are more suitable kernel approximation methods for use under computationally limited conditions, as they can effectively balance computational efficiency and performance. QRFF, due to its fluctuations in accuracy and alignment, is not the optimal choice. To determine the performance difference between SRF and RFF, by observing Figures 7, 8, and 9, it can be seen that the performance of these two methods is most similar when the number of data sets is 1000. Therefore, both methods were used to train the original data with 1000 data sets and the KELM model parameters described in Conclusion 4.2, instead of the sampled 5000 data sets. The table below shows the average results of five runs:

[0157]

[0158] In the practical application of user behavior recognition in new power systems, the selection of kernel approximation methods for the KELM model was based on a comparison of the running time and accuracy of the SRF and RFF methods on the full dataset. The SRF method demonstrated its superiority with a shorter running time of 2.482 seconds and a relatively high accuracy of 93.35%. Although the RFF method achieved slightly higher accuracy than SRF (93.77%), its running time was much longer at 4.622 seconds, almost twice that of SRF. Considering both efficiency and performance, especially under limited computational resources, the SRF method offered a more balanced compromise between efficiency and accuracy. Therefore, SRF was ultimately chosen as the kernel approximation method, as it not only meets the accuracy requirements of user behavior recognition in new power systems but also ensures high computational efficiency.

[0159] Comparison of Heuristic Algorithms

[0160] Two parameters in KELM were optimized using the Genetic Algorithm (GA), Differential Evolution (DE), and Particle Swarm Optimization (PSO) algorithms, respectively. The parameter set was then used to classify the test set to verify the parameter optimization performance of the ZOA algorithm in this problem. The parameter boundaries of each algorithm were [(0.1, 100), (0, 1, 5)], the population size was 30, and the number of iterations was 50.

[0161] Based on Python platform coding, training was performed on resampled data using KMeansSMOTE and TomekLinks. Different optimization algorithms were used to optimize the parameters, and the classification accuracy on the test set and the optimization time of each algorithm under these parameters were statistically analyzed. Results are as follows: Figure 11 As shown.

[0162] from Figure 11 It is evident that the ZOA algorithm significantly outperforms the other three algorithms, achieving an excellent score of 0.9392, while the scores of the other algorithms hover around 0.8413. This significant difference highlights the powerful optimization capability of the ZOA algorithm in the KELM parameter optimization process, enabling it to effectively avoid local optima. In contrast, the GA, PSO, and DE algorithms, due to their different search methods, may encounter similar local optima problems.

[0163] In terms of computation time, the ZOA algorithm not only demonstrates superior optimization performance but also exhibits a significant advantage in computational efficiency. The ZOA algorithm takes 1972.70 seconds to run, while the GA, PSO, and DE algorithms require 2018.15 seconds, 2095.27 seconds, and 4532.12 seconds, respectively. Therefore, compared to GA, the ZOA algorithm is 2.25% faster; compared to PSO, it is 5.86% faster; and compared to the most time-consuming DE algorithm, the ZOA algorithm reduces the running time by more than half, a reduction of 56.45%.

[0164] Overall, the ZOA algorithm demonstrated its excellence in this KELM parameter optimization experiment. Whether in pursuing higher quality solutions or in terms of operational efficiency, the ZOA algorithm showed superior performance compared to other algorithms.

[0165] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0166] It should be understood that the above detailed description of the technical solutions of the present invention with reference to preferred embodiments is illustrative and not restrictive. Those skilled in the art can modify the technical solutions described in the embodiments or make equivalent substitutions for some of the technical features based on reading this specification; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model, characterized in that: The method includes: Electricity consumption behavior features were extracted, including voltage imbalance coefficient, current imbalance coefficient, and current correlation coefficient. Electricity consumption behavior probability analysis assesses users' electricity consumption behavior and then classifies users accordingly; Resampling strategies balance classes by modifying the class distribution in the dataset, and there are two methods: oversampling and undersampling. A multi-classification model based on the Zebra Optimization Algorithm (Z0A) was constructed to provide early warning for electricity theft.

2. The novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model according to claim 1, characterized in that: The voltage imbalance coefficient mentioned above refers to the voltage imbalance that occurs when electricity theft occurs due to illegal connections or unreasonable load distribution. The voltage imbalance coefficient reflects the degree of inconsistency of the three-phase voltage under insufficient voltage conditions in the power grid, and therefore serves as a characteristic for judging whether a user is stealing electricity. The current imbalance coefficient is used to determine whether electricity theft has occurred. Electricity theft is caused by illegal devices connected to a single phase line, which can lead to current imbalance. The current correlation coefficient indicates that there is a small abnormal current, and vice versa.

3. A novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model as described in claim 1, characterized in that: The aforementioned electricity consumption behavior probability analysis integrates multiple features to assess users' electricity consumption behavior and then classifies users. By using three features—voltage imbalance coefficient, current imbalance coefficient, and current correlation coefficient—variable values ​​are calculated. The data is then divided into three categories through clustering. Furthermore, by introducing probability distribution, the power data is converted into normal probability, abnormal probability, and suspicious probability. Finally, user behavior is marked using the abnormal probability and suspicious probability.

4. A novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model as described in claim 1, characterized in that: The SRF-KELM multi-class classification model optimized by the Zebra Optimization Algorithm (Z0A) includes: KELM is used to implicitly map power data to a high-dimensional feature space using kernel functions, thus achieving stronger stability and generalization ability. The computational resource reduction strategy uses RFF to approximate the RBF kernel, thereby improving computational efficiency. The purpose of RFF is to approximate the high-dimensional RBF kernel with a low-dimensional feature map through random sampling. It is expressed through the inverse Fourier transform, and the properties of the Fourier transform allow the use of low-dimensional random features for approximation. The ZOA algorithm is used to optimize the parameters in the KELM model.

5. A novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model according to claim 4, characterized in that: The KELM described above uses kernel functions to implicitly map power data to a high-dimensional feature space, specifically: KELM's output function is In the formula This serves as the input to the neural network; These are the weight values ​​for the output; For feature mapping; It is the output matrix of the hidden layer; It is the target expected output. Let RBF be the penalty coefficient; introduce RBF: In the formula Represent two eigenvectors; For kernel coefficients: Penalty coefficient when calculating the output matrix Kernel coefficient The selection of coefficients affects KELM performance; This determines the trade-off between minimizing the fitting error and minimizing the input weight standard; the coefficients A nonlinear mapping from the input space to a certain high-dimensional feature space was determined; by further optimizing these two parameters, the optimal values ​​were selected to build the KELM model.

6. A novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model according to claim 4, characterized in that: The optimization of parameters in the KELM model using the ZOA algorithm includes the foraging phase and the defense phase.

7. A novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model as described in claim 6, characterized in that: The foraging phase includes: During the foraging phase, each zebra individual attempts to update its location to improve fitness using the following formula: In the formula: This represents the new position of the i-th zebra individual in the j-th dimension during Part 1 (foraging behavior); Represents the fitness value; where This can be expressed by the following formula: In the formula: This indicates the position of the i-th zebra in the j-th dimension at the current moment; Indicates the position of the vanguard zebra in the j-th dimension; random number. The range is [0,1]; the decision factor is a random value taken from the set {1,2}.

8. A novel power system anti-electricity theft early warning method based on the Zebra Optimization Algorithm and the SRF-KELM model according to claim 6, characterized in that: The defense phase includes: Based on random numbers To choose a defense strategy, among which It is a random number in the range [0,1]; if If the value is less than 0.5, an escape strategy is adopted. Otherwise, adopt an offensive strategy. New location The calculation method is shown in equation (11): In the formula: R is the reaction intensity coefficient; T is the maximum number of iterations; Let zebra be the state of the zebra being attacked in the j-th dimension; Similar to the foraging phase, when updating the zebra's position, if the zebra has a better objective function value at the new position, then the new position is accepted; otherwise, the original position is maintained. .