InceptionTS model establishment method, device and electricity theft detection method and device

By training the InceptionTS model and using electricity usage data to extract electricity theft features, the timeliness and accuracy issues of existing electricity theft detection methods are resolved, and efficient electricity theft identification and edge deployment are achieved to adapt to changes in electricity theft methods.

CN114841314BActive Publication Date: 2025-09-12CHINA GRIDCOM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210412569.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-09-12
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

Existing electricity theft detection methods have problems such as poor timeliness, low accuracy and difficulty in edge deployment, making it difficult to effectively identify electricity theft. In addition, traditional methods have poor detection effects when the means of electricity theft change.

Method used

The InceptionTS model is used for training. It utilizes electricity current and voltage data, extracts features through a multi-layer Inception Block network and residual structure, combines LSTM and convolutional layers, and uses the cross-entropy loss function to optimize the model, enabling accurate identification of electricity theft users.

Benefits of technology

It improves the accuracy of electricity theft detection, reduces the false alarm rate, and has strong adaptability. It is suitable for edge device deployment and realizes real-time or near real-time electricity theft identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841314B_ABST
    Figure CN114841314B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for establishing an InceptionTS model, as well as a method and device for detecting electricity theft. The method for establishing the InceptionTS model includes: obtaining a training data set, wherein the training data in the training data set includes electricity usage data of electricity theft users and electricity usage data of non-electricity theft users; inputting the training data in the training data set into the InceptionTS model to obtain a classification vector for each training data, wherein the classification vector includes an electricity theft category; constructing a loss function based on the classification vector and the electricity theft category to which the corresponding training data belongs; and training the InceptionTS model based on the loss function to obtain a trained InceptionTS model. The trained InceptionTS model obtained using this establishment method has the advantages of high accuracy, low false alarm rate, and strong adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electricity theft detection, and in particular to a method and device for establishing an InceptionTS model and a method and device for detecting electricity theft. Background Art

[0002] Currently, electricity theft detection methods primarily include simple rule-based methods, clustering-based methods, and classification-based methods. Simple rule-based methods can only identify certain specific theft methods, requiring rules to adapt to the theft method. Some theft methods are difficult to identify using rules. Clustering-based methods primarily cluster users based on their electricity usage behavior, classifying a small number of samples as theft users. This method suffers from high false positive rates and low detection rates. Furthermore, this method is highly dependent on electricity usage characteristics, which change with the theft method, making clustering difficult to effectively identify theft users. Classification-based methods primarily rely on manual features and traditional machine learning. They first need to extract and filter feature indicators that effectively characterize user electricity usage based on user behavior patterns. Theft characteristics vary with the theft method, and some theft methods are difficult to effectively characterize using manually extracted features. Certain features are unclear and easily confused between theft and non-theft, resulting in a high incidence of false positives and unsatisfactory detection results.

[0003] With the updating and upgrading of electricity theft methods, the above-mentioned electricity theft detection methods are difficult to effectively detect electricity theft. The main problems are: 1. Poor timeliness. Electricity theft detection methods cannot detect users' electricity theft behavior in a timely manner and lack real-time performance. 2. Low accuracy. Whether it is rule-based methods, clustering-based detection methods, or classification-based detection methods, they are unable to capture the fundamental anomalies of electricity theft behavior during the theft process. Clustering and classification-based detection methods mainly rely on manual features and cannot automatically learn to represent anomalies in electricity theft behavior. As a result, low detection rates and high false alarm rates will occur, resulting in low accuracy when applied. 3. Difficulty in edge deployment. Current detection methods are mainly applied in business backends and data systems. They have problems such as high computational load and large data volumes. They have not been considered for application at the edge, making edge deployment difficult and lacking applicability. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. To this end, one object of the present invention is to propose a method for establishing an InceptionTS model, wherein the trained InceptionTS model obtained by the establishment method has the advantages of high accuracy, low false alarm rate, and strong adaptability.

[0005] The second object of the present invention is to provide a method for detecting electricity theft.

[0006] The third object of the present invention is to provide a device for establishing an InceptionTS model.

[0007] A fourth object of the present invention is to provide a power theft detection device.

[0008] A fifth object of the present invention is to provide a computer-readable storage medium.

[0009] A sixth object of the present invention is to provide an electronic device.

[0010] To achieve the above objectives, an embodiment of the first aspect of the present invention proposes a method for establishing an InceptionTS model, which includes: obtaining a training data set, wherein the training data in the training data set includes electricity usage data of electricity theft users and electricity usage data of non-electricity theft users; inputting the training data in the training data set into the InceptionTS model to obtain a classification vector for each training data, wherein the classification vector includes an electricity theft category; constructing a loss function based on the classification vector and the electricity theft category to which the corresponding training data belongs; and training the InceptionTS model based on the loss function to obtain a trained InceptionTS model.

[0011] According to the method for establishing the InceptionTS model of an embodiment of the present invention, the electricity usage data of electricity theft users and the electricity usage data of non-electricity theft users are used to train the InceptionTS model, so that the trained InceptionTS model has the advantages of high accuracy, low false alarm rate, and strong adaptability.

[0012] In addition, the method for establishing the InceptionTS model proposed in the above embodiment of the present invention may also have the following additional technical features:

[0013] According to one embodiment of the present invention, the training data in the training data set is input into the InceptionTS model to obtain a classification vector for each training data, including: inputting the training data in the training data set into a multi-layer first Inception Block network to obtain a first tensor, and inputting the training data in the training data set into a first residual structure to obtain a second tensor, and adding the first tensor and the second tensor, and then obtaining a third tensor through a first activation layer, wherein a first batch normalization layer and a second activation layer are added after each layer of the first Inception Block network, and the first residual structure includes a first convolution layer and a second batch normalization layer; inputting the third tensor into a multi-layer second Inception Block network to obtain a fourth tensor, and inputting the third tensor into a second residual structure to obtain a fifth tensor, and adding the fourth tensor and the fifth tensor, and then obtaining a target tensor through a third activation layer, wherein a third batch normalization layer and a fourth activation layer are added after each layer of the second Inception Block network, and the second residual structure includes a second convolution layer and a fourth batch normalization layer; and inputting the target tensor into an average pooling layer and a fully connected layer in sequence to obtain the classification vector.

[0014] According to one embodiment of the present invention, the training data in the training data set is input into the InceptionBlock network, including: inputting the training data in the training data set into the first structure and the second structure, respectively, to obtain a sixth tensor and multiple seventh tensors, wherein the first structure includes a pooling layer and an LSTM long short-term memory network layer connected in sequence, and the second structure includes a third convolutional layer and a convolutional layer group connected in sequence, and the convolutional layer group includes multiple fourth convolutional layers respectively connected to the third convolutional layer, and the multiple fourth convolutional layers have different sizes; the sixth tensor and the multiple seventh tensors are merged and input into the FilterConcatenation mixing layer to obtain an eighth tensor.

[0015] According to one embodiment of the present invention, the loss function uses a cross entropy loss function, and the expression of the cross entropy loss function is:

[0016]

[0017] Wherein, CE represents the cross entropy loss function, p i Indicates the electricity theft category label of the i-th training data. When the i-th training data belongs to electricity theft data, p i =1, when the i-th training data belongs to non-electricity theft data, p i =0,s irepresents the probability that the i-th training data belongs to electricity theft data, and C represents the number of electricity theft categories.

[0018] According to one embodiment of the present invention, when the loss function converges to a minimum, the corresponding InceptionTS model is the trained InceptionTS model.

[0019] According to one embodiment of the present invention, the method for establishing the InceptionTS model, wherein obtaining a training data set includes: collecting user electricity usage data, wherein the user electricity usage data includes electricity current and / or electricity voltage data of electricity theft users and non-electricity theft users:

[0020] X={x1,...,x m}∈R m×l

[0021] Where m is the number of users, l is the length of the time series data of each user's current and / or voltage, and x i =(x i,1 ,...,x i,l ), representing the electricity current and / or electricity voltage data of the i-th user;

[0022] A data set is constructed based on the user's electricity consumption data, and the data in the data set is labeled as follows:

[0023] D={x 1,t,d ,...,x n,t,d}∈R n×t×d

[0024] Y={y1,...,y n}∈{0,1}

[0025] Where D represents the data set, d represents the dimension of the data in the data set, d≥1, y n represents the electricity theft category of the data corresponding to the nth time window, t represents the width of the time window, n represents the data in the data set constructed by sliding the time window width, and n is greater than m; the training data set is divided from the data set.

[0026] According to one embodiment of the present invention, the method further includes: dividing a test data set and a validation data set from the data set, wherein the amount of data in the training data set is greater than the amount of data in the test data set, and the amount of data in the test data set is greater than the amount of data in the validation data set; during the training process, using the test data set to test the InceptionTS model to test the training effect of the InceptionTS model; after the training is completed, using the validation data set to verify the trained InceptionTS model to obtain an InceptionTS model that meets preset requirements.

[0027] According to one embodiment of the present invention, the sizes of the first tensor, the second tensor, the third tensor, the target tensor and the eighth tensor are all (None, t, K*4), the size of the classification vector is (None, c), c represents the electricity theft category, and the sizes of the sixth tensor and the seventh tensor are both (None, t, K), t represents time, and K represents the output tensor dimension.

[0028] To achieve the above objectives, a second embodiment of the present invention provides a method for detecting electricity theft, comprising: inputting electricity usage data of a user to be detected into a trained InceptionTS model obtained using any of the above-described methods for establishing an InceptionTS model, to obtain an electricity theft category of the user to be detected, wherein the electricity usage data is electricity current and / or electricity voltage data.

[0029] To achieve the above objectives, the third embodiment of the present invention proposes an apparatus for establishing an InceptionTS model, comprising: an acquisition module for acquiring a training data set, wherein the training data in the training data set includes electricity usage data of electricity theft users and electricity usage data of non-electricity theft users; an input module for inputting the training data in the training data set into the InceptionTS model to obtain a classification vector for each training data, wherein the classification vector includes an electricity theft category; a construction module for constructing a loss function based on the classification vector and the electricity theft category to which the corresponding training data belongs; and a training module for training the InceptionTS model based on the loss function to obtain a trained InceptionTS model.

