A multi-device multi-task non-intrusive load identification method

By using a multi-task joint recognition model, and leveraging ResNet residual blocks and Mamba modules for feature extraction and prediction, the problem of insufficient consideration of common features among devices in existing technologies is solved. This enables latency-free load recognition of multiple devices and multiple tasks, reduces computational load and parameter count, and improves real-time performance and model compatibility.

CN120632574BActive Publication Date: 2026-02-06ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510761942.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2026-02-06
Estimated Expiration
2045-06-09

AI Technical Summary

Technical Problem

Existing non-intrusive load identification technologies do not fully consider common features among devices, have a large number of model parameters, lack real-time performance, and are highly dependent on label data, making it difficult to achieve efficient load identification across multiple devices and tasks.

Method used

A multi-task joint recognition model is adopted, including an encoder, a preliminary prediction module, a task decoder, and a final prediction module. It utilizes ResNet residual blocks and Mamba modules for feature extraction and prediction, and combines bilinear interpolation and a hybrid loss function for training to reduce computational load and parameter count, thereby achieving latency-free multi-device multi-task recognition.

Benefits of technology

It achieves zero-latency load identification across multiple devices and tasks, reduces computational load and parameter count, enhances model compatibility and real-time performance, reduces dependence on tag data, supports real-time operation on embedded devices, and provides low-cost power consumption details management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632574B_ABST
    Figure CN120632574B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-device multitask non-invasive load identification method, comprising the following steps: S1, the total load power of multiple electrical equipment is obtained;S2, a multi-task joint identification model is established and trained using a training set, the multi-task joint identification model includes sequentially connected encoder, preliminary prediction module, task decoder and final prediction module;S3, the total load power of the multiple electrical equipment to be identified is input into the trained multi-task joint identification model, and the corresponding final prediction result is obtained, which is the load identification result. The multi-device multitask non-delay load identification result can be obtained, and the computational load and parameter quantity are further reduced, which is convenient for deployment and low in cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of load identification, and particularly relates to a multi-device multi-task non-intrusive load identification method. BACKGROUND

[0002] With the development of urbanization and the progress of electrification, energy demand continues to increase, and energy saving and improving energy utilization efficiency are imperative. Traditional intrusive power monitoring technology needs to install collection devices on each device, which has problems such as complex installation and high cost, and is difficult to meet the needs of large-scale demand. Non-intrusive load identification technology (NILM) realizes device-level energy consumption decoupling through the analysis of current and voltage signals at a single entrance. Non-intrusive load identification technology identifies which electrical devices exist in the circuit and their power consumption by analyzing the total power consumption signal. The core of this technology is that it does not need to install separate sensors on each electrical appliance, but intelligently analyzes the total power consumption signal of the entire building or facility to infer the use and energy consumption distribution of each electrical appliance. Compared with traditional intrusive methods, non-intrusive load identification technology has the advantages of low cost, simple deployment, and little impact on user use. Therefore, non-intrusive load identification technology has wide application prospects in the fields of smart grid, home energy management, and device fault diagnosis.

[0003] However, non-intrusive load identification technology still faces many challenges in practical application. For example, existing load identification algorithms are limited by the ability to extract time series context features, and usually leave extra windows at both ends of the input sequence, so the output sequence length is mostly the midpoint or subsequence of the input sequence, which is not real-time. At the same time, a large amount of labeled training data is required, such as about a month of data, which has high training cost and poor user privacy. In addition, existing load identification algorithms do not fully consider the common features between different categories of devices, and most of them use a single device solution, which requires training a set of model parameters for each device, i.e. repeating the model training each time, which has large model parameter quantity, higher requirements for device performance, and practical plan complexity. In addition, existing load identification algorithms only involve single-task energy decomposition, and the algorithm performance depends entirely on the prediction ability of the model, without fully considering the correlation between multi-task devices, which is not conducive to ensuring the load identification effect. Therefore, the present application proposes a multi-device multi-task non-intrusive load identification method. SUMMARY

[0004] The purpose of the present application is to solve the above problems, and to propose a multi-device multi-task non-intrusive load identification method, which can obtain multi-device multi-task non-delay load identification results, and further reduce the amount of calculation and the amount of parameters, facilitating deployment and being low in cost.

[0005] To achieve the above object, the technical scheme adopted by the present application is:

[0006] The multi-device multi-task non-intrusive load identification method provided by the present application comprises the following steps:

[0007] S1, obtaining the total load power of a plurality of electrical appliances;

[0008] S2, establishing a multi-task joint identification model and training it using a training set, the multi-task joint identification model comprising an encoder, a preliminary prediction module, a task decoder and a final prediction module connected in sequence, wherein:

[0009] The encoder comprises four ResNet residual blocks connected in series;

[0010] The preliminary prediction module comprises a classification module and a regression module in parallel, and both the classification module and the regression module are used to perform the following operations:

[0011] The shared features output by the encoder are decoded using the first decoder to obtain decoding features;

[0012] The decoding features are predicted using the prediction head to obtain initial prediction results;

[0013] The initial prediction results and the decoding features are spliced in the channel dimension to obtain a spliced feature vector;

[0014] The task decoder comprises three decoding modules connected in series, and the input features of the task decoder comprise the initial prediction results of the classification module, the initial prediction results of the regression module and the output features of the first three ResNet residual blocks, the decoding module comprises a classification task branch and a regression task branch in parallel, and both the classification task branch and the regression task branch comprise a feature fusion module, two first Mamba modules and a second Mamba module connected in sequence;

[0015] The final prediction module comprises two prediction heads in parallel, and the output features of the two second Mamba modules of the third decoding module are input into the prediction heads one by one, and the output features of the two prediction heads are the final prediction results;

[0016] S3, inputting the total load power of the plurality of electrical appliances to be identified into the trained multi-task joint identification model to obtain the corresponding final prediction results, which are the load identification results.

