Non-intrusive load identification method and system based on generative adversarial network

By using a combined model of generative adversarial networks, the impact of grid noise on non-intrusive load identification was addressed, resulting in more stable and efficient appliance type identification.

CN121167482APending Publication Date: 2025-12-19BEIJING JINGYIBEIFANG INSTR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511318135.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing non-intrusive load identification methods based on deep learning have failed to effectively address grid noise, resulting in unstable identification rates and poor robustness, which limits their application on the residential side.

Method used

A generative adversarial network is used to construct a non-intrusive load identification model by combining a generator with two discriminators (a true/false discriminator and a category discriminator). The model is trained using a loss function to remove noise and identify the type of electrical appliance.

Benefits of technology

It significantly improves the robustness and recognition accuracy of the model, effectively copes with grid noise, and enhances the stability and accuracy of non-intrusive load identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121167482A_ABST
    Figure CN121167482A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of power loads, and discloses a non-intrusive load identification method and system based on a generative adversarial network, and the method comprises the steps: collecting the current data of electric equipment, and constructing an electrical parameter data set according to the current data; the method comprises the following steps: constructing a generator based on a predefined encoder and decoder, constructing an authenticity discriminator and a category discriminator based on a predefined residual network structure, and combining the generator, the authenticity discriminator and the category discriminator to generate a non-intrusive load identification model based on a generative adversarial network; and constructing a loss function of the generative adversarial network, training the non-intrusive load identification model through the loss function, and performing electric appliance type identification by using the trained non-intrusive load identification model. According to the method, the problems of unstable model recognition rate and low robustness caused by insufficient power grid noise modeling in the recognition process of the current non-intrusive load recognition method are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power load technology, and in particular to a non-intrusive load identification method and system based on generative adversarial networks. Background Technology

[0002] With the continuous progress and development of society and technology, the demand for energy is increasing daily. Fossil fuels, as the main component of the world's energy consumption structure, are being used more and more, while their non-renewable nature and pollution are receiving increasing attention. Clean electricity is gaining increasing attention, and to accelerate economic development, it is being applied more and more across various industries. Manufacturing is a crucial pillar of China's economy, and the large amounts of electricity required for industrial production are indispensable. Simultaneously, the construction industry, transportation, and other sectors are also experiencing increasing electricity demand. Urbanization has led to a rapid increase in urban population and rising living standards, further increasing the demand for electricity. Against this backdrop, non-intrusive load identification technology has emerged. Non-intrusive load identification identifies various types of electrical equipment and loads by analyzing electrical characteristic parameters in the power grid. Traditional load identification methods require the installation of specialized sensors or monitoring equipment to obtain information about electrical equipment, but this method is costly and not suitable for large-scale application. Non-intrusive load identification, on the other hand, can utilize existing power equipment. By installing only a small number of sampling devices at the main power transmission points of the grid, it can monitor and identify the load of various devices throughout the entire system. Therefore, non-intrusive identification technology can help identify electrical equipment, thereby optimizing the grid structure and achieving intelligent energy saving. Current non-intrusive load identification methods are mainly divided into optimization-based non-intrusive load identification algorithms and machine learning-based non-intrusive load identification methods. Due to their superior identification performance, deep learning-based non-intrusive load identification methods have been widely used. However, current deep learning-based non-intrusive load identification methods do not consider the noise problem in the power grid, resulting in unstable recognition rates and poor robustness during application. This is mainly due to the presence of noise in the power grid. Figure 9 As shown, the current of a desktop computer obtained by subtracting the current before and after a switching event in the power grid differs from the current directly collected without a switching event. These differences interfere with non-intrusive load identification. Existing non-intrusive load identification methods lack modeling of power grid noise data, resulting in significant noise in the input model data. This leads to unstable model recognition rates and poor robustness during use, thus limiting the application of non-intrusive load identification methods in residential settings. Therefore, providing a non-intrusive load identification method and system based on generative adversarial networks is a pressing issue that needs to be addressed. Summary of the Invention

[0003] This invention provides a non-intrusive load identification method and system based on generative adversarial networks to solve the problems of unstable model recognition rate and poor robustness in the prior art.

[0004] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or to describe the scope of protection of these embodiments. Its sole purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.

[0005] According to a first aspect of the present invention, a non-intrusive load identification method based on generative adversarial networks is provided.

[0006] In one embodiment, the non-intrusive load identification method based on generative adversarial networks includes:

[0007] Collect current data from electrical equipment and construct an electrical parameter dataset based on the current data;

[0008] A generator and a discriminator are constructed based on an electrical parameter dataset. The generator and discriminator are then combined to generate a non-intrusive load identification model based on a generative adversarial network.

[0009] A loss function for a generative adversarial network is constructed, and the non-intrusive load identification model is trained using the loss function. The trained non-intrusive load identification model is then used to identify the type of electrical appliance.

[0010] In one embodiment, collecting current data from electrical equipment and constructing an electrical parameter dataset based on the current data includes:

[0011] Based on the preset sampling rate, sampling time and number of samples, current data of electrical equipment are collected to construct the original electrical parameter dataset;

[0012] Limit the signal-to-noise ratio of electrical equipment noise, add the noise signal of the electrical equipment to the current data to augment the original electrical parameter dataset, and obtain an augmented electrical parameter dataset;

[0013] By combining the original electrical parameter dataset of electrical equipment and the augmented electrical parameter dataset of electrical equipment, a dataset is obtained for training a non-intrusive load identification model based on generative adversarial networks.

