An intelligent detection method for abnormal power consumption
Through clustering algorithms and feature cross-border networks, user category features are extracted in abnormal power detection, and the network interaction timing characteristics are normalized using conditional hierarchy, which solves the problem of poor detection accuracy in the existing technology, and achieves high accuracy and high reliability abnormal electrical detection.
Patent Information
- Application Number
- CN202311575884.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2043-11-23
AI Technical Summary
The prior art fails to fully consider the diversity of users and the periodicity of electricity use habits in abnormal electricity use detection, resulting in poor detection accuracy and high false alarm rate.
The clustering algorithm is used to extract user category features, combine multi-layer feature cross-border networks and conditional hierarchical normalization networks, and build an abnormal electricity detection model through feature cross-border and timing feature interactions to reduce false alarm rates and improve detection accuracy.
It significantly improves the accuracy of abnormal electricity detection, with high accuracy, high timeliness, high reliability and high automation.
Smart Images

Figure CN117786564B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of abnormal power consumption detection, and in particular relates to an intelligent abnormal power consumption detection method. Background Art
[0002] With the continuous development of the power system, the number of electricity users is also increasing. However, due to various reasons, some users may have abnormal electricity usage behaviors, such as electricity theft, overload electricity usage, etc. These abnormal electricity usage behaviors will not only affect the normal operation of the power system, causing huge economic losses to the power company, but also cause unnecessary losses to other users. Therefore, it is crucial to improve the power company's power management level and increase the crackdown on electricity theft. To implement this series of measures, the first thing is to detect and identify abnormal electricity usage behaviors of power users, so it is becoming more and more important to use big data to detect abnormal electricity usage behaviors of power users.
[0003] For the task of detecting abnormal power consumption behavior of power users, commonly used methods include anomaly detection technology based on machine learning and data mining, anomaly detection technology based on expert systems, and anomaly detection technology based on deep learning and clustering algorithms. Anomaly detection technology based on machine learning and data mining often depends on a specific environment. A system cannot be adaptively applied to power grid anomaly detection in all regions. At the same time, since the boundary between normal behavior and abnormal behavior is very vague, the use of machine learning methods may produce a high false alarm rate; anomaly detection technology based on expert systems often requires experienced experts to build and maintain feature libraries. For power grid systems throughout the country, the power consumption habits and environmental changes in each region are different, which requires a high level of experience from experts; anomaly detection technology based on deep learning and clustering algorithms, through the support of big data and the nonlinear fitting ability of deep learning, can effectively find the internal connection between data, and there is no need to manually find the optimal features.
[0004] However, traditional deep learning-based methods do not take into account or even completely ignore the diversity of users and the periodicity of their electricity usage habits. They often directly input the time series data of users' electricity usage into the deep time series network for abnormal user detection, which results in poor detection accuracy. In view of this, there is an urgent need for an abnormal electricity usage detection method that can fully consider the diversity of users and the periodicity of their electricity usage habits, so as to improve the accuracy of abnormal electricity usage detection. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention proposes an intelligent detection method for abnormal power consumption.
[0006] An intelligent detection method for abnormal power consumption comprises the following steps:
[0007] Acquire the power grid user data to be detected;
[0008] The power grid user data to be detected is input into the trained abnormal power consumption detection model, and the abnormal power consumption detection results of the power grid users are output.
[0009] The training process of the abnormal power consumption detection model includes:
[0010] S1: Obtain a model training sample, which is a labeled power grid user dataset, which includes power consumption recording time, daily power consumption value, week, user resident population and house area;
[0011] S2: Extract the user's daily electricity consumption behavior characterization vector sequence and the user's electricity consumption behavior characterization vector from the power grid user data set;
[0012] S3: clustering the user's electricity consumption behavior representation vector using a clustering algorithm to obtain user category features;
[0013] S4: using an embedding model to convert discrete data into corresponding continuous feature vectors, the discrete data including the user category characteristics, week, user resident population and house area;
[0014] S5: concatenate the user's electricity consumption behavior characterization vector and the continuous feature vector and input them into a multi-layer feature cross network to obtain a feature cross vector of the user's electricity consumption behavior;
[0015] S6: Input the user's daily electricity consumption behavior characterization vector sequence into the conditional hierarchical normalization network and the maximum pooling network to obtain the user's related behavior characterization vector;
[0016] S7: The feature cross vector and the user-related behavior representation vector are concatenated and input into a fully connected neural network for binary classification to obtain a classification result. The model classification loss is calculated based on the classification result. The model parameters are adjusted based on the loss. The training is iterated. The training ends when the loss function converges to obtain a trained abnormal power consumption detection model.
[0017] The beneficial effects of the present invention are as follows: the present invention can weaken the influence of the number of permanent residents, the floor area of houses, etc. on electricity consumption when clustering through a specific clustering algorithm. After weakening these influences, the categories mined are the categories that truly classify the user's electricity consumption behavior, thereby obtaining user category features that are more valuable for analysis and utilization; the use of a feature cross network solves the problem that the traditional machine learning model may ignore certain cross features when manually extracting features. Through the feature cross network, the continuous features and the category features are fully allowed to interact with each other, reducing the false alarm rate of the model and improving the detection accuracy; the conditional hierarchical normalization network is used to interact with the time series features at each time step, fully mining the periodicity and diversity of different users' electricity consumption behavior habits, providing the most effective feature vector for the prediction of the final model, which is conducive to improving the detection accuracy. The method provided by the present invention fully considers the influence of the characteristics of electricity consumption behavior such as the diversity of users and the periodicity of users' electricity consumption habits, significantly improves the accuracy of abnormal electricity consumption detection, and has the advantages of high precision, high timeliness, high reliability, and high degree of automation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flowchart of the steps of the abnormal power consumption detection model training process in the present invention;
[0019] Figure 2 It is a schematic diagram of the model structure and data processing flow of the abnormal power consumption detection model in the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The embodiment of the present invention provides an abnormal power consumption intelligent detection method, which comprises the following steps:
[0022] Acquire the power grid user data to be detected;
[0023] The power grid user data to be detected is input into the trained abnormal power consumption detection model, and the abnormal power consumption detection results of the power grid users are output.
[0024] like Figure 1 As shown, the training process of the abnormal power consumption detection model includes:
[0025] S1: Obtain model training samples, which are labeled grid user datasets, including electricity consumption recording time, daily electricity consumption value, week, number of permanent residents and house area. Grid users are all real-name registered users, and information such as the number of permanent residents and the area of the user's house can be investigated during registration. With the promotion and popularization of smart meters, the information of smart meters can be fed back in time through the network, and the electricity consumption recording time, daily electricity consumption value, week, real-time electricity consumption value, cumulative electricity consumption value and other information of grid users can be obtained in real time.
[0026] Preferably, the power grid user data set is manually labeled, and a label 1 indicates that the user is an abnormal power user, and a label 0 indicates that the user is a normal power user, thereby obtaining a labeled power grid user data set.
[0027] S2: Extract the user's daily electricity consumption behavior characterization vector sequence and user electricity consumption behavior characterization vector from the power grid user dataset.
[0028] Preferably, step S2 specifically includes the following steps:
[0029] S21: Obtain the daily power consumption value in the power grid user data set, construct a daily power consumption characterization vector with a length of 24 based on the daily power consumption value in units of hours, and standardize it to obtain a standardized daily power consumption characterization vector. The daily power consumption value is a data set obtained after processing the historical power consumption values of power grid users. Standardization is used to reduce the impact of the huge difference in values between nighttime power consumption and daytime power consumption on the model. The standardization formula is:
[0030]
[0031] Among them, N v represents the normalized feature vector, v i Represents the value of the i-th dimension in the vector.
[0032] S22: The above-mentioned standardized daily electricity consumption characterization vectors of the adjacent 7 days are concatenated in the time dimension and input into the LSTM model. The hidden layer output obtained by the LSTM model is used as the user's daily electricity consumption behavior characterization vector sequence. The final output obtained by the LSTM model is used as the user's electricity consumption behavior characterization vector.
[0033] The LSTM model has the advantages of capturing the long-term dependency of time series data and suppressing gradient disappearance. The hidden layer output obtained by the LSTM model is used as a sequence of vectors representing the user's daily electricity consumption behavior. At this time, each vector in the sequence of vectors representing the user's daily electricity consumption behavior contains the relevant information of each daily electricity consumption representation vector before this vector; the final output obtained by the LSTM model is used as the user's electricity consumption behavior representation vector. This vector has the relevant information of all daily electricity consumption representation vectors for the adjacent 7 days (i.e., one week), which is convenient for predicting the electricity consumption situation on the next day.
[0034] The dimension size of the user's daily electricity consumption behavior characterization vector sequence is (batch_size, 7, inner_dim), and the dimension size of the user's electricity consumption behavior characterization vector is (batch_size, inner_dim).
[0035] S3: clustering the user's electricity consumption behavior representation vector using a clustering algorithm to obtain user category features.
[0036] In the existing abnormal power consumption detection technology, only conventional electrical indicators such as power consumption, voltage, and current are often used to monitor abnormal power consumption. However, power grid users are diverse and their power consumption habits are also different. The present invention fully refers to the power consumption values of power grid users, the number of permanent residents of users, the floor area of houses and other influencing factors to form a data set, among which the number of permanent residents and the floor area generally have a great influence on power consumption. These data are processed and weakened through a specific clustering algorithm. The categories mined are the categories that truly classify the user's power consumption behavior, thereby obtaining the category characteristics of users with more analysis and utilization value.
[0037] Preferably, the user's electricity consumption behavior characterization vector is input into the focal-means clustering algorithm model, the number of cluster centers is determined by the elbow method, the number of cluster centers is used as the number of classifications of the user category, the distance between each user and the cluster center is calculated by the distance formula of the focal-means clustering algorithm, and the category corresponding to the cluster center is determined according to the distance as the category feature of the user. Generally, the distance between each user and the cluster center is calculated by the distance formula, and the category corresponding to the cluster center with the smallest distance is used as the category feature of the user.
[0038] The distance calculation formula of the focal-means clustering algorithm is:
[0039]
[0040] Among them, x i represents the i-th dimension in the vector representing the power consumption behavior of user x, c i represents the i-th dimension in the cluster center representation vector c, represents the average number of permanent residents in the households of all users belonging to the cluster center c. It is initialized as the average number of permanent residents in the households of all users. μ represents the number of permanent residents in the households of user x. A a represents the floor space of the house of user x, It represents the average floor area of all users belonging to the cluster center c, and is initialized to the average floor area of all users. This specific clustering algorithm can weaken the impact of the number of permanent residents, floor area, etc. on electricity consumption when clustering, thereby deeply mining some characteristics of users' electricity consumption behavior and clustering based on these characteristics.
[0041] The specific method of the elbow method in determining the number of cluster centers is: by enumerating the number of clusters from small to large, and calculating the sum of squared errors under the current number of clusters, the number of clusters is used as the horizontal coordinate, and the sum of squared errors corresponding to the current number of clusters is used as the vertical coordinate. The slope between each point and the previous point is calculated. When the slope change is the largest, the corresponding number of clusters is the number of clusters we need. The formula for the sum of squared errors is:
[0042]
[0043] Among them, SSE represents the sum of squared errors, K represents the number of clusters, and C i represents the i-th cluster center vector, and x represents the user's electricity consumption behavior characterization vector.
[0044] S4: Using an embedding model, discrete data is converted into corresponding continuous feature vectors. The discrete data includes user category characteristics, week, user resident population, and house area.
[0045] Preferably, in step S4, the embedding model is composed of two fully connected layers, and the initialization weight parameters of the fully connected neural network satisfy the Xavier uniform distribution.
[0046] Specifically, the embedding model consists of two fully connected layers and is connected by a residual network. The input feature dimension of the first fully connected network is the sum of the product of each discrete data and the corresponding number of categories, and the output dimension is inner_dim / / 3; the input feature dimension of the second fully connected neural network is inner_dim / / 3, and the output dimension is inner_dim.
[0047] S5: The user power consumption behavior characterization vector obtained in the above step S2 and the continuous feature vector obtained in the above step S4 are concatenated and input into a multi-layer feature cross network to obtain a feature cross vector of the user power consumption behavior.
[0048] Preferably, step S5 comprises:
[0049] S51: The user power consumption behavior characterization vector obtained in the above step S2 and the continuous feature vector obtained in the above step S4 are concatenated in the last dimension to obtain a fused feature vector.
[0050] S52: Input the fused feature vector into a multi-layer feature cross network to obtain a feature cross vector of the user's electricity consumption behavior.
[0051] Preferably, each layer of the multi-layer feature cross network adopts a single-layer feature cross network, and the single-layer feature cross network includes an Elu activation function. The specific formula of the single-layer feature cross network is:
[0052]
[0053] where v l+1 represents the (l+1)th layer feature cross vector in the multi-layer feature cross network, v l represents the feature cross vector of the lth layer, v0 represents the fused feature vector, w l represents the weight parameter in the lth layer, D(x) represents the random activation function, and A(x) represents the Elu activation function.
[0054] The existing feature cross network does not add random deactivation function and activation function. As the number of feature cross network layers increases, the model will overfit. Because not every feature cross is valid, invalid cross features will become noise features in the model, which will have a certain negative impact on model performance. By adding random deactivation function, the feature cross network randomly deactivates the cross features at each layer, which can alleviate the excessive appearance of noise features to a certain extent and increase the generalization ability of the model; at the same time, although the existing feature cross network alleviates the problem of gradient disappearance to a certain extent by using residual connection. However, the entire network model is still a linear model. By adding Elu activation function, on the one hand, the model has some nonlinear capabilities; on the other hand, Elu activation function has certain advantages in solving the problem of gradient disappearance, which indirectly weakens the problem of gradient disappearance faced by multi-layer feature cross network as the number of network layers gradually increases.
[0055] S6: Input the user's daily electricity consumption behavior characterization vector sequence obtained in the above step S2 into the conditional hierarchical normalization network and the maximum pooling network to obtain the user-related behavior characterization vector.
[0056] Preferably, step S6 comprises the following steps:
[0057] S61: Input the user's daily electricity consumption behavior characterization vector sequence obtained in the above step S2 into the conditional hierarchical normalization network to obtain a correlation behavior feature matrix.
[0058] The specific formula of the conditional hierarchical normalization network is:
[0059]
[0060] Where V ij The vector representing the (i, j)th position in the correlation matrix, S ij The vector at the (i, j)th position of the vector sequence representing the user's daily electricity consumption behavior after expansion in the second dimension (dimension [batch_size, 7, 7, inner_dim]), h j represents the jth vector in the vector sequence representing the user's daily electricity consumption behavior, μ represents h j The mean value corresponding to the vector, σ represents h j The standard deviation corresponding to the vector, Indicates the splicing operation. j Dividing by a certain weight is to prevent h j The numerical value of each element in is large, which is not conducive to gradient update. Through the splicing operation, we get V ij The information representation between the current i-th day and the j-th day will be obtained at the same time.
[0061] S62: Input the above correlation behavior feature matrix into a two-dimensional maximum pooling network with a convolution kernel of 7 to obtain a user correlation behavior representation vector.
[0062] S7: Concatenate the feature cross vector obtained in the above step S5 and the user-related behavior representation vector obtained in the above step S6, and input them into a fully connected neural network for binary classification to obtain a classification result; calculate the model classification loss according to the classification result, adjust the model parameters according to the loss, and when the loss function converges, the training ends to obtain the trained abnormal power consumption detection model.
[0063] Calculate the total model loss, i.e. the fully connected classification loss:
[0064]
[0065] Among them, loss represents the full connection classification loss, n represents the number of users, and y i Indicates the true label of whether the i-th user is an abnormal user, represents the model's probability prediction value of whether the i-th user is an abnormal user, η represents the regularization parameter, l represents the number of layers of the multi-layer cross network. As the number of cross network layers increases, the model is more likely to overfit, so the regularization term increases with the increase in the number of cross network layers, θj Represents the parameters of the jth layer in a multi-layer cross network.
[0066] Using the above loss function, calculating the model classification loss and adjusting the model parameters according to the loss can effectively prevent the feature cross-network from overfitting due to the large number of network layers, thereby improving the detection accuracy of the model.
[0067] like Figure 2 As shown, the abnormal power consumption detection method provided in the embodiment of the present application, wherein the model structure of the abnormal power consumption detection model mainly includes a multi-layer feature cross network, a conditional hierarchical normalization network, a maximum pooling network and a fully connected neural network. The abnormal power consumption detection method provided in the embodiment of the present application, during the abnormal power consumption detection model training process, the specific process of data processing is as follows:
[0068] After the above step S1, the power grid user data set is manually labeled to obtain a labeled power grid user data set.
[0069] After the above step S2, based on the standardized processing of the power grid user data set, the LSTM model is used to extract the user's daily electricity consumption behavior characterization vector sequence and the user's electricity consumption behavior characterization vector.
[0070] After the above step S3, a clustering algorithm is used to cluster the user's electricity consumption behavior characterization vector to obtain user category features.
[0071] After the above step S4, the embedding model is used to convert discrete data such as user category characteristics, week, user resident population and house area into corresponding continuous feature vectors.
[0072] After the above step S5, the user's electricity consumption behavior characterization vector and the continuous feature vector are concatenated and input into a multi-layer feature cross network to obtain a feature cross vector of the user's electricity consumption behavior.
[0073] After the above step S6, the user's daily electricity consumption behavior characterization vector sequence is input into the conditional hierarchical normalization network and the maximum pooling network to obtain the user-related behavior characterization vector.
[0074] After the above step S7, the feature cross vector and the user-related behavior representation vector are spliced and input into the fully connected neural network for binary classification to obtain the classification result. The model classification loss is calculated according to the classification result, and the model parameters are adjusted according to the loss. When the loss function converges, the training is completed and the trained abnormal power consumption detection model is obtained.
[0075] The beneficial effects of the present invention are as follows: the present invention can weaken the influence of the number of permanent residents, the floor area of houses, etc. on electricity consumption when clustering through a specific clustering algorithm. After weakening these influences, the categories mined are the categories that truly classify the user's electricity consumption behavior, thereby obtaining user category features that are more valuable for analysis and utilization; the use of a feature cross network solves the problem that the traditional machine learning model may ignore certain cross features when manually extracting features. Through the feature cross network, the continuous features and the category features are fully allowed to interact with each other, reducing the false alarm rate of the model and improving the detection accuracy; the conditional hierarchical normalization network is used to interact with the time series features at each time step, fully mining the periodicity and diversity of different users' electricity consumption behavior habits, providing the most effective feature vector for the prediction of the final model, which is conducive to improving the detection accuracy. The method provided by the present invention fully considers the influence of the characteristics of electricity consumption behavior such as the diversity of users and the periodicity of users' electricity consumption habits, significantly improves the accuracy of abnormal electricity consumption detection, and has the advantages of high precision, high timeliness, high reliability, and high degree of automation.
[0076] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An intelligent detection method for abnormal power consumption, characterized in that: The steps include: Acquire the power grid user data to be detected; Inputting the to-be-detected power grid user data into the trained abnormal power consumption detection model, and outputting abnormal power consumption detection results of the power grid users; The training process of the abnormal power consumption detection model includes: S1: Obtain a model training sample, wherein the model training sample is a labeled power grid user data set, wherein the power grid user data set includes power consumption recording time, daily power consumption value, week, number of permanent residents of the user, and house area; S21: acquiring the daily power consumption value in the power grid user data set, constructing a daily power consumption characterization vector with a length of 24 using the daily power consumption value in units of hours, and standardizing the daily power consumption value to obtain a standardized daily power consumption characterization vector; S22: splicing the standardized daily power consumption characterization vectors of the adjacent 7 days in the time dimension and inputting them into the LSTM model, and obtaining the hidden layer output of the LSTM model as the user's daily power consumption behavior characterization vector sequence, and obtaining the final output of the LSTM model as the user's power consumption behavior characterization vector; S3: clustering the user's electricity consumption behavior characterization vector using a clustering algorithm to obtain user category features; S4: using an embedding model to convert discrete data into corresponding continuous feature vectors, wherein the discrete data includes the user category characteristics, week, user resident population and house area; S5: concatenating the user's electricity consumption behavior characterization vector and the continuous feature vector and inputting the concatenated vectors into a multi-layer feature cross network to obtain a feature cross vector of the user's electricity consumption behavior; S6: Input the user's daily electricity consumption behavior characterization vector sequence into a conditional hierarchical normalization network and a maximum pooling network to obtain a user-related behavior characterization vector; S7: Concatenate the feature cross vector and the user-related behavior representation vector and input them into a fully connected neural network for binary classification to obtain a classification result, calculate the model classification loss according to the classification result, adjust the model parameters according to the loss, iterate the training, and terminate the training when the loss function converges to obtain a trained abnormal power consumption detection model.
2. The method for detecting abnormal power consumption according to claim 1, characterized in that: In step S1, the grid user data set is manually labeled, where a label 1 indicates that the user is an abnormal power user, and a label 0 indicates that the user is a normal power user, thereby obtaining a labeled grid user data set.
3. The method for detecting abnormal power consumption according to claim 1, characterized in that: The step S3 specifically comprises: inputting the user's electricity consumption behavior characterization vector into the focal-means clustering algorithm model, determining the number of cluster centers by the elbow method, using the number of cluster centers as the number of classifications of user categories, calculating the distance between each user and the cluster center by the distance formula of the focal-means clustering algorithm, and determining the category corresponding to the cluster center according to the distance as the category feature of the user; The distance calculation formula of the focal-means clustering algorithm is: Among them, x i represents the i-th dimension in the vector representing the power consumption behavior of user x, c i represents the i-th dimension in the cluster center representation vector c, represents the average number of permanent residents in the households of all users belonging to the cluster center c. It is initialized as the average number of permanent residents in the households of all users. μ represents the number of permanent residents in the households of user x. A a represents the floor space of the house of user x, It represents the average floor space of all users’ houses belonging to cluster center c. It is initialized to the average floor space of all users’ houses.
4. The method for detecting abnormal power consumption according to claim 1, characterized in that: In step S4, the embedding model is composed of two fully connected layers, and the initialization weight parameters of the fully connected neural network satisfy the Xavier uniform distribution.
5. The method for detecting abnormal power consumption according to claim 1, characterized in that: The step S5 comprises: S51: concatenating the user's electricity consumption behavior characterization vector and the corresponding continuous feature vector to obtain a fused feature vector; S52: Input the fused feature vector into a multi-layer feature cross network to obtain a feature cross vector of the user's electricity consumption behavior.
6. The method for detecting abnormal power consumption according to claim 1 or 5, characterized in that: In the step S5, each layer of the multi-layer feature cross network adopts a single-layer feature cross network, the single-layer feature cross network includes an Elu activation function, and the specific formula of the single-layer feature cross network is: where v l+1 represents the (l+1)th layer feature cross vector in the multi-layer feature cross network, v l represents the feature cross vector of the lth layer, v0 represents the fused feature vector, w l represents the weight parameter in the lth layer, D(x) represents the random activation function, and A(x) represents the Elu activation function.
7. The method for detecting abnormal power consumption according to claim 1, characterized in that: The step S6 comprises the following steps: S61: Input the user's daily electricity consumption behavior characterization vector sequence into the conditional hierarchical normalization network to obtain a correlation behavior feature matrix; S62: Input the correlation behavior feature matrix into a two-dimensional maximum pooling network with a convolution kernel of 7 to obtain a user correlation behavior representation vector.
Citation Information
Patent Citations
Abnormal electricity consumption detection method based on electricity consumption trend quantification network
CN116861306A
