Small sample load identification method and system based on SE attention mechanism

By using the SE attention mechanism in user-side load recognition method, the problem of unsatisfactory load recognition effect caused by small sample size is solved, the generalization performance and adaptability of the model are improved, and the small sample environment is realized Payload identification under .

CN118941838APending Publication Date: 2024-11-12GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410884263.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In user-side load recognition, due to the small number of samples, it is difficult for conventional neural networks to train to achieve better results, resulting in poor results in small sample environments, making it difficult to quickly adapt to user-side power usage habits.

Method used

Using a small sample load recognition method based on the SE attention mechanism, a color V-I trajectory diagram containing timing information is constructed by obtaining the voltage and current signals during steady-state operation of the appliance, the preprocessed visual features are extracted, and the basic load recognition is obtained. The SE attention mechanism module is added to the model for further training to achieve load recognition in a small sample environment.

Benefits of technology

It improves data processing efficiency and intuitiveness of model input, strengthens the model's learning of key features, reduces the risk of overfitting, improves the generalization performance of the model, and achieves rapid adaptation and verification under different sample conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941838A_ABST
    Figure CN118941838A_ABST
Patent Text Reader

Abstract

The invention discloses a small sample load identification method and system based on an SE attention mechanism, and the method comprises the steps: obtaining voltage and current signals during the steady-state operation of an electric appliance, constructing a color V-I trajectory diagram containing time sequence information, and extracting the preprocessed visual features from the color V-I trajectory diagram; based on the convolutional neural network, a basic load identification model is constructed, and the basic load identification model comprises a feature extraction layer and a linear layer; using the processed visual features as input, applying the processed visual features to the constructed basic load identification model, and carrying out preliminary model training and learning; based on a preliminary training result, adding an SE attention mechanism module between a feature extraction layer and a linear layer of the basic load identification model to obtain an improved load identification model; and based on the improved load identification model, further training and learning are carried out, and load identification in a small sample environment is realized. According to the invention, the accuracy and stability of load identification are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of non-invasive load identification technology, and in particular to a small sample load identification method and system based on SE attention mechanism. Background Art

[0002] Energy management on the user side is an important measure. As an important method of energy management on the user side, load identification obtains the voltage and current signals of the electrical appliances on the user side, and then mines out the implicit information through artificial intelligence and other methods. However, the number of samples on the user side is often small, and it is difficult to train the conventional neural network used for image classification to achieve good results, which brings huge challenges to the implementation of load identification. At present, there are attempts such as federated learning, transfer learning and small sample learning for the actual deployment and application of load identification on the user side. Federated learning attempts to fine-tune the unified load identification model on the user side, and learn the user's electricity usage habits by adapting to the data distribution on the user side; transfer learning attempts to migrate the model of the source domain to the target domain through mapping and other methods, so as to migrate the entire model to the target domain for use; small sample learning is learning with a very small number of samples. By comparing the above three methods, it is not difficult to see that federated learning and transfer learning require a long period of data sample search and collection before they can be realized, and it is difficult for the load identification model to quickly adapt to the user side. Therefore, this method focuses on small sample learning.

[0003] Small sample learning refers to the training and testing of neural network models under extremely scarce sample conditions. Since the number of samples used to train the model is extremely small, the training effect of conventional neural network models is often not ideal. It is necessary to modify the model for small sample conditions so that better training results can be achieved in a small sample environment. Summary of the invention

[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0005] In view of the above existing problems, the present invention is proposed.

[0006] Therefore, the present invention provides a small sample load identification method and system based on SE attention mechanism to solve the problem that the existing load identification method is not ideal in a small sample environment.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] In a first aspect, the present invention provides a small sample load identification method based on SE attention mechanism, comprising:

[0009] Obtain the voltage and current signals of the electrical appliance during steady-state operation, construct a color VI trajectory diagram containing timing information, and extract preprocessed visual features from it;