[0017] Preferably, the ResNet residual block is used to perform the following operations:

[0018] The input feature corresponding to the ResNet residual block of the layer is sequentially subjected to a convolution layer, an activation function and a convolution layer to obtain a first extracted feature, and subjected to a convolution layer to obtain a second extracted feature, the first extracted feature and the second extracted feature are subjected to an addition operation, and then sequentially subjected to an activation function and a maximum pooling layer to obtain the output feature of the ResNet residual block of the layer.

[0019] Preferably, the first decoder comprises a one-dimensional convolution layer and a ReLU activation function connected in series.

[0020] Preferably, the input feature of the task decoder comprises the initial prediction result of the classification module, the initial prediction result of the regression module, and the output feature of the first three ResNet residual blocks, specifically as follows:

[0021] The input feature of the classification task branch in the first decoding module is the spliced feature vector of the classification module and the output feature of the third ResNet residual block of the encoder, and the input feature of the regression task branch is the spliced feature vector of the regression module and the output feature of the third ResNet residual block of the encoder; the input feature of the classification task branch in the second decoding module is the output feature of the classification task branch in the first decoding module and the output feature of the second ResNet residual block of the encoder, and the input feature of the regression task branch is the output feature of the regression task branch in the first decoding module and the output feature of the second ResNet residual block of the encoder; the input feature of the classification task branch in the third decoding module is the output feature of the classification task branch in the second decoding module and the output feature of the first ResNet residual block of the encoder, and the input feature of the regression task branch is the output feature of the regression task branch in the second decoding module and the output feature of the first ResNet residual block of the encoder.

[0022] Preferably, the feature fusion module comprises an inverse convolution layer, a normalization layer, a channel splicing module and a convolution layer connected in series, and the channel splicing module is used for splicing the output feature of the normalization layer and the input output feature of the corresponding ResNet residual block in the channel dimension;

[0023] The first Mamba module is used for performing the following operations:

[0024] The input feature is subjected to a normalization layer to obtain a third extracted feature, the third extracted feature is subjected to a linear layer and an activation function to obtain a fourth extracted feature, and subjected to a linear layer, a one-dimensional convolution layer, an activation function, an SSD module and a normalization layer to obtain a fifth extracted feature, the fourth extracted feature and the fifth extracted feature are subjected to a multiplication operation, and then subjected to a linear layer to obtain a sixth extracted feature, and then the input feature and the sixth extracted feature are subjected to an addition operation to form the output feature of the first Mamba module;

[0025] The second Mamba module is configured to perform the following operations:

[0026] The output features of the last first Mamba module corresponding to the classification task branch and the output features of the last first Mamba module corresponding to the regression task branch are spliced in the channel dimension, and then feature fusion is performed through a one-dimensional convolution layer to obtain fused features.

[0027] The output features of the last first Mamba module corresponding to the task branch are obtained as the seventh extracted features through a normalization layer, the eighth extracted features are obtained through a linear layer and an activation function, and the ninth extracted features are obtained through a linear layer, a one-dimensional convolution layer, an activation function, a CSSD module and a normalization layer, the eighth extracted features and the ninth extracted features are multiplied to obtain the tenth extracted features through a linear layer, and the output features of the third decoding module corresponding to the task branch and the tenth extracted features are added to form the output features of the second Mamba module, and the input features of the CSSD module further include the fused features.

[0028] Preferably, the SSD module and the CSSD module have the same selection state space, and the calculation formula is as follows:

[0029]

[0030] wherein, is the hidden state at the moment, t is the hidden state at the moment, is the input data at the moment, t is the hidden state at the moment, is the input data at the moment, t is the output data at the moment. , and is the learnable parameter at the moment, corresponding to t is the weight of the hidden state at the moment, t is the weight of the input data at the moment, and t is the weight of the hidden state at the moment, t represents transposition, t is the output data at the moment. T t Preferably, each prediction head includes a linear layer and an activation function connected in sequence.

[0031] Preferably, each sample in the training set includes the total load power the on-off state of each electrical appliance and the energy consumption of each electrical appliance.

[0032]

[0033] ​​​Preferably, the multi-device multi-task non-intrusive load identification method further comprises the following steps:

[0034] The initial prediction result of the unified classification module and the time series length of the true value are unified by using a bilinear interpolation method, and the initial prediction result of the unified regression module and the time series length of the true value are unified, and the classification loss and the regression loss are calculated correspondingly;

[0035] The classification loss and the regression loss of the final prediction result and the true value are calculated correspondingly;

[0036] The total loss function is calculated according to the classification loss and the regression loss of the preliminary prediction module and the classification loss and the regression loss of the final prediction module, and back propagation is performed to update the parameters of the multi-task joint identification model.

[0037] Preferably, the total loss function , and the formula is as follows:

[0038]

[0039] In the formula, represents the regression loss of the i-th level, represents the classification loss of the i-th level, represents the classification weight, represents the regression weight, A represents the true value at the j-th moment of the i-th level, B represents the prediction value at the j-th moment of the i-th level, =1 , t is the number of levels, and the value is 1 and 2, the first level represents the preliminary prediction module, and the second level represents the task decoder, is the time series length of the final prediction result, that is, the time series length of the true value, t =1 . S S TL Compared with the prior art, the method has the following beneficial effects: t TL Compared with the prior art, the method has the following beneficial effects:

[0040] Compared with the prior art, the method has the following beneficial effects:

[0041] Compared with the prior art, the method has the following beneficial effects:

[0042] ​​​​By introducing the preliminary prediction module and the Mamba module, the multi-task joint identification model introduces the state space model Mamba into the field of non-intrusive load identification (NILM), and breaks through the efficiency bottleneck of traditional CNN, RNN and other models in long sequence modeling. The selective state space mechanism (Selective State Spaces) of Mamba can dynamically capture the fine-grained features (such as device start-stop transient and periodic harmonic) across time scales in the current / voltage waveform, realize high-precision time sequence modeling with low computational complexity, and solve the feature redundancy and delay accumulation problems caused by fixed convolution kernel or circular dependency in traditional methods. The ability of the model to associate context is enhanced, and the time sequence length of the input and output is the full sequence, which can realize the non-delayed appliance switching state classification and energy disaggregation, greatly reducing the computational complexity and parameter quantity of the model, and the total loss function is a hybrid loss function formed by the preliminary prediction module and the final prediction module, realizing the weighted summation of two-level training loss function to form the total loss function, which alleviates the gradient vanishing or explosion problem caused by the increase of model depth, supports real-time operation on embedded devices, and can obtain the switching state and device-level energy consumption of multiple devices through one model, has the performance of non-delay, multi-device and multi-task processing, is convenient to deploy, and provides real-time power consumption details and energy consumption management low-cost solutions for users;

[0043] A small amount of low-frequency sampled label data is used for training, which reduces the dependence of the model on the label data, and the low-frequency sampling rate reduces the performance requirements of the data acquisition and storage hardware, expands the application range of the model and reduces the use cost of the user, solves the problems of label data dependence, real-time performance and low multi-target recognition accuracy in the field of NILM. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 The flowchart of the multi-device multi-task non-intrusive load identification method of the present application;

[0045] Figure 2 The structural schematic diagram of the multi-task joint identification model of the present application;

[0046] Figure 3 The structural schematic diagram of the ResNet residual block (a) and the encoder (b) of the present application;

[0047] Figure 4 The structural schematic diagram of the task decoder of the present application;

[0048] Figure 5 The structural schematic diagram of the decoding module of the present application;

[0049] Figure 6 The structural schematic diagram of the feature fusion module of the present application;

[0050] Figure 7 Figure 1 is a structural schematic diagram of a first Mamba module of the present application;

[0051] Figure 8 Figure 2 is a structural schematic diagram of a CM module of the present application. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0053] It should be noted that when a component is referred to as being "connected" with another component, it can be directly connected with the other component or there can be a component in the middle. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0054] The non-intrusive load monitoring (NILM) technology of the present application identifies multiple device-level energy consumptions and switching states simultaneously through a total load power signal collected by a smart meter, so as to facilitate a user to more clearly understand the energy consumption and switching state information. By providing fine-grained information, the user can more scientifically formulate an energy-saving strategy and improve energy efficiency.

[0055] The problem of the non-intrusive load monitoring of the present application is described as follows:

[0056] The total load power at time t is decomposed as follows: t y t

[0057]

[0058] In the formula, s t i is the switching state of the i th electrical appliance device at time t, e t i is the energy consumption of the i th electrical appliance device at time t, n t is the noise at time t, and 1 is a constant. t t t N N ​​​​​​​​​​​​​The total number of electrical devices included in the total load power;

