Confrontation training-based load identification method and system in complex power utilization environment

By collecting and segmenting load voltage and current waveform data in the laboratory, constructing an adversarial training model and generating adversarial examples, the performance degradation problem of the load identification model in complex environments was solved, and the robustness and applicability of the model were improved.

CN121456533APending Publication Date: 2026-02-03GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410798432.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing load identification models struggle to obtain sufficient training data to represent various disturbances in complex power environments, leading to a decline in model performance.

Method used

Load voltage and current waveform data were collected in a laboratory environment, segmented and preprocessed to build a load identification model. Adversarial examples were generated through adversarial training and added to the training set. The model was then retrained to improve robustness.

Benefits of technology

This improved the model's recognition performance in complex power environments and enhanced its applicability and performance in real-world scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456533A_ABST
    Figure CN121456533A_ABST
Patent Text Reader

Abstract

The invention discloses an adversarial training-based load identification method and system in a complex power utilization environment, and relates to the technical field of load identification. Comprising the following steps: acquiring various common load voltage and current waveform data in a laboratory environment, and segmenting the acquired load current waveform according to a voltage forward zero crossing point; constructing a load identification model, and training the load identification model by using the training set; the method comprises the following steps: training a load identification model, carrying out attack resisting operation on the trained load identification model, generating an adversarial sample, marking a load type label which is the same as that of an original sample, forming a new training set, retraining the load identification model by using the new training set, obtaining a high-robustness load identification model, and putting the high-robustness load identification model into a complex power utilization environment for application. According to the method, the adversarial sample and the original sample are used for training the load identification model together to enhance the robustness of the model, and the identification performance of the model in a complex power utilization environment can be improved under the condition that the acquisition difficulty of complex interference load data with labels is large.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of load identification, and in particular to a load identification method and system in a complex power consumption environment based on adversarial training. BACKGROUND

[0002] Under the background of increasingly severe global climate change and continuous growth of energy demand, power enterprises need to undergo profound changes. Among them, improving demand side management capability is an important reform direction for power enterprises. Load identification is an important sub-task of non-intrusive load monitoring (NILM), which explores specific loads inside the user through the user's power consumption data. Power enterprises can use the user's power consumption to evaluate the adjustable potential and assist demand response decision-making to reduce the operation loss of the power grid.

[0003] With the updating of key technologies such as advanced metering infrastructure (AMI), researchers can collect various high-precision load data for load identification analysis and model construction. However, such data is usually collected in a laboratory environment and cannot fully represent the operation of the power load in the real environment. In the real environment, there are often disturbances such as power quality fluctuations and changes in the power consumption characteristics of various loads, which reduce the performance of the constructed model. A common processing method is to add such disturbed load data to the training, but there are many types of disturbances, and it is difficult to obtain data, and the collected data cannot well cover the situation under various disturbances; another common processing method is to add Gaussian noise or other forms of noise to the input data, which can increase the robustness of the model to a certain extent, but for loads with similar characteristics, this method can easily destroy the features that can distinguish each other, resulting in poor recognition effect.

[0004] It is a difficult problem for load identification applications to construct a model with good identification performance in a complex power consumption environment, but it is limited by the unknown nature of the real environment and the difficulty of data acquisition. SUMMARY

[0005] In view of the problem that existing load identification technology cannot obtain sufficient training data to represent various disturbances in a complex real power consumption environment, resulting in a decline in the performance of the constructed model in actual application, the present application is proposed.

[0006] Therefore, the problem to be solved by the present application is to construct a high-robustness load identification model based on adversarial training, which can improve the identification performance of the model in a complex power consumption environment under the condition of difficult acquisition of labeled disturbed load data.

[0007] To solve the above technical problems, the present application provides the following technical solutions:

[0008] In a first aspect, the embodiments of the present application provide a load identification method in a complex power consumption environment based on adversarial training, which comprises collecting voltage and current waveform data of various common loads in a laboratory environment, and segmenting the collected load current waveform according to the voltage forward zero-crossing point; preprocessing the segmented load current waveform, taking each segment of the preprocessed current waveform as a sample, constructing a load identification model, labeling each sample with the corresponding load type to form a training set of the load identification model, and training the load identification model using the training set; performing an adversarial attack operation on the trained load identification model, generating an adversarial sample by adding a disturbance based on the gradient of the loss function with respect to the input data on the original sample, and labeling the adversarial sample with the same load type label as the original sample; adding the load type labeled adversarial sample to the training set to form a new training set, retraining the load identification model using the new training set, and obtaining a high robustness load identification model, and applying the high robustness load identification model to the complex power consumption environment.

