A smart meter fault classification method based on multi-granularity neighbor graph

By constructing a multi-grained nearest neighbor graph and graph attention neural network, the problem of accurate judgment of smart meter fault types is solved, and higher classification accuracy and recall rate are achieved, improving operation and maintenance efficiency and accuracy.

CN116543198BActive Publication Date: 2025-08-26BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310363977.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-06
Publication Date
2025-08-26
Estimated Expiration
2043-04-06

AI Technical Summary

Technical Problem

The existing technology is difficult to accurately judge the type of smart meter failure, resulting in untimely operation and maintenance processing and unreasonable solutions. The existing methods are prone to introduce noise or overfitting when dealing with unbalanced classification, reducing classification accuracy.

Method used

The smart meter fault classification method based on multi-grained nearest neighbor graph is adopted. By constructing a multi-grained nearest neighbor graph, combining the autoencoder and graph attention neural network, the nearest neighbor sample information expansion and graph attention mechanism are used to achieve accurate classification of smart meter faults.

Benefits of technology

It improves the accuracy and recall of smart meter fault classification, enhances the stability and accuracy of the model, and solves the problem of difficult to distinguish overlapping samples in unbalanced classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116543198B_ABST
    Figure CN116543198B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention proposes a smart meter fault classification method based on a multi-granularity neighbor graph, comprising: taking fault history data of smart meters under different categories as input data sets, and dividing them into multiple two-category data sets; for each two-category data set, taking each sample as a target sample, and forming a multi-granularity neighbor graph with the target sample and different numbers of neighbor samples as training samples in subsequent classification tasks; based on the constructed neighbor graph data set, designing an autoencoder to extract node features of the neighbor graph, and training a graph attention neural network for the neighbor graph classification task based on the node encoding features of the neighbor graph and the adjacency relationship of the original nodes of the neighbor graph; for a given test sample, combining its test sample with a neighbor sample group consisting of different numbers of corresponding neighbor samples, and integrating the neighbor graph classification results to obtain the discrimination result of the classifier under each two-category data set, and obtaining its fault category through soft voting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field

[0001] The present invention relates to a smart meter fault classification method, and in particular to a smart meter fault classification method based on a multi-granularity neighbor graph. [Background Technology]

[0002] With the rapid development of science and technology and the ever-increasing demand for electricity, building a digital, intelligent, and internet-based smart grid is a crucial path for the power industry's digital transformation. As a key terminal in the smart grid, smart meters not only provide basic functions such as data measurement and display, but also offer extended capabilities such as remote meter reading, two-way communication, and data management. They play a vital role in ensuring the normal use of electricity by users and the stable operation of the power system. With the development of smart grids, smart meters have become widely deployed and popularized. Rapid and accurate identification of smart meter fault types helps reduce grid operating costs and improve grid quality. Smart meter faults are characterized by their diversity and complexity, making it difficult for operators and maintenance personnel to determine the fault type based on their own experience. This can lead to delayed and inappropriate fault resolution. Therefore, accurately predicting smart meter fault types is crucial and provides valuable guidance for operators and maintenance personnel in developing appropriate maintenance plans.

[0003] As my country's power grid transformation continues to deepen, demand for smart meters continues to rise. Different smart meter manufacturers differ in design, component selection, and process flow. Furthermore, due to the influence of external operating environments such as temperature and humidity, smart meter failure types are diverse and complex. Smart meter failure types are influenced by these multiple factors, making it difficult to accurately determine the fault type based on manual experience. Therefore, using machine learning methods to establish a mapping relationship between multidimensional smart meter attributes and their fault types to predict fault categories is a common approach. Smart meter failure types are diverse, and historical smart meter data reveals that different smart meter fault types occur with varying frequencies. Furthermore, the feature space distributions of samples from different fault categories may overlap, further complicating smart meter fault prediction. Current approaches to addressing imbalanced classification mainly fall into two categories: data-level and algorithm-level. Data-level approaches generate minority class samples through specific sample generation methods or by learning the distribution of minority class samples. On the one hand, generating minority class samples is difficult to ensure their authenticity and may introduce noise. On the other hand, generating samples in overlapping regions exacerbates the overlap and increases classification difficulty. Algorithm-level methods improve the loss function or the model structure to make the classification model pay more attention to minority class samples, but the model is prone to overfitting to minority class samples. Regardless of the above-mentioned algorithm-level or data-level methods, the classification model divides sample types by constructing a mapping relationship between single sample information and its corresponding category label, which makes it difficult to accurately distinguish overlapping samples with similar representation information, thereby reducing the overall classification accuracy. Based on the above analysis, the present invention proposes a smart meter fault classification method based on a multi-granularity neighbor graph to improve the performance of smart meter fault classification. In response to the above problems, this chapter proposes an unbalanced classification method based on a multi-granularity neighbor graph. [Summary of the invention]