[0059] Utilize the decomposed t Total load power at any given time y ( t Construct a non-intrusive load identification task at the corresponding time point. , means as follows:

[0060] ;

[0061] in, yes t Total load power at any given time y ( t The mapping of the NILM process to the total power of a given load. The Non-Intrusive Load Identification (NILM) task can be summarized as an algorithm that obtains the switching state of electrical appliances and their corresponding energy consumption by observing the total power of a given load. NILM involves obtaining data from smart meters... t Total load power at any given time y ( t The energy consumption and on / off states of electrical appliances are decomposed into device-level energy consumption and on / off states. After training, the model predicts the energy consumption and on / off states of specific electrical appliances based on observed total load patterns.

[0062] In its specific implementation, this application predicts the switching status and energy consumption of multiple electrical devices based on the total input load power, achieving consistency between the input time series length and the output time series length. equal This means no-delay classification and de-clustering, and the above problem description corresponds to the execution process of the multi-task joint identification model of this application, which is one implementation method. In this implementation, the tasks to be identified are the on / off state and energy consumption of electrical equipment. It can also be applied to other task types that need to be identified. In contrast, the time series length output by the existing NILM algorithm is the [missing information - likely a number]. Midpoint of the window of each electrical appliance Or the The length of the window of each electrical appliance is subsequence of .in, , To round down, Indicates the size of the input window. For the output window length, The smaller the value, the smaller the proportion of the predicted time series length to the input time series length.

[0063] like Figures 1-8 As shown, a non-intrusive multi-device, multi-tasking load identification method includes the following steps:

[0064] S1, acquire total load power of a plurality of electrical appliances.

[0065] S2, establish a multi-task joint identification model and train it using a training set, the multi-task joint identification model comprising an encoder, a preliminary prediction module, a task decoder and a final prediction module connected in sequence, wherein:

[0066] The encoder comprises four ResNet residual blocks connected in series.

[0067] The preliminary prediction module comprises a classification module and a regression module in parallel, and both the classification module and the regression module are configured to perform the following operations:

[0068] The shared features output by the encoder are decoded using the first decoder to obtain decoded features.

[0069] The decoded features are predicted using the prediction head to obtain initial prediction results.

[0070] The initial prediction results and the decoded features are spliced in the channel dimension to obtain a spliced feature vector.

[0071] The task decoder comprises three decoding modules connected in series, and the input features of the task decoder comprise the initial prediction results of the classification module, the initial prediction results of the regression module, and the output features of the first three ResNet residual blocks. The decoding module comprises a classification task branch and a regression task branch in parallel, and both the classification task branch and the regression task branch comprise a feature fusion module, two first Mamba modules and a second Mamba module connected in sequence.

[0072] The final prediction module comprises two prediction heads in parallel, and the output features of the two second Mamba modules of the third decoding module are input into the prediction heads one by one, and the output features of the two prediction heads are the final prediction results.

[0073] S3, input the total load power of the plurality of electrical appliances to be identified into the trained multi-task joint identification model to obtain the corresponding final prediction results, which are the load identification results.

[0074] In an embodiment, the ResNet residual block is configured to perform the following operations:

[0075] The input features of the corresponding layer ResNet residual block are sequentially input into a convolution layer, an activation function and a convolution layer to obtain first extracted features, and a convolution layer to obtain second extracted features. After the first extracted features and the second extracted features are added, the output features of the corresponding layer ResNet residual block are obtained by sequentially passing through an activation function and a max-pooling layer.

[0076] In an embodiment, the first decoder comprises a one-dimensional convolution layer and a ReLU activation function connected in series.

[0077] In an embodiment, the input features of the task decoder comprise the initial prediction result of the classification module, the initial prediction result of the regression module, and the output features of the first three ResNet residual blocks, specifically as follows:

[0078] In the first decoding module, the input features of the classification task branch are the spliced feature vector of the classification module and the output features of the third ResNet residual block of the encoder, and the input features of the regression task branch are the spliced feature vector of the regression module and the output features of the third ResNet residual block of the encoder; in the second decoding module, the input features of the classification task branch are the output features of the classification task branch in the first decoding module and the output features of the second ResNet residual block of the encoder, and the input features of the regression task branch are the output features of the regression task branch in the first decoding module and the output features of the second ResNet residual block of the encoder; in the third decoding module, the input features of the classification task branch are the output features of the classification task branch in the second decoding module and the output features of the first ResNet residual block of the encoder, and the input features of the regression task branch are the output features of the regression task branch in the second decoding module and the output features of the first ResNet residual block of the encoder.

[0079] In an embodiment, the feature fusion module comprises, connected in series, a deconvolution layer, a normalization layer, a channel splicing module, and a convolution layer, and the channel splicing module is configured to perform a splicing operation on the output features of the normalization layer and the output features of the corresponding layer ResNet residual block in the channel dimension;

[0080] The first Mamba module is configured to perform the following operations:

[0081] The input features are input into the normalization layer to obtain third extracted features, the third extracted features are input into a linear layer and an activation function to obtain fourth extracted features, and the fourth extracted features are input into a linear layer, a one-dimensional convolution layer, an activation function, an SSD module, and a normalization layer to obtain fifth extracted features, the fourth extracted features and the fifth extracted features are multiplied to obtain sixth extracted features, and the input features and the sixth extracted features are added to obtain output features of the first Mamba module;

[0082] The second Mamba module is configured to perform the following operations:

[0083] The output features of the last first Mamba module corresponding to the classification task branch and the output features of the last first Mamba module corresponding to the regression task branch are spliced in the channel dimension, and then feature fusion is performed through a one-dimensional convolution layer to obtain fused features;

[0084] The output features of the last first Mamba module in the corresponding task branch are passed through a normalization layer to obtain the seventh extracted feature. The seventh extracted feature is passed through a linear layer and an activation function to obtain the eighth extracted feature. The ninth extracted feature is passed through a linear layer, a one-dimensional convolutional layer, an activation function, a CSSD module, and a normalization layer. The eighth and ninth extracted features are multiplied and then passed through a linear layer to obtain the tenth extracted feature. The output features of the corresponding task branch in the third decoding module and the tenth extracted feature are added to form the output features of the second Mamba module. The input features of the CSSD module also include fused features.

[0085] In one embodiment, the SSD module and the CSSD module have the same selection state space, calculated as follows:

[0086]

[0087] in, for t The hidden state at all times for t The hidden state at time -1 for t Input data at any time, , and for t The learnable parameters at time t are, in order, as follows: t Always keep t The weights of the hidden state at time -1 t The weights of the input data at time t. t The weights of the hidden states at each time step. T Indicates transpose. for t Output data at any given time.

[0088] In one embodiment, each prediction head includes a linear layer and an activation function connected in series.

[0089] In one embodiment, each sample in the training set includes the total load power at the corresponding time point. 、 The on / off status of each electrical device and the energy consumption of each electrical device.

[0090] In one embodiment, the multi-device, multi-tasking non-intrusive load identification method further includes the following steps:

[0091] Bilinear interpolation was used to unify the time series lengths of the initial prediction results and the true values ​​of the classification module, and the time series lengths of the initial prediction results and the true values ​​of the regression module, and the classification loss and regression loss were calculated accordingly.

[0092] corresponding to the final prediction result and the true value;

[0093] The total loss function is calculated according to the classification loss and the regression loss of the preliminary prediction module and the classification loss and the regression loss of the final prediction module, and is back propagated to update the parameters of the multi-task joint recognition model.

[0094] In an embodiment, the total loss function , and the formula is as follows:

[0095]

[0096] In the formula, represents the regression loss of the th level, represents the classification loss of the th level, A represents the classification weight, B represents the regression weight, represents the prediction value of the th level at the t th moment, represents the true value of the th level at the t th moment, =1 S , S is the number of levels, and takes the values of 1 and 2, then the 1st level represents the preliminary prediction module, and the 2nd level represents the task decoder, TL is the time sequence length of the final prediction result, that is, the time sequence length of the true value, t =1 TL .

[0097] Specifically, for ease of understanding, the following is described in detail in conjunction with the accompanying drawings.

[0098] The overall architecture of the multi-task joint recognition model is shown in Figure 2 , which includes an encoder (Encoder), a preliminary prediction module (Preliminary Predictions), a task decoder (Decoder), and a final prediction module (Final Predictions) connected in sequence. Pre-Decoder1 represents the first decoder of the classification module, Pre-Decoder2 represents the first decoder of the regression module, P represents a prediction head composed of a linear layer and an activation function, and C is a concatenation operation.

[0099] In addition, the overall architecture of the multi-task joint recognition model includes the following stages:

[0100] 1) Capture multi-level shared features of tasks and devices: the encoder is responsible for extracting shared features of tasks and devices (F s ) from the total load power of the input, and gradually extracting high-level features with higher abstraction levels (E1, E2, E3) from low-level features.

[0101] 2) Preliminary prediction: separate the classification task and the regression task from the shared features (F s ), and respectively decode to obtain the decoding features (F c ) of the classification module and the decoding features (F r ) of the regression module, and make preliminary predictions to obtain the initial prediction results (F cp ) of the classification module and the initial prediction results (F rp ) of the regression module, respectively, and perform splicing operations to obtain the splicing feature vector (F1) of the classification module and the splicing feature vector (F2) of the regression module, and calculate the loss value of the preliminary prediction results and the true value as part of the total loss function value.

[0102] 3) Capture task-level features: the task decoder takes the splicing feature vector (F1) of the classification module and the splicing feature vector (F2) of the regression module as input, extracts features shared by tasks and at the task level, and makes final result predictions. Calculate the loss value of the final prediction result and the true value, multiply the loss value of the preliminary prediction by the corresponding weight, and add it to the total loss function value for back propagation to update the model parameters.