[0030] To achieve the above objectives, a fourth embodiment of the present invention provides an electricity theft detection device, comprising: a detection module, configured to input electricity usage data of a user to be detected into a trained InceptionTS model obtained using any of the above-described methods for establishing an InceptionTS model, to obtain an electricity theft category of the user to be detected, wherein the electricity usage data includes electricity current and / or electricity voltage data.

[0031] To achieve the above objectives, the fifth embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for establishing the InceptionTS model as described above is implemented.

[0032] To achieve the above objectives, the sixth embodiment of the present invention proposes an electronic device, including a memory and a processor, wherein a computer program is stored on the memory. When the computer program is executed by the processor, the method for establishing the InceptionTS model as described above is implemented, and / or the method for detecting electricity theft as described above is implemented.

[0033] In addition, the electronic device according to the above embodiment of the present invention may also have the following additional technical features:

[0034] According to one embodiment of the present invention, the electronic device includes an edge device and / or a detection platform.

[0035] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flow chart of a method for establishing an InceptionTS model according to an embodiment of the present invention;

[0037] Figure 2 is a flowchart of obtaining a training data set according to an embodiment of the present invention;

[0038] Figure 3 is a flow chart of obtaining a classification vector for each training data according to an embodiment of the present invention;

[0039] Figure 4 This is a flowchart of the Inception Block network processing training data according to one embodiment of the present invention;

[0040] Figure 5 It is a structural diagram of the InceptionTS model of a specific embodiment of the present invention;

[0041] Figure 6This is a schematic diagram of the structure of the Inception Block network of a specific embodiment of the present invention;

[0042] Figure 7 Schematic diagram of the structure of the device for establishing the InceptionTS model according to an embodiment of the present invention;

[0043] Figure 8 is a schematic structural diagram of an electricity theft detection device according to an embodiment of the present invention;

[0044] Figure 9 2 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0046] The following will be combined with the instructions Figure 1-9 The specific implementation methods and devices for establishing the InceptionTS model and the electricity theft detection method and device of the embodiments of the present invention are described in detail.

[0047] Figure 1 This is a flow chart of a method for establishing an InceptionTS model according to an embodiment of the present invention. Figure 1 As shown, the method for establishing the InceptionTS model may include:

[0048] S1. Obtain a training data set, wherein the training data in the training data set includes electricity usage data of electricity-stealing users and electricity usage data of non-electricity-stealing users.

[0049] In embodiments of the present invention, when acquiring training data, electricity usage data of electricity theft users and non-electricity theft users can be collected using an electricity usage collection terminal. The collected electricity usage data can include current data, voltage data, or both. Characterization and learning of electricity theft behavior can be performed based on the current data / curve or voltage data / curve.

[0050] It's important to note that regardless of the method used to steal electricity, as long as it causes abnormal changes in voltage or current, theft can be identified using electricity usage data. Learning to characterize electricity theft using basic electricity usage data, such as voltage and / or current data, can improve the accuracy of identifying theft, while also offering advantages like low false alarm rates and strong adaptability.

[0051] As a feasible implementation method, Figure 2 As shown, obtaining a training data set may include:

[0052] S11, collecting user electricity usage data, wherein the user electricity usage data includes electricity current and / or electricity voltage data of electricity stealing users and non-electricity stealing users:

[0053] X={x1,...,x m}∈R m×l

[0054] Where m is the number of users, l is the length of the time series data of each user's current and / or voltage, and x i =(x i,1 ,...,x i,l ), representing the electricity current and / or electricity voltage data of the i-th user.

[0055] Specifically, the collected m-digit household numbers include electricity-stealing users and non-electricity-stealing users, so as to obtain electricity-stealing and non-electricity-stealing data, and perform representation learning on the electricity-stealing and non-electricity-stealing data.

[0056] More specifically, current data from m users can be collected over a period of time, with l representing the length of each user's current time series data. Alternatively, voltage data from m users can be collected over a period of time, with l representing the length of each user's voltage time series data. Alternatively, both current and voltage data from m users can be collected over a period of time, with l representing the length of each user's current and voltage time series data. This yields a current and / or current curve with a horizontal axis time length of l.

[0057] S12, constructing a data set based on the user's electricity consumption data and marking the data in the data set as follows:

[0058] D={x 1,t,d ,...,x n,t,d}∈R n×t×d

[0059] Y={y1,...,y n}∈{0,1}

[0060] Where D represents the data set, d represents the dimension of the data in the data set, d≥1, y n represents the electricity theft category of the data corresponding to the nth time window, t represents the width of the time window, and n represents the number of data in the data set constructed by sliding the time window width, where n is greater than m.

[0061] Specifically, when constructing the dataset D, based on the collected current and / or voltage curves of m users, a time window of width t is slid to obtain the current and / or voltage values ​​corresponding to n time windows t, where n is much larger than m.

[0062] More specifically, the current and / or voltage values ​​corresponding to n time windows t are marked so as to classify the electricity theft and non-electricity theft data. When marking the current and / or voltage values ​​corresponding to n time windows t, the mark of the electricity theft data can be recorded as 1, and the mark of the non-electricity theft data can be recorded as 0. When the data corresponding to the nth time window is electricity theft data, record y n = 1. When the data corresponding to the nth time window is non-electricity theft data, record y n =0.