[0004] In view of this, the present invention proposes a smart meter fault classification method based on a multi-granularity neighbor graph to improve the performance of smart meter fault classification.

[0005] The present invention proposes a smart meter fault classification method based on a multi-granularity neighbor graph, comprising the following steps:

[0006] (1) Taking the fault history data of different categories of smart meters as the input data set, multiple second-class data sets are obtained, specifically:

[0007] The actual fault dataset of smart meters is input. The samples in this dataset contain nine characteristic variables: working hours, arrival batch number, power supply unit number, electricity meter category, fault identification month, installation month, province, equipment specifications, and communication method. Its fault category labels include 11 categories: appearance fault, metering fault, storage unit fault, processing unit fault, display unit fault, control unit fault, power supply unit fault, communication unit fault, clock unit fault, other faults, and software fault. Each category of samples in the fault dataset is traversed, and all samples under this category are regarded as minority class sample sets, and all samples of the other categories are regarded as majority class sample sets. The original dataset is converted into 11 two-category datasets. For each of these two-category datasets, the dataset can be described as follows:

[0008] D=[D min ,D maj ]

[0009] Among them, D is a two-category dataset, and x is defined as i is any sample in the D dataset, that is, x i ∈D;D min is a minority class sample set, the number of samples is N min ;D maj is the majority class sample set, the number of samples is N maj ;

[0010] (2) For each two-class dataset, each sample is used as a target sample, and a multi-granularity neighbor graph is constructed with the target sample and different numbers of neighbor samples as training samples in the subsequent classification task. Specifically:

[0011] Based on the unbalanced binary classification dataset D obtained in step (1), a neighbor graph dataset is constructed:

[0012] For any sample x in the training set i , when it is used as a target sample, its multi-granularity neighbor graph can be constructed. Specifically, for each target sample, m neighbor graphs are constructed, and the number of neighbor samples participating in the construction of the neighbor graph is K = {k1, k2, ..., k m}; When the number of neighbor samples is k j When , use the KNN algorithm to find the target sample x i k in D j neighbor samples, j∈[1,m], and get x i The neighbor sample group of Any is a sample in the original data set D; the target sample x i and its neighbor sample group NN i,j Construct the neighbor graph g i,j =(V,E); neighbor graph g i,jThe label is the target sample x i The category label y i ;

[0013] in, Represents the neighbor graph g i,j Node, Node v t Corresponding neighbor sample group NN i,j Medium sample node Corresponding target sample x i ; Represents the neighbor graph g i,j The edge of each edge e t ∈E represents the target sample x i Its neighboring samples Connected; NN i,j Represents sample x i The jth group of neighboring samples;

[0014] Therefore, traverse the samples in the entire D and store the constructed neighbor graph sample pairs and their labels in the sets G and Y respectively. G In the example above, we can get the neighbor graph dataset P=(G,Y G ), and use the neighbor graph in G as the neighbor graph sample in the subsequent classification task;

[0015] Among them, G is the constructed neighbor graph set, Y G is the correct label for G;

[0016] (3) Based on the constructed neighborhood graph dataset, an autoencoder is designed to extract the node features of the neighborhood graph. According to the node encoding features of the neighborhood graph and the adjacency relationship of the original nodes in the neighborhood graph, a graph attention neural network is trained for the neighborhood graph classification task. Specifically:

[0017] Based on the neighbor graph dataset obtained in step (2), an encoder and a decoder are constructed to extract the neighbor graph node features. The encoder encodes the neighbor graph node feature X to obtain the neighbor graph node encoding feature Z, and the decoder decodes the node encoding feature Z to obtain the neighbor graph reconstructed node feature X′. The optimization goal is:

[0018]

[0019] Among them, L rec is the loss of the encoding and decoding process, g∈G, g is the training sample in the neighbor graph dataset, X g is the node feature matrix of g, X g ′ is the reconstructed node feature matrix of g;

[0020] Based on the neighbor graph dataset obtained in step (2), a graph attention classifier clf is constructed and trained, and its optimization goal is:

[0021]

[0022] Among them, L clf is the loss of the classifier part, α represents the weight of different categories of samples in the loss function, Z is the node encoding feature matrix of the neighbor graph, E is the adjacency matrix of the neighbor graph, and (g,y g )∈(G,Y G ) is the training sample in the neighbor graph dataset, g is the constructed neighbor sample pair, y g is the correct label for g, is the model’s predicted label for g;

[0023] The overall optimization goal of the model includes the encoder-decoder loss and the classifier loss, and its overall optimization goal is:

[0024] L=L rec +L clf

[0025] (4) For a given test sample, the neighbor sample group consisting of the test sample and its corresponding neighbor samples of different numbers is combined. After integrating the neighbor graph classification results, the discrimination result of the classifier under each two-class data set is obtained, and its fault category is obtained by soft voting, specifically:

[0026] Based on the encoder encoder and graph attention classifier clf trained in step (3), for a test sample x test , the calculation process of its predicted label is as follows:

[0027]

[0028] Among them, p test,i =(V test,i ,E test,i ) is x test A sample of a nearest neighbor graph, V test,i is the set of neighbor graph nodes, X test,i is the node feature matrix of the neighbor graph, E test,i is the neighbor graph adjacency matrix, is x test Prediction results under this second category of data sets;

[0029] Repeat the above process to obtain 11 graph attention classifiers clf j , j is the subscript of the graph attention classifier, j∈[1,11]; for the test sample x test , its predicted label The calculation is as follows:

[0030]

[0031]

[0032] When the value is j, it means x test The predicted fault category is the jth fault.

[0033] In the above method, in step (2), for any k j ∈K, k j The value is [a,b], a=min(5,N min ), b=min(10,2*N min ), k j The values ​​are integers and are different. The value of m is the number of integers in [a, b].

[0034] In the above method, in step (3), the loss weight α is set to α = 0.5*IR λ *(1-N min η );

[0035] Where IR = N maj / N min is the imbalance rate of the current two-category dataset, N min is the number of samples in the minority class sample set under the current two-class data set, N maj is the number of samples in the majority class sample set under the current two-class dataset, λ and η represent the influence of the imbalance rate and the number of minority class samples in the original dataset on the loss weight, respectively. The values ​​of λ and η are -0.3 and -0.5, respectively.

[0036] In the above method, in step (3), the structures of the encoder encoder, decoder decoder and graph attention classifier clf are as follows:

[0037]

[0038] Among them, Linear() is the fully connected layer construction function; BatchNorm1d() is the one-dimensional batch normalization function; GATConv() is the graph attention convolution layer construction function; global_mean_pool() is the global node representation pooling function; LeakyReLU() is the activation function; dim_z is the latent space data dimension, and dim_x is the original data dimension.

[0039] The smart meter fault classification method based on the multi-granularity neighbor graph improves the accuracy and recall rate of smart meter fault classification.

[0040] It can be seen from the above technical solutions that the present invention has the following beneficial effects:

[0041] In the technical solution implemented in the present invention, a combination of data level and algorithm level is adopted to achieve the expansion of target sample information and the increase in the number of training samples. At the same time, the construction of the nearest neighbor graph increases the differences between similar samples of different categories, and the graph attention mechanism is combined to realize the effective mining of similar sample information. The integration of multiple nearest neighbor graph results is conducive to improving the accuracy and stability of the results, thereby improving the accuracy and recall rate of smart meter fault classification.

Brief Description of the Drawings

[0042] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0043] Figure 1 This is a schematic diagram of the framework flow of the smart meter fault classification method based on multi-granularity neighbor graph proposed in the present invention;

