An abnormal power utilization detection method based on multi-scale differential quantization
The abnormal power consumption detection model constructed by multi-scale differential convolution and quantization module solves the problem of insufficient cross-domain detection capability in the existing technology, realizes cross-domain abnormal power consumption detection without human intervention, and improves the adaptability and detection accuracy of the model.
Patent Information
- Application Number
- CN202310738065.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-06-20
AI Technical Summary
Existing abnormal power consumption detection models show significant performance degradation in unknown scenarios, are unable to effectively identify abnormal power consumption in cross-domain power data, and rely on manual feature extraction, resulting in poor generalization performance.
An abnormal electricity consumption detection model is constructed using a multi-scale differential convolution module and a quantization module. The model extracts information on changes in electricity consumption patterns through the multi-scale differential convolution kernel, eliminates the influence of normal fluctuations caused by the randomness of electricity consumption behavior through the quantization module, and is trained through a classification module to achieve cross-domain detection without human intervention.
It can effectively identify abnormal electricity consumption in power data from different fields, has good cross-domain detection capabilities and flexibility, adapts to various deep time series classification networks, and improves the model's detection accuracy in unknown scenarios.
Smart Images

Figure CN116756653B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electricity consumption behavior analysis technology, and more specifically, relates to an abnormal electricity consumption detection method based on multi-scale differential quantization. Background Technology
[0002] Anomaly detection plays a crucial supporting role in the safe operation of the power grid. During grid operation, factors such as metering equipment malfunctions and user electricity theft can prevent power grid companies from accurately collecting users' actual electricity consumption data, resulting in anomaly data. This anomaly data negatively impacts grid dispatching and power supply security, and also causes significant economic losses to the power sector. Therefore, effectively utilizing the high-precision, fine-granularity user electricity consumption data collected by smart grids for anomaly detection is of great importance. By proactively detecting anomalies in electricity consumption data, it is possible to promptly repair faulty metering devices or impose fines and overdue electricity bills on users who steal electricity, thereby reducing power losses and ensuring the safe operation of the power grid.
[0003] Currently, data-driven abnormal electricity consumption detection technology analyzes large amounts of electricity consumption data to identify patterns and characteristics of abnormal electricity consumption, thereby enabling detection and identification. Although many data-driven studies have been dedicated to improving the accuracy and reliability of abnormal electricity consumption detection, these studies mainly focus on validation and testing of single data sources and have not considered the detection problem of models in unknown scenarios.
[0004] Current data-driven methods for detecting abnormal electricity consumption mainly include machine learning and deep learning methods. Machine learning methods typically require manual feature extraction, followed by processing using algorithms such as clustering, outlier detection, and classification to ultimately identify users with abnormal electricity consumption. However, the features extracted in this method are highly correlated with the current training set data distribution. When the data distribution changes, the previously extracted features become invalid, leading to poor generalization performance. Deep learning methods, on the other hand, have strong data modeling and representation capabilities, enabling them to better uncover the intrinsic relationships and patterns between data, and do not rely on manual modeling. However, current research is often limited to specific user detection or detection within the same user domain, failing to consider the performance degradation of the model when applied to unknown scenarios. Summary of the Invention
[0005] To address the shortcomings and improvement needs of existing technologies, this invention provides an abnormal power consumption detection method based on multi-scale differential quantization, aiming to solve the technical problem that existing abnormal power consumption detection models suffer significant performance degradation in unknown scenarios.
[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for constructing an abnormal power consumption detection model based on multi-scale differential quantization, comprising the following steps:
[0007] After acquiring and preprocessing the time-series electricity consumption data, it was used as the training sample set.
[0008] An abnormal power consumption detection model is constructed, comprising a multi-scale differential convolution module, a quantization module, and a classification module. The multi-scale differential convolution module uses multi-scale differential convolution kernels to perform convolution operations on the data in the training sample set to obtain differential data for multiple channels. The quantization module determines each quantization point according to the quantization level, and then, for each channel, obtains the differential data corresponding to each quantization point as a quantization threshold, thereby obtaining the quantized data corresponding to all differential data.
[0009] All quantified data are input into the classification module, and the abnormal power consumption detection model is trained with the goal of minimizing the classification loss.
[0010] Furthermore, the preprocessing includes missing value handling, noisy data filtering, and normalization.
[0011] Further, the step of determining each quantization point based on the quantization level, and then, for each channel, obtaining the differential data corresponding to each quantization point as a quantization threshold, thereby obtaining the quantized data corresponding to all differential data, includes:
[0012] Each quantile is determined based on the quantization level n. The difference data for each channel are sorted from smallest to largest, and then the difference data corresponding to each quantization point is used as the quantization threshold [α1, α2, ..., α]. n-1 ];
[0013] The quantization function is determined by the quantization threshold, and the differential data of each channel is quantized to obtain the corresponding quantized data; the quantization function formula is as follows:
[0014]
[0015] Where x represents any differential data in any channel, and Quant(x) represents the quantized data corresponding to the differential data x.
[0016] Secondly, the present invention provides an abnormal electricity consumption detection method based on multi-scale differential quantization, comprising: preprocessing the time-series data of the electricity consumption to be detected, inputting it into an abnormal electricity consumption detection model constructed using the construction method of the abnormal electricity consumption detection model based on multi-scale differential quantization described in the first aspect, and outputting the detection result.
[0017] Thirdly, the present invention provides a device for constructing an abnormal power consumption detection model based on multi-scale differential quantization, comprising:
[0018] The acquisition module is used to acquire electricity consumption time-series data and preprocess it as a training sample set;
[0019] A construction module is used to build an abnormal power consumption detection model, including a multi-scale differential convolution module, a quantization module, and a classification module. The multi-scale differential convolution module uses multi-scale differential convolution kernels to perform convolution operations on the data in the training sample set to obtain differential data for multiple channels. The quantization module determines each quantization point according to the quantization level, and then, for each channel, obtains the differential data corresponding to each quantization point as a quantization threshold, thereby obtaining the quantized data corresponding to all differential data.
[0020] The training module is used to input all quantified data into the classification module and train the abnormal power consumption detection model with the goal of minimizing the classification loss.
[0021] Fourthly, the present invention provides an abnormal electricity consumption detection device based on multi-scale differential quantization, including a detection module. The detection module is used to preprocess the time-series data of the electricity consumption to be detected, input it into the abnormal electricity consumption detection model constructed by the construction device based on multi-scale differential quantization of the abnormal electricity consumption detection model described in the third aspect, and output the detection result.
[0022] Fifthly, the present invention provides a machine-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for constructing an abnormal power consumption detection model based on multi-scale differential quantization as described in the first aspect and / or the method for detecting abnormal power consumption based on multi-scale differential quantization as described in the second aspect.
[0023] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects:
[0024] (1) The main innovation of this invention lies in using multiple differential convolution kernels of different sizes to perform convolution operations on the preprocessed electricity consumption data to obtain differential data from multiple channels, thereby extracting information on changes in electricity consumption patterns. Then, the differential data obtained from different differential convolution kernels are processed using a quantization module to obtain quantized data, eliminating the influence of normal fluctuations in electricity consumption data caused by the randomness of electricity consumption behavior on the detection of abnormal electricity consumption. Thus, this invention can capture domain-independent abnormal electricity consumption information without manual extraction of electricity consumption features, exhibiting excellent cross-domain detection capabilities. This means that the model can effectively identify abnormal electricity consumption in power data from different domains without manual intervention. This feature makes the method highly flexible and applicable in practical applications.
[0025] (2) This invention has the ability to adapt to different depth time series classification networks. This method can be combined with various deep time series classification networks and can be flexibly applied and adjusted within these networks to classify and detect anomalies in different types of power data. This flexibility allows this invention to better adapt to and be applied to various deep time series classification networks when dealing with different power data analysis scenarios and needs. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating the method for constructing an abnormal power consumption detection model based on multi-scale differential quantization provided in an embodiment of the present invention.
[0027] Figure 2 This is a structural diagram of the abnormal power consumption detection model provided in an embodiment of the present invention;
[0028] Figure 3 This is a diagram of an optional multi-scale differential convolution module structure provided in an embodiment of the present invention;
[0029] Figure 4 This is a flowchart for abnormal power consumption detection provided in an embodiment of the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0031] See Figure 1 , combined Figure 2 and Figure 3 The present invention provides a method for constructing an abnormal power consumption detection model based on multi-scale differential quantization, including operations S1 to S3.
[0032] Operation S1 acquires and preprocesses the time-series data of electricity consumption, which is then used as the training sample set.
[0033] In this embodiment, the electricity consumption time-series data refers to the electricity consumption of the user within each standard time interval (commonly 15 minutes or 30 minutes) recorded by the smart meter. In this embodiment, the sampling interval of the electricity consumption data is 30 minutes, and there will be 48 sampling points per day.
[0034] In addition, preprocessing includes handling missing values, filtering noisy data, and normalization. Specifically:
[0035] (1) Handling missing values. Due to malfunctions in the smart meter metering equipment or the meter information transmission equipment, missing values may exist in the data. For a small number of missing data, this embodiment uses linear interpolation to fill in the data; for a large number of missing data, a direct filtering method is used.
[0036] (2) Noise Data Filtering. Noise data here includes maximum values exceeding the normal electricity metering range, minimum values with a duration of zero, and negative values. Maximum values are defined as:
[0037] Maximum value = Q3 + (Q3 - Q1) * 5
[0038] Q3 is the third-quarter locus, and Q1 is the quarter-quarter locus.
[0039] (3) Normalization. A linear scaling transformation normalization method is used to map all data to the interval [0, 1], x i For the original data, x i ′ represents the normalized data, and the formula is as follows:
[0040] x i ′=x i / x max
[0041] Furthermore, the sample data is labeled based on the on-site inspection results to construct a training sample set. For example, abnormal data is labeled as 1, and normal data is labeled as 0.
[0042] Operation S2 constructs an abnormal power consumption detection model including a multi-scale differential convolution module, a quantization module, and a classification module. The multi-scale differential convolution module uses multi-scale differential convolution kernels to perform convolution operations on the data in the training sample set to obtain differential data for multiple channels. The quantization module determines each quantization point according to the quantization level, and then for each channel, obtains the differential data corresponding to each quantization point as a quantization threshold, thereby obtaining the quantized data corresponding to all differential data.
[0043] Unlike existing technologies, this method only normalizes the raw data, using it as training samples to train the classification network. For example... Figure 2 As shown, this invention proposes an abnormal power consumption detection model that includes a multi-scale differential convolution module, a quantization module, and a classification module. Specifically:
[0044] (1) Multi-scale differential convolution module. Multi-scale differential convolution kernels are used to convolve the data in the training sample set to obtain differential data from multiple channels, extracting information on changes in electricity consumption patterns. The length of the differential convolution kernel can be of various scales, such as 3, 5, 7, etc., to achieve different levels of extraction of information on changes in electricity consumption patterns. Preferred convolution kernels include: when the kernel length is 3, the kernel parameters can be [-1, 1, 0], [-1, 2, -1], and [0, 1, -1] or other values; when the kernel length is 5, the kernel parameters can be [-1, -1, 4, -1, -1] or other values; when the kernel length is 7, the kernel parameters can be [-1, -1, -1, 6, -1, -1, -1] or other values. The convolution formula is as follows:
[0045]
[0046] Where X(n) is the normalized data of length n, d(k) is the differential convolution kernel of size k, and X(n) diff This is the data after differencing.
[0047] For example, such as Figure 3 The diagram shows an optional multi-scale differential module structure provided by an embodiment of the present invention. Normalized data is cyclically padded, and then convolved one-dimensionally with a defined differential convolution kernel to obtain the differential data. The purpose of cyclic padding is to ensure that the sequence length of the convolved data remains unchanged. The convolution kernel consists of three fixed-parameter differential convolution kernels with a length of 3, and the kernel parameters are [-1, 1, 0], [-0.5, 1, -0.5], and [0, 1, -1], respectively, to subtract adjacent values from the data. In this embodiment, the normalized data size is 1×D, the data size after cyclic padding is 1×(D+2), and the data size after differential convolution becomes 3×D, where D is the length of one day's electricity consumption data.
[0048] (2) Quantization module. Based on the quantization level, each quantization point is determined. Then, for each channel, the differential data corresponding to each quantization point is obtained as the quantization threshold, thereby obtaining the quantized data corresponding to all differential data, eliminating the impact of normal fluctuations in electricity consumption data caused by the randomness of electricity consumption behavior on abnormal electricity consumption detection.
[0049] In this embodiment, each quantile is determined based on the quantization level n. The difference data for each channel are sorted from smallest to largest, and then the difference data corresponding to each quantization point is used as the quantization threshold [α1, α2, ..., α]. n-1 The quantization function is then determined by the quantization threshold, and the differential data of each channel is quantized to obtain the corresponding quantized data. The quantization function formula is as follows:
[0050]
[0051] Where x represents any differential data in any channel, and Quant(x) represents the quantized data corresponding to the differential data x.
[0052] (3) Classification Module. Abnormal electricity consumption detection can be considered a standard binary classification task, where the detection model classifies samples as normal or abnormal (normal is usually set to 0 and abnormal to 1 in the task). User electricity consumption data samples can be considered as univariate time series, therefore, the abnormal electricity consumption detection task can use the latest time series classification network. The deep time series classification network is trained using the differentially quantized data in a binary classification manner.
[0053] Operation S3 inputs all quantified data into the classification module and trains the abnormal power consumption detection model with the goal of minimizing classification loss.
[0054] In the model application phase, such as Figure 4 As shown, the time series data of electricity consumption to be detected is preprocessed and then input into the trained abnormal electricity consumption detection model to obtain the category probability. The maximum value index of the category probability is taken along the horizontal axis. If the maximum value index is 1, it indicates that the detected electricity consumption is abnormal. If the maximum value index is 0, it indicates that the detected electricity consumption is normal.
[0055] Application examples:
[0056] A cross-domain scenario dataset was constructed using publicly available power datasets and False Data Injection (FDI) to provide training, testing, and comparison for the proposed model algorithm.
[0057] The publicly available power dataset used in this embodiment includes:
[0058] (1) Ireland Smart Meter Dataset, which contains electricity consumption data of 4,225 residential users and 485 small and medium-sized industrial and commercial users in Ireland from July 15, 2009 to December 31, 2010, with a sampling interval of 30 minutes.
[0059] (2) Low Carbon London Smart Meter Dataset, which contains electricity consumption data of 5,567 residents in London, UK, who participated in the Low Carbon London project from November 2011 to February 2014, with a sampling interval of 30 minutes.
[0060] (3) The UCI Electricity Load Dataset contains electricity consumption data from 370 large industrial users from 2011 to 2014, with a sampling interval of 15 minutes. To ensure scale consistency, the data from every two sampling points in this dataset are added and merged, resulting in a final time granularity of 30 minutes.
[0061] Hereinafter referred to as the Ireland dataset, the London dataset, and the UCI Electricity dataset.
[0062] Real-world abnormal electricity consumption data may exhibit the following characteristics: a continuous or variable decrease in electricity consumption; irregular electricity consumption patterns; zero electricity consumption; and a sudden drop in electricity consumption. The abnormal data injection types in this embodiment are the six types shown in Table 1.
[0063] Table 1. Types of abnormal power consumption used in this embodiment.
[0064]
[0065]
[0066] *Note: x t This represents the raw electricity consumption collected at time t. Let x represent the electricity consumption after time t is altered, x be the original electricity consumption sequence, α and β be random numbers, γ be the percentile, and α be the value of β. t Let be the value at time t in a random sequence. This represents the average electricity consumption.
[0067] In this embodiment, the three public datasets are divided into four different domains after data cleaning, based on different users, user types, time periods, and regions:
[0068] 1) Source Domain (SD). The SD Ireland dataset contains electricity consumption data for residential users over one year (52 weeks, 364 days).
[0069] 2) Target Domain 1 (TD1): This target domain is a cross-user type domain. TD1 contains electricity consumption data for small and medium-sized industrial and commercial users from the Ireland dataset for one year (52 weeks, 364 days). This domain simulates a cross-user type scenario, using residential electricity consumption data from the source domain for training and detecting electricity consumption data from industrial and commercial users.
[0070] 3) Target Domain 2 (TD2): This target domain spans both geographical and temporal domains. TD2 contains electricity consumption data for one year (52 weeks, 364 days) of residential users participating in the Low Carbon London project in the London dataset. Due to their participation in the low carbon program, the electricity consumption of users in this dataset is significantly smaller than that of residential users in the Ireland dataset.
[0071] 4) Target Domain 3 (TD3): This target domain spans user type, region, and time. TD3 contains electricity consumption data for large industrial users concentrated in the UCI Electricity dataset, covering 52 weeks (364 days) from January 2, 2012 to December 30, 2012. The electricity consumption scale of users in this target domain is significantly higher than that of residential users.
[0072] Since existing publicly available fine-grained datasets only contain normal electricity consumption data, it is necessary to construct a dataset containing abnormal electricity consumption data for model training and testing. To reduce data dimensionality, decrease model parameters, and accelerate training, a weekly-level abnormal electricity consumption dataset is constructed for model training and performance testing. The steps for constructing the weekly-level abnormal electricity consumption dataset are as follows:
[0073] 1) After data cleaning, users in each field are randomly divided into normal users and abnormal users and labeled. The ratio of normal users to abnormal users is 2:1.
[0074] 2) Randomly assign one of the six abnormal electricity consumption types in Table 1 to the marked abnormal electricity consumption type.
[0075] 3) After cropping the user electricity consumption data marked with abnormal electricity consumption types by week, randomly select a point each week as the abnormal starting point. The selection of the abnormal starting point is limited to any sampling point time from the second day to the second to last day to ensure that the data has enough information on changes in electricity consumption behavior. Convert the data after the abnormal electricity consumption behavior starting point into abnormal electricity consumption data according to the conversion formula corresponding to the marked abnormal electricity consumption type.
[0076] 4) The normal user labeled data of each domain is cropped weekly and then merged with the abnormal data after abnormal data injection processing to form the abnormal electricity consumption dataset of that domain.
[0077] The final dataset information for each domain is shown in Table 2:
[0078] Table 2 Dataset Information for Cross-Domain Scenarios
[0079]
[0080] This embodiment uses a binary classification method to detect abnormal power consumption, testing the performance of a classification model trained in the source domain under different cross-domain scenarios. This embodiment uses accuracy (ACC) and area under the curve (AUC) as evaluation metrics to represent the model's classification performance.
[0081] ACC represents the overall accuracy of the model's classification, while AUC (Area Under Curve) is the area under the Receiver Operating Characteristic (ROC) curve. The ROC curve is a performance curve of the classifier plotted based on different classification thresholds. The horizontal axis represents the false positive rate, and the vertical axis represents the true positive rate. AUC can reflect the classification performance of the classifier under imbalanced conditions, and its value ranges between 0.5 and 1. The closer it is to 1, the better the model's classification performance.
[0082] The results obtained using these two metrics are shown in Table 3. Training was performed using source domain data, and testing was conducted using target domain data. The batch size was set to 1024, the training epochs were 150, the optimizer used was SGD with momentum, the initial learning rate was set to 0.1, the learning rate decreased to 0.01 after the 90th epoch, and the learning rate decreased to 0.001 after the 120th epoch. The quantization level was set to 5, and the quantiles were [0.2, 0.4, 0.6, 0.8].
[0083] Each model corresponds to four columns of data. The first two columns represent the baseline experimental results, i.e., the results of training and testing the deep time series classification model directly on the normalized electricity consumption data. The last column represents the results of training and testing using the data processed by the multi-scale differential quantization method proposed in this invention. The results show that the differential quantization method of this invention can improve the cross-domain detection capability for different deep time series networks.
[0084] Table 3 Comparison of the effects of adding the proposed method to the deep time series classification model.
[0085]
[0086] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing an abnormal electricity consumption detection model based on multi-scale differential quantization, characterized in that, The method comprises the following steps: obtaining time series data of power consumption and preprocessing the data as a training sample set; building an abnormal power consumption detection model comprising a multi-scale differential convolution module, a quantization module and a classification module; the multi-scale differential convolution module uses a multi-scale differential convolution kernel to perform convolution operation on data in the training sample set to obtain differential data of multiple channels; the quantization module determines each quantile according to a quantization level, and for each channel, obtains differential data corresponding to each quantile as a quantization threshold, thereby obtaining quantized data corresponding to all differential data; all quantized data is input into the classification module, and the abnormal power consumption detection model is trained with the objective of minimizing classification loss; the quantization module determines each quantile according to a quantization level, and for each channel, obtains differential data corresponding to each quantile as a quantization threshold, thereby obtaining quantized data corresponding to all differential data, which comprises: Determine each quantization point according to quantization level n , respectively, each channel from small to large order difference data, and the corresponding quantization threshold difference data as each quantization point ; a quantization function is determined by the quantization threshold, and quantization operation is performed on the differential data of each channel to obtain corresponding quantized data; the quantization function formula is as follows: wherein, represents any differential data in any channel, represents differential data corresponding quantized data.
2. The method of claim 1, wherein the method comprises: the preprocessing comprises missing value processing, noise data filtering and normalization.
3. A method for detecting abnormal electricity use based on multi-scale differential quantization, characterized in that, The method comprises the following steps: time series data of power consumption to be detected is preprocessed and input into an abnormal power consumption detection model built by the construction method of the abnormal power consumption detection model based on multi-scale differential quantization according to any one of claims 1 to 2, and a detection result is output.
4. A device for constructing an abnormal power consumption detection model based on multi-scale differential quantization, characterized in that, The method comprises the following steps: an acquisition module is configured to obtain time series data of power consumption and preprocess the data as a training sample set; a building module is configured to build an abnormal power consumption detection model comprising a multi-scale differential convolution module, a quantization module and a classification module; the multi-scale differential convolution module uses a multi-scale differential convolution kernel to perform convolution operation on data in the training sample set to obtain differential data of multiple channels; the quantization module determines each quantile according to a quantization level, and for each channel, obtains differential data corresponding to each quantile as a quantization threshold, thereby obtaining quantized data corresponding to all differential data; a training module is configured to input all quantized data into the classification module, and train the abnormal power consumption detection model with the objective of minimizing classification loss; the quantization module determines each quantile according to a quantization level, and for each channel, obtains differential data corresponding to each quantile as a quantization threshold, thereby obtaining quantized data corresponding to all differential data, which comprises: According to the quantization level n, each quantile point is determined The differential data of each channel is sorted from small to large, and the differential data corresponding to each quantile point is taken as a quantization threshold ; a quantization function is determined by the quantization threshold, and quantization operation is performed on the differential data of each channel to obtain corresponding quantized data; the quantization function formula is as follows: wherein, represents any differential data in any channel, represents differential data corresponding quantized data.
5. An abnormal power consumption detection device based on multi-scale differential quantization, characterized by, The method comprises the following steps: time series data of power consumption to be detected is preprocessed and input into an abnormal power consumption detection model built by the construction method of the abnormal power consumption detection model based on multi-scale differential quantization according to any one of claims 1 to 2, and a detection result is output.
6. A machine-readable storage medium, characterized in that, The machine readable storage medium stores machine executable instructions that, when called and executed by the processor, cause the processor to implement the method for constructing an abnormal power consumption detection model based on multi-scale difference quantization according to any one of claims 1 to 2 and / or the method for detecting abnormal power consumption based on multi-scale difference quantization according to claim 3.
Citation Information
Patent Citations
Circuit breaker image edge detection method fusing spatial constraint fuzzy clustering and lightweight network optimization
CN120451585A
Intelligent monitoring and early warning method and device for photovoltaic energy storage equipment
CN120638644A