A smart meter fault classification method based on multi-label confidence comparison

By converting the problem of smart meter fault classification into multiple unbalanced binary classification problems, and building a multi-label trust discrimination network, using the target-nearest neighbor sample pair to expand the data set and compare the confidence level, the complexity of smart meter fault classification and Imbalance issues improve classification accuracy and recall rate.

CN115099306BActive Publication Date: 2024-12-20BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210569747.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-24
Publication Date
2024-12-20
Estimated Expiration
2042-05-24

AI Technical Summary

Technical Problem

The complexity and diversity of smart meter faults lead to the decision-making subjectivity and untimely nature of traditional fault classification methods, and the environmental impact of different manufacturers and regions has increased the difficulty of fault classification. The existing methods lack universality when dealing with unbalanced classification. and noise control.

Method used

Using the smart meter fault classification method based on multi-label confidence comparison, we construct a multi-label trust discrimination network by converting the unbalanced multi-classification problem into multiple unbalanced binary classification problems, and using the target-nearest neighbor sample pair to expand the data set and multi-classification Label confidence comparison, integrating prediction results to improve classification accuracy.

Benefits of technology

It improves the accuracy and recall of smart meter fault classification, enhances the robustness and generalization capabilities of the model, avoids the introduction of noise, and is suitable for diverse and unbalanced fault data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115099306B_ABST
    Figure CN115099306B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention proposes a smart meter fault classification method based on multi-label confidence comparison, including: dividing historical data of smart meters under different fault categories to obtain multiple two-category data sets as input data; traversing each sample in each of the two-category data sets, taking it as a target sample and performing multiple random sampling in a neighbor sample pool of the sample to form multiple differentiated target-neighbor sample pairs; based on an expanded new data set consisting of a large number of target-neighbor sample pairs, constructing a multi-label trust discrimination network to carry out multi-label confidence comparison between target samples and control sample groups within the target-neighbor sample pairs; in the test phase, for any sample to be tested, arbitrarily combining its multiple different control sample groups to obtain multiple target-neighbor sample pairs of the test sample, integrating the prediction results of each group to perform reverse reasoning to obtain the discrimination result under each of the two-category data sets, and obtaining the 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 multi-label confidence comparison. [Background technology]

[0002] Since the 21st century, with the advancement of power market reform and the relevant adjustments of the country's energy policies in recent years, the interaction between power networks, power markets and users has become increasingly close. The electricity demand and power consumption of users are constantly increasing, and the number of distributed power generation resources such as renewable energy is increasing. It is difficult for traditional power networks to meet the above needs. In this environment, smart grids have emerged. As terminal equipment in smart grids, smart meters integrate data display, information transmission, power theft prevention and control functions on the basis of traditional meters to measure power consumption, and play an important supporting role in the stable operation of power grids. However, with the popularization and promotion of smart meters, their failures in operation show characteristics such as complexity, diversity, and suddenness, which seriously affect the normal power consumption of users. At present, the maintenance of the power grid system mainly depends on the operation and maintenance personnel. In the process of handling faults, it is inevitable that there are problems such as subjective or one-sided decision-making, which leads to unreasonable and untimely handling of meter faults. Therefore, accurate classification of smart meter faults can not only help power grid companies make reasonable decisions in time and dispatch staff with relevant experience to handle them, but also has important significance for improving the overall stability of the power grid system, reducing human resource losses and operation and maintenance costs.