[0014] In one embodiment, the step of constructing a generator and a discriminator based on an electrical parameter dataset, and combining the generator and the discriminator to generate a non-intrusive load identification model based on a generative adversarial network includes:

[0015] A generator is built based on a predefined encoder and decoder. The generator filters the input noisy current data and outputs filtered data.

[0016] A discriminant is constructed based on a predefined residual network structure, the discriminant including a true / false discriminant and a category discriminant;

[0017] Among them, the authenticity discriminator is used to determine the authenticity of the filtered data; the category discriminator is used to identify the type of electrical appliance from the filtered data and the original unfiltered data.

[0018] By combining the generator, the true / false discriminator, and the category discriminator, a non-intrusive load identification model based on generative adversarial networks is obtained.

[0019] In one embodiment, the encoder and decoder in the generator have the same number of layers, and each layer of the encoder contains a one-dimensional convolutional neural network, a max pooling layer, and a ReLU activation function;

[0020] Each layer of the decoder contains a one-dimensional deconvolutional neural network, an inverse max-pooling layer, and a ReLU activation function.

[0021] In one embodiment, the loss function for constructing the generative adversarial network, the training of the non-intrusive load identification model using the loss function, and the use of the trained non-intrusive load identification model for appliance type identification include:

[0022] Low-noise data is selected from the original electrical parameter dataset, and the loss function of the generator is constructed by combining the filtered data output by the generator.

[0023] Based on the generator's loss function, a first loss function is constructed for the adversarial network composed of the generator and the true / false discriminator.

[0024] Construct the loss function of the class discriminator, and based on the predefined triplet relationship, construct the second loss function of the adversarial network composed of the generator and the class discriminator;

[0025] The non-intrusive load identification model is trained using a loss function to obtain the trained non-intrusive load identification model.

[0026] The trained non-intrusive load identification model is used to identify the type of electrical appliance.

[0027] In one embodiment, the expression for the first loss function of the adversarial network composed of the generator and the truth / falsehood discriminator includes:

[0028]

[0029] In the formula, x ~ Pdata(x) is the distribution of input data x belonging to Pdata(x), z ~ Pdata(z) is the distribution of input data z belonging to Pdata(z), D1(·) is the true / false discriminator, and G(·) is the generator. Let the loss function of the generator be... Let E be the loss function of the true / false discriminator. x~Pdata(x) [log(D1(x)] is the expected value of log(D1(x)) calculated for all data x from the true data distribution Pdata(x), where E is the expected value of the expected value. z~Pdata(z) [log(D1(G(z))] is the expected value of log(D1(G(z))) calculated for all data from the noisy data distribution Pdata(z).

[0030] In one embodiment, the expression for the second loss function of the adversarial network composed of the generator and the class discriminator includes:

[0031]

[0032] In the formula, Let the loss function of the generator be... Let be the loss function of the class discriminator, a be the anchor point, p be the positive instance, n be the negative instance, margin be the minimum margin required by the discriminator to distinguish between real and generated samples, dis be the cosine similarity, D2(·) be the class discriminator, and G(·) be the generator.

[0033] In one embodiment, training the non-invasive load identification model using a loss function to obtain the trained non-invasive load identification model includes:

[0034] The generator is pre-trained based on the generator's loss function. The generator pre-training is complete when the loss function value drops to a preset value.

[0035] The class discriminator is trained based on the loss function of the class discriminator and the original electrical parameter dataset. The class discriminator pre-training is completed when the loss function value drops to a preset value.

[0036] The first loss function is used to train the adversarial network composed of the generator and the true / false discriminator, and the second loss function is used to train the adversarial network composed of the generator and the class discriminator.

[0037] If both generative adversarial networks reach Nash equilibrium, the training is complete, and a trained non-intrusive load identification model is obtained. Otherwise, the model parameters are adjusted and iterative training is performed again.

[0038] In one embodiment, the identification of appliance type using a trained non-intrusive load identification model includes:

[0039] Based on the original electrical parameter dataset and the category discriminator, the class centers of electrical appliances are extracted and saved to the database;

[0040] Switching event time is obtained by using switching event detection technology. The current within the preset switching event time period is obtained by subtracting the current after voltage alignment.

[0041] The current data is filtered by the generator and then input into the class discriminator to obtain the embedding features of the current data;

[0042] The embedded features are measured at a distance from the class center. If the distance is less than a preset threshold, the current data that is closest to the class center is assigned to the corresponding appliance type to obtain the appliance type identification result. Otherwise, the current appliance is determined to be a new type of appliance.

[0043] According to a second aspect of the present invention, a non-intrusive load identification system based on generative adversarial networks is provided.

[0044] In one embodiment, the non-intrusive load identification system based on generative adversarial networks includes:

[0045] The dataset acquisition module is used to collect current data from electrical equipment and construct an electrical parameter dataset based on the current data.

[0046] The model building module is used to build a generator and a discriminator based on the electrical parameter dataset, and combine the generator and discriminator to generate a non-intrusive load identification model based on generative adversarial networks.

[0047] The appliance type identification module is used to construct the loss function of the generative adversarial network. The loss function is used to train the non-intrusive load identification model, and the trained non-intrusive load identification model is used to identify the appliance type.

[0048] According to a third aspect of the present invention, a computer device is provided.

[0049] In one embodiment, the computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.

[0050] According to a fourth aspect of the present invention, a computer-readable storage medium is provided.

[0051] In one embodiment, a computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the above method.

[0052] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0053] 1. This invention improves the effect of non-intrusive load identification by forming an adversarial network. It combines a generator, a true / false discriminator, and a category discriminator for load identification, which can significantly improve the robustness and accuracy of the model. The generator effectively removes noise and restores the real load signal. The true / false discriminator enables the generator to learn more realistic load characteristics through adversarial training, while the category discriminator further optimizes the identification of device types.

[0054] 2. This invention combines the generator, the true / false discriminator, and the category discriminator to improve the robustness of the model in order to cope with noise in the power grid. This solves the problem that current non-intrusive load identification methods do not adequately model power grid noise during the identification process, resulting in unstable model recognition rate and low robustness. Attached Figure Description

[0055] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0056] Figure 1 This is a flowchart illustrating a non-intrusive load identification method based on generative adversarial networks according to an exemplary embodiment;

