Electric energy meter anomaly detection system and method based on multi-granularity dynamic receptive field

Through the combination of the multi-grained dynamic receptive field module and the Transformer model, the problems of information loss and insufficient semantic feature mining in the abnormal detection of multi-dimensional time sequence data are solved, and the accuracy and robustness of abnormal detection are improved.

CN119128750AActive Publication Date: 2024-12-13BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411176227.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-13
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

The existing multidimensional timing data anomaly detection methods have problems such as information loss and insufficient semantic feature mining when dealing with complex mode changes, especially in low information density data, which leads to limited model overfitting and detection accuracy.

Method used

The multi-grained dynamic receptive field module is used to traverse the patch block data of the power meter, and combine the multi-dimensional timing codec module and the double-layer abnormality detection module to reconstruct and lose calculation through the Transformer model to achieve weighting of the receptive fields of different granularity Processing to improve abnormal detection accuracy.

Benefits of technology

Effectively mining the advanced semantic features of multi-dimensional time series data, solve the problems of information loss and insufficient semantic feature mining, and improve the accuracy and robustness of abnormal detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128750A_ABST
    Figure CN119128750A_ABST
Patent Text Reader

Abstract

The invention discloses an electric energy meter anomaly detection system and method based on a multi-granularity dynamic receptive field, and belongs to the technical field of electric energy metering. The system comprises a multi-granularity dynamic receptive field module used for performing traversal processing on patch block data of an electric energy meter to output receptive field data; the multi-dimensional time sequence codec module is used for reconstructing the receptive field data output by the multi-granularity dynamic receptive field module and outputting reconstructed data; and the double-layer anomaly detection module is used for calculating an anomaly score of the reconstruction data output by the multi-dimensional time sequence codec module, and determining the anomaly of the electric energy meter based on the anomaly score. Through the receptive field and the data reconstruction, the method can identify the data anomaly so as to determine the anomaly score, and solves the problem of possible information loss or insufficient semantic feature mining when an existing reconstruction method processes multi-dimensional time series data with low information density.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric energy metering, and more specifically, to an electric energy meter anomaly detection system and method based on a multi-granularity dynamic receptive field. Background Art

[0002] With the rapid development of Internet of Things technology, the level of automation and intelligence in the power industry is constantly improving, especially in key areas such as power dispatching automation systems and smart meters, where the generation and application of multivariate time series data are increasing. These multidimensional time series data not only form the basis of cyber-physical systems, but their stability and accuracy are also crucial to the efficient operation of the entire system. Once these key components are abnormal, it may not only lead to system performance degradation, but also trigger a chain reaction, causing serious damage to the stability and economic operation of the power grid. By adopting advanced data analysis technologies such as machine learning, deep learning, time series analysis, etc., abnormal patterns in multidimensional time series data of smart meters can be effectively identified and predicted. This can not only improve the accuracy and response speed of anomaly detection, but also help to achieve real-time monitoring and intelligent diagnosis of power systems, thereby providing strong technical support for the intelligence and automation of the power industry.

[0003] In anomaly detection, due to the robustness and stability of the physical equipment of electric energy meters, the data collected by them usually consists of a large amount of normal data. Therefore, most multidimensional time series anomaly detection works focus on semi-supervised learning settings (model training uses only normal data) or unsupervised learning settings (training data is mostly normal but may contain a small number of unknown anomalies). Most multidimensional time series anomaly detection methods usually calculate the anomaly score for each time point and then compare the score with a certain threshold. In recent works on semi-supervised or unsupervised multidimensional time series anomaly detection, deep learning-based methods have achieved the best results on authoritative and publicly available multidimensional time series dataset benchmarks.

[0004] Deep learning methods can be divided into two categories, among which prediction-based methods and reconstruction-based methods have been widely used. Prediction methods use past information to predict future values ​​in time series and use prediction errors as indicators for anomaly detection. Reconstruction methods encode the entire time series into a latent space and infer anomaly labels based on the reconstruction error between the original data and the reconstructed data. However, multidimensional time series data usually have complex pattern changes, and future time series values ​​may show high uncertainty, which makes it challenging to accurately predict multidimensional time series data. In contrast, existing reconstruction-based methods have achieved state-of-the-art results in complex multidimensional time series datasets. However, since reconstruction methods need to reconstruct the entire time series, their performance depends largely on the ability of the reconstruction model to extract and learn the normal patterns of the data. In order to make the overall reconstruction error of the reconstruction model small, when the data shows uncertainties such as small fluctuations, the strong data sensitivity of the reconstruction model will cause large reconstruction errors at the time points of fluctuations, so the reconstruction model's ability to express details is limited.