[0003] At present, with the large-scale use of smart meters, the number of different manufacturers is increasing. The electronic components, process techniques and overall design schemes used by various manufacturers in the manufacturing process are different, which further increases the complexity of the smart meter itself and will inevitably bring more fault types during use. At the same time, given the large differences in geographical environment and climate in different regions, the operating status of smart meters will inevitably be affected, and the complexity of their faults will also increase. Classifying various faults of smart meters is a typical machine learning problem. In addition, the frequency of occurrence of different fault types in actual use is also different. The fault data as a whole presents the characteristics of multi-mode distribution, which further increases the difficulty of correctly predicting various faults of smart meters. If the above data is not processed and directly learned based on machine learning methods, it will often cause the classifier to be biased towards the majority class features during the learning process, which will make it difficult for the model to correctly identify the minority class, seriously reducing the generalization ability of the model. At present, there are two main methods for dealing with such problems, namely the data level and the algorithm level. The data-level method improves the recall and accuracy of minority class samples by sample rebalancing, and does not need to rely on specific data sets, so it has good versatility. However, there is a lack of a mechanism to supervise the reliability of generated samples, making it difficult to ensure the authenticity of generated samples, and the problem of introducing noise cannot be avoided in the process of constructing new samples. Although the algorithm-level method improves the classification accuracy to a certain extent by artificially increasing the misclassification cost and modifying the model structure, and alleviates the impact of data imbalance, it is often limited by the selected data set and specific classification tasks and lacks universality. In addition, how to deeply explore the distribution differences in data overlap areas and effectively explore category differences when the absolute number of minority class samples is small is also an important challenge faced by the field of unbalanced classification. Based on the above analysis, the present invention proposes a smart meter fault classification method based on multi-label confidence comparison to improve the performance of smart meter fault classification. [Summary of the invention]

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

[0005] The present invention proposes a smart meter fault classification method based on multi-label confidence comparison, comprising the following steps:

[0006] (1) The historical data of smart meters under different fault categories are divided to obtain multiple second-class data sets as input data, specifically:

[0007] The actual fault data set of smart meters is processed. The samples in the data set contain the following characteristic variables: working time, arrival batch number, power supply unit number, electric energy meter category, fault identification month, installation month, province, equipment specification, communication method, and equipment identification; the fault category labels contain 11 categories, namely: 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 data set, take all samples under this category as the minority class sample set, and take the remaining fault category samples as the majority class sample set, and convert the original data set into 11 second-category data sets; for each of the second-category data sets, the data set can be described as:

[0008] X i =[X min ,X maj ]

[0009] Among them, X i is any one of the 11 transformed two-class data sets, i∈[1,11]; X min For the second-class dataset X i The minority class sample set in X, where each sample class label is set to 1; maj For the second-class dataset X i The majority class sample set in X, where each sample class label is set to 0; i The size is G i =len(X i ), len(X i ) represents the second-class dataset X i The number of samples in; Through the above operations, the original unbalanced multi-classification problem is converted into multiple unbalanced binary classification problems for processing;

[0010] (2) Traverse each sample in each of the two data sets, take it as the target sample and perform multiple random sampling in the neighbor sample pool of the sample to form multiple differentiated target-neighbor sample pairs, specifically:

[0011] Based on any one X of the 11 imbalanced two-class datasets obtained in step (1) i =[X min ,X maj ], construct a differentiated target-neighbor sample pair dataset:

[0012] For any two-class dataset X i Any sample x in i , taking it as the target sample, construct multiple sets of differentiated target-nearest neighbor sample pairs, specifically: Use the KNN algorithm to find the target sample xi In the second class dataset X i The K nearest neighbor samples in get x i The nearest neighbor sample pool; randomly sample m samples in the nearest neighbor sample pool, where the size of m is less than K, to generate target-nearest neighbor sample pairs c i =(x i ,p(x i ));

[0013] Among them, K is the size of the nearest neighbor sample pool, m is the number of random sampling; target-nearest neighbor sample pair c i By the target sample x i and the control sample group p(x i ), the control sample group p(x i ) is obtained by i The m nearest neighbor samples x are sampled from the nearest neighbor sample pool j In the construction process, a hyperparameter N is set to control the expansion multiple of the data set. By setting the hyperparameter N, the current target sample x i Find N groups of differentiated control samples p(x i ),and Represents the number of ordered permutations of sampling m samples from K samples;

[0014] For the target sample x i The control sample group p(x i ) to reconstruct the class labels of each sample, specifically: traverse the control sample group p(x i ) in each neighbor sample x j , j∈[1,m], extract its category label, and the target sample x i The category labels are XORed; when the target sample x i and the current neighbor sample x j If the categories are the same, the neighbor samples are called the same type of samples, and the label is set to 1. Otherwise, they are different types of samples, and the label is set to 0.