[0057] Figure 2 This is a schematic diagram illustrating the principle of a non-intrusive load identification system based on a generative adversarial network, according to an exemplary embodiment.

[0058] Figure 3 This is a schematic diagram of the structure of a computer device according to an exemplary embodiment;

[0059] Figure 4 This is a framework diagram of a non-intrusive load identification model in a non-intrusive load identification method based on generative adversarial networks, according to an exemplary embodiment.

[0060] Figure 5 This is a generator structure diagram illustrating a non-intrusive load identification method based on generative adversarial networks according to an exemplary embodiment;

[0061] Figure 6 This is a schematic diagram of a true / false discriminator structure in a non-intrusive payload identification method based on generative adversarial networks, according to an exemplary embodiment.

[0062] Figure 7 This is a structural diagram of a class discriminator in a non-intrusive load identification method based on generative adversarial networks, according to an exemplary embodiment.

[0063] Figure 8 This is a flowchart illustrating a non-intrusive load identification method based on generative adversarial networks, according to an exemplary embodiment.

[0064] Figure 9 This is a comparison graph showing the difference between the current of a desktop computer during a switching event and the current of a desktop computer without a switching event in a non-intrusive load identification method based on generative adversarial networks, according to an exemplary embodiment. Detailed Implementation

[0065] The following description and accompanying drawings fully illustrate specific embodiments described herein to enable those skilled in the art to practice them. Some embodiments may include or substitute parts and features of other embodiments. The scope of the embodiments herein includes the entire scope of the claims and all available equivalents thereof. Throughout this document, the terms “first,” “second,” etc., are used only to distinguish one element from another without requiring or implying any actual relationship or order between the elements. Indeed, a first element can also be referred to as a second element, and vice versa. Furthermore, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a structure, apparatus, or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a structure, apparatus, or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the structure, apparatus, or device that includes said element. The various embodiments described herein are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.

[0066] The terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer" used in this document to indicate orientations or positional relationships are based on the orientations or positional relationships shown in the accompanying drawings. They are used solely for the convenience of describing the document and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In the description herein, unless otherwise specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two elements; they can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.

[0067] In this document, unless otherwise stated, the term "multiple" means two or more.

[0068] In this article, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0069] In this article, the term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0070] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the diagram may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0071] The modules in the apparatus or system of this application can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0072] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0073] Figure 1 An embodiment of the non-intrusive load identification method based on generative adversarial networks of the present invention is shown.

[0074] In this optional embodiment, the non-intrusive load identification method based on generative adversarial networks includes:

[0075] Step S101: Collect current data of electrical equipment and construct an electrical parameter dataset based on the current data;

[0076] Step S102: Construct a generator and a discriminator based on the electrical parameter dataset, and combine the generator and discriminator to generate a non-intrusive load identification model based on generative adversarial networks;

[0077] Step S103: Construct the loss function of the generative adversarial network, train the non-intrusive load identification model using the loss function, and use the trained non-intrusive load identification model to identify the type of electrical appliance.

[0078] In this optional embodiment, the process of collecting current data from electrical equipment and constructing an electrical parameter dataset based on the current data includes:

[0079] Based on the preset sampling rate, sampling time and number of samples, current data of electrical equipment are collected to construct the original electrical parameter dataset;

[0080] Limit the signal-to-noise ratio of electrical equipment noise, add the noise signal of the electrical equipment to the current data to augment the original electrical parameter dataset, and obtain an augmented electrical parameter dataset;

[0081] By combining the original electrical parameter dataset of electrical equipment and the augmented electrical parameter dataset of electrical equipment, a dataset is obtained for training a non-intrusive load identification model based on generative adversarial networks.

[0082] In this optional embodiment, the step of constructing a generator and a discriminator based on the electrical parameter dataset, and combining the generator and the discriminator to generate a non-intrusive load identification model based on a generative adversarial network includes:

[0083] A generator is built based on a predefined encoder and decoder. The generator filters the input noisy current data and outputs filtered data.

[0084] A discriminant is constructed based on a predefined residual network structure, the discriminant including a true / false discriminant and a category discriminant;

[0085] Among them, the authenticity discriminator is used to determine the authenticity of the filtered data; the category discriminator is used to identify the type of electrical appliance from the filtered data and the original unfiltered data.

[0086] By combining the generator, the true / false discriminator, and the category discriminator, a non-intrusive load identification model based on generative adversarial networks is obtained.