[0005] In recent years, mask reconstruction methods have shown good performance in the field of multi-dimensional time series data anomaly detection, which are mainly divided into point mask reconstruction and patch mask reconstruction. The former mainly designs masks for multiple time points in the time window, while the latter processes time series data in the form of patches or time periods. After in-depth analysis, compared with natural language data with rich semantics for each independent data point, multi-dimensional time series data are mostly continuous data points with weak semantics. It is difficult to mine the rich time dependency and dimensional correlation of time series data for prediction or reconstruction of time points. Therefore, point mask reconstruction based on single point mining is not suitable for multi-dimensional time series anomaly detection tasks, and patch mask reconstruction is more suitable for information extraction of time series data segments. Patch mask reconstruction usually only masks one of the multiple patches in the time series window, and processes the input data at a fixed position or random position. However, fixed position masking will sacrifice some information characteristics of the input data. While the random masking strategy introduces randomness in model training, its testing process will also fall into the disadvantages of fixed position masking. In addition, fixed or random position masks limit the size of the model's receptive field for the data. During the training process, it often falls into the repeated learning of features at the same level and cannot achieve multi-layer semantic interaction, which limits the improvement of its anomaly detection accuracy and may even cause the model to overfit. Summary of the invention

[0006] In view of the above problems, the present invention proposes an electric energy meter anomaly detection system based on a multi-granularity dynamic receptive field, comprising:

[0007] A multi-granularity dynamic receptive field module is used to traverse and process the patch block data of the electric energy meter to output the receptive field data;

[0008] A multi-dimensional temporal codec module, used for reconstructing the receptive field data output by the multi-granularity dynamic receptive field module and outputting the reconstructed data;

[0009] The double-layer anomaly detection module is used to calculate the anomaly score of the reconstructed data output by the multi-dimensional time series codec module, and determine the anomaly of the electric energy meter based on the anomaly score.

[0010] Optional, multi-granularity dynamic receptive field module, also used for:

[0011] Multidimensional time series data of an electric energy meter is obtained, the multidimensional time series data is standardized to obtain standardized data, and the standardized data is converted into patch block data using a window-patch strategy.

[0012] Optionally, the multi-granularity dynamic receptive field module traverses and processes the patch block data of the electric energy meter to output receptive field data, including:

[0013] The patch block data is subjected to a double-layer traversal process based on position and size, and the multi-dimensional temporal semantic features of the patch block data are represented by receptive field data to output the receptive field data.

[0014] Optionally, the multi-dimensional time series encoder-decoder module reconstructs the receptive field data based on the Transformer model and obtains the output data of the Transformer model.

[0015] Optionally, the two-layer anomaly detection module determines the receptive field losses of different granularities based on the reconstructed data, and determines the model loss based on the output data of the Transformer model, and performs weighted calculation on the receptive field loss and the model loss to obtain the anomaly score of the reconstructed data.

[0016] On the other hand, the present invention also proposes a method for detecting abnormality of an electric energy meter based on a multi-granularity dynamic receptive field, comprising:

[0017] Based on the multi-granularity dynamic receptive field module, the patch block data of the electric energy meter is traversed and processed to output the receptive field data;

[0018] Based on the multi-dimensional time series codec module, reconstruct the receptive field data output by the multi-granularity dynamic receptive field module, and output the reconstructed data;

[0019] Based on the double-layer anomaly detection module, an anomaly score of the reconstructed data output by the multi-dimensional time series codec module is calculated, and based on the anomaly score, an anomaly of the electric energy meter is determined.

[0020] Optionally, the method further includes:

[0021] Based on a multi-granularity dynamic receptive field module, multi-dimensional time series data of an electric energy meter is obtained, the multi-dimensional time series data is standardized to obtain standardized data, and a window-patch strategy is used to convert the standardized data into patch block data.

[0022] Optionally, the patch block data of the electric energy meter is traversed and processed based on a multi-granularity dynamic receptive field module to output receptive field data, including:

[0023] The patch block data is subjected to a double-layer traversal process based on position and size, and the multi-dimensional temporal semantic features of the patch block data are represented by receptive field data to output the receptive field data.

[0024] Optionally, the receptive field data is reconstructed based on a Transformer model of the multi-dimensional temporal encoder-decoder module, and output data of the Transformer model is obtained.

[0025] Optionally, calculating the anomaly score of the reconstructed data output by the multi-dimensional time series codec module based on the two-layer anomaly detection module includes:

[0026] Based on the reconstructed data, the receptive field losses of different granularities are determined, and based on the output data of the Transformer model, the model loss is determined, and the receptive field loss and the model loss are weightedly calculated to obtain the anomaly score of the reconstructed data.

[0027] In yet another aspect, the present invention further provides a computing device, comprising: one or more processors;

[0028] a processor for executing one or more programs;

[0029] When the one or more programs are executed by the one or more processors, the above-described method is implemented.

