Lightweight non-intrusive load identification method and system based on feature partitioning
By constructing a lightweight load identification model for feature blocking, the problems of insufficient identification accuracy and high complexity in the prior art are solved, and high precision and low complexity load identification is achieved, which is suitable for embedded environments.
Patent Information
- Application Number
- CN202510218154.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-07-04
AI Technical Summary
Existing load identification technologies have shortcomings in identification accuracy and model complexity, and are not suitable for embedded environment deployment.
Using a lightweight non-invasive load identification method based on feature blocking, the load identification model including initial convolutional layer, LSTM module, DenseNet structure and global average pooling layer is simplified, and the feature construction process is reduced and the computational complexity is reduced.
It improves load recognition accuracy and reduces the amount of model parameters, making it suitable for embedded applications.
Smart Images

Figure CN120256906A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of non-intrusive load identification, and in particular, relates to a lightweight non-intrusive load identification method and system based on feature partitioning. Background Art
[0002] Non-Intrusive Load Monitoring (NILM) is a technology that infers the energy consumption patterns of individual electrical appliances by analyzing the total household electricity signal. Its core idea is to utilize the household bus signal, analyze the household electricity consumption data, identify the operating characteristics of electrical appliances, so as to achieve intelligent monitoring and refined decomposition of household energy consumption. An important advantage of NILM technology is that no additional sensors need to be installed, so it has become a key tool for household energy management and optimization. Its main processes include data acquisition, event detection, feature extraction, and load identification, etc.
[0003] For example, the Chinese patent document with the publication number CN116599040A discloses a non-intrusive electrical load identification method, including: collecting corresponding electrical characteristic data through a monitoring device preset at the user-side power inlet, processing the collected electrical characteristic data through a preset electrical load characteristic model to obtain corresponding step mutation variables, judging whether there is a sudden change in active power, if a sudden change occurs, extracting corresponding electrical quantity characteristics and non-electrical quantity characteristics; using the electrical quantity characteristics and the non-electrical quantity characteristics as input quantities to input a pre-trained non-intrusive load decomposition model, selecting the optimal electrical quantity characteristics and the optimal non-electrical quantity characteristics, and identifying electrical equipment according to the selected optimal electrical quantity characteristics and optimal non-electrical quantity characteristics to obtain the final electrical load identification result.
[0004] In the data acquisition stage, an intelligent electricity meter or a similar device collects the total current, voltage and other electrical parameters of the household and records them as time series data. These high-resolution raw data contain the comprehensive operating information of all electrical appliances in the household and are the basis for subsequent analysis.
[0005] Event detection is a key step in NILM technology, aiming to identify the moment when the switch state of an electrical appliance changes. By analyzing the fluctuations in the total electricity signal, the switch events of electrical appliances can be accurately located, providing an accurate time reference for subsequent feature extraction and load decomposition. After the event is effectively detected, a complete cycle of voltage and current can be extracted from the steady-state sequences before and after the event. Extract the switch state characteristics of the current before and after the event.
[0006] After the feature extraction is completed, in the load identification stage, machine learning or deep learning models are used to classify the extracted features, and the total load signal is accurately decomposed into specific electrical appliances. These models can accurately map the operating modes of electrical appliances to achieve accurate identification of electrical appliances and energy consumption decomposition.
[0007] Through comprehensive signal analysis and efficient algorithm design, NILM technology provides refined monitoring and energy consumption optimization solutions for household electricity usage without the need for additional hardware devices, with important application value and broad development prospects.
[0008] However, there are still some deficiencies in existing load identification technologies:
[0009] 1. There are still certain deficiencies in the identification accuracy of some existing load identification methods.
[0010] 2. The complexity of the graph-based load identification method is relatively high during the construction of the feature graph, making it difficult to be efficiently implemented in practical applications.
[0011] 3. The number of model parameters of existing load identification methods is relatively large and is not suitable for deployment in embedded environments. Summary of the Invention
[0012] The present invention provides a lightweight non-intrusive load identification method and system based on feature partitioning, aiming to improve the load identification accuracy while simplifying the model structure and reducing the computational complexity.
[0013] A lightweight non-intrusive load identification method based on feature partitioning includes the following steps:
[0014] (1) Obtain high-frequency current and voltage data of a single cycle through a public dataset, locate the switch events of electrical appliances in the obtained time series data, and extract the activation current and activation voltage before and after the switch events;
[0015] (2) Calculate the feature matrix according to the extracted activation current and activation voltage. The features include activation current, reactive current, and instantaneous power; add the features to the feature list and splice the feature dimensions. After standardizing each feature dimension, partition the features;
[0016] (3) Construct a load identification model. The load identification model includes an initial convolutional layer, an LSTM module, a DenseNet structure composed of multiple DenseBlocks and TransitionLayers, and a final global average pooling layer and classification layer; each DenseBlock contains a DenseLayer with ECA attention;
[0017] (4) Use the data processed in step (2) as the training set to train the constructed load identification model so that the model can accurately identify the energy consumption patterns of different electrical appliances;
[0018] (5) During the application process, first extract the activation current and activation voltage through the event detection method, and then input the calculated features in blocks into the load identification model for load identification.
[0019] In step (1), extract the activation current and activation voltage before and after the switching event. The specific process is as follows:
[0020] Extract the switching state characteristics of the current before and after the switching event. Starting from the zero-crossing point where the voltage changes from negative to positive, record the current of one cycle in the off state as I_off, and the current of one cycle in the on state as I_on; define the activation current as I = I_on - I_off, and I is the current of one voltage cycle.
[0021] Starting from the zero-crossing point where the voltage changes from negative to positive, record the voltage of one cycle in the off state as V_off, and the voltage of one cycle in the on state as V_on; define the activation voltage as V = (V_on + V_off) / 2.
[0022] In step (2), the process of calculating the reactive current and instantaneous power is as follows:
[0023] The calculation formula for the active current is:
[0024]
[0025] where: I a (t) is the active current at time t, representing the component of the current in the voltage direction; V(t) represents the activation voltage signal at time t; V rms represents the root mean square value of the voltage for normalization; T represents the time length of one voltage cycle; I(τ) represents the activation current signal;
[0026] The calculation formula for the reactive current is:
[0027] I n (t) = I(t) - I a (t)
[0028] where, I n (t) is the reactive current, representing the remaining part orthogonal to the active current; I(t) is the activation current signal at time t;
[0029] The calculation formula for the instantaneous power is:
[0030] P(t) = V(t) * I(t)
[0031] Where P(t) is the instantaneous power at time t.
[0032] In step (3), the initial convolution layer uses a 1×1 convolution layer to map the number of channels of the input signal to the preset initial number of channels; followed by batch normalization and ReLU activation to ensure the numerical stability and nonlinear expression ability of the features, and extract the preliminary features of the input signal for subsequent LSTM module input.
[0033] In step (3), the input feature dimension of the LSTM module is consistent with the output of the initial convolutional layer; the number of hidden layer units of the LSTM module is set to 40; the LSTM module is used to capture the temporal dynamic features in the input signal and provide temporal context for subsequent feature extraction.
[0034] In step (3), the DenseNet structure setting includes three DenseBlocks, and the first two DenseBlocks are connected to a transition layer TransitionLayer to control the feature dimension and the amount of calculation;
[0035] Each DenseBlock is composed of 4 stacked DenseLayers. The output of each DenseLayer is fused with its input by splicing to achieve layer-by-layer accumulation and reuse of features. The processing flow inside each DenseLayer includes: preprocessing, depthwise separable convolution, ECA attention mechanism and feature splicing.
[0036] The transition layer TransitionLayer performs feature compression and dimensionality reduction between DenseBlocks to prevent the feature dimension and parameter quantity from increasing too quickly.
[0037] The global average pooling layer compresses the features after all DenseBlocks and TransitionLayers into a single vector in the time dimension to achieve global feature aggregation; the classification layer processes the feature vector after global average pooling through the fully connected layer and outputs the load identification result.
[0038] A lightweight non-intrusive load identification system based on feature block, comprising a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the above-mentioned non-intrusive load identification method.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] 1. Improve load identification accuracy: The accuracy of load identification is improved through more precise feature block processing.
[0041] 2. Simplify the feature construction process: Compared with traditional methods, there is no need for complex feature mapping, reducing the complexity of model implementation.
[0042] 3. Significantly reduce the number of model parameters: Through lightweight design, the number of parameters of the model is significantly reduced compared with the existing technology, making it more suitable for embedded applications. Description of the Drawings
[0043] Figure 1 Schematic diagram for obtaining the activation current and activation voltage in the embodiments of the present invention.
[0044] Figure 2 Schematic diagram of active current, reactive current and instantaneous power in the embodiments of the present invention.
[0045] Figure 3 Network architecture diagram of the load identification model in the embodiments of the present invention. Detailed Embodiments
[0046] The following further describes the present invention in detail with reference to the drawings and embodiments. It should be noted that the following embodiments are intended to facilitate the understanding of the present invention, but do not limit it in any way.
[0047] A lightweight non-intrusive load identification method based on feature partitioning includes the following steps:
[0048] Step 1: Prepare the dataset
[0049] First, extract one-cycle high-frequency current and voltage data from the public dataset. These data will serve as the basis for subsequent model training and application.
[0050] Consider extracting electrical appliance features within a short-time window, which only contains a single event feature obtained from the aggregated power measurement. This helps to distinguish different electrical appliances by using the characteristics when the electrical appliance starts. Define the activation current I and activation voltage V as the single-cycle steady-state signals extracted from the aggregated current waveform within a short time after the state transition. To obtain the activation current, collect Ns complete cycles of current and voltage before and after the state transition, denoted as I_off and V_off before the transition and I_on and V_on after the transition respectively. For the PLAID dataset, Ns = 2 is selected.
[0051] These Ns cycles correspond to the steady-state behavior, equivalent to collecting Ts×Ns sampling points. Among them, Ts = fs / f; fs is the sampling frequency and f is the power grid frequency.
[0052] As Figure 1As shown, each collected cycle is aligned at the voltage zero-crossing point, and then one cycle of activation current and voltage before and after conversion is extracted from it. Since the current waveform has good additivity, the activation current can be obtained by differentiating the aggregated signal. The specific calculation method is as follows:
[0053] I = I_on - I_off
[0054] V = (V_on + V_off) / 2
[0055] Based on the activation current and voltage data extracted above, subsequent feature calculations will be performed, and the data will be chunked according to an appropriate time window for model training and further analysis.
[0056] Step 2: Calculate features, perform chunking, and design the model structure.
[0057] Calculate the feature matrix according to the extracted activation current and activation voltage. The features include current, reactive current, and instantaneous power, as Figure 2 shown.
[0058] The current feature I (activation current) and voltage feature V (activation voltage) extracted through events are respectively formed into a batch, denoted by cur and vol.
[0059] The input signals are cur, vol, and N. cur is the current signal matrix with a shape of b×dim; vol is the voltage signal matrix with a shape of b×dim; N is the number of chunks. The output is feats, representing the processed feature matrix.
[0060] The flow of the entire algorithm is as follows:
[0061] 1. Obtain the batch size b and dimension dim of the input matrix. Then calculate the reactive current and instantaneous power for each group of current and voltage samples. 2. The formula for calculating the active current is:
[0062]
[0063] where: I a (t) is the active current at time t, representing the component of the current in the voltage direction; V(t) represents the activation voltage signal at time t; V rms represents the root mean square value of the voltage for normalization; T represents the time length of a voltage cycle; I(τ) represents the activation current signal.
[0064] 3. The formula for calculating the reactive current is:
[0065] I n (t) = I(t) - I a (t)
[0066] Among them, I n (t) is the reactive current, representing the remaining part orthogonal to the active current; I(t) is the activation current signal at time t;
[0067] 4. The calculation formula for instantaneous power is:
[0068] pow(t) = V(t) * I(t)
[0069] 5. Initialize an empty feature list Define an empty list feats to store features.
[0070] 6. Add features to the list Add cur, I n (t), and pow to the feats list in sequence.
[0071] 7. Concatenate feature dimensions Reshape feats into the shape (b, -1, 3), that is, each sample contains 3 features (current, reactive current, and power).
[0072] 8. Standardize features Perform the following operations on each feature dimension:
[0073] Calculate the mean: m = mean(feats[:, :, i]), where m represents the mean of this dimension.
[0074] Calculate the standard deviation: s = std(feats[:, :, i]), where s represents the standard deviation of this dimension.
[0075] Use the Z-score standardization formula: Among them: m, s, feats[:, :, i]: are the mean, standard deviation, and corresponding feature value respectively. -∈>0 is a small constant used to prevent division by zero.
[0076] 9. Generate feature blocks Reshape feats into the shape:
[0077] feats = reshape(feats, (-1, N, dim / N, 3))
[0078] That is, divide the data into N blocks, and each block contains the corresponding features.
[0079] As Figure 3 shown, the constructed load identification model includes an initial convolutional layer, an LSTM module, a DenseNet structure composed of multiple DenseBlocks and TransitionLayers, and a final global average pooling layer and classification layer; each DenseBlock contains a DenseLayer with ECA attention.
[0080] 1. Initial convolutional layer
[0081] Function: Extract the preliminary features of the input signal and map the number of channels.
[0082] Implementation details: Use a 1×1 convolutional layer to map the number of channels of the input signal to a preset initial number of channels.
[0083] Immediately followed by batch normalization and ReLU activation to ensure that the features have good numerical stability and non-linear expression ability.
[0084] Output: The processed features are used as the input for the subsequent LSTM module.
[0085] 2. LSTM Module
[0086] Function: Capture the temporal dynamic features in the input signal.
[0087] Implementation details: The input feature dimension of the LSTM module is the same as the output of the initial convolutional layer, which is 40.
[0088] The number of hidden layer units is set to 40, which can effectively capture the dynamic changes of the time series while ensuring a moderate scale of model parameters.
[0089] Function: Before inputting the data into the DenseNet structure, extract temporal information through LSTM to provide temporal context for subsequent feature extraction.
[0090] 3. DenseNet Structure
[0091] It consists of multiple DenseBlocks and transition layers TransitionLayer. A total of 3 DenseBlocks are set, and both of the first two DenseBlocks are followed by TransitionLayer to control the feature dimension and computational complexity.
[0092] (1) DenseBlock
[0093] Composition: Each DenseBlock is stacked by 4 DenseLayers.
[0094] Feature: The output of each DenseLayer is fused with its input in a concatenated manner to achieve the layer-by-layer accumulation and reuse of features.
[0095] Feature concatenation between layers enables the network to capture rich feature information with fewer parameters.
[0096] (2) TransitionLayer
[0097] Function: Perform feature compression and dimensionality reduction between DenseBlocks to prevent the rapid increase of feature dimensions and the number of parameters.
[0098] Implementation details: Use 1×1 convolution for channel number compression.
[0099] Subsequently, perform average pooling operation with a kernel size of 2 and a stride of 2 to reduce the temporal length of the features.
[0100] 4. DenseLayer
[0101] The processing flow inside each DenseLayer is as follows:
[0102] Preprocessing: Perform BN and ReLU activation on the input features to enhance the expression ability and numerical stability of the features.
[0103] Depthwise separable convolution
[0104] Depthwise convolution: Independently perform convolution on each input channel using a convolution with a kernel size of 3, and set the stride to 1.
[0105] Pointwise convolution: Use 1×1 convolution to integrate the features obtained by Depthwise convolution into the specified number of output channels (growth_rate = 20).
[0106] Advantages: By decomposing the standard convolution into two steps, the number of parameters and computational cost are significantly reduced.
[0107] ECA attention mechanism
[0108] Global statistics: First, extract the statistical information of each channel through global average pooling (AvgPool1).
[0109] Weight generation: Transpose the pooled result to (batch, 1, channels).
[0110] Use one-dimensional convolution (convolution kernel size is 3) to generate channel attention weights, and then normalize through Sigmoid activation.
[0111] Feature reweighting: Expand the generated channel weights to the same dimension as the original features, and multiply them element-wise with the features to emphasize key information.
[0112] Feature concatenation
[0113] Concatenate the output (x_processed) after the above processing with the original input (x_in): Formula: x_out = Concat(x_in, x_processed)
[0114] This concatenation method realizes the accumulation of features and the full utilization of cross-layer information.
[0115] 5. Global Average Pooling and Classification Layer
[0116] Global Average Pooling (GAP): Compresses the features after passing through all DenseBlocks and TransitionLayers into a single vector in the time series dimension to achieve global feature aggregation.
[0117] Classification layer: Processes the feature vector after GAP through a fully connected layer and outputs the load identification results corresponding to num_classes categories.
[0118] Step 3: Training and application of the model.
[0119] Use the processed feature data as the training set to train the constructed load identification model so that the model can accurately identify the energy consumption patterns of different electrical appliances.
[0120] During the application process, first extract the current and voltage features through an event detection method; then block the features and input them into the load identification model for load identification.
[0121] The above-described embodiments have detailed the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the present invention. Any modifications, supplements, and equivalent replacements made within the scope of the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A lightweight non-intrusive load identification method based on feature partitioning, characterized in that It includes the following steps: (1) Obtain high-frequency current and voltage data for a single cycle through a public dataset, locate the switch events of the electrical appliances in the obtained time-series data, and extract the activation current and activation voltage before and after the switch events; (2) Calculate the feature matrix based on the extracted activation current and activation voltage. The features include activation current, reactive current, and instantaneous power; Add the features to the feature list and splice the feature dimensions. After normalizing each feature dimension, divide the features into blocks; (3) Construct a load identification model. The load identification model includes an initial convolutional layer, an LSTM module, a DenseNet structure composed of multiple DenseBlocks and TransitionLayers, and a final global average pooling layer and classification layer; each DenseBlock contains a DenseLayer with ECA attention; (4) Use the data processed in step (2) as the training set to train the constructed load identification model so that the model can accurately identify the energy consumption patterns of different electrical appliances; (5) During the application process, first extract the activation current and activation voltage through an event detection method, and then divide the calculated features into blocks and input them into the load identification model for load identification.
2. The lightweight non-intrusive load identification method based on feature partitioning according to claim 1, characterized in that In step (1), the activation current and activation voltage before and after the switch event are extracted. The specific process is as follows: Extract the switch state features of the current before and after the switch event. Starting from the zero-crossing point where the voltage changes from negative to positive, record the current for one cycle in the off state as I_off, and the current for one cycle in the on state as I_on; define the activation current as I = I_on - I_off, and I is the current for one cycle; Starting from the zero-crossing point where the voltage changes from negative to positive, record the voltage for one cycle in the off state as V_off, and the voltage for one cycle in the on state as V_on; define the activation voltage as V = (V_on + V_off) / 2.
3. The lightweight non-intrusive load identification method based on feature partitioning according to claim 1, characterized in that, In step (2), the process of calculating the reactive current and instantaneous power is as follows: The calculation formula for the active current is: Where: I a (t) is the active current at time t, representing the component of the current in the voltage direction; V(t) represents the activation voltage signal at time t; V rms represents the root mean square value of the voltage, which is used for normalization; T represents the time length of a voltage cycle; I(τ) represents the activation current signal; The calculation formula for the reactive current is: I n (t) = I(t) - I a (t) where I n (t) is the reactive current, representing the remaining part orthogonal to the active current; I(t) is the activation current signal at time t; The calculation formula for the instantaneous power is: P(t) = V(t)*I(t) where P(t) is the instantaneous power at time t.
4. The lightweight non-intrusive load identification method based on feature block according to claim 1, characterized in that In step (3), the initial convolutional layer uses a 1×1 convolutional layer to map the number of channels of the input signal to a preset initial number of channels; then batch normalization and ReLU activation are performed to ensure the numerical stability and non-linear expression ability of the features, and the preliminary features of the input signal are extracted for input to the subsequent LSTM module.
5. The lightweight non-intrusive load identification method based on feature partitioning according to claim 4, characterized in that In step (3), the input feature dimension of the LSTM module is the same as the output of the initial convolutional layer; the number of hidden layer units of the LSTM module is set to 40; the LSTM module captures the temporal dynamic features in the input signal to provide temporal context for subsequent feature extraction.
6. The lightweight non-intrusive load identification method based on feature partitioning according to claim 5, characterized in that, In step (3), the DenseNet structure is set to include 3 DenseBlocks, and a transition layer TransitionLayer is connected after the first two DenseBlocks to control the feature dimension and computational complexity; Each DenseBlock is stacked by 4 DenseLayers. The output of each DenseLayer is fused with its input in a concatenated manner to achieve the layer-by-layer accumulation and reuse of features. The processing flow within each DenseLayer includes: preprocessing, depthwise separable convolution, ECA attention mechanism, and feature concatenation; The TransitionLayer compresses and reduces the dimension of features between DenseBlocks to prevent the rapid increase of feature dimensions and the number of parameters.
7. The lightweight non-intrusive load identification method based on feature partitioning according to claim 6, wherein The global average pooling layer compresses the features after passing through all DenseBlocks and TransitionLayers into a single vector in the time series dimension to achieve global feature aggregation. The classification layer processes the feature vector after global average pooling through a fully connected layer and outputs the load identification result.
8. A lightweight non-intrusive load identification system based on feature partitioning, characterized in that It includes a memory and one or more processors. Executable code is stored in the memory. When the one or more processors execute the executable code, it is used to implement the non-intrusive load identification method described in any one of claims 1-7.
Citation Information
Patent Citations
Non-intrusive electrical load identification method
CN116599040A
Cited By
Non-intrusive load identification method and storage medium
CN121906428A