[0087] It should be noted that during the early stages of training or during convergence, when the discriminator rapidly becomes stronger and its ability to distinguish between real and generated samples becomes too clear, it will output extreme confidence scores (such as close to 1 or 0). This causes the gradient of the loss function to be almost zero, making it impossible for the generator to receive effective gradient signals during backpropagation. As a result, training stagnates, leading to discriminator gradient saturation and subsequent generator update stagnation. Moreover, the introduction of a class discriminator makes the discrimination task more complex. In the high-dimensional current signal feature space, if the discriminator overfits the current generator's pattern, gradient saturation will also occur prematurely, thus hindering the generator from learning more realistic load patterns. This collaborative imbalance is more easily amplified in multi-task adversarial training.

[0088] Therefore, to address the gradient saturation problem that easily occurs in the discriminator, a spectral norm constraint is applied to the weights of each layer, and a power iteration method combined with a gradient penalty mechanism is used to improve the stability and continuity of the generator training signal. Specifically, this includes:

[0089] Based on the discriminator network structure, learnable weight layers in the discriminator network structure are selected and a weight matrix is ​​constructed.

[0090] Two auxiliary variables are introduced into each weight matrix to estimate the maximum singular value of the current weight. These two variables are cached as parameters in each layer and updated with training iterations to provide initial direction for subsequent power iterations.

[0091] By using two variables to perform multiple rounds of exponential iteration, the maximum eigenvalue of the weight matrix can be quickly approximated with extremely low computational cost, and the iteration results are used to estimate the maximum singular value of the current layer.

[0092] By using the estimated maximum singular value, the original weight matrix is ​​divided by this value to obtain the normalized weight matrix. The normalized weights are then used in the forward inference process of the discriminator, which theoretically constrains the sensitivity of the discriminator output to input perturbations, thereby mitigating gradient explosion or gradient saturation.

[0093] Among them, multi-round power iteration is an efficient method for approximating the maximum singular value (spectral norm) of a matrix, which specifically includes:

[0094] Step 1: Initialize a unit vector, denoted as u, from a random Gaussian or uniform distribution. The dimension is the same as the number of columns of the matrix to be estimated. This vector serves as the initial guess of the feature direction and will be the starting point of the power iteration loop.

[0095] Step 2: Multiply the current vector u on the left by the target matrix W to obtain a new vector v. Then normalize it. Multiply the normalized vector v on the right by the transpose WT of the matrix to obtain the updated u. Then normalize it again. The purpose is equivalent to finding the dominant direction of the matrix and its transpose, that is, the corresponding eigenvector that approximates the maximum singular value.

[0096] Step 3: Through multiple rounds of alternating iterations, each iteration brings vectors u and v closer to the singular direction dominated by the matrix, and stops when the iteration condition is met (usually 2 to 5 iterations are sufficient to achieve a stable estimate).

[0097] Step 4: After the iteration converges, the latest u and v are used as the approximate estimate of the maximum singular value of the constructed matrix. This value is the spectral norm, which is used to normalize the original weight matrix to satisfy the continuity constraint.

[0098] In this optional embodiment, the encoder and decoder in the generator have the same number of layers, and each layer of the encoder includes a one-dimensional convolutional neural network, a max pooling layer, and a ReLU activation function;

[0099] Each layer of the decoder contains a one-dimensional deconvolutional neural network, an inverse max-pooling layer, and a ReLU activation function.

[0100] In this optional embodiment, the loss function for constructing the generative adversarial network, the training of the non-intrusive load identification model using the loss function, and the use of the trained non-intrusive load identification model for appliance type identification include:

[0101] Low-noise data is selected from the original electrical parameter dataset, and the loss function of the generator is constructed by combining the filtered data output by the generator.

[0102] Based on the generator's loss function, a first loss function is constructed for the adversarial network composed of the generator and the true / false discriminator.

[0103] Construct the loss function of the class discriminator, and based on the predefined triplet relationship, construct the second loss function of the adversarial network composed of the generator and the class discriminator;

[0104] The non-intrusive load identification model is trained using a loss function to obtain the trained non-intrusive load identification model.

[0105] The trained non-intrusive load identification model is used to identify the type of electrical appliance.

[0106] In this optional embodiment, training the non-invasive load identification model using a loss function to obtain the trained non-invasive load identification model includes:

[0107] The generator is pre-trained based on the generator's loss function. The generator pre-training is complete when the loss function value drops to a preset value.

[0108] The class discriminator is trained based on the loss function of the class discriminator and the original electrical parameter dataset. The class discriminator pre-training is completed when the loss function value drops to a preset value.

[0109] The first loss function is used to train the adversarial network composed of the generator and the true / false discriminator, and the second loss function is used to train the adversarial network composed of the generator and the class discriminator.

[0110] When both generative adversarial networks reach Nash equilibrium, training is complete, resulting in a trained non-intrusive load identification model. Otherwise, the model parameters are adjusted, and iterative training is repeated.

[0111] In this optional embodiment, the identification of appliance type using the trained non-intrusive load identification model includes:

[0112] Based on the original electrical parameter dataset and the category discriminator, the class centers of electrical appliances are extracted and saved to the database;

[0113] Switching event time is obtained by using switching event detection technology. The current within the preset switching event time period is obtained by subtracting the voltage after voltage alignment.

[0114] It should be noted that the switching event time is obtained using switching event detection technology. The current within the preset switching event time period is subtracted after voltage alignment to obtain the corresponding current data, including:

[0115] Step 1: Use switching event detection technology (such as edge detection, abrupt change detection, or high-frequency feature monitoring) to locate significant jump points in the voltage or current signal. These jump points are the candidate time intervals for the switching operation of the load device.