[0044] Figure 2 It is a flowchart for solving smart meter fault classification;

[0045] Figure 3 It is a detailed schematic diagram of the multi-granularity neighbor graph construction method in the algorithm of the present invention;

[0046] Figure 4 This is a structural diagram of the unbalanced classification model based on the multi-granularity neighbor graph in the algorithm of the present invention. [Specific implementation method]

[0047] In order to better understand the technical solution of the present invention, the present invention is described in detail below with reference to the accompanying drawings.

[0048] It should be understood that the embodiments of the invention described herein are only a portion of the embodiments of the invention, not all of the embodiments. Based on the embodiments of the invention, all other embodiments obtained by persons of ordinary skill in the art without creative effort are within the scope of protection of the invention.

[0049] An embodiment of the present invention proposes a smart meter fault classification method based on a multi-granularity neighbor graph, including: taking fault history data of smart meters under different categories as input data sets, dividing them into multiple two-category data sets; for each two-category data set, taking each sample as a target sample, obtaining a neighbor sample group consisting of different numbers of samples, and forming a neighbor graph with the target sample and each neighbor sample group as a training sample in a subsequent classification task; based on the constructed neighbor graph data set, designing an autoencoder to extract node features of the neighbor graph, and training a graph attention neural network for the neighbor graph classification task based on the node encoding features of the neighbor graph and the adjacency relationship of the original nodes of the neighbor graph; for a given test sample, combining its test sample with its corresponding neighbor sample group consisting of different numbers of neighbor samples, and obtaining the discrimination result of the classifier under each two-category data set after integrating the results, and obtaining its fault category through soft voting.

[0050] Figure 1 The figure is a schematic diagram of the framework flow of the smart meter fault classification method based on the multi-granularity neighbor graph proposed in the present invention. The method includes the following steps:

[0051] Step 101: Take the fault history data of different categories of smart meters as input data sets and divide them into multiple second-category data sets, specifically:

[0052] The actual fault dataset of smart meters is input. The samples in this dataset contain nine characteristic variables: working hours, arrival batch number, power supply unit number, electricity meter category, fault identification month, installation month, province, equipment specifications, and communication method. Its fault category labels include 11 categories: appearance fault, metering fault, storage unit fault, processing unit fault, display unit fault, control unit fault, power supply unit fault, communication unit fault, clock unit fault, other faults, and software fault. Each category of samples in the fault dataset is traversed, and all samples under this category are regarded as minority class sample sets, and all samples of the other categories are regarded as majority class sample sets. The original dataset is converted into 11 two-category datasets. For each of these two-category datasets, the dataset can be described as follows:

[0053] D=[D min ,D maj ]

[0054] Among them, D is a two-category dataset, and x is defined as i is any sample in the D dataset, that is, x i ∈D;D min is a minority class sample set, the number of samples is N min ;D maj is the majority class sample set, the number of samples is N maj .

[0055] Step 102: For each two-class dataset, each sample is used as a target sample, and a multi-granularity neighbor graph is constructed with the target sample and different numbers of neighbor samples, which serves as training samples in the subsequent classification task. Specifically,

[0056] Based on the unbalanced binary classification dataset D obtained in step 101, a neighbor graph dataset is constructed:

[0057] For any sample x in the training set i , when it is used as a target sample, its multi-granularity neighbor graph can be constructed. Specifically, for each target sample, m neighbor graphs are constructed, and the number of neighbor samples participating in the construction of the neighbor graph is K = {k1, k2, ..., k m}; When the number of neighbor samples is k j When , use the KNN algorithm to find the target sample x i k in D j neighbor samples, j∈[1,m], and get x i The neighbor sample group of Any is a sample in the original data set D; the target sample x i and its neighbor sample group NN i,j Construct the neighbor graph g i,j =(V,E); neighbor graph gi ,j The label is the target sample x i The category label y i ;

[0058] in, Represents the neighbor graph g i,j Node, Node v t Corresponding neighbor sample group NN i,j Medium sample node Corresponding target sample x i ; Represents the neighbor graph g i,j The edge of each edge e t ∈E represents the target sample x i Its neighboring samples Connected; NN i,j Represents sample x i The jth group of neighboring samples;

