Load identification training method, load identification method and related device
By constructing multidimensional image features and training in residual networks, the problem of overfitting in load recognition is solved, and the recognition accuracy and model performance are improved.
Patent Information
- Application Number
- CN202411474573.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is prone to overfitting problems in load recognition, resulting in degradation in model performance and poor identification accuracy, especially in scenarios where data volume is limited.
By obtaining the electrical parameters of multiple electrical appliances, building multi-dimensional image features and inputting them into the residual network for training, the sum of the residual mapping function and multi-dimensional image features is output to reduce the model overfitting.
This method reduces the risk of model overfitting through the combination of multidimensional image features and residual networks, and improves the accuracy of load recognition and model performance.
Smart Images

Figure CN119445281A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a load identification training method, a load identification method and related devices. Background Art
[0002] Load identification is a technology widely used in power systems. It is mainly used to identify and classify electric energy loads, for example, to identify and classify the electrical appliances used in each user's home. It is mainly based on the research and analysis of parameters such as current, voltage, power factor, etc. of various loads in the power system. Among them, load refers to the demand and use of electric energy by power users.
[0003] At present, related technologies usually use convolutional neural networks (CNN) or hybrid models based on CNN for load identification. Although they can effectively distinguish loads to a certain extent, for load identification scenarios with relatively limited data volume, the depth and complexity of the model will also increase accordingly.
[0004] However, when the above-mentioned neural network model with increased depth and complexity is used for load identification, fewer image features are used, and the neural network model is prone to overfitting problems, which affects the performance of the model and leads to poor accuracy of load identification. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a load identification training method, a load identification method and a device, aiming to improve the accuracy of load identification.
[0006] In a first aspect, an embodiment of the present application provides a load identification training method, the method comprising:
[0007] Obtain electrical parameters of power consumption of multiple electrical appliances;
[0008] Based on the electrical parameters of the plurality of electrical appliances, corresponding multi-dimensional image features are respectively constructed to obtain the multi-dimensional image features corresponding to the plurality of electrical appliances; the multi-dimensional image features are used to indicate the change of the electrical parameters from multiple different dimensions;
[0009] Inputting the multidimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and outputting the sum of a residual mapping function and the multidimensional image features; the residual mapping function is used to indicate the residual between the input and output of the learning residual block;
[0010] Calculate a loss value based on a difference between a sum of the residual mapping function and the multidimensional image feature and the category labels corresponding to the plurality of electrical appliances;
[0011] Based on the loss value, the residual network is trained to obtain an identification model for load identification.
[0012] In a second aspect, an embodiment of the present application provides a load identification method, the method comprising:
[0013] Obtain electrical parameters of the user's electricity consumption;
[0014] Constructing corresponding multi-dimensional image features based on the electrical parameters;
[0015] The multi-dimensional image features are input into a recognition model to perform load recognition to obtain a load recognition result. The recognition model is trained by the load recognition training method described in the first aspect.
[0016] In a third aspect, an embodiment of the present application provides a load identification training device, the device comprising:
[0017] A first acquisition module is used to acquire electrical parameters of electricity consumption of multiple electrical appliances;
[0018] A first construction module is used to construct corresponding multi-dimensional image features based on the electrical parameters of the plurality of electrical appliances, respectively, to obtain multi-dimensional image features corresponding to the plurality of electrical appliances; the multi-dimensional image features are used to indicate changes in the electrical parameters from a plurality of different dimensions;
[0019] An output module, used for inputting the multi-dimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and outputting a sum of a residual mapping function and the multi-dimensional image features; the residual mapping function is used for indicating the residual between the input and output of the learning residual block;
[0020] A calculation module, configured to calculate a loss value based on a difference between a sum of the residual mapping function and the multidimensional image feature and the category labels corresponding to the plurality of electrical appliances;
[0021] A training module is used to train the residual network based on the loss value to obtain an identification model for load identification.
[0022] In a third aspect, an embodiment of the present application provides a load identification device, the device comprising:
[0023] The second acquisition module is used to obtain the electrical parameters of the user's electricity consumption;
[0024] A second construction module, used to construct corresponding multi-dimensional image features based on the electrical parameters;
[0025] The recognition module is used to input the multi-dimensional image features into a recognition model to perform load recognition and obtain a load recognition result. The recognition model is trained by the load recognition training method described in the first aspect.
[0026] In a fifth aspect, an embodiment of the present application provides a computer device, the device comprising:
[0027] The memory is used to store computer programs;
[0028] The processor is used to execute the steps of the load identification training method described in the first aspect or the steps of the load identification method described in the second aspect according to the computer program.
[0029] In a sixth aspect, an embodiment of the present application provides a computer storage medium, on which a computer program is stored. When the computer program is executed, the device running the computer program implements the load identification training method described in the first aspect, or executes the load identification method described in the second aspect.
[0030] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0031] The embodiment of the present application provides a load identification training method, which includes: first obtaining electrical parameters of multiple electrical appliances, constructing corresponding multidimensional image features based on the electrical parameters of the multiple electrical appliances, and obtaining multidimensional image features corresponding to the multiple electrical appliances, wherein the multidimensional image features are used to indicate the changes in the electrical parameters from multiple different dimensions, that is, in the training process, not only the multidimensional image features of different dimensions are used to enrich the training data, but also the residual network can learn different features of the load data from different dimensions, which helps to reduce the overfitting of the model. Then, the multidimensional image features corresponding to the multiple electrical appliances are input into the residual network for training, and the sum of the residual mapping function and the multidimensional image features is output, wherein the residual mapping function is used to indicate the residual between the input and output of the learning residual block. The multidimensional image features corresponding to the multiple electrical appliances are input into the residual network for training, and the residual between the input and output of the residual block can be learned through the residual mapping function, that is, the residual network only needs to learn the difference between the input and output, which simplifies the learning objectives and learning difficulty. At the same time, the residual network includes shortcut connections, so the sum of the residual mapping function and the multi-dimensional image features can be output, so that the residual network can learn high-level features while learning low-level features, which can alleviate the gradient vanishing problem caused by increasing the depth in the deep neural network to improve the performance of the model. Therefore, based on the sum of the residual mapping function and the multi-dimensional image features, and the difference between the category labels corresponding to multiple electrical appliances, the loss value is calculated. Based on the loss value, the residual network is trained to obtain a recognition model for load identification. It can be seen that through the above training method, training the residual network based on multi-dimensional image features can reduce the overfitting of the model, improve the performance of the model, and thus improve the accuracy of load identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A schematic diagram of an application scenario of a load identification training method provided in an embodiment of the present application;
[0034] Figure 2 A flow chart of a load identification training method provided in an embodiment of the present application;
[0035] Figure 3 A schematic diagram of a multi-dimensional image feature provided in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of the structure of a residual network provided in an embodiment of the present application;
[0037] Figure 5 A schematic diagram of a confusion matrix provided in an embodiment of the present application;
[0038] Figure 6 A flow chart of a load identification method provided in an embodiment of the present application;
[0039] Figure 7 A structural schematic diagram of a load identification training device provided in an embodiment of the present application;
[0040] Figure 8 A schematic diagram of the structure of a load identification device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] At present, related technologies usually use convolutional neural networks (CNN) or hybrid models based on CNN for load identification. Although they can effectively distinguish loads to a certain extent, for load identification scenarios with relatively limited data volume, the depth and complexity of the model will also increase accordingly.
[0043] However, when the above-mentioned neural network model with increased depth and complexity is used for load identification, fewer image features are used, and the neural network model is prone to overfitting problems, which affects the performance of the model and leads to poor accuracy of load identification.
[0044] Based on this, in order to solve the above problems, in an embodiment of the present application, the electrical parameters of the electricity consumption of multiple electrical appliances are first obtained, and corresponding multidimensional image features are respectively constructed based on the electrical parameters of the multiple electrical appliances, and the multidimensional image features corresponding to the multiple electrical appliances are obtained, wherein the multidimensional image features are used to indicate the changes in the electrical parameters from multiple different dimensions, that is, in the training process, not only the multidimensional image features of different dimensions are used to enrich the training data, but also the residual network can learn different features of the load data from different dimensions, which helps to reduce the overfitting of the model. Then, the multidimensional image features corresponding to the multiple electrical appliances are respectively input into the residual network for training, and the sum of the residual mapping function and the multidimensional image features is output, wherein the residual mapping function is used to indicate the residual between the input and output of the learning residual block. The multidimensional image features corresponding to the multiple electrical appliances are respectively input into the residual network for training, and the residual between the input and output of the residual block can be learned through the residual mapping function, that is, the residual network only needs to learn the difference between the input and output, which simplifies the learning objectives and learning difficulty. At the same time, the residual network includes shortcut connections, so the sum of the residual mapping function and the multi-dimensional image features can be output, so that the residual network can learn high-level features while learning low-level features, which can alleviate the gradient vanishing problem caused by increasing the depth in the deep neural network to improve the performance of the model. Therefore, based on the sum of the residual mapping function and the multi-dimensional image features, and the difference between the category labels corresponding to multiple electrical appliances, the loss value is calculated. Based on the loss value, the residual network is trained to obtain a recognition model for load identification. It can be seen that through the above training method, training the residual network based on multi-dimensional image features can reduce the overfitting of the model, improve the performance of the model, and thus improve the accuracy of load identification.
[0045] For example, one of the scenarios of the embodiments of the present application may be applied to Figure 1 In the scenario shown. The scenario includes a database 101 and a server 102. The electrical parameters of multiple electrical appliances can be collected through an electric energy meter, and then the collected electrical parameters of multiple electrical appliances can be recorded through the database 101. The server 102 can obtain the electrical parameters of multiple electrical appliances from the database 101, and then the server 102 can use the load recognition training method provided in the embodiment of the present application to construct corresponding multi-dimensional image features based on the electrical parameters of multiple electrical appliances, and then train the residual network based on the multi-dimensional image features corresponding to the multiple electrical appliances, and obtain a recognition model for load recognition.
[0046] First, in the above application scenario, although the action description of the implementation method provided in the embodiment of the present application is executed by the server 102; however, the embodiment of the present application is not limited in terms of the execution subject, as long as the actions disclosed in the implementation method provided in the embodiment of the present application are executed.
[0047] Secondly, the above scenario is only an example scenario provided by the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
[0048] The specific implementation of the load identification training method, load identification method and related devices in the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0049] See also Figure 2 , which is a flow chart of a load identification training method provided in an embodiment of the present application, combined with Figure 2 As shown, it may specifically include:
[0050] S201: Acquire electrical parameters of power consumption of multiple electrical appliances.
[0051] The electrical parameters of electrical appliances refer to the electrical parameters generated by the appliances in working state, for example, the electrical parameters may include voltage, current, and power, etc. Among them, the voltage and current signals refer to the sine signals with a sampling frequency of 6400 and a frequency of 50 Hz as described in the technical specifications of the State Grid Intelligent IoT Energy Meter. In practical applications, the sampling data of one cycle (i.e. 128 points) is usually used for calculation.
[0052] As an example, electrical parameters of electricity consumption of multiple electrical appliances may be collected through an electric energy meter, and then the collected electrical parameters of the multiple electrical appliances may be stored in a database, so that a server may obtain the electrical parameters of electricity consumption of the multiple electrical appliances from the database.
[0053] S202: construct corresponding multi-dimensional image features based on the electrical parameters of the plurality of electrical appliances respectively, and obtain the multi-dimensional image features corresponding to the plurality of electrical appliances respectively; the multi-dimensional image features are used to indicate the change of the electrical parameters from a plurality of different dimensions.
[0054] The multidimensional image features are used to indicate the changes of electrical parameters from multiple different dimensions. For example, the multidimensional image features may include voltage and current trajectory image features, Gram angle and field image features, Gram angle difference field image features, Markov transition field image features, recursive graph image features, and relative position matrix image features.
[0055] As an example, in the present application, corresponding multi-dimensional image features can be constructed based on the electrical parameters of multiple electrical appliances through the calculation method of voltage and current trajectory VI trajectory, the calculation method of Gramian Angular Summation Field (GASF), the calculation method of Gramian Angular Difference Field (GADF), the calculation method of Markov Transition Field (MTF), the calculation method of Recurrence Plot (RP) and the calculation method of relative position matrix (RPM).
[0056] Among them, the VI trajectory compresses the voltage and current sampling data to a fixed length, with voltage as the x-axis and current as the y-axis, to show the synchronous changes of voltage and current; the remaining image features are changes to the current sampling signal, such as spatial rotation, transition probability, phase space norm, and probability distribution. For example, the Gram angle sum field and Gram angle difference field convert the current signal in the Cartesian coordinate system into the current signal in the polar coordinate system (angle and radius), and calculate the corresponding image features through the sum angle relationship and the difference angle relationship; the Markov transition field corresponds to each current signal in a fixed quantile box, calculates its transfer probability, and obtains the Markov transition field image feature, where the quantile box refers to a range or state of the data; the recursion graph maps the current signal into the phase space, calculates the vector norm between each two states, and obtains the recursion graph image feature, where the phase space is a mathematical space that describes the state of the system, and each point represents the state of the system at a certain moment; the basic principle of the relative position matrix is to effectively capture the similarity information between and within classes in the converted image, convert the current signal into a standard normal distribution by z-score normalization, and then use the piecewise aggregation approximation method to generate lower-dimensional signals and relative positions corresponding to different dimensions.
[0057] As an example, before constructing a multidimensional image feature based on the electrical parameters of multiple electrical appliances, the electrical parameters of the multiple electrical appliances can be preprocessed to obtain the electrical parameters of the multiple electrical appliances after preprocessing. Taking the electrical parameters as voltage and current signals as an example, the voltage and current signals are waveform signals. For example, two methods, namely, outlier screening and DC removal, can be used for data preprocessing. Outlier screening is used to identify and process data points in the voltage and current signal data set that do not conform to the normal pattern or distribution law. For example, by using the logical relationship between the power average value of 5 adjacent whole cycles and the threshold, the whole cycle data that exceeds the threshold is considered to be an abnormal waveform, and the abnormal waveform is deleted from the voltage and current signal. DC removal refers to eliminating the DC component of the whole cycle signal by subtracting the average value of the whole cycle signal. By performing data preprocessing on the electrical parameters by the above two methods, the electrical parameters of multiple electrical appliances after preprocessing can be obtained, which provides convenience for the subsequent training process and reduces the amount of calculation in the subsequent training process. Among them, the whole cycle refers to a complete change cycle of a voltage signal or a current signal.
[0058] Then, corresponding multi-dimensional image features can be constructed respectively through the pre-processed electrical parameters of the plurality of electrical appliances, and the multi-dimensional image features corresponding to the plurality of electrical appliances can be obtained.
[0059] For example, corresponding multi-dimensional image features can be constructed based on the pre-processed waveform data of voltage v(t), t∈[1, L] and current i(t), t∈[1, L], where L is the number of sampling points of the whole cycle.
[0060] In a possible implementation, multi-dimensional image features corresponding to the plurality of electrical appliances can be constructed based on the electrical parameters of the plurality of electrical appliances according to calculation methods of different dimensions. Accordingly, after data preprocessing of the electrical parameters, multi-dimensional image features corresponding to the plurality of electrical appliances can be constructed based on the preprocessed electrical parameters of the plurality of electrical appliances.
[0061] Since the dimension of the multidimensional image feature is scaled to N*N, the voltage and current sequence length L can be interpolated to N by nearest neighbor linear interpolation, where N=24. Then, the corresponding multidimensional image feature can be constructed by the electrical parameters with a sequence length of N.
[0062] As an example, the VI trajectory is a matrix with the overlapping points formed by voltage as the x-axis and current as the y-axis set as constants. Therefore, the corresponding VI trajectory image features can be constructed based on the voltages and currents of multiple electrical appliances. For example, the matrix of the VI trajectory determined by the voltages and currents of multiple electrical appliances can be mapped to the pixel positions of the image, thereby determining the corresponding VI trajectory image features.
[0063] The calculation method of Gram angle sum field and Gram angle difference field can refer to the following formula, as shown in the following formula:
[0064] As shown in formula 1-4.
[0065]
[0066] θ t = acos(x t ),t∈[1,N] Formula 2
[0067] GADF(t,n)= sin(θ t -θ n ),t,n∈[1,N] Formula 3
[0068] GASF(t,n)= cos(θ t +θ n ),t,n∈[1,N] Formula 4
[0069] Among them, x t is the time series after the normalization of the current series, θ n To convert the current data into an angle between two polar coordinates, θ t To convert to another angle between every two current data in the polar coordinate system, GADF (t, n) is the Gram angle difference field feature matrix, and GASF (t, n) is the Gram angle sum field feature matrix. Therefore, the Gram angle sum field feature matrix can be mapped to the pixel position of the image to obtain the corresponding Gram angle sum field image features; the Gram angle difference field feature matrix can also be mapped to the pixel position of the image to obtain the corresponding Gram angle difference field image features.
[0070] Convert each data in the current sequence i(t) into the serial number q of its corresponding bin, and the bin threshold is k q , q∈[1,Q], quantile box Q=12, if k q-1 <i(t)<k q , I_Q(q)=q, thus the transfer matrix W1 and the Markov transfer field characteristic matrix in the Markov transfer field can be constructed based on the sequence I_Q(q) corresponding to each current data converted into a bin. The calculation method of the Markov transfer field can refer to the formula below, as shown in Formula 5-8.
[0071] Diff_I_Q(t)= I_Q(t) - I_Q(t+1),t∈[1,N-1] Formula 5
[0072] W(q,p)=W(q,p)+1,if Diff_I_Q(t)==(qp)&&I_Q(t)==q Formula 6
[0073] W1(:,p)=W(:,p) / sum(W(:,p)) Formula 7
[0074] MTF(t,n)=W1(I_Q(t),I_Q(n)) Formula 8
[0075] Among them, Diff_I_Q(t) represents the difference between two adjacent data, I_Q(t) represents the sequence corresponding to each current data converted into a bin, W represents the number of data in the corresponding bin, W(q,p) represents the transfer matrix, and W1 represents the transfer matrix with a row sum of 1, that is, satisfying ∑ p W1(p,q)=1, MTF represents the Markov transfer field feature matrix, I_Q(t) and I_Q(n) have the same physical meaning and are only used to distinguish values at different positions. Therefore, the Markov transfer field feature matrix can be mapped to the pixel position of the image to obtain the corresponding Markov transfer field image features.
[0076] The time domain space of the current sequence i(t) is transformed into the phase space, that is, each point of i(t) in the time domain space is transformed into the corresponding state s(n) in the phase space. The recursive graph can be obtained by calculating the distance (vector norm) between each two states and performing threshold binarization on the calculated vector norm.
[0077] Specifically,
[0078]
[0079] s=[I(1:end-1)′,I(2:end)] Formula 10
[0080] RP0=‖s‖ 2 Formula 11
[0081]
[0082] Among them, I is the time series after the normalization of the current series, I is a one-dimensional array, s is the reconstructed phase space state, RPO is the distance between every two states (vector norm), and RP is the recursive graph image feature.
[0083] The current sequence i(t) is converted into a time series z(t) that obeys a standard normal distribution by using the z-score standardization method. A new smoothed time series X(t) can be generated by using the segmented aggregation approximation method and selecting a suitable reduction factor c. Then, the relative position between two timestamps (two data in the time series) can be calculated to determine the relative position matrix image feature, where c = 4. Specifically, the calculation formula below can be referred to, as shown in Formulas 13-16.
[0084]
[0085] M(i,j)=X(i,:)-X(:,j),ij∈[1,N] Formula 15
[0086]
[0087] Where z(t) is the time series after the current series is standardized, std(i(t)) represents the standard deviation, mean(i(t)) represents the mean, and X(t) represents the new time series constructed by z(t) under different constraints. Respectively represent upper and lower rounding, M represents the two-dimensional matrix of the relative position relationship between every two timestamps in the time series, i, j represent the row and column subscripts specified by X(t), and RPM is the relative position matrix feature after minimum-maximum normalization. Therefore, the relative position matrix feature can be mapped to the pixel position of the image to obtain the corresponding relative position matrix image feature.
[0088] Please refer to Figure 3 , Figure 3 A schematic diagram of a multi-dimensional image feature provided in an embodiment of the present application, taking an electric heater as an example, with the voltage and current of a whole cycle as sampling data (electrical parameters), the multi-dimensional image features corresponding to the electric heater can be constructed respectively according to the calculation methods of different dimensions.
[0089] As an example, the multiple electrical appliances used as training data may include fixed-frequency air conditioners, variable-frequency air conditioners, electric kettles and other major electric heating categories, vacuum cleaners, microwave ovens, induction cookers, refrigerators, washing machines and other typical electrical appliances. In this regard, the present application does not specifically limit the types and quantities of electrical appliances. Then, the single-class waveform data and multi-class waveform data of the above-mentioned electrical appliances can be batch-processed to construct corresponding multidimensional image features based on the waveform data after data preprocessing, so that the input data set for training can be constructed based on the multidimensional image features corresponding to multiple electrical appliances. For example, the feature dimension of the input multidimensional image feature can be M*24*24*6. During training, the label of the multidimensional image feature corresponding to each electrical appliance can be the specific category of the electrical appliance, with a dimension of M*1, M=16100, and M represents the total number of electrical appliances. For example, during the training process, each electrical appliance can construct a corresponding multidimensional image feature based on 1500 whole cycles.
[0090] After determining the multidimensional image features corresponding to multiple electrical appliances, training can be performed based on the multidimensional image features, so that the recognition model can extract load recognition features from multiple angles or dimensions, such as voltage and current change trends, periodic changes, and mutation points, etc. This not only enriches the training data, but also enhances the robustness of the recognition model.
[0091] S203: inputting the multidimensional image features corresponding to the plurality of electrical appliances into the residual network for training, and outputting the sum of the residual mapping function and the multidimensional image features; the residual mapping function is used to indicate the residual between the input and output of the learning residual block.
[0092] As an example, the input data set determined above can be shuffled, and then the first 80% of the shuffled input data set can be used as a training set to input into the residual network for training, the middle 10% can be used as a verification test set to adjust the optimal parameters of the model, and the last 10% can be used as a test set to evaluate the performance of the recognition model.
[0093] For example, the parameter values of the input multi-dimensional image features can refer to Table 1, that is, Table 1 is the training parameters in the training process.
[0094] Table 1
[0095]
[0096] Residual Network ResNet is a deep learning architecture consisting of a series of convolutional layers for further extracting features from the input multi-dimensional image features. The convolutional layer includes convolution kernels to identify specific features in the multi-dimensional image features. In the residual network, the convolutional layer is often used with batch normalization and activation functions such as ReLU to accelerate training and improve model performance. The residual network includes residual blocks, which are modules consisting of two or three convolutional layers.
[0097] For example, see Figure 4 , Figure 4 A schematic diagram of the structure of a residual network provided in an embodiment of the present application. The input channel In_channel represents the number of multidimensional image features input to the convolutional layer. The number of features of different dimensions used above is 6, that is, the number of multidimensional image features of each appliance is 6, and the dimension of each feature is 24*24. The output channel Out_channel represents the number of multidimensional image features output by the convolutional layer. For subsequent convolutional layers, In_channel is the Out_channel of the previous layer. The residual block (i.e. Figure 4The first layer in the CNN includes two 3*3 convolutional layers, the first one is used for feature mapping, and the second one is used to generate residual mapping. Conv represents the convolution operation, which is the core building block in CNN and is used to detect local features in the input data. 3*3 represents the convolution kernel size, which means that each convolution operation will slide a 3*3 window on the input image features to extract local features from the window. 1 and 1 represent the stride and padding respectively. The stride refers to the number of pixels that the convolution kernel crosses each time it moves, and padding refers to a circle of pixels (usually 0 values) added to the edge of the input image features so that the size of the output image features after the convolution operation can be consistent with the size of the input image features. 10 represents the number of convolutional layers, that is, 10 such convolution kernels (3x3, stride 1, padding 1) are included in the first convolutional layer to extract features from the input multi-dimensional image features. Each convolution kernel learns different features of the input data, so 10 convolution kernels can extract 10 different features. The meanings in subsequent convolutional layers are the same, but the dimensions are different, so I will not go into details here.
[0098] The batch normalization layer (BatchNorm2d) is located after each convolutional layer to standardize the input data, accelerate convergence and improve the stability of the model. 2d represents 2-dimensional calculation. The activation function ReLU is located after each batch normalization layer to introduce nonlinearity to the residual network.
[0099] At the same time, in traditional neural networks, each layer attempts to learn an ideal mapping relationship and pass it to the next layer, but as the parameters increase, information may be lost between layers. In the residual network cabinet, the network layer is designed to learn the residual mapping (that is, the gap between the input x and the expected output), and the residual mapping is used to indicate the residual between the input and output of the learning residual block. If the ideal mapping is the hidden layer output h(x), the residual network directly learns not h(x), but the residual mapping function F(x) = h(x)-x, that is, the gap between the input and output, where h(.) represents the output of the hidden layer activation function, that is, the input of the residual block.
[0100] Since the residual network includes a shortcut connection (Skip Connection), that is, Figure 4 The lines connecting the residual blocks in the network allow the input to directly skip one or more layers and be added to the outputs of these layers. The multi-dimensional image features corresponding to multiple appliances are input into the residual network for training. When the input dimension and output dimension of the shortcut-connected residual blocks in the residual network are the same, the sum of the residual mapping function and the multi-dimensional image features can be output. That is, if the input dimension and output dimension of the residual block are the same, the input can be directly added to the output processed by the convolution layer through the shortcut connection.
[0101] Alternatively, the multi-dimensional image features corresponding to the multiple appliances are respectively input into the residual network for training. When the input dimension and output dimension of the residual block connected by shortcut in the residual network are different, the input dimension and output dimension of the residual block can be adjusted by stacking convolution layers until the input dimension and output dimension of the residual block are the same, and the sum of the residual mapping function and the multi-dimensional image feature is output. That is, if the input dimension and output dimension of the residual block are different, the dimension is adjusted by stacking 1*1 convolution layers until the input dimension and output dimension of the residual block are the same, and the sum of the residual mapping function and the multi-dimensional image feature is output. At this time, the output of the residual network is F(x)+x, that is, the output of the residual network is the sum of the residual mapping function and the multi-dimensional image feature as input.
[0102] Therefore, shortcut connections ensure that even if the learning improvement in the deep network is small (close to 0), the gradient can be more effectively transferred during the back-propagation process, avoiding the problem of gradient vanishing and gradient explosion, thereby improving the performance of the deep neural network. Through residual mapping learning and shortcut connections, the residual network can build a deeper network while maintaining high accuracy, effectively integrating diverse and multi-level feature information (that is, more levels of feature information can be extracted from multi-dimensional image features), thereby improving the model's representation ability and generalization performance.
[0103] S204: Calculate a loss value based on the difference between the sum of the residual mapping function and the multi-dimensional image feature and the category labels corresponding to the plurality of electrical appliances.
[0104] The category labels corresponding to the multiple electrical appliances refer to the labels corresponding to the multi-dimensional image features of each electrical appliance in the training set, that is, the real categories corresponding to the multiple electrical appliances.
[0105] After determining the output of the residual network, that is, the sum of the residual mapping function and the multi-dimensional image features, the loss value in the training process can be calculated through the loss function based on the output of the residual network and the real category labels corresponding to the multiple electrical appliances. The loss value can reflect the performance of the recognition model in the load recognition task based on the current residual mapping function. It should be understood that the larger the loss value, the worse the performance of the recognition model in the load recognition task, that is, the quality of the current residual mapping function is poor; conversely, the smaller the loss value, the better the performance of the recognition model in the load recognition task, that is, the quality of the current residual mapping function is better. Among them, the loss function can be a cross entropy loss function or a contrastive learning loss function. In this regard, the present application does not specifically limit the loss function in the training process.
[0106] S205: Based on the loss value, the residual network is trained to obtain an identification model for load identification.
[0107] Finally, the residual network can be trained based on the loss value, that is, the residual mapping function can be trained based on the loss value, that is, with the goal of reducing the loss value, by continuously adjusting the parameters in the residual network (including the parameters in the residual mapping function) to optimize the performance of the recognition model based on multi-dimensional image features in load recognition, improve the recognition accuracy of the recognition model, and finally obtain a recognition model for load recognition.
[0108] In addition, after the training is completed, the performance of the recognition model can be evaluated by accuracy. The accuracy result is used to indicate the proportion of correctly classified samples to the total number of samples. The higher the accuracy, the better the performance of the recognition model. For details, please refer to formulas 17-18.
[0109]
[0110] misclass = 1- accuracy Formula 18
[0111] Among them, accuracy represents the accuracy result, TP represents true positive, that is, the number of samples correctly predicted as positive by the model, TN represents true negative, that is, the number of samples correctly predicted as negative by the model; FP represents false positive, that is, the number of samples where the model incorrectly predicts negative as positive; FN represents false negative, that is, the number of samples where the model incorrectly predicts positive as negative. Misclass represents the error rate, that is, the proportion of misclassified samples to the total number of samples. Among them, positive examples and negative examples represent the load recognition results output by the recognition model, that is, the electrical appliance classification results output by the recognition model. Positive examples and negative examples can be set by the training parameter configuration personnel. For example Figure 5 As shown, Figure 5 A schematic diagram of a confusion matrix provided in an embodiment of the present application, Figure 5 The numbers in represent the number of electrical appliance tests, the vertical axis represents the results of residual network classification (i.e., the load identification results output by the identification model), and the horizontal axis represents the true category.
[0112] In the load identification training method provided in the embodiment of the present application, the method includes: firstly obtaining the electrical parameters of the electricity consumption of multiple electrical appliances, constructing corresponding multidimensional image features based on the electrical parameters of the multiple electrical appliances, and obtaining the multidimensional image features corresponding to the multiple electrical appliances, wherein the multidimensional image features are used to indicate the changes of the electrical parameters from multiple different dimensions, that is, in the training process, not only the multidimensional image features of different dimensions are used to enrich the training data, but also the residual network can learn different features of the load data from different dimensions, which helps to reduce the overfitting of the model. Then, the multidimensional image features corresponding to the multiple electrical appliances are input into the residual network for training, and the sum of the residual mapping function and the multidimensional image features is output, wherein the residual mapping function is used to indicate the residual between the input and output of the learning residual block. The multidimensional image features corresponding to the multiple electrical appliances are input into the residual network for training, and the residual between the input and output of the residual block can be learned through the residual mapping function, that is, the residual network only needs to learn the difference between the input and output, which simplifies the learning objectives and learning difficulty. At the same time, the residual network includes shortcut connections, so the sum of the residual mapping function and the multi-dimensional image features can be output, so that the residual network can learn high-level features while learning low-level features, which can alleviate the gradient vanishing problem caused by increasing the depth in the deep neural network to improve the performance of the model. Therefore, based on the sum of the residual mapping function and the multi-dimensional image features, and the difference between the category labels corresponding to multiple electrical appliances, the loss value is calculated. Based on the loss value, the residual network is trained to obtain a recognition model for load identification. It can be seen that through the above training method, training the residual network based on multi-dimensional image features can reduce the overfitting of the model, improve the performance of the model, and thus improve the accuracy of load identification.
[0113] Based on the above load identification training method, the present application embodiment also provides a method for load identification based on the identification model obtained by the above load identification training method. Figure 6 , Figure 6 A flow chart of a load identification method provided in an embodiment of the present application. Figure 6 As shown, the load identification method includes the following steps:
[0114] S601: Obtain electrical parameters of the user's electricity consumption.
[0115] As an example, a non-intrusive load identification module can be used to detect electrical parameters such as voltage and current at the user's electrical entrance to obtain the electrical parameters of the user's electricity usage. The electrical parameters can then be transmitted to the server, so that the server can perform load identification based on the user's electrical parameters to identify the types of major electrical appliances inside the user and their operating modes, without directly intervening in the user's home or electrical equipment.
[0116] S602: Construct corresponding multi-dimensional image features based on electrical parameters.
[0117] After the electrical parameters of the user's electricity consumption are determined, the corresponding multi-dimensional image features can be constructed based on the acquired electrical parameters according to the calculation formulas of different dimensions in the above load identification training method.
[0118] S603: Input the multi-dimensional image features into a recognition model to perform load recognition and obtain a load recognition result. The recognition model is trained by a load recognition training method.
[0119] By inputting the multi-dimensional image features into the recognition model for load recognition, the load recognition result can be obtained. The load recognition result is used to indicate what kind of electrical appliance the user has used, that is, the classification result of the electrical appliance. Among them, the recognition model is trained by the above-mentioned load recognition training method.
[0120] Therefore, the above method can identify the type of electrical appliances in a working state inside the user based on a load identification model with high identification accuracy, without accessing the inside of the user's home or electrical equipment, which helps to quickly obtain accurate load identification results.
[0121] The above are some specific implementations of the load identification training method provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The device provided in the embodiment of the present application will be introduced from the perspective of functional modularization.
[0122] See also Figure 7 , which is a schematic diagram of the structure of a load identification training device 700 provided in an embodiment of the present application, and the device 700 may include:
[0123] The first acquisition module 701 is used to acquire electrical parameters of multiple electrical appliances;
[0124] A first construction module 702 is used to construct corresponding multi-dimensional image features based on the electrical parameters of the plurality of electrical appliances, respectively, to obtain multi-dimensional image features corresponding to the plurality of electrical appliances; the multi-dimensional image features are used to indicate changes in the electrical parameters from a plurality of different dimensions;
[0125] An output module 703 is used to input the multi-dimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and output a sum of a residual mapping function and the multi-dimensional image features; the residual mapping function is used to indicate the residual between the input and output of the learning residual block;
[0126] A calculation module 704, configured to calculate a loss value based on a difference between a sum of the residual mapping function and the multidimensional image feature and the category labels corresponding to the plurality of electrical appliances;
[0127] The training module 705 is used to train the residual network based on the loss value to obtain an identification model for load identification.
[0128] Optionally, the first building module 702 includes:
[0129] The first construction unit is used to construct multi-dimensional image features corresponding to the plurality of electrical appliances respectively based on the electrical parameters of the plurality of electrical appliances according to calculation methods of different dimensions.
[0130] Optionally, the multidimensional image features include voltage and current trajectory image features, Gram angle sum field image features, Gram angle difference field image features, Markov transition field image features, recursive graph image features, and relative position matrix image features.
[0131] Optionally, the output module 703 includes:
[0132] A first output unit, configured to input the multidimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and output a sum of a residual mapping function and the multidimensional image features when the input dimension and output dimension of the residual block connected by shortcut in the residual network are the same;
[0133] The second output unit is used to input the multidimensional image features corresponding to the multiple electrical appliances into the residual network for training. When the input dimension and output dimension of the residual block connected by shortcut in the residual network are different, the input dimension and output dimension of the residual block are adjusted by stacking convolution layers until the input dimension and output dimension of the residual block are the same, and the sum of the residual mapping function and the multidimensional image feature is output.
[0134] Optionally, the device further comprises:
[0135] A preprocessing unit, used for performing data preprocessing on the electrical parameters of the plurality of electrical appliances to obtain preprocessed electrical parameters of the plurality of electrical appliances;
[0136] Correspondingly, the first building module 702 includes:
[0137] The first construction unit is used to respectively construct corresponding multi-dimensional image features based on the preprocessed electrical parameters of the plurality of electrical appliances, so as to obtain the multi-dimensional image features corresponding to the plurality of electrical appliances.
[0138] Based on the load identification method provided in the above embodiments, the present application also provides a load identification device. Figure 8 To explain, Figure 8 A schematic diagram of the structure of a load identification device 800 provided in an embodiment of the present application, the device comprising:
[0139] The second acquisition module 801 is used to acquire the electrical parameters of the user's electricity consumption;
[0140] A second construction module 802, configured to construct corresponding multi-dimensional image features based on the electrical parameters;
[0141] The recognition module 803 is used to input the multi-dimensional image features into a recognition model to perform load recognition and obtain a load recognition result. The recognition model is trained by the load recognition training method described above.
[0142] The embodiments of the present application also provide corresponding computer devices and computer storage media for implementing the solutions provided by the embodiments of the present application.
[0143] Among them, the computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program, so that the device executes the load identification training method described in the aforementioned embodiment of the present application, or executes the load identification method described in the aforementioned embodiment of the present application.
[0144] The computer storage medium stores a computer program. When the code is executed, the device running the computer program implements the load identification training method described in the aforementioned embodiment of the present application, or executes the load identification method described in the aforementioned embodiment of the present application.
[0145] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0146] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0147] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A load identification training method, characterized in that: The method comprises: Obtain electrical parameters of power consumption of multiple electrical appliances; Based on the electrical parameters of the plurality of electrical appliances, corresponding multi-dimensional image features are respectively constructed to obtain the multi-dimensional image features corresponding to the plurality of electrical appliances; the multi-dimensional image features are used to indicate the change of the electrical parameters from multiple different dimensions; Inputting the multidimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and outputting the sum of a residual mapping function and the multidimensional image features; the residual mapping function is used to indicate the residual between the input and output of the learning residual block; Calculate a loss value based on a difference between a sum of the residual mapping function and the multidimensional image feature and the category labels corresponding to the plurality of electrical appliances; Based on the loss value, the residual network is trained to obtain an identification model for load identification.
2. The method according to claim 1, characterized in that The step of constructing corresponding multi-dimensional image features based on the electrical parameters of the plurality of electrical appliances to obtain the multi-dimensional image features corresponding to the plurality of electrical appliances comprises: According to calculation methods of different dimensions, multi-dimensional image features corresponding to the multiple electrical appliances are respectively constructed based on the electrical parameters of the multiple electrical appliances.
3. The method according to claim 1 or 2, characterized in that: The multi-dimensional image features include voltage and current trajectory image features, Gram angle sum field image features, Gram angle difference field image features, Markov transition field image features, recursive graph image features, and relative position matrix image features.
4. The method according to claim 1, characterized in that: The step of inputting the multidimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and outputting the sum of the residual mapping function and the multidimensional image features comprises: Inputting the multidimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and when the input dimension and output dimension of the residual block connected by shortcut in the residual network are the same, outputting the sum of the residual mapping function and the multidimensional image features; The multidimensional image features corresponding to the multiple electrical appliances are respectively input into the residual network for training. When the input dimension and output dimension of the residual block connected by shortcut in the residual network are different, the input dimension and output dimension of the residual block are adjusted by stacking convolution layers until the input dimension and output dimension of the residual block are the same, and the sum of the residual mapping function and the multidimensional image feature is output.
5. The method according to claim 1, characterized in that After obtaining the electrical parameters of the power consumption of the multiple electrical appliances, the method further includes: Performing data preprocessing on the electrical parameters of the plurality of electrical appliances to obtain preprocessed electrical parameters of the plurality of electrical appliances; The step of constructing corresponding multi-dimensional image features based on the electrical parameters of the plurality of electrical appliances to obtain the multi-dimensional image features corresponding to the plurality of electrical appliances includes: Based on the preprocessed electrical parameters of the plurality of electrical appliances, corresponding multi-dimensional image features are respectively constructed to obtain the multi-dimensional image features corresponding to the plurality of electrical appliances.
6. A load identification method, characterized in that: The method comprises: Obtain electrical parameters of the user's electricity consumption; Constructing corresponding multi-dimensional image features based on the electrical parameters; The multi-dimensional image features are input into a recognition model for load recognition to obtain a load recognition result, wherein the recognition model is trained by the load recognition training method according to any one of claims 1 to 5.
7. A load identification training device, characterized in that: The device comprises: A first acquisition module is used to acquire electrical parameters of electricity consumption of multiple electrical appliances; A first construction module is used to construct corresponding multi-dimensional image features based on the electrical parameters of the plurality of electrical appliances, respectively, to obtain multi-dimensional image features corresponding to the plurality of electrical appliances; the multi-dimensional image features are used to indicate changes in the electrical parameters from a plurality of different dimensions; An output module, used for inputting the multi-dimensional image features corresponding to the plurality of electrical appliances into a residual network for training, and outputting a sum of a residual mapping function and the multi-dimensional image features; the residual mapping function is used for indicating the residual between the input and output of the learning residual block; A calculation module, configured to calculate a loss value based on a difference between a sum of the residual mapping function and the multidimensional image feature and the category labels corresponding to the plurality of electrical appliances; A training module is used to train the residual network based on the loss value to obtain an identification model for load identification.
8. A load identification device, characterized in that: The device comprises: The second acquisition module is used to obtain the electrical parameters of the user's electricity consumption; A second construction module, used to construct corresponding multi-dimensional image features based on the electrical parameters; The recognition module is used to input the multidimensional image features into a recognition model to perform load recognition and obtain a load recognition result. The recognition model is trained by the load recognition training method according to any one of claims 1 to 5.
9. A computer device, characterized in that: The device includes a processor and a memory; The memory is used to store computer programs; The processor is used to execute the load identification training method described in any one of claims 1 to 5 or the load identification method described in claim 6 according to the computer program.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by a processor, the load identification training method according to any one of claims 1 to 5 or the load identification method according to claim 6 is implemented.