[0009] As a preferred scheme of the load identification method in a complex power consumption environment based on adversarial training of the present application, the collection of voltage and current waveform data of various common loads comprises collecting load voltage and current waveform data of an electromagnetic oven, an electric heater, an electric hair dryer, an electric fan, an electric lamp, a notebook computer and a refrigerator.

[0010] As a preferred scheme of the load identification method in a complex power consumption environment based on adversarial training of the present application, the sampling frequency of collecting voltage and current waveform data of various common loads is greater than 2 kHz.

[0011] As a preferred scheme of the load identification method in a complex power consumption environment based on adversarial training of the present application, the segmentation of the collected load current waveform according to the voltage forward zero-crossing point comprises the voltage forward zero-crossing point t0 + which means that the voltage sampling value at the sampling point is greater than or equal to zero, and the voltage sampling value at the previous sampling point is less than zero, and the formula is as follows:

[0012]

[0013] wherein u represents the voltage sampling value, k represents the sampling point index, represents the voltage forward zero-crossing point index; the preprocessed current data after segmentation is represented as I M×N , I M×N The formula is as follows:

[0014]

[0015] wherein I M×N represents the preprocessed current data after segmentation, i M,N represents the nth sampling value of the mth segment of current data.

[0016] As a preferred scheme of the load identification method in a complex power consumption environment based on adversarial training, the pre-processing of the segmented load current waveform comprises: removing abnormal values, judging and removing abnormal points by using a 3σ method, assuming that the data satisfies a normal distribution, calculating the mean value and standard deviation of the sampling points corresponding to adjacent cycles, values outside 3 times the standard deviation from the center are small probability events, and are removed, and the removing and iteration are repeated multiple times until the variance meets the requirements; missing values are filled, for continuous data missing, a whole cycle data direct removal operation is adopted; for scattered data missing, a polynomial interpolation method is used for supplement.

[0017] As a preferred scheme of the load identification method in a complex power consumption environment based on adversarial training, the load identification model is a one-dimensional convolutional neural network model with SE-ResBlock, the structure of the residual module includes two one-dimensional convolutional layers and a shortcut connection, the shortcut connection directly adds the input to the output of the convolutional layer, the SE-ResBlock introduces an SE module based on the standard residual module, compresses the feature map into a vector through global average pooling, calculates the importance weight of each channel through two fully connected layers and an activation function, and applies the importance weight to each channel of the original feature map, the load identification model takes a single cycle current waveform as input, sequentially passes through multiple SE-ResBlock, passes through a flattening layer and a fully connected layer, and outputs the model identification result, the model parameters are initialized by using Kaiming, the parameters are updated by using a stochastic gradient descent optimizer with momentum, and cross entropy is used as a loss function.

[0018] As a preferred scheme of the load identification method in a complex power consumption environment based on adversarial training, the operation of performing adversarial attack on the trained load identification model comprises: updating the adversarial samples in multiple iterations, and dynamically adjusting the amplitude and direction of the update based on the Adam optimizer, the update of the adversarial samples comprises: inputting the training set samples or the generated adversarial samples after the last iteration into the load identification model, calculating the loss function of the samples and the corresponding label and the gradient of the loss function with respect to the samples, and the calculation formula is as follows:

[0019]

[0020] Wherein, g t represents the gradient of the loss function with respect to the sample at the tth iteration, x t-1 represents the generated adversarial sample after the t-1th iteration, y represents the corresponding load type label, D(·) represents the output of the load identification model, L(·) represents the loss function, represents the gradient of the loss function with respect to the sample; the formula for updating the adversarial sample is as follows:

[0021]