[0015] In this way, the original category labels of the neighbor samples are reconstructed into the same or different labels obtained by comparing with the target sample category; for any category of target samples, by presetting the hyperparameter N, N differentiated control sample groups and the reconstructed labels corresponding to each neighbor sample can be obtained. Therefore, traversing X i For each sample in, store the constructed target-neighbor sample pair and the reconstructed labels of each neighbor sample in set A i With L i In the above example, we can get the expanded target-neighbor sample pair data set S i =(A i ,Li ), where A i It is composed of multiple target-nearest neighbor sample pairs obtained by construction, each target-nearest neighbor sample pair consists of target sample x i And the N differentiated control sample groups p(x i ), each control sample group consists of m neighbor samples, A i The size is N×(G i ×(m+1)), G i Represents the current second-class dataset X i The number of samples in L i It consists of the reconstructed labels of the neighbor samples in each target-neighbor sample pair data, and each reconstructed label corresponds to the control sample group p(x i ), L i The size is N×(G i ×(m+1)), i∈[1,11];

[0016] (3) Based on the expanded new data set consisting of a large number of target-neighbor sample pairs, a multi-label trust discrimination network is constructed to perform multi-label confidence comparison between the target sample and the control sample group within the target-neighbor sample pair, specifically:

[0017] Based on any target-neighbor sample pair dataset S obtained in step (2) i =(A i ,L i ), use VAE to build the corresponding multi-label trust discrimination network model i And train, its optimization goal is:

[0018]

[0019] Among them, RC loss represents the reconstruction error of the multi-label trust discriminant network, D kl,p is the KL divergence of VAE for a single training sample; x ori,p A i The single target-neighbor sample pair data in will be provided to the VAE network for training; gen,p is a new sample generated by the VAE network according to the characteristics of the training data, (x gen,p -x ori,p ) represents the generation error of VAE for a single training sample; M loss For the defined multi-label matching loss, label q For L i Any refactoring tag in pre q is the label prediction result of the model for the control sample, q∈[0,1];

[0020] (4) In the test phase, for any sample to be tested, multiple different control sample groups are arbitrarily combined to obtain multiple target-neighbor sample pairs of the test sample. The prediction results of each group are integrated to perform reverse reasoning to obtain the discrimination results under each two-class data set. The fault category is obtained through soft voting, which is specifically:

[0021] Based on each multi-label trust discriminant network model trained in step (3) i , for a test sample x test , the calculation process of its predicted label is as follows:

[0022]

[0023] Among them, n is a hyperparameter, representing the sample x to be tested test The number of differential control sample groups obtained for the target sample; m is the number of random sampling times, representing x test The number of control samples in a control sample group obtained; y test,i is x test In the current network model i The corresponding prediction score, y test,i ∈[0,1]; label ori is x test The category label of any control sample in its n groups of control samples with m samples, pre is the current network model i The predicted target sample and label ori The similarity between the corresponding control samples, pre∈[0,1];

[0024] Repeat the above process for each of the two-category datasets X i , we can get the corresponding multi-label trust discrimination network model i , i is the subscript of the pattern discrimination classifier, i∈[1,11]; for the sample to be tested x test , its predicted label The calculation of is as follows:

[0025]

[0026] When the value is i, it means x test The predicted fault category is the i-th fault.

[0027] In the above method, in step (2), the value of N is The value of m is The value of K is

[0028] in, To round down, len(X min ) is the number of samples in the minority class sample set under the current two-class data set, Represents the number of ordered permutations of sampling m samples from K samples.

[0029] In the above method, in step (3), the multi-label trust discrimination network model i The structure is as follows:

[0030]

[0031] Among them, Reshape() is a tensor deformation function; Conv2D() is a two-dimensional convolutional layer construction function, in which the value of the tensor expansion option padding is 'same'; Flatten() is a tensor flattening function; Dense() is a fully connected layer construction function; LeakyReLU represents the activation function; Dropout() is a random dropout function.

[0032] In the above method, in step (4), the value of n is 5.

[0033] The smart meter fault classification method based on multi-label confidence comparison improves the accuracy and recall rate of smart meter fault classification.

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

[0035] In the technical solution implemented in the present invention, based on the construction method of target-neighbor sample pairs, the data set is expanded exponentially without introducing noise. At the same time, based on the multi-label confidence comparison method, the unbalanced classification task is redefined. The introduction of the control sample group enables the model to pay attention to the hidden information between neighbor samples. The integration of the prediction results of multiple target-neighbor sample pairs is conducive to improving the accuracy and robustness of the model, thereby improving the accuracy and recall rate of the smart meter fault classification results.