[0030] In yet another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the method described above is implemented.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] The present invention provides an electric energy meter anomaly detection system and method based on a multi-granularity dynamic receptive field, comprising: a multi-granularity dynamic receptive field module, used for traversing and processing patch block data of the electric energy meter to output receptive field data; a multi-dimensional time series codec module, used for reconstructing the receptive field data output by the multi-granularity dynamic receptive field module and outputting reconstructed data; a double-layer anomaly detection module, used for calculating the anomaly score of the reconstructed data output by the multi-dimensional time series codec module, and determining the anomaly of the electric energy meter based on the anomaly score. The present invention can identify data anomalies through receptive fields and data reconstruction, thereby determining anomaly scores, and solves the problem of information loss or insufficient semantic feature mining that may occur in existing reconstruction methods when processing multi-dimensional time series data with low information density. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a framework structure diagram of the system of the present invention;

[0034] Figure 2 It is a framework diagram of the multi-dimensional timing codec module of the system of the present invention;

[0035] Figure 3 It is a framework diagram of the double-layer anomaly detection module of the system of the present invention;

[0036] Figure 4 Flow chart of the method of the present invention. DETAILED DESCRIPTION

[0037] Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units / elements are marked with the same reference numerals.

[0038] Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.

[0039] Embodiment 1:

[0040] The present invention proposes an electric energy meter anomaly detection system based on multi-granularity dynamic receptive field, such as Figure 1 As shown, including:

[0041] A multi-granularity dynamic receptive field module is used to traverse and process the patch block data of the electric energy meter to output the receptive field data;

[0042] A multi-dimensional temporal codec module, used for reconstructing the receptive field data output by the multi-granularity dynamic receptive field module and outputting the reconstructed data;

[0043] The double-layer anomaly detection module is used to calculate an anomaly score of the reconstructed data output by the multi-dimensional time series codec module, and determine the anomaly of the electric energy meter based on the anomaly score.

[0044] Among them, the multi-granularity dynamic receptive field module is also used for:

[0045] Multidimensional time series data of an electric energy meter is obtained, the multidimensional time series data is standardized to obtain standardized data, and the standardized data is converted into patch block data using a window-patch strategy.

[0046] Among them, the multi-granularity dynamic receptive field module traverses and processes the patch block data of the electric energy meter to output receptive field data, including:

[0047] The patch block data is subjected to a double-layer traversal process based on position and size, and the multi-dimensional temporal semantic features of the patch block data are represented by receptive field data to output the receptive field data.

[0048] Among them, the multi-dimensional time series encoder-decoder module reconstructs the receptive field data based on the Transformer model and obtains the output data of the Transformer model.

[0049] Among them, the two-layer anomaly detection module determines the receptive field loss of different granularities based on the reconstructed data, and determines the model loss based on the output data of the Transformer model. The receptive field loss and the model loss are weightedly calculated to obtain the anomaly score of the reconstructed data.

[0050] The present invention will be further described below in conjunction with specific embodiments:

[0051] This invention proposes a multi-granularity mask strategy to continuously mine the semantic features of multi-dimensional time series data from low-level to high-level, and designs a dynamic receptive field to solve the information loss problem of existing mask reconstruction, so as to better learn the temporal dependency and dimensional coupling relationship of the data. In addition, MGDRF designs a hierarchical loss based on receptive field and model. By constructing the underlying loss for each single granularity of receptive field, the low-level or high-level semantic features of the time series corresponding to the granularity are mined. The idea of ​​ensemble learning is introduced, and a high-level loss is constructed by fusing the reconstruction results of multi-granularity dynamic receptive fields to further learn the semantic interaction features between different granularities of time series data. The method framework is as follows: Figure 1As shown in the figure, MGDRF can learn long sequences based on the multi-granularity dynamic receptive field module and provide rich context segment-level information representation through the feature processing module. Through the double-layer anomaly detection training of information representation, semantic information of different granularities can be obtained, thereby improving the anomaly detection ability of the model.

[0052] The present invention mainly includes a multi-granularity dynamic receptive field module, a multi-dimensional time series codec module and a double-layer anomaly detection module. First, the standardized input data is converted into patch blocks through a window-patch strategy to obtain a multi-granularity receptive field module input. Secondly, by performing a double-layer traversal of the time series patch data based on position and size, the semantic features rich in multi-dimensional time series can be represented by receptive field data of different granularities. After that, it is input into the multi-dimensional time series codec module, the receptive field data is reconstructed based on the Transformer model, and the receptive field reconstruction output and model output are obtained based on the double-layer anomaly detection module. Finally, the receptive field losses of different granularities are weightedly calculated with the final integrated learning model loss to obtain the data anomaly score.

[0053] Multi-granularity dynamic receptive field module:

[0054] In this section, the present invention aims to design an effective unsupervised time series anomaly detection method for time series data. Inspired by the field of natural language processing, as an artificially generated signal, each data point in natural language (i.e., a word in a sentence) has rich semantics and is suitable as a data unit for model input. In contrast, time series data has a low semantic density, and each isolated data point gives less semantic information. Time series semantics only appear when we observe at least segment-level data. And for time series data, its feature information is distributed in a longer segment of sequence data. For example, a traffic system records data every five seconds. If you want to understand the periodicity of each day, this requires a complete cycle time slice of at least 288 consecutive time points. Although downsampling (lower frequency sampling) is a possible solution, it will inevitably lose information. Based on this, the present invention designs a window-patch strategy and a patch-window strategy to divide the entire larger time window into different patches, and use patch masks to deeply mine the time series data.

