Two-stage non-intrusive load detection method for unknown aliasing scene

Through the two-stage non-invasive load detection method, the general noise reduction model and the robust recognition model are used, combined with feature masking and non-local residual shrinkage modules, the problem of insufficient load monitoring accuracy and robustness in unknown aliasing scenarios is solved. , realizes efficient load identification and is suitable for edge deployment.

CN119202938AActive Publication Date: 2024-12-27SOUTH CHINA UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411199440.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-27
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

Existing event-based load monitoring methods are difficult to effectively reduce distortion waveform noise in unknown aliasing scenarios, resulting in a decrease in recognition accuracy and insufficient robustness, which affects the promotion and application of non-invasive load monitoring technology.

Method used

A two-stage non-invasive load detection method is proposed. By building a lightweight general noise reduction model and a robust recognition model, using feature masking and non-local residual shrinkage modules, combining the enhanced training set and the perturbation data set, the unknown is achieved. High recognition accuracy and robust performance in aliasing scenarios.

Benefits of technology

The robustness and accuracy of the load recognition model is significantly improved in unknown aliasing scenarios. It is suitable for edge deployment and can effectively reduce distorted waveform noise. It does not require training for distorted waveforms in the target scenario to achieve robust recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202938A_ABST
    Figure CN119202938A_ABST
Patent Text Reader

Abstract

The invention discloses a two-stage non-intrusive load detection method for an unknown aliasing scene, and the method comprises the steps: constructing a lightweight general noise reduction model based on feature masking, and constructing a lightweight robust recognition model based on a non-local residual shrinkage module, and enabling the lightweight general noise reduction model and the lightweight robust recognition model to be used for extracting and recognizing the features of a key electric appliance; an enhanced training set is constructed by adding random noise, and two models are trained through a mean square error and a cross entropy loss function respectively. In the test stage, the trained model is adopted to carry out two-stage robust recognition on a target electric appliance in an unknown aliasing scene, in the first stage, the trained general noise reduction module is adopted to carry out noise reduction processing on waveforms, and in the second stage, the trained general noise reduction module is adopted to carry out noise reduction processing on the waveforms. And performing key feature identification on the aliasing decomposition waveform of the target electric appliance after noise reduction by using the trained robust identification model to obtain a prediction label of the target electric appliance. According to the design of the invention, both lightweight and robustness are considered, the method is suitable for edge deployment, and the performance of load detection in a complex environment is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of non-intrusive universal load detection, and in particular to a two-stage non-intrusive load detection method for unknown aliasing scenarios. Background Art

[0002] Smart grids provide innovative solutions for power efficiency and reliability on the load side by integrating advanced measurement, communication and control technologies. In recent years, non-intrusive load monitoring (NILM) technology has become a key bridge connecting smart grids and the user side, and its importance in the field of intelligent perception on the user side is increasing. NILM technology has been applied in many fields, such as energy management and prevention of electrical accidents. Although NILM technology has made certain progress, the existing event-based load monitoring methods often ignore the influence of factors such as voltage fluctuations, line losses, and changes in load impedance characteristics during waveform extraction. This neglect may cause the extracted waveforms to have diverse and unpredictable distortions, thereby significantly reducing the performance of the load identification model. In particular, the performance of the model is particularly poor in the face of unknown aliasing scenarios. Therefore, how to improve the robustness of the model in unknown aliasing scenarios has become a key challenge for the large-scale promotion and application of non-intrusive load identification technology.

[0003] At present, the research on event-based load identification mainly focuses on the development of event detection and identification algorithms. Event detection research is committed to capturing event mutation points more accurately, while identification algorithm research focuses on improving the recognition accuracy of the algorithm. However, most existing studies are based only on relatively pure single data sets, which may lead to overly optimistic estimates of load identification results. These single data sets are usually sample waveforms collected when a single appliance is running independently. Although some studies have considered the sampling noise in the original waveform and adopted simple measures such as Gaussian sequence convolution, mean filter, high brightness coding, and adjustment of model parameters to reduce noise interference, these methods are often not robust enough when dealing with decomposed waveforms in aliasing scenarios. In practical applications, researchers are usually unable to pre-collect all possible decomposed distorted waveforms in aliasing scenarios, which does not conform to the assumption of independent and identically distributed data in machine learning, which may lead to a significant decrease in recognition accuracy. Therefore, studying how to effectively reduce the noise of distorted waveforms and enhance the robustness of identification models in unknown aliasing scenarios is of vital significance for the large-scale promotion and application of non-intrusive load monitoring technology. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and propose a two-stage non-intrusive load detection method for unknown aliasing scenarios, which can maintain a high recognition accuracy of the target electrical appliance in unknown aliasing scenarios and improve the robust performance of different methods in unknown aliasing scenarios. Its lightweight design makes it suitable for edge deployment.

[0005] To achieve the above object, the technical solution provided by the present invention is: a two-stage non-intrusive load detection method for unknown aliasing scenarios, comprising the following steps:

[0006] Step 1: Based on feature masking, a lightweight universal denoising model is constructed to denoise the waveform of the target electrical appliance in the unknown aliasing scene to obtain a more recognizable waveform of the target electrical appliance; based on the non-local residual shrinkage module, a lightweight robust recognition model is constructed to extract the key features of the waveform of the target electrical appliance after denoising, so as to perform robust recognition; the voltage and current data of each electrical appliance in the target scene running separately are obtained to establish a single data set;

[0007] Step 2: construct a perturbation dataset by adding random noise interference of a specified signal-to-noise ratio to the single dataset obtained in step 1, and merge the single dataset and the perturbation dataset into an enhanced training set;

[0008] Step 3: Use the enhanced training set constructed in step 2 to train the general denoising model and the robust recognition model constructed in step 1 respectively, where the general denoising model is trained using the mean square error loss function, and the robust recognition model is trained using the cross entropy loss function;