[0010] Based on the convolutional neural network, a basic load identification model is constructed, wherein the basic load identification model includes a feature extraction layer and a linear layer;

[0011] The processed visual features are used as input and applied to the constructed basic load recognition model for preliminary model training and learning;

[0012] Based on the results of preliminary training, an SE attention mechanism module is added between the feature extraction layer and the linear layer of the basic load recognition model to obtain an improved load recognition model;

[0013] Based on the improved load identification model, further training and learning are carried out to achieve load identification in a small sample environment.

[0014] As a preferred solution of the small sample load identification method based on SE attention mechanism described in the present invention, wherein:

[0015] The method of constructing a colored VI trajectory diagram containing timing information comprises the following steps:

[0016] Calculate the maximum value of voltage and current signals and determine the signal range;

[0017] Divide the pixel grid into equal intervals according to the maximum signal value and image size;

[0018] Map the voltage and current data of each point onto the image grid and mark the corresponding pixel points;

[0019] By analyzing the relative positions of adjacent points in the voltage-current space, a hue value H representing the direction of movement is assigned to each pixel in the VI trajectory graph;

[0020] Calculate the pixel point (l t ,w t ) Saturation S on the color VI trajectory diagram;

[0021] The overall brightness V is obtained by averaging the grayscale images of multi-cycle VI trajectories;

[0022] The hue H, saturation S, and lightness V are converted into RGB color space, and the color image is constructed by calculating the R, G, and B values ​​of the final pixel.

[0023] As a preferred solution of the small sample load identification method based on SE attention mechanism described in the present invention, wherein:

[0024] The calculated maximum values ​​of the voltage and current signals are expressed as:

[0025] i max =max(abs(i))

[0026] u max =max(abs(u))

[0027] Among them, i is the vector composed of the instantaneous values ​​of the current signal, u is the vector composed of the instantaneous values ​​of the voltage signal, adb(·) is the absolute value function, and max(·) is the maximum value function.

[0028] As a preferred solution of the small sample load identification method based on SE attention mechanism described in the present invention, wherein:

[0029] The step of dividing the pixel grid into equal intervals according to the maximum signal value and the image size includes:

[0030] Assume that the length of the image is 2L pixels and the width is 2W pixels. The change units of the voltage and current represented by each pixel in the image are determined according to the maximum values ​​of the original voltage and current signals:

[0031]

[0032] Among them, Δi represents the current change represented by each pixel in the vertical direction of the image, and Δu represents the voltage change represented by each pixel in the horizontal direction of the image.

[0033] As a preferred solution of the small sample load identification method based on SE attention mechanism described in the present invention, wherein:

[0034] The voltage and current data of each point are mapped to the image grid, and the corresponding pixel points are marked as:

[0035]

[0036] P(l t ,w t )=1

[0037] Among them, (l t ,w t ) represents the pixel coordinates of a point on the current-voltage trajectory in the final generated image, l t represents the horizontal coordinate of the point, w t Represents the vertical coordinate of the point, i t represents the current value measured at time t, ut represents the voltage value measured at time t, and ceil(·) is the rounding function.

[0038] As a preferred solution of the small sample load identification method based on SE attention mechanism described in the present invention, wherein:

[0039] By analyzing the relative positions of adjacent points in the voltage-current space, each pixel in the VI trajectory graph is assigned a hue value H indicating the direction of movement, which is expressed as:

[0040]

[0041] Among them, arg(·) calculates the phase angle of two consecutive points in the VI trajectory, K is the number of pixels, and T is the set of pixels counted in a certain direction;

[0042] The calculation pixel point (l t ,w t ) The saturation S on the color VI trajectory diagram is expressed as:

[0043]

[0044] Among them, V rms and I rms It is the effective value of voltage and current signal.

[0045] As a preferred solution of the small sample load identification method based on SE attention mechanism described in the present invention, wherein:

[0046] The SE attention mechanism module includes a global pooling layer, a fully connected layer, a nonlinear layer and an S-function layer. The module connection relationship is: global pooling layer, fully connected layer 1, nonlinear layer, fully connected layer 2, S-function layer;

[0047] The sliding window size of the global pooling layer is consistent with the size of the input feature map, the input feature map is converted into a one-pixel map, and the feature map is processed from A×B×C to 1×1×C, where A is the length of the input feature map, B is the width of the input feature map, and C is the number of channels of the input feature map;

[0048] The fully connected layer 1 compresses the number of output channels to C / r, where r is the compression factor, and the fully connected layer 2 restores the compressed feature map.

[0049] In a second aspect, the present invention provides a small sample load identification system based on SE attention mechanism, comprising:

[0050] The acquisition module is used to obtain the voltage and current signals of the electrical appliance during steady-state operation, construct a color VI trajectory diagram containing timing information, and extract preprocessed visual features from it;

[0051] Creating a module for building a basic load identification model based on a convolutional neural network, wherein the basic load identification model includes a feature extraction layer and a linear layer;

[0052] An input module is used to apply the processed visual features as input to the constructed basic load recognition model to perform preliminary model training and learning;

[0053] An improvement module is used to add an SE attention mechanism module between the feature extraction layer and the linear layer of the basic load recognition model based on the results of preliminary training to obtain an improved load recognition model;

[0054] The training module is used to conduct further training and learning based on the improved load identification model to achieve load identification in a small sample environment.

[0055] In a third aspect, the present invention provides a computing device, comprising:

[0056] Memory, used to store programs;

[0057] A processor is used to execute the computer executable instructions, which, when executed by the processor, implement the steps of the small sample load identification method based on the SE attention mechanism.

[0058] In a fourth aspect, the present invention provides a computer-readable storage medium, comprising: when the program is executed by a processor, the steps of implementing the small sample load identification method based on the SE attention mechanism are implemented.

[0059] Beneficial effects of the present invention:

[0060] 1. The present invention converts electrical signals into color VI trajectory diagrams, which is a cross-domain technological innovation and improves the efficiency of data processing and the intuitiveness of model input.

[0061] 2. Introducing the SE attention mechanism in small sample learning scenarios is an effective strategy for model optimization. It strengthens the model's learning of key features, reduces the risk of overfitting, and improves the generalization performance of the model.

[0062] 3. The present invention realizes rapid adaptation and verification of the model under different sample conditions by dynamically adjusting the ratio of training set to test set and the number of training rounds, thereby increasing the flexibility and practicality of the method. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0064] Figure 1 A basic flow chart of a small sample load identification method based on SE attention mechanism provided by one embodiment of the present invention;

[0065] Figure 2 A model diagram of a small sample load identification method based on the SE attention mechanism provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0067] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0068] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0069] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0070] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0071] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0072] Example 1

[0073] Reference Figure 1 , is an embodiment of the present invention, and provides a small sample load identification method based on SE attention mechanism, including:

[0074] S1: Obtain the voltage and current signals of the electrical appliance during steady-state operation, construct a color VI trajectory diagram containing timing information, and extract preprocessed visual features from it;

[0075] In the embodiment of the present application, the extraction of voltage and current signals of steady-state operation of the electrical appliance requires a frequency higher than NkHz, and the acquired signal should be no less than m cycles to ensure that the instantaneous values ​​of the voltage and current signals meet the requirements for constructing a color VI trajectory diagram.

[0076] In an embodiment of the present application, constructing a color VI trajectory map includes the following steps:

[0077] S1.1: According to the voltage and current signals extracted in step S1, the maximum values ​​of the voltage and current signals are obtained, that is:

[0078] i max =max(abs(i))

[0079] u max =max(abs(u))

[0080] Among them, i is the vector composed of the instantaneous values ​​of the current signal, u is the vector composed of the instantaneous values ​​of the voltage signal, abs(·) is the absolute value function, and max(·) is the maximum value function.