Brief Description of the Drawings

[0036] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the present invention will be briefly introduced below. 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 creative labor.

[0037] Figure 1 It is a schematic diagram of the framework flow of the smart meter fault classification method based on multi-label confidence comparison proposed by the present invention;

[0038] Figure 2 It is a flowchart of target-neighbor sample pair construction and data set expansion;

[0039] Figure 3 Detailed schematic diagram of the algorithm of the present invention. [Specific implementation method]

[0040] 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.

[0041] It should be clear that the described embodiments of the invention are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments of the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.

[0042] The present invention provides a smart meter fault classification method based on multi-label confidence comparison. In order to meet the fault classification of smart meters, the present invention divides the historical data of smart meters under different fault categories to obtain multiple two-category data sets as input data; traverses each sample in each two-category data set, takes it as the target sample and performs multiple random sampling in the neighbor sample pool of the sample to form multiple differentiated target-neighbor sample pairs; based on the expanded new data set composed of a large number of target-neighbor sample pairs, constructs a multi-label trust discrimination network to carry out multi-label confidence comparison between target samples and control sample groups in the target-neighbor sample pairs; in the test stage, for any sample to be tested, arbitrarily combine its multiple different control sample groups to obtain multiple target-neighbor sample pairs of the test sample, integrate the prediction results of each group to perform reverse reasoning to obtain the discrimination results under each two-category data set, and obtain the fault category through soft voting.

[0043] Figure 1 The figure is a schematic diagram of a framework flow of a smart meter fault classification method based on multi-label confidence comparison proposed in the present invention, and the method comprises the following steps:

[0044] Step 101, divide the historical data of the smart meter under different fault categories to obtain multiple second-category data sets as input data, specifically:

[0045] The actual fault data set of smart meters is processed. The samples in the data set contain the following characteristic variables: working time, arrival batch number, power supply unit number, electric energy meter category, fault identification month, installation month, province, equipment specification, communication method, and equipment identification; the fault category labels contain 11 categories, namely: 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 data set, take all samples under this category as the minority class sample set, and take the remaining fault category samples as the majority class sample set, and convert the original data set into 11 second-category data sets; for each of the second-category data sets, the data set can be described as:

[0046] X i =[X min ,X maj ]

[0047] Among them, X i is any one of the 11 transformed two-class data sets, i∈[1,11]; X min For the second-class dataset X i The minority class sample set in X, where each sample class label is set to 1; maj For the second-class dataset X i The majority class sample set in X, where each sample class label is set to 0; i The size is G i =len(X i ), len(X i ) represents the second-class dataset X i The number of samples in; Through the above operations, the original unbalanced multi-classification problem is converted into multiple unbalanced binary classification problems for processing.

[0048] Step 102, traverse each sample in each of the two-category data sets, use it as a target sample and perform multiple random sampling in the neighbor sample pool of the sample to form multiple differentiated target-neighbor sample pairs, specifically:

[0049] Based on any one X of the 11 imbalanced two-class data sets obtained in step 101 i =[X min ,X maj ], construct a differentiated target-neighbor sample pair dataset:

[0050] For any two-class dataset X i Any sample x in i , taking it as the target sample, construct multiple sets of differentiated target-nearest neighbor sample pairs, specifically: Use the KNN algorithm to find the target sample xi In the second class dataset X i The K nearest neighbor samples in get x i The nearest neighbor sample pool; randomly sample m samples in the nearest neighbor sample pool, where the size of m is less than K, to generate target-nearest neighbor sample pairs c i =(x i ,p(x i ));

[0051] Among them, K is the size of the nearest neighbor sample pool, m is the number of random sampling; target-nearest neighbor sample pair c i By the target sample x i and the control sample group p(x i ), the control sample group p(x i ) is obtained by i The m nearest neighbor samples x are sampled from the nearest neighbor sample pool j In the construction process, a hyperparameter N is set to control the expansion multiple of the data set. By setting the hyperparameter N, the current target sample x i Find N groups of differentiated control samples p(x i ),and Represents the number of ordered permutations of sampling m samples from K samples;

