User-level multi-energy load data abnormal value detection method based on graph representation learning
Through multi-dimensional scale analysis and graph convolutional neural network combined with Boosting integrated model, the space-time coupling characteristics and unbalanced data of multi-energy load data in the power system are solved, and high-precision abnormality detection effect is achieved, improving the F1 score of abnormality detection.
Patent Information
- Application Number
- CN202510582554.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-19
AI Technical Summary
The existing methods cannot effectively process complex and changeable distribution network data in power systems, especially under the access of high proportion of new energy, the space-time coupling characteristics and unbalanced data characteristics of multiple time series are not fully considered, resulting in low abnormal detection accuracy and easy to miss detection.
The graph representation learning method based on multi-dimensional scale analysis method and graph convolutional neural network is adopted. By constructing low-dimensional feature space and graph structure data, semi-supervised training is carried out in combination with Boosting integrated model, the spatiotemporal correlation of multi-energy load time series is effectively modeled, and the detection training weight is adjusted to solve the overfitting problem of unbalanced data.
It realizes high-precision abnormality detection for multi-energy load data, improves the F1 score for abnormality detection, and performs excellently in unbalanced data, which can effectively capture the space-time coupling characteristics of multi-energy loads and complex hybrid weak-supervised abnormality detection problems.
Smart Images