[0022] wherein x t represents the generated adversarial sample under the tth iteration, z t represents the adversarial perturbation under the current iteration, v and h represent the first and second moment estimates of the loss function gradient respectively, β1 and β2 are the exponential decay rates of the moment estimates, are the bias correction calculations, ε represents a small numerical constant, and α represents the perturbation step size; sign(·) represents the sign function, clip(·) represents the clipping function, δ represents the upper and lower limits of clipping, x t-1 represents the generated adversarial sample under the t-1th iteration, represents the generated adversarial sample under the tth iteration without clipping, t represents the current iteration number, h t represents the second moment estimate of the loss function gradient under the tth iteration, h t-1 represents the second moment estimate of the loss function gradient under the t-1th iteration, g t represents the gradient of the loss function with respect to the sample under the tth iteration, v t represents the first moment estimate of the loss function gradient under the tth iteration, v t-1 represents the first moment estimate of the loss function gradient under the t-1th iteration, t represents the current iteration number; the iteration is performed T times to obtain the finally generated adversarial sample.

[0023] In a second aspect, the embodiments of the present application provide a load identification system in a complex power consumption environment based on adversarial training, which comprises a collection module for collecting voltage and current waveform data of various common loads in a laboratory environment, and segmenting the collected load current waveform according to the voltage forward zero-crossing point; a model construction module for preprocessing the segmented load current waveform, taking each segment of the preprocessed current waveform as a sample, constructing a load identification model, labeling each sample with a corresponding load type to form a training set of the load identification model, and training the load identification model using the training set; an adversarial module for performing adversarial attack operation on the trained load identification model, generating adversarial samples by adding perturbations based on the gradient of the loss function with respect to the input data on the original samples, and labeling the adversarial samples with the same load type as the original samples; a training module for adding the adversarial samples labeled with the load type to the training set to form a new training set, retraining the load identification model using the new training set, obtaining a high-robustness load identification model, and applying the high-robustness load identification model in a complex power consumption environment.

[0024] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor, the memory storing a computer program, wherein the computer program instructs the processor to implement the steps of the load identification method in a complex power consumption environment based on adversarial training according to the first aspect of the present application.

[0025] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium storing a computer program, wherein the computer program instructs the processor to implement the steps of the load identification method in a complex power consumption environment based on adversarial training according to the first aspect of the present application.

[0026] The present application has the following beneficial effects: collecting voltage and current waveform data of various common loads, segmenting the data according to the positive zero-crossing points of voltage, which is conducive to capturing the periodic characteristics of the load, obtaining relatively clean and noise-free periodic load data, constructing a load identification model, performing adversarial attack operation on the trained load identification model, generating adversarial samples, and adding these adversarial samples to the training set to retrain the model, training the load identification model with the adversarial samples and the original samples to enhance the robustness of the model, which can improve the identification performance of the model in a complex power consumption environment under the condition that it is difficult to obtain labeled complex interference load data, and improve the applicability and performance of the load identification model in actual scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0028] Fig. 1 The flowchart of the load identification method in a complex power consumption environment based on adversarial training.

[0029] Fig. 2 The basic structure of SE-Resblock of the load identification method in a complex power consumption environment based on adversarial training.

[0030] Fig. 3 The structural schematic diagram of the load identification method in a complex power consumption environment based on adversarial training. DETAILED DESCRIPTION