[0052] For the target sample x i The control sample group p(x i ) to reconstruct the class labels of each sample, specifically: traverse the control sample group p(x i ) in each neighbor sample x j , j∈[1,m], extract its category label, and the target sample x i The category labels are XORed; when the target sample x i and the current neighbor sample x j If the categories are the same, the neighbor samples are called the same type of samples, and the label is set to 1. Otherwise, they are different types of samples, and the label is set to 0.

[0053] In this way, the original category labels of the neighbor samples are reconstructed into the same or different labels obtained by comparing with the target sample category; for any category of target samples, by presetting the hyperparameter N, N differentiated control sample groups and the reconstructed labels corresponding to each neighbor sample can be obtained. Therefore, traversing X i For each sample in, store the constructed target-neighbor sample pair and the reconstructed labels of each neighbor sample in set A i With L i In the above example, we can get the expanded target-neighbor sample pair data set S i =(A i ,Li ), where A i It is composed of multiple target-nearest neighbor sample pairs obtained by construction, each target-nearest neighbor sample pair consists of target sample x i And the N differentiated control sample groups p(x i ), each control sample group consists of m neighbor samples, A i The size is N×(G i ×(m+1)), G i Represents the current second-class dataset X i The number of samples in L i It consists of the reconstructed labels of the neighbor samples in each target-neighbor sample pair data, and each reconstructed label corresponds to the control sample group p(x i ), L i The size is N×(G i ×(m+1)), i∈[1,11].

[0054] Step 103, based on the expanded new data set consisting of a large number of target-neighbor sample pairs, a multi-label trust discrimination network is constructed to perform multi-label confidence comparison between the target sample and the control sample group within the target-neighbor sample pair, specifically:

[0055] Based on any target-neighbor sample pair data set S obtained in step 102 i =(A i ,L i ), use VAE to build the corresponding multi-label trust discrimination network model i And train, its optimization goal is:

[0056]

[0057] Among them, RC loss represents the reconstruction error of the multi-label trust discriminant network, D kl,p is the KL divergence of VAE for a single training sample; x ori,p A i The single target-neighbor sample pair data in will be provided to the VAE network for training; gen,p is a new sample generated by the VAE network according to the characteristics of the training data, (x gen,p -x ori,p ) represents the generation error of VAE for a single training sample; M loss For the defined multi-label matching loss, label q For L i Any refactoring tag in pre q is the label prediction result of the model for the control sample, q∈[0,1].

[0058] Step 104, in the test phase, for any sample to be tested, any combination of its multiple different control sample groups is used to obtain multiple target-neighbor sample pairs of the test sample, and the prediction results of each group are integrated to perform reverse reasoning to obtain the discrimination results under each two-class data set, and the fault category is obtained through soft voting, specifically:

[0059] Based on each multi-label trust discrimination network model trained in step 103 i , for a test sample x test , the calculation process of its predicted label is as follows:

[0060]

[0061] Among them, n is a hyperparameter, representing the sample x to be tested test The number of differential control sample groups obtained for the target sample; m is the number of random sampling times, representing x test The number of control samples in a control sample group obtained; y test,i is x test In the current network model i The corresponding prediction score, y test,i ∈[0,1]; label ori is x test The category label of any control sample in its n groups of control samples with m samples, pre is the current network model i The predicted target sample and label ori The similarity between the corresponding control samples, pre∈[0,1];

[0062] Repeat the above process for each of the two-category datasets X i , we can get the corresponding multi-label trust discrimination network model i , i is the subscript of the pattern discrimination classifier, i∈[1,11]; for the sample to be tested x test , its predicted label The calculation of is as follows:

[0063]

[0064] When the value is i, it means x test The predicted fault category is the i-th fault.

[0065] Figure 2 This is a flowchart of target-nearest neighbor sample pair construction and data set expansion. First, the KNN algorithm is used to find the target sample x iIn the two-category dataset X, we get K nearest neighbor samples, i The nearest neighbor sample pool; randomly sample m (m < K) samples in the nearest neighbor sample pool to generate the target-nearest neighbor sample pair c i =(x i ,p(x i )); where K is the size of the nearest neighbor sample pool, m is the number of samples in the nearest neighbor sample pool; the target-nearest neighbor sample pair c i By the target sample x i and the control sample group p(x i ), the control sample group p(x i ) is composed of samples sampled from m neighboring sample pools; by presetting the data set expansion multiple N, the current target sample x i Find the most The control sample group p(x i ), Represents the number of ordered permutations of sampling m samples from K samples.