[0116] Step 2: Based on the switching event time period identified in Step 1, perform differential analysis on the current signal within that time period. Align the current signal with voltage, that is, normalize the current signal to a unified time base according to the voltage phase or period, and then calculate the difference before and after the event to obtain the current increment characteristics corresponding to the switching event.

[0117] Step 3: For the current difference data extracted in each time period, the nonlinear Granger causal analysis method is used to construct the driving causal relationship between loads. By analyzing whether the history of a certain load can significantly improve the prediction of changes in another load, potential causal couplings can be identified.

[0118] It should be noted that constructing the driving causal relationship between loads using the nonlinear Granger causal analysis method involves: extracting representative feature sequences, such as current differences or trends within the event time period, from the current or power time series of each load device; and then using nonlinear modeling methods (such as kernel-based regression, tree models, etc.) to evaluate the predictive contribution of different load sequences to the future changes of the target load. If the past information of a certain load in the historical data can significantly improve the predictive ability of the future trend of the target load, a causal driving relationship is determined to exist.

[0119] This process differs from traditional linear Granger causality analysis, overcoming the limitation of only identifying linear dependencies and making it applicable to complex, overlapping, and non-stationary real-world current signals. By establishing this causal network, the actual control or physical coupling mechanisms between devices can be accurately identified.

[0120] Step 4: Based on the causal analysis results, construct a causal graph model, where nodes represent different loads or signal sources and edges represent causal driving relationships.

[0121] Specifically, the co-occurring but non-independent coupled signal pairs are identified through the directed connections in the causal graph model, and the overlapping parts are then extracted from the original signals using structural information, thereby achieving signal layer decoupling of the load, that is, splitting the coupled signals into multiple relatively independent causal components.

[0122] Step 5: Based on the constructed causal graph model, counterfactual intervention is performed on a specific node (i.e., assuming the device is not turned on), and the expected response signals of other nodes in this situation are inferred. Virtual samples under the intervention conditions are generated, and the original event samples and the counterfactually generated samples are used together as the training set to input the load classification model, such as to determine whether the current event is more likely to belong to an air conditioner, dehumidifier or mixed event.

[0123] It should be noted that by performing counterfactual intervention on specific nodes based on the constructed causal graph model, virtual samples under the intervention conditions are generated to simulate the expected current response of other devices in the system when a target device is not powered on. This removes the false correlation between devices, enhances the interpretability and independence of the signal, and helps to accurately determine whether the currently observed signal is indeed caused by the target device. This not only improves the load decoupling capability, but also provides richer and more controllable training samples for the load identification model.

[0124] The current data is filtered by the generator and then input into the class discriminator to obtain the embedding features of the current data;

[0125] The embedded features are measured at a distance from the class center. If the distance is less than a preset threshold, the current data that is closest to the class center is assigned to the corresponding appliance type to obtain the appliance type identification result. Otherwise, the current appliance is determined to be a new type of appliance.

[0126] Figure 2 An embodiment of the non-intrusive load identification system based on generative adversarial networks of the present invention is shown.

[0127] In this optional embodiment, the non-intrusive load identification system based on generative adversarial networks includes:

[0128] The dataset acquisition module 201 is used to collect current data of electrical equipment and construct an electrical parameter dataset based on the current data;

[0129] The model building module 202 is used to build a generator and a discriminator based on the electrical parameter dataset, and combine the generator and discriminator to generate a non-intrusive load identification model based on a generative adversarial network.

[0130] The appliance type identification module 203 is used to construct the loss function of the generative adversarial network, train the non-intrusive load identification model through the loss function, and use the trained non-intrusive load identification model to identify the appliance type.

[0131] To address the limitations of existing non-intrusive load identification methods in handling power grid noise, which suffers from unstable recognition rates and poor robustness, this invention proposes a non-intrusive load identification method based on generative adversarial networks (GANs). First, this invention constructs a dataset of electrical parameters of electrical equipment by collecting data. Second, it constructs a generator based on an autoencoder structure and two discriminators based on residual networks, forming a GAN. Finally, it trains the constructed GAN using the dataset to achieve robust non-intrusive load identification. The overall framework of this invention is shown in the figure below. Figure 4 As shown.

[0132] The non-intrusive load identification method based on generative adversarial networks provided by the present invention will be further described below with reference to specific implementation methods.

[0133] 1) Collect electrical parameters of electrical appliances to build a dataset. The sampling rate should be no less than 6.4kHz, and the sampling time should be no less than 3 seconds. The specific data collection process is as follows:

[0134] Step 1: Collect electrical parameter dataset 1 of the electrical equipment (dataset 1 is the original electrical parameter dataset). The collection method includes:

[0135] In a household electricity environment, plug electrical device A into a socket and turn off all other appliances, ensuring that only device A is operating in the power grid. Collect the current data of device A at this time using a data acquisition device with sufficient filtering capability, with a sampling rate of at least 6.4 kHz, a sampling time of 3 seconds, and at least 400 samples. Repeat this process to collect current data from electrical devices B, C, D, etc., for at least 15 types of electrical devices, constructing a relatively clean dataset of electrical parameters for these devices with low noise content.

[0136] Step 2: Augment the dataset. In actual non-intrusive load identification scenarios, each household user connects to multiple appliances, and these appliances inevitably generate some interference noise. Therefore, training the model using only dataset 1 is insufficient. Since collecting power grid noise is difficult, dataset 2 (the augmented electrical parameter dataset) is obtained by adding noise to dataset 1. The noise addition process is shown below:

[0137] siganl iaddnoise =signal i +noise ij ;