[0081] S1.2: Divide the image into cells of equal size according to the pixel size of the composition. Assume that the length of the image is 2L pixels and the width is 2W pixels. The length and width of each cell are:

[0082]

[0083] S1.3: Map the VI trajectory to the VI trajectory diagram. t , the current is i t For a certain instantaneous value of , the corresponding pixel position and image processing are:

[0084]

[0085] P(l t ,w t )=1

[0086] Where ceil(·) is the rounding function, and P(a, b) is the pixel at position (a, b) in the image.

[0087] The pixels are colored, including three colors: R (red), G (green), and B (blue). First, the H, S, and V color models are constructed. H represents hue, that is, the color type, 0° represents red, 120° represents green, and 240° represents blue; S represents saturation, that is, the vividness of the color, 0% represents no color, and 100% represents the most saturated; V represents lightness, that is, the brightness of the color, 0% represents black, and 100% represents white.

[0088] S1.4: The different evolution directions of the VI trajectory are represented to capture the motion trajectory direction of the VI trajectory, that is:

[0089]

[0090] Among them, arg(·) is the phase angle of two consecutive points in the calculated VI trajectory, K is the number of pixels, and T is the set of pixels counted in a certain direction.

[0091] S1.5: The power factor of the VI trajectory is captured by expressing the relationship between the active and reactive components of the current, namely:

[0092]

[0093] Among them, V rms and I rms It is the effective value of voltage and current signal.

[0094] S1.6: The voltage and current signals representing long-term steady-state operation are averaged using m cycles of voltage and current signals. The two-dimensional VI trajectory grayscale image is constructed as described above. The image is averaged to obtain:

[0095]

[0096] S1.7: Convert H, S, V to R, G, B images. First, convert the H value to an angle in the range of 0-360 degrees, then normalize the S and V values ​​to the range of 0-1, and finally calculate the R, G, B values ​​according to the formula of the H, S, V color model, that is:

[0097] C=V×S

[0098]

[0099] m=VC

[0100]

[0101] (R,G,B)=(R′+m,G′+m,B′+m)

[0102] Among them, mod is the remainder function, and C, X and m are intermediate variables.

[0103] S2: Based on the convolutional neural network, a basic load identification model is constructed, wherein the basic load identification model includes a feature extraction layer and a linear layer;

[0104] In an embodiment of the present application, the feature extraction layer includes a convolution layer, a pooling layer and a non-linear layer, and includes at least 2 convolution layers to extract the features of the image as much as possible.

[0105] S3: The processed visual features are used as input and applied to the constructed basic load recognition model for preliminary model training and learning;

[0106] S4: Based on the results of preliminary training, an SE attention mechanism module is added between the feature extraction layer and the linear layer of the basic load recognition model to obtain an improved load recognition model;

[0107] In an embodiment of the present application, the SE attention mechanism module is constructed, including a global pooling layer, a fully connected layer, a nonlinear layer and an S-function layer, and the module connection relationship is: global pooling layer, fully connected layer 1, nonlinear layer, fully connected layer 2, S-function layer.

[0108] In an embodiment of the present application, the sliding window size of the global pooling layer is consistent with the size of the input feature map, thereby converting the input feature map into a map with only one pixel, that is, the feature map is processed from the size of A×B×C to 1×1×C, where A is the length of the input feature map, B is the width of the input feature map, and C is the number of channels of the input feature map.

[0109] In the embodiment of the present application, the fully connected layer 1 compresses the number of output channels to C / r, where r is the compression factor, and the fully connected layer 2 restores the compressed feature map.

[0110] In the embodiment of the present application, the S function layer is a sigmoid function, that is:

[0111]

[0112] Among them, e is a natural constant, approximately 2.718.

[0113] S5: Based on the improved load identification model, further training and learning are carried out to realize load identification in a small sample environment.

[0114] In the embodiments of the present application, the load identification model constructed based on the public data set should first be trained on the training set, and after the training is completed, the model weight parameters and gradients should be frozen, and then the effect should be tested on the test set.