[0055] like Figure 1 As shown in the multi-granularity dynamic receptive field module, the input of the module is an M*T dimensional window. The algorithm first converts the window into a patch through the window-patch strategy and then performs data replication and mask design. For the original input time series window x∈R T×M, MGDRF will set a longer data input window (i.e., T is larger). Although a longer time series window will increase the complexity of the model, MGDRF can alleviate it by stacking attention blocks and fixing model parameters to reduce computational and memory overhead. M×T The time is divided into P patches, then the time series patch x = {x1,...,x p ,...,x P}, where x p ∈R M×T / p In the window-patch strategy, MGDRF first splits each patch by segment embedding:

[0056] EM p =E L x p E+E p (pos) (1)

[0057] Among them, E L ∈R L×M With E∈R T / p×1 Project each segment through a linear layer to obtain an initial embedding representation of length L, E p (pos) It is the learnable position encoding for different position fragments, and the EM obtained by adding them together p is the final embedding representation corresponding to the fragment at the pth position. Then EM={EM1,...,EM p ,...,EM P}=Embedding{x1,...,x p ,...,x P}, EM∈R P×L , that is, P patches, each patch vector has a length of L.

[0058] In addition, the patch size has a great influence on the learning of the model. A smaller patch mask can be simply predicted by the model, which makes the training model only focus on low-level information. At the same time, a larger patch mask increases the difficulty of model reconstruction. In order to obtain a smaller reconstruction error, a larger patch mask task forces the model to conduct in-depth mining of the time dependency within the time series data sequence and the dimensional correlation between sequences. However, a patch mask that is too large will learn too little data information, which is likely to cause the model to fail to learn well. Therefore, the present invention designs a multi-granularity masking strategy to mine the semantic information of time series data from low-level to high-level, so as to interactively learn multi-dimensional time series data, such as Figure 1As shown in the lower part. In addition, fixed position masking will lead to information loss of input data, while random position masking brings randomness and uncertainty to the model, and it is impossible to achieve consistency between the training and testing processes (because training can use random position masking multiple times to reduce input information loss, but the test process only masks once). In order to fully explore the rich time dependency and feature coupling relationships of multi-dimensional time series data, and reduce the randomness of the model while maintaining consistency between the training and testing processes, the present invention designs a dynamic receptive field for the mask position.

[0059] Therefore, for the embedding representation EM, the mask ratio m is introduced p Get the receptive field output DRF i :

[0060] DRF i =EM p ×(1-m p ), i={2,3,...,P-1}, i+p=P(2)

[0061] That is, the mask ratio m p The larger the receptive field DRF is, the i The smaller it is, the less information the model can receive. In order to obtain a smaller loss, the model will tend to learn the high-level semantic features of the sequence trend changes. This creates a relatively challenging self-supervision task for the model, forcing the model to enhance its overall understanding of the time series data. Similarly, the mask ratio m p The smaller the receptive field DRF i The larger it is, the more information the model receives. Figure 1 As shown in the DRF7 section, the model will learn to represent the rich temporal dependencies and dimensional correlations of time series data. At this time, MGDRF can learn relatively rich detailed feature representations.

[0062] For different DRF i Input, the model can be input to the encoder-decoder structure in parallel for training to reduce overhead, because each receptive field DRF i A separate model will be trained for each dataset, and the most effective model solution in the corresponding dataset will be selected by ensemble learning at the final output. In addition, the receptive field design based on mask ratio will cause the information received by the model to be missing compared to the original dataset, which to some extent reduces the length of the time series data sequence. Therefore, MGDRF introduces the receptive step k to realize the dynamic single-step mask of each input, thereby further realizing the dynamic perception of the model, such as Figure 1 Each DRF i As shown in the multiple data variants. That is, for DRF i, the dynamic receptive field will copy the input data i-1 times and mask the i patches except the first and last ones to obtain DRF i,k The white patch in the figure is the mask part. Each dynamic receptive field DRF i,k It is expressed as: for p patches, the receptive field obtained by the model is i patches, where pi patches are the mask part and the position of the mask is the kth. It should be noted that each DRF i,k They are all input window-patched and masked data, not k dimensions.

[0063] but:

[0064] DRF i,k =EM p ×(1-m p,k ),p={1,3,...,P-2},i+p=P,k=2,3,...,P-2(3)

[0065] Where p is the mask size, k is the mask position, if P = 8, p = 1, k = 2, then i = Pp = 7, DRF 7,2 Then only one (p) patch is masked, and the masked position is the second (kth) patch.

[0066] Multi-dimensional Timing Codec Module:

[0067] After obtaining different receptive field inputs for each window, the MGDRF method can be trained based on a variety of feature processing networks. Due to the wide application and excellent performance of Transformer in various fields such as natural language processing, image processing, and multi-dimensional time series data, MGDRF uses Transformer to implement feature processing of multi-dimensional time series data, such as Figure 2 shown.

[0068] For the single-granularity mask strategy, MGDRF performs explicit mining of temporal dependencies and implicit analysis of dimensional dependencies for different dynamic receptive fields. The model encoder is designed to model the historical information of multi-dimensional time series data, including L en For each model input DRF i,k =X 0 , then the given encoder input is X 0 en ∈R P×L , the details of the lth encoder layer are as follows:

[0069]

[0070] Similarly, the model decoder also contains L deTranformer layers, the details of the lth decoder layer are as follows:

[0071]

[0072] in, In the encoder, given the input of the Transformer Layer is X l ∈R P×L , H is the number of heads, d l = [M / H] is the dimension of query, key and value in each head. The hth self-attention head calculates the attention weights between time points and extracts the semantic information of temporal data:

[0073]

[0074] Among them, W h Q , W h K , W h V ∈R L×dl express Figure 2 The three linear projectors in the Multi-Head Attention module, Q h , K h , V h ∈R P×dl Represents query, key, and value respectively. S h ∈R L×L represents the attention weight between the input window time points, Z h ∈R L×dl represents the output of the h-th temporal self-attention head. As shown in Equation 2, the outputs of the H self-attention heads are concatenated and then passed through a linear projector W Z ∈R Hdl×P By projection, we can get the output Z∈R of the multi-head attention Attn(·) P×L :

[0075] Z=Concat(Z1,…,Z h ,…,Z H )W Z (7)

[0076] The above formula is decoded by the decoder to obtain DRF i,k The codec output DRF′ i,k .

[0077] Two-layer anomaly detection module:

[0078] Since the performance of the model is different under different granularity receptive field sizes, the method of ensemble learning and weighted calculation based on the MLP layer is not applicable to the existing design of MGDRF. In addition, most of the current multi-dimensional time series anomaly detection methods still judge the subsequent positive and abnormal state labels based on the overall reconstruction error of the input and output. The model cannot learn data features of different levels according to the loss during the training process. Based on this, the present invention designs a hierarchical loss module, which includes a hierarchical loss design based on the receptive field and a model.

[0079] like Figure 3 As shown in the figure, the two-layer anomaly detection module is mainly divided into two aspects:

[0080] MGDRF constructs the underlying loss for each single-granularity receptive field to mine the low-level or high-level time series semantic features corresponding to the granularity. i,k , the codec gets the reconstructed output DRF i, ' k , at this time, the loss of the dynamic receptive field can be calculated as:

[0081] Loss i,k =|DRF i,k -DRF′ i,k | (8)

[0082] Where i = {2, 3, ..., P-1}, k = {2, 3, ..., P-2}. Since each input of the dynamic receptive field is the result of post-processing of data replication, for the receptive field under different dynamic changes k, MGDRF performs weighted calculation of the loss, thereby obtaining the first-level loss based on the receptive field:

[0083] Loss i =weightedMean(Loss i,k ), k=2,3,...,P-2 (9)

[0084] At this time, for each i receptive field model, there is a corresponding input and output detail representation loss Loss i The first stage of model training is based on Loss i Perform parallel training of i receptive field models and obtain the receptive field model output DRF i ′.