[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings of the specification.

[0032] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without the specific details set forth in this description, that the present application can be practiced with only some of the details set forth in this description, that the present application can be practiced with other elements in addition to or in place of the details set forth in this description, and that the present application can be practiced using any number of approaches.

[0033] Second, the "one embodiment" or "an embodiment" referred to herein means a specific feature, structure, characteristic, or combination of features and characteristics described herein that can be included in at least one implementation of the present application. The appearance of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are the various embodiments referred to separately or in combination, mutually exclusive of one another.

[0034] Embodiment 1

[0035] Reference Figs. 1-3 For the first embodiment of the present application, the embodiment provides a load identification method in a complex power consumption environment based on adversarial training, comprising,

[0036] S1: Collecting voltage and current waveform data of various common loads in a laboratory environment, and segmenting the collected load current waveform according to the voltage forward zero-crossing point.

[0037] Specifically, 11 common loads such as induction cooker, electric heater, electric hair dryer, electric fan, electric lamp, notebook computer, refrigerator, electric blanket, microwave oven, and electric rice cooker are collected by using intelligent socket, and the sampling frequency is 6.4 kHz. In this embodiment, the transient process of the load is not considered, so the start time of data collection is set to 30 seconds after each load device is turned on, to ensure that the load enters the steady state working condition.

[0038] Preferably, the load identification model can identify the load type with a boundary. The above-mentioned 11 types of electrical appliances have a high frequency of use in various families, have a certain universality, and also define the load types that can be identified by the present application.

[0039] Further, the sampling frequency for collecting voltage and current waveform data of various common loads is greater than 2 kHz. The reason is that the model takes a cycle of current waveform as input. According to the Nyquist sampling theorem, in order to restore the original signal without distortion in the sampled signal, the sampling frequency should be greater than twice the highest frequency of the signal. If only the fundamental current is considered, it should be at least 50 Hz*2=100 Hz. However, in actual application, higher harmonics (3rd, 5th harmonics) are generally considered, and to improve the degree of waveform data restoration, the sampling frequency multiple is usually set higher (5-10 times), so the sampling frequency is greater than 2 kHz to ensure the integrity and accuracy of the current waveform information in the sampling process.

[0040] Further, the voltage forward zero-crossing point means that the voltage sampling value at the sampling point is greater than or equal to zero, and the voltage sampling value at the previous sampling point is less than zero, as follows:

[0041]

[0042] wherein u represents the voltage sampling value, k represents the sampling point index, represents the voltage positive zero-crossing point index.

[0043] Further, the preprocessed current data after segmentation is represented as I M×N M×N The formula of I

[0044]

[0045] wherein I M×N represents the preprocessed current data after segmentation, each row of I M×N represents the current waveform of a segment (i.e. one cycle), N is the sampling point number of single cycle data, and its value is equal to the ratio of sampling frequency to power frequency, here N = 6400 / 50 = 128, i M,N represents the nth sampling value of the mth segment of current data.

[0046] S2: The preprocessed load current waveform after segmentation is taken as a sample, and a load identification model is constructed. Each sample is labeled with a corresponding load type to form a training set of the load identification model, and the load identification model is trained using the training set.

[0047] Specifically, the preprocessing step includes removing outliers and filling in missing values.

[0048] Further, since the load steady-state data is relatively stable, the adjacent cycle corresponding positions of the sampling points can be used to judge the abnormal points. In this embodiment, 3σ method is used to judge and remove abnormal points. Assuming that the data satisfies normal distribution, the mean and standard deviation of the sampling points at the corresponding positions of adjacent cycles are calculated. The probability of the value outside the 3 times standard deviation of the mean is less than one thousandth, which is a small probability event and can be removed. Repeat the removal and iteration multiple times, and constantly update the mean and standard deviation until the variance reaches a small value.

[0049] ​Further, the supplement of missing values is divided into two cases: for large-scale, continuous data missing, the whole cycle data is directly removed; for small-scale, scattered data missing, the polynomial interpolation method is used for supplement. The polynomial interpolation method is a data recovery algorithm that uses the strong continuity and autocorrelation of the data before and after each point. It assumes that a few consecutive load data points show continuous change rules. A number of load points before and after the non-missing time are used to calculate the polynomial interpolation formula, obtain the corresponding polynomial, and take the function value corresponding to the missing point position in the polynomial as the repair value of the missing data.

[0050] Further, according to the mathematical concept, for n points on a plane (no two points on a straight line), a -1 order polynomial can be found to pass through the n points. The n-1 order polynomial passing through the n points is solved, and the coordinates (x1, y1), (x2, y2)…(xn, yn) of the n points are substituted into the polynomial function to obtain the Lagrange interpolation polynomial as:

[0051]

[0052] Where L(x) represents the approximate value of the missing value, x represents the point corresponding to the missing value, x i represents the independent variable coordinate value of the i th data point, y i represents the dependent variable coordinate value of the i th data point, and n represents the number of data points.

[0053] Further, the point x corresponding to the missing value is substituted into the interpolation polynomial to obtain the approximate value L(x) of the missing value. In this embodiment, n = 2, i.e. linear interpolation.

[0054] Further, the load recognition model is a one-dimensional convolutional neural network model with SE-ResBlock. The residual module (ResBlock) structure includes two one-dimensional convolutional layers and a shortcut connection, which directly adds the input to the output of the convolutional layer; SE-ResBlock is an improved deep learning model architecture, which adds an SE (Squeeze-and-Excitation) module to the original residual module (ResBlock) model. First, the feature map is compressed into a vector through global average pooling, then the importance weight of each channel is calculated through two fully connected layers and an activation function, and finally the weights are applied to each channel of the original feature map. SE-ResBlock improves the network's representation ability by explicitly modeling the dependence between channels, and its structure is as shown in Fig. 2 .

[0055] Further, in this embodiment, the one-dimensional convolutional neural network model with SE-ResBlock has the structure as shown in Fig. 3The model parameters are initialized using Kaiming, the parameters are updated using the stochastic gradient descent (SGDM) optimizer with momentum, the model learning rate is set to 0.001, the iteration is repeated 100 times, and the cross-entropy is used as the loss function.

[0056] S4: Perform an adversarial attack operation on the trained load identification model, generate an adversarial sample by adding a disturbance based on the gradient of the loss function with respect to the input data on the original sample, and label it with the same load type label as the original sample.

[0057] Specifically, to address the problem that generating an adversarial sample directly using the gradient of the loss function may deviate from the decision boundary, and it is difficult to converge when training the model using the adversarial sample, the adversarial sample is updated multiple times, and the amplitude and direction of the update are dynamically adjusted based on the Adam optimizer, thereby more carefully exploring the vulnerability of the model, and generating more effective adversarial samples.

[0058] Further, Adam, which stands for Adaptive Moment Estimation, is the most popular and relatively effective optimizer in the field of deep learning. Adam method draws on the introduction of momentum in Momentum algorithm, AdaGrad's adaptive adjustment of learning rate based on historical gradient square sum, and RMSProp's step-by-step forgetting of past gradients, achieving the goal of faster convergence and more effective learning by integrating the strengths of previous optimization methods. The specific steps for updating the adversarial sample are as follows:

[0059] The training set sample or the adversarial sample generated after the previous iteration is input into the load identification model, the loss function of the sample and the corresponding label is calculated, and the gradient of the loss function with respect to the sample is calculated, the calculation formula is as follows:

[0060]

[0061] where g t represents the gradient of the loss function with respect to the sample at the tth iteration, x t-1 represents the adversarial sample after t-1 iterations, y represents the corresponding load type label, D(·) represents the output of the load identification model, L(·) represents the loss function, represents the gradient of the loss function with respect to the sample;

[0062] The formula for updating the adversarial sample is as follows:

[0063]

[0064] where x t represents the adversarial sample at the tth iteration, z trepresents the adversarial perturbation at the current iteration number, v, h represent the first and second moment estimates of the loss function gradient respectively, which can also be understood as the momentum of gradient calculation and the historical square sum of the gradient respectively, β1, β2 are the exponential decay rates of the moment estimates, and the embodiments take 0.9 and 0.999, are both bias correction calculations, which reduce the influence of bias on the initial training, and ε represents a small numerical constant to prevent division by zero error, and the embodiment takes 10 -8 , and α represents the perturbation step size, and the embodiment takes 10 -2 , sign(·) represents the sign function, and clip(·) represents the clipping function, which controls z t in the range of (-δ, δ), and δ represents the upper and lower limits of clipping, and the embodiment takes 0.2, x t-1 represents the generated adversarial sample at the iteration number t-1, represents the generated adversarial sample at the iteration number t, and t represents the current iteration number, h t represents the second moment estimate of the loss function gradient at the iteration number t, h t-1 represents the second moment estimate of the loss function gradient at the iteration number t-1, g t represents the gradient of the loss function with respect to the sample at the iteration number t, v t represents the first moment estimate of the loss function gradient at the iteration number t, v t-1 represents the first moment estimate of the loss function gradient at the iteration number t-1.

[0065] Further, the specific steps of repeatedly updating the adversarial sample are repeated T times to obtain the finally generated adversarial sample.

[0066] S5: Add the adversarial sample labeled with the load type to the training set to form a new training set, retrain the load recognition model using the new training set, obtain a high-robustness load recognition model, and apply the high-robustness load recognition model to the complex power consumption environment.

[0067] Specifically, the adversarial sample and the original training set sample are merged in a certain proportion to form a new training set, and the samples in the new training set are used to train the load recognition model in the same way as in S2 to obtain a high-robustness load recognition model.

[0068] Preferably, by adding adversarial samples for adversarial training, the robustness of the model to adversarial samples can be enhanced, and the generalization ability of the model can be improved. Adversarial training makes the model not only learn the features of normal samples during training, but also learn the features of adversarial samples, thereby expanding the decision boundary of the model, reducing the influence of adversarial samples, and improving the robustness of the model to noise and perturbations.

[0069] Preferably, the high-robustness load identification model can be applied to complex power consumption environments to monitor and identify the power consumption status of various household appliances in real time.

[0070] Embodiment 2

[0071] With reference to Figs. 1-3 For an embodiment of the present application, a load identification system in a complex power consumption environment based on adversarial training is provided, comprising:

[0072] A collection module is configured to collect voltage and current waveform data of various common loads in a laboratory environment, and segment the collected load current waveform according to the voltage forward zero-crossing point.

[0073] A model construction module is configured to preprocess the segmented load current waveform, take each segment of the preprocessed current waveform as a sample, construct a load identification model, label each sample with a corresponding load type to form a training set of the load identification model, and train the load identification model using the training set.

[0074] An adversarial module is configured to perform adversarial attack operations on the trained load identification model, generate adversarial samples, and label the adversarial samples with the same load type as the original samples.

[0075] A training module is configured to add the adversarial samples labeled with the load type to the training set to form a new training set, retrain the load identification model using the new training set, obtain a high-robustness load identification model, and apply the high-robustness load identification model to a complex power consumption environment.

[0076] The specific limitations of the load identification system in a complex power consumption environment based on adversarial training can be referred to the limitations of the load identification method in a complex power consumption environment based on adversarial training described above, which will not be repeated here. Each module in the above load identification system in a complex power consumption environment based on adversarial training can be realized by software, hardware, or a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0077] Embodiment 3