[0009] Step 4: In the testing phase, the model trained in step 3 is used to perform two-stage robust recognition on the aliasing decomposition waveform of the target appliance in the unknown aliasing scenario. In the first stage, the waveform is denoised using the trained general denoising module. In the second stage, the trained robust recognition model is used to perform key feature recognition on the aliasing decomposition waveform of the target appliance after denoising to obtain the predicted label of the target appliance.

[0010] Further, in step 1, the general noise reduction model includes an encoder, a feature masking module, a decoder and a gain module, and the details are as follows:

[0011] a. The encoder consists of a one-dimensional convolution and a ReLU activation function, which is used to map the input waveform features to a high-dimensional feature space. The input of the encoder is a single-cycle current waveform of the appliance. Before input, the current cycle needs to be standardized based on the variance and mean of each current cycle as follows:

[0012]

[0013] In the formula, xi represents the current at the i-th current sampling point; N is the total number of sampling points of the current cycle; μ is the current mean of a cycle; v is the standard deviation of the cycle; x i ′ is the current sampling point after standardization;

[0014] b. The feature masking module first performs component analysis on the high-dimensional features of the above encoder through a non-local residual shrinkage module, which includes a residual network, soft thresholding, and an adaptive threshold network. The details are as follows:

[0015] b1. Residual network: It consists of two identical one-dimensional convolutions and cross-layer identity paths. Batch normalization is used between each one-dimensional convolution to speed up training and prevent the model from falling into overfitting.

[0016] b2. Soft thresholding: First, a positive threshold τ needs to be set. Then the soft threshold function will set the load features with absolute values ​​lower than the positive threshold τ to zero, and the load features with absolute values ​​greater than the positive threshold τ will also shrink towards zero, thereby achieving the distinction between different component features. The relationship between the input x and the output y is shown in the following formula:

[0017]

[0018]

[0019] b3. Adaptive threshold network: The input of this network is the output feature vector of the second one-dimensional convolution in the above residual network. First, the feature vector s(n) with spatial attention characteristics is calculated through the spatial attention module. The calculation process is shown in the following formula, where n represents the input feature vector with a dimension of C×L in the real number field R, where C is the number of channels and L is the length of each cycle; the spatial attention module further extracts features through one-dimensional convolution and compresses it in the channel dimension to generate a one-dimensional feature vector with a length of L. Then, the one-dimensional feature vector is formed into an attention vector through the Softmax function to strengthen the correlation between positions. The attention vector is multiplied by the output of the one-dimensional convolution to provide input for the channel attention mechanism and optimize the effectiveness of the threshold evaluation;

[0020] s(n)=Softmax(GAP(Transpose(Conv(n))))×Conv(n), n∈R C×L

[0021] In the formula, Transpose represents the transposition operation of the vector; GAP represents global average pooling; Conv represents the one-dimensional convolution, which performs absolute value processing and global average pooling on the feature channels of the output s(n) of the spatial attention module through the channel attention mechanism to form an attention vector s'(n) with channel attention characteristics. The dimension of this vector is C×1; then, adaptive threshold learning is performed through two linear layers. The two linear layers are first batch normalized and then activated by the ReLu function; then a set of coefficients n between 0 and 1 is generated for each channel through the Softmax activation function. c ; Finally, using the above obtained s(n) and n c , the threshold τ for each channel used for soft thresholding c It can be obtained by the following formula:

[0022] τ c =|s(n)|×n c

[0023] In the formula, |s(n)| represents the absolute value of the output vector s(n) of the spatial attention. After the threshold calculation is completed, the feature vector output by the second one-dimensional convolution in the above residual network is soft-thresholded by channel to obtain the processed feature vector, which is added to the input vector mapped by the identity mapping path in the residual network to obtain the output vector x of the non-local residual contraction module. t ;

[0024] Subsequently, the output of the non-local residual shrinkage module is passed through a gating unit to obtain a characteristic masking vector of the current waveform; wherein the gating unit is designed as follows:

[0025] y t =ReLu(tanh(x t )⊙σ(x t ))

[0026] Where ⊙ represents element-wise multiplication; y t represents the masking vector output by the gated unit, and σ represents the Sigmoid activation function; the feature masking vector is then multiplied element-by-element with the high-dimensional features output by the encoder to extract the noise feature component;

[0027] c. The decoder reconstructs the noise waveform of the noise feature component output by the feature masking module through one-dimensional convolution, and extracts the clean waveform by subtracting the noise waveform from the input current waveform;

[0028] d. The gain module reconstructs the global information of the extracted clean waveform through the left and right branch linear layers; the right branch linear layer is a 1×1 linear layer, which uses global average pooling to obtain the overall amplitude information of the waveform, and then calculates the overall amplitude gain of the waveform, and then multiplies the gain by the output of the left branch linear layer to reduce the overall amplitude error of the waveform. The left branch linear layer is a 150×150 linear layer.

[0029] Furthermore, in step 1, the input of the robust recognition model is a single current cycle, and the length of each cycle is L. The robust recognition model first extracts the high-dimensional features of the current cycle through a one-dimensional convolution, and then extracts the key features by stacking three non-local residual shrinkage modules with the same structure. The relationship between these three non-local residual shrinkage modules is a series relationship. Finally, a classification module is constructed using two series-connected linear layers. Nonlinearity is introduced between the two series-connected linear layers through a ReLu activation function, and the output dimension of the last linear layer is the number of electrical appliance types M.

[0030] Furthermore, in step 1, the current and voltage data of each electrical appliance in the target scene are collected individually, with a sampling frequency of f, and the sampled data are annotated with artificial electrical appliance labels. To establish a single data set, the above sampled data are uniformly resampled to the specified sampling frequency f. s , the resampling method is Lagrange polynomial interpolation, and the calculation process is as follows:

[0031] First, construct the interpolation polynomial P(e) using the Lagrange basis polynomial:

[0032]

[0033] Where, L u (e) is the u-th Lagrange basis polynomial; e represents the position of the interpolation sampling point of the current cycle; y u It corresponds to the current sampling value at the uth position; l is the number of sampling points of the current cycle to be resampled;

