Low-voltage user electricity stealing identification method based on contrastive prediction coding

By using a low-voltage user electricity theft identification method based on contrastive predictive coding, and extracting long-term electricity consumption features through convolutional neural networks and fully connected layers, and optimizing positive and negative sample contrast learning, the problem of high false positive rate in existing electricity theft detection methods is solved, and higher accuracy of electricity theft identification and power system stability are achieved.

CN117216670BActive Publication Date: 2025-11-11CHONGQING ELECTRIC POWER COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311128398.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-04
Publication Date
2025-11-11
Estimated Expiration
2043-09-04

AI Technical Summary

Technical Problem

Existing electricity theft detection technologies have a high false alarm rate and are difficult to accurately identify electricity theft by low-voltage users, especially when there are short-term power consumption fluctuations and confusion with electricity theft behavior.

Method used

A low-voltage user electricity theft identification method based on contrastive predictive coding is adopted. An electricity theft identification model is built through a neural network. Long-term electricity consumption features are extracted by using convolutional neural networks, gated recurrent units and fully connected layers. The positive and negative sample contrast learning is optimized by using the InfoNCE loss function to reduce short-term pattern interference and improve identification accuracy.

Benefits of technology

It achieved a lower false positive rate and higher accuracy in identifying electricity theft, thus improving the safety and stability of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216670B_ABST
    Figure CN117216670B_ABST
Patent Text Reader

Abstract

This invention relates to a low-voltage user electricity theft identification method based on contrastive predictive coding, comprising: constructing a low-voltage user electricity theft identification model using a neural network; training the low-voltage user electricity theft identification model using a contrastive predictive coding method; and identifying the electricity consumption data of low-voltage users using the low-voltage user electricity theft identification model. In this invention, by utilizing a contrastive predictive coding algorithm for self-supervised learning, short-term pattern information in user electricity consumption information is filtered out, while more crucial long-term pattern information is retained, thereby achieving more accurate electricity theft identification with a lower false positive rate and improving power security and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power system anti-electricity theft technology, and relates to a method for identifying low-voltage user electricity theft based on contrastive predictive coding. Background Technology

[0002] Electricity theft and other irregular electricity use are among the major problems plaguing the power grid, causing significant losses to the country and threatening its safe operation. With technological advancements, irregular electricity use methods have become increasingly diverse and covert, making detection of electricity theft more difficult.

[0003] Existing electricity theft detection technologies mainly include the following: one method uses data mining techniques based on historical electricity consumption data, employing a (SVM) classifier to detect theft, but this method is only suitable for detecting sudden load changes; another method utilizes Bayesian networks and decision trees to detect theft, selecting power load characteristic indicators to build a decision tree, which then determines theft; and yet another method detects theft based on distance-based outlier detection, identifying outliers in voltage or current, but this cannot detect other abnormal electricity consumption. Therefore, existing electricity theft identification methods have a relatively high rate of false positives, necessitating the continuous optimization of existing electricity theft identification models using better technologies to reduce the false positive rate and improve accuracy.

[0004] In recent years, self-supervised autoencoders (AEs) have often been used to extract key features of user load patterns from user-collected big data. These extracted features are then used to employ supervised classifiers such as SVMs for electricity theft detection. AEs extract all electricity consumption pattern information from user-collected big data, including short-term and long-term patterns. However, short-term electricity consumption fluctuations can be confused with fluctuations caused by electricity theft, leading to a high false positive rate for electricity consumption features extracted using AEs. Summary of the Invention

[0005] To address the shortcomings of the existing technologies, the technical problem to be solved by this invention is to provide a low-voltage user electricity theft identification method based on contrastive predictive coding with a low false positive rate.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] A low-voltage user electricity theft detection method based on contrastive predictive coding includes the following steps:

[0008] S100: A low-voltage user electricity theft identification model is built using a neural network;

[0009] S200, a low-voltage user electricity theft identification model is trained based on a contrastive predictive coding method;

[0010] S300 uses a low-voltage user electricity theft identification model to identify the electricity consumption data of low-voltage users.

[0011] Furthermore, the low-voltage user electricity theft identification model includes an electricity consumption feature extraction model and a classifier; step S200 includes the following sub-steps:

[0012] S210. Use unlabeled electricity consumption data from normal users to pre-train the electricity consumption feature extraction model, enabling it to extract long-term electricity consumption features.

[0013] S220. Extract long-term electricity consumption features of users from labeled user electricity consumption training data using a pre-trained electricity consumption feature extraction model, and train the classifier using the extracted long-term electricity consumption features and labeling information.