[0138] In the formula, signal iaddnoise This indicates that noise will be added to the current signal of the acquired dataset 1. i This indicates the noise to be added, where i represents the appliance corresponding to the noise, and j represents the type of noise.

[0139] Step 3: Noise Generation and Size Limitations. The generated noise includes, but is not limited to, white noise, uniform noise, multiplicative noise, and similar types. It is important to note that the signal-to-noise ratio (SNR) of the noise needs to be limited when adding it, as illustrated in the following example:

[0140] (1) Producing normally distributed random noise init Its power is P init .

[0141] (2) Limit its power. Limiting the signal-to-noise ratio is equivalent to limiting the power. If the signal-to-noise ratio of the noise to be added is X, then the formula for calculating the power of the noise to be added is:

[0142]

[0143] In the formula, P s P represents the power of the current data that needs to be annotated. noise This indicates the power of the noise to be added; the noise level after limiting its magnitude is... elater It is represented as follows:

[0144]

[0145] In the formula, (n1, n2, ..., n3) represents noise. init The data points are used to generate noise components for different electrical appliances under different distributions and signal-to-noise ratios. ij Where i corresponds to the type of electrical appliance, and j corresponds to the noise distribution and noise level. For example, if there are x types of noise distribution and y types of noise levels, then j = x * j. The dataset should contain at least 7 types of noise, and the signal-to-noise ratio (SNR) for each type should be no less than 10, with an SNR of no less than 0 dB. These noise signals are added to the current signal using a noise addition expression to obtain dataset 2. Dataset 1 and dataset 2 together constitute the dataset for training a non-intrusive load identification model based on a generative adversarial network.

[0146] 2) Construct a non-intrusive load identification model based on generative adversarial networks, the architecture of which is as follows: Figure 4 As shown, the system consists of a generator and two discriminators. The generator is mainly used to filter the input signal and remove grid noise. Discriminator 1 (the true / false discriminator) is mainly used to determine the authenticity of the filtered data, which is essentially determining the authenticity of the filtered data. Discriminator 2 (the category discriminator) identifies the type of electrical appliance by comparing the filtered signal with the original unfiltered signal. The entire framework construction process includes:

[0147] Step 1: Construct the generator. Since the generator primarily performs filtering operations on the noisy input current signal, it adopts a self-encoding structure, as shown below. Figure 5 As shown, the generator mainly consists of an encoder and a decoder. The input to the generator is a current signal, and the output is a filtered signal. The encoder in the generator should have no fewer than 8 layers, each containing a one-dimensional convolutional neural network, a max-pooling layer, and a ReLU activation function. Since the input current data is a high-sampling-rate signal, its data length is usually over 10,000 points. To quickly extract features, the stride of the convolutional layer is set to 1, and the stride of the max-pooling layer is set to 2. The data length of the embedded features extracted by the encoder can be reduced to less than 1,000 points. If the data length is too long, the stride of the convolutional layer and the stride of the pooling layer can be increased to accelerate the feature extraction speed. The decoder has the same number of layers as the encoder, still no fewer than 8 layers. Each layer consists of a one-dimensional deconvolutional neural network, an inverse max-pooling layer, and a ReLU activation function. Generally, the parameter settings of the one-dimensional deconvolution and the inverse max-pooling network correspond to the parameters of the one-dimensional convolutional layer and the max-pooling layer, respectively, so that the data length of the generator's output is equal to the data length of the input. If it is not possible to make the length of the input signal equal to the length of the output signal, the parameters of each layer, such as padding, can be adjusted to make the lengths of the input and output signals the same.

[0148] Step 2: Construct Discriminator 1. Discriminator 1 is mainly used to determine the authenticity of the filtered current and the original current data. The generator may filter out too much data during noise removal, causing data loss and thus disrupting the original current data distribution, resulting in data distortion. Therefore, Discriminator 1 is used to determine the authenticity of the data and whether the filtered data conforms to the corresponding current data distribution. Its structure is as follows: Figure 6 As shown, the filter employs a residual network structure with at least six residual blocks. The features extracted by the residual network are then output through a fully connected neural network. Similar to the model parameter settings in step one, the feature extraction speed can be accelerated by adjusting the stride of the one-dimensional convolutional neural network in the residual blocks and the average pooling.

[0149] Step 3: Construct Discriminator 2. Discriminator 2 primarily classifies current signals, determining the appliance category to which the input current signal belongs. To enhance the discriminator 2's recognition capability, it and the generator also form an adversarial network. The structure of Discriminator 2 is as follows: Figure 7 As shown, the structure of discriminator 2 is similar to that of discriminator 1, but the output dimension of the model is different. Discriminator 2 uses a metric learning method to classify the load, so its output is an embedded feature.

[0150] 3) Construct the loss function for training a non-intrusive load identification model based on generative adversarial networks. The construction process includes the following steps:

[0151] Step 1: Construct the loss function for the generator. Since the generator's function is filtering, the loss function for the generator is as follows:

[0152]

[0153] In the formula, LG represents the generator's loss function, N represents the number of samples, which is actually the batch size during training, and M represents the length of the input data. This represents the data with less noise in dataset 1. This represents the data after the generator has filtered out noise. During training, the generator's input can be noisy data from dataset 2 or data with very low noise from training set 1. However, during loss calculation, the generator's input, regardless of whether it comes from training set 1 or training set 2, is the filtered data. The loss function is calculated using the data corresponding to training set 1. This loss function can enable the generator to have a filtering effect, and can also make the generator as unaffected as possible by data with low noise, such as training set 1.