[0059] Therefore, traverse the samples in the entire D and store the constructed neighbor graph sample pairs and their labels in the sets G and Y respectively. G In the example above, we can get the neighbor graph dataset P=(G,Y G ), and use the neighbor graph in G as the neighbor graph sample in the subsequent classification task;

[0060] Among them, G is the constructed neighbor graph set, Y G is the correct label for G.

[0061] Step 103: Based on the constructed neighborhood graph dataset, an autoencoder is designed to extract the node features of the neighborhood graph. The graph attention neural network is trained for the neighborhood graph classification task based on the node encoding features of the neighborhood graph and the adjacency relationship of the original nodes of the neighborhood graph. Specifically,

[0062] Based on the neighborhood graph dataset obtained in step 102, an encoder and a decoder are constructed to extract neighborhood graph node features. The encoder encodes the neighborhood graph node feature X to obtain the neighborhood graph node encoded feature Z, and the decoder decodes the node encoded feature Z to obtain the reconstructed node feature X′. The optimization goal is:

[0063]

[0064] Among them, L rec is the loss of the encoding and decoding process, g∈G, g is the training sample in the neighbor graph dataset, X g is the node feature matrix of g, X g ′ is the reconstructed node feature matrix of g;

[0065] Based on the neighbor graph dataset obtained in step 102, a graph attention classifier clf is constructed and trained, and its optimization goal is:

[0066]

[0067] Among them, L clf is the loss of the classifier part, α represents the weight of different categories of samples in the loss function, Z is the node encoding feature matrix, E is the neighbor graph adjacency matrix, and (g,y g )∈(G,Y G ) is the training sample in the neighbor graph dataset, g is the constructed neighbor sample pair, y g is the correct label for g, is the model’s predicted label for g;

[0068] The overall optimization goal of the model includes the encoder-decoder loss and the classifier loss, and its overall optimization goal is:

[0069] L=L rec +L clf

[0070] Step 104: For a given test sample, combine the test sample with its corresponding neighbor sample groups consisting of different numbers of neighbor samples. After integrating the neighbor graph classification results, obtain the discrimination result of the classifier in each two-class data set. Soft voting is used to obtain the fault category, which is specifically:

[0071] Based on the encoder encoder and graph attention classifier clf trained in step 103, for a test sample x test , the calculation process of its predicted label is as follows:

[0072]

[0073] Among them, p test,i =(V test,i ,E test,i ) is x test A sample of a nearest neighbor graph, V test,i is the set of neighbor graph nodes, X test,i is the node feature matrix of the neighbor graph, E test,i is the neighbor graph adjacency matrix, is x test Prediction results under this second category of data sets;

[0074] Repeat the above process to obtain 11 graph attention classifiers clf j , j is the subscript of the graph attention classifier, j∈[1,11]; for the test sample x test , its predicted label The calculation is as follows:

[0075]

[0076]

[0077] When the value is j, it means x test The predicted fault category is the jth fault.

[0078] Figure 2 This is a flow chart of the present invention for solving the problem of smart meter fault classification. First, the fault history data sets under different categories of smart meters are divided into multiple second-category data sets. The smart meter fault classification method based on multi-granularity neighbor graph (Smart Meter Fault Classification Method Based on MultigrainNeighbor Graph, MNGIC) of the proposed invention is applied to obtain multiple second-category neighbor graph data sets, and node encoders and graph attention classifiers are trained respectively. For the samples to be tested, the node encoders and graph attention classifiers obtained under each second-category data set are used for discrimination, and the final predicted category of the sample to be tested is obtained by the soft voting method.

[0079] Figure 3It is a schematic diagram of the multi-granularity neighbor graph construction method in the algorithm of the present invention, which converts the original single sample classification into a neighbor graph sample classification. The existing unbalanced classification method divides the sample type by constructing a mapping relationship between the single sample information and its corresponding category label, and converts it into using neighbor information to assist in judging the category of the target sample, which makes it difficult to accurately distinguish the overlapping area samples with similar characterization information, thereby reducing the overall classification accuracy. The present invention constructs a multi-granularity neighbor graph of the target sample, and uses the neighbor samples of the target sample to expand the target sample information, increase the difference between similar samples of different categories, and make it easier for the subsequent classification model to learn the difference between similar samples. At the same time, multiple neighbor graph samples are constructed for the same target sample to achieve an increase in the number of training samples, which is beneficial to the stable training of the model, and is also beneficial to obtaining more accurate and robust smart meter fault prediction results by integrating multiple neighbor graph classification results.