[0115] In an embodiment of the present application, a load identification model is constructed according to steps S1 to S4 based on a public data set, α×100% of the samples are selected as a training set, and the remaining (1-α)×100% of the samples are selected as a test set. After the model is trained on the training set for n rounds, it is verified on the test set.

[0116] This embodiment also provides a small sample load identification system based on SE attention mechanism, including:

[0117] The acquisition module is used to obtain the voltage and current signals of the electrical appliance during steady-state operation, construct a color VI trajectory diagram containing timing information, and extract preprocessed visual features from it;

[0118] Creating a module for building a basic load identification model based on a convolutional neural network, wherein the basic load identification model includes a feature extraction layer and a linear layer;

[0119] An input module is used to apply the processed visual features as input to the constructed basic load recognition model to perform preliminary model training and learning;

[0120] An improvement module is used to add an SE attention mechanism module between the feature extraction layer and the linear layer of the basic load recognition model based on the results of preliminary training to obtain an improved load recognition model;

[0121] The training module is used to conduct further training and learning based on the improved load identification model to achieve load identification in a small sample environment.

[0122] Furthermore, it also includes:

[0123] Memory, used to store programs;

[0124] A processor is used to load the program to execute the small sample load identification method based on SE attention mechanism.

[0125] This embodiment also provides a computer-readable storage medium storing a program, which, when executed by a processor, implements the small sample load identification method based on the SE attention mechanism.

[0126] The storage medium proposed in this embodiment and the small sample load identification method based on SE attention mechanism proposed in the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0127] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ReadOnly, Memory, ROM), random access memory (RandomAccess Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.

[0128] Example 2

[0129] Reference Figure 2 , is an embodiment of the present invention, which provides a small sample load identification method based on SE attention mechanism. In order to verify its beneficial effects, scientific demonstration is carried out through specific implementation methods and implementation effects.

[0130] The present embodiment is as follows:

[0131] Step 1: Obtain the voltage and current signals of the electrical appliance during steady-state operation, construct a color VI trajectory diagram containing timing information, and extract preprocessed visual features from it;

[0132] In this embodiment, the extraction of voltage and current signals of steady-state operation of the appliance requires a frequency higher than 3.2kHz to construct a VI trajectory diagram with 32×32 pixels; the acquired signal should be no less than 4 cycles to ensure that the instantaneous values ​​of the voltage and current signals meet the requirements for constructing a color VI trajectory diagram.

[0133] 1) Extract the voltage and current signals and find the maximum value of the voltage and current signals, that is,

[0134] i max =max(abs(i))

[0135] u max =max(abs(u))

[0136] Among them, i is the vector composed of the instantaneous values ​​of the current signal, u is the vector composed of the instantaneous values ​​of the voltage signal, abs(·) is the absolute value function, and max(·) is the maximum value function.

[0137] 2) Divide the image into cells of equal size according to the pixel size of the composition. Assume that the length of the image is 2×16=32 pixels and the width is 2×16=32 pixels. The length and width of each cell are

[0138]

[0139] 3) Map the VI trajectory to the VI trajectory diagram. t , the current is i t For a certain instantaneous value of , the corresponding pixel position and image processing are:

[0140]

[0141] P(l t ,w t )=1

[0142] Where ceil(·) is the rounding function, and P(a, b) is the pixel at position (a, b) in the image.

[0143] The pixels are colored, including three colors: R (red), G (green), and B (blue). First, the H, S, and V color models are constructed. H represents hue, that is, the color type, 0° represents red, 120° represents green, and 240° represents blue; S represents saturation, that is, the vividness of the color, 0% represents no color, and 100% represents the most saturated; V represents lightness, that is, the brightness of the color, 0% represents black, and 100% represents white.

[0144] 4) The different evolution directions of the VI trajectory are represented to capture the motion trajectory direction of the VI trajectory, that is:

[0145]