[0154] Step 2: The loss function for constructing the adversarial network consisting of the generator and discriminator 1 includes:

[0155]

[0156] In the formula, x ~ Pdata(x) is the distribution of input data x belonging to Pdata(x), z ~ Pdata(z) is the distribution of input data z belonging to Pdata(z), D1(·) is the true / false discriminator, and G(·) is the generator. The loss function of the generator Let E be the loss function of the true / false discriminator. x~Pdata(x) [log(D1(x)] represents the expected value of log(D1(x)) for all data x from the true data distribution Pdata(x), E. z~Pdata(z) [log(D1(G(z)))] represents the expectation of log(D1(G(z))) for all data z from the noisy data distribution Pdata(z). During training, the input data x of the discriminator comes from training set 1, and the input z of the generator comes from either training set 1 or training set 2. This allows the discriminator to judge data with low noise as true and data with high noise as false. Therefore, the training process can guide the generator's noise filtering. The generator can denoise the noisy data without affecting the data with no noise or low noise, thus guiding the training of the discriminator.

[0157] Step 2: Construct the loss function for discriminator 2, the expression of which is shown below:

[0158] LD2=max(dis(a,p)-dis(a,n)+margin,0);

[0159] In the formula, <a,p,n> is called a triple, a is called the anchor point, p is a positive instance belonging to the same class as a, n is a negative instance belonging to a different class, margin is the minimum margin required by the discriminator to distinguish between real and generated samples, and dis is the cosine similarity, which is calculated using the following formula:

[0160]

[0161] By training the model using this loss function, the model can continuously learn the similarity between input samples, thereby increasing the similarity between samples of the same type of electrical appliances and reducing the similarity between samples of different types of electrical appliances.

[0162] Step 3: Construct the loss function of the adversarial network consisting of discriminator 2 and generator, the expression of which includes:

[0163]

[0164] In the formula, The loss function of the generator Let be the loss function of discriminator 2, <a,p,n> be called a triple, a be called the anchor point, p be a positive instance that belongs to the same class of samples as a, n be a negative instance, margin be the minimum margin that the discriminator needs to achieve when distinguishing between real samples and generated samples, dis be the cosine similarity, D2(·) represent discriminator 2, and G(·) represent the generator.

[0165] calculate The goal is to make the embedding vector of the data generated by the generator, after passing through discriminator 2, as close as possible to the embedding vector of the corresponding data without noise, thereby improving the generator's denoising capability; calculation The goal is to enable the discriminator to learn to distinguish between the data filtered by the generator and the data without noise, thereby improving the data discrimination ability. Here, x and a are data of the same type of appliance and both come from dataset 1, while z is the noisy data of x, which comes from dataset 2.

[0166] 4) Train a non-intrusive load identification model based on generative adversarial networks. The training steps are as follows:

[0167] Step 1: Pre-train the generator and discriminator 2. For the generator, first train it using its loss function. Pre-training is complete when the loss function value stabilizes. Next, train discriminator 2 using its own loss function. Note that discriminator 2 training should use training set 1 to avoid the noise from training set 2 affecting the training results. Pre-training of discriminator 2 is complete when the loss function value stabilizes.

[0168] Step 2: Using the loss functions of the adversarial network composed of generator and discriminator 1, and the adversarial network composed of discriminator 2 and generator, train the adversarial networks composed of generator and discriminator 1 and generator and discriminator 2, respectively. Training is complete when both networks reach Nash equilibrium; otherwise, adjust the model parameters and retrain the model. Note that discriminators 1 and 2 do not require training on training set 2.

[0169] 5) The process of calculating the class center of electrical appliances and identifying their applications is as follows: Figure 8 As shown, after training in step 4), the generator and discriminator 2 are combined into a network for appliance identification. The specific steps include:

[0170] Step 1: Extract the class centers of electrical appliances based on training set 1 and discriminator 2. The expression is as follows:

[0171]

[0172] In the formula, C a Let x be the characteristic center of class A electrical appliances. i Let represent the i-th input sample of the a-th type of electrical appliance, N represent the number of samples used to calculate the feature center, and D2(·) represent discriminator 2.

[0173] Step 2: Collect current data of the electrical appliance. The timing of the switching event is obtained using a switching event detection method; however, switching events are not within the scope of this patent. The current before and after the switching event is aligned with voltage and then subtracted to obtain the current of the corresponding electrical appliance.

[0174] Step 3: The current data obtained in Step 2 is filtered by the generator and then input into the discriminator 2 to obtain the embedding feature of the current data. This embedding feature is compared with all class centers. When the distance is less than a set threshold, the current data is identified as belonging to the class of appliances closest to the set class center. However, if the distance between the embedding feature of an appliance and all class centers is greater than the set threshold, the appliance is identified as belonging to a new class. Without loss of generality, the method proposed in this invention can also be trained using power data to achieve similar recognition results.

[0175] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores static and dynamic information data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the above method embodiments.

[0176] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0177] In addition, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0178] In addition, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0179] This invention is not limited to the structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this invention is limited only by the appended claims.

Claims

1. A non-intrusive load identification method based on generative adversarial networks, characterized in that, The method includes: Collect current data from electrical equipment and construct an electrical parameter dataset based on the current data; A generator is built based on a predefined encoder and decoder, and a true / false discriminator and a category discriminator are built based on a predefined residual network structure. The generator, true / false discriminator and category discriminator are combined to generate a non-intrusive load identification model based on generative adversarial networks. A loss function for a generative adversarial network is constructed, and the non-intrusive load identification model is trained using the loss function. The trained non-intrusive load identification model is then used to identify the type of electrical appliance.

