Generation of recognition model for household electrical appliance and device thereof
Through the combination of Adaboost model and BP neural network, and using the feature vector training data set, a more accurate and reliable household appliance usage pattern recognition model is generated, which solves the limitations of traditional technology in accuracy and robustness and achieves high performance. Accurate electrical appliance identification.
Patent Information
- Application Number
- CN202410733557.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-15
AI Technical Summary
Traditional non-intrusive load monitoring techniques have limitations in accuracy and robustness, and are especially difficult to effectively differentiate between household appliances with similar power characteristics.
The Adaboost model is combined with the BP neural network to generate a more accurate and reliable household appliance usage pattern recognition model by using feature vectors in the training data set such as average power consumed during operation, time period information and maximum power changes.
It achieved a test set accuracy of 95%, improved the accuracy and reliability of recognition of home appliance usage patterns, and surpassed the performance of individual BP neural networks and SVM.
Smart Images

Figure CN118779767A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of household appliance identification, and in particular to a generation of an identification model for household appliances and a device thereof. Background Art
[0002] With the rapid development of smart home and smart grid technologies, accurate household appliance usage pattern recognition has become increasingly important for energy efficiency optimization, power safety monitoring, and smart device management. Although traditional NILM (Non-intrusive Load Monitoring) technology can achieve household appliance usage monitoring to a certain extent, it is still limited in accuracy and robustness, especially for appliances with similar power characteristics that are difficult to effectively distinguish.
[0003] Therefore, designing a more accurate and reliable household appliance usage pattern recognition model becomes an urgent problem to be solved. Summary of the invention
[0004] The object of the present invention is to provide a method for generating an identification model of a household appliance and a device thereof.
[0005] In order to achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a method for generating a recognition model for household appliances, comprising the following steps: obtaining a training data set D = {(x1, y1), (x2, y2), ..., (x N ,y n )}, where x i is the eigenvector, y i is x i The corresponding electrical appliance category label, sample (x i ,y i ) has a weight of w i =1 / N, N and i are both natural numbers, N≥2, 1≤i≤N; create an Adaboost model, in which the weak classifier is a BP neural network model, and the Adaboost model can create T BP neural network models h1,h2,...,h T , the recognition model is α t h is the BP neural network model t The corresponding weights, where t and T are natural numbers, T ≥ 2, 1 ≤ t ≤ T; based on the training data set D, and w1, w2, ..., w N , for the BP neural network model h1,h2,...,h T Perform one training.
[0006] As a further improvement of an embodiment of the present invention, the “based on taking a training data set D, and w1, w2, ..., w N , for the BP neural network model h1,h2,...,h T Each training is performed once" specifically includes: BP neural network model h1,h2,...,h T Any h t The training process includes: using the training data set D = {(x1, y1), (x2, y2), …, (x N ,y N )}, and w1,w2,...,w N Train the BP neural network model h t ; The error rate of the BP neural network model on the training data set D Where I(·) is the indicator function. If y i Not equal to h t (x i ) then I(y i ≠h t (x i ))=1, if y i Equal to h t (x i ) then I(y i ≠h t (x i ))=0;Calculate the BP neural network model h t Weight Num=w i exp(-α t y i h t (x i )),w i =Num, for w1,w2,...,w N All are normalized; where i=1, 2, ..., N.
[0007] As a further improvement of an embodiment of the present invention, the feature vector includes at least: average power consumed during operation, time period information during operation, duration of operation, and maximum power change during operation.
[0008] As a further improvement of an embodiment of the present invention, the “using the training data set D = {(x1, y1), (x2, y2), …, (x N ,y N )}, and w1,w2,...,w N Train the BP neural network model h t "Specifically include: generating y1,y2,…,y NOne-hot encoding y′1, y′2, …, y′ N , for x1,x2,…,x N After normalization, the dataset {(x1,y′1),(x2,y′2),…,(x N ,y′ N )}, and w1,w2,...,w N Train the BP neural network model h t .
[0009] As a further improvement of an embodiment of the present invention, the “for x1, x2, …, x N Standardization processing" specifically includes: using the z-score method to standardize x1, x2, ..., x N Perform standardization.
[0010] The embodiment of the present invention further provides a device for generating a recognition model for household appliances, comprising the following modules: a data acquisition module for acquiring a training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, where x i is the eigenvector, y i is x i The corresponding electrical appliance category label, sample (x i ,y i ) has a weight of w i =1 / N, N and i are both natural numbers, N≥2, 1≤i≤N; a model creation module, used to create an Adaboost model, in which the weak classifier is a BP neural network model, and the Adaboost model can create T BP neural network models h1, h2, ..., h T , the recognition model is α t h is the BP neural network model t The corresponding weights, where t and T are natural numbers, T ≥ 2, 1 ≤ t ≤ T; based on the training data set D, and w1, w2, ..., w N , for the BP neural network model h1,h2,...,h T Perform one training.
[0011] As a further improvement of an embodiment of the present invention, the model creation module is also used for: BP neural network model h1, h2, ..., h T Any h t The training process includes: using the training data set D = {(x1, y1), (x2, y2), …, (xN ,y N )}, and w1,w2,...,w N Train the BP neural network model h t ; The error rate of the BP neural network model on the training data set D Where I(·) is the indicator function. If y i Not equal to h t (x i ) then I(y i ≠h t (x i ))=1, if y i Equal to h t (x i ) then I(y i ≠h t (x i ))=0;Calculate the BP neural network model h t Weight Num=w i exp(-α t y i h t (x i )),w i =Num, for w1,w2,...,w N All are normalized; where i=1, 2, ..., N.
[0012] As a further improvement of an embodiment of the present invention, the feature vector includes at least: average power consumed during operation, time period information during operation, duration of operation, and maximum power change during operation.
[0013] As a further improvement of an embodiment of the present invention, the model creation module is further used to: generate y1, y2, ..., y N One-hot encoding y′1, y′2, …, y′ N , for x1,x2,…,x N After normalization, the dataset {(x1,y′1),(x2,y′2),…,(x N ,y′ N )}, and w1,w2,...,w N Train the BP neural network model h t .
[0014] As a further improvement of an embodiment of the present invention, the model creation module is further used to: use the z-score method to calculate x1, x2, ..., x N Standardization
[0015] Compared with the prior art, the technical effect of the present invention is that: the embodiment of the present invention provides a method for generating a recognition model for household appliances and a device thereof, the generation method comprising the following steps: obtaining a training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, create an Adaboost model, in which the weak classifier is a BP neural network model, and the Adaboost model can create T BP neural network models, and the BP neural network models h1,h2,...,h T The generation method can obtain a more accurate and reliable household appliance usage pattern recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of a method for generating an identification model for household appliances in an embodiment of the present invention;
[0017] Figure 2 It is a structural diagram of the BP neural network model in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The present invention will be described in detail below in conjunction with the various embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0019] As used herein, terms indicating spatial relative positions such as "upper," "above," "lower," and "below" are used for the purpose of convenience to describe the relationship of one unit or feature relative to another unit or feature as shown in the accompanying drawings. Terms of spatial relative position may be intended to include different orientations of the device in use or operation in addition to the orientation shown in the drawings. For example, if the device in the figure is turned over, units described as being "below" or "beneath" other units or features will be located "above" the other units or features. Thus, the exemplary term "below" can encompass both above and below orientations. The device may be oriented in other ways (rotated 90 degrees or in other orientations), and the spatially relative descriptors used herein interpreted accordingly.
[0020] Furthermore, it should be understood that although the terms first, second, etc. may be used herein to describe various elements or structures, these described objects should not be limited by these terms. These terms are only used to distinguish these described objects from each other. For example, a first end may be referred to as a second end, and similarly a second end may also be referred to as a first end, without departing from the scope of protection of this application.
[0021] Embodiment 1 of the present invention provides a method for generating an identification model for household appliances, such as Figure 1 As shown, the following steps are included:
[0022] Step 101: Obtain training data set D = {(x1, y1), (x2, y2), …, (x N ,y N )}, where x i is the eigenvector, y i is x i The corresponding electrical appliance category label, sample (x i ,y i ) has a weight of w i =1 / N, N and i are both natural numbers, N≥2, 1≤i≤N;
[0023] Here, the feature vector may include: average power consumed during operation, time period information during operation, duration of operation, and maximum power change during operation.
[0024] Here, y i The value range of can be several integers, for example, i =1 represents an electric water heater, y i =-1 represents a washing machine, etc. The time period information may be morning, noon or evening, etc. The duration is the time difference between turning on and off the household appliance during this operation.
[0025] The training data set D may be collected through a non-intrusive load monitoring system, and the feature vector may also include: power value, timestamp, etc.
[0026] For example, if the feature vector consists of: T d : Event duration, assuming that an electric water heater lasts 30 minutes and a washing machine lasts 45 minutes. s : Event start time, assuming that the electric water heater is usually used at 6 am and the washing machine at 8 pm. ΔP max : The maximum power change is 3000 watts for electric water heaters and 2000 watts for washing machines. Then, the feature vector of an electric water heater usage event can be X wH = [30,6,3000], the feature vector of a washing machine usage event may be X WH =[45,20,2000].
[0027] Step 102: Create an Adaboost model. In the Adaboost model, the weak classifier is a BP (Back Propagation) neural network model. The Adaboost model can create T BP neural network models h1, h2, ..., h T , the recognition model is α t h is the BP neural network model t The corresponding weights, where t and T are natural numbers, T ≥ 2, 1 ≤ t ≤ T; based on the training data set D, and w1, w2, ..., w N , for the BP neural network model h1,h2,...,h T Perform one training.
[0028] Here, it is assumed that in the first round, a BP neural network h1 is trained, and then the sample weights are updated according to α1, and then the next BP neural network h2 is trained using the updated weights, and this cycle is repeated until all T rounds of training are completed. In this way, each BP neural network is trying to correct the samples that the previous network failed to correctly classify, and the final model H(x) can effectively improve the overall accuracy of load identification.
[0029] In the inventor's experiment, when t = 1, the error rate ∈1 = 0.3 was obtained, and the weight α1 was calculated as
[0030]
[0031] In this embodiment, the “based on taking the training data set D, and w1, w2, ..., w N , for the BP neural network model h1,h2,...,h T Each training is performed once" specifically includes: BP neural network model h1,h2,...,h T Any h t The training process includes: using the training data set D = {(x1, y1), (x2, y2), …, (x N ,y N )}, and w1,w2,...,w N Train the BP neural network model h t ; The error rate of the BP neural network model on the training data set D Where I(·) is the indicator function. If y i Not equal to h t (x i ) then I(y i ≠h t (x i ))=1, if yi Equal to h t (x i ) then I(y i ≠h t (x i ))=0.
[0032] Here, I(·) is an indicator function used to indicate whether a condition is true. i ≠h t (x i ) holds, that is, if the classifier h t For sample x i The prediction result h t (x i ) and the true label y i If they are not equal, then I(y i ≠h t (x i )) has a value of 1; if the predicted result is equal to the true label, then I(y i ≠h t (x i )) has a value of 0.
[0033] The role of this indicator function is to calculate the sum of the weights of samples that are misclassified by the classifier, and then calculate the weighted error rate ∈ of the entire model t The denominator in the formula is the sum of all sample weights, ensuring that ∈ t is a normalized ratio representing the total error rate on the weighted training dataset.
[0034] Calculate the BP neural network model h t Weight Num=w i exp(-α t y i h t (x i )),w i =Num, for w1,w2,...,w N All are normalized; where i=1, 2, ..., N.
[0035] Here, the sample weights are updated according to the prediction results of the BP neural network, increasing the weights of the misclassified samples and reducing the weights of the correctly classified samples. t+1 The weight distribution is a probability distribution, so the weights of all samples are normalized.
[0036] In this embodiment, the feature vector includes at least: average power consumed during operation, time period information during operation, duration of operation, and maximum power change during operation.
[0037] In this embodiment, the “using the training data set D = {(x1, y1), (x2, y2), …, (x N ,y N )}, and w1,w2,...,w N Train the BP neural network model h t "Specifically include: generating y1,y2,…,y N One-hot encoding y′1, y′2, …, y′ N , for x1,x2,…,x N After normalization, the dataset {(x1,y′1),(x2,y′2),…,(x N ,y′ N )}, and w1,w2,...,w N Train the BP neural network model h t .
[0038] Here, the average power consumed during operation, the time period information during operation, the duration of operation, the maximum power change during operation, etc., their dimensions, orders of magnitude, etc. are generally different, and therefore, can be standardized.
[0039] In this embodiment, the “for x1, x2, …, x N Standardization processing" specifically includes: using the z-score method to standardize x1, x2, ..., x N Perform standardization.
[0040] In the experiment of the invention, it was found that the accuracy of the Adaboost model on the test set was 95%, while the accuracy of the BP neural network alone was 90% and that of the SVM (Support Vector Machine) was 88%.
[0041] Figure 2 The structure diagram of a BP neural network is shown. The input of the BP neural network is x1, x2, ..., x N , where the nodes of the input layer correspond to the features extracted from each power consumption event. For example, x1 can be the duration T of the event d , X2 can be the start time T of the event s , X3 is the maximum power change ΔPmax.
[0042] Weight W 13 and W 23The weights connect the neurons in the input layer and the hidden layer to adjust the importance of the input signal. Each weight represents the importance of the corresponding input feature in the prediction result.
[0043] Hidden layer neurons f(z1) and f(z2) etc. The neurons in the hidden layer transform the weighted input into output through a non-linear activation function. These functions help the network learn complex patterns.
[0044] Activation function f, which is used to introduce nonlinearity so that the network can learn and simulate more complex functions. Common activation functions include Sigmoid, ReLU, etc. In the recognition of household appliance usage patterns, since the goal is classification (electric water heater or washing machine), Sigmoid (for binary classification) or Softmax (if multi-classification is considered in the future) can be selected.
[0045] Embodiment 2 of the present invention provides a device for generating an identification model for household appliances, comprising the following modules:
[0046] The data acquisition module is used to obtain the training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, where x i is the eigenvector, y i is x i The corresponding electrical appliance category label, sample (x i ,y i ) has a weight of w i =1 / N, N and i are both natural numbers, N≥2, 1≤i≤N;
[0047] A model creation module is used to create an Adaboost model. In the Adaboost model, the weak classifier is a BP neural network model. The Adaboost model can create T BP neural network models h1, h2, ..., h T , the recognition model is α t h is the BP neural network model t The corresponding weights, where t and T are natural numbers, T ≥ 2, 1 ≤ t ≤ T; based on the training data set D, and w1, w2, ..., w N , for the BP neural network model h1,h2,...,h T Perform one training.
[0048] In this embodiment, the model creation module is also used for: BP neural network model h1, h2, ..., h T Any h tThe training process includes: using the training data set D = {(x1, y1), (x2, y2), …, (x N ,y N )}, and w1,w2,...,w N Train the BP neural network model h t ; The error rate of the BP neural network model on the training data set D Where I(·) is the indicator function. If y i Not equal to h t (x i ) then I(y i ≠h t (x i ))=1, if y i Equal to h t (x i ) then I(y i ≠h t (x i ))=0;Calculate the BP neural network model h t Weight Num=w i exp(-α t y i h t (x i )),w i =Num, for w1,w2,...,w N All are normalized; where i=1, 2, ..., N.
[0049] In this embodiment, the feature vector includes at least: average power consumed during operation, time period information during operation, duration of operation, and maximum power change during operation.
[0050] In this embodiment, the model creation module is also used to generate y1, y2, ..., y N One-hot encoding y′1, y′2, …, y′ N , for x1,x2,…,x N After normalization, the dataset {(x1,y′1),(x2,y′2),…,(x N ,y′ N )}, and w1,w2,...,w N Train the BP neural network model h t .
[0051] In this embodiment, the model creation module is further used to: use the z-score method to calculate x1, x2, ..., x NPerform standardization.
[0052] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.
[0053] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0054] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0055] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.
Claims
1. A method for generating an identification model for household appliances, characterized in that: The following steps are involved: Get the training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, where x i is the eigenvector, y i is x i The corresponding electrical appliance category label, sample (x i ,y i ) has a weight of w i =1 / N, N and i are both natural numbers, N≥2, 1≤i≤N; Create an Adaboost model, in which the weak classifier is a BP neural network model, and the Adaboost model can create T BP neural network models h1, h2, ..., h T , the recognition model is α t h is the BP neural network model t The corresponding weights, where t and T are natural numbers, T ≥ 2, 1 ≤ t ≤ T; based on the training data set D, and w1, w2, ..., w N , for BP neural network models h1, h2, ..., h T Perform one training.
2. The generation method according to claim 1, characterized in that: The "based on taking the training data set D, and w1, w2, ..., w N , for BP neural network models h1, h2, ..., h T "Perform one training" specifically includes: BP neural network model h1, h2, ..., h T Any h t The training process includes: using the training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, and w1, w2, ..., w N Train the BP neural network model h t ; The error rate of the BP neural network model on the training data set D Where I(·) is the indicator function. If y i Not equal to h t (x i ) then I(y i ≠h t (x i ))=1, if y i Equal to h t (x i ) then I(y i ≠h t (x i ))=0;Calculate the BP neural network model h t Weight Num=w i exp(-α t y i h t (x i )),w i =Num, for w1, w2, ..., w N All are normalized; where i=1, 2, ..., N.
3. The generation method according to claim 1, characterized in that: The feature vector includes at least: average power consumed during operation, time period information during operation, duration of operation, and maximum power change during operation.
4. The generation method according to claim 3, characterized in that: The "using training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, and w1, w2, ..., w N Train the BP neural network model h t Specifically include: Generate y1, y2, ..., y N One-hot encoding y′1, y′2, ..., y′ N , for x1, x2, ..., x N After normalization, the dataset {(x1, y′1), (x2, y′2), ..., (x N , y′ N )}, and w1, w2, ..., w N Train the BP neural network model h t .
5. The generation method according to claim 4, characterized in that: The "for x1, x2, ..., x N Standardization processing specifically includes: Using the z-score method, for x1, x2, ..., x N Perform standardization.
6. A device for generating an identification model for household appliances, characterized in that: Includes the following modules: The data acquisition module is used to acquire the training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, where x i is the eigenvector, y i is x i The corresponding electrical appliance category label, sample (x i ,y i ) has a weight of w i =1 / N, N and i are both natural numbers, N≥2, 1≤i≤N; A model creation module is used to create an Adaboost model. In the Adaboost model, the weak classifier is a BP neural network model. The Adaboost model can create T BP neural network models h1, h2, ..., h T , the recognition model is α t h is the BP neural network model t The corresponding weights, where t and T are natural numbers, T ≥ 2, 1 ≤ t ≤ T; based on the training data set D, and w1, w2, ..., w N , for BP neural network models h1, h2, ..., h T Perform one training.
7. The generating device according to claim 6, characterized in that The model creation module is also used to: BP neural network model h1, h2, ..., h T Any h t The training process includes: using the training data set D = {(x1, y1), (x2, y2), ..., (x N ,y N )}, and w1, w2, ..., w N Train the BP neural network model h t ; The error rate of the BP neural network model on the training data set D Where I(·) is the indicator function. If y i Not equal to h t (x i ) then I(y i ≠h t (x i ))=1, if y i Equal to h t (x i ) then I(y i ≠h t (x i ))=0;Calculate the BP neural network model h t Weight Num=w i exp(-α t y i h t (x i )),w i =Num, for w1, w2, ..., w N All are normalized; where i=1, 2, ..., N.
8. The generating device according to claim 6, characterized in that The feature vector includes at least: average power consumed during operation, time period information during operation, duration of operation, and maximum power change during operation.
9. The generating device according to claim 8, characterized in that The model creation module is also used to: Generate y1, y2, ..., y N One-hot encoding y′1, y′2, .., ..y′ N , for x1, x2, ..., x N After normalization, the dataset {(x1, y′1), (x2, y′2), ..., (x N , y′ N )}, and w1, w2, ..., w N Train the BP neural network model h t .
10. The generating device according to claim 9, characterized in that The model creation module is also used to: Using the z-score method, for x1, x2, ..., x N Perform standardization.
Citation Information
Patent Citations
User abnormal power consumption behavior detection method based on non-intrusive load decomposition
CN113762355A