[0103] The encoder is composed of four ResNet residual blocks connected in series, which can reduce gradient disappearance by using residual connection to skip part of the input data of the layer, which helps the fitting of the multi-task joint recognition model of the method. As shown in Figure 3 (b), the four ResNet residual blocks correspond to ResBlock1~ResBlock4, E1, E2, E3 and F s are the output features of ResBlock1~ResBlock4, y t ) is the input feature of the encoder, i.e. the total load power of multiple electrical devices, and the output features of the encoder are E1, E2, E3 and F s , F s , i.e. shared features. As shown in Figure 3 ​(a) shown is a structural diagram of ResNet residual block (ResBlock), ResBlock1~ResBlock4 have the same structure, the specific input and output can be different, Input and Output represent the input feature and output feature of ResNet residual block, Conv 5x5 represents a one-dimensional convolution layer with a convolution kernel of 5, Conv 1x1 represents a one-dimensional convolution layer with a convolution kernel of 1, ReLU represents a ReLU activation function, and MaxPooling is a maximum pooling layer. That is, the output of the ResNet residual block can be represented as:

[0104]

[0105] wherein, represents the output result after the first extracted feature and the second extracted feature are added, represents a fitting function of the ResNet residual block, represents the input feature (Input) of the ResNet residual block, and the ResBlock1~ResBlock4 are respectively total load power signals , E1, E2 and E3, and MaxPooling represents a maximum pooling layer for down-sampling.

[0106] The preliminary prediction module takes the shared feature (F s ) captured by the encoder as the input feature, separates the switch state classification task and the device-level energy disaggregation regression task of the electrical equipment into two branches (corresponding to the classification module and the regression module), and each branch is composed of a first decoder, a prediction head and a splicing operation, wherein the first decoder is composed of a one-dimensional convolution layer and a ReLU activation function in series, and the prediction head is composed of a linear layer and a ReLU activation function in series. Figure 2 , the decoding steps of the preliminary prediction module are as follows:

[0107] 1) respectively using the first decoder (Pre-Decoder1) of the classification module and the first decoder (Pre-Decoder2) of the regression module to decode the shared feature, corresponding to obtaining the decoding feature of the classification module and the decoding feature of the regression module;

[0108] 2) using the prediction head of the classification module to classify the decoding feature of the classification module to obtain the initial prediction result of the classification module, and simultaneously using the prediction head of the regression module to regress the decoding feature of the regression module to obtain the initial prediction result of the regression module;

[0109] 3) Concatenate the initial prediction result of the classification module and the decoding feature of the classification module in the channel dimension to obtain the concatenated feature vector (F1) of the classification module, and concatenate the initial prediction result of the regression module and the decoding feature of the regression module in the channel dimension to obtain the concatenated feature vector (F2) of the regression module, that is, the concat function is used for the concatenation operation;

[0110] 4) The time sequence lengths of the initial prediction result of the classification module and the true value are unified by using the bilinear interpolation method, and the time sequence lengths of the initial prediction result of the regression module and the true value are unified, and the classification loss (Loss) and the regression loss (Loss) are calculated correspondingly. Figure 2 Figure 2

[0111] As shown in Figure 4 (a), the overall structure of the task decoder, the task decoder includes three serial decoding modules outputting task level decoding features, the first decoding module to the third decoding module correspond to Decoder Block1~DecoderBlock3, the task level decoding features include and , is the classification feature vector of the third decoding module (that is, the output feature of the second Mamba module of the classification task branch of the third decoding module), is the regression feature vector of the third decoding module (that is, the output feature of the second Mamba module of the regression task branch of the third decoding module), which is the input feature of the corresponding prediction head of the final prediction module.

[0112] ​​The decoding module includes parallel classification and regression task branches. In the first decoding module, the input features of the classification task branch are the concatenated feature vector (F1) of the classification module and the output features (E3) of the third-layer ResNet residual block of the encoder. The input features of the regression task branch are the concatenated feature vector (F2) of the regression module and the output features (E3) of the third-layer ResNet residual block of the encoder. In the second decoding module, the input features of the classification task branch are the output features of the classification task branch in the first decoding module and the output features (E2) of the second-layer ResNet residual block of the encoder. The input features of the regression task branch are the output features of the regression task branch in the first decoding module and the output features (E2) of the second-layer ResNet residual block of the encoder. In the third decoding module, the input features of the classification task branch are the output features of the classification task branch in the second decoding module and the output features (E1) of the first-layer ResNet residual block of the encoder. The input features of the regression task branch are the output features of the regression task branch in the second decoding module and the output features (E1) of the first-layer ResNet residual block of the encoder. Both the classification task branch and the regression task branch include a feature fusion module, two first Mamba modules, and a second Mamba module connected in sequence.