2. The non-intrusive load identification method based on generative adversarial networks according to claim 1, characterized in that, The process of collecting current data from electrical equipment and constructing an electrical parameter dataset based on the current data includes: Based on the preset sampling rate, sampling time and number of samples, current data of electrical equipment are collected to construct the original electrical parameter dataset; Limit the signal-to-noise ratio of electrical equipment noise, add the noise signal of the electrical equipment to the current data to augment the original electrical parameter dataset, and obtain an augmented electrical parameter dataset; By combining the original electrical parameter dataset of electrical equipment and the augmented electrical parameter dataset of electrical equipment, a dataset is obtained for training a non-intrusive load identification model based on generative adversarial networks.

3. The non-intrusive load identification method based on generative adversarial networks according to claim 1, characterized in that, The discriminator includes a true / false discriminator and a category discriminator; Among them, the authenticity discriminator is used to determine the authenticity of the filtered data; the category discriminator is used to identify the type of electrical appliance from the filtered data and the original unfiltered data.

4. The non-intrusive load identification method based on generative adversarial networks according to claim 1, characterized in that, The encoder and decoder in the generator have the same number of layers, and each layer of the encoder contains a one-dimensional convolutional neural network, a max pooling layer, and a ReLU activation function. Each layer of the decoder contains a one-dimensional deconvolutional neural network, an inverse max-pooling layer, and a ReLU activation function.

5. The non-intrusive load identification method based on generative adversarial networks according to claim 1, characterized in that, The loss function for constructing the generative adversarial network is used to train the non-intrusive load identification model. The trained non-intrusive load identification model is then used to identify appliance types, including: Low-noise data is selected from the original electrical parameter dataset, and the loss function of the generator is constructed by combining the filtered data output by the generator. Based on the generator's loss function, a first loss function is constructed for the adversarial network composed of the generator and the true / false discriminator. Construct the loss function of the class discriminator, and based on the predefined triplet relationship, construct the second loss function of the adversarial network composed of the generator and the class discriminator; The non-intrusive load identification model is trained using a loss function to obtain a trained non-intrusive load identification model, which is then used to identify the type of electrical appliance.

6. The non-intrusive load identification method based on generative adversarial networks according to claim 5, characterized in that, The expression for the first loss function of the adversarial network composed of the generator and the true / false discriminator includes: In the formula, x ~ Pdata(x) is the distribution of input data x belonging to Pdata(x), z ~ Pdata(z) is the distribution of input data z belonging to Pdata(z), D1(·) is the true / false discriminator, and G(·) is the generator. Let the loss function of the generator be... Let E be the loss function of the true / false discriminator. x~Pdata(x) [log(D1(x)] is the expected value of log(D1(x)) calculated for all data x from the true data distribution Pdata(x), where E is the expected value of the expected value. z~Pdata(z) [log(D1(G(z))] is the expected value of log(D1(G(z))) calculated for all data from the noisy data distribution Pdata(z).

7. The non-intrusive load identification method based on generative adversarial networks according to claim 6, characterized in that, The expression for the second loss function of the adversarial network composed of the generator and the class discriminator includes: In the formula, Let the loss function of the generator be... Let be the loss function of the class discriminator, a be the anchor point, p be the positive instance, n be the negative instance, margin be the minimum margin required by the discriminator to distinguish between real and generated samples, dis be the cosine similarity, D2(·) be the class discriminator, and G(·) be the generator.

8. The non-intrusive load identification method based on generative adversarial networks according to claim 7, characterized in that, The process of training the non-invasive load identification model using a loss function to obtain the trained non-invasive load identification model includes: The generator is pre-trained based on the generator's loss function. The generator pre-training is complete when the loss function value drops to a preset value. The class discriminator is trained based on the loss function of the class discriminator and the original electrical parameter dataset. The class discriminator pre-training is completed when the loss function value drops to a preset value. The first loss function is used to train the adversarial network composed of the generator and the true / false discriminator, and the second loss function is used to train the adversarial network composed of the generator and the class discriminator. When both generative adversarial networks reach Nash equilibrium, training is complete, resulting in a trained non-intrusive load identification model. Otherwise, the model parameters are adjusted, and iterative training is repeated.

9. The non-intrusive load identification method based on generative adversarial networks according to claim 8, characterized in that, The method of identifying appliance types using a trained non-intrusive load identification model includes: Based on the original electrical parameter dataset and the category discriminator, the class centers of electrical appliances are extracted and saved to the database; Switching event time is obtained by using switching event detection technology. The current within the preset switching event time period is obtained by subtracting the current after voltage alignment. The current data is filtered by the generator and then input into the class discriminator to obtain the embedding features of the current data; The embedded features are measured at a distance from the class center. If the distance is less than a preset threshold, the current data that is closest to the class center is assigned to the corresponding appliance type to obtain the appliance type identification result. Otherwise, the current appliance is determined to be a new type of appliance.

10. A non-intrusive load identification system based on generative adversarial networks, characterized in that, The system includes: The dataset acquisition module is used to collect current data from electrical equipment and construct an electrical parameter dataset based on the current data. The model building module is used to build a generator and a discriminator based on the electrical parameter dataset, and combine the generator and discriminator to generate a non-intrusive load identification model based on generative adversarial networks. The appliance type identification module is used to construct the loss function of the generative adversarial network. The loss function is used to train the non-intrusive load identification model, and the trained non-intrusive load identification model is used to identify the appliance type.