[0146] Among them, arg(·) is the phase angle of two consecutive points in the calculated VI trajectory, K is the number of pixels, and T is the set of pixels counted in a certain direction.

[0147] 5) The relationship between the active and reactive components of the current is expressed to capture the power factor of the VI trajectory, that is:

[0148]

[0149] Among them, V rms and I rms It is the effective value of voltage and current signal.

[0150] 6) The voltage and current signals representing long-term steady-state operation are averaged using m cycles of voltage and current signals. The two-dimensional VI trajectory grayscale image is constructed as described above. The image is averaged to obtain:

[0151]

[0152] 7) Convert H, S, V to R, G, B images. First, convert the H value to an angle in the range of 0-360 degrees, then normalize the S and V values ​​to the range of 0-1, and finally calculate the R, G, B values ​​according to the formula of the H, S, V color model, that is:

[0153] C=V×S

[0154]

[0155] m=VC

[0156]

[0157] (R,G,B)=(R′+m,G′+m,B′+m)

[0158] Among them, mod is the remainder function, and C, X and m are intermediate variables.

[0159] Step 2: Based on the convolutional neural network, a basic load identification model is constructed, wherein the basic load identification model includes a feature extraction layer and a linear layer;

[0160] In this embodiment, the feature extraction layer includes a convolution layer, a pooling layer and a nonlinear layer. In this embodiment, two convolution layers are included.

[0161] In this embodiment, each convolution layer is followed by a nonlinear layer and a pooling layer, and the feature extraction layer structure of the model is in the following order: convolution layer 1, nonlinear layer 1, pooling layer 1, convolution layer 2, nonlinear layer 2, pooling layer 2; wherein, convolution layer 1 uses 32 (3×3) convolution kernels, a step size of 1, and a padding of 1; convolution layer 2 uses 64 (3×3) convolution kernels, a step size of 1, and a padding of 1; nonlinear layer 1 and nonlinear layer 2 are ReLU functions, i.e., max(x,0), where x is the input variable; pooling layer 1 and pooling layer 2 are maximum pooling, with a size of (2×2) and a step size of 2.

[0162] Step 3: Use the processed visual features as input and apply them to the constructed basic load recognition model to perform preliminary model training and learning;

[0163] Step 4: Based on the results of preliminary training, an SE attention mechanism module is added between the feature extraction layer and the linear layer of the basic load recognition model to obtain an improved load recognition model;

[0164] In this embodiment, the SE attention mechanism module is constructed, including a global pooling layer, a fully connected layer, a nonlinear layer and an S-function layer.

[0165] In this embodiment, the SE attention mechanism module is constructed, including a global pooling layer whose sliding window size is consistent with the input feature map size, thereby converting the input feature map into a map with only one pixel, that is, processing the feature map from A×B×C size to 1×1×C, where A is the length of the input feature map, B is the width of the input feature map, and C is the number of channels of the input feature map.

[0166] In this embodiment, the SE attention mechanism module is constructed, including a first fully connected layer that compresses the number of output channels to C / r, where r is the compression factor, and a second fully connected layer that restores the compressed feature map.

[0167] In this embodiment, the SE attention mechanism module is constructed, including the S function layer as a sigmoid function, that is,

[0168]

[0169] Among them, e is a natural constant, approximately 2.718.

[0170] In this embodiment, the SE attention mechanism module structure order of the model is: global pooling layer, fully connected layer 1, nonlinear layer, fully connected layer 2, S function layer; among them, the compression factor used by the fully connected layer 1 is 16, that is, the 64-channel input feature map is converted into a 4-channel output feature map, and the fully connected layer 2 restores the feature map compressed by the fully connected layer 1.

[0171] In this embodiment, a tiling operation is also included between the feature extraction layer and the linear layer of the load identification model to flatten the output feature map of the feature extraction layer into a one-dimensional vector in element order to facilitate classification by the linear layer.