[0014] Furthermore, the electricity consumption feature extraction model includes a convolutional neural network, a gated recurrent unit, and a first fully connected layer; step S210 includes the following sub-steps:

[0015] S211. A convolutional neural network encodes a sequence in the user electricity consumption dataset X into a first feature vector with 1 row and m columns, where m is an integer.

[0016] S212. The gated loop unit summarizes the encoded first feature vector and extracts the data of the first n columns of the first feature vector of the sequence, converting it into a second feature vector in the form of a multi-row n-column matrix, where n is an integer and n < m.

[0017] S213. The first fully connected layer predicts the feature vector after the nth step of the first feature vector of the sequence based on the second feature vector.

[0018] S214. Extract the feature vector predicted by the first fully connected layer at step (n+k) and the feature vector of the first feature vector of the sequence at step (n+k) to form a positive sample pair; extract the feature vector predicted by the first fully connected layer at step (n+k) and the feature vector of the first feature vector formed according to another sequence in the user electricity consumption dataset X at step (n+k) to form a negative sample pair; 1≤k≤(mn);

[0019] S215. Correct the parameters of the convolutional neural network using positive and negative sample pairs.

[0020] Furthermore, the first feature vector is a vector with 1 row and 512 columns; the second feature vector is a matrix with 21 rows and 256 columns.

[0021] Furthermore, the maximum value of k is less than or equal to 16.

[0022] Furthermore, after performing step S220, the following steps are also performed:

[0023] S230. Evaluate the performance of the low-voltage user electricity theft detection model using a labeled user electricity consumption test dataset.

[0024] Furthermore, the low-voltage user electricity theft identification model uses InfoNCE as the loss function and compares positive and negative sample examples to learn the long-term electricity consumption characteristics in the samples.

[0025] Furthermore, the loss function of the low-voltage user electricity theft identification model is:

[0026]

[0027]

[0028]

[0029] Where E represents the expected value; x j This represents the j-th sequence in the user electricity consumption dataset X; x j (n+k) represents the sequence x j The (n+k)th element; c j (n) represents the second feature vector formed based on the j-th sequence in the user electricity consumption dataset X; z j (n+k) represents the expression based on x j The eigenvector of the first eigenvector obtained at step (n+k) is the eigenvector of the (n+k)th step. Indicates the first fully connected layer according to c j (n) is the (n+k)th step eigenvector of the predicted first eigenvector; x i This represents the i-th sequence in the user electricity consumption dataset X; x i (n+k) represents the sequence x i The (n+k)th element; z i (n+k) represents the expression based on x i (n+k) is the eigenvector of the first eigenvector obtained at step (n+k); sim() is a function defined as follows:

[0030]

[0031] Here, x and y represent the parameters of the sim() function, and both x and y are vectors.

[0032] Furthermore, the convolutional neural network includes

[0033] Multiple convolutional layers are used to extract low-level user electricity consumption features from user electricity consumption data, and to iteratively extract complex user electricity consumption features from low-level user electricity consumption features;

[0034] Activation functions, used with the ReLU function to increase the non-linear fitting capability of convolutional neural network models; and

[0035] Multiple pooling layers are used to merge the outputs of a cluster of neurons in one layer into a single neuron in the next layer to reduce the amount of data.

[0036] Furthermore, the classifier employs a fully connected neural network, connecting each neuron in one layer to each neuron in another layer, thereby combining local features into global features before calculating the score for each class; the training method of the classifier includes the following steps:

[0037] Step S221: Initialize all parameters of the fully connected neural network with random numbers;

[0038] Step S222: The low-voltage user electricity theft identification model performs a forward propagation step on the input data and calculates the corresponding output probability for each category;

[0039] Step S223: Calculate the total error of the output layer;

[0040] Step S224: The low-voltage user electricity theft identification model executes the backpropagation algorithm to calculate the gradient of the error relative to all parameters;

[0041] Step S225: Update the values ​​of all parameters of the fully connected neural network using gradient descent.

[0042] In this invention, by using a contrastive predictive coding algorithm for self-supervised learning and optimizing the InfoNCE loss function, positive sample pairs are made closer together and negative sample pairs are made further apart. This allows the ND-CP model to extract the most shared long-term electricity consumption patterns while filtering out unrelated short-term electricity consumption patterns, and retaining more critical long-term pattern information. This results in more accurate electricity theft identification with a lower false positive rate, thereby improving the stability of power security. Attached Figure Description

[0043] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0044] Figure 1 This is a flowchart of a preferred embodiment of the low-voltage user electricity theft identification method based on contrastive predictive coding of the present invention.