[0034] Resampling: Calculate the value of the interpolation polynomial at the new sampling point and resample the data to the specified current sampling length L;

[0035] Through the above resampling processing of the sampled data, the current cycles of different electrical appliances with the same number of sampling points when they are running separately can be obtained, and the resampled cycles of each electrical appliance are merged to establish a single data set.

[0036] Furthermore, in step 2, the disturbance data set is constructed by adding two kinds of random noises to the current cycle: Gaussian noise and random walk noise. The specific calculation process of the disturbance data set is as follows:

[0037] Signal-to-noise ratio: refers to the logarithm of the ratio of signal power to noise power, as shown in the following formula:

[0038]

[0039] Where P signal and P noise Represents signal power and noise power respectively; SNR dB is the signal-to-noise ratio of the signal; the bus data obtained by the smart meter is discrete, and the power of the signal can be directly calculated. Here, a current signal of one cycle is assumed to be I = {i1′, i2′, …, i L ′},i L ′ represents the Lth current sampling point, then the current signal power P of one cycle can be calculated signal for:

[0040]

[0041] In the formula, i k It represents the current value of the kth sampling point in I. The signal power here is not the same as the active power of traditional electrical appliances. After obtaining the current signal power, the noise signal power P can be calculated by the following formula: noise :

[0042]

[0043] In the formula, SNR is the specified signal-to-noise ratio, that is, the signal-to-noise ratio of the sample after adding noise is SNR; after obtaining the signal power of the noise, it is necessary to generate a random noise sequence with the signal power; in the two noise sequences used, Gaussian noise is a white noise that obeys the normal distribution. In the one-dimensional state, the probability density function of the Gaussian normal distribution is:

[0044]

[0045] Where P(r) represents the value of 2 In this case, the random variable r takes the probability density function of r; assuming that the generated random Gaussian noise sequence is I N_noise , then the random Gaussian noise sequence I′ with a specified noise signal power can be calculated by the following formula N_noise :

[0046]

[0047] For a time series {g t}, if the following conditions are met, the time series is a random walk;

[0048] g t =wt +w t-1 +...w0

[0049] In the formula, w t and w t-1 are the tth and t-1th white noise sequences respectively; w0 is the 0th white noise sequence; for the random walk sequence g t , which is equal to the sum of multiple white noises, that is, random walk is the accumulation of white noise, from which the steps of generating a random walk sequence can be obtained. Given a random initial value g0, each subsequent value g in the random walk sequence t It can be calculated by the following formula:

[0050] g t =g t-1 +w t

[0051] In the formula, g t-1 is the random walk sequence of the t-1th time step; similarly, assuming that the generated random walk noise sequence is I W_noise , then the random walk noise sequence I′ with a specified noise signal power can be calculated by the following formula W_noise :

[0052]

[0053] So far, two random noise sequences with specified noise signal power have been generated. By superimposing the generated random noise sequence on the original monomer waveform, the noisy data after data enhancement can be obtained, and the perturbation data set can be constructed as follows:

[0054]

[0055] In the formula, I noise Represents the constructed perturbation dataset.

[0056] Further, in step 3, the general denoising model is trained using a mean square error loss function MSE, which is defined as follows:

[0057]

[0058] Where D is the number of samples; j d is the true value of the dth sample; is the true value of the dth sample;

[0059] The robust recognition model is trained using the cross-entropy loss function, which is defined as follows:

[0060]

[0061] Where, M is the number of electrical appliances; j d,h is the true label of the d-th sample for the h-th type of electrical appliance; is the predicted probability of the dth sample for the hth type of electrical appliance.

[0062] Further, in step 4, the aliasing scenario refers to a complex power consumption environment in which multiple electrical appliances are running simultaneously. In an unknown aliasing scenario, the newly switched electrical appliance is called the target electrical appliance, and the electrical appliances running on the bus other than the target electrical appliance are called background electrical appliances.

[0063] In the identification stage, the aliasing decomposition current of the target appliance, that is, its branch current, is first obtained by subtracting the bus current before and after the switching event. The aliasing decomposition current can be obtained by the following formula:

[0064]

[0065] In the formula, I Y is the aliasing decomposition current; I s ' um is the total current after the switching event occurs; I sum is the total current before the switching event occurs; after obtaining the aliasing decomposition current of the target appliance in the unknown aliasing scenario, it is first input into the general noise reduction model to obtain the denoised current waveform, and then the denoised current waveform is input into the robust recognition model to identify the type of appliance, thereby obtaining the predicted label of the target appliance.

[0066] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0067] In view of the problem of aliasing decomposition waveform distortion in unknown aliasing scenarios, the present invention proposes a robust recognition model, which aims to improve its robustness by enhancing the model's ability to recognize key features of distorted waveforms. Furthermore, we use perturbed data sets and general denoising models to further improve the robust performance of the model, thereby constructing a two-stage robust load identification method. Specifically, we train the general denoising model and the robust recognition model respectively through the perturbed data set, and during testing, the test data is first passed through the general denoising model and then input into the robust recognition model for identification. The method proposed in the present invention does not need to be trained for the distorted waveform of the target scene, and only the original waveform is required to achieve robust identification in the target scene, which effectively solves the problem of the accuracy of the existing method decreasing when the aliasing decomposition waveform is distorted in unknown aliasing scenarios. In addition, the general denoising model proposed in the present invention is effective for different aliasing scenarios and different load identification methods, and can be used as a pre-denoising model for other methods. In addition, all models of the present invention adopt a lightweight design, which is more suitable for high-frequency recognition edge deployment of NILM. In summary, the present invention provides a new solution to the problem of performance degradation of event-based high-frequency load identification in unknown aliasing scenarios, has practical application value, and is worthy of promotion. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 Flow chart of the method of the present invention.

[0069] Figure 2 This is the structural diagram of the general denoising model.

[0070] Figure 3 It is the structural diagram of the non-local residual shrinkage module.