[0066] Figure 3 This is a schematic diagram of the core idea of ​​the algorithm of the present invention. The algorithm of the present invention is based on a multi-label confidence comparison method, which transforms the traditional imbalanced classification problem into a multi-label matching problem between the target sample and the control sample group; at the same time, through the construction method of the target-nearest neighbor sample pair, it achieves an exponential expansion of the original data set without introducing noise, overcoming the problems of the small absolute number of minority class samples and the difficulty in mining the features of the overlapping areas of categories. The traditional imbalanced method is a classification method at the level of a single sample, which models p(y|x) by establishing a classification model for a single sample. Due to the imbalance in the number of samples between the majority class and the minority class, the trained classifier will have a decision bias problem;

[0067] Through the target-nearest-neighbor sample pair construction method and the multi-label confidence comparison method proposed in the present invention, the traditional classification problem is transformed into a multi-label matching task between the target sample and the control sample group, and p(same class ornot|(x,p(x))) is modeled, where x is the target sample, p(x) is the control sample group, (x,p(x)) is the target-nearest-neighbor sample pair, Indicates the sample category that needs to be predicted in the original task, Represents the similarity result predicted by the i-th group of nearest neighbor control groups in the new task.

[0068] Algorithm 1 is the pseudo code of the target-nearest neighbor sample pair construction algorithm:

[0069]

[0070] In the specific implementation example, the fault history data set of different categories of smart meters was used for testing. The data set collected data of smart meters with 11 fault types in 25 provinces. Due to the influence of various factors such as manual statistics and external conditions, the data labels are mislabeled or missing. If used directly, the model will learn incorrect features. After data cleaning by cluster analysis, missing value completion, outlier processing and other technologies, a total of 15,885 fault sample data were obtained. In order to reduce the randomness of the results, the data set was randomly divided into training set and test set with a fixed random number seed in a ratio of 8:2.

[0071] Table 1 Datasets used in specific examples

[0072]

[0073] To verify the effectiveness of the proposed algorithm, 10 data-level methods and 6 mainstream deep learning sample generation methods are used in the embodiment of the present invention for comparison, as shown in Table 2. Considering the large amount of sample data and complex categories of the smart meter fault data set, RF is used as a classifier to verify the sample balance effect of the data-level method. The embodiment of the present invention is represented by MLCC-IBC (Imbalanced binary classification method based on contrastive learning using multi-label confidence comparisons) in the table.

[0074] Table 2 Algorithms compared in specific embodiments

[0075]

[0076]

[0077] The embodiment of the present invention uses macro-F1 and G-mean indicators to evaluate the classification effect of the algorithm. The macro-F1 indicator is the arithmetic mean of the F1-measure of each fault category, which is used to comprehensively evaluate the accuracy and recall of the model in each category. The G-mean indicator is the geometric mean of the recall rate in each category, which is used to evaluate the recall of the model in each category. Both Macro-F1 and G-mean have values ​​from 0 to 1. The larger the value, the better the classification performance of the model.

[0078] The experimental results of the embodiment of the present invention and the mainstream oversampling method on the F1-measure and macro-F1 indicators under various fault categories of smart meters are shown in Table 3, and the experimental results on the recall rate and G-mean indicators of each category are shown in Table 4. It can be seen that the smart meter fault classification method constructed based on the nearest neighbor sample pair of the present invention has obtained F1-measure and recall rates that exceed those of other methods in most categories, and has obtained the highest macro-F1 and G-mean. Combining the results of Tables 3 and 4, it is shown that the smart meter fault sample balancing effect of the method of the embodiment of the present invention is better than that of the data level balancing method, and can obtain higher classification accuracy and recall rate.

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

[0080]

[0081]

[0082] Table 4 Experimental results of MLCC-IBC and oversampling methods on recall rate and G-mean index for various fault categories of smart meters

[0083]

[0084] The experimental results of the embodiment of the present invention and the mainstream algorithm-level methods on the F1-measure and macro-F1 indicators under various fault categories of smart meters are shown in Table 5, and the experimental results on the recall rate and G-mean indicators of each category are shown in Table 6. It can be seen that the smart meter fault classification method constructed based on neighbor sample pairs of the present invention has obtained F1-measure and recall rates that exceed other methods in most categories, and has obtained the highest macro-F1 and G-mean. The results of Tables 5 and 6 show that the smart meter fault sample balancing effect of the method of the embodiment of the present invention is better than that of the algorithm-level method, and can obtain higher classification accuracy and recall rate.

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