Figure CN120508933A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of graph neural networks and relates to a method for detecting abnormal values of user-level multi-energy load data based on graph representation learning. Background Art
[0002] Publicly labeled datasets in the computer science field are standardized data sets that have been manually or automatically annotated, primarily used to train and validate machine learning models. Traditional statistical mathematical methods, unsupervised anomaly detection methods, supervised and semi-supervised methods, and graph-structured data have all achieved promising results on publicly labeled datasets in the computer science field. Technically, these methods all rely on a fundamental assumption during semi-supervised learning: the data used to train neural networks on graph-structured relationships is clean (normal), with only anomalous data present in the final test set.
[0003] However, the existing methods have the following defects:
[0004] Traditional statistical mathematical methods have the advantages of simple models and easy understanding. However, they have weak modeling capabilities for long-term dependencies and cannot handle complex nonlinear characteristics. They are no longer able to adapt to the application scenarios of complex and changeable distribution network data.
[0005] Unsupervised methods usually rely on assumptions about the distribution of normal data or abnormal data, and have certain limitations. At the same time, most unsupervised models have low anomaly detection accuracy on massive high-dimensional and complex distribution network data, and are prone to false detection and missed detection.
[0006] Among supervised and semi-supervised methods, methods based on time series models such as LSTM and RNN usually only focus on the temporal correlation of time series, and the associations between different time series are not effectively learned; most reconstruction methods are also based on time series models such as convolutional neural networks and recurrent neural networks as encoders, and do not adequately model the spatial correlation between different time series.
[0007] Most existing graph neural network-based methods rely on a fundamental assumption: the data used to train the neural network on graph structural relationships is clean (normal), with only anomalous data present in the final test set. However, in practical power system engineering applications, the massive, multi-dimensional distribution network data generated by a high proportion of renewable energy access carries multivariate uncertainties from complex processes such as acquisition, storage, circulation, and reprocessing. Typically, only a small amount of fully labeled data annotated by domain experts is included, while the majority of data is semi-labeled or unlabeled, making it impossible to guarantee the acquisition of all clean data for training. The anomaly detection problem for multi-energy load data at the user level of distribution network users constitutes a complex hybrid weakly supervised anomaly detection problem that must simultaneously consider the spatiotemporal coupling characteristics of multivariate time series and the characteristics of unbalanced data.
[0008] Therefore, a method that can simultaneously consider the spatiotemporal coupling characteristics of multivariate time series and the characteristics of unbalanced data is needed to solve the above technical problems. Summary of the Invention
[0009] This paper proposes a method for graphically representing user-level multi-energy load data in distribution networks based on multidimensional scaling analysis. This process can effectively model the spatiotemporal correlations between multi-energy load time series. Furthermore, it proposes an anomaly detection framework based on a Boosting ensemble learning model. This process can effectively address the overfitting problem of supervised models on unbalanced data, achieving an integrated improvement effect through repeated iterations. This method can effectively model complex power system load data, outperforming existing statistical mathematical methods and unsupervised methods. Furthermore, the graph construction based on multidimensional scaling analysis and graph representation learning based on graph convolutional neural networks can effectively model spatiotemporal correlations, outperforming traditional supervised methods and existing graph neural network frameworks.
[0010] The technical solution adopted by the present invention to solve the technical problem is: a method for detecting abnormal values of user-level multi-energy load data based on graph representation learning, comprising the following steps:
[0011] Step 1: Utilize the dimensionality reduction and clustering capabilities of multidimensional scaling analysis to map the multi-time series distribution network data into a low-dimensional feature space. By calculating the Euclidean distance between features to construct the edge weights of the graph structure data, the spatiotemporal correlation between the multi-energy load time series is modeled.
[0012] Step 2: Build a graph convolutional neural network to model the spatiotemporal correlation between multi-dimensional features;
[0013] Step 3: Build an overall training framework based on the Boosting ensemble model. Based on the semi-supervised training mode, train the base detector on some clean data, output the detection results on the validation set with outliers, and adjust the training weight of the next level detector according to the samples with detection errors.
[0014] Preferably, in step 1, mapping the multi-time series distribution network data to a low-dimensional feature space comprises the following steps:
[0015] Step 1-1-1: Use Euclidean distance as the metric distance of multidimensional scaling analysis and construct the distance matrix as follows:
[0016]
[0017] In formula (2), D represents the distance matrix, d ij Represents the distance between any two sample sequences, where d ij =||X i -X j||,i,j∈1,2,...,n,||·|| represents the distance function, X i 、X j represents any two samples;
[0018] Step 1-1-2: Calculate the eigenvalues and eigenvectors of the inner product matrix:
[0019]
[0020] In formula (5), V represents the eigenvector of the inner product matrix B, and Λ represents the eigenvalue matrix;
[0021] Step 1-1-3: Map the high-dimensional features to a 2-dimensional plane, select the two largest eigenvalues (λ1, λ2) and their eigenvectors (v1, v2); the coordinates after dimensionality reduction are:
[0022]
[0023] In formula (6), V' represents the new eigenvector matrix composed of (v1, v2), and Λ' represents the new eigenvalue matrix composed of (λ1, λ2).
[0024] Preferably, the step 1 of modeling the spatiotemporal correlation between multiple energy load time series includes the following steps:
[0025] Step 1-2-1: Divide the time series into a time series region set {Z} according to the sliding window ω. The w-th region time series set is:
[0026] Z w ={X (w-1)ω ,X (w-1)ω+1 ,...,X w-ω} (7)
[0027] In formula (7), Z w represents the w-th region time series, ω represents the sliding window, X t Represents the set of all N time series values at time t;
[0028] Step 1-2-2: Construct static graph structure data within each regional time series. The distance optimization goal of multidimensional scaling analysis is:
[0029]
[0030] In formula (8), X i represents the value of the i-th time series over the entire time length T, d ij Represents the distance between any two sample sequences;
[0031] Step 1-2-3: The distance optimization goal of multidimensional scaling analysis is:
[0032]
[0033] In formula (9), X i w 、 They represent the value of the i-th time series in the w-th graph over the entire time length T, and the value of the j-th time series in the w+1-th graph over the entire time length T, respectively.
[0034] Preferably, step 2 specifically includes: forming original data from multivariate time series, forming a graph through multidimensional scaling analysis, and then modeling by a graph convolutional neural network to form a precise modeling framework for the deep spatiotemporal coupling characteristics of multi-energy load time series.
[0035] More preferably, in step 2, the graph convolutional neural network is:
[0036]
[0037] The matrix form is:
[0038] Y=σ(L sym XW) (20)
[0039] In formula (19) and formula (20), σ represents the nonlinear part, U and λ represent the eigenvector matrix and eigenvalue respectively. represents the Chebyshev coefficient vector, C k (·) represents the k-order Chebyshev polynomial, x represents the input, and y represents the output; L sym represents the symmetric normalized Laplacian matrix, X represents the sample matrix, and W represents the linear weight matrix.
[0040] More preferably, in step 2, the single basis detector expression is:
[0041] F=Softmax(ReLU(c(L sym XW (0) )W (1) )) (twenty one)
[0042] In formula (21), σ represents the nonlinear part, U represents the eigenvector matrix, and L sym represents the symmetric normalized Laplacian matrix, X represents the sample matrix, and W represents the linear weight matrix.
[0043] Preferably, in step 3, the training of the weighted weights of the base learners is abandoned during training, and only the sample loss is designed to improve the learner's attention to easily misclassified samples, and finally a fully connected layer is superimposed to directly train the outputs of all base learners.
[0044] More preferably, in step 3, the loss function is:
[0045]
[0046] In formula (24), p represents the probability of predicting the sample category, α i represents the sample weight adjustment parameter;
[0047] If the sample is an abnormal sample, that is, y = 1, and p>0.5 is classified correctly, a smaller weight is given to the loss function, otherwise a larger weight parameter is given to it.
[0048] The beneficial effects of the present invention are:
[0049] 1. The present invention utilizes the dimensionality reduction and clustering capabilities of multidimensional scaling analysis to map multiple time series into a low-dimensional feature space, and constructs the edge weights of graph structured data by calculating the Euclidean distance between features. Therefore, the present invention can effectively model the spatiotemporal correlation between multiple energy load time series.
[0050] 2. The present invention uses multivariate time series as raw data, constructs a graph through multi-dimensional scaling analysis, and then models it through a graph convolutional neural network to form a precise modeling framework for the deep spatiotemporal coupling characteristics of multi-energy load time series.
[0051] 3. Based on a semi-supervised training model, the present invention trains a base detector on partially clean data, outputs detection results on a validation set with outliers, and adjusts the training weights of the next-level detector based on samples with detection errors. This process can effectively solve the problem of overfitting of head data by supervised models on unbalanced data. After repeated iterations, the effect of integrated improvement is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a model diagram of the user-level multi-energy load data outlier detection method based on graph representation learning of the present invention;
[0053] Figure 2 A diagram of a method for constructing dynamic multivariate time series graph data based on multidimensional scaling analysis according to the present invention;
[0054] Figure 3 This is a comparison diagram of the Boosting algorithm and the Adaboost algorithm framework of the present invention;
[0055] Figure 4 It is a basic process diagram of the multidimensional scaling analysis of the present invention;
[0056] Figure 5 is an outlier detection base detector diagram of the present invention;
[0057] Figure 6 This is the F1 score graph of each model under different abnormal proportions of the present invention. DETAILED DESCRIPTION
[0058] The following will provide a clear and complete description of the relevant technologies in the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0059] refer to Figures 1 to 6 As shown in FIG, this specific embodiment proposes a user-level multi-energy load data anomaly detection model based on Boosting ensemble learning and graph representation learning (graph learning with Boosting ensemble framework, Boost-GL), as shown in FIG. Figure 1 Firstly, a graphical representation method of multi-energy load data at the user level of distribution network based on multi-dimensional scaling analysis is proposed, as shown in Figure 2 As shown. The core of the method is to use the dimensionality reduction and clustering capabilities of multidimensional scaling analysis to map multiple time series to a low-dimensional feature space, and to construct the edge weights of the graph structure data by calculating the Euclidean distance between features. This process can effectively model the spatiotemporal correlation between multi-energy load time series; secondly, a graph convolutional neural network is constructed to model the spatiotemporal correlation between multi-dimensional features. Finally, an overall training framework based on the Boosting ensemble model is constructed, as shown in Figure 3 As shown in the figure, based on the semi-supervised training mode, the base detector is trained on some clean data, the detection results are output on the validation set with outliers, and the training weights of the next-level detector are adjusted according to the samples with detection errors. This process can effectively solve the problem of overfitting of the head data of the supervised model on unbalanced data. After repeated iterations, the effect of integrated improvement is achieved.
[0060] Real-world test results show that the anomaly detection accuracy of this invention surpasses most baseline models and other graph neural network models, with an average anomaly detection F1 score exceeding 0.94, and it performs well when the data is extremely unbalanced.
[0061] A. Graph Data Construction Based on Multidimensional Scaling
[0062] Multidimensional scaling analysis is a data dimensionality reduction algorithm, which is often used in data visualization and feature correlation research. It has the advantages of simple theory, high dimensionality reduction accuracy and fast calculation speed. The basic process of multidimensional scaling analysis is as follows: Figure 4 shown.
[0063] Consider a set of n samples with p features in multidimensional scaling analysis:
[0064] {X1, X2, ..., X n|f i ,i=1,2,…p} (1)
[0065] This method uses Euclidean distance as the metric distance of multidimensional scaling analysis. The distance between any two sample sequences can be expressed as d ij =||X i -X j ||,i,j∈1,2,...,n,‖·‖ represents the distance function. The distance matrix is constructed as follows:
[0066]
[0067] The centrosymmetric construction process of the distance matrix is shown as follows:
[0068]
[0069] Where I is the identity matrix and i is a vector of all ones of length n.
[0070] Calculate the inner product matrix B:
[0071]
[0072] In order to characterize the direction of data change, the eigenvalues and eigenvectors of the inner product matrix are calculated:
[0073]
[0074] Where V represents the eigenvector of the inner product matrix B, and Λ represents the eigenvalue matrix.
[0075] This method maps high-dimensional features to a 2-dimensional plane, so the two largest eigenvalues (λ1,λ2) and their eigenvectors (v1,v2) are selected. The coordinates after dimensionality reduction are:
[0076]
[0077] Where V' is the new eigenvector matrix composed of (v1, v2), and Λ' is the new eigenvalue matrix composed of (λ1, λ2).
[0078] After dimensionality reduction by multidimensional scaling analysis, the smaller the distance between each feature point in the low-dimensional space, the stronger the correlation.
[0079] This method represents multivariate time series into a graph data space, forming a spatiotemporal graph structure data with a dual-dimensional dependency relationship between time and space. Considering that the spatial coupling characteristics between multi-energy loads and between multi-energy loads and other characteristic variables also change on a time scale, constructing static characteristic graph data will not be able to capture the potential correlation information of spatiotemporal coupling between multivariate time series. Therefore, this method designs a dynamic multivariate time series graph data construction method, such as Figure 2 shown.
[0080] Assume that there is a multi-time series set consisting of user-level multi-energy load time series and its characteristic variables Where N is the total number of time series, T is the length of the time series, and in this method, X i represents the value of the i-th time series over the entire time length T, X t Represents the set of all N time series values at time t, that is, X t =X :,t First, the time series is divided into a time series region set {Z} according to the sliding window ω. The w-th region time series set is shown as follows:
[0081] Z w {X (w-1)ω ,X (w-1)ω+1 ,…,X w-ω} (7)
[0082] Static graph structure data is constructed within each regional time series, and the distance optimization goal of multidimensional scaling analysis is:
[0083]
[0084] This method constructs dynamic graph structure data that can simultaneously capture the spatial correlation and temporal correlation information of multivariate time series. Therefore, it is necessary to model the "edge" between two adjacent graph structures. Considering the w-th and w+1-th graphs, the distance optimization objective of multidimensional scaling analysis is:
[0085]
[0086] B. Graph Representation Learning Based on Graph Convolutional Neural Networks
[0087] This implementation proposes a graph representation learning method based on a graph convolutional neural network. The raw data consists of multivariate time series, which are then converted into a graph through multidimensional scaling analysis. This graph convolutional neural network is then used to model the deep spatiotemporal coupling characteristics of multi-energy load time series, forming a precise modeling framework.
[0088] For an undirected graph G = (V, E), V represents the nodes of the graph, E represents the edges of the graph, and the adjacency matrix A that represents the relationship between the nodes is defined. ijIndicates whether there is an edge between the i-th node and the j-th node. If there is an edge connection, it is 1, otherwise it is 0. Define the degree matrix D that describes the edge density of the graph nodes. The degree matrix is a diagonal matrix with diagonal elements D ii Represents the number of edges connected to the i-th node.
[0089] Define the Laplacian matrix L of the graph G and the symmetric normalized Laplacian matrix L sym for:
[0090] L=DA (10)
[0091]
[0092] Using the symmetric normalized Laplace matrix to represent the information of graph data has the following advantages: 1) Compared with directly using the adjacency matrix A, L sym Taking into account both the information transmitted by adjacent nodes and the node's own information; 2) Using L sym The output of each layer will not become infinitely large because the left multiplication D -1 and right multiply D -1 Normalize the rows and columns separately; 3) Left multiplication and right multiplication Constructed L sym Is a semi-positive symmetric matrix, which must have n linearly independent eigenvectors, that is, it can be eigendecomposed.
[0093] According to the convolution theorem:
[0094]
[0095] The first part is the discrete form, and the second part represents that the convolution of the graph f and the convolution kernel g is equal to the inverse transform of their Fourier transform product.
[0096] Extended to the convolutional neural network of the image, the convolution kernel g is written as a diagonal matrix:
[0097]
[0098] in is the Fourier transform of the convolution kernel g, represents the conjugate of the kth eigenvector.
[0099] Similarly, the Fourier transform of graph f is Written in matrix form, we get:
[0100]
[0101] The product of the two parts is multiplied by U to obtain the inverse transform, which is the form of image convolution:
[0102]
[0103] Where U and λ are the eigenvector matrix and eigenvalue.
[0104] Analogous to graph structure data, using L sym As a carrier for describing graph data node association and other non-Euclidean information, since L sym It is a semi-positive symmetric matrix, so it can be decomposed into U and λ.
[0105] In deep learning, it is necessary to construct convolution kernel parameters that can be trained through error back propagation, so that the convolution diagonal matrix are the trainable convolution kernel parameters:
[0106]
[0107] in The error back propagation training parameters for the initialized operation.
[0108] Therefore, the layer expression of the graph convolutional neural network can be written as:
[0109] Layer:y=σ(Ug θ (U T x) (17)
[0110] Where σ is the nonlinear part, x is the input, and y is the output.
[0111] This method uses the second-order Chebyshev polynomial to replace the convolution kernel, namely:
[0112]
[0113] Among them C k (·) is the k-th order Chebyshev polynomial, is the Chebyshev coefficient vector.
[0114] The graph convolutional neural network expression used in this method is:
[0115]
[0116] Written in matrix form as follows:
[0117] Y=σ(L sym XW) (20)
[0118] Where W is the linear weight matrix.
[0119] The multi-energy load time series anomaly detection scenario is a classification problem. The fully connected layer and the Softmax layer are added after the graph convolutional neural network to form the base detector in the Boost-GL model proposed in this method, such as Figure 5 shown.
[0120] The single basis detector expression in this method can be written as:
[0121] F=Softmax(ReLU(c(L sym XW (0) )W (1) )) (twenty one)
[0122] C.Boosting ensemble learning framework
[0123] The basic idea of ensemble learning is to mix multiple base learners through a certain method to greatly improve the overall effect. Ensemble learning is not a specific machine learning algorithm, but a model mixing strategy. Representative strategies include Bagging, Boosting, and Stacking. This implementation adopts the Boosting ensemble framework as the overall framework of the multi-energy load anomaly detection model. Boosting ensemble learning has the characteristics of serial training. Each level of learner will achieve a certain improvement on the basis of the previous level. Therefore, for the multi-energy load anomaly detection problem with unbalanced data characteristics, the base learners under the Boosting framework will gradually improve the classification accuracy of outliers (minority classes).
[0124] Boosting for integrated learning performance improvement generally falls into two approaches: increasing the weight of error samples, as exemplified by the adaptive ensemble boosting framework (Adaboost), and fitting the negative gradient of the upper-level learner, as exemplified by gradient boosting (GD). This implementation adopts the principles of the Adaboost algorithm, designs a unique loss function, and constructs fully connected layers and softmax layers to replace the final weighted combination layer of the original algorithm.
[0125] Assume that there is a set of base learners In the Adaboost strategy, the final decision result is a weighted combination of all base learners:
[0126]
[0127] in
[0128] The training method is global optimization. That is, when training the mth layer, the loss function needs to consider the weights of all learners in the first m-1 layers. The loss function is as follows:
[0129]
[0130] Where L(·) is the specific sample loss calculation method.
[0131] The Adaboost algorithm has the advantages of high computational efficiency and low overfitting. However, it is more sensitive to outliers. When training on unbalanced data, the early learner has poor ability to identify outliers. If global optimization is used in each step, it is easy to cause gradient explosion problems, and the detection accuracy will also be affected by the poor early learner. This implementation method abandons the training of the weighted weights of the base learners during training, and only improves the learner's attention to samples that are easy to misclassify by designing sample losses, and finally superimposes a fully connected layer to directly train the outputs of all base learners. The comparison diagram of the Adaboost algorithm and the Boosting framework of this method is shown in the figure below. Figure 3 As shown:
[0132] This method improves the loss function of the traditional two-class classification problem, cross entropy, so that it has the ability to dynamically pay attention to error-prone samples. The loss function expression is as follows:
[0133]
[0134] Where p is the probability of predicting the sample category, α i Tuning parameters for sample weights.
[0135] If the sample is an abnormal sample, that is, y = 1, and p>0.5 is classified correctly, a smaller weight is given to the loss function, otherwise a larger weight parameter is given to it.
[0136] Example
[0137] The real-world dataset used in this example comes from NEST, an innovative technology smart campus platform built by the Swiss Federal Laboratories for Materials Science and Technology. This platform publicly discloses multi-energy load data from three user-level smart building units, along with other relevant sensor data, with a temporal resolution of 15 minutes.
[0138] This example uses data from August 2021 to August 2023 to form the example data set. First, the missing values in the original data are removed, and then all time series are normalized:
[0139]
[0140] The data anomalies in the dataset include anomalies caused by sensor damage, maintenance, pollution, etc., as well as anomalies caused by bad data injection attacks. The detailed representation of the user-level unit data used is shown in Table 1:
[0141] Table 1 User-level unit data details
[0142]
[0143] In order to subsequently explore the impact of data imbalance on the performance of different models, this example uses a black box bad data injection method to add more outliers to the dataset to control the degree of data imbalance. The bad data injection model is shown below:
[0144]
[0145] where x FDI The injected bad data follows a Gaussian distribution with a mean of 0 and a variance of 0.1, and finally the bad data with an absolute value greater than 0.1 is selected for injection.
[0146] The confusion matrix is used to describe the detection status of samples, and abnormal samples are defined as positive and normal samples as negative.
[0147] The accuracy of the model is evaluated using three evaluation indicators: precision (P), recall (R), and F1 score. The calculation of precision, recall, and F1 score is shown in the following formula:
[0148]
[0149] This embodiment adopts the idea of graph representation learning modeling to model the complex spatiotemporal coupling correlation between multi-energy load data and its characteristic sequences. Therefore, the reasonable construction of the graph structure is the basis for the model to have a high-precision modeling level. This embodiment compares the final anomaly detection effect of the model under different graph structure construction methods. As shown in Table 2, the selected graph structure construction methods are: K-means clustering, DBSCAN clustering and fuzzy C-means clustering. The specific construction steps are as follows: first, each time series is clustered to obtain a cluster with a graph relationship, and then the edge relationship is constructed by calculating the Pearson correlation coefficient.
[0150] Table 2 Comparison of anomaly detection effects of models under different graph structure construction methods
[0151]
[0152] As can be seen from the table, the construction of the graph structure will affect the final anomaly detection effect of the model, among which the final detection effect of the K clustering method is related to the number of K clusters. When the number of clusters is 7 or 8, the detection effect of the model reaches the best. The feature sequence in the "UMAR" data set used in this embodiment has 7-8 categories, including room temperature, temperature control valve, rooftop photovoltaic, etc. DBSCAN clustering does not require manual specification of the number of clusters, and its final detection effect is slightly lower than when the number of K clusters is 8. Fuzzy C clustering reaches the best when the number of clusters is 8, and its detection effect is slightly better than K clustering. The multidimensional scaling analysis dynamic graph data construction method used in this embodiment has the highest anomaly detection accuracy. The reason is that multidimensional scaling analysis can quantify the correlation between features, and the constructed graph structure is more accurate. At the same time, the generation of the dynamic graph structure ensures that the subsequent graph convolutional neural network module can capture the changes in the feature sequence in the time dimension in real time.
[0153] Tables 3 and 4 show the anomaly detection results for three user-level load units' cooling, heating, and electricity load data. The baseline comparison models used include traditional statistical models like the Raida criterion and box plot criterion, the isolation forest model (IF), the random forest model (RF), the long short-term memory neural network variational autoencoder framework (LSTM-VAE), graph attention networks (GAT), and the graph deviation network (GDN). The Boost-GL model proposed in this example achieves the highest F1 score, balancing both precision and recall for anomaly detection, with average precision, recall, and F1 scores reaching 98.3%, 95.3%, and 96.8%, respectively.
[0154] Traditional statistical methods, such as the Laida criterion and the box plot criterion, have high anomaly detection accuracy rates, reaching 99.1% and 91.7%, respectively. However, their recall rates for abnormal data are far lower than those of other models, at only 29.5% and 39.8%. This is because these models rely solely on assumed distributions and thresholds to identify outliers, making it difficult to detect anomalies in data at the user level of distribution networks, which has complex, high-dimensional characteristics and multiple sources of uncertainty.
[0155] The unsupervised anomaly detection model, Isolation Forest, has similar detection precision and recall rates across all datasets, indicating that data imbalance has little impact on the performance of unsupervised methods. However, traditional unsupervised models are relatively simple and struggle to learn the complex coupling relationships between multiple features. Consequently, their detection precision, recall, and F1-score are generally low.
[0156] Table 3. Results of abnormal detection of cooling and heating loads
[0157]
[0158] Table 4. Results of abnormality detection of electric load
[0159]
[0160] All graph neural network models have a high anomaly detection accuracy rate of more than 97.0%. Compared with other types of models, the recall rate of outliers has also been improved to a certain extent. This shows that by capturing the spatiotemporal coupling relationship between multi-energy load time series and other feature sequences, the model performance can be effectively improved, and more anomalies with multi-feature associations can be detected. Due to the high imbalance of the abnormal data set, the abnormal recall rate of most models is lower than the abnormal precision rate. The model of this embodiment has the highest anomaly detection recall rate of 95.3% due to the use of the Boosting integration framework and repeated training of samples that are easy to detect errors. In addition, the Boost-GL model proposed in this embodiment has never received the highest precision score, indicating that the seesaw phenomenon between precision and recall is still an unavoidable problem in anomaly detection scenarios. Despite this, the model of this embodiment still has the highest F1 comprehensive score on the entire data set.
[0161] To explore the performance of different models on data with varying degrees of imbalance and verify the robustness of the Boost-GL model proposed in this example, we used the aforementioned method to gradually increase the proportion of outliers in the dataset. A higher outlier proportion indicates a more balanced data set. Table 5 shows the outlier detection results for different models on data with varying outlier proportions.
[0162] Table 5 Detection results of different abnormal proportions
[0163]
[0164] This example uses a dataset with six different anomaly ratios, with the highest anomaly ratio being 30%. The comparison models used are Isolation Forest, Random Forest, and Graph Attention Network. The Boost-GMD model proposed in this example achieves the highest F1-score in all four scenarios, while the GAT model achieves the highest F1-score in two scenarios with relatively balanced data. On average, the Boost-GMD model achieves the highest anomaly recall and F1-score, while the GAT model achieves the highest anomaly precision. Figure 6The following table shows the changes in the F1 scores of anomaly detection of the four models under different anomaly proportions. It can be seen that the Boost-GMD anomaly detection model proposed in this embodiment has a certain robustness to unbalanced data and has the highest F1 score when the data is relatively unbalanced (the anomaly proportion is less than 15%). When the anomaly proportion gradually increases and the data tends to be balanced, the anomaly detection effect of the RF and GAT models is greatly improved. Among them, the F1 score of the graph attention network is close to that of Boost-GMD, and is slightly higher than the Boost-GMD model on both sets of data.
[0165] In summary, the present invention utilizes the dimensionality reduction and clustering capabilities of multidimensional scaling analysis to map multiple time series into a low-dimensional feature space, and constructs the edge weights of graph structured data by calculating the Euclidean distance between features. Therefore, the present invention can effectively model the spatiotemporal correlation between multiple energy load time series.
[0166] It should be emphasized that the above are only preferred embodiments of the present invention and do not limit the present invention in any form. Any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for detecting outliers in user-level multi-energy load data based on graph representation learning, characterized in that: The following steps are involved: Step 1: Utilize the dimensionality reduction and clustering capabilities of multidimensional scaling analysis to map the multi-time series distribution network data into a low-dimensional feature space. By calculating the Euclidean distance between features to construct the edge weights of the graph structure data, the spatiotemporal correlation between the multi-energy load time series is modeled. Step 2: Build a graph convolutional neural network to model the spatiotemporal correlation between multi-dimensional features; Step 3: Build an overall training framework based on the Boosting ensemble model. Based on the semi-supervised training mode, train the base detector on some clean data, output the detection results on the validation set with outliers, and adjust the training weight of the next level detector according to the samples with detection errors.
2. The method for detecting abnormal values of user-level multi-energy load data based on graph representation learning according to claim 1 is characterized in that: In step 1, mapping the multi-time series distribution network data to a low-dimensional feature space includes the following steps: Step 1-1-1: Use Euclidean distance as the metric distance of multidimensional scaling analysis and construct the distance matrix as follows: In formula (2), D represents the distance matrix, d ij Represents the distance between any two sample sequences, where d ij =||X i -X j ||,i,j∈1,2,...,n,||·|| represents the distance function, X i 、X j represents any two samples; Step 1-1-2: Calculate the eigenvalues and eigenvectors of the inner product matrix: In formula (5), V represents the eigenvector of the inner product matrix B, and Λ represents the eigenvalue matrix; Step 1-1-3: Map the high-dimensional features to a 2-dimensional plane, select the two largest eigenvalues (λ1, λ2) and their eigenvectors (v1, v2); the coordinates after dimensionality reduction are: In formula (6), V' represents the new eigenvector matrix composed of (v1, v2), and Λ' represents the new eigenvalue matrix composed of (λ1, λ2).
3. The method for detecting abnormal values of user-level multi-energy load data based on graph representation learning according to claim 1 is characterized in that: The step 1, modeling the spatiotemporal correlation between multiple energy load time series, includes the following steps: Step 1-2-1: Divide the time series into a time series region set {Z} according to the sliding window ω. The w-th region time series set is: Z w ={X (w-1)ω ,X (w-1)ω+1 ,...,X w-ω } (7) In formula (7), Z w represents the w-th region time series set, ω represents the sliding window, X t Represents the set of all N time series values at time t; Step 1-2-2: Construct static graph structure data within each regional time series. The distance optimization goal of multidimensional scaling analysis is: In formula (8), X i represents the value of the i-th time series over the entire time length T, d ij Represents the distance between any two sample sequences; Step 1-2-3: The distance optimization goal of multidimensional scaling analysis is: In formula (9), They represent the value of the i-th time series in the w-th graph over the entire time length T, and the value of the j-th time series in the w+1-th graph over the entire time length T, respectively.
4. The method for detecting abnormal values of user-level multi-energy load data based on graph representation learning according to claim 1 is characterized in that: The step 2 specifically includes: forming the original data from multivariate time series, forming a graph through multi-dimensional scaling analysis, and then modeling by a graph convolutional neural network to form a precise modeling framework for the deep spatiotemporal coupling characteristics of multi-energy load time series.
5. The method for detecting abnormal values of user-level multi-energy load data based on graph representation learning according to claim 4 is characterized in that: In step 2, the graph convolutional neural network is: The matrix form is: Y=σ(L sym XW) (20) In formula (19) and formula (20), σ represents the nonlinear part, U and λ represent the eigenvector matrix and eigenvalue respectively. represents the Chebyshev coefficient vector, C k (·) represents the k-order Chebyshev polynomial, x represents the input, and y represents the output; L sym represents the symmetric normalized Laplacian matrix, X represents the sample matrix, and W represents the linear weight matrix.
6. The method for detecting abnormal values of user-level multi-energy load data based on graph representation learning according to claim 4 is characterized in that: In step 2, the single basis detector expression is: F=Softmax(ReLU(σ(L sym XW (0) )W (1) )) (21) In formula (21), σ represents the nonlinear part, U represents the eigenvector matrix, and L sym represents the symmetric normalized Laplacian matrix, X represents the sample matrix, and W represents the linear weight matrix.
7. The method for detecting abnormal values of user-level multi-energy load data based on graph representation learning according to claim 1, characterized in that: In step 3, the training of the weighted weights of the base learners is abandoned during training, and only the sample loss is designed to improve the learner's attention to samples that are easy to be misclassified, and finally a fully connected layer is superimposed to directly train the outputs of all base learners.
8. The method for detecting abnormal values of user-level multi-energy load data based on graph representation learning according to claim 7, characterized in that: In step 3, the loss function is: In formula (24), p represents the probability of predicting the sample category, α i represents the sample weight adjustment parameter; If the sample is an abnormal sample, that is, y = 1, and p>0.5 is classified correctly, a smaller weight is given to the loss function, otherwise a larger weight parameter is given to it.