[0085] 2) Introducing the idea of ​​ensemble learning, MGDRF constructs high-level loss by fusing the reconstruction results of multi-granularity dynamic receptive fields, and further learns the semantic interaction features between different granularities of time series data. That is, for each multi-granularity receptive field DRF i , the first training stage obtains the model output DRF' i. At this time, MGDRF integrates the loss of multi-granularity receptive fields, because the present invention considers the balance of the model in the process of constructing the receptive field and adds a large mask receptive field (only the first patch or the last patch can be seen). The traditional weighted integration will be greatly affected by the large mask receptive field. At this time, the model output can be obtained as x'=Ensemble(weightedMean(DRF' i )). Then the model loss of the second stage is:

[0086] Loss = λLoss i +(1-λ)|xx′| (10)

[0087] Among them, x is the multi-dimensional time series input data window, x' represents the integrated output value of the model for the input data, and λ is a preset hyperparameter, which is usually 0. However, considering the retention of detailed features during the training process, the hyperparameter λ will be appropriately increased to about 0.2. The final output anomaly score is:

[0088]

[0089] Where N is the number of features in the dataset. Based on the above model input-output loss, the ensemble learning selector can select mask rates and training models with certain advantages among multiple mask training models. The model training pseudo code is shown in Algorithm 1.

[0090]

[0091] In the technical solution implemented by the present invention, according to the problem of information loss or insufficient semantic feature mining that may occur in the existing reconstruction method when processing multi-dimensional time series data with low information density, a multi-dimensional time series anomaly detection method MGDRF based on multi-granularity dynamic receptive field is proposed. The algorithm can learn the high-level semantic features of the true value of time series data better than the existing methods. Specifically, MGDRF proposes a multi-granularity mask strategy to continuously mine the semantic features of multi-dimensional time series data from low-level to high-level, and designs a dynamic receptive field to solve the information loss problem of the existing mask reconstruction, and better learn the time dependency and dimensional coupling relationship of the data. In addition, MGDRF designs a hierarchical loss based on receptive field and model. By constructing the bottom-level loss for each single-granularity receptive field, the low-level or high-level time series semantic features corresponding to the granularity are mined. In addition, the idea of ​​ensemble learning is introduced, and the high-level loss is constructed by fusing the reconstruction results of multi-granularity dynamic receptive fields to further learn the semantic interaction features between different granularities of time series data.

[0092] The present invention was compared with 16 more advanced models on an actual data set of smart meters, which confirmed the effectiveness and advancement of the present invention.

[0093] The present invention selects AUC, Fc1 and F1PA%K as evaluation indicators to verify the model performance of the proposed method and the baseline.

[0094] AUC (Area Under Curve). AUC is one of the most commonly used methods for evaluating unsupervised anomaly detection tasks. The AUC evaluation indicator mainly calculates the area under the ROC (Receiver Operating Characteristic) curve, which ranges from 0 to 1. A perfect data result will have an AUC of 1, while a random data will produce an AUC value of nearly 0.5. Compared with traditional evaluation indicators, the advantage of AUC is that it is not affected by threshold settings. However, AUC only reflects the number of abnormal time points correctly detected by the method, but a higher AUC does not mean that the method can accurately detect all abnormal segments.

[0095] F c1 (Composite F-score). c1 It is a metric proposed in recent literature for time series anomaly detection tasks. Unlike AUC, F c1 The advantage of the indicator is that it can fully reflect all abnormal segments correctly detected in the multidimensional time series, and it focuses on the ability of the algorithm to detect abnormal events. c1 The indicator needs to calculate the recall rate in the abnormal time period and the accuracy rate at the time point, so as to avoid the overestimation of the performance of some algorithms by the point adjustment strategy. The F c1 The rating is higher.

[0096] F1 PA%K (Point Adjustment % K). Similarly, we proposed F1 PA%K To solve the problem of overestimation of model performance due to point adjustment. It calculates the F1 score at the point level, but when the proportion of anomalies detected by the model in a continuous anomaly segment exceeds K%, the result is point adjusted. In order to reduce the dependence on parameter K, F1 PA%K F1 can be adaptively calculated by adjusting the size of K PA%K The area under the curve.

[0097] Comparison method:

[0098] The baseline comparison methods used in this experiment are the mainstream methods with certain influence at present, as shown in Table 1. These methods belong to different categories, including some classic methods: LOF, OCSVM and iForest. Reconstruction-based algorithms: InterFusion. Generative adversarial models: BeatGAN, USAD. Models focusing on dimensional or temporal analysis: GDN, GTA and MSCRED. The first two use graph structures to learn the relationship and coupling between different sensors, thereby achieving robust dimensional correlation analysis of multivariate time series data. MSCRED uses long short-term memory (LSTM) networks and attention mechanisms to analyze data. The latest temporal anomaly detection algorithms: TranAD and AT. The former builds a Transformer-based anomaly detection model based on adaptive and adversarial training processes. AT designs a method based on prior and serial correlation based on the attention mechanism, and performs anomaly detection based on different correlation differences in positive anomaly states. Multidimensional temporal anomaly detection reconstruction methods: CAE-AD, RAE, TSMAE, MOUT. CAE-AD is a contrastive learning based method for implicitly analyzing noise or anomalies, while the next three methods explicitly design modules for noise analysis. The mask reconstruction algorithm, ImDiffusion, implements unconditional generation of temporal interpolation based on a diffusion model, and performs anomaly detection by masking the interpolation error.

[0099] Table 1

[0100]

[0101] The present invention uses the Adam optimizer for training, with an initial learning rate of 1e-4 and a batch size of 16. The sliding window size and time step of the time series data are 240, the number of patches is 8, and the original training data is divided into a training set and a validation set in a ratio of 8:2. During training, each time the loss on the validation set does not decrease within 3 epochs, the learning rate will be reduced to half, and if the loss on the validation set does not decrease within 6 epochs, early stopping will be triggered. As for the baseline models, their hyperparameters and detection thresholds are set according to the information provided in their respective original papers. In the absence of explicit mention of these details, a grid search is performed to determine the optimal value. All experiments were repeated five times with different random seeds, and their average results are reported.

[0102] Actual electric meter data set:

[0103] The specific data characteristics of the smart electricity meter dataset (ELE) are shown in Table 2. The dataset is collected from 9 three-phase meters in multiple substations. Each device includes 22 sensor values: current (phase A, phase B, phase C), voltage (phase A, phase B, phase C), electric energy indication (positive active), electric energy indication (reverse active), electric energy indication (positive reactive), electric energy indication (reverse reactive), active power (phase A, phase B, phase C, total value), reactive power (phase A, phase B, phase C, total value), and power factor (phase A, phase B, phase C, total value).

[0104] Table 2

[0105]

[0106] During the data recording period, these smart meter devices experienced various types of anomalies, such as flow reversal, current loss, reverse running of the energy meter, flying away of the energy meter, uneven energy indication value, start button box of the energy meter, power differential anomaly, etc. This dataset contains data collected from each meter entity device at 96 points per day for 9-16 consecutive months. The experiment uses data containing only normal data for training, and uses data containing anomalies for testing. In addition, the actual meter data set includes 9 complete entity devices, and the actual meter data set shows data characteristics of different data sizes and uneven data anomaly ratios on different devices.

[0107] Evaluation of actual data set results:

[0108] In order to verify the universality of the proposed model, the performance of the proposed model is evaluated and analyzed on the actual electricity meter data set. The comparative experimental results are shown in Table 3. The table shows the AUC, F c1 、F1 PA%K Performance of three indicators. Among them, all the results shown in the table are the averages obtained from 5 separate runs, which enables the study to evaluate the robustness of each baseline method. In addition, the method with the best performance is highlighted in bold, and the second best performance is underlined.

[0109] It is worth noting that MGDRF performs well in all evaluation indicators, achieving an AUC value of 0.6409, an F c1 score and F1 of 0.4302 PA%K After analysis, it can be found that compared with the average results of other baseline methods, the AUC index of MGDRF is improved by 17.60%, which shows that MGDRF has a higher detection accuracy for abnormal time points and is less affected by data uncertainty. c1In terms of scores, MGDRF’s performance is 40.60% higher than the baseline method, which shows that MGDRF has a high recall rate and high accuracy rate for abnormal time period detection. PA%K In terms of score, MGDRF has increased by 48.84%, so the detection accuracy of the MGDRF algorithm for abnormal time periods is also at a high level. The high performance of the above three indicators also confirms the superiority and applicability of the MGDRF algorithm in the task of anomaly detection of multi-dimensional time series data.

[0110] As can be seen from Table 2, the ELE dataset has a relatively high anomaly ratio, and there are rich anomaly types in the data. Therefore, the excellent performance of MGDRF on the actual electric meter dataset reflects that the algorithm's multi-granularity dynamic receptive field module can better detect abnormal segments in different areas, thereby adapting to the impact of different anomalies on the model. In addition, since ELE is multi-dimensional time series data collected by actual intelligent three-phase electric meters, its features are composed of multiple monitoring quantities such as voltage, current, and electric power distributed in different parts of the system, so its features are all continuous quantities, and there is a strong correlation between the data dimensions. Therefore, the outstanding performance of MGDRF on this dataset shows that it can learn dimensional correlation well. Overall, MGDRF's Transformer-based multi-granularity dynamic receptive field model can fully capture the high-level semantic information of the time series, so it has an excellent performance on the ELE dataset. The comparative experimental results on the actual electric meter dataset are shown in Table 3;

[0111] Table 3

[0112]

[0113]

[0114] Embodiment 2:

[0115] The present invention also proposes a method for detecting abnormality of electric energy meters based on multi-granularity dynamic receptive fields. Figure 4 As shown, including:

[0116] Step 1: Based on the multi-granularity dynamic receptive field module, the patch block data of the electric energy meter is traversed and processed to output the receptive field data;

[0117] Step 2: reconstructing the receptive field data output by the multi-granularity dynamic receptive field module based on the multi-dimensional time series codec module, and outputting the reconstructed data;

[0118] Step 3: Based on the double-layer anomaly detection module, calculate the anomaly score of the reconstructed data output by the multi-dimensional time series codec module, and determine the anomaly of the electric energy meter based on the anomaly score.

[0119] The method further includes:

[0120] Based on a multi-granularity dynamic receptive field module, multi-dimensional time series data of the electric energy meter is obtained, the multi-dimensional time series data is standardized to obtain standardized data, and the standardized data is converted into patch block data using a window-patch strategy.

[0121] Among them, based on the multi-granularity dynamic receptive field module, the patch block data of the electric energy meter is traversed and processed to output the receptive field data, including:

[0122] The patch block data is subjected to a double-layer traversal process based on position and size, and the multi-dimensional temporal semantic features of the patch block data are represented by receptive field data to output the receptive field data.

[0123] Among them, the Transformer model based on the multi-dimensional time series codec module reconstructs the receptive field data and obtains the output data of the Transformer model.

[0124] Wherein, based on the two-layer anomaly detection module, calculating the anomaly score of the reconstructed data output by the multi-dimensional time series codec module includes:

[0125] Based on the reconstructed data, the receptive field losses of different granularities are determined, and based on the output data of the Transformer model, the model loss is determined, and the receptive field loss and the model loss are weightedly calculated to obtain the anomaly score of the reconstructed data.

[0126] The present invention can identify data anomalies through receptive field and data reconstruction, thereby determining the anomaly score, and solves the problems of information loss or insufficient semantic feature mining that may occur in existing reconstruction methods when processing multidimensional time series data with low information density.

[0127] Embodiment 3:

[0128] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of the method in the above embodiment.

[0129] Embodiment 4:

[0130] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both a built-in storage medium in a computer device and an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the method in the above embodiment.

[0131] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0132] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0135] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0136] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. An electric energy meter anomaly detection system based on multi-granularity dynamic receptive field, It is characterized in that include: A multi-granularity dynamic receptive field module is used to traverse and process the patch block data of the electric energy meter to output the receptive field data; A multi-dimensional temporal codec module, used for reconstructing the receptive field data output by the multi-granularity dynamic receptive field module and outputting the reconstructed data; The double-layer anomaly detection module is used to calculate the anomaly score of the reconstructed data output by the multi-dimensional time series codec module, and determine the anomaly of the electric energy meter based on the anomaly score.