[0086]

[0087]

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

[0089]

[0090] A large number of comparison results with mainstream oversampling methods and deep learning sample generation methods show that the multi-label confidence comparison method and target-nearest neighbor sample pair construction method proposed in the present invention can achieve exponential expansion of the data set without introducing noise when dealing with the multi-classification problem of smart meters with a small absolute number of minority class samples and overlapping areas between different categories of data. The multi-label confidence comparison between the target sample and the control sample group and the result integration of multiple groups of control sample groups can effectively improve the accuracy and recall rate of faulty meter classification.

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

[0092] In the technical solution implemented in the present invention, the historical data of the smart meter under different fault categories are divided to obtain multiple two-category data sets as input data; each sample in each two-category data set is traversed, and it is used as a target sample and randomly sampled multiple times in the neighbor sample pool of the sample to form multiple differentiated target-neighbor sample pairs; based on the expanded new data set composed of a large number of target-neighbor sample pairs, a multi-label trust discrimination network is constructed to carry out multi-label confidence comparison between the target sample and the control sample group within the target-neighbor sample pair; in the test stage, for any sample to be tested, its multiple different control sample groups are arbitrarily combined to obtain multiple target-neighbor sample pairs of the test sample, and the prediction results of each group are integrated to perform reverse reasoning to obtain the discrimination result under each two-category data set, and the fault category is obtained by soft voting.