[0080] Algorithm 1 is the pseudo code of the multi-granularity neighbor graph construction algorithm:

[0081]

[0082] Figure 4 This diagram shows the structure of the imbalanced classification model based on a multi-granularity neighbor graph in the algorithm of this paper. It includes a node encoder and decoder for extracting node features and a graph attention neural network for graph classification. An autoencoder is designed to extract node features from the neighbor graph. The graph attention neural network is trained based on the node encoding features of the neighbor graph and the adjacency relationships between the original nodes in the neighbor graph. The graph attention mechanism is used to adaptively aggregate the information of neighbor samples to the target sample, fully exploring the differences between different types of samples.

[0083] Algorithm 2 is the pseudo code for training and testing the MNGIC algorithm:

[0084]

[0085] In this specific example, a fault history dataset of different smart meter categories was used for testing. This dataset collected data from smart meters covering 11 fault types across 25 provinces. Due to factors such as manual labeling errors, fault type labels were sometimes mislabeled or omitted, and the data samples contained outliers and missing values. After processing using various techniques, including missing value completion, feature selection, outlier detection, and data normalization, a total of 15,876 smart meter fault data records were obtained. Table 1 lists the number of samples for each fault type. To reduce the randomness of the results, 80% of the samples were randomly selected from the smart meter fault dataset using a fixed random number seed as the training set, and the remaining samples were used as the test set.

[0086] Table 1 Datasets used in specific examples

[0087]

[0088] To verify the effectiveness of the proposed algorithm, eight data-level methods and six mainstream deep learning sample generation methods were compared in this embodiment, as shown in Table 2. Considering the large number and complex distribution of smart meter fault data samples, RF was used as a classifier to compare the performance of the data-level methods. The embodiment of this invention is represented in the table as MNGIC.

[0089] Table 2 Algorithms compared in specific embodiments

[0090]

[0091] This embodiment of the present invention uses the macro-F1 and G-mean metrics to evaluate the classification performance of the algorithm. The macro-F1 comprehensive evaluation model uses the F1-measure results for each category, specifically by calculating the arithmetic mean of the F1-measure for each category. The G-mean comprehensive evaluation model uses the recall rate results for each category, specifically by calculating the geometric mean of the recall rates for each category. Both Macro-F1 and G-mean values ​​range from 0 to 1, with larger values ​​indicating better classification performance.

[0092] Table 3 shows a comparison of the experimental results of the present invention and mainstream data-level methods for various smart meter fault categories using the F1-measure and macro-F1 metrics. Table 4 shows a comparison of the experimental results for recall and G-mean metrics for each category. It can be seen that the smart meter fault classification method based on the multi-granularity neighbor graph of the present invention achieves higher F1-measure and recall rates than other methods for most categories, and achieves the highest macro-F1 and G-mean. The results in Tables 3 and 4 demonstrate that the method of the present invention can achieve higher classification accuracy and recall.

[0093] Table 3 Experimental results of MNGIC and data-level methods on F1-measure and macro-F1 indicators under various fault categories of smart meters

[0094]

[0095] Table 4 Experimental results of MNGIC and data-level methods on recall rate and G-mean index for various fault categories of smart meters

[0096]

[0097] Table 5 shows a comparison of the experimental results of the present invention's embodiment and mainstream algorithm-level methods on the F1-measure and macro-F1 metrics for various smart meter fault categories. Table 6 shows a comparison of the experimental results on the recall rate and G-mean metrics for each category. It can be seen that the present invention's smart meter fault classification method based on a multi-granularity neighbor graph achieves higher F1-measure and recall rates than other methods for most categories, and achieves the highest macro-F1 and G-mean. The results in Tables 5 and 6 demonstrate that the method according to the present invention can achieve higher classification accuracy and recall rates.