2. The anomaly detection system according to claim 1, It is characterized in that The multi-granularity dynamic receptive field module is also used for: Multidimensional time series data of an electric energy meter is obtained, the multidimensional time series data is standardized to obtain standardized data, and the standardized data is converted into patch block data using a window-patch strategy.

3. The anomaly detection system according to claim 1, It is characterized in that The multi-granularity dynamic receptive field module traverses and processes the patch block data of the electric energy meter to output receptive field data, including: The patch block data is subjected to a double-layer traversal process based on position and size, and the multi-dimensional temporal semantic features of the patch block data are represented by receptive field data to output the receptive field data.

4. The anomaly detection system according to claim 1, It is characterized in that The multi-dimensional temporal codec module reconstructs the receptive field data based on the Transformer model and obtains the output data of the Transformer model.

5. The anomaly detection system according to claim 1, It is characterized in that The two-layer anomaly detection module determines the receptive field loss of different granularities based on the reconstructed data, and determines the model loss based on the output data of the Transformer model, and performs weighted calculation on the receptive field loss and the model loss to obtain the anomaly score of the reconstructed data.

6. A method for detecting abnormality in electric energy meters based on multi-granularity dynamic receptive fields. It is characterized in that include: Based on the multi-granularity dynamic receptive field module, the patch block data of the electric energy meter is traversed and processed to output the receptive field data; Based on the multi-dimensional time series codec module, reconstruct the receptive field data output by the multi-granularity dynamic receptive field module, and output the reconstructed data; Based on the double-layer anomaly detection module, an anomaly score of the reconstructed data output by the multi-dimensional time series codec module is calculated, and based on the anomaly score, an anomaly of the electric energy meter is determined.