[0071] Figure 4 Structural diagram of the robust recognition model. DETAILED DESCRIPTION

[0072] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0073] Example 1

[0074] This embodiment discloses a two-stage non-intrusive load detection method for unknown aliasing scenarios. Figure 1 As shown, the following steps are included:

[0075] Step 1: Construct a lightweight general denoising model based on feature masking. The encoder feature masking module is used to denoise the target electrical appliance waveform in the unknown aliasing scene to obtain a more recognizable target electrical appliance waveform. Construct a lightweight robust recognition model based on the non-local residual shrinkage module to extract the key features of the target electrical appliance waveform after denoising, so as to perform robust recognition. Obtain the voltage and current data of each electrical appliance in the target scene running separately to establish a single data set.

[0076] like Figure 2 As shown in FIG. 1 , the general noise reduction model consists of four parts: an encoder, a feature masking module, a decoder and a gain module. The specific introduction of different parts is as follows.

[0077] The encoder consists of a one-dimensional convolution with parameters (1, 16, 3, 1, 1) and a ReLU activation function, which is used to map the input waveform features to a high-dimensional feature space. The meanings of the five parameters are (number of input channels, number of output channels, convolution kernel size, stride, padding size). The input of the encoder is a single cycle current waveform of the appliance. Before input, the current cycle needs to be standardized as follows based on the variance and mean of each current cycle.

[0078]

[0079] Among them, x i represents the current at the i-th current sampling point; N is the total number of sampling points of the current cycle; μ is the current mean of a cycle; v is the standard deviation of the cycle; x i ′ is the current sampling point after standardization

[0080] The feature masking module first performs component analysis on the above high-dimensional features through the non-local residual shrinkage module. Figure 3 As shown in the figure, the non-local residual shrinkage module consists of three parts: residual network, soft thresholding, and adaptive threshold network.

[0081] Residual network: It consists of two identical one-dimensional convolutions and cross-layer identity paths. The parameters of the two one-dimensional convolutions are (16, 16, 3, 1, 1). Batch normalization (BN) is used between each one-dimensional convolution to speed up training and prevent the model from falling into overfitting.

[0082] Soft thresholding: First, you need to set a positive threshold τ. Then the soft threshold function will set the load features with absolute values ​​lower than the positive threshold τ to zero, and the load features with absolute values ​​greater than the positive threshold τ will also shrink towards zero. This allows the distinction of different component features. The relationship between the input x and output y is shown in the following formula:

[0083]

[0084] Adaptive Threshold Network: The input of this network is the output feature vector of the second one-dimensional convolution in the above residual network. First, the feature vector s(n) with spatial attention characteristics is calculated through the spatial attention module. The calculation process is shown in the following formula, where n represents the input feature vector with dimension C×L in the real number field R. Where C is the number of channels 16. The spatial attention module further extracts features through one-dimensional convolution and compresses it in the channel dimension to generate a one-dimensional feature vector with a length of L of 150. The one-dimensional feature vector is then formed into an attention vector through the Softmax function to strengthen the correlation between positions. The attention vector is multiplied by the output of the one-dimensional convolution to provide input for the channel attention mechanism and optimize the effectiveness of the threshold evaluation.

[0085] s(n)=Softmax(GAP(Transpose(Conv(n))))×Conv(n), n∈R C×L

[0086] Among them, Transpose represents the transposition operation of the vector, represented by "T" in the figure; GAP represents global average pooling; Conv represents one-dimensional convolution. Furthermore, the feature channel of the output s(n) of the spatial attention module is processed by absolute value and global average pooling through the channel attention mechanism to form an attention vector s'(n) with channel attention characteristics. The dimension of this vector is C×1. Then, adaptive threshold learning is performed through two linear layers with input and output of 16. The two linear layers are first processed by batch normalization and then by ReLu activation function; then, a set of coefficients n between 0-1 is generated for each channel through Softmax activation function. c ; Finally, using the above obtained s(n) and n c , the threshold τ for soft thresholding of each channel c It can be obtained by the following formula.

[0087] τ c =|s(n)|×n c

[0088] In the formula, |s(n)| represents the absolute value of the output vector s(n) of the spatial attention. After the threshold calculation is completed, the feature vector output by the second one-dimensional convolution in the above residual network is soft-thresholded by channel to obtain the processed feature vector, which is added to the input vector mapped by the identity mapping path in the output residual network to obtain the output x of the non-local residual shrinkage module. t .

[0089] Subsequently, the output of the non-local residual shrinkage module is passed through a gating unit to obtain a characteristic masking vector of the current waveform; wherein the gating unit is designed as follows:

[0090] y t =ReLu(tanh(x t )⊙σ(x t ))

[0091] Where ⊙ represents element-wise multiplication; y t represents the mask vector output by the gated unit, and σ represents the Sigmoid activation function. The feature mask vector is then multiplied element-by-element with the high-dimensional features output by the encoder to extract the noise feature component.

[0092] c. The decoder part reconstructs the noise waveform of the noise feature component output by the feature masking module through one-dimensional convolution, and extracts the clean waveform by subtracting the noise waveform from the input current waveform.

[0093] d. The gain module reconstructs the global information of the extracted clean waveform through the left and right branch linear layers; the right branch linear layer is a 1×1 linear layer, which uses global average pooling to obtain the overall amplitude information of the waveform, and then calculates the overall amplitude gain of the waveform, and then multiplies the gain by the output of the left branch linear layer to reduce the overall amplitude error of the waveform. The left branch linear layer is a 150×150 linear layer.

[0094] The input of the robust identification model is a single current cycle, and the length of each cycle is 150. Figure 4 As shown in the figure, the robust recognition model first extracts the high-dimensional features of the current cycle through a one-dimensional convolution. Then, the key features are extracted by stacking three non-local residual shrinkage modules with the same structure. The relationship between these three non-local residual shrinkage modules is a series relationship. Finally, two series-connected linear layers are used to construct the classification module. The nonlinearity is introduced between the two series-connected linear layers through the ReLu activation function. The output dimension of the last linear layer is the number of electrical appliance types M.