[0098] Table 5 Experimental results of MNGIC and algorithm-level methods on F1-measure and macro-F1 indicators under various fault categories of smart meters

[0099]

[0100] Table 6 Experimental results of MNGIC and algorithm-level methods on recall rate and G-mean index for various fault categories of smart meters

[0101]

[0102] A large number of comparative experimental results with mainstream data-level and algorithm-level methods show that the present invention, through the proposed multi-granularity neighbor graph construction method, uses the neighbor samples of the target sample to expand the target sample information when solving the multi-classification problem of smart meters with overlapping distributions of samples of different categories, thereby increasing the differences between similar samples of different categories, which is more conducive to the classification model to mine the differences of similar samples. By integrating the classification results of multiple neighbor graphs, more accurate and robust smart meter fault prediction results are obtained, effectively improving the accuracy and recall rate of faulty meter classification.

[0103] In summary, the embodiments of the present invention have the following beneficial effects:

[0104] In the technical solution implemented by the present invention, the fault history data of smart meters under different categories are used as input data sets and divided into multiple two-category data sets; for each two-category data set, each sample is used as a target sample, and a neighbor sample group consisting of different numbers of samples is obtained. The target sample and each neighbor sample group constitute a neighbor graph as a training sample in the subsequent classification task; based on the constructed neighbor graph data set, an autoencoder is designed to realize the extraction of node features of the neighbor graph, and a graph attention neural network is trained for the neighbor graph classification task according to the node encoding features of the neighbor graph and the adjacency relationship of the original nodes of the neighbor graph; for a given test sample, its test sample and its corresponding neighbor sample group consisting of different numbers of neighbor samples are combined, and the discrimination result of the classifier under each two-category data set is obtained after the results are integrated, and its fault category is obtained by soft voting.