[0078] With reference to Figs. 1-3For the third embodiment of the present application, on the basis of the first two embodiments, the embodiment of the present application provides a computer device, which comprises a processor, a memory and a network interface connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium.

[0079] The database of the computer device is used to store action detection data. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the steps in any of the sparse tensor operation acceleration method embodiments.

[0080] In an embodiment, the embodiment of the present application provides a computer readable storage medium, which stores a computer program. The computer program is executed by the processor to implement the steps in any of the sparse tensor operation acceleration method embodiments.

[0081] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to the memory, storage, database or other medium in the embodiments provided by the present application can include at least one of the non-volatile and volatile memories. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory or an optical memory. The volatile memory can include a random access memory (RAM) or an external cache memory. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0082] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the present application, which should be covered in the scope of the claims of the present application.​​​​

Claims

1. A load identification method based on adversarial training in a complex power consumption environment, characterized in that: The application relates to a method for constructing a high-robustness load recognition model. Collecting various common load voltage and current waveform data in a laboratory environment, segmenting the collected load current waveform according to voltage forward zero-crossing points; Pretreating the segmented load current waveform, taking each pretreated current waveform as a sample, constructing a load recognition model, labeling each sample with a corresponding load type to form a training set of the load recognition model, and training the load recognition model using the training set; Performing an adversarial attack operation on the trained load recognition model, generating an adversarial sample by adding a disturbance based on the gradient of a loss function with respect to input data to the original sample, and labeling the adversarial sample with the same load type as the original sample; Adding the load type labeled adversarial sample to the training set to form a new training set, retraining the load recognition model using the new training set, obtaining a high-robustness load recognition model, and applying the high-robustness load recognition model to a complex power consumption environment.