[0045] Figure 2 This is a flowchart for pre-training the electricity consumption feature extraction model.

[0046] Figure 3 This is a flowchart for training a classifier. Detailed Implementation

[0047] The following specific examples illustrate the implementation of the present invention. The illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0048] Please see Figure 1 , Figure 1 This is a flowchart of a preferred embodiment of the low-voltage user electricity theft detection method based on contrastive predictive coding of the present invention. The low-voltage user electricity theft detection method based on contrastive predictive coding in this embodiment includes the following steps:

[0049] S100. A low-voltage user electricity theft identification model (Non-Technical lossDetection using Contrastive Prediction, hereinafter referred to as ND-CP model) is built using a neural network. In this embodiment, the ND-CP model includes an electricity consumption feature extraction model and a classifier. Of course, the ND-CP model also includes the basic structure of a neural network model, such as an input layer and an output layer.

[0050] The electricity consumption feature extraction model includes a convolutional neural network (CNN), gated recurrent units, and a first fully connected layer. In deep neural networks, a convolutional neural network (CNN) is a special type of artificial neural network (ANN) commonly used to process 2D or 3D user electrical data. During processing, at least one hidden layer uses convolution operations. Convolutional layers typically share the same kernel (or filter) to reduce the number of training parameters and lower computational costs. The CNN includes multiple convolutional layers, activation functions, and multiple pooling layers.

[0051] The multiple convolutional layers are used to extract low-level user electricity consumption features from user electricity consumption data, and iteratively extract complex user electricity consumption features from these low-level features. The purpose of convolutional layer operations is to extract different features from the input. The first convolutional layer may only extract some low-level user electricity consumption features, while more layers of the network can iteratively extract more complex user electricity consumption features from these low-level features. Each convolutional layer in a convolutional neural network consists of several convolutional units. Each convolutional layer convolves the input and passes the result to the next layer. For user electricity consumption data with a longer time span, to address the computational time consumption problem caused by the "fully connected" design of input and hidden layers in ordinary neural networks, the connection between hidden units and input units is restricted. That is, each hidden unit can only connect to a part of the input units through the convolutional sliding window. Each hidden unit only connects to a small adjacent region of the input image. This ensures that the learned filter produces the strongest response to spatial local input patterns.

[0052] The activation function uses the ReLU function to increase the nonlinear fitting capability of the convolutional neural network model.

[0053] Typically, high-dimensional features are obtained after convolutional layers. Pooling layers reduce the amount of data by merging the outputs of clusters of neurons in one layer into a single neuron in the next layer. Pooling layers include local pooling and global pooling. Local pooling combines small clusters, while global pooling acts on all neurons in the feature map, taking the maximum or average value of the neuron cluster to obtain new, lower-dimensional features.

[0054] The classifier employs a fully connected neural network, including a second fully-connected layer. This fully-connected layer connects each neuron in one layer to each neuron in another layer, combining local features into global features before calculating the score for each class.

[0055] S200. Train the ND-CP model using a contrastive predictive coding method. Specifically, this may include the following steps:

[0056] S210. Pre-train the electricity consumption feature extraction model using unlabeled electricity consumption data from normal users to enable it to extract long-term electricity consumption features. (See also...) Figure 2 The method for pre-training the electricity consumption feature extraction model may include the following steps:

[0057] S211. A convolutional neural network processes a sequence x from a user electricity consumption dataset X. j (x j The j-th sequence in the user electricity consumption dataset X is encoded as the first feature vector z in 1 row and m columns. j(t), where m is an integer. Here, a sequence in the user electricity consumption dataset X corresponds to the electricity consumption data of one electrical user. In this embodiment, m = 512, and a 3-layer 1D convolutional neural network (1D-CNN) is used to encode a sequence in the user electricity consumption dataset X into a 1x512 vector as the first feature vector z. j (t).

[0058] S212. The gated loop unit summarizes the encoded first feature vector and extracts the first n columns of data from the first feature vector, converting them into a more compact second feature vector c in the form of a multi-row n-column matrix. j (n), where n is an integer and n < m. In this embodiment, n = 256 is taken, and the first half of the first feature vector is extracted to form a second feature vector c in the form of a matrix of 21 rows and 256 columns. j (n).

[0059] S213, The first fully connected layer, based on the second feature vector c j (n) Predicts the first eigenvector z of the sequence. j The eigenvectors of the latter half of (t) (after step 256) are used to obtain the third eigenvector.

[0060] S214, Extract z j (n+k) (that is, according to x) j The eigenvector of the first eigenvector obtained at step (n+k) and the eigenvector of the (n+k)th step. (i.e., the first fully connected layer according to c) j (n) The (n+k)th step feature vector of the first feature vector obtained from prediction forms a positive sample pair. and z i (n+k) (i.e., based on another sequence x in the user electricity consumption dataset X) i The first eigenvector z formed i The eigenvectors of step (n+k) of (t) form negative sample pairs. 1≤k≤(mn); in this embodiment, 1≤k≤16. Since the positive sample pairs come from the same electrical user data sequence, and are respectively from the first half (predicted from the data in the first half, unrelated to the data in the second half) and the second half, the positive sample pairs share the same long-term electricity consumption pattern information but do not share short-term pattern information. Since the negative sample pairs come from the first half and the second half of different electrical user data sequences, they do not share the same long-term electricity consumption pattern information.

[0061] S215. Correct the parameters of the convolutional neural network using positive and negative sample pairs. Then, repeat steps S211 to S215 until the requirements are met, and then end the pre-training.

[0062] The ND-CP model can use InfoNCE as the loss function and compare positive and negative samples to learn the long-term electricity consumption characteristics in the samples. In this embodiment, the loss function of the ND-CP model is...

[0063]

[0064]

[0065]

[0066] Where E represents the expected value; x j (n+k) represents the sequence x j The (n+k)th element; x i This represents the i-th sequence in the user electricity consumption dataset X; x i (n+k) represents the sequence x i The (n+k)th element. sim() is a function defined as follows:

[0067]

[0068] Here, x and y represent the parameters of the sim() function, and both x and y are vectors.

[0069] S220. After pre-training, the pre-trained electricity consumption feature extraction model extracts long-term electricity consumption features from the labeled user electricity consumption training set data. The extracted long-term electricity consumption features and labeling information are then used to train the ND-CP model's classifier. Please refer to [link / reference]. Figure 3 The training method for the classifier includes the following steps:

[0070] Step S221: Initialize all parameters / weights of the fully connected neural network with random numbers; the parameters / weights of the convolutional neural network remain unchanged.

[0071] Step S222: The low-voltage user electricity theft identification model performs a forward propagation step on the input data (i.e., propagates according to the propagation direction of the convolutional layer, ReLU function, pooling layer and fully connected neural network) and calculates the corresponding output probability for each category.

[0072] Step S223: Calculate the total error of the output layer.

[0073] Step S224: The low-voltage user electricity theft identification model executes the backpropagation algorithm to calculate the gradient of the error relative to all parameters.

[0074] Step S225: Update the values ​​of all parameters of the fully connected neural network using gradient descent to minimize the output error. After training, the fully connected neural network classifier is obtained.

[0075] S230. Use a labeled user electricity test dataset to evaluate the performance of the ND-CP model and determine whether the recognition accuracy of the ND-CP model meets the requirements. If it does not meet the requirements, return to execute steps S210 and S220 again.

[0076] S300 uses the ND-CP model to identify the electricity consumption data of low-voltage users.

[0077] Traditional deep learning methods aim to classify users by training a model through optimizing a loss function (such as binary cross-entropy). This embodiment employs a contrastive learning approach, optimizing the InfoNCE loss function to bring positive sample pairs closer together and negative sample pairs further apart. This allows the ND-CP model to extract the most shared long-term electricity consumption patterns while filtering out unrelated short-term patterns. Compared to existing technologies that rely on overall electricity consumption changes to detect electricity theft, which have a high probability of false positives, this embodiment proposes using contrastive predictive coding to filter short-term patterns in user electricity consumption information, retaining more crucial long-term patterns for more accurate and lower-false-positive electricity theft identification.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for identifying electricity theft by low-voltage users based on contrastive predictive coding, characterized in that, Includes the following steps: S100: A low-voltage user electricity theft identification model is built using a neural network; S200, a low-voltage user electricity theft identification model is trained based on a contrastive predictive coding method; S300: Uses a low-voltage user electricity theft identification model to identify the electricity consumption data of low-voltage users; The low-voltage user electricity theft identification model includes an electricity consumption feature extraction model and a classifier; step S200 includes the following sub-steps: S210. Use unlabeled electricity consumption data from normal users to pre-train the electricity consumption feature extraction model, enabling it to extract long-term electricity consumption features. S220. Extract long-term electricity consumption features of users from labeled user electricity consumption training data using a pre-trained electricity consumption feature extraction model, and train the classifier using the extracted long-term electricity consumption features and labeling information. The electricity consumption feature extraction model includes a convolutional neural network, a gated recurrent unit, and a first fully connected layer; step S210 includes the following sub-steps: S211, Convolutional Neural Networks Process User Electricity Consumption Data X A sequence is encoded as the first feature vector in 1 row and m columns, where m is an integer; S212. The gated loop unit summarizes the encoded first feature vector and extracts the data of the first n columns of the first feature vector of the sequence, converting it into a second feature vector in the form of a multi-row n-column matrix, where n is an integer and n < m. S213. The first fully connected layer predicts the feature vector after the nth step of the first feature vector of the sequence based on the second feature vector. S214, Extract the predicted (th) from the first fully connected layer. n+k The eigenvector of step () and the ()th step of the first eigenvector of the sequence n+k The feature vectors from step () form positive sample pairs; the ()th step predicted by the first fully connected layer is extracted. n+k The feature vectors of the first step and the feature vectors based on the user electricity consumption dataset X The first eigenvector formed by another sequence in the sequence is the ( )th n+k The feature vectors from step 1 form negative sample pairs; 1≤ k ≤( m - n ); S215. Correct the parameters of the convolutional neural network using positive and negative sample pairs.

2. The low-voltage user electricity theft identification method based on contrastive predictive coding according to claim 1, characterized in that: The first feature vector is a vector with 1 row and 512 columns; the second feature vector is a matrix with 21 rows and 256 columns.

3. The low-voltage user electricity theft identification method based on contrastive predictive coding according to claim 1, characterized in that: The maximum value of k is less than or equal to 16.

4. The low-voltage user electricity theft identification method based on contrastive predictive coding according to claim 1, characterized in that, After performing step S220, the following steps are also performed: S230. Evaluate the performance of the low-voltage user electricity theft detection model using a labeled user electricity consumption test dataset.

5. The low-voltage user electricity theft identification method based on contrastive predictive coding according to any one of claims 1 to 4, characterized in that: The low-voltage user electricity theft identification model uses InfoNCE As a loss function, and by comparing positive and negative samples, the long-term electricity consumption characteristics in the samples are learned.

6. The low-voltage user electricity theft identification method based on contrastive predictive coding according to any one of claims 1 to 4, characterized in that: The loss function of the low-voltage user electricity theft detection model is: Where E represents the expected value; x j Represents user electricity consumption dataset X The first in j A sequence; x j ( n+k ) represents a sequence x j The ( n+k ) elements; c j ( n This indicates that the data is based on the user's electricity consumption dataset. X The second feature vector is formed by the j-th sequence in the sequence; z j ( n+k ) indicates according to x j ( n+k The ()th eigenvector of the first eigenvector obtained n+k ) step of eigenvectors; Indicates the first fully connected layer according to c j ( n The ( )th eigenvector of the first eigenvector predicted n+k ) step of eigenvectors; x i Represents user electricity consumption dataset X The first in i A sequence; x i ( n+k ) represents a sequence x i The ( n+k ) elements; z i ( n+k ) indicates according to x i ( n+k The ()th eigenvector of the first eigenvector obtained n+k The feature vector of step ); sim() is a function defined as follows: Here, x and y represent the parameters of the sim() function, and both x and y are vectors.

7. The low-voltage user electricity theft identification method based on contrastive predictive coding according to claim 1, characterized in that: The convolutional neural network includes Multiple convolutional layers are used to extract low-level user electricity consumption features from user electricity consumption data, and to iteratively extract complex user electricity consumption features from low-level user electricity consumption features; Activation functions are used to enhance the non-linear fitting ability of convolutional neural network models using the ReLU function; as well as Multiple pooling layers are used to merge the outputs of a cluster of neurons in one layer into a single neuron in the next layer to reduce the amount of data.

8. The low-voltage user electricity theft identification method based on contrastive predictive coding according to claim 7, characterized in that: The classifier employs a fully connected neural network, connecting each neuron in one layer to each neuron in another layer, thereby combining local features into global features before calculating the score for each class; the training method of the classifier includes the following steps: Step S221: Initialize all parameters of the fully connected neural network with random numbers; Step S222: The low-voltage user electricity theft identification model performs a forward propagation step on the input data and calculates the corresponding output probability for each category; Step S223: Calculate the total error of the output layer; Step S224: The low-voltage user electricity theft identification model executes the backpropagation algorithm to calculate the gradient of the error relative to all parameters; Step S225: Update the values ​​of all parameters of the fully connected neural network using gradient descent.

Citation Information

Patent Citations

  • Power consumer electricity stealing identification method and system based on deep learning

    CN113901977A

  • Battery anomaly detection method and device, electronic equipment and computer storage medium

    CN115423003A