[0063] S13, dividing a training data set from the data set.

[0064] Specifically, when training the InceptionTS model, a large amount of training data is required. Therefore, when dividing part of the data from the dataset as training data in the training dataset, the majority of the data from the dataset can be divided as training data in a ratio of 3:2 or 5:4.

[0065] S2: Input the training data in the training data set into the InceptionTS model to obtain a classification vector for each training data, wherein the classification vector includes the electricity theft category.

[0066] In an embodiment of the present invention, Figure 3 As shown, the training data in the training dataset is input into the InceptionTS model to obtain the classification vector of each training data, which may include:

[0067] S21, input the training data in the training data set into the multi-layer first Inception Block network to obtain a first tensor, and at the same time input the training data in the training data set into the first residual structure to obtain a second tensor, and add the first tensor and the second tensor, and then obtain a third tensor through the first activation layer, wherein the first batch of normalization layers and the second activation layer are added after each layer of the first Inception Block network, and the first residual structure includes the first convolution layer and the second batch of normalization layers.

[0068] S22: Input the third tensor into the multi-layer second Inception Block network to obtain the fourth tensor. At the same time, input the third tensor into the second residual structure to obtain the fifth tensor. After adding the fourth tensor and the fifth tensor, the target tensor is obtained through the third activation layer. The third batch normalization layer and the fourth activation layer are added after each layer of the second Inception Block network, and the second residual structure includes the second convolution layer and the fourth batch normalization layer.

[0069] S23, the target tensor is sequentially input into the average pooling layer and the fully connected layer to obtain the classification vector.

[0070] In this embodiment, if Figure 4 As shown, inputting the training data in the training dataset into the Inception Block network may include:

[0071] S211, inputting training data in the training data set into the first structure and the second structure, respectively, to obtain a sixth tensor and multiple seventh tensors, wherein the first structure includes a pooling layer and an LSTM long short-term memory network layer connected in sequence, and the second structure includes a third convolutional layer and a convolutional layer group connected in sequence, the convolutional layer group includes multiple fourth convolutional layers respectively connected to the third convolutional layer, and the multiple fourth convolutional layers have different sizes;

[0072] S212: Combine the sixth tensor and multiple seventh tensors and input them into the FilterConcatenation mixing layer to obtain an eighth tensor.

[0073] In this embodiment, the sizes of the first tensor, the second tensor, the third tensor, the target tensor, and the eighth tensor are all (None, t, K*4), the size of the classification vector is (None, c), c represents the electricity theft category, and the sizes of the sixth and seventh tensors are both (None, t, K), t represents time, and K represents the output tensor dimension.

[0074] In an embodiment of the present invention, the number of layers of the multi-layer first Inception Block network and the multi-layer second Inception Block network can both be 3 layers, that is, 3 Inception Block networks are stacked together to process the training data in the training data set.

[0075] In an embodiment of the present invention, the number of the plurality of fourth convolutional layers included in the convolutional layer group may be 3. The three fourth convolutional layers may be a one-dimensional convolutional layer (10 Conv1d) with a size of 10, a one-dimensional convolutional layer (20 Conv1d) with a size of 20, and a one-dimensional convolutional layer (40 Conv1d) with a size of 40, respectively.

[0076] in, Figure 5This is a schematic diagram of the structure of the InceptionTS model of a specific embodiment of the present invention. Figure 5 , the number of layers of the Inception Block network is 3. Figure 6 This is a schematic diagram of the structure of the Inception Block network of a specific embodiment of the present invention, see Figure 6 , the number of the fourth convolutional layers is 3.

[0077] by Figure 5 The structure of the InceptionTS model and Figure 6 The structure of the Inception Block network in the embodiment of the present invention is described as follows: inputting the training data in the training data set into the InceptionTS model to obtain the classification vector of each training data:

[0078] Specifically, the training data from the training dataset is fed into the three-layer first Inception Block network. This network extracts local features and long-term behavioral pattern features from the electricity usage sequence, generating a first tensor of size (None, t, K*4). To prevent degradation of the InceptionTS model when training the electricity usage data using the three-layer first Inception Block network, the training data from the training dataset is fed into the first residual structure simultaneously with the first Inception Block network.

[0079] In this embodiment, the first structure of the Inception Block network includes a one-dimensional pooling layer (3max pooling1d) and an LSTM (Long Short-Term Memory) layer of size 3 connected in sequence, and the second structure includes a one-dimensional third convolutional layer (1Conv1d) of size 1 and a convolutional layer group consisting of a one-dimensional convolutional layer (10 Conv1d) of size 10, a one-dimensional convolutional layer (20 Conv1d) of size 20, and a one-dimensional convolutional layer (40Conv1d) of size 40, which are connected in sequence.