[0095] In the embodiment of the present application, the storage recorder MR8875-30 is used to collect the electrical data of each appliance in the target scene, with a sampling frequency of f, and the sampled data is annotated with artificial electrical labels. Establishing a single data set is to uniformly resample the above sampled data to the specified sampling frequency f s , its value is set to 7500, and the resampling method is Lagrange polynomial interpolation, and its calculation process is as follows:

[0096] (1) First, use the Lagrange basis polynomial to construct the interpolation polynomial P(e):

[0097]

[0098] Among them, L u(e) is the u-th Lagrange basis polynomial; e represents the position of the interpolation sampling point of the current cycle; y u The corresponding value is the current sampling value at the uth position. l is the number of sampling points of the current cycle to be resampled.

[0099] (2) Resampling: Calculate the value of the interpolation polynomial at the new sampling point and resample the data to the specified current sampling length L.

[0100] Through the above resampling of the sampled data, the current cycles of different electrical appliances with the same number of sampling points when they are running separately can be obtained. The resampled cycles of each electrical appliance are merged to establish a single data set.

[0101] Step 2: Construct a perturbation dataset by adding random noise interference of a specified signal-to-noise ratio to the single dataset obtained in step 1, and merge the single dataset and the perturbation dataset into an enhanced training set.

[0102] The perturbation data set is constructed by adding two kinds of random noise to the current cycle: Gaussian noise and random walk noise. The specific calculation process of the perturbation data set is as follows.

[0103] Signal-to-noise ratio: refers to the logarithm of the ratio of signal power to noise power, as shown in the following formula:

[0104]

[0105] Where P signal and P noise Represents signal power and noise power respectively; SNR dB is the signal-to-noise ratio of the signal; usually, the bus data obtained by the smart meter is discrete, and the power of the signal can be directly calculated. Here we assume that the current signal of one cycle is I = {i1′, i2′, …, i L ′},i L ′ represents the Lth current sampling point, then the current signal power of one cycle can be calculated as:

[0106]

[0107] In the formula, i k It represents the current value of the kth sampling point in I. It is worth noting that the signal power here is not the same as the active power of traditional electrical appliances. After obtaining the current signal power, the signal power of the noise can be calculated by the following formula:

[0108]

[0109] Among them, SNR is the specified signal-to-noise ratio, which is set to 10 here, that is, the signal-to-noise ratio of the sample after adding noise is SNR. After obtaining the signal power of the noise, it is necessary to generate a random noise sequence with the signal power. In the two noise sequences used, Gaussian noise is a white noise that obeys the normal distribution. In the one-dimensional state, the probability density function of the Gaussian normal distribution is:

[0110]

[0111] Where P(r) represents the value of 2 Under this condition, the random variable r takes the probability density function of r. Assume that the generated random Gaussian noise sequence is I N_noise , then the random Gaussian noise sequence with specified noise signal power can be calculated by the following formula.

[0112]

[0113] For a time series {g t}, if the following conditions are met, the time series is a random walk.

[0114] g t =w t +w t-1 +...w0

[0115] Among them, w t and w t-1 are the tth and t-1th white noise sequences respectively; w0 is the 0th white noise sequence. For the random walk sequence g t , which is equal to the sum of multiple white noises, that is, random walk is the accumulation of white noise. From this, we can get the steps to generate a random walk sequence. Given a random initial value g0, each subsequent value g in the random walk sequence t It can be calculated by the following formula:

[0116] g t =g t-1 +w t

[0117] In the formula, g t-1 is the random walk sequence of the t-1th time step; similarly, assuming that the generated random Gaussian noise sequence is I W_noise , then the random walk noise sequence with specified noise signal power can be calculated by the following formula:

[0118]

[0119] Through the above steps, we have generated two random noise sequences with specified noise signal power. By superimposing the generated random noise sequences on the original monomer waveform, we can obtain the noisy data after data enhancement, thereby constructing the perturbation data set.

[0120]

[0121] In the formula, I noise Represents the constructed perturbation dataset.

[0122] The perturbation dataset I constructed above noise Merge with the single dataset into an enhanced training set for subsequent model training.

[0123] Step 3: Use the enhanced training set constructed in step 2 to train the two models proposed in step 1 respectively. The two models are trained using mean square error and cross entropy loss functions respectively.

[0124] The enhanced training set constructed in step 4 is used to train the general denoising model and the robust recognition model proposed in step 1 and step 2, respectively. The two models are trained using mean square error and cross entropy loss functions, respectively.

[0125] The general denoising model is trained using the mean square error loss function MSE, which is defined as follows:

[0126]

[0127] Where D is the number of samples; j d is the true value of the dth sample; is the true value of the dth sample.

[0128] The robust recognition model is trained using the cross-entropy loss function, which is defined as follows:

[0129]

[0130] Where M is the number of electrical appliances; j d,h is the true label of the d-th sample for the h-th class; is the predicted probability of the dth sample for the hth class.

[0131] Step 4: In the testing phase, the model trained in step 3 is used to perform two-stage robust recognition on the aliasing decomposition waveform of the target appliance in the unknown aliasing scenario. In the first stage, the waveform is denoised using the trained general denoising module. In the second stage, the trained robust recognition model is used to perform key feature recognition on the aliasing decomposition waveform of the target appliance after denoising to obtain the predicted label of the target appliance.

[0132] The aliasing scenario refers to a complex power consumption environment where multiple electrical appliances are running at the same time. In an unknown aliasing scenario, a newly switched electrical appliance is called a target electrical appliance, and electrical appliances running on the bus other than the target electrical appliance are called background electrical appliances.

[0133] In the identification stage, the aliased decomposition current of the target appliance is first obtained by subtracting the bus current before and after the switching event, that is, its branch current I Y Current I Y It can be obtained by the following formula:

[0134]