7. The anomaly detection method according to claim 6, It is characterized in that The method further comprises: Based on a multi-granularity dynamic receptive field module, multi-dimensional time series data of an electric energy meter is obtained, the multi-dimensional time series data is standardized to obtain standardized data, and a window-patch strategy is used to convert the standardized data into patch block data.

8. The anomaly detection method according to claim 6, It is characterized in that The multi-granularity dynamic receptive field module traverses and processes the patch block data of the electric energy meter to output receptive field data, including: The patch block data is subjected to a double-layer traversal process based on position and size, and the multi-dimensional temporal semantic features of the patch block data are represented by receptive field data to output the receptive field data.

9. The anomaly detection method according to claim 6, It is characterized in that The Transformer model based on the multi-dimensional temporal encoder-decoder module reconstructs the receptive field data and obtains the output data of the Transformer model.

10. The anomaly detection method according to claim 6, It is characterized in that The method of calculating the anomaly score of the reconstructed data output by the multi-dimensional time series codec module based on the double-layer anomaly detection module includes: Based on the reconstructed data, the receptive field losses of different granularities are determined, and based on the output data of the Transformer model, the model loss is determined, and the receptive field loss and the model loss are weightedly calculated to obtain the anomaly score of the reconstructed data.

11. A computer device, It is characterized in that include: one or more processors; a processor for executing one or more programs; When the one or more programs are executed by the one or more processors, the method according to any one of claims 1 to 5 is implemented.

12. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and when the computer program is executed, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Seismic wave velocity modeling method based on SR Transform and multi-receptive-field module

    CN117784235A

  • Multivariable time sequence anomaly detection method and system based on graph neural network

    CN117786374A

  • Fossil image saliency target detection method based on multistage joint attention mechanism

    CN118097178A

  • Wind power prediction method and system in gale extreme weather

    CN118134021A

  • Abnormal event detection method and apparatus, computer device, storage medium, computer program, and computer program product

    WO2023142550A1