[0113] like Figure 4 As shown in (b), this is the structure of a Decoder Block. FI1 represents a classification feature (such as the concatenated feature vector (F1) of the classification module, the output feature of the classification task branch in the first decoding module, or the output feature of the classification task branch in the second decoding module). EI represents an encoding feature (such as one of E3, E2, and E1). FI2 represents a regression feature (such as the concatenated feature vector (F2) of the regression module, the output feature of the regression task branch in the first decoding module, or the output feature of the regression task branch in the second decoding module). FO1 represents the output feature of the classification task branch of the corresponding decoding module, and FO2 represents the output feature of the regression task branch of the corresponding decoding module. B, L, and W represent the batch size, length, and number of channels, respectively. A Decoder Block consists of a classification task branch and a regression task branch running in parallel. Each task branch passes through a feature fusion module (DCR block), two concatenated first Mamba models (TM block, task-level Mamba), and a second Mamba model.

[0114] The feature fusion module (DCR block) is responsible for implementing the feature fusion of the corresponding classification features (FI) and the encoded features (EI). Since there is a dimensional difference between the two feature vectors, the feature fusion module also unifies the feature vector dimensions through deconvolution and standardization, then splices in the channel dimension, and finally uses a 1x1 convolution layer for feature fusion. As shown in Figure 5 , where FI represents FI1 or FI2, EI represents the encoded features, FOD represents the output features of the feature fusion module, DeConv represents the deconvolution layer, Norm represents the standardization layer, C represents the splicing operation, and Conv 1x1 represents the one-dimensional convolution layer with a convolution kernel of 1.

[0115] The first Mamba model decodes the input task-level features, is designed based on the Mamba-2 module, and benefits from the state space dual (SSD) framework, making GPU computation more efficient. As shown in Figure 6 , FOD represents the output features of the feature fusion module, FOT represents the output features of the first Mamba model, Norm represents the standardization layer, Linear represents the linear layer, Conv 3x3 represents the one-dimensional convolution layer with a convolution kernel of 3, R represents the ReLU activation function, SSD represents the state space dual, i.e., the SSD module, X represents the multiplication operation, and + represents the addition operation.

[0116] As shown in Figure 7 , the two second Mamba models of the classification task branch and the regression task branch together form the CM module (CM block, for cross-task-level Mamba), which extracts cross-task features using the output features of the first Mamba models of the two task branches as input. The second Mamba module uses the CSSD module based on the first Mamba model, as shown in Figure 7 . FOT1 represents the output features of the first Mamba model of the classification task branch, FOT2 represents the output features of the first Mamba model of the regression task branch, FOC1 is the output feature of the second Mamba model of the classification task branch, and FOC2 is the output feature of the second Mamba model of the regression task branch. The second Mamba module is used to perform the following operations:

[0117] First, the FOT1 and FOT2 of the two task branches are spliced in the channel dimension, then a 3x3 convolution is used for feature fusion, and then the resulting fusion features and the seventh extracted features are input into the CSSD module after passing through the linear layer, one-dimensional convolution layer, and activation function, i.e., the and two parameters in the SSD module are generated from the original single task feature to the fusion feature, thereby realizing cross-task feature extraction.

[0118] The final prediction module includes two parallel prediction heads, and the output features of the two second Mamba modules of the third decoding module are input into the prediction heads one by one, and the output features of the two prediction heads are the final prediction results. The prediction head is composed of a linear layer and a ReLU activation function. The classification loss (Loss) of the prediction head of the classification task of the final prediction module and the regression loss (Loss) of the prediction head of the regression task of the final prediction module are calculated. Figure 2 Figure 2

[0119] Since the application realizes the classification of the switching state of the electrical equipment and the disaggregation of the device-level energy consumption, the binary cross entropy loss (BCE) and the mean squared error (MSE) are selected as the loss functions of the classification loss and the regression loss, respectively, and the total loss function is calculated by combining the classification loss and the regression loss of the preliminary prediction module and the task decoder. As shown in Figure 8 The training process of the multi-task joint recognition model is as follows:

[0120] 1) Set hyperparameters: model parameters include channel number, convolution kernel size, step, experimental parameters include data length, data volume, learning rate, optimizer, loss function weight, training round number, early stopping;

[0121] 2) Determine whether the specified training round number is reached, if not, continue to train the multi-task joint recognition model, calculate the total loss function value and update the model parameters by back propagation, and loop until the specified training round number is reached;

[0122] 3) Keep the optimal model parameters to obtain the trained multi-task joint recognition model. The trained multi-task joint recognition model is used for classification prediction and regression prediction, and the final prediction result can be output.

[0123] The total loss function is a hybrid loss function formed by the preliminary prediction module and the final prediction module, which realizes the weighted summation of the two-level training loss functions to form the total loss function. Through the design of the two-level loss functions, the problem of gradient vanishing or explosion caused by the increase of the model depth is alleviated.

[0124] The training, verification and testing process of the embodiment is as follows:

[0125] 1) Obtain the data set: each sample in the data set includes the total load power 、 ​​The switch state of each electrical appliance and the energy consumption of each electrical appliance. Specifically, the REDD disclosure dataset includes six total load consumption data of American households, with a time range from 23 days to 48 days. The time resolution of the aggregate signal (total load power of multiple electrical appliances) is 1 second, and the time resolution of the application signal (load power of each electrical appliance, i.e. as the energy consumption label of each electrical appliance) is 3 seconds. In order to ensure the consistency of time alignment, the aggregate signal is down-sampled to 3 seconds to match the consistent sampling rate. The tested electrical appliances include refrigerator (FD), dishwasher (DW), microwave oven (MW) and dryer (WD), and the corresponding switch threshold values are set to 50w, 200w, 10w and 20w respectively, and if the power is greater than or equal to the switch threshold value, it is recorded as "1", otherwise "0", thereby obtaining the corresponding switch state label of the electrical appliance. Finally, the dataset is composed of the total load power of multiple electrical appliances, the switch state label of each electrical appliance and the energy consumption label of each electrical appliance. The load recognition result output by the trained multi-task joint recognition model includes two tasks of the switch state of the electrical appliance and the energy consumption of the electrical appliance.