[0135] Among them, I s ' um is the total current after the switching event occurs; I sum is the total current before the switching event occurs. The aliasing decomposition current of the target appliance in the unknown aliasing scenario is obtained. First, it is input into the general noise reduction model to obtain the noise-reduced current waveform, and then the noise-reduced current waveform is input into the robust recognition model to identify the type of appliance, thereby obtaining the predicted label of the target appliance.

[0136] Example 2

[0137] Referring to Table 1, Table 2 and Table 3, the second embodiment of the present invention provides an experimental effect description based on the first embodiment to verify its beneficial effects.

[0138] Preferably, in order to further illustrate the effectiveness of the invention, four data sets, namely LIT, self-collected data set, PLAID and WHITED, were used for testing. The first two data sets are intended to verify the robust performance of the two-stage non-intrusive load identification method for known electrical appliances in unknown aliasing scenarios, and the performance is averaged by repeating 10 times to obtain more convincing results. The latter two data sets are used to evaluate the recognition performance of the proposed robust recognition model for single waveforms, and ten-fold cross validation is used to obtain more convincing results. Among them, LIT and self-collected data sets contain electrical appliance sampling data in many aliasing scenarios, and PLAID and WHITED contain single waveforms of many electrical appliances. In terms of experimental data acquisition, the timestamps recorded in LIT and self-collected data sets are directly extracted by subtracting the steady-state current waveforms before and after the event. Finally, the LIT data set contains 20 cycles of current and voltage data randomly selected for each aliasing scenario, including 1520 decomposed waveforms of 25 electrical appliances and 500 original waveform samples. The self-collected dataset contains 30 cycles of voltage and current data randomly selected for each aliasing scenario, including 1800 decomposed waveforms of 12 electrical appliances and 260 original waveform samples. The PLAID dataset contains 1874 single waveforms of 15 electrical appliances. The WHITED dataset contains 1259 single waveforms of 54 electrical appliances. We use the polynomial interpolation method to downsample the voltage and current of all datasets to 150 sampling points per cycle as the input of the model. All experiments use the adaptive weighted recursive graph (AWRG) method for comparison.

[0139] Furthermore, in terms of testing robust performance, the model is trained using an enhanced dataset based on the monomer dataset, and aliasing decomposition waveforms of different aliasing scenarios are used as test sets. In terms of testing the recognition performance of monomer waveforms, all monomer waveforms are divided into training sets and test sets in a ratio of 8:2.

[0140] Furthermore, in terms of test indicators, the macro average score (F1-macro), accuracy (ACC), and Matthews correlation coefficient (MCC) are used as evaluation indicators of the model. The definition of the macro average score is as follows:

[0141]

[0142] Where N′ is the number of electrical appliance categories; Recall i′ is the recall rate of the i′th category of electrical appliances; i′ is the accuracy rate of the i′th type of electrical appliances; TP i′ Indicates the true positive rate of the i′th category electrical appliance, FP i′ represents the false positive rate of the i′th category of electrical appliances, FN i′ It represents the false negative rate of the i′th category electrical appliances; the accuracy rate is defined as follows:

[0143]

[0144] Among them, TP represents the true positive rate, FP represents the false positive rate, TN represents the true negative rate, and FN represents the false negative rate.

[0145] The Matthews correlation coefficient (MCC) is defined as follows:

[0146]

[0147] The value range of MCC is from -1 to 1. The closer the value is to 1, the better the performance.

[0148] Furthermore, Table 1 shows the recognition performance of the proposed robust recognition model (Ours) for single waveforms. Experimental results show that when the waveform is relatively clean, the proposed robust recognition model has the best waveform recognition performance. Specifically, on the PLAID dataset, the robust recognition model performs well on F1-macro, which is 3.26% higher than the comparison method. In addition, the variance of its test results on all indicators is smaller than that of the comparison model, showing excellent stability. On the PLAID dataset, all indicators are close to 100%, showing its excellent single waveform recognition performance.

[0149] Table 1 Single waveform recognition performance test results

[0150]

[0151] Furthermore, Table 2 shows the basic robustness test results of different methods on aliased decomposition waveforms in the face of unknown aliasing scenarios, that is, only the robust recognition model (Ours) is used for testing. It can be seen that the proposed robust recognition model performs well on both datasets, and all indicators reach the best level. In the face of unknown aliasing scenarios, its test performance far exceeds that of the comparison method.

[0152] Table 2 Robustness performance test results for unknown aliasing scenarios

[0153]

[0154] Furthermore, Table 3 shows the two-stage robustness test results of different methods on aliased decomposition waveforms in the face of unknown aliasing scenarios, that is, the constructed universal denoising model is placed in front of all recognition models. It can be found that compared with the basic robustness, the pre-positioned universal denoising model can further stabilize the classification performance of the model at a higher level, alleviating the problem of unrecognition caused by severe waveform distortion. The recognition accuracy of the proposed robust recognition model is improved to 95.97% on the LIT dataset and as high as 99% on the self-collected data. It is worth noting that the pre-positioned universal denoising model not only makes the proposed recognition method effective, but also improves the recognition performance of AWRG to a higher level. Compared with the basic robust performance, the F1-macro of AWRG on the LIT dataset is improved by 20.04%, which shows that the pre-positioned denoising model has a certain universality in improving the robustness of different methods.

[0155] Table 3 Two-stage test results

[0156]

[0157] Table 4 Statistical results of model parameters

[0158] method Parameter quantity (k) Memory used (MB) Calculation Amount AWRG 667.66 2.55 <![CDATA[2.55×10 3 ]]> Robust recognition model 103.01 0.39 <![CDATA[9.12×10 2 ]]> General Noise Reduction Model 24.97 0.09 <![CDATA[2.90×10 2 ]]>

[0159] Table 4 shows the number of parameters, memory usage, and floating point calculations of the constructed general denoising module and robust recognition model, and also shows the relevant parameters of the comparison method AWRG. It can be found that the two constructed general denoising modules and robust recognition models are both lightweight and have recognition capabilities in seconds, which are suitable for edge deployment and large-scale promotion and application.