[0172] In this embodiment, the linear layer of the load identification model includes two fully connected layers and one nonlinear layer, that is, the structural order is: fully connected layer 1, nonlinear layer and fully connected layer 2; wherein the fully connected layer 1 contains 512 neurons, the nonlinear layer adopts the ReLU function, the fully connected layer 2 contains 14 neurons, and the output of the fully connected layer 2 is the classification category number of the electrical appliance.

[0173] like Figure 2 As shown in Figure 2, the model diagram includes a feature extraction layer, a SE attention module, and a linear layer from top to bottom. The feature extraction layer includes 2 convolutional layers, 2 nonlinear layers, and 2 pooling layers. The SE attention module includes 1 global pooling layer, 2 fully connected layers, 1 nonlinear layer, and 1 S-function layer. The linear layer includes 2 fully connected layers and 1 nonlinear layer. The structural order is as follows: Figure 2 shown.

[0174] Step 5: Based on the improved load identification model, further training and learning are carried out to achieve load identification in a small sample environment.

[0175] In this embodiment, the load identification model constructed based on the public data set should be trained on the training set first, and the model weight parameters and gradients should be frozen after the training is completed, and then the effect should be tested on the test set.

[0176] In this embodiment, the method is trained and tested on the WHITED dataset to verify the effect of the present invention.

[0177] In this embodiment, the WHITED data set contains 1259 pieces of current data and raw voltage and current data of 54 kinds of household and industrial electrical appliances from all over the world. Considering that users may have many kinds of electrical appliances, but the user's sample information is not much, the present invention selects 14 types of electrical appliances, and the number of samples of each type of electrical appliance is also small.

[0178] In this embodiment, on the WHITED dataset, Figure 1 After the load identification model is trained on the training set, it is tested on the test set.

[0179] As a comparison of an embodiment of the present invention, after removing the SE attention module, the present invention uses the original feature extraction layer and linear layer as the load recognition model, and retrains and tests as a control group. Table 1 is the test set comparison effect of the embodiment of the present invention and the control group, and the comparison results are shown in Table 1.

[0180] Table 1 Comparison table

[0181] Control group Embodiments of the present invention Test accuracy % 87.5 92.0

[0182] As can be seen from Table 1, our invention has taken more detailed considerations in data preprocessing and model design. By converting electrical signals into color VI trajectory diagrams, introducing the SE attention mechanism in small sample learning scenarios, and dynamically adjusting the ratio of training sets to test sets and the number of training rounds, the accuracy and stability of load identification are improved.

[0183] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A small sample load identification method based on SE attention mechanism, characterized in that: include: Obtain the voltage and current signals of the electrical appliance during steady-state operation, construct a color VI trajectory diagram containing timing information, and extract preprocessed visual features from it; Based on the convolutional neural network, a basic load identification model is constructed, wherein the basic load identification model includes a feature extraction layer and a linear layer; The processed visual features are used as input and applied to the constructed basic load recognition model for preliminary model training and learning; Based on the results of preliminary training, an SE attention mechanism module is added between the feature extraction layer and the linear layer of the basic load recognition model to obtain an improved load recognition model; Based on the improved load identification model, further training and learning are carried out to achieve load identification in a small sample environment.

2. The small sample load identification method based on SE attention mechanism as claimed in claim 1, characterized in that: The method of constructing a colored VI trajectory diagram containing timing information comprises the following steps: Calculate the maximum value of voltage and current signals and determine the signal range; Divide the pixel grid into equal intervals according to the maximum signal value and image size; Map the voltage and current data of each point onto the image grid and mark the corresponding pixel points; By analyzing the relative positions of adjacent points in the voltage-current space, a hue value H representing the direction of movement is assigned to each pixel in the VI trajectory graph; Calculate the pixel point (l t ,w t ) Saturation S on the color VI trajectory diagram; The overall brightness V is obtained by averaging the grayscale images of multi-cycle VI trajectories; The hue H, saturation S, and lightness V are converted into RGB color space, and the color image is constructed by calculating the R, G, and B values ​​of the final pixel.