[0126] 2) Comparative model

[0127] Comparison of five models, including: 1) STP (sequence to point) model, reference: Zhang C, Zhong M, Wang Z, et al. Sequence-to-point learning with neural networks for non-intrusive load monitoring [C] / / Proceedings of the AAAI conference on artificial intelligence. 2018, 32(1).; 2) TransUNet model, reference: Zhou K, Zhang Z, Lu X. Non-intrusive load monitoring based on an efficient deep learning model with local feature extraction[J]. IEEE Transactions on Industrial Informatics, 2024.; 3) SGN model, reference: Shin C, Joo S, Yim J, et al. Subtask gated networks for non-intrusive load monitoring[C] / / Proceedings of the AAAI conference on artificial intelligence. 2019, 33(01): 1150-1157.; 4) SAM model, reference: [1] Liu Y, Qiu J, Ma J. SAMNet: Toward latency-free non-intrusive load monitoring via multi-task deep learning[J]. IEEE Transactions on Smart Grid, 2021, 13(3): 2412-2424.; 5) MAT model, reference: Xiong J, Hong T, Zhao D, et al. MATNilm: Multi-appliance-task non-intrusive load monitoring with limited labeled data[J].IEEE Transactions on Industrial Informatics, 2023, 20(3):3177-3187.

[0128] 4) Performance indicators

[0129] The energy disaggregation performance indicators of the electrical appliance include the mean absolute error (MAE) and the signal aggregate error (SAE), and the switch state classification performance indicator is the F1 score. The corresponding calculation formulas are as follows:

[0130]

[0131] In the formula, TL denotes the length of the time series of the final prediction result, denotes the true value of the energy consumption of the electrical appliance at time t, denotes the predicted value of the energy consumption of the electrical appliance at time t, denotes the accuracy, denotes the recall rate, denotes the F1 score.

[0132] 5) Training, validation and testing

[0133] The data of the 2nd and 3rd households in the data set were selected for training and validation, respectively, and the data of the 1st household was selected for testing. The data volume for training, validation and testing was 7 days, 7 days and 30 days, respectively. The data length (time series length) of the input and output was 864, Adam was selected as the optimizer, the learning rate was 0.0001, early stopping was used to prevent overfitting, and the patience value was set to 30. The channel numbers of the four ResNet residual blocks (ResBlock1~ResBlock4) in the encoder were [16, 32, 64, 128], the convolution kernel size was 5, the channel numbers of the three decoding modules (Decoder Block1~Decoder Block3) of the task decoder were [64, 32, 16], the step size was 1, the weights A and B of the two-level loss function were both set to 1, and the number of training rounds was 300.

[0134] 6) Test results

[0135] The specific test results are shown in Table 1. The bolded numbers are the optimal model indicators under the same device and the same indicator. MAE and SAE are both errors, the smaller the better, and F1 is a score, the larger the better. As can be seen from Table 1, Metric represents the performance indicator, Model represents the model method, Parmas represents the parameter amount of the model method, Appliances represents the selected appliances in the experiment, DW, FD, MW and WD are dishwashers, refrigerators, microwaves and dryers respectively. The method proposed in the present application realizes similar performance to the other five comparative models under the premise of the smallest parameter amount, and among the five comparative models, only MAT is a multi-device classification and disaggregation, and the other four are single-device models. From the model parameter amount and performance indicators, the parameter amount of all models is larger than that of the present application, so the method proposed in the present application is more suitable for actual production and life, that is, the device performance requirement is lower, the deployment is more convenient, and the cost is low. In addition, since STP, TransUNet, SGN and SAM are all single-device models, multiple sets of model parameters need to be trained for multi-device application scenarios, and the training scheme is complex, while the model proposed in the present application only needs to train one set of model parameters to adapt to multi-device application scenarios, the training scheme is simple and efficient, and has lower parameter amount and higher calculation efficiency than MAT.

[0136] Table 1-REDD dataset performance comparison

[0137]

[0138] Each of the technical features of the above-described embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above-described embodiments are not described, but as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present disclosure.

[0139] The above-described embodiments only express the more specific and detailed embodiments described in the present application, but should not be construed as limiting the scope of the application. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of the present application should be subject to the appended claims.

Claims

1. A non-intrusive load identification method for multiple devices and multiple tasks, characterized in that: Includes the following steps: S1. Obtain the total load power of multiple electrical devices; S2. Establish a multi-task joint recognition model and train it using a training set. The multi-task joint recognition model includes an encoder, a preliminary prediction module, a task decoder, and a final prediction module connected in sequence, wherein: The encoder includes four cascaded ResNet residual blocks; The preliminary prediction module includes a parallel classification module and a regression module, both of which are used to perform the following operations: The shared features output by the encoder are decoded using the first decoder to obtain the decoded features; The prediction head is used to predict the decoded features to obtain initial prediction results; The initial prediction results and decoded features are concatenated along the channel dimension to obtain the concatenated feature vector. The task decoder includes three serially connected decoding modules. The input features of the task decoder include the initial prediction results of the classification module, the initial prediction results of the regression module, and the output features of the first three ResNet residual blocks. The decoding module includes parallel classification task branches and regression task branches. Each classification task branch and regression task branch includes a feature fusion module, two first Mamba modules, and a second Mamba module connected in sequence. The final prediction module includes two parallel prediction heads, and the output features of the two second Mamba modules of the third decoding module are input into the prediction heads one by one. The output features of the two prediction heads are the final prediction results. S3. Input the total load power of the multiple electrical devices to be identified into the trained multi-task joint recognition model, and obtain the corresponding final prediction result, which is the load recognition result.