[0160] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A two-stage non-intrusive load detection method for unknown aliasing scenarios, characterized in that: The following steps are involved: Step 1: A lightweight universal denoising model is constructed based on feature masking to denoise the target electrical appliance waveform in an unknown aliasing scenario and obtain a more recognizable target electrical appliance waveform; A lightweight robust recognition model is built based on the non-local residual shrinkage module to extract the key features of the target electrical appliance waveform after noise reduction, so as to perform robust recognition; the voltage and current data of each electrical appliance in the target scene is obtained to establish a single data set; Step 2: construct a perturbation dataset by adding random noise interference of a specified signal-to-noise ratio to the single dataset obtained in step 1, and merge the single dataset and the perturbation dataset into an enhanced training set; Step 3: Use the enhanced training set constructed in step 2 to train the general denoising model and the robust recognition model constructed in step 1 respectively, where the general denoising model is trained using the mean square error loss function, and the robust recognition model is trained using the cross entropy loss function; Step 4: In the testing phase, the model trained in step 3 is used to perform two-stage robust recognition on the aliasing decomposition waveform of the target appliance in the unknown aliasing scenario. In the first stage, the waveform is denoised using the trained general denoising module. In the second stage, the trained robust recognition model is used to perform key feature recognition on the aliasing decomposition waveform of the target appliance after denoising to obtain the predicted label of the target appliance.

2. According to claim 1, a two-stage non-intrusive load detection method for unknown aliasing scenarios is characterized in that: In step 1, the general noise reduction model includes an encoder, a feature masking module, a decoder and a gain module, and the details are as follows: a. The encoder consists of a one-dimensional convolution and a ReLU activation function, which is used to map the input waveform features to a high-dimensional feature space. The input of the encoder is a single-cycle current waveform of the appliance. Before input, the current cycle needs to be standardized based on the variance and mean of each current cycle as follows: In the formula, x i represents the current at the i-th current sampling point; N is the total number of sampling points of the current cycle; μ is the current mean of a cycle; v is the standard deviation of the cycle; x i ′ is the current sampling point after standardization; b. The feature masking module first performs component analysis on the high-dimensional features of the above encoder through a non-local residual shrinkage module, which includes a residual network, soft thresholding, and an adaptive threshold network. The details are as follows: b1. Residual network: It consists of two identical one-dimensional convolutions and cross-layer identity paths. Batch normalization is used between each one-dimensional convolution to speed up training and prevent the model from falling into overfitting. b2. Soft thresholding: First, a positive threshold τ needs to be set. Then the soft threshold function will set the load features with absolute values ​​lower than the positive threshold τ to zero, and the load features with absolute values ​​greater than the positive threshold τ will also shrink towards zero, thereby achieving the distinction between different component features. The relationship between the input x and the output y is shown in the following formula: b3. Adaptive threshold network: The input of this network is the output feature vector of the second one-dimensional convolution in the above residual network. First, the feature vector s(n) with spatial attention characteristics is calculated through the spatial attention module. The calculation process is shown in the following formula, where n represents the input feature vector with a dimension of C×L in the real number field R, where C is the number of channels and L is the length of each cycle; the spatial attention module further extracts features through one-dimensional convolution and compresses it in the channel dimension to generate a one-dimensional feature vector with a length of L. Then, the one-dimensional feature vector is formed into an attention vector through the Softmax function to strengthen the correlation between positions. The attention vector is multiplied by the output of the one-dimensional convolution to provide input for the channel attention mechanism and optimize the effectiveness of the threshold evaluation; s(n)=Softmax(GAP(Transpose(Conv(n))))×Conv(n),n∈R C×L In the formula, Transpose represents the transposition operation of the vector; GAP represents global average pooling; Conv represents the one-dimensional convolution, which performs absolute value processing and global average pooling on the feature channels of the output s(n) of the spatial attention module through the channel attention mechanism to form an attention vector s'(n) with channel attention characteristics. The dimension of this vector is C×1; then, adaptive threshold learning is performed through two linear layers. The two linear layers are first batch normalized and then activated by the ReLu function; then a set of coefficients n between 0 and 1 is generated for each channel through the Softmax activation function. c ; Finally, using the above obtained s(n) and n c , the threshold τ for each channel used for soft thresholding c It can be obtained by the following formula: t c =|s(n)|×n c In the formula, |s(n)| represents the absolute value of the output vector s(n) of the spatial attention. After the threshold calculation is completed, the feature vector output by the second one-dimensional convolution in the above residual network is soft-thresholded by channel to obtain the processed feature vector, which is added to the input vector mapped by the identity mapping path in the residual network to obtain the output vector x of the non-local residual contraction module. t ; Subsequently, the output of the non-local residual shrinkage module is passed through a gating unit to obtain a characteristic masking vector of the current waveform; wherein the gating unit is designed as follows: y t =ReLu(tanh(x t )⊙σ(x t )) Where ⊙ represents element-wise multiplication; y t represents the masking vector output by the gated unit, and σ represents the Sigmoid activation function; the feature masking vector is then multiplied element-by-element with the high-dimensional features output by the encoder to extract the noise feature component; c. The decoder reconstructs the noise waveform of the noise feature component output by the feature masking module through one-dimensional convolution, and extracts the clean waveform by subtracting the noise waveform from the input current waveform; d. The gain module reconstructs the global information of the extracted clean waveform through the left and right branch linear layers; the right branch linear layer is a 1×1 linear layer, which uses global average pooling to obtain the overall amplitude information of the waveform, and then calculates the overall amplitude gain of the waveform, and then multiplies the gain by the output of the left branch linear layer to reduce the overall amplitude error of the waveform. The left branch linear layer is a 150×150 linear layer.

