A load identification method and device based on feature fusion and explainable enhancement
By collecting high-frequency voltage, current, and low-frequency power signals of the load, extracting multi-scale features, and combining them with deep feature fusion and interpretable analysis, the problem of insufficient feature utilization in existing load identification methods is solved, and the robustness and generalization ability of the model are improved.
Patent Information
- Application Number
- CN202310968753.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-08-02
AI Technical Summary
Existing load identification methods are insufficient in terms of complementary use of features, learning of sample relationship features, and interpretability of features for model identification, which limits the robustness and generalization of load identification models.
By collecting high-frequency voltage and current signals and low-frequency active and reactive power signals of the load, short-term and long-term features are extracted. A dual-tower feature extraction network is used for deep feature fusion. The training methods of self-attention and cross-attention networks and metric learning are combined. GradCAM++ interpretable analysis method is used to guide feature optimization, thereby improving the recognition accuracy and reliability of the model.
It achieves efficient fusion of multi-scale features, improves the robustness and generalization performance of the load recognition model, and enhances the interpretability of features and the reliability of recognition.
Smart Images

Figure CN117077076B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of load identification, and in particular to a load identification method and device based on feature fusion and explainable enhancement. BACKGROUND
[0002] The load identification technology can effectively obtain user power consumption information, understand the power consumption behavior of residents, formulate personalized energy-saving plans and safe power consumption strategies for users, realize energy saving and consumption reduction on the user side, and protect the safety of user power consumption. At the same time, the load identification technology can also help the power grid to formulate targeted demand response strategies, improve the demand side power dispatching capability, and improve the power flow state of the power grid.
[0003] In the field of load identification, scholars at home and abroad have extracted a series of long-term and short-term load characteristics around the frequency measurement data of the load. For example, the literature “An non-intrusive load monitoring algorithm based on multiple features and decision fusion” (Li Y Z, Wang H X, Yang J Y, et al. An non-intrusive load monitoring algorithm based on multiple features and decision fusion [J]. Energy Reports, 2021, Pages 1555-1562.) uses high-frequency voltage and current data to extract short-term characteristics such as load VI trajectory and harmonics; the literature “A novel transfer learning-based intelligent nonintrusive load-monitoring with limited measurements” (Zhou Z, Xiang Y, Xu H, et al. A novel transfer learning-based intelligent nonintrusive load-monitoring with limited measurements [J]. IEEE Transactions on Instrumentation and Measurement, 2020, 70: 1-8.) uses low-frequency power data of the load to extract long-term operating characteristics such as load power difference and power surge; the literature “Household load identification based on transient characteristic closeness matching” (Gao Y, Yang H G. Household load identification based on transient characteristic closeness matching [J]. Power System Automation, 2013, 37(09): 54-59.) extracts startup characteristics such as transient curve in the load switching process. However, in general, the existing identification methods still have deficiencies in the complementary use of load characteristics, sample relationship feature learning, and model identification basis characteristics, which limits the further improvement of the robustness, generalization and reliability of the load identification model. SUMMARY
[0004] To at least partially solve one of the technical problems existing in the prior art, the purpose of the present application is to provide a load identification method and device based on feature fusion and explainable enhancement.
[0005] The technical scheme adopted by the present application is:
[0006] A load identification method based on feature fusion and explainable enhancement, comprising the following steps:
[0007] Collecting high-frequency voltage and current signals and low-frequency active power and reactive power signals after the load is connected;
[0008] Extracting short-term features from the collected load high-frequency waveform and obtaining long-term features from the load low-frequency power data;
[0009] Constructing a load feature data set according to the long-term features and the short-term features, and obtaining a training set, a validation set and a test set according to the load feature data set;
[0010] Inputting the training set into a feature fusion and load identification model to perform deep feature extraction, fusion and load classification, and outputting a classification result; wherein the training is performed in a metric learning manner;
[0011] Using an explainable analysis method to analyze the classification result, combining the analysis result with preset prior knowledge to guide a feature optimization model, so as to complete the training of the feature fusion and load identification model;
[0012] Obtaining a load to be identified, extracting features of the load to be identified, inputting the extracted features into the trained feature fusion and load identification model, and outputting a classification result.
[0013] Further, in order to obtain accurate load waveform trajectory and reduce the influence of noise and voltage fluctuation on the short-term feature extraction result, the sampling frequency of the high-frequency voltage and current signals should be greater than 6.4 kHz, and the sampling time should be greater than 10 power frequency cycles; in order to obtain sufficient transient characteristics at the load starting moment and trend and fluctuation characteristics during operation, the sampling frequency of the low-frequency active power and reactive power signals should be greater than 0.1 Hz, and the sampling time should be greater than 5 minutes.
[0014] Further, the short-term features are VI trajectory image features, and the extraction of the short-term features from the collected load high-frequency waveform comprises:
[0015] For n-cycle voltage and current waveform data U1, U2, … U n and I1, I2, … I n , respectively, perform per-unit processing:
[0016]
[0017]
[0018] In the formula, is the kth voltage and current cycle sequence after per-unit processing; U k (t), I k(t) represents the k-th voltage and current cycle sequence before normalization; U max ,I max The maximum values of voltage and current within one cycle;
[0019] VI trajectory image features are constructed using the normalized voltage and current waveform sequences.
[0020] Furthermore, the VI trajectory image features are divided into three channels: R, G, and B. The filling method for each channel is as follows: construct an m×m zero matrix M with resolution m, multiply the normalized voltage and current by resolution m and round to the nearest integer, and fill the corresponding positions of matrix M with current values as rows and voltage values as columns.
[0021] The fill value for the R channel is the instantaneous power normalized to the waveform amplitude, calculated using the following formula:
[0022]
[0023] In the formula, R mn Let P be the power value at the m-th row and n-th column of matrix M, where N is the number of sampling points at that position in the matrix. i Let P be the instantaneous power at the i-th sampling point. max ,P min The maximum and minimum instantaneous power values within one cycle;
[0024] The fill value for channel G is the instantaneous power normalized to the load level; the specific calculation formula is the same as the above formula; the difference is that P in the formula... max ,P min The maximum and minimum instantaneous power of the dataset load at the waveform sampling point;
[0025] The fill value for channel B is the ratio of the voltage to the rate of change of current, calculated using the following formula:
[0026]
[0027] Combining the R, G, and B channel matrices forms the three-channel color VI trajectory image matrix I corresponding to that cycle. k To reduce distortion of the VI trajectory caused by sampling noise or power grid fluctuations in a single cycle, the average of the VI trajectory image matrices generated from the sampled n cycles is used as the final VI trajectory image feature I, i.e.:
[0028]
[0029] Furthermore, the long-term characteristics include the load's startup characteristics and operating characteristics;
[0030] Among them, the startup characteristics include the startup spike PT-spike and start-up time T start , start-up peak P T-spike is the maximum value of active power of the load during start-up, start-up time T start is the time used by the load from start-up to stable operation;
[0031] The operating characteristics include the active power curve P(t), the reactive power curve Q(t), the power factor curve of the maximum value P max , Q max , of the minimum value P min , Q min , of the average value P mean , Q mean , and the variance P var , Q var , of the active power duty cycle D, the load operating time T on , the number of active power peaks N spike , the modulus maximum value cd nmax , ca nmax of the wavelet transform detail coefficient and the approximate coefficient, the root mean square value cd nrms , ca nrms , the modulus average value cd nmean , ca nmean , the standard deviation cd nstd , ca nstd characteristics.
[0032] Further, the power factor curve can be calculated by the load steady-state active power P(t) and the steady-state reactive power Q(t):
[0033]
[0034] The duty cycle D is the time ratio of the load in the operating state in the working cycle, which can be written as:
[0035]
[0036] In the formula, T work is the time length of the load in the operating state.
[0037] The calculation formulas of the modulus maximum value cd nmax , the root mean square value cd nrms , the modulus average value cd nmean , and the standard deviation cd nstd of the wavelet transform detail coefficient are as follows:
[0038]
[0039] In the formula, n represents the number of wavelet decomposition layers, and N represents the length of the n-th layer of load detail coefficient.
[0040] Maximum value of power wavelet transform approximation coefficient module ca nmax Root mean square value ca nrms Module average value ca nmean Standard deviation ca nstd The calculation formula of the feature is consistent with the above formula.
[0041] Further, the feature fusion and load recognition model comprises a deep feature extraction network, a feature fusion network and a classification network.
[0042] The deep feature extraction network adopts a double-tower neural network structure, one branch of which adopts a convolutional neural network to extract deep features of VI trajectories, and the other branch adopts a BP neural network to extract deep features of long-term tabular features.
[0043] The feature fusion network adopts a structure of “batch self-attention layer-batch cross-attention layer-self-attention layer”, which respectively fuses between similar samples and between long-term features and short-term features; the first self-attention layer and the cross-attention layer adopt batch attention to realize fusion at the sample level, and the second self-attention layer realizes fusion at the feature space level; the expression of the attention network is:
[0044]
[0045] In the formula, Q, K and V respectively represent a query matrix, an index matrix and a value matrix, d k represents the feature dimension;
[0046] The classification network adopts a fully connected network form to output the final load classification result.
[0047] Further, the training in the manner of metric learning comprises:
[0048] A metric loss function Margin-Based Loss is introduced into the loss function of model training to reduce the feature distance of similar samples and improve the efficiency of fusion and the robustness of the model to noise samples, and specifically comprises the following steps:
[0049] Each sample in the training set is selected as an anchor sample in turn, and according to the sample feature distribution output by the deep feature extraction network, a positive sample is extracted from data with the same label as the anchor sample by distance weighted sampling, and a negative sample is extracted from data with a different label from the anchor sample, and by setting a distance metric loss function, the feature distance between the anchor sample and the positive sample is reduced, and the feature distance between the anchor sample and the negative sample is increased.
[0050] The sampling probability of positive / negative samples is:
[0051] Pr(n * |i)∝min(λ,q -1 (D in ))
[0052]
[0053] where λ is the minimum sampling probability, q(d) is the distance distribution function of positive / negative samples, D in is the Euclidean distance between anchor sample i and sample n;
[0054] The form of the distance metric loss function is:
[0055]
[0056] l margin (i,j)=(α+y ij (D ij -β)) +
[0057] where N is the number of samples, M is the number of positive / negative samples of anchor sample i, β(i) is a trainable boundary parameter for sample i, v is a regularization hyperparameter of β(i); l margin (i,j) is the distance metric function between anchor sample i and sample j, α is a variable for controlling the sample separation margin; y ij is a sign function, which is 1 when the classes of sample i and sample j are consistent, otherwise it is -1; D ij is the Euclidean distance between the features of sample i and sample j;
[0058] The overall training method of the feature fusion and load recognition model is: using a classification loss function loss1 as the loss function of the classification network, and using a metric loss function Margin-Based Loss as the loss functions loss2, loss3 of the two branches of the deep feature extraction network; loss1 makes the load classification result output by the model tend to the true label, and loss2, loss3 makes the deep features of the same load map to similar feature spaces; the total loss function of the feature fusion and load recognition model is:
[0059]
[0060] where σ i is the loss ia learnable parameter for measuring the uncertainty of variance; the feature fusion and load identification model adopts a batch training method, divides the training samples into several batches, inputs the model for training, and simultaneously adopts an equal sampling method for each batch, so that each type of load in each batch has the same number.
[0061] Further, the interpretable analysis method is a gradient-weighted class activation mapping (GradCAM++) method, which is used to calculate the importance of each feature according to the gradient of the target output relative to the input feature, and the calculation formula is:
[0062]
[0063]
[0064]
[0065] wherein, is the feature value of the i-th row and the j-th column of the sample feature matrix, k is the channel number of the feature matrix, Y c represents the output probability of the model identifying the sample as the c-th class, is the weight of the feature value.
[0066] Further, the analysis result is combined with the preset prior knowledge to guide the feature optimization model, which includes:
[0067] An initial feature weight matrix is constructed by using the preset prior knowledge, and a total feature weight matrix is obtained by weighted averaging the feature importance matrix generated by the interpretable method in each training;
[0068] The weight matrix is multiplied by the features of each load sample by elements, that is, the features are weighted according to the model explanation result, and then enhanced features required by the model identification are generated;
[0069] With the training, the weight of the initial matrix is continuously attenuated, the weight of the interpretable matrix generated by the model is increased, and a self-optimization process of the input feature is gradually formed; the calculation formula of the weight matrix is:
[0070]
[0071] wherein, n is the training number, I is a matrix with all element values being 1, w is a feature enhancement factor, γ is a weight attenuation factor, M0 is an initial weight matrix, is the feature importance matrix generated by the n-1th training, and is the average value of the feature importance matrix of the training set samples.
[0072] Further, the analysis result is combined with expert prior knowledge to guide the model optimization method, specifically: a same amount of samples are randomly extracted from each type of the verification set, the expert verification method is used to judge whether the feature importance result is consistent with the prior knowledge, and the ratio of the sample quantity meeting the prior knowledge to the verification sample quantity is taken as the explainable rate, and the average of the explainable rate and the verification set accuracy is taken as an evaluation index to optimize the model.
[0073] Further, the load identification method further includes the following steps:
[0074] The obtained importance matrix of the VI trajectory image features is displayed in the form of a heat map, and the obtained importance matrix of the long-term features is displayed in the form of an index importance order diagram, so as to judge whether the identification basis of the feature fusion and load identification model is consistent with the preset knowledge, and to ensure the reliability of the model identification.
[0075] Another technical solution adopted by the present application is:
[0076] A load identification device based on feature fusion and explainable enhancement, comprising:
[0077] At least one processor;
[0078] At least one memory for storing at least one program;
[0079] When the at least one program is executed by the at least one processor, the at least one processor implements the method as described above.
[0080] Another technical solution adopted by the present application is:
[0081] A computer readable storage medium, wherein a processor executable program is stored, the processor executable program is used to execute the method as described above when executed by a processor.
[0082] The present application has the following advantages: the present application extracts key features reflecting the load circuit structure and operation mode from long-term and short-term time scales by collecting high and low frequency electrical data of the load, and uses feature fusion and load identification model to mine deep features of the load, to realize sufficient and efficient fusion between multi-scale features and similar sample features; in addition, the key input features are enhanced combined with expert knowledge to guide model optimization, to improve the robustness, generalization and reliability of model identification. BRIEF DESCRIPTION OF DRAWINGS
[0083] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following introduces the drawings of the related technical solutions in the embodiments of the present application or the prior art. It should be understood that the drawings in the following introduction are only for facilitating the clear description of part of the embodiments of the technical solutions of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the premise of the drawings.
[0084] Figure 1 is a step flow chart of a load identification method based on feature fusion and interpretable enhancement in an embodiment of the present application;
[0085] Figure 2 is a network structure diagram of a feature fusion and load identification model in an embodiment of the present application;
[0086] Figure 3 is a specific implementation schematic diagram of a network model of a feature fusion and load identification module in an embodiment of the present application;
[0087] Figure 4 is a notebook computer sample long-term and short-term feature importance matrix visualization result diagram output by an interpretable interaction enhancement module in an embodiment of the present application;
[0088] Figure 5 is a structural block diagram of a load identification system based on feature fusion and interpretable enhancement in an embodiment of the present application. DETAILED DESCRIPTION
[0089] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the drawings, wherein the same or similar notations represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application. For the step numbers in the following embodiments, they are only set for facilitating the description and explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0090] In the description of the present application, it should be understood that the orientation description, such as the orientation or position relationship indicated by up, down, front, back, left, right, etc. is based on the orientation or position relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation of the present application.
[0091] In the description of the present application, the meaning of one or more is one or more, the meaning of multiple is two or more, greater than, less than, more than, etc. are understood as not including the number, above, below, within, etc. are understood as including the number. If it is described as first, second, it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the sequence of indicated technical features.
[0092] In addition, in the description of the present application, unless otherwise specified, "a plurality of" means two or more. The association relationship of the associated objects described by "and / or" indicates that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship.
[0093] In the description of the present application, unless otherwise explicitly limited, the words such as setting, installing, connecting, etc. should be broadly understood, and those skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical solution.
[0094] In order to solve the problems of the prior art, the present application provides a load identification method based on feature fusion and explainable enhancement, which collects high-frequency voltage and current data and low-frequency active and reactive power data of the load, extracts short-term color VI trajectory features and long-term load startup and running feature indicators, uses a double-tower structure feature extraction network to further mine deep load features, uses a feature fusion network combining self-attention and cross-attention and a metric learning training method to realize sufficient and efficient fusion of features between multi-scale features and similar sample features, and uses a GradCAM++ explainable method to visualize feature importance, combines expert knowledge to enhance key input features, guides model optimization, and improves the robustness, generalization and reliability of model identification.
[0095] Embodiment one
[0096] As shown in Figure 1 The present embodiment provides a load identification method based on feature fusion and explainable enhancement, comprising the following steps:
[0097] S1, collecting high-frequency voltage and current signals and low-frequency active power and reactive power signals after the load is connected.
[0098] In order to obtain accurate load waveform trajectory, reduce the influence of noise and voltage fluctuation on short-term feature extraction result, the sampling frequency of high-frequency voltage and current signal should be greater than 6.4 kHz, and the sampling time should be greater than 10 power frequency cycles; in order to obtain sufficient transient characteristics reflecting load starting time and trend and fluctuation characteristics during operation, the sampling frequency of low-frequency active power and reactive power signal should be greater than 0.1 Hz, and the sampling time should be greater than 5 min.
[0099] In the embodiment, the high-frequency sampling frequency is 6.4 kHz, the sampling time is 10 power frequency cycles, the low-frequency sampling frequency is 1 Hz, and the sampling time is 10 min.
[0100] S2, according to the short-term features extracted from the collected load high-frequency waveform, and according to the long-term features obtained from the load low-frequency power data.
[0101] The short-term features of the collected load high-frequency waveform are extracted, which are three-channel color VI trajectory images. The specific construction method of VI trajectory features of each load data is as follows:
[0102] 1) for the n-cycle voltage and current waveform data U1, U2,…U n and I1, I2,…I n extracted by the load, respectively, perform per-unit processing:
[0103]
[0104]
[0105] In the formula, Uk(t), Ik(t) are the kth voltage and current cycle sequences before per-unit processing; Uk(t), Ik(t) are the kth voltage and current cycle sequences after per-unit processing; U k (t), I k (t) are the kth voltage and current cycle sequences before per-unit processing; U max ,I max is the maximum value of voltage and current in a cycle.
[0106] 2) VI trajectory image features are constructed by using the per-unit voltage and current waveform sequences.
[0107] In the embodiment, 3-channel VI trajectory image features are extracted from the collected load high-frequency waveform, and the image feature resolution is set to 32x32. The maximum value, minimum value, average value and variance of the start peak, start time, active power, reactive power, power factor, active power duty ratio, load running time, active power peak number, modulus maximum value, root mean square value, modulus average value, and standard deviation of long-term features of the wavelet transform detail coefficient and approximation coefficient of the active power are calculated and generated. Among them, the wavelet basis function selects db3 wavelet, and the wavelet decomposition layer is set to 1 layer, and a total of 25 long-term features are extracted.
[0108] S3, according to the long-term feature and the short-term feature, a load feature data set is constructed, and a training set, a verification set and a test set are obtained according to the load feature data set; the training set is input into the feature fusion and load identification model for deep feature extraction, fusion and load classification, and the classification result is output; wherein the training is carried out in the form of metric learning.
[0109] In the embodiment, the long-term and short-term features generated by each load data are used to construct a load feature data set, and the data set samples are divided into a training set, a verification set and a test set according to 3:1:1. The training set is input into the feature fusion and load identification model for deep feature extraction, fusion and load classification, and the training is carried out in the form of metric learning.
[0110] Referring to Figure 2 , the feature fusion and load identification model includes a deep feature extraction network, a feature fusion network and a classification network. The deep feature extraction network adopts a double-tower neural network structure, one branch of which adopts a convolutional neural network to extract deep features of VI trajectory, and the other branch adopts a BP neural network to extract deep features of long-term tabular features. The feature fusion network adopts the structure of "batch self-attention layer-batch cross-attention layer-self-attention layer", and performs fusion between similar samples and between long-term and short-term features respectively. Among them, the first self-attention layer and the cross-attention layer adopt batch attention to realize fusion at the sample level, and the second self-attention layer realizes fusion at the feature space level. The classification network adopts a full connection network form to output the final load identification result.
[0111] In the embodiment, the model structure of the feature fusion and load identification module is as follows Figure 3The deep feature extraction network is a double-tower structure, one branch is stacked in the form of "full connection layer-relu layer-Dropout layer", and the other branch is stacked in the form of "convolutional layer-batch normalization layer-activation layer-pooling layer" and spliced with a full connection layer; the feature fusion network is formed in the form of "batch self-attention layer-batch cross-attention layer-self-attention layer"; and the load classification network is composed of three full connection layers. The numbers in the brackets of the full connection layer in the figure represent the input feature length and the output feature length, the numbers in the brackets of the convolutional layer represent the convolution kernel size and the convolution step size respectively, the numbers in the brackets of the pooling layer represent the pooling kernel size and the pooling step size, the numbers in the brackets of the attention layer represent the number of attention heads and the number of hidden layer neurons, and the numbers in the brackets of the dropout layer represent the probability of discarding each neuron connection. In this embodiment, the batchsize of the training process is set to 128, the optimizer is Adam, and the learning rate is 0.001. The classification loss function loss1 adopts a cross-entropy loss function, and its calculation formula is:
[0112]
[0113] In the formula, N is the number of samples in a batch, M is the number of sample categories, y ic is a symbol function, which takes 1 if the predicted category of sample i is the same as the true category, otherwise 0, and p ic is the probability that sample i belongs to category c. In the model testing process, for each sample in the test set, an equal number of 8 samples are randomly selected from each type of load in the training set by using the equal sampling method, and the test sample is input into the model together with the selected samples, to assist the model in identifying the test sample.
[0114] S4, an interpretable analysis method is used to analyze the classification result, and the analysis result is combined with preset prior knowledge to guide the feature optimization model, so as to complete the training of the feature fusion and load identification model.
[0115] The interpretable analysis method is a gradient-weighted class activation mapping (GradCAM++) method, which can calculate the importance of each feature according to the gradient of the target output with respect to the input feature, and its calculation formula is:
[0116]
[0117]
[0118]
[0119] In the formula, N is the number of samples in a batch, M is the number of sample categories, y is the eigenvalue of the sample feature matrix in the i-th row and the j-th column, k is the number of channels of the feature matrix, Y c is the output probability of the model identifying the sample as the c-th class, is the weight of the eigenvalue. The method of combining the analysis results with expert prior knowledge to guide the feature enhancement method refers to constructing an initial feature weight matrix using the prior knowledge of professionals, and performing weighted averaging on the feature importance matrix generated by the interpretable method each time to obtain a total feature weight matrix. The weight matrix is multiplied by the features of each load sample by elements, that is, the features are weighted according to the model explanation result, and then enhanced features required by the model identification are generated. With the training, the weight of the initial matrix decays, and the weight of the interpretable matrix generated by the model increases, gradually forming a process of self-optimization of input features. The calculation formula of the weight matrix is:
[0120]
[0121] wherein n is the number of training times, I is a matrix with all element values being 1, w is a feature enhancement factor, γ is a weight decay factor, M0 is an initial weight matrix, is the feature importance matrix generated by the n-1 training, and is the average value of the feature importance matrix of the training set samples. The method of combining the analysis results with expert prior knowledge to guide the model optimization method specifically refers to randomly extracting an equal number of samples from each type of the validation set, using the expert verification method to judge whether the feature importance result is consistent with the prior knowledge, and taking the ratio of the number of samples meeting the prior knowledge to the number of validation samples as the interpretable rate. The average of the validation set accuracy is taken as an evaluation index to optimize the model.
[0122] In this embodiment, the analysis results are combined with expert prior knowledge to guide feature enhancement and model optimization, and the training of the feature fusion and load identification module is completed. Finally, the feature utilization and fusion effect of the model is verified, and a closed loop of human-computer interpretable interaction is realized. Among them, the feature enhancement factor w in the feature weight matrix is set to 0.1, and the weight decay factor γ is set to 0.9.
[0123] S5, acquiring a load to be identified, extracting features of the load to be identified, inputting the extracted features into the trained feature fusion and load identification model, and outputting a classification result.
[0124] Example Two
[0125] This embodiment provides a verification test of a load identification method based on feature fusion and interpretable enhancement, which illustrates the effect of the above method.
[0126] This embodiment is based on the parameter setting and model structure in Example One, takes a data set containing 8 types of common loads such as hot water kettle, electric hair dryer, etc. as the object, takes long-term feature + bagging, VI trajectory feature + LeNet-5, long-short term feature + BP three commonly used features and methods as the control group, verifies the recognition accuracy of the algorithm of the present application according to the data set division ratio in Example 1, and the specific results are shown in Table 1.
[0127] Table 1
[0128]
[0129] From the experimental results, it can be seen that the multi-scale feature recognition method of the present application has better recognition performance than the current single-scale feature recognition method, and compared with other feature fusion models, the model of the present embodiment also achieves higher recognition accuracy, proving that the method of the present application has better robustness and can better learn and utilize multi-scale features to realize load classification.
[0130] This embodiment is based on the parameter setting and model structure in Example One, takes a data set containing 8 types of common loads such as hot water kettle, electric hair dryer, etc. as the object, takes long-term feature + bagging, VI trajectory feature + LeNet-5, long-short term feature + BP three commonly used features and methods as the control group, verifies the recognition accuracy of the algorithm of the present application according to the data set division ratio in Example 1, and the specific results are shown in Table 1.
[0131] Table 2
[0132]
[0133] From the experimental results, it can be seen that the multi-scale feature fusion and explainable enhancement combined recognition method of the present application has further improved the generalization recognition ability compared with other recognition methods. Compared with the long-term feature recognition method based on bagging and the short-term feature recognition method based on VI trajectory feature, the generalization recognition accuracy of the present application is improved by more than 5%, fully proving that the recognition model of the present application has better generalization performance.
[0134] Example Three
[0135] This embodiment provides a reliability verification test of a load recognition method based on feature fusion and explainable enhancement, which illustrates the effect of the method of the present application by visualizing the utilization of each feature in the model recognition process.
[0136] This invention is based on the parameter settings and model structure in Example 1 and the feature fusion and load identification module trained in Example 2. It visualizes the utilization of long-term and short-term features of a laptop sample by the identification model. The visualization results are as follows: Figure 4 As shown.
[0137] Depend on Figure 4 It is evident that, in the short term, the model in this paper can not only fully capture the VI trajectory curve but also focus on the differences between the VI trajectory and other types of loads. In the long term, the model's identification relies on two main factors: firstly, reactive power and power factor, which fully reflect the characteristics of power electronic loads; and secondly, active power variance, wavelet coefficients, and peak count, which reflect the differences in operational fluctuation characteristics between laptops and other electronic loads. The model's identification criteria are consistent with expert prior knowledge, verifying the reliability of the identification method.
[0138] This invention addresses the problem that existing load identification methods often focus on single-scale features of long-term or short-term loads, resulting in insufficient feature representation capabilities and limiting model recognition accuracy and generalization performance. It proposes a multi-scale feature fusion and interpretable enhancement load identification system and method. The system extracts long-term and short-term features from load sampling data, constructs a dual-tower deep feature extraction network to efficiently mine deep features at various scales using different branches of the network, and designs a feature fusion network combining self-attention and cross-attention to achieve the fusion of long-term and short-term load features, improving the model's utilization of features. A metric learning training method is employed to narrow the feature distance between similar samples, improving the efficiency and effectiveness of feature fusion. The GradCAM++ interpretable analysis method is used to quantify the importance of features, enabling adaptive feature enhancement and model tuning combined with expert interaction.
[0139] Example 4
[0140] like Figure 5 As shown, this embodiment also provides a load identification system based on feature fusion and interpretable enhancement, including a load data acquisition module, a multi-scale feature extraction module, a feature fusion and load identification module, and an interpretable interactive enhancement module;
[0141] The load data acquisition module is used to acquire high-frequency voltage and current signals and low-frequency active and reactive power signals after the load is connected.
[0142] The multi-scale feature extraction module is used to extract short-term features from the collected high-frequency load waveforms and to calculate and generate long-term features from the low-frequency load power data.
[0143] The long-term and short-term features generated by the load data are used to construct a load feature data set, and the data set samples are proportionally divided into a training set, a validation set and a test set, and then input into the feature fusion and load identification module for deep feature extraction, fusion and load classification, and the training is performed in the form of metric learning;
[0144] The identified results are analyzed by using the interpretable interaction enhancement module, the analysis results are combined with expert prior knowledge to guide feature enhancement and model optimization, the training of the feature fusion and load identification module is completed, and finally the feature utilization and fusion effect of the model is verified to realize the closed loop of human-computer interpretable interaction.
[0145] The load identification system based on feature fusion and interpretable enhancement provided in the embodiment can execute the load identification method based on feature fusion and interpretable enhancement provided in the method embodiment, can execute any combination of the steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.
[0146] The embodiment also provides a load identification device based on feature fusion and interpretable enhancement, which comprises:
[0147] At least one processor;
[0148] At least one memory for storing at least one program;
[0149] When the at least one program is executed by the at least one processor, the at least one processor implements the method as shown in Figure 1 .
[0150] The load identification device based on feature fusion and interpretable enhancement provided in the embodiment can execute the load identification method based on feature fusion and interpretable enhancement provided in the method embodiment, can execute any combination of the steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.
[0151] The embodiment of the application also discloses a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method as shown in Figure 1 .
[0152] The embodiment also provides a storage medium storing instructions or programs executable for the load identification method based on feature fusion and interpretable enhancement provided in the method embodiment, and when the instructions or programs are executed, any combination of the steps of the method embodiment can be executed, and the corresponding functions and beneficial effects of the method are possessed.
[0153] In some alternative embodiments, the function / operations mentioned in the block diagrams can not occur in the order mentioned in the operational illustrations. For example, two blocks shown in succession can in fact be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality / operations involved. Also, embodiments presented and described in the flow diagrams are only examples. Alternative embodiments are possible and contemplated. For example, the order of operations can differ from that which is described. Further, not all of the operations illustrated in the flow diagrams can be required for a novel method. In addition, those skilled in the art will appreciate that one or more operations illustrated in the flow diagrams can suitably be performed in a different order and / or concurrently with other operations. Alternatively, one or more operations can be performed at different times than illustrated in the flow diagrams.
[0154] Further, while the present application has been described in the context of functional modules, it is to be understood that one or more of the functions and / or features described can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It will also be appreciated that detailed discussion of the actual implementation of each module is not necessary to an understanding of the application. Rather, the actual implementation of the modules, in combination with their attributes, functions, and internal relationships, are to be understood within the context of the devices disclosed herein. Thus, those skilled in the art, having the benefit of the present description, will appreciate the manner in which the modules are implemented within the context of the devices disclosed herein. Accordingly, the present application is not limited to the embodiments illustrated in the figures. Rather, the scope of the present application is to be determined by the entire scope of the claims and their equivalents.
[0155] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0156] The logic and / or steps represented in the flow diagrams or otherwise described herein, for example, can be embodied in non-transitory computer- readable media, executed by an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions, or in conjunction with which the instructions can be executed. In the context of this specification, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium.
[0157] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and stored in a computer memory.
[0158] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, known in the art, or combinations thereof, can be used: a discrete logic circuit having logic gates for implementing logic functions upon data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), and / or the like.
[0159] In the above description of the present specification, reference is made to the description of terms such as "one embodiment / one example", "another embodiment / another example", or "certain embodiments / certain examples" and the like, which means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. The illustrative appearances of the above-mentioned terms in the description are not necessarily referred to the same embodiment or example throughout the specification. Moreover, the particular features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0160] While the embodiments of the application have been shown and described, it is to be understood that the embodiments described are merely exemplary and are not to be construed as limiting the scope of the application. The scope of the application is defined by the appended claims and their equivalents.
[0161] The above is the specific description of the preferred embodiment of the application, but the application is not limited to the above-mentioned embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the application.
Claims
1. A load identification method based on feature fusion and interpretable enhancement, characterized in that, Includes the following steps: Collect high-frequency voltage and current signals and low-frequency active and reactive power signals after the load is connected; Short-term features are extracted from the high-frequency waveform of the load, and long-term features are obtained from the low-frequency power data of the load. A load feature dataset is constructed based on long-term and short-term characteristics, and a training set, validation set, and test set are obtained based on the load feature dataset. The training set input features are fused with the load identification model to perform deep feature extraction, fusion, and load classification, and the classification results are output; metric learning is used for training. Interpretable analysis methods are used to analyze the classification results, and the analysis results are combined with pre-set prior knowledge to guide the feature optimization model, so as to complete the training of the feature fusion and load identification model. The system acquires the load to be identified, extracts features from the load, inputs the extracted features into the trained feature fusion model, and outputs the classification result. The short-term feature is the VI trajectory image feature. The extraction of short-term features based on the acquired high-frequency load waveform includes: For the voltage and current waveform data U1, U2, ... U2 of n cycles extracted from the load n and I1,I2,…I n Each of them is then normalized: In the formula, This represents the k-th voltage and current cycle sequence after standardization; U k I k This is the k-th voltage and current cycle sequence before standardization; This represents the maximum values of voltage and current within the k-th cycle; VI trajectory image features are constructed using the normalized voltage and current waveform sequences; The VI trajectory image features are divided into three channels: R, G, and B. The filling method for each channel is as follows: construct an m×m zero matrix M with resolution m, multiply the normalized voltage and current by resolution m and round to the nearest integer, and fill the corresponding positions of matrix M with current values as rows and voltage values as columns. The fill value for the R channel is the instantaneous power normalized to the waveform amplitude, calculated using the following formula: In the formula, R mn Let P be the power value at the m-th row and n-th column of matrix M, where N is the number of sampling points at that position in the matrix. i Let P be the instantaneous power at the i-th sampling point. max ,P min The maximum and minimum instantaneous power values within one cycle; The fill value for channel G is the instantaneous power normalized to the load level; The fill value for channel B is the ratio of the voltage to the rate of change of current, calculated using the following formula: Combining the R, G, and B channel matrices forms the three-channel color VI trajectory image matrix C corresponding to that cycle. k To reduce distortion of the VI trajectory caused by sampling noise or power grid fluctuations in a single cycle, the average of the VI trajectory image matrices generated from the sampled n cycles is used as the final VI trajectory image feature C, i.e.: Where n is the number of periods.
2. The load identification method based on feature fusion and interpretable enhancement according to claim 1, characterized in that, The long-term characteristics include the load's startup characteristics and operating characteristics; Among them, the startup characteristics include the startup spike P T-spike and startup time T start Start peak P T-spike The maximum active power of the load during startup is given by the startup time T. start The time taken for the load to go from startup to stable operation; Operating characteristics include the maximum value P of the active power curve, reactive power curve, and power factor curve during load operation. max Q max , Minimum value P min Q min , Average P mean Q mean , and variance P var Q var , Active power duty cycle D, load running time T on Number of active power spikes N spike The modulus maxima cd of the wavelet transform detail coefficients and approximation coefficients of active power nmax ,ca nmax Root mean square value cd nrms ,ca nrms , modulus average cd nmean ,ca nmean Standard deviation cd nstd ,ca nstd feature.
3. The load identification method based on feature fusion and interpretable enhancement according to claim 1, characterized in that, The feature fusion and load identification model includes a deep feature extraction network, a feature fusion network, and a classification network; The deep feature extraction network adopts a dual-tower neural network structure, with one branch using a convolutional neural network to extract deep features of the VI trajectory and the other branch using a backpropagation neural network to extract deep features of long-term tabular features. The feature fusion network adopts a structure of batch self-attention layer-batch cross-attention layer-self-attention layer, fusing features between similar samples and between long-term and short-term features, respectively. Specifically, the first self-attention layer and cross-attention layer achieve fusion at the sample level using batch attention, while the second self-attention layer achieves fusion at the feature space level. The expression for the attention network is: In the formula, Q, K, and V refer to the query matrix, index matrix, and value matrix, respectively, and d k Indicates the feature dimension; The classification network is a fully connected network used to output the final load classification results.
4. The load identification method based on feature fusion and interpretable enhancement according to claim 1, characterized in that, The load identification method further includes the following steps: The importance matrix of the obtained VI trajectory image features is displayed in the form of a heatmap, and the importance matrix of the obtained long-term features is displayed in the form of an indicator importance ranking chart, so as to determine whether the identification basis of the feature fusion and load identification model is consistent with the preset knowledge.
5. A load identification device based on feature fusion and interpretable enhancement, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method of any one of claims 1-4.
Citation Information
Patent Citations
Machine learning model training method and system for power load identification
CN111242391A
Load identification system and method based on small sample learning
CN114611629A