2. The load identification method based on adversarial training in a complex power consumption environment according to claim 1, wherein: The method for collecting various common load voltage and current waveform data includes collecting load voltage and current waveform data of an electromagnetic oven, an electric heater, an electric hair dryer, an electric fan, an electric lamp, a notebook computer and a refrigerator.

3. The load identification method based on adversarial training in a complex power consumption environment according to claim 2, wherein: The sampling frequency of the method for collecting various common load voltage and current waveform data is greater than 2 kHz.

4. The load identification method based on adversarial training in a complex power consumption environment according to claim 3, wherein: The method for segmenting the collected load current waveform according to voltage forward zero-crossing points includes, voltage forward zero crossing It refers to the voltage sampling value at the sampling point is greater than or equal to zero, and the voltage sampling value at the previous sampling point is less than zero, and the specific formula is as follows: wherein u represents a voltage sample value, k represents a sample point index, represents a voltage forward zero-crossing point index; The pre-processed current data after segmentation is denoted as I M×N , The formula of I M×N is as follows: where I M×N denotes the preprocessed current data after segmentation, i M,N denotes the n-th sample value of the m-th segment of the current data.

5. The method of claim 4, wherein the method is based on an adversarial training. The method for pretreating the segmented load current waveform includes, Removing abnormal values, judging and removing abnormal points by using a 3sigma method, setting data to satisfy normal distribution, calculating the mean value and standard deviation of sampling points at corresponding positions of adjacent cycles, removing values outside 3 times the standard deviation from the center of the mean value, repeatedly removing and iterating until the variance meets the requirements; Filling in missing values, directly removing continuous data missing for a whole cycle, and supplementing scattered data missing by using a polynomial interpolation method.