[0105] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A smart meter fault classification method based on multi-granularity neighbor graph, characterized by: The steps include: (1) Taking the fault history data of different categories of smart meters as the input data set, multiple second-class data sets are obtained, specifically: The actual fault data set of smart meters is input. The samples in this data set contain 9 characteristic variables: working hours, arrival batch number, power supply unit number, meter type, fault identification month, installation month, province, equipment specifications, and communication method. Its fault category labels include 11 categories: appearance fault, metering fault, storage unit fault, processing unit fault, display unit fault, control unit fault, power supply unit fault, communication unit fault, clock unit fault, other faults, and software fault. Traverse each category of samples in the fault dataset and regard all samples under this category as the minority class sample set, and all samples of the remaining categories as the majority class sample set. The original dataset is converted into 11 second-category datasets. For each of the second-category datasets, the dataset can be described as follows: D=[D min ,D maj ] Among them, D is a two-category dataset, and x is defined as i is any sample in the D dataset, that is, x i ∈D;D min is a minority class sample set, the number of samples is N min ;D maj is the majority class sample set, the number of samples is N maj ; (2) For each two-class dataset, each sample is used as a target sample, and a multi-granularity neighbor graph is constructed with the target sample and different numbers of neighbor samples as training samples in the subsequent classification task. Specifically: Based on the unbalanced binary classification dataset D obtained in step (1), a neighbor graph dataset is constructed: For any sample x in the training set i , when it is used as a target sample, its multi-granularity neighbor graph can be constructed. Specifically, for each target sample, m neighbor graphs are constructed, and the number of neighbor samples participating in the construction of the neighbor graph is K = {k1, k2, ..., k m }; When the number of neighbor samples is k j When , use the KNN algorithm to find the target sample x i k in D j neighbor samples, j∈[1,m], and get x i The neighbor sample group of Any is a sample in the original data set D; the target sample x i and its neighbor sample group NN i,j Construct the neighbor graph g i,j =(V,E); neighbor graph g i,j The label is the target sample x i The category label y i ; in, Represents the neighbor graph g i,j Node, Node v t Corresponding neighbor sample group NN i,j Medium sample Node v kj+1 Corresponding target sample x i ; Represents the neighbor graph g i,j The edge of each edge e t ∈E represents the target sample x i Its neighboring samples Connected; NN i,j Represents sample x i The jth group of neighboring samples; Therefore, traverse the samples in the entire D and store the constructed neighbor graph sample pairs and their labels in the sets G and Y respectively. G In the example above, we can get the neighbor graph dataset P=(G,Y G ), and use the neighbor graph in G as the neighbor graph sample in the subsequent classification task; Among them, G is the constructed neighbor graph set, Y G is the correct label for G; (3) Based on the constructed neighborhood graph dataset, an autoencoder is designed to extract the node features of the neighborhood graph. According to the node encoding features of the neighborhood graph and the adjacency relationship of the original nodes in the neighborhood graph, a graph attention neural network is trained for the neighborhood graph classification task. Specifically: Based on the neighbor graph dataset obtained in step (2), an encoder and a decoder are constructed to extract the neighbor graph node features. The encoder encodes the neighbor graph node feature X to obtain the neighbor graph node encoding feature Z, and the decoder decodes the node encoding feature Z to obtain the neighbor graph reconstructed node feature X′. The optimization goal is: Among them, L rec is the loss of the encoding and decoding process, g∈G, g is the training sample in the neighbor graph dataset, X g is the node feature matrix of g, X g ′ is the reconstructed node feature matrix of g; Based on the neighbor graph dataset obtained in step (2), a graph attention classifier clf is constructed and trained, and its optimization goal is: Among them, L clf is the loss of the classifier part, α represents the weight of different categories of samples in the loss function, Z is the node encoding feature matrix of the neighbor graph, E is the adjacency matrix of the neighbor graph, and (g,y g )∈(G,Y G ) is the training sample in the neighbor graph dataset, g is the constructed neighbor sample pair, y g is the correct label for g, is the model’s predicted label for g; The overall optimization goal of the model includes the encoder-decoder loss and the classifier loss, and its overall optimization goal is: L=L rec +L clf (4) For a given test sample, the neighbor sample group consisting of the test sample and its corresponding neighbor samples of different numbers is combined. After integrating the neighbor graph classification results, the discrimination result of the classifier under each two-class data set is obtained, and its fault category is obtained by soft voting, specifically: Based on the encoder encoder and graph attention classifier clf trained in step (3), for a test sample x test , the calculation process of its predicted label is as follows: Among them, p test,i =(V test,i ,E test,i ) is x test A sample of a nearest neighbor graph, V test,i is the set of neighbor graph nodes, X test,i is the node feature matrix of the neighbor graph, E test,i is the neighbor graph adjacency matrix, is x test Prediction results under this second category of data sets; Repeat the above process to obtain 11 graph attention classifiers clf j , j is the subscript of the graph attention classifier, j∈[1,11]; for the test sample x test , its predicted label The calculation is as follows: When the value is j, it means x test The predicted fault category is the jth fault.

2. The method for smart meter fault classification based on multi-granularity neighbor graph according to claim 1, characterized in that: In step (2), for any k j ∈K, k j The value is [a,b], a=min(5,N min ), b=min(10,2*N min ), k j The values ​​are integers and are different. The value of m is the number of integers in [a, b].

3. The method for smart meter fault classification based on multi-granularity neighbor graph according to claim 1, characterized in that: In step (3), the loss weight α is set to α=0.5*IR λ *(1-N min η ); Where IR = N maj / N min is the imbalance rate of the current two-category dataset, N min is the number of samples in the minority class sample set under the current two-class data set, N maj is the number of samples in the majority class sample set under the current two-class dataset, λ and η represent the influence of the imbalance rate and the number of minority class samples in the original dataset on the loss weight, respectively. The values ​​of λ and η are -0.3 and -0.5, respectively.

4. The method for smart meter fault classification based on multi-granularity neighbor graph according to claim 1, characterized in that: In step (3), the structures of the encoder encoder, decoder decoder and graph attention classifier clf are as follows: Among them, Linear() is the fully connected layer construction function; BatchNorm1d() is the one-dimensional batch normalization function; GATConv() is the graph attention convolution layer construction function; global_mean_pool() is the global node representation pooling function; LeakyReLU() is the activation function; dim_z is the latent space data dimension, and dim_x is the original data dimension.