2. The multi-device, multi-task, non-intrusive load identification method as described in claim 1, characterized in that: The ResNet residual block is used to perform the following operations: The input features of the ResNet residual block in the corresponding layer are sequentially passed through a convolutional layer, an activation function, and another convolutional layer to obtain the first extracted features, and then through a convolutional layer to obtain the second extracted features. The first extracted features and the second extracted features are added together, and then sequentially passed through an activation function and a max pooling layer to obtain the output features of the ResNet residual block in the corresponding layer.

3. The multi-device, multi-task, non-intrusive load identification method as described in claim 1, characterized in that: The first decoder includes a series of one-dimensional convolutional layers and a ReLU activation function.

4. The multi-device, multi-task, non-intrusive load identification method as described in claim 1, characterized in that: The input features of the task decoder include the initial prediction results of the classification module, the initial prediction results of the regression module, and the output features of the first three ResNet residual blocks, as detailed below: In the first decoding module, the input features for the classification task branch are the concatenated feature vector from the classification module and the output features of the third-layer ResNet residual block of the encoder; the input features for the regression task branch are the concatenated feature vector from the regression module and the output features of the third-layer ResNet residual block of the encoder. In the second decoding module, the input features for the classification task branch are the output features of the classification task branch in the first decoding module and the output features of the second-layer ResNet residual block of the encoder; the input features for the regression task branch are the output features of the regression task branch in the first decoding module and the output features of the second-layer ResNet residual block of the encoder. In the third decoding module, the input features for the classification task branch are the output features of the classification task branch in the second decoding module and the output features of the first-layer ResNet residual block of the encoder; the input features for the regression task branch are the output features of the regression task branch in the second decoding module and the output features of the first-layer ResNet residual block of the encoder.

5. The multi-device, multi-task, non-intrusive load identification method as described in claim 4, characterized in that: The feature fusion module includes a deconvolution layer, a normalization layer, a channel concatenation module, and a convolution layer connected in sequence. The channel concatenation module is used to concatenate the output features of the normalization layer with the output features of the corresponding ResNet residual block in the input layer in the channel dimension. The first Mamba module is used to perform the following operations: The input features are passed through a normalization layer to obtain the third extracted feature. The third extracted feature is passed through a linear layer and an activation function to obtain the fourth extracted feature. The fifth extracted feature is passed through a linear layer, a one-dimensional convolutional layer, an activation function, an SSD module, and a normalization layer. The fourth and fifth extracted features are multiplied and then passed through a linear layer to obtain the sixth extracted feature. Finally, the input features and the sixth extracted feature are added to form the output features of the first Mamba module. The second Mamba module is used to perform the following operations: The output features of the last first Mamba module of the corresponding classification task branch and the output features of the last first Mamba module of the regression task branch are concatenated in the channel dimension and then fused through a one-dimensional convolutional layer to obtain fused features. The output features of the last first Mamba module in the corresponding task branch are passed through a normalization layer to obtain the seventh extracted feature. The seventh extracted feature is passed through a linear layer and an activation function to obtain the eighth extracted feature. The seventh extracted feature is then passed through a linear layer, a one-dimensional convolutional layer, an activation function, a CSSD module, and a normalization layer to obtain the ninth extracted feature. The eighth and ninth extracted features are multiplied and then passed through a linear layer to obtain the tenth extracted feature. Finally, the output features of the corresponding task branch in the third decoding module and the tenth extracted feature are added to form the output features of the second Mamba module. The input features of the CSSD module also include fused features.

6. The multi-device, multi-task, non-intrusive load identification method as described in claim 5, characterized in that: The SSD module and the CSSD module have the same selection state space, calculated as follows: in, for t The hidden state at all times for t The hidden state at time -1 for t Input data at any time, , and for t The learnable parameters at time t are, in order, as follows: t Always keep t The weights of the hidden state at time -1 t The weights of the input data at time t. t The weights of the hidden states at each time step. T Indicates transpose. for t Output data at any given time.

7. The multi-device, multi-task, non-intrusive load identification method as described in claim 1, characterized in that: Each prediction head comprises a linear layer and an activation function connected in series.

8. The multi-device, multi-task, non-intrusive load identification method as described in claim 1, characterized in that: Each sample in the training set includes the total load power at the corresponding time point. 、 The on / off status of each electrical device and the energy consumption of each electrical device.

9. The multi-device, multi-tasking, non-intrusive load identification method as described in claim 1, characterized in that: The multi-device, multi-task, non-intrusive load identification method further includes the following steps: Bilinear interpolation was used to unify the time series lengths of the initial prediction results and the true values ​​of the classification module, and the time series lengths of the initial prediction results and the true values ​​of the regression module, and the classification loss and regression loss were calculated accordingly. The classification loss and regression loss are calculated accordingly between the final predicted results and the true values. The total loss function is calculated based on the classification and regression losses of the preliminary prediction module and the classification and regression losses of the final prediction module, and backpropagation is performed to update the parameters of the multi-task joint recognition model.

10. The multi-device, multi-tasking, non-intrusive load identification method as described in claim 9, characterized in that: The total loss function The formula is as follows: In the formula, Indicates the first Level of regression loss, Indicates the first Classification loss at each level, A Indicates the classification weight. B Indicates the regression weights. Indicates the first Level t The true value of a moment Indicates the first Level t Predicted value at time, =1~ S , S The value represents the number of levels, taking values ​​of 1 and 2. Level 1 represents the initial prediction module, and level 2 represents the task decoder. TL The time series length of the final prediction result, which is also the time series length of the true value. t =1~ TL .

Citation Information

Patent Citations

  • Non-intrusive load monitoring method based on multi-task learning

    CN116167654A

  • Non-intrusive load monitoring method and system based on multi-task learning model

    CN117272230A