6. The method of claim 5, wherein the method is based on adversarial training. The load recognition model is a one-dimensional convolutional neural network model with an SE-ResBlock, the structure of a residual module includes two one-dimensional convolutional layers and a shortcut connection, the shortcut connection directly adds input to the output of the convolutional layer, the SE-ResBlock introduces an SE module on the basis of a standard residual module, compresses feature maps into a vector through global average pooling, calculates importance weights of each channel through two fully connected layers and an activation function, and applies the importance weights to each channel of the original feature map, the load recognition model takes a single-cycle current waveform as input, sequentially passes through multiple SE-ResBlocks, passes through a flattening layer and a fully connected layer, outputs a model recognition result, initializes model parameters by using Kaiming, updates parameters by using a stochastic gradient descent optimizer with momentum, and uses cross-entropy as a loss function.

7. The method of claim 6, wherein the method is based on adversarial training. The operation of performing an adversarial attack on the trained load recognition model includes updating the adversarial sample in multiple iterations, and dynamically adjusting the amplitude and direction of the update based on the Adam optimizer. wherein g t denotes the gradient of the loss function with respect to the sample at the tth iteration, x t-1 denotes the generated adversarial sample after t-1 iterations, y denotes the corresponding load type label, D(·) denotes the output of the load identification model, L(·) denotes the loss function, and g denotes the gradient of the loss function with respect to the sample. The formula for updating the adversarial sample is as follows: where x t represents the generated adversarial sample at the tth iteration, z t represents the adversarial perturbation at the current iteration, v and h represent the first and second moment estimates of the loss function gradient, respectively, β1 and β2 are the exponential decay rates of the moment estimates, are the bias correction calculations, ε represents a small numerical constant, and α represents the perturbation step size; sign(·) represents the sign function, clip(·) represents the clipping function, δ represents the upper and lower limits of clipping, x t-1 represents the generated adversarial sample at the (t-1)th iteration, represents the generated adversarial sample at the tth iteration without clipping, t represents the current iteration number, h t represents the second moment estimate of the loss function gradient at the tth iteration, h t-1 represents the second moment estimate of the loss function gradient at the (t-1)th iteration, g t represents the gradient of the loss function with respect to the sample at the tth iteration, v t represents the first moment estimate of the loss function gradient at the tth iteration, v t-1 represents the first moment estimate of the loss function gradient at the (t-1)th iteration; Iterate T times to obtain the final generated adversarial sample.

8. A load identification system in a complex power consumption environment based on adversarial training, based on the load identification method in a complex power consumption environment based on adversarial training in any one of claims 1-7, characterized in that: Also includes, The acquisition module is used for collecting various common load voltage and current waveform data in a laboratory environment, and segmenting the collected load current waveform according to the voltage forward zero-crossing point; The model construction module is used for pre-processing the segmented load current waveform, taking each pre-processed current waveform as a sample, constructing a load recognition model, labeling each sample with a corresponding load type to form a training set for the load recognition model, and training the load recognition model using the training set; The adversarial module is used for performing an adversarial attack on the trained load recognition model, generating an adversarial sample by adding a disturbance based on the gradient of the loss function with respect to the input data to the original sample, and labeling the adversarial sample with the same load type label as the original sample; The training module is used for adding the adversarial sample labeled with the load type to the training set to form a new training set, retraining the load recognition model using the new training set, and obtaining a high-robustness load recognition model. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that: The processor executes the computer program to realize the steps of the load recognition method in a complex power consumption environment based on adversarial training according to any one of claims 1-7.

10. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to realize the steps of the load recognition method in a complex power consumption environment based on adversarial training according to any one of claims 1-7.