[0093] 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-label confidence comparison, It is characterized in that The steps include: (1) The historical data of smart meters under different fault categories are divided to obtain multiple second-class data sets as input data, specifically: The actual fault data set of smart meters is processed. The samples in this data set contain the following characteristic variables: working time, arrival batch number, power supply unit number, electric energy meter category, fault identification month, installation month, province, equipment specification, communication method, and equipment identification; The fault category labels include 11 categories, namely: 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 faults. Each category of samples in the data set is traversed, and all samples under this category are taken as the minority class sample set, and the remaining fault category samples are taken as the majority class sample set, and the original data set is converted into 11 two-category data sets. For each of the two-category data sets, the data set can be described as follows: X i =[X min ,X maj ] Among them, X i is any one of the 11 transformed two-class data sets, i∈[1,11]; X min For the second-class dataset X i The minority class sample set in X, where each sample class label is set to 1; maj For the second-class dataset X i The majority class sample set in X, where each sample class label is set to 0; i The size is G i =len(X i ), len(X i ) represents the second-class dataset X i The number of samples in; Through the above operations, the original unbalanced multi-classification problem is converted into multiple unbalanced binary classification problems for processing; (2) Traverse each sample in each of the two data sets, take it as the target sample and perform multiple random sampling in the neighbor sample pool of the sample to form multiple differentiated target-neighbor sample pairs, specifically: Based on any one X of the 11 imbalanced two-class datasets obtained in step (1) i =[X min ,X maj ], construct a differentiated target-neighbor sample pair dataset: For any two-class dataset X i Any sample x in i , taking it as the target sample, construct multiple sets of differentiated target-nearest neighbor sample pairs, specifically: Use the KNN algorithm to find the target sample x i In the second class dataset X i The K nearest neighbor samples in get x i The nearest neighbor sample pool; randomly sample m samples in the nearest neighbor sample pool, where the size of m is less than K, to generate target-nearest neighbor sample pairs c i =(x i ,p(x i )); Among them, K is the size of the nearest neighbor sample pool, m is the number of random sampling; target-nearest neighbor sample pair c i By the target sample x i and the control sample group p(x i ), the control sample group p(x i ) is obtained by i The m nearest neighbor samples x are sampled from the nearest neighbor sample pool j In the construction process, a hyperparameter N is set to control the expansion multiple of the data set. By setting the hyperparameter N, the current target sample x i Find N groups of differentiated control samples p(x i ),and Represents the number of ordered permutations of sampling m samples from K samples; For the target sample x i The control sample group p(x i ) to reconstruct the class labels of each sample, specifically: traverse the control sample group p(x i ) in each neighbor sample x j , j∈[1,m], extract its category label, and the target sample x i The category labels are XORed; when the target sample x i and the current neighbor sample x j If the categories are the same, the neighbor samples are called the same type of samples, and the label is set to 1. Otherwise, they are different types of samples, and the label is set to 0. In this way, the original category labels of the neighbor samples are reconstructed into the same or different labels obtained by comparing with the target sample category; for any category of target samples, by presetting the hyperparameter N, N differentiated control sample groups and the reconstructed labels corresponding to each neighbor sample can be obtained. Therefore, traversing X i For each sample in, store the constructed target-neighbor sample pair and the reconstructed labels of each neighbor sample in set A i With L i In the above example, we can get the expanded target-neighbor sample pair dataset S i =(A i ,L i ), where A i It is composed of multiple target-neighbor sample pairs obtained by construction, each target-neighbor sample pair consists of target sample x i And the N differentiated control sample groups p(x i ), each control sample group consists of m neighbor samples, A i The size is N×(G i ×(m+1)), G i Represents the current second-class dataset X i The number of samples in L i It consists of the reconstructed labels of the neighbor samples in each target-neighbor sample pair data, and each reconstructed label corresponds to the control sample group p(x i ), L i The size is N×(G i ×(m+1)), i∈[1,11]; (3) Based on the expanded new data set consisting of a large number of target-neighbor sample pairs, a multi-label trust discrimination network is constructed to perform multi-label confidence comparison between the target sample and the control sample group within the target-neighbor sample pair, specifically: Based on any target-neighbor sample pair dataset S obtained in step (2) i =(A i ,L i ), use VAE to build the corresponding multi-label trust discrimination network model i And train, its optimization goal is: Among them, RC loss represents the reconstruction error of the multi-label trust discriminant network, D kl,p is the KL divergence of VAE for a single training sample; x ori,p A i The single target-neighbor sample pair data in will be provided to the VAE network for training; gen,p is a new sample generated by the VAE network according to the characteristics of the training data, (x gen,p -x ori,p ) represents the generation error of VAE for a single training sample; M loss For the defined multi-label matching loss, label q For L i Any refactoring tag in pre q is the label prediction result of the model for the control sample, q ∈[0,1]; (4) In the test phase, for any sample to be tested, multiple different control sample groups are arbitrarily combined to obtain multiple target-neighbor sample pairs of the test sample. The prediction results of each group are integrated to perform reverse reasoning to obtain the discrimination results under each two-class data set. The fault category is obtained through soft voting, which is specifically: Based on each multi-label trust discriminant network model trained in step (3) i , for a test sample x test , the calculation process of its predicted label is as follows: Among them, n is a hyperparameter, representing the sample x to be tested test The number of differential control sample groups obtained for the target sample; m is the number of random sampling times, representing x test The number of control samples in a control sample group obtained; y test,i is x test In the current network model i The corresponding prediction score, y test,i ∈[0,1]; label ori is x test The category label of any control sample in its n groups of control samples with m samples, pre is the current network model i The predicted target sample and label ori The similarity between the corresponding control samples, pre∈[0,1]; Repeat the above process for each of the two-category datasets X i , we can get the corresponding multi-label trust discrimination network model i , i is the subscript of the pattern discrimination classifier, i∈[1,11]; for the sample to be tested x test , its predicted label The calculation of is as follows: When the value is i, it means x test The predicted fault category is the i-th fault.

2. According to claim 1, a smart meter fault classification method based on multi-label confidence comparison, It is characterized in that In step (2), the value of N is The value of m is The value of K is in, To round down, len(X min ) is the number of samples in the minority class sample set under the current two-class data set, Represents the number of ordered permutations of sampling m samples from K samples.

3. According to claim 1, a smart meter fault classification method based on multi-label confidence comparison, It is characterized in that In step (3), the multi-label trust discrimination network model i The structure is as follows: Among them, Reshape() is a tensor deformation function; Conv2D() is a two-dimensional convolutional layer construction function, in which the value of the tensor expansion option padding is 'same'; Flatten() is a tensor flattening function; Dense() is a fully connected layer construction function; LeakyReLU represents the activation function; Dropout() is a random dropout function.

4. According to claim 1, a smart meter fault classification method based on multi-label confidence comparison, It is characterized in that In the step (4), the value of n is 5.