[0080] Specifically, when the training data in the training dataset is input into the Inception Block network, the training data in the training dataset passes through the one-dimensional pooling layer (3max pooling1d) and the LSTM layer with a size of 3 in sequence to obtain the sixth tensor of size (None, t, K); after the training data in the training dataset passes through the one-dimensional third convolutional layer (1Conv1d) with a size of 1, it passes through the one-dimensional convolutional layer (10 Conv1d) with a size of 10, the one-dimensional convolutional layer (20Conv1d) with a size of 20, and the one-dimensional convolutional layer with a size of 40 to obtain three seventh tensors of size (None, t, K). The four tensors of size (None, t, K) are input into the FilterConcatenation mixing layer to obtain an eighth tensor of size (None, t, K*4).

[0081] It should be noted that the output of the three-layer first Inception Block network is also connected to the first batch normalization layer (BN) and the second activation layer. The training data in the training dataset is passed through the three-layer first Inception Block network to obtain a first tensor of size (None, t, K*4). This is then input into the first batch normalization layer and the second activation layer to normalize the first tensor and improve the model's expressiveness.

[0082] In this embodiment, the first residual structure includes a first one-dimensional convolutional layer (1Conv1d) of size 1 and a second batch normalization layer (BN). The training data in the training dataset passes through the first one-dimensional convolutional layer (1Conv1d) of size 1 and the second batch normalization layer in sequence to obtain a second tensor of size (None, t, K*4).

[0083] More specifically, after adding the first tensor of size (None, t, K*4) and the second tensor of size (None, t, K*4), a third tensor of size (None, t, K*4) is obtained through the first activation layer (ReLU, Rectified Linear Units).

[0084] To be more specific, the third tensor of size (None, t, K*4) is input into the three-layer second InceptionBlock network to obtain the fourth tensor of size (None, t, K*4). At the same time, the third tensor of size (None, t, K*4) is input into the second residual structure to obtain the fifth tensor of size (None, t, K*4). The fourth tensor and the fifth tensor of size (None, t, K*4) are added together, and then the target tensor of size (None, t, K*4) is obtained through the third activation layer.

[0085] It should be noted that the structure of each layer of the three-layer second Inception Block network is the same as the InceptionBlock network described above, and the three-layer second Inception Block network also has a normalization layer and an activation layer. The second residual structure is the same as the first residual structure described above and will not be repeated here.

[0086] Specifically, the target tensor of size (None, t, K*4) is sequentially input into the average pooling layer (Avg-Pool, average pooling layer) and the fully connected (FC) layer to obtain a classification vector of size (None, c).

[0087] In an embodiment of the present invention, the Adam optimizer can be used to train the InceptionTS model. When using the Adam optimizer to train the InceptionTS model, the initial learning rate can be set to 0.01 and the batch size can be set to 128.

[0088] S3, construct a loss function based on the classification vector and the electricity theft category to which the corresponding training data belongs.

[0089] In an embodiment of the present invention, the loss function uses a cross entropy loss function, and the expression of the cross entropy loss function is:

[0090]

[0091] Among them, CE represents the cross entropy loss function, p i Indicates the electricity theft category label of the i-th training data. When the i-th training data belongs to electricity theft data, p i =1, when the i-th training data belongs to non-electricity theft data, p i =0,s i represents the probability that the i-th training data belongs to electricity theft data, and C represents the number of electricity theft categories.

[0092] S4, train the InceptionTS model based on the loss function to obtain a trained InceptionTS model.

[0093] In an embodiment of the present invention, when the loss function converges to a minimum, the corresponding InceptionTS model is a trained InceptionTS model.

[0094] In an embodiment of the present invention, the method for establishing an InceptionTS model may further include: dividing a test data set and a validation data set from a data set, wherein the amount of data in the training data set is greater than the amount of data in the test data set, and the amount of data in the test data set is greater than the amount of data in the validation data set; during the training process, using the test data set to test the InceptionTS model to test the training effect of the InceptionTS model; after the training is completed, using the validation data set to verify the trained InceptionTS model to obtain an InceptionTS model that meets the preset requirements.

[0095] Specifically, the training, test, and validation datasets can be divided in a ratio of 7:2:1 to ensure sufficient training data for the InceptionTS model. The InceptionTS model is a deep learning neural network model. During training, the goal is to minimize the loss function. The weight parameters of the InceptionTS model are learned. The InceptionTS model is tested using test data from the test dataset during training, and the training results are monitored and analyzed in real time.

[0096] More specifically, during the training process, the verification data in the verification data set can be input into the trained InceptionTS model to verify the InceptionTS model trained using the training data in the training data set, so as to detect the training effect of the InceptionTS model. After the training is completed, the verification data in the verification data set can be input into the trained InceptionTS model to verify the trained InceptionTS model to determine whether the trained InceptionTS model meets the preset requirements. If the trained InceptionTS model meets the preset requirements, the trained InceptionTS model is an InceptionTS model that meets the preset requirements. If the trained InceptionTS model does not meet the preset requirements, the trained InceptionTS model needs to be trained again until an InceptionTS model that meets the preset requirements is obtained.

[0097] In an embodiment of the present invention, the training data is basic electricity usage data, such as voltage and / or current data. When using basic electricity usage data to characterize electricity theft, any abnormal changes in voltage or current can be detected, regardless of the method used. Furthermore, the training data is based on time series data and can be applied regardless of the frequency of voltage or current data collection. High-frequency voltage and / or current data enables the model to identify users who steal electricity in real time, while low-frequency voltage and / or current data enables near-real-time identification of users who steal electricity. The Inception Block network utilizes a combination of one-dimensional convolutional layers and LSTM layers to directly extract local features and long-term behavioral pattern characteristics from current and / or voltage data, reducing the need for manual feature extraction and improving robustness. Using the InceptionTS model establishment method of an embodiment of the present invention, the trained InceptionTS model exhibits high accuracy, low false positive rate, and strong adaptability.

