Non-intrusive load identification method and system
By using transfer learning and an improved ResNet-50 model, combined with voltage-current trajectory image features, the high cost and time consumption of the NILM system in electrical appliance identification were solved, achieving efficient and accurate electrical appliance identification.
Patent Information
- Application Number
- CN202410473601.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2026-02-03
AI Technical Summary
With the rapid increase in the number and types of electrical appliances, existing non-intrusive load monitoring (NILM) systems face challenges in maintaining complex equipment identification models, which is costly, time-consuming, and difficult to obtain sufficient labeled data for training.
The transfer learning method is adopted, which utilizes pre-trained deep learning models such as the improved ResNet-50, combined with voltage-current trajectory image features, and trains the appliance recognition model through weighted pixelation processing and composite attention loss function to reduce the need for label data.
It improves the accuracy and generalization ability of appliance recognition, reduces model training costs, adapts to various complex scenarios, and reduces the use of label data.
Smart Images

Figure CN121456447A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-intrusive power load monitoring technology, and in particular to a non-intrusive load identification method and system. Background Technology
[0002] Non-intrusive load monitoring (NILM), a concept originally proposed by Hart, uses feature extraction and machine learning algorithms to analyze the input voltage and current of total power consumption and monitor appliance usage without deploying submeters. An indispensable step in NILM is classifier training, which uses machine learning algorithms to build classification models to identify different types of electrical loads. To validate the accuracy of different models, researchers have generated a wide variety of NILM datasets, including voltage and current measurements of appliance loads and their labels.
[0003] However, considering the practicalities of NILM, training complex device recognition models from scratch is expensive and time-consuming. Even creating a comprehensive database to build a classification model with strong generalization capabilities becomes challenging as the number and types of appliances rapidly increase. Transfer learning, a research problem in machine learning, focuses on applying knowledge gained while solving a problem to different but related problems. Unlike traditional machine learning methods, training and test samples in transfer learning do not need to be independent and identically distributed, and the labeled data for training samples does not need to be sufficient. Furthermore, classification models can be reused within the framework of transfer learning, rather than building separate models for each task, which reduces modeling and computational costs. To enable transfer learning in NILM, pre-trained classification models are needed to store relevant knowledge. In visual recognition tasks, models like AlexNet, VGG-16, GoogLeNet, and ResNet-50 are common. These models are carefully trained on millions of images, and we can transfer the knowledge stored within them from the domain of visual recognition to the domain of appliance recognition. In fact, voltage-current trajectory images, as a load feature, can serve as a bridge between computer vision and NILM. Summary of the Invention
[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.
[0005] In view of the aforementioned existing problems, the present invention is proposed.
[0006] Therefore, the present invention provides a non-invasive load identification method and system that can solve the problems mentioned in the background art.
[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a non-invasive load identification method, comprising:
[0008] The system acquires first voltage and current data before and after a load switching event within a fixed time period in the target load scenario, preprocesses the first voltage and current data, and performs weighted pixelation processing on the preprocessed first voltage and current data.
[0009] Obtain second current and voltage data maps before and after load event switching from a publicly available image dataset under similar load scenarios, and train a first electrical appliance recognition model based on the second current and voltage data maps;
[0010] The first electrical appliance recognition model is further trained and updated based on the first voltage and current data after weighted pixelation to obtain the second electrical appliance recognition model. Non-intrusive load recognition is then completed based on the second electrical appliance recognition model.
[0011] As a preferred embodiment of the non-intrusive load identification method of the present invention, the step of acquiring first voltage and current data before and after a load switching event within a fixed time period in the target load scenario, and preprocessing the first voltage and current data, includes:
[0012] Let the target load scenario be A, and the load switching events within a fixed time period under this scenario be denoted as {A1, A2, ..., A...}. i ,...,A n}, i∈n, where n represents all load switching events generated within this fixed time period, and load switching event A i This refers to the first voltage and current data before and after the load switching event;
[0013] Load switching event A i The event includes a unique identifier, switching event type, switching start and end time, ID of the first affected appliance, voltage data for the complete cycle before the event, voltage data for the complete cycle after the event, current data for the complete cycle before the event, and current data for the complete cycle after the event. The switching event type includes at least power-on, power-off, mode switching, power level adjustment, timed start, timed shutdown, fault shutdown, and recovery operation.
[0014] Load switching event A i Represented as {E i ,T i ST i ,ET i ID i QU i ,HUi QI i HI i}, where E i T represents a unique identifier for the i-th load switching event. i ST represents the switching event type of the i-th load switching event. i ET represents the start time of the i-th load switching event. i Indicates the end time of the i-th load switching event, ID. i QU represents the set of IDs of the first affected appliances in the i-th load switching event. i HU represents the voltage data within the complete cycle preceding the i-th load switching event. i QI represents the voltage data within the complete cycle following the i-th load switching event. i HI represents the current data within the complete cycle preceding the i-th load switching event. i This represents the current data within the complete cycle following the i-th load switching event;
[0015] The first set of affected appliance IDs contains the product serial numbers of all appliances affected in this load switching event;
[0016] The preprocessing includes standardizing and normalizing the first voltage and current data before and after the load switching event in the load switching event.
[0017] As a preferred embodiment of the non-invasive load identification method of the present invention, the weighted pixelation processing of the preprocessed first voltage and current data includes:
[0018] Set the target resolution for weighted pixelation processing. Let the target resolution be m×m. Then, multiply the preprocessed voltage and current data within the complete cycle before and after the event by m and round down to obtain a set of voltage and current data less than or equal to m, denoted as i. mm and v mm , is represented as:
[0019] i mm =floor(i m m),i m ={QI i HI i}
[0020] v mm =floor(v m m),v m =QU i ,HU i
[0021] Where floor(·) represents the floor function, im represents the preprocessed current data within the complete cycle before and after the event, and v m This represents the voltage data within the complete cycle before and after the preprocessed event;
[0022] Create an m×m zero matrix, taking values from row 1 to row 1 within a complete period, where the i-th value of each row is... mm and v mm The values at the m-th row and m-th column of the zero matrix are respectively assigned as 1. This process is repeated until the end to obtain the weighted pixelated results of the voltage and current data before and after the load event within the complete cycle, thus obtaining the voltage-current trajectory image under the load event.
[0023] As a preferred embodiment of the non-invasive load identification method of the present invention, the step of obtaining a second current-voltage data map before and after load event switching in a publicly available image dataset under similar load scenarios, and training a first electrical appliance identification model based on the second current-voltage data map, includes:
[0024] The second current and voltage data graph obtained from the publicly available image dataset under the same load scenario before and after the load event switching includes at least the unique identifier of the event, the ID of the second affected appliance, the voltage data within the complete cycle before the event, the voltage data within the complete cycle after the event, the current data within the complete cycle before the event, and the current data within the complete cycle after the event.
[0025] Obtain second current and voltage data maps before and after load event switching from publicly available image datasets under similar load scenarios, preprocess the second current and voltage data maps, and train a first electrical appliance recognition model based on the preprocessed second current and voltage data maps.
[0026] The input to the first appliance identification model is the preprocessed second current and voltage data graph, and the output is the second affected appliance ID, which includes the first affected appliance ID.
[0027] As a preferred embodiment of the non-intrusive load identification method of the present invention, the step of obtaining the second current and voltage data map before and after the load event switching in the publicly available image dataset under the same load scenario, and training the first electrical appliance identification model based on the second current and voltage data map, further includes using a composite attention loss function as the loss function of the first electrical appliance identification model. The composite attention loss function includes a category attention loss function and a time attention loss function.
[0028] As a preferred embodiment of the non-invasive load identification method of the present invention, the step of continuing to train and update the first electrical appliance identification model based on the first voltage and current data after weighted pixelation processing to obtain the second electrical appliance identification model includes:
[0029] The output of the first electrical appliance identification model is changed from the second affected appliance ID to the first affected appliance ID. The weighted pixelated voltage-current trajectory image is used as the input, and the first affected appliance ID in the load event corresponding to the voltage-current trajectory image is used as the output.
[0030] The weighted pixelated first voltage and current data are divided into a training set and a test set, with a ratio of 1:1. If the updated second appliance recognition model does not meet the preset evaluation criteria, the weighted pixelated first voltage and current data are reclassified into training and test sets. The new training set consists of the original training set and half of the test set, and the new test set consists of the remaining half of the test set. If the updated second appliance recognition model still does not meet the preset evaluation criteria, half of the test set from the previous classification is merged into the training set as the new training set, and the remaining half of the test set is used as the new test set, until the second appliance recognition model meets the preset evaluation criteria.
[0031] As a preferred embodiment of the non-invasive load identification method of the present invention, the preset evaluation indicators include:
[0032] If the evaluation index is not less than 95%, the second electrical appliance identification model is deemed to meet the preset evaluation index.
[0033] The expression for solving the evaluation index is as follows:
[0034]
[0035] Among them, W k W represents the weight of the k-th split between the training and test sets, which is related to the number of splits. k = 1 / (k+1) α α is the attenuation coefficient, 0.5≤α≤1}, S k This represents the combined score of the model under the k-th split between the training and test sets, calculated as follows:
[0036]
[0037] Where N represents the total number of samples, Accuracy represents the number of test set samples in the k-th partition. (k) =(TP) (k) +TN (k)Recall / N represents the accuracy at the k-th partition. (k) =TP (k) / (TP (k) +FN (k) ) represents the recall rate in the k-th partition, F1-Score (k) =2·Precision (k) •Recall (k) / (Precision (k) +Recall (k) () represents the F1 score under the k-th partition, Precision (k) =TP (k) / (TP (k) +FP (k) ), β1, β2, β3 represent weight coefficients, corresponding to the importance of precision, recall, and F1 score, respectively, and β1 + β2 + β3 = 1. TP represents the number of samples correctly predicted as the first affected appliance ID, TN represents the number of samples correctly predicted as a non-first affected appliance ID, FP represents the number of samples incorrectly predicted as the first affected appliance ID, and FN represents the number of samples incorrectly predicted as a non-first affected appliance ID. N train N represents the number of samples in the current training set. test This represents the current number of samples in the test set, and M represents the maximum allowed number of training / test set re-splits.
[0038] A non-invasive load identification system, comprising:
[0039] The data acquisition and processing module is used to acquire the first voltage and current data before and after the load switching event within a fixed time period in the target load scenario, and to preprocess the first voltage and current data, and to perform weighted pixelation processing on the preprocessed first voltage and current data.
[0040] The first model building module is used to obtain the second current and voltage data map before and after the load event switching in the publicly available image dataset under the same load scenario, and to train the first electrical appliance recognition model based on the second current and voltage data map.
[0041] The second model building module is used to continue training and updating the first electrical appliance recognition model based on the first voltage and current data after weighted pixelation processing, to obtain the second electrical appliance recognition model, and to complete non-intrusive load recognition based on the second electrical appliance recognition model.
[0042] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.
[0043] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0044] The beneficial effects of this invention are as follows: This invention proposes a non-intrusive load identification method and system. It acquires first voltage and current data before and after a load switching event within a fixed time period in a target load scenario, preprocesses the first voltage and current data, and performs weighted pixelation on the preprocessed data. It then acquires second current and voltage data images before and after the load event switching from a publicly available image dataset of similar load scenarios, and trains a first appliance identification model based on these images. The first appliance identification model is further trained and updated based on the weighted pixelation of the first voltage and current data to obtain a second appliance identification model. Non-intrusive load identification is then completed using this second model. Addressing the problem of insufficient labeled data for training deep neural network models for non-intrusive load identification in practical engineering, this invention designs a non-intrusive load identification method based on voltage-current image features and model pre-training. A deep learning model trained on a large-scale publicly available image dataset is used as a pre-training model for non-intrusive load identification. The pre-training model is fine-tuned using voltage-current image feature data from actual load scenarios, ultimately constructing an appliance identification model. This ensures high identification accuracy while reducing the use of labeled data. Attached Figure Description
[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0046] Figure 1 A flowchart of a non-invasive load identification method and system provided in one embodiment of the present invention;
[0047] Figure 2 A schematic diagram illustrating the model implementation of a non-intrusive load identification method and system according to an embodiment of the present invention;
[0048] Figure 3 This is an internal structural diagram of a computer device for a non-intrusive load identification method and system provided in one embodiment of the present invention. Detailed Implementation
[0049] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0050] Example 1
[0051] Reference Figure 1-3 This is the first embodiment of the present invention, which provides a non-invasive load identification method and system, including a non-invasive load identification method and a non-invasive load identification system, wherein the non-invasive load identification method includes:
[0052] S101, acquire the first voltage and current data before and after the load switching event within a fixed time period in the target load scenario, preprocess the first voltage and current data, and perform weighted pixelation processing on the preprocessed first voltage and current data.
[0053] The process of acquiring first voltage and current data before and after a load switching event within a fixed time period in the target load scenario, and preprocessing the first voltage and current data, includes: Let the target load scenario be A, and let the load switching events within a fixed time period in this scenario be denoted as {A1, A2, ..., A...}. i ,...,A n}, i∈n, where n represents all load switching events generated within this fixed time period, and load switching event A i This refers to the first voltage and current data before and after the load switching event;
[0054] It should be noted that load switching event A i It includes the unique identifier of the event, the switching event type, the start and end time of the switching, the ID of the first affected appliance, the voltage data for the complete cycle before the event, the voltage data for the complete cycle after the event, the current data for the complete cycle before the event, and the current data for the complete cycle after the event. The switching event type includes at least power-on, power-off, mode switching, power level adjustment, timed start, timed shutdown, fault shutdown, and recovery operation.
[0055] In this embodiment of the application, load switching event A i Represented as {E i ,T i ST i ,ET i ID i QU i ,HU i QI i HIi}, where E i T represents a unique identifier for the i-th load switching event. i ST represents the switching event type of the i-th load switching event. i ET represents the start time of the i-th load switching event. i Indicates the end time of the i-th load switching event, ID. i QU represents the set of IDs of the first affected appliances in the i-th load switching event. i HU represents the voltage data within the complete cycle preceding the i-th load switching event. i QI represents the voltage data within the complete cycle following the i-th load switching event. i HI represents the current data within the complete cycle preceding the i-th load switching event. i This represents the current data within the complete cycle following the i-th load switching event;
[0056] It should be noted that the first set of affected appliance IDs contains the product serial numbers of all appliances affected in this load switching event;
[0057] It should be noted that preprocessing includes standardizing and normalizing the first voltage and current data before and after the load switching event in the load switching event.
[0058] Furthermore, the weighted pixelation processing of the preprocessed first voltage and current data includes: setting the target resolution for weighted pixelation processing, assuming the target resolution is m×m, then multiplying the voltage data before and after the event complete cycle, and the current data before and after the event complete cycle by m respectively, and rounding down to obtain a set of voltage and current data less than or equal to m, denoted as i. mm and v mm , is represented as:
[0059] i mm =floor(i m m),i m ={QI i HI i}
[0060] v mm =floor(v m m),v m =QU i ,HU i
[0061] Where floor(·) represents the floor function, i m This represents the preprocessed current data within a complete cycle before and after the event, v mThis represents the voltage data within the complete cycle before and after the preprocessed event;
[0062] Furthermore, create a set of m×m zero matrices, taking values from the first row to the last row within a complete period, where the i-th value in each row... mm and v mm The values at the m-th row and m-th column of the zero matrix are respectively assigned as 1. This process is repeated until the end to obtain the weighted pixelated results of the voltage and current data before and after the load event within the complete cycle, thus obtaining the voltage-current trajectory image under the load event.
[0063] It should be noted that by performing weighted pixelation on the preprocessed first voltage and current data, the raw data can be transformed into a more easily understood and analyzed image format: a voltage-current trajectory image. This image format can intuitively display the trends in voltage and current changes before and after a load switching event, helping analysts quickly identify the characteristics and patterns of the load switching event, thereby enabling more accurate and efficient fault diagnosis and prediction. Automated and standardized data processing workflows can significantly reduce manual intervention and errors, improving the efficiency and accuracy of data processing. Simultaneously, weighted pixelation can transform high-dimensional data into low-dimensional image data, reducing the complexity and difficulty of data processing, further improving the efficiency of data analysis and processing.
[0064] S102, Obtain the second current and voltage data map before and after load event switching in the publicly available image dataset under the same load scenario, and train the first electrical appliance recognition model based on the second current and voltage data map;
[0065] The process of acquiring second current and voltage data maps before and after load event switching in publicly available image datasets under similar load scenarios, and training a first electrical appliance identification model based on the second current and voltage data maps, includes: acquiring second current and voltage data maps before and after load event switching in publicly available image datasets under similar load scenarios. The second current and voltage data maps include at least the unique identifier of the event, the ID of the second affected electrical appliance, voltage data within the complete cycle before the event, voltage data within the complete cycle after the event, current data within the complete cycle before the event, and current data within the complete cycle after the event.
[0066] In this embodiment of the application, the CIFAR-10 dataset is used to train the neural network.
[0067] Furthermore, the system obtains second current and voltage data maps before and after load event switching from publicly available image datasets under similar load scenarios, preprocesses the second current and voltage data maps, and trains a first electrical appliance recognition model based on the preprocessed second current and voltage data maps.
[0068] It should be noted that the input of the first appliance identification model is the preprocessed second current and voltage data graph, and the output is the second affected appliance ID, which includes the first affected appliance ID.
[0069] It should be noted that the second affected appliance ID is public data, and the scale of public data is large. Therefore, the first affected appliance ID is included in the second affected appliance ID.
[0070] Furthermore, obtaining second current and voltage data maps before and after load event switching from publicly available image datasets under similar load scenarios, and training the first electrical appliance recognition model based on the second current and voltage data maps, also includes using a composite attention loss function as the loss function of the first electrical appliance recognition model. The composite attention loss function includes a category attention loss function and a temporal attention loss function.
[0071] In this embodiment, the composite attention loss function is expressed as:
[0072] Calculate the attention weight α for each sample in each category. c Then compare it with the real category label y c Multiplication, as category attention loss:
[0073]
[0074] z c =ReLU(W c ·f(x)+b c ), c = 1, 2, ..., C
[0075] Where f(x) is the feature extraction result of the model on the input x (preprocessed current and voltage data), W c and b c Here, represents the weight matrix and bias vector for category c, respectively; ReLU is the activation function; and C is the total number of appliance categories.
[0076]
[0077] Where, p c Let c be the probability of class c in the probability distribution predicted by the model.
[0078] Calculate the attention weight β for each sample in the time dimension. t Then, it is multiplied by the feature vector at that time point as the temporal attention loss:
[0079]
[0080] u t =ReLU(V t ·f(x)t +d t ), t=1,2,…,T
[0081] Where, f(x) t V represents the feature vector of the model for input x at time point t. t and d t Here, represents the weight matrix and bias vector at time point t, respectively, and is counted as the number of time steps.
[0082]
[0083] Where, p t This represents the predicted probability of the model at time point t.
[0084] The composite attention loss combines category attention loss and temporal attention loss, aiming to guide the model to simultaneously focus on inter-class differences and time-series features, and is expressed as:
[0085] L CAL =L CALC +L CALT
[0086] In this embodiment, an improved ResNet-50 residual neural network is used for model training.
[0087] It should be noted that the traditional ResNet-50 is a deep residual network, belonging to the ResNet (Residual Network) series of models. Compared to traditional deep convolutional neural networks, it employs the idea of residual learning, introducing residual blocks to solve the gradient vanishing and gradient exploding problems in deep network training, thus enabling the training of deeper neural networks. Specifically, ResNet-50 contains a total of 50 deep network layers, including stacked residual blocks, global average pooling layers, and fully connected layers. The residual blocks mainly consist of several bottleneck blocks and base blocks. Each base block contains two convolutional layers, each followed by a batch normalization layer and a ReLU activation function. Each bottleneck block consists of three convolutional layers: a 1x1 convolutional layer, a 3x3 convolutional layer, and a 1x1 convolutional layer. The first 1x1 convolutional layer is used for dimensionality reduction, reducing the number of input channels, typically reducing the number of input channels to one-quarter of that in the base block. The number of output channels in a 3x3 convolutional layer is the growth rate (typically 64) multiplied by the dilation factor (typically 4), which is 256. The last 1x1 convolutional layer is used to restore the number of output channels to the size of the base block.
[0088] In this embodiment, to obtain the final classification result, the output of the last fully connected layer of the improved ResNet-50 residual neural network is passed to the softmax function. Then, all layers except the last fully connected layer are extracted from the pre-trained improved ResNet-50 residual neural network. By replacing the last fully connected layer with a new fully connected layer, the layers are transferred to a new device classification task. Figure 2 As shown.
[0089] It should be noted that by introducing a composite attention loss function, the model can simultaneously focus on inter-category differences and time-series features during training, thereby improving the accuracy of appliance identification. This improvement enables the model to more accurately identify affected appliances, reducing the possibility of false positives and false negatives. Pre-training using current and voltage data before and after load event switching from a publicly available image dataset allows the model to learn features of more types of appliances and load events. This allows the model to better adapt to various complex scenarios in practical applications, improving its generalization ability. By adopting an improved ResNet-50 residual neural network structure, the model can reduce training time while maintaining high performance. This is because the residual structure effectively solves the gradient vanishing and gradient exploding problems in deep network training, enabling the model to converge to the optimal solution faster. Since the model can more accurately identify affected appliances, this helps to take timely measures to solve problems, improving system reliability. At the same time, due to the model's strong generalization ability, it can adapt to various complex scenarios, further enhancing the system's stability.
[0090] S103, based on the first voltage and current data after weighted pixelation, continue to train and update the first electrical appliance recognition model to obtain the second electrical appliance recognition model, and complete the non-intrusive load recognition based on the second electrical appliance recognition model.
[0091] The process of training and updating the first electrical appliance identification model based on the first voltage and current data after weighted pixelation to obtain the second electrical appliance identification model includes: changing the output of the first electrical appliance identification model, changing the output from the second affected electrical appliance ID to the first affected electrical appliance ID, taking the voltage-current trajectory image after weighted pixelation as input, and taking the first affected electrical appliance ID in the load event corresponding to the voltage-current trajectory image as output;
[0092] Furthermore, the weighted pixelated first voltage and current data is divided into a training set and a test set, with a 1:1 ratio between the training set and the test set. If the updated second appliance recognition model does not meet the preset evaluation criteria, the weighted pixelated first voltage and current data is reclassified into training and test sets. The new training set consists of the original training set and half of the test set, and the new test set consists of the remaining half of the test set. If the updated second appliance recognition model still does not meet the preset evaluation criteria, half of the test set from the previous classification is merged into the training set as the new training set, and the remaining half of the test set is used as the new test set, until the second appliance recognition model meets the preset evaluation criteria.
[0093] In this embodiment, a pre-trained improved ResNet-50 residual neural network is transferred to the NILM task, with a voltage-current trajectory image as input. The image size should be adjusted to match the input neurons of the improved ResNet-50. The output is the category of the power load. A new fully connected layer is configured with the same size as the power load category. Loads among users are continuously identified to obtain the real-time operating status of each load device.
[0094] Furthermore, the preset evaluation indicators include: if the evaluation indicator is not less than 95%, then the second electrical appliance identification model is deemed to meet the preset evaluation indicators.
[0095] The expression for solving the evaluation index is as follows:
[0096]
[0097] Among them, W k W represents the weight of the k-th split between the training and test sets, which is related to the number of splits. k = 1 / (k+1) α α is the attenuation coefficient, 0.5≤α≤1}, S k This represents the combined score of the model under the k-th split between the training and test sets, calculated as follows:
[0098]
[0099] Where N represents the total number of samples, Accuracy represents the number of test set samples in the k-th partition. (k) =(TP) (k) +TN (k) Recall / N represents the accuracy at the k-th partition. (k) =TP (k) / (TP (k) +FN (k) ) represents the recall rate in the k-th partition, F1-Score (k)=2·Precision (k) •Recall (k) / (Precision (k) +Recall (k) () represents the F1 score under the k-th partition, Precision (k) =TP (k) / (TP (k) +FP (k) ), β1, β2, β3 represent weight coefficients, corresponding to the importance of precision, recall, and F1 score, respectively, and β1 + β2 + β3 = 1. TP represents the number of samples correctly predicted as the first affected appliance ID, TN represents the number of samples correctly predicted as a non-first affected appliance ID, FP represents the number of samples incorrectly predicted as the first affected appliance ID, and FN represents the number of samples incorrectly predicted as a non-first affected appliance ID. N train N represents the number of samples in the current training set. test This represents the current number of samples in the test set, and M represents the maximum allowed number of training / test set re-splits.
[0100] In this embodiment, the above steps ensure that the appliance identification model is continuously optimized during training, gradually improving its recognition accuracy and generalization ability. This gradual optimization and updating method allows the appliance identification model to better adapt to various complex power load conditions, improving the accuracy and stability of non-intrusive load identification. Simultaneously, by pre-setting evaluation indicators and gradually adjusting the training / test set partitioning, the appliance identification model can be ensured to gradually approach the optimal solution during training, avoiding overfitting and underfitting problems, and further improving the model's recognition performance.
[0101] Furthermore, this method of incremental optimization and updating can effectively address noise and outliers in power load data, improving the model's robustness. Simultaneously, by continuously adjusting weight coefficients and re-splitting the training / test sets, the model can become more adaptable to different data distributions and characteristics, enhancing its versatility and scalability.
[0102] In summary, this invention proposes a non-intrusive load identification method. It acquires first voltage and current data before and after a load switching event within a fixed time period in a target load scenario, preprocesses the first voltage and current data, and performs weighted pixelation on the preprocessed data. It then acquires second current and voltage data images before and after the load event switching from a publicly available image dataset of similar load scenarios, and trains a first appliance identification model based on these images. The first appliance identification model is further trained and updated based on the weighted pixelation of the first voltage and current data to obtain a second appliance identification model. Non-intrusive load identification is then performed using this second model. Addressing the problem of insufficient labeled data for training deep neural network models for non-intrusive load identification in practical engineering, this invention designs a non-intrusive load identification method based on voltage-current image features and model pre-training. A deep learning model trained on a large-scale publicly available image dataset is used as a pre-training model for non-intrusive load identification. The pre-training model is fine-tuned using voltage-current image feature data from actual load scenarios, ultimately constructing an appliance identification model. This method ensures high accuracy while reducing the use of labeled data.
[0103] In a preferred embodiment, a non-invasive load identification system includes:
[0104] The data acquisition and processing module is used to acquire the first voltage and current data before and after the load switching event within a fixed time period in the target load scenario, and to preprocess the first voltage and current data, and to perform weighted pixelation processing on the preprocessed first voltage and current data.
[0105] The first model building module is used to obtain the second current and voltage data map before and after the load event switching in the publicly available image dataset under the same load scenario, and to train the first electrical appliance recognition model based on the second current and voltage data map.
[0106] The second model building module is used to continue training and updating the first electrical appliance recognition model based on the first voltage and current data after weighted pixelation, so as to obtain the second electrical appliance recognition model and complete the non-intrusive load recognition based on the second electrical appliance recognition model.
[0107] The above-mentioned unit modules can be embedded in the processor of the computer device in hardware form or independent of it, or they can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of the above modules.
[0108] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a non-intrusive load identification method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0109] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0110] The system acquires first voltage and current data before and after a load switching event within a fixed time period in the target load scenario, preprocesses the first voltage and current data, and performs weighted pixelation processing on the preprocessed first voltage and current data.
[0111] Obtain second current and voltage data maps before and after load event switching from a publicly available image dataset under similar load scenarios, and train a first electrical appliance recognition model based on the second current and voltage data maps;
[0112] The first electrical appliance recognition model is further trained and updated based on the first voltage and current data after weighted pixelation to obtain the second electrical appliance recognition model. Non-intrusive load recognition is then completed based on the second electrical appliance recognition model.
[0113] Example 2
[0114] Reference Figure 1-3 As an embodiment of the present invention, a non-invasive load identification method and system are provided. To verify the beneficial effects of the present invention, comparative experiments are conducted for scientific demonstration.
[0115] 1) Obtain data from the PLAID dataset and process the data;
[0116] According to the method of the present invention, the original voltage and current waveforms of 11 target load devices (i.e., air conditioners, fans, refrigerators, hair dryers, heaters, incandescent light bulbs, laptops, microwave ovens, washing machines, vacuum cleaners, and dishwashers) in the PLAID dataset should be transferred to the visual representation to achieve transfer learning.
[0117] 2) Transfer the improved ResNet-50 model pre-trained on the visual recognition dataset to train the NILM classifier. Extract all layers except the last fully connected layer from the pre-trained improved ResNet-50, and transfer the layers to a new device classification task by replacing the last fully connected layer with a new fully connected layer. Input the extracted voltage-current trajectory data into the network structure for training to obtain the network model.
[0118] 3) Test the trained model to verify its performance.
[0119] Table 1. Identification Probability of Equipment Load Identification Results for Different Target Loads
[0120]
[0121] As can be seen from Table 1, the non-invasive load identification method of the present invention achieved a high identification probability for various target load devices. In particular, for simple load devices such as heaters and light bulbs, the identification probability even reached 100%. For other devices, the identification probability was also generally high, exceeding 96%, which fully demonstrates the effectiveness of the present invention.
[0122] Compared to traditional non-invasive load identification methods, the method of this invention does not require a large amount of labeled data for training. Instead, it utilizes publicly available large-scale image datasets for pre-training and then fine-tunes it based on voltage-current image feature data from actual load scenarios. This method not only ensures the accuracy of identification but also significantly reduces the use of labeled data, lowering the difficulty and cost in practical applications.
[0123] Furthermore, this invention preprocesses voltage and current data through weighted pixelation, enabling the model to better learn the characteristics of the load equipment. Simultaneously, the design of the first and second model building modules makes the model training process more scientific and efficient, further improving the accuracy of load identification.
[0124] In summary, the non-intrusive load identification method and system of the present invention have significant advantages and effects in practical applications, providing strong technical support for the development of smart grids, smart homes and other fields.
[0125] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
[0126] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0127] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0128] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0129] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0130] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0131] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A non-invasive load identification method, characterized in that, include: The system acquires first voltage and current data before and after a load switching event within a fixed time period in the target load scenario, preprocesses the first voltage and current data, and performs weighted pixelation processing on the preprocessed first voltage and current data. Obtain second current and voltage data maps before and after load event switching from a publicly available image dataset under similar load scenarios, and train a first electrical appliance recognition model based on the second current and voltage data maps; The first electrical appliance recognition model is further trained and updated based on the first voltage and current data after weighted pixelation to obtain the second electrical appliance recognition model. Non-intrusive load recognition is then completed based on the second electrical appliance recognition model.
2. The non-invasive load identification method as described in claim 1, characterized in that, The step of acquiring the first voltage and current data before and after the load switching event within a fixed time period in the target load scenario, and preprocessing the first voltage and current data, includes: Let the target load scenario be A, and the load switching events within a fixed time period under this scenario be denoted as {A1, A2, ..., A...}. i ,...,A n }, i∈n, where n represents all load switching events generated within this fixed time period, and load switching event A i This refers to the first voltage and current data before and after the load switching event; Load switching event A i The event includes a unique identifier, switching event type, switching start and end time, ID of the first affected appliance, voltage data for the complete cycle before the event, voltage data for the complete cycle after the event, current data for the complete cycle before the event, and current data for the complete cycle after the event. The switching event type includes at least power-on, power-off, mode switching, power level adjustment, timed start, timed shutdown, fault shutdown, and recovery operation. Load switching event A i Represented as {E i ,T i ST i ,ET i ID i QU i ,HU i QI i HI i }, where E i T represents a unique identifier for the i-th load switching event. i ST represents the switching event type of the i-th load switching event. i ET represents the start time of the i-th load switching event. i Indicates the end time of the i-th load switching event, ID. i QU represents the set of IDs of the first affected appliances in the i-th load switching event. i HU represents the voltage data within the complete cycle preceding the i-th load switching event. i QI represents the voltage data within the complete cycle following the i-th load switching event. i HI represents the current data within the complete cycle preceding the i-th load switching event. i This represents the current data within the complete cycle following the i-th load switching event; The first set of affected appliance IDs contains the product serial numbers of all appliances affected in this load switching event; The preprocessing includes standardizing and normalizing the first voltage and current data before and after the load switching event in the load switching event.
3. The non-invasive load identification method as described in claim 2, characterized in that, The weighted pixelation process for the preprocessed first voltage and current data includes: Set the target resolution for weighted pixelation processing. Let the target resolution be m×m. Then, multiply the preprocessed voltage and current data within the complete cycle before and after the event by m and round down to obtain a set of voltage and current data less than or equal to m, denoted as i. mm and v mm , is represented as: i mm =floor(i m m),i m ={QI i ,HI i } in mm =floor(in m m),v m =QU i ,HU i Where floor(·) represents the floor function, im represents the preprocessed current data within the complete cycle before and after the event, and v m This represents the voltage data within the complete cycle before and after the preprocessed event; Create an m×m zero matrix, taking values from row 1 to row 1 within a complete period, where the i-th value of each row is... mm and v mm The values at the m-th row and m-th column of the zero matrix are respectively assigned as 1. This process is repeated until the end to obtain the weighted pixelated results of the voltage and current data before and after the load event within the complete cycle, thus obtaining the voltage-current trajectory image under the load event.
4. The non-invasive load identification method as described in claim 3, characterized in that, The step of obtaining second current and voltage data maps before and after load event switching in a publicly available image dataset under similar load scenarios, and training a first electrical appliance recognition model based on the second current and voltage data maps, includes: The second current and voltage data graph obtained from the publicly available image dataset under the same load scenario before and after the load event switching includes at least the unique identifier of the event, the ID of the second affected appliance, the voltage data within the complete cycle before the event, the voltage data within the complete cycle after the event, the current data within the complete cycle before the event, and the current data within the complete cycle after the event. Obtain second current and voltage data maps before and after load event switching from publicly available image datasets under similar load scenarios, preprocess the second current and voltage data maps, and train a first electrical appliance recognition model based on the preprocessed second current and voltage data maps. The input to the first appliance identification model is the preprocessed second current and voltage data graph, and the output is the second affected appliance ID, which includes the first affected appliance ID.
5. The non-invasive load identification method as described in claim 4, characterized in that, The step of obtaining the second current and voltage data map before and after the load event switching in the publicly available image dataset under the same load scenario, and training the first electrical appliance recognition model based on the second current and voltage data map, further includes using a composite attention loss function as the loss function of the first electrical appliance recognition model. The composite attention loss function includes a category attention loss function and a temporal attention loss function.
6. The non-invasive load identification method as described in claim 5, characterized in that, The step of continuing to train and update the first electrical appliance recognition model based on the first voltage and current data after weighted pixelation to obtain the second electrical appliance recognition model includes: The output of the first electrical appliance identification model is changed from the second affected appliance ID to the first affected appliance ID. The weighted pixelated voltage-current trajectory image is used as the input, and the first affected appliance ID in the load event corresponding to the voltage-current trajectory image is used as the output. The weighted pixelated first voltage and current data are divided into a training set and a test set, with a ratio of 1:
1. If the updated second appliance recognition model does not meet the preset evaluation criteria, the weighted pixelated first voltage and current data are reclassified into training and test sets. The new training set consists of the original training set and half of the test set, and the new test set consists of the remaining half of the test set. If the updated second appliance recognition model still does not meet the preset evaluation criteria, half of the test set from the previous classification is merged into the training set as the new training set, and the remaining half of the test set is used as the new test set, until the second appliance recognition model meets the preset evaluation criteria.
7. The non-invasive load identification method as described in claim 6, characterized in that, The preset evaluation indicators include: If the evaluation index is not less than 95%, the second electrical appliance identification model is deemed to meet the preset evaluation index. The expression for solving the evaluation index is as follows: Among them, W k W represents the weight of the k-th split between the training and test sets, which is related to the number of splits. k = 1 / (k+1) α α is the attenuation coefficient, 0.5≤α≤1}, S k This represents the combined score of the model under the k-th split between the training and test sets, calculated as follows: Where N represents the total number of samples, Accuracy represents the number of test set samples in the k-th partition. (k) =(TP) (k) +TN (k) Recall / N represents the accuracy at the k-th partition. (k) =TP (k) / (TP (k) +FN (k) ) represents the recall rate in the k-th partition, F1-Score (k) =2·Precision (k) •Recall (k) / (Precision (k) +Recall (k) () represents the F1 score under the k-th partition, Precision (k) =TP (k) / (TP (k) +FP (k) ), β1, β2, β3 represent weight coefficients, corresponding to the importance of precision, recall, and F1 score, respectively, and β1 + β2 + β3 = 1. TP represents the number of samples correctly predicted as the first affected appliance ID, TN represents the number of samples correctly predicted as a non-first affected appliance ID, FP represents the number of samples incorrectly predicted as the first affected appliance ID, and FN represents the number of samples incorrectly predicted as a non-first affected appliance ID. N train N represents the number of samples in the current training set. test This represents the current number of samples in the test set, and M represents the maximum allowed number of training / test set re-splits.
8. A non-invasive load identification system, characterized in that, include: The data acquisition and processing module is used to acquire the first voltage and current data before and after the load switching event within a fixed time period in the target load scenario, and to preprocess the first voltage and current data, and to perform weighted pixelation processing on the preprocessed first voltage and current data. The first model building module is used to obtain the second current and voltage data map before and after the load event switching in the publicly available image dataset under the same load scenario, and to train the first electrical appliance recognition model based on the second current and voltage data map. The second model building module is used to continue training and updating the first electrical appliance recognition model based on the first voltage and current data after weighted pixelation processing, to obtain the second electrical appliance recognition model, and to complete non-intrusive load recognition based on the second electrical appliance recognition model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.