3. The small sample load identification method based on SE attention mechanism according to claim 1 or 2, characterized in that: The calculated maximum values ​​of the voltage and current signals are expressed as: i max =max(abs(i)) u max =max(abs(u)) Among them, i is the vector composed of the instantaneous values ​​of the current signal, u is the vector composed of the instantaneous values ​​of the voltage signal, adb(·) is the absolute value function, and max(·) is the maximum value function.

4. The small sample load identification method based on SE attention mechanism as claimed in claim 3, characterized in that: The step of dividing the pixel grid into equal intervals according to the maximum signal value and the image size includes: Assume that the length of the image is 2L pixels and the width is 2W pixels. The change units of the voltage and current represented by each pixel in the image are determined according to the maximum values ​​of the original voltage and current signals: Among them, Δi represents the current change represented by each pixel in the vertical direction of the image, and Δu represents the voltage change represented by each pixel in the horizontal direction of the image.

5. The small sample load identification method based on SE attention mechanism as claimed in claim 4, characterized in that: The voltage and current data of each point are mapped to the image grid, and the corresponding pixel points are marked as: P(l t ,w t )=1 Among them, (l t ,w t ) represents the pixel coordinates of a point on the current-voltage trajectory in the final generated image, l t represents the horizontal coordinate of the point, w t Represents the vertical coordinate of the point, i t represents the current value measured at time t, u t represents the voltage value measured at time t, and ceil(·) is the rounding function.

6. The small sample load identification method based on SE attention mechanism as claimed in claim 5, characterized in that: By analyzing the relative positions of adjacent points in the voltage-current space, each pixel in the VI trajectory graph is assigned a hue value H indicating the direction of movement, which is expressed as: Among them, arg(·) calculates the phase angle of two consecutive points in the VI trajectory, K is the number of pixels, and T is the set of pixels counted in a certain direction; The calculation pixel point (l t ,w t ) The saturation S on the color VI trajectory diagram is expressed as: Among them, V rms and I rms It is the effective value of voltage and current signal.

7. The small sample load identification method based on SE attention mechanism as claimed in claim 6, characterized in that: The SE attention mechanism module includes a global pooling layer, a fully connected layer, a nonlinear layer and an S-function layer. The module connection relationship is: global pooling layer, fully connected layer 1, nonlinear layer, fully connected layer 2, S-function layer; The sliding window size of the global pooling layer is consistent with the size of the input feature map, the input feature map is converted into a one-pixel map, and the feature map is processed from A×B×C to 1×1×C, where A is the length of the input feature map, B is the width of the input feature map, and C is the number of channels of the input feature map; The fully connected layer 1 compresses the number of output channels to C / r, where r is the compression factor, and the fully connected layer 2 restores the compressed feature map.

8. A system based on the small sample load identification method based on SE attention mechanism according to claim 1, characterized in that: The acquisition module is used to obtain the voltage and current signals of the electrical appliance during steady-state operation, construct a color VI trajectory diagram containing timing information, and extract preprocessed visual features from it; Creating a module for building a basic load identification model based on a convolutional neural network, wherein the basic load identification model includes a feature extraction layer and a linear layer; An input module is used to apply the processed visual features as input to the constructed basic load recognition model to perform preliminary model training and learning; An improvement module is used to add an SE attention mechanism module between the feature extraction layer and the linear layer of the basic load recognition model based on the results of preliminary training to obtain an improved load recognition model; The training module is used to conduct further training and learning based on the improved load identification model to achieve load identification in a small sample environment.

9. An electronic device, characterized in that: include: Memory, used to store programs; A processor, used to load the program to execute the steps of the small sample load identification method based on the SE attention mechanism as described in any one of claims 1-7.

10. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the steps of the small sample load identification method based on the SE attention mechanism as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Non-intrusive non-stationary load identification method for statistically driving multi-scale fusion attention

    CN121659039A