[0098] Based on the above-mentioned method for establishing the InceptionTS model, the present invention proposes a method for detecting electricity theft.

[0099] The electricity usage data of the user to be detected is input into the trained InceptionTS model obtained by using the above-mentioned InceptionTS model establishment method to obtain the electricity theft category of the user to be detected, wherein the electricity usage data is electricity current and / or electricity voltage data.

[0100] Specifically, when detecting whether a user is an electricity theft user or a non-electricity theft user, the user's electricity usage data is input into the trained InceptionTS model. The trained InceptionTS model outputs a classification vector (None, c) for the user's electricity usage data. When c = 1, the user is an electricity theft user, and when c = 0, the user is a non-electricity theft user.

[0101] It should be noted that the electricity usage data input to the trained InceptionTS model is time-series data of current, voltage, or both. Therefore, when collecting current and / or voltage data from the user to be tested, the current and / or voltage must be processed into time-series data.

[0102] It should be noted that, for other specific implementations of the electricity theft detection method according to the embodiment of the present invention, reference may be made to the specific implementation of the method for establishing the InceptionTS model according to the above embodiment of the present invention.

[0103] Based on the above-mentioned method for establishing the InceptionTS model, the present invention proposes a device for establishing the InceptionTS model.

[0104] Figure 7 Schematic diagram of the structure of the device for establishing the InceptionTS model according to an embodiment of the present invention. Figure 7 As shown, the device 100 for establishing the InceptionTS model includes an acquisition module 10, an input module 20, a construction module 30 and a training module 40.

[0105] The acquisition module 10 is configured to obtain a training dataset, where the training data in the training dataset includes electricity usage data from both electricity theft users and non-electricity theft users. The input module 20 is configured to input the training data in the training dataset into the InceptionTS model to obtain a classification vector for each training data point, where the classification vector includes the electricity theft category. The construction module 30 is configured to construct a loss function based on the classification vector and the electricity theft category to which the corresponding training data point belongs. The training module 40 is configured to train the InceptionTS model based on the loss function to obtain a trained InceptionTS model.

[0106] In an embodiment of the present invention, the input module is specifically used to input the training data in the training data set into the multi-layer first Inception Block network to obtain a first tensor, and at the same time input the training data in the training data set into the first residual structure to obtain a second tensor, and after adding the first tensor and the second tensor, obtain a third tensor through the first activation layer, wherein the first batch of standardization layers and the second activation layer are added after each layer of the first Inception Block network, and the first residual structure includes the first convolution layer and the second batch of standardization layers; input the third tensor into the multi-layer second Inception Block network to obtain a fourth tensor, and at the same time input the third tensor into the second residual structure to obtain a fifth tensor, and after adding the fourth tensor and the fifth tensor, obtain a target tensor through the third activation layer, wherein the third batch of standardization layers and the fourth activation layer are added after each layer of the second Inception Block network, and the second residual structure includes the second convolution layer and the fourth batch of standardization layers; the target tensor is sequentially input into the average pooling layer and the fully connected layer to obtain a classification vector.

[0107] In an embodiment of the present invention, the input module is also specifically used to input the training data in the training data set into the first structure and the second structure, respectively, to obtain a sixth tensor and multiple seventh tensors, wherein the first structure includes a pooling layer and an LSTM long short-term memory network layer connected in sequence, and the second structure includes a third convolutional layer and a convolutional layer group connected in sequence, and the convolutional layer group includes multiple fourth convolutional layers respectively connected to the third convolutional layer, and the sizes of the multiple fourth convolutional layers are different; the sixth tensor and the multiple seventh tensors are merged and input into the FilterConcatenation mixing layer to obtain an eighth tensor.

[0108] In an embodiment of the present invention, the loss function uses a cross entropy loss function, and the construction module is specifically used to construct the cross entropy loss function through the following formula:

[0109]

[0110] Among them, CE represents the cross entropy loss function, p i Indicates the electricity theft category label of the i-th training data. When the i-th training data belongs to electricity theft data, p i =1, when the i-th training data belongs to non-electricity theft data, p i =0,s i represents the probability that the i-th training data belongs to electricity theft data, and C represents the number of electricity theft categories.

[0111] It should be noted that, for other specific implementations of the device for establishing the InceptionTS model in the embodiment of the present invention, reference may be made to the specific implementation of the method for establishing the InceptionTS model in the above embodiment of the present invention.

[0112] Based on the above-mentioned method for establishing the InceptionTS model, the present invention proposes an electricity theft detection device.

[0113] Figure 8 FIG is a schematic diagram of the structure of the power theft detection device according to an embodiment of the present invention. Figure 8 As shown, the electricity theft detection device 500 includes a detection module 50. The detection module 50 is configured to input the electricity usage data of the user to be detected into the trained InceptionTS model obtained using the above-mentioned InceptionTS model establishment method to obtain the electricity theft category of the user to be detected, wherein the electricity usage data is electricity current and / or electricity voltage data.