3. A two-stage non-intrusive load detection method for unknown aliasing scenarios according to claim 1, characterized in that: In step 1, the input of the robust recognition model is a single current cycle, and the length of each cycle is L. The robust recognition model first extracts the high-dimensional features of the current cycle through a one-dimensional convolution, and then extracts the key features by stacking three non-local residual shrinkage modules with the same structure. The relationship between these three non-local residual shrinkage modules is a series relationship. Finally, a classification module is constructed using two series-connected linear layers. Nonlinearity is introduced between the two series-connected linear layers through the ReLu activation function, and the output dimension of the last linear layer is the number of electrical appliance types M.

4. According to claim 1, a two-stage non-intrusive load detection method for unknown aliasing scenarios is characterized in that: In step 1, the current and voltage data of each electrical appliance in the target scene are collected at a sampling frequency of f, and the sampled data are annotated with artificial electrical appliance labels. To establish a single data set, the above sampled data are uniformly resampled to the specified sampling frequency f. s , the resampling method is Lagrange polynomial interpolation, and the calculation process is as follows: First, construct the interpolation polynomial P(e) using the Lagrange basis polynomial: Where, L u (e) is the u-th Lagrange basis polynomial; e represents the position of the interpolation sampling point of the current cycle; y u It corresponds to the current sampling value at the uth position; l is the number of sampling points of the current cycle to be resampled; Resampling: Calculate the value of the interpolation polynomial at the new sampling point and resample the data to the specified current sampling length L; Through the above resampling processing of the sampled data, the current cycles of different electrical appliances with the same number of sampling points when they are running separately can be obtained, and the resampled cycles of each electrical appliance are merged to establish a single data set.

5. The two-stage non-intrusive load detection method for unknown aliasing scenarios according to claim 1 is characterized in that: In step 2, the perturbation data set is constructed by adding two kinds of random noise to the current cycle: Gaussian noise and random walk noise. The specific calculation process of the perturbation data set is as follows: Signal-to-noise ratio: refers to the logarithm of the ratio of signal power to noise power, as shown in the following formula: Where P signal and P noise Represents signal power and noise power respectively; SNR dB is the signal-to-noise ratio of the signal; the bus data obtained by the smart meter is discrete, and the power of the signal can be directly calculated. Here, a current signal with a cycle is assumed to be I = {i1′, i2′, …, i L ′},i L ′ represents the Lth current sampling point, then the current signal power P of one cycle can be calculated signal for: In the formula, i k It represents the current value of the kth sampling point in I. The signal power here is not the same as the active power of traditional electrical appliances. After obtaining the current signal power, the noise signal power P can be calculated by the following formula: noise : In the formula, SNR is the specified signal-to-noise ratio, that is, the signal-to-noise ratio of the sample after adding noise is SNR; after obtaining the signal power of the noise, it is necessary to generate a random noise sequence with the signal power; in the two noise sequences used, Gaussian noise is a white noise that obeys the normal distribution. In the one-dimensional state, the probability density function of the Gaussian normal distribution is: Where P(r) represents the value of 2 In this case, the random variable r takes the probability density function of r; assuming that the generated random Gaussian noise sequence is I N_noise , then the random Gaussian noise sequence I′ with a specified noise signal power can be calculated by the following formula N_noise : For a time series {g t }, if the following conditions are met, the time series is a random walk; g t =in t +in t-1 +...w0 In the formula, w t and w t-1 are the tth and t-1th white noise sequences respectively; w0 is the 0th white noise sequence; for the random walk sequence g t , which is equal to the sum of multiple white noises, that is, random walk is the accumulation of white noise, from which the steps of generating a random walk sequence can be obtained. Given a random initial value g0, each subsequent value g in the random walk sequence t It can be calculated by the following formula: g t =g t-1 +w t In the formula, g t-1 is the random walk sequence of the t-1th time step; similarly, assuming that the generated random walk noise sequence is I W_noise , then the random walk noise sequence I′ with a specified noise signal power can be calculated by the following formula W_noise : So far, two random noise sequences with specified noise signal power have been generated. By superimposing the generated random noise sequence on the original monomer waveform, the noisy data after data enhancement can be obtained, and the perturbation data set can be constructed as follows: In the formula, I noise Represents the constructed perturbation dataset.

6. A two-stage non-intrusive load detection method for unknown aliasing scenarios according to claim 1, characterized in that: In step 3, the general denoising model is trained using the mean square error loss function MSE, which is defined as follows: Where D is the number of samples; j d is the true value of the dth sample; is the true value of the dth sample; The robust recognition model is trained using the cross-entropy loss function, which is defined as follows: Where, M is the number of electrical appliances; j d,h is the true label of the d-th sample for the h-th type of electrical appliance; is the predicted probability of the dth sample for the hth type of electrical appliance.

7. A two-stage non-intrusive load detection method for unknown aliasing scenarios according to claim 1, characterized in that: In step 4, the aliasing scenario refers to a complex power consumption environment in which multiple electrical appliances are running at the same time. In an unknown aliasing scenario, the newly switched electrical appliance is called the target electrical appliance, and the electrical appliances running on the bus other than the target electrical appliance are called background electrical appliances. In the identification stage, the aliasing decomposition current of the target appliance, that is, its branch current, is first obtained by subtracting the bus current before and after the switching event. The aliasing decomposition current can be obtained by the following formula: In the formula, I Y is the aliasing decomposition current; I s ' um is the total current after the switching event occurs; I sum is the total current before the switching event occurs; After obtaining the aliasing decomposition current of the target appliance in the unknown aliasing scenario, it is first input into the general denoising model to obtain the denoised current waveform, and then the denoised current waveform is input into the robust recognition model to identify the type of appliance, thereby obtaining the predicted label of the target appliance.

Citation Information

Patent Citations

  • Non-intrusive load decomposition improvement method and device and storage medium

    CN114692740A

  • Non-intrusive load identification method and system for high-frequency aliasing data

    CN117056665A

  • Bearing fault diagnosis method based on improved deep residual shrinkage network

    CN117112991A

  • Unauthorized frequency band wireless signal identification method based on deep residual shrinkage network

    CN117312942A

  • Hail weather identification and classification method based on multi-channel deep residual shrinkage network

    WO2023216583A1