[0114] It should be noted that the electricity usage data input to the trained InceptionTS model is time-series data of current, voltage, or both. Therefore, when collecting current and / or voltage data from the user to be tested, the current and / or voltage must be processed into time-series data.

[0115] Based on the above-mentioned method for establishing the InceptionTS model, the present invention proposes a computer-readable storage medium.

[0116] In this embodiment, a computer program is stored on a computer-readable storage medium. When the computer program is executed by a processor, the method for establishing the InceptionTS model as described above is implemented.

[0117] Based on the above-mentioned method for establishing the InceptionTS model, the present invention proposes an electronic device.

[0118] In this embodiment, the electronic device 600 includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the method for establishing the InceptionTS model described above and / or the method for detecting electricity theft described above are implemented.

[0119] Figure 9 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 9 As shown, the electronic device 600 includes an edge device 60 and / or a detection platform 70 .

[0120] Specifically, the trained InceptionTS model can be converted into a lite version, and the converted InceptionTS model can be stored in the electronic device 600. By deploying the edge device 60 and / or the detection platform 70, suspected electricity theft or abnormal electricity users can be detected and located efficiently and accurately.

[0121] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

[0122] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0123] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0124] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like to indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0125] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0126] In the present invention, unless otherwise specified or limited, the terms "installed," "connected," "connect," "fixed," etc. should be understood in a broad sense. For example, they can refer to fixed connection, detachable connection, or integration; mechanical connection, electrical connection; direct connection, or indirect connection through an intermediate medium; internal communication between two components, or interaction between two components, unless otherwise specified. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0127] In the present invention, unless otherwise expressly specified or limited, when a first feature is "above" or "below" a second feature, it may mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediary. Furthermore, when a first feature is "above," "above," or "above" a second feature, it may mean that the first feature is directly above or diagonally above the second feature, or simply means that the first feature is at a higher level than the second feature. When a first feature is "below," "below," or "below" a second feature, it may mean that the first feature is directly below or diagonally below the second feature, or simply means that the first feature is at a lower level than the second feature.

[0128] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for establishing an InceptionTS model, characterized in that: include: Acquire a training data set, wherein the training data in the training data set includes electricity usage data of electricity-stealing users and electricity usage data of non-electricity-stealing users; Inputting the training data in the training data set into the InceptionTS model to obtain a classification vector for each training data, wherein the classification vector includes a category of electricity theft; Constructing a loss function based on the classification vector and the electricity theft category to which the corresponding training data belongs; Training the InceptionTS model based on the loss function to obtain a trained InceptionTS model; The training data in the training data set is input into the InceptionTS model to obtain a classification vector for each training data, including: Inputting the training data in the training data set into a multi-layer first Inception Block network to obtain a first tensor, and simultaneously inputting the training data in the training data set into a first residual structure to obtain a second tensor, and adding the first tensor and the second tensor together to obtain a third tensor through a first activation layer, wherein a first batch normalization layer and a second activation layer are added after each layer of the first Inception Block network, and the first residual structure includes a first convolutional layer and a second batch normalization layer; Inputting the third tensor into a multi-layer second Inception Block network to obtain a fourth tensor, and simultaneously inputting the third tensor into a second residual structure to obtain a fifth tensor, and adding the fourth tensor and the fifth tensor together to obtain a target tensor through a third activation layer, wherein a third batch normalization layer and a fourth activation layer are added after each layer of the second Inception Block network, and the second residual structure includes a second convolutional layer and a fourth batch normalization layer; Inputting the target tensor into the average pooling layer and the fully connected layer in sequence to obtain the classification vector; Inputting the training data in the training data set into the Inception Block network, including: inputting the training data in the training data set into the first structure and the second structure, respectively, to obtain a sixth tensor and multiple seventh tensors, wherein the first structure includes a pooling layer and an LSTM long short-term memory network layer connected in sequence, and the second structure includes a third convolutional layer and a convolutional layer group connected in sequence, the convolutional layer group includes multiple fourth convolutional layers respectively connected to the third convolutional layer, and the multiple fourth convolutional layers have different sizes; merging the sixth tensor and the multiple seventh tensors into a FilterConcatenation mixing layer to obtain an eighth tensor.

2. The method for establishing the InceptionTS model according to claim 1, characterized in that: The loss function uses the cross entropy loss function, and the expression of the cross entropy loss function is: Wherein, CE represents the cross entropy loss function, Indicates the electricity theft category label to which the i-th training data belongs. When the i-th training data belongs to electricity theft data, , when the i-th training data belongs to non-electricity theft data, , represents the probability that the i-th training data belongs to electricity theft data, and C represents the number of electricity theft categories.

3. The method for establishing the InceptionTS model according to claim 2, characterized in that When the loss function converges to a minimum, the corresponding InceptionTS model is the trained InceptionTS model.

4. The method for establishing the InceptionTS model according to claim 2, characterized in that The obtaining of the training data set includes: Collect user electricity usage data, wherein the user electricity usage data includes electricity current and / or electricity voltage data of electricity stealing users and non-electricity stealing users: Where m is the number of users, l is the length of the time series data of the power current and / or power voltage of each user, , represents the electricity current and / or electricity voltage data of the i-th user; A data set is constructed based on the user's electricity consumption data, and the data in the data set is labeled as follows: Where D represents the data set, d represents the dimension of the data in the data set, , represents the electricity theft category of the data corresponding to the nth time window, t represents the width of the time window, and n represents the number of data in the data set constructed by sliding the time window width, where n is greater than m; The training data set is divided from the data set.

5. The method for establishing the InceptionTS model according to claim 4, characterized in that: The method further comprises: Dividing the data set into a test data set and a validation data set, wherein the amount of data in the training data set is greater than the amount of data in the test data set, and the amount of data in the test data set is greater than the amount of data in the validation data set; During the training process, the InceptionTS model is tested using the test data set to test the training effect of the InceptionTS model; After the training is completed, the trained InceptionTS model is verified using the verification data set to obtain an InceptionTS model that meets the preset requirements.

6. The method for establishing the InceptionTS model according to claim 1, characterized in that The sizes of the first tensor, the second tensor, the third tensor, the target tensor, and the eighth tensor are all (None, t, K*4), the size of the classification vector is (None, c), where c represents the electricity theft category, and the sizes of the sixth tensor and the seventh tensor are both (None, t, K), where t represents time and K represents the output tensor dimension.

7. A method for detecting electricity theft, characterized in that: The method comprises: The electricity usage data of the user to be detected is input into the trained InceptionTS model obtained by the method for establishing the InceptionTS model according to any one of claims 1 to 6 to obtain the electricity theft category of the user to be detected, wherein the electricity usage data is electricity current and / or electricity voltage data.

8. A device for establishing an InceptionTS model, characterized in that: include: An acquisition module, configured to acquire a training data set, wherein the training data in the training data set includes electricity usage data of electricity-stealing users and electricity usage data of non-electricity-stealing users; An input module, configured to input the training data in the training data set into the InceptionTS model to obtain a classification vector for each training data, wherein the classification vector includes a category of electricity theft; A construction module, configured to construct a loss function based on the classification vector and the electricity theft category to which the corresponding training data belongs; A training module, configured to train the InceptionTS model based on the loss function to obtain a trained InceptionTS model; The input module is specifically configured to input the training data in the training data set into a multi-layer first InceptionBlock network to obtain a first tensor, and input the training data in the training data set into a first residual structure to obtain a second tensor, and add the first tensor and the second tensor together to obtain a third tensor through a first activation layer, wherein a first batch normalization layer and a second activation layer are added after each layer of the first Inception Block network, and the first residual structure includes a first convolutional layer and a second batch normalization layer; input the third tensor into a multi-layer second Inception Block network to obtain a fourth tensor, and input the third tensor into a second residual structure to obtain a fifth tensor, and add the fourth tensor and the fifth tensor together to obtain a target tensor through a third activation layer, wherein a third batch normalization layer and a fourth activation layer are added after each layer of the second Inception Block network, and the second residual structure includes a second convolutional layer and a fourth batch normalization layer; and input the target tensor into an average pooling layer and a fully connected layer in sequence to obtain the classification vector; The input module is further specifically used to input the training data in the training data set into the first structure and the second structure respectively, to obtain a sixth tensor and multiple seventh tensors accordingly, wherein the first structure includes a pooling layer and an LSTM long short-term memory network layer connected in sequence, and the second structure includes a third convolutional layer and a convolutional layer group connected in sequence, and the convolutional layer group includes multiple fourth convolutional layers respectively connected to the third convolutional layer, and the multiple fourth convolutional layers have different sizes; the sixth tensor and the multiple seventh tensors are merged and input into the FilterConcatenation mixing layer to obtain an eighth tensor.

9. The device for establishing the InceptionTS model according to claim 8, characterized in that: The loss function uses a cross entropy loss function, and the construction module is specifically used to construct the cross entropy loss function through the following formula: Wherein, CE represents the cross entropy loss function, Indicates the electricity theft category label to which the i-th training data belongs. When the i-th training data belongs to electricity theft data, , when the i-th training data belongs to non-electricity theft data, , represents the probability that the i-th training data belongs to electricity theft data, and C represents the number of electricity theft categories.

10. An electricity theft detection device, characterized in that: include: A detection module is configured to input the electricity usage data of the user to be detected into a trained InceptionTS model obtained by using the method for establishing the InceptionTS model according to any one of claims 1 to 6, to obtain the electricity theft category of the user to be detected, wherein the electricity usage data is electricity current and / or electricity voltage data.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for establishing the InceptionTS model according to any one of claims 1 to 6 is implemented.

12. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the method for establishing the InceptionTS model according to any one of claims 1 to 6 is implemented, and / or the method for detecting electricity theft according to claim 7 is implemented.

13. The electronic device according to claim 12, wherein: The electronic device includes an edge device and / or a detection platform.

Citation Information

Patent Citations

  • Classification task model training method and device, equipment and storage medium

    CN110097130A

  • Electricity stealing detection method and system based on ResNet-LSTM

    CN112098714A