Electrical appliance identification method based on electrical parameter characteristic diagram
Through the electrical appliance identification method based on the electrical parameter feature map, the problems of slow identification speed, low accuracy and limited types of electrical appliances in the prior art are solved, and efficient and accurate electrical appliance identification is achieved, including the identification of similar current characteristics and mixed electricity consumption.
Patent Information
- Application Number
- CN202411687974.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The prior art has problems in the identification of electrical appliances, low recognition accuracy, limited types of electrical appliances, poor resolution effects for electrical appliances with similar current characteristics, and difficult to identify mixed electricity usage.
The electrical appliance identification method based on the electrical parameter feature map is adopted to collect and process current and voltage data, and the electrical parameter feature map is generated, and the pre-trained electrical appliance identification model is used for identification. The method includes data acquisition, denoising processing, data slicing, normalization processing, generation of electrical parameter feature maps, and finally identification through convolutional neural network.
It significantly improves the response speed and recognition accuracy of electrical appliance identification, supports identification of more types of electrical appliances, improves the resolution of electrical appliances with similar current characteristics, and can effectively identify mixed electricity consumption.
Smart Images

Figure CN119179953B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electrical appliance identification, and in particular is an electrical appliance identification method based on an electrical parameter characteristic diagram. Background Art
[0002] As the requirements for electricity safety and refined management of electric energy continue to increase, accurate identification of electrical appliances is becoming increasingly important. The electrical appliance identification method based on deep learning has a certain degree of recognition accuracy, but the existing technology still has the following problems: 1. The recognition speed is slow and it is difficult to adapt to scenarios with high requirements for real-time response; 2. There is still a lot of room for improvement in recognition accuracy; 3. The types of electrical appliances that can be identified are limited; 4. The effect of distinguishing and identifying electrical appliances with similar current characteristics is poor; 5. It is difficult to identify mixed power consumption.
[0003] Traditional electrical appliance identification technology has a low recognition rate in the face of increasingly diverse types of electrical appliances and complex electricity usage scenarios, and cannot fully utilize the features in current and voltage signals. Therefore, generating accurate electrical feature values is crucial and is also a difficult problem in this field. Summary of the invention
[0004] The present invention aims to address the technical defects of the prior art and provide a method for identifying electrical appliances based on electrical parameter characteristic diagrams, so as to solve the technical problems that conventional methods have slow recognition speed, low recognition accuracy, limited types of electrical appliances that can be identified, poor recognition effect for appliances with similar current characteristics, and difficulty in identifying mixed power consumption.
[0005] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0006] The electrical appliance identification method based on the electrical parameter characteristic diagram includes:
[0007] 1) Collect electrical appliance data, cut the collected data into current sequence data with a length of 5 current cycles, and simultaneously intercept the corresponding voltage sequence data;
[0008] 2) The current characteristic graph is used to generate a model, construct time and voltage two-dimensional data, and perform fast Fourier transform to obtain the current characteristic graph, current line graph, and current frequency domain characteristic graph respectively;
[0009] 3) The current characteristic graph and the voltage line graph are combined into an electrical parameter thermal graph, which is then combined with the current frequency domain characteristic graph into a three-channel electrical parameter characteristic graph;
[0010] 4) Input the electrical parameter characteristic diagram into the pre-trained electrical appliance recognition model;
[0011] 5) The electrical appliance identification model outputs the type of electrical appliance, switch status, and switch occurrence time.
[0012] Preferably, the training step of the current characteristic diagram generation model in step 2) includes:
[0013] 2.1) Collecting current sequences containing switching events of a single electrical appliance;
[0014] 2.2) Add other electrical appliances to the circuit and collect current sequences containing switching events of multiple electrical appliances;
[0015] 2.3) The two sets of sequences are truncated into subsequences with a length of 5 current cycles, which contain switching events;
[0016] 2.4) Plot these two sets of sequences into a single-appliance current line graph and a multi-appliance current line graph according to the time-current relationship; input them together into the adversarial neural network for training to obtain a current feature map generation model.
[0017] Preferably, the process of generating the electrical parameter characteristic diagram in step 3) includes:
[0018] 3.1) The current data is pre-processed and intercepted into 5 current cycles to form current sequence data, and the voltage data at the corresponding time is intercepted;
[0019] 3.2) Plot the current series data into a current line graph according to time-current, which is used as the input of the current characteristic graph generation model, and the current characteristic graph is obtained after calculation;
[0020] 3.3) The voltage series is plotted as a line graph according to time-voltage;
[0021] 3.4) The current sequence data is subjected to fast Fourier transform to obtain the current frequency domain characteristic diagram;
[0022] 3.5) Generate a two-dimensional thermal map using the current characteristic graph and the voltage line graph with time as the horizontal axis;
[0023] 3.6) The R, G, and B of the electrical parameter heat map are used as the 1st, 2nd, and 3rd channels of the electrical parameter characteristic map, and the current frequency domain characteristic map is used as the 4th channel, and they are fused into a 4-channel electrical parameter characteristic map.
[0024] Preferably, the training step of the electrical appliance recognition model in step 4) includes:
[0025] 4.1) Constructing electrical parameter feature atlas for training;
[0026] 4.2) Carry out the labeling of electrical appliance type switching, on / off status, and occurrence time to form an electrical appliance recognition model training set;
[0027] 4.3) Input to the residual network for training;
[0028] 4.4) Obtain the electrical appliance identification model.
[0029] Preferably, the method of the present invention comprises the following process:
[0030] aData collection;
[0031] Collect real-time current and voltage data; the data sampling rate is expressed as , the data is a series of current and voltage data, based on time; the data contains sampling points, the original current data is expressed as:
[0032]
[0033] The corresponding voltage data sequence is expressed as:
[0034]
[0035] b denoising processing;
[0036] For the original signal Use the continuous wavelet transform algorithm to filter out noise points and obtain denoised data , this process is expressed as:
[0037]
[0038] in is the scale parameter, is the translation parameter;
[0039] c data slice;
[0040] In sequence The time window is divided into 5 current cycles and the interception time window is arrive Current fragment (5 current cycles) And the corresponding voltage segment ,in is the number of points contained in each data after slicing, expressed as:
[0041]
[0042] d Normalization processing;
[0043] Using the minimum-maximum normalization method, and Each sample value in is mapped to the range of [0, 1] to obtain the normalized data and , the process is expressed as:
[0044]
[0045] in is the original data, is the output data, For sequence data The maximum value of For sequence data The minimum value of
[0046] e. Generate electrical parameter characteristic diagram;
[0047] 1. Data fragments Apply fast Fourier transform to obtain frequency domain feature data , the process is expressed as:
[0048]
[0049] 2. Use time-current to draw a line graph ,in:
[0050] , ,
[0051] 3. Use time-voltage as a line graph ,in:
[0052] ,
[0053] 4. Generate a model through the trained current characteristic graph. Apply current feature image generation to generate a current feature map of electrical appliances that only contain switching events ,in:
[0054] ,
[0055] 5. Mapping processing;
[0056] Will The value of is mapped to the range of 0-255. Cut to length of Sequence data , and stack them row by row to get the frequency domain feature matrix ,in It is expressed as:
[0057] , ,
[0058] Afterwards and The thermal image is fused to obtain the time domain feature matrix of the three channels ,in , , ;
[0059] 6. Construct the image and build the shape 4-channel image , , , , : The first channel is a matrix , and the remaining three channels are matrices , get the feature image ;
[0060] f Electrical identification model identification;
[0061] 1. Feature extraction;
[0062] Image extraction using residual network The high-level features of the output feature vector are 2048 in length. ;
[0063] 2. Result classification;
[0064] 1) Set the length of the fully connected layer to 300 and the input layer to vector , after ReLU activation, output the electrical appliance category ;
[0065] 2) Set the fully connected layer to a length of 200 and the input layer to a vector , after sigmoid activation, output the switching time of the electrical appliances ;
[0066] 3) Set the fully connected layer to a length of 50 and the input layer to a vector , after softmax activation, output the switch status of the electrical appliance ;
[0067] 3. Model training;
[0068] The model is trained using a labeled dataset with the annotation content being the real electrical appliance category, switching time, and switch status; the cross entropy loss function and Adam optimization algorithm are used.
[0069] Preferably, the current characteristic diagram generation model training includes the following process:
[0070] 2a Data collection;
[0071] 1) Collect the current data of a single electrical appliance; add an appliance to the circuit, complete the entire process from on to off and collect data; the data sampling rate is expressed as , the data is a current data sequence based on time; when there is Each piece of data contains When there are sampling points, the original data is expressed as:
[0072]
[0073] 2) Add other electrical appliances to the circuit, ensure that the previous appliances are always in the on state, start collecting current data in the circuit, complete the entire process from on to off, and collect current sequences containing multiple electrical appliance switch events; the data sampling rate is expressed as , the data is a current data sequence based on time; when there is Each piece of data contains When there are sampling points, the original data is expressed as:
[0074]
[0075] 2b denoising processing;
[0076] For the original signal as well as Use the continuous wavelet transform algorithm to filter out noise points and obtain denoised data and , this process is expressed as:
[0077]
[0078] in is the scale parameter, is the translation parameter;
[0079] 2c data slicing;
[0080] In sequence and The 5 current cycles are used as the boundary to extract The time window is arrive Current fragment (5 current cycles) and ,in is the number of points contained in each data after slicing, expressed as:
[0081]
[0082] in is the number of signals after slicing, expressed as:
[0083]
[0084] 2d normalization processing;
[0085] Using the minimum-maximum normalization method, and Each sample value in is mapped to the range of [0, 1] to obtain the normalized data and , the process is expressed as:
[0086]
[0087] in is the original data, is the output data, For sequence data The maximum value of For sequence data The minimum value of
[0088] 2e Generate current feature map training set;
[0089] 1. and Use time-current to draw a line graph and ,in:
[0090] , ,
[0091] 2. Construct a data set for current characteristic graph generation model training. is a data set of a line chart of the current of a single appliance. is a data set of current line graphs of multiple electrical appliances. and One-to-one correspondence is a group, with a total of Group data;
[0092] 2f training current feature map generation model;
[0093] 1. Build an adversarial neural network, which should include a generator network and a discriminator network;
[0094] 2. Input generator network, Input the discriminator network and train it to obtain the current feature map generation model.
[0095] Preferably, the generation of the electrical appliance parameter characteristic diagram includes the following process:
[0096] 3a The current series data is cut into 5 current cycles and denoised and normalized And the corresponding voltage series data As the raw input for generating electrical parameter characteristic maps;
[0097] 3b Pair of data fragments Apply fast Fourier transform to obtain frequency domain feature data , the process is expressed as:
[0098]
[0099] 3c Use time-current to draw a line graph ,in:
[0100] , ,
[0101] 3D Use time-voltage as a line graph ,in:
[0102] ,
[0103] 3e generates a model through the trained current feature map. Apply current feature image generation to generate a current feature map of electrical appliances that only contain switching events ,in:
[0104] ,
[0105] 3f mapping processing;
[0106] Will The value of is mapped to the range of 0-255. Cut to length of Sequence data , and stack them row by row to get the frequency domain feature matrix ,in It is expressed as:
[0107] , ,
[0108] Afterwards and The thermal image is fused to obtain the time domain feature matrix of the three channels ,in , , ;
[0109] 3g build image;
[0110] The shape is constructed as 4-channel image , , , , : The first channel is a matrix , and the remaining three channels are matrices , get the feature image .
[0111] Preferably, the electrical appliance recognition model training includes the following process:
[0112] 4a Data collection;
[0113] Collect current and voltage data of a single electrical appliance; add an appliance to the circuit, complete the entire process from on to off and collect data, and record the time when the appliance is turned on and off , Types of electrical appliances With switch category ; The data sampling rate is expressed as , the data is a series of current and voltage data, based on time; when there is Each piece of data contains When there are sampling points, the original data is expressed as:
[0114]
[0115]
[0116] 4b denoising processing;
[0117] For the original signal Use the continuous wavelet transform algorithm to filter out noise points and obtain denoised data , this process is expressed as:
[0118]
[0119] in is the scale parameter, is the translation parameter;
[0120] 4c data slicing;
[0121] In sequence The 5 current cycles are used as the boundary to extract The time window is arrive Current fragment (5 current cycles) and ;in is the number of points contained in each data after slicing, expressed as:
[0122]
[0123] in is the number of signals after slicing, expressed as:
[0124]
[0125] 4d normalization processing;
[0126] Using the minimum-maximum normalization method, and Each sample value in is mapped to the range of [0, 1] to obtain the normalized data and , the process is expressed as:
[0127]
[0128] in is the original data, is the output data, For sequence data The maximum value of For sequence data The minimum value of
[0129] 4e build a training data set;
[0130] right and Apply the electrical parameter characteristic graph generation method to generate an electrical parameter characteristic graph dataset, and annotate the dataset to mark the time points when the corresponding electrical appliances are turned on and off , Types of electrical appliances With switch category , get the training set of electrical parameter characteristic diagrams for training; It is expressed as:
[0131]
[0132] For the time window arrive The time when the electrical appliance is turned on and off;
[0133] 4f electrical appliance identification model training;
[0134] 1) Build the Resnet50 model;
[0135] 2) Use the training set of electrical parameter characteristic graphs for training;
[0136] 3) Obtain a trained electrical appliance recognition model.
[0137] The present invention proposes an electrical appliance identification method based on an electrical parameter characteristic diagram, which belongs to the technical field of electrical appliance identification. The method first generates a current characteristic diagram based on a current characteristic diagram generation model trained by an adversarial neural network; then uses a fast Fourier transform to process the current line graph to obtain a current frequency domain characteristic diagram; fuses the voltage line graph with the current characteristic diagram to obtain a two-dimensional thermal diagram; fuses the current frequency domain characteristic diagram with the two-dimensional thermal diagram to construct a three-channel electrical parameter characteristic diagram; finally, based on the electrical appliance identification model obtained by residual network training, the electrical parameter characteristic diagram is analyzed to achieve accurate identification of electrical appliances. In view of the transient electrical characteristic changes when the switching event of the electrical equipment occurs, the method can simultaneously identify the type, switch state and switch occurrence time of the electrical appliance, so as to comprehensively judge the use of the electrical appliances in the circuit. In order to improve the accuracy of electrical appliance identification in complex power consumption scenarios, the present invention obtains a current characteristic diagram generation model based on adversarial neural network training, which can effectively remove the influence and ensure the recognition accuracy. Compared with the prior art, the present invention has a faster response speed and higher recognition accuracy.
[0138] The innovation of the present invention is:
[0139] 1. An electrical appliance identification method based on electrical parameter characteristic diagram is proposed. Compared with the traditional method based on time series analysis, it can greatly improve the identification speed and respond to high-frequency data.
[0140] 2. Generate a current frequency domain feature map by fast Fourier transform and image processing of the current signal. This can fully combine the current signal characteristics in the time domain and frequency domain to improve the richness of feature expression.
[0141] 3. Use convolutional neural network technology to achieve end-to-end electrical appliance recognition. Compared with traditional methods, the classification effect is better and supports the recognition of a wider range of electrical appliance categories.
[0142] 4. The output recognition results include three dimensions of information: electrical appliance category, switching time and switch status, with richer recognition details.
[0143] 5. Generate current feature maps based on adversarial networks, which has a higher recognition rate for complex electrical appliances.
[0144] 6. The proposed technical route has the characteristics of strong generalization and can be used to optimize the system and improve performance based on a large amount of labeled data.
[0145] 7. For electrical appliances with similar current characteristics, since the voltage and current of resistive, capacitive and inductive electrical appliances may appear in different phases, the technology proposed in the present invention considers the different phases of voltage and current by fusing feature images, thereby improving the recognition accuracy.
[0146] The present invention has the following beneficial technical effects:
[0147] 1. Real-time processing capabilities have been greatly improved
[0148] The ability to process data in real time has been significantly improved, making it possible to respond to high-frequency data.
[0149] 2. Recognition accuracy is significantly improved
[0150] By fusing the frequency domain and time domain features of the current signal, more feature values are extracted. At the same time, convolutional neural networks are used for end-to-end recognition, giving full play to the advantages of deep learning, and the classification effect is significantly better than traditional methods.
[0151] 3. Support identification of more electrical appliance categories
[0152] The output result of the present invention includes three-dimensional information of electrical appliance category, switching time and switch status. The recognition effect is more comprehensive and rich, and can support the recognition of more types of electrical appliances.
[0153] 4. Reduce computing resource consumption and reduce deployment and usage costs
[0154] Since the amount of calculation is greatly reduced, the computing resources and memory usage are reduced, the hardware cost required to deploy the system of the present invention will also be reduced, making it more suitable for practical application and promotion.
[0155] 5. The system has good scalability and is easy to upgrade and iterate.
[0156] This method can continuously optimize and improve the recognition effect by acquiring more labeled data and adjusting the model structure, continuously adapt to new types of electrical appliances, and the system has strong scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0157] Figure 1 It is a flow chart of the whole method of the present invention.
[0158] Figure 2 It is a flow chart of training the current characteristic diagram generation model in the present invention.
[0159] Figure 3 It is a flow chart for generating a current characteristic diagram in the present invention.
[0160] Figure 4 This is a flow chart for generating a voltage line graph in the present invention.
[0161] Figure 5 It is a flow chart for generating a current frequency domain characteristic diagram in the present invention.
[0162] Figure 6 It is a flow chart for generating an electrical parameter characteristic diagram in the present invention.
[0163] Figure 7 It is a flow chart of training an electrical appliance identification model in the present invention. DETAILED DESCRIPTION
[0164] The specific embodiments of the present invention will be described in detail below. In order to avoid too much unnecessary details, the well-known structures or functions will not be described in detail in the following examples. The approximate language used in the following examples can be used for quantitative expression, indicating that the quantity can be allowed to have a certain change without changing the basic function. Unless otherwise defined, the technical and scientific terms used in the following examples have the same meaning as those generally understood by those skilled in the art to which the present invention belongs.
[0165] Example 1
[0166] Electrical appliance identification method based on electrical parameter characteristic diagram.
[0167] The real-time processing steps are:
[0168] 1) Collect electrical appliance data, cut the collected data into current sequence data with a length of 5 current cycles, and simultaneously intercept the corresponding voltage sequence data;
[0169] 2) The current characteristic graph is generated into a model, the time and voltage two-dimensional data are constructed, and the current characteristic graph, current line graph and current frequency domain characteristic graph are obtained by fast Fourier transform respectively;
[0170] 3) The current characteristic graph and the voltage line graph are combined into an electrical parameter heat map, which is then combined with the current frequency domain characteristic graph to form a three-channel electrical parameter characteristic graph;
[0171] 4) Input the electrical parameter characteristic diagram into the pre-trained electrical appliance recognition model;
[0172] 5) The electrical appliance identification model outputs the type of electrical appliance, switch status, and switch occurrence time. Figure 1 As shown.
[0173] The current characteristic map generation model training steps in step (2) are:
[0174] 1) Collect the current sequence containing the switching events of a single electrical appliance;
[0175] 2) Add other electrical appliances to the circuit and collect current sequences containing switching events of multiple electrical appliances;
[0176] 3) The two sets of sequences are truncated into subsequences with a length of 5 current cycles, which include switching events;
[0177] 4) Plot these two sets of sequences into a single-appliance current line graph and a multi-appliance current line graph according to the time-current relationship. Input them into the adversarial neural network for training to obtain the current characteristic graph generation model. Figure 2 shown.
[0178] The main processes of the electrical parameter characteristic diagram generation process in step (3) are:
[0179] 1) The current data is pre-processed and intercepted into 5 current cycles to form current sequence data, and the voltage data at the corresponding time is intercepted;
[0180] 2) Plot the current series data into a current line graph according to time-current, which is used as the input of the current characteristic graph generation model, and the current characteristic graph is obtained after calculation;
[0181] 3) The voltage series is plotted as a line graph according to time-voltage;
[0182] 4) The current sequence data is subjected to fast Fourier transform to obtain the current frequency domain characteristic diagram;
[0183] 5) Generate a two-dimensional thermal map using the current characteristic graph and the voltage line graph with time as the horizontal axis;
[0184] 6) The R, G, and B of the electrical parameter heat map are used as the 1st, 2nd, and 3rd channels of the electrical parameter characteristic map, and the current frequency domain characteristic map is used as the 4th channel, and they are fused into a 4-channel electrical parameter characteristic map. Figure 3~Figure 6 shown.
[0185] The main steps of the electrical appliance recognition model training in step (4) are:
[0186] 1) Constructing electrical parameter feature atlas for training;
[0187] 2) Carry out the labeling of electrical appliance type switching, on / off status, and occurrence time to form an electrical appliance recognition model training set;
[0188] 3) Input to the residual network for training;
[0189] 4) Obtain the electrical appliance identification model. Figure 7 shown.
[0190] The specific process is as follows:
[0191] Real-time processing flow:
[0192] aData collection:
[0193] First, the real-time current and voltage data need to be collected. The data sampling rate is expressed as , the data is a series of current and voltage data, based on time. The data contains sampling points, the original current data can be expressed as:
[0194]
[0195] The corresponding voltage data sequence is expressed as:
[0196]
[0197] b Denoising
[0198] For the original signal Use the continuous wavelet transform (CWT) algorithm to filter out noise points and obtain denoised data , this process can be expressed as:
[0199]
[0200] in is the scale parameter, is the translation parameter.
[0201] c data slice
[0202] In sequence The time window is divided into 5 current cycles and the interception time window is arrive Current fragment (5 current cycles) And the corresponding voltage segment ,in is the number of points contained in each data after slicing, which can be expressed as:
[0203]
[0204] d Normalization
[0205] Using the minimum-maximum normalization method, and Each sample value in is mapped to the range of [0, 1] to obtain the normalized data and , the process can be expressed as:
[0206]
[0207] in is the original data, is the output data, For sequence data The maximum value of For sequence data The minimum value of .
[0208] eGenerate electrical parameter characteristic diagram
[0209] Fourier transform of the data segment Apply fast Fourier transform (FFT) to obtain frequency domain feature data , the process can be expressed as:
[0210]
[0211] Will Use time-current to draw a line graph ,in:
[0212] , ,
[0213] Will Use time-voltage as a line graph ,in:
[0214] ,
[0215] The model is generated by training the current characteristic map. Apply current feature image generation to generate a current feature map of electrical appliances that only contain switching events ,in:
[0216] ,
[0217] Mapping Process
[0218] Will The value of is mapped to the range of 0-255. Cut to length of Sequence data , and stack them row by row to get the frequency domain feature matrix ,in It can be expressed as:
[0219] , ,
[0220] Afterwards and The thermal image is fused to obtain the time domain feature matrix of the three channels ,in , , .
[0221] The shape of the constructed image is 4-channel image , , , , : The first channel is a matrix , and the remaining three channels are matrices , get the feature image .
[0222] f Electrical identification Model identification
[0223] Feature extraction
[0224] Image extraction using residual network The high-level features of the output feature vector are 2048 in length. .
[0225] Result classification
[0226] (1) Set the length of the fully connected layer to 300 and the input layer to vector , after ReLU activation, output the electrical appliance category .
[0227] (2) Set the length of the fully connected layer to 200 and the input layer to be a vector , after sigmoid activation, output the switching time of the electrical appliances .
[0228] (3) Set the length of the fully connected layer to 50 and the input layer to be a vector , after softmax activation, output the switch status of the electrical appliance .
[0229] Model training uses a labeled data set to train the model. The labeled content is the real electrical appliance category, switching time and switch status. The cross entropy loss function and Adam optimization algorithm are used.
[0230] Current characteristic map generation model training process:
[0231] aData Collection
[0232] (1) It is necessary to collect the current data of a single electrical appliance. Add an electrical appliance to the circuit, complete the entire process from on to off, and collect data. The data sampling rate is expressed as , the data is a current data sequence based on time. Assume that Each piece of data contains sampling points, the original data can be expressed as:
[0233]
[0234] (2) Add other electrical appliances to the circuit, ensure that the previous appliances are always in the on state, start collecting current data in the circuit, complete the entire process from on to off, and collect current sequences containing multiple electrical appliance switching events. The data sampling rate is expressed as , the data is a current data sequence based on time. Assume that Each piece of data contains sampling points, the original data can be expressed as:
[0235]
[0236] b Denoising
[0237] For the original signal as well as Use the continuous wavelet transform (CWT) algorithm to filter out noise points and obtain denoised data and , this process can be expressed as:
[0238]
[0239] in is the scale parameter, is the translation parameter.
[0240] c data slice
[0241] In sequence and The 5 current cycles are used as the boundary to extract The time window is arrive Current fragment (5 current cycles) and ,in is the number of points contained in each data after slicing, which can be expressed as:
[0242]
[0243] in is the number of signals after slicing, which can be expressed as:
[0244]
[0245] d Normalization
[0246] Using the minimum-maximum normalization method, and Each sample value in is mapped to the range of [0, 1] to obtain the normalized data and , the process can be expressed as:
[0247]
[0248] in is the original data, is the output data, For sequence data The maximum value of For sequence data The minimum value of .
[0249] e Generate current feature map training set
[0250] Will and Use time-current to draw a line graph and ,in:
[0251] , ,
[0252] Construct a dataset for training the current feature map generation model. is a data set of a line chart of the current of a single appliance. is a data set of current line graphs of multiple electrical appliances. and One-to-one correspondence is a group, with a total of Group data.
[0253] f Training current feature map generation model
[0254] Build a GAN (general method), which should include a generator network and a discriminator network. Input generator network, Input the discriminator network and train it to obtain the current feature map generation model.
[0255] Electrical parameter characteristic diagram generation process:
[0256] a The current series data will be cut into 5 current cycles and denoised and normalized And the corresponding voltage series data As the raw input for generating electrical parameter characteristic maps.
[0257] b Fourier transform of the data segment Apply fast Fourier transform (FFT) to obtain frequency domain feature data , the process can be expressed as:
[0258]
[0259] c Use time-current to draw a line graph ,in:
[0260] , ,
[0261] d will Use time-voltage as a line graph ,in:
[0262] ,
[0263] e generates a model through the trained current feature map. Apply current feature image generation to generate a current feature map of electrical appliances that only contain switching events ,in:
[0264] ,
[0265] f mapping process
[0266] Will The value of is mapped to the range of 0-255. Cut to length of Sequence data , and stack them row by row to get the frequency domain feature matrix ,in It can be expressed as:
[0267] , ,
[0268] Afterwards and The thermal image is fused to obtain the time domain feature matrix of the three channels ,in , , .
[0269] g constructs an image with a shape of 4-channel image , , , , : The first channel is a matrix , and the remaining three channels are matrices , get the feature image .
[0270] The main process of electrical appliance recognition model training:
[0271] aData Collection
[0272] (1) It is necessary to collect the current and voltage data of a single electrical appliance. Add an electrical appliance to the circuit, complete the entire process from on to off and collect data, and record the time when the appliance is turned on and off. , Types of electrical appliances With switch category The data sampling rate is expressed as , the data is a series of current and voltage data, based on time. Assume that Each piece of data contains sampling points, the original data can be expressed as:
[0273]
[0274]
[0275] b Denoising
[0276] For the original signal Use the continuous wavelet transform (CWT) algorithm to filter out noise points and obtain denoised data , this process can be expressed as:
[0277]
[0278] in is the scale parameter, is the translation parameter.
[0279] c data slice
[0280] In sequence The 5 current cycles are used as the boundary to extract The time window is arrive Current fragment (5 current cycles) and .in is the number of points contained in each data after slicing, which can be expressed as:
[0281]
[0282] in is the number of signals after slicing, which can be expressed as:
[0283]
[0284] d Normalization
[0285] Using the minimum-maximum normalization method, and Each sample value in is mapped to the range of [0, 1] to obtain the normalized data and , the process can be expressed as:
[0286]
[0287] in is the original data, is the output data, For sequence data The maximum value of For sequence data The minimum value of .
[0288] eBuild a training dataset
[0289] right and Apply the electrical parameter characteristic graph generation method to generate an electrical parameter characteristic graph dataset, and annotate the dataset to mark the time points when the corresponding electrical appliances are turned on and off , Types of electrical appliances With switch category , and obtain the training set of electrical parameter characteristic diagrams for training. It can be expressed as:
[0290]
[0291] For the time window arrive The time point when the electrical appliance is turned on or off.
[0292] fElectrical appliance recognition model training
[0293] (1) Build the Resnet50 model (general model).
[0294] (2) Use the training set of electrical parameter characteristic maps for training.
[0295] (3) Obtain a trained electrical appliance recognition model.
[0296] The above method is based on the training of the current characteristic graph generation model by adversarial neural network; the current characteristic graph, voltage characteristic graph and current frequency domain characteristic graph are integrated into the electrical parameter characteristic graph; the electrical appliance recognition model is obtained based on the residual network training; thereby improving the recognition efficiency of the algorithm. This method has a fast response speed, can process high-frequency data, and has a wide range of support. It can recognize various common electrical appliances. At the same time, it has high recognition accuracy and improves the recognition rate for complex electrical appliances.
[0297] Example 2
[0298] Step 1: Current characteristic diagram generation model data preprocessing
[0299] 1. Collect the current time series data of a single electrical appliance.
[0300] Includes: the occurrence of electrical switch events and the corresponding time of occurrence.
[0301] 2. Collect current time series data of multiple electrical appliances.
[0302] Add other electrical consumers to the circuit and collect current sequences that include switching events of multiple electrical consumers.
[0303] 3. Perform wavelet transform to remove noise and normalize the maximum and minimum values of the collected continuous current time series data, and divide it into several data containing five current cycle lengths, the length of which should be n.
[0304] 4. Plot the single load and mixed load timing current data into a The time-current line graph is used as the current characteristic graph to generate the model training data set.
[0305] Step 2: Generate a model based on a generative adversarial network (GAN) and train the current feature map
[0306] 1. Build a generator model: The generator receives random noise input and generates an image. This includes:
[0307] Fully connected layer (Dense)
[0308] Function: Convert the input random noise vector into a high-dimensional feature.
[0309] parameter:
[0310] units=256 4 4: The number of output neurons, equal to 256 feature maps, each with a size of 4 4.
[0311] activation="relu": Use the ReLU activation function.
[0312] input_dim=latent_dim: The dimension of the input vector, equal to the length of the random noise vector.
[0313] Reshape
[0314] Function: Reshape the output of the fully connected layer into 4 4 256 three-dimensional tensor for use in subsequent convolutional layers.
[0315] parameter:
[0316] target_shape=(4, 4, 256): target shape, reshape the output to 4 256 feature maps of size 4.
[0317] UpSampling2D
[0318] Function: Enlarge the size of the feature map by interpolation.
[0319] parameter:
[0320] size=(2, 2): Double the size of each feature map from 4 to 4 to 8 8.
[0321] Convolutional Layer (Conv2D)
[0322] Function: Apply convolution operation to extract local features in feature map.
[0323] parameter:
[0324] filters=256: The number of convolution kernels, that is, the number of output feature maps.
[0325] kernel_size=3: the size of the convolution kernel, 3 3.
[0326] padding="same": keep the input shape unchanged after convolution.
[0327] activation=None: No activation function is used, and LeakyReLU activation is used later.
[0328] Batch Normalization
[0329] Function: Perform batch normalization on features to stabilize and accelerate training.
[0330] parameter:
[0331] momentum=0.8: Momentum parameter, used to control the update speed of the mean and variance.
[0332] Leaky ReLU activation layer (LeakyReLU)
[0333] Function: Apply the Leaky ReLU activation function to allow some negative values to pass through and avoid neuron death.
[0334] parameter:
[0335] alpha=0.2: negative slope.
[0336] UpSampling2D
[0337] Function: Enlarge the size of the feature map again through interpolation.
[0338] parameter:
[0339] size=(2, 2): Double the size of each feature map from 8 to 8 to 16 16.
[0340] Convolutional Layer (Conv2D)
[0341] Function: Apply the convolution operation again to extract and enhance features.
[0342] parameter:
[0343] filters=128: The number of convolution kernels, that is, the number of output feature maps.
[0344] kernel_size=3: the size of the convolution kernel, 3 3.
[0345] padding="same": keep the input shape unchanged after convolution.
[0346] Batch Normalization
[0347] Function: Perform batch normalization on features to stabilize and accelerate training.
[0348] parameter:
[0349] momentum=0.8: Momentum parameter.
[0350] Leaky ReLU activation layer
[0351] Function: Apply Leaky ReLU activation function.
[0352] parameter:
[0353] alpha=0.2: negative slope.
[0354] UpSampling2D
[0355] Function: Enlarge the size of the feature map by interpolation for the last time.
[0356] parameter:
[0357] size=(2, 2): Double the size of each feature map from 16 to 16 to 32 32.
[0358] Convolutional Layer (Conv2D)
[0359] Function: Apply convolution operation to generate the final image.
[0360] parameter:
[0361] filters=64: The number of convolution kernels, that is, the number of output feature maps.
[0362] kernel_size=3: the size of the convolution kernel, 3 3.
[0363] padding="same": keep the input shape unchanged after convolution.
[0364] Batch Normalization
[0365] Function: Perform batch normalization on features.
[0366] parameter:
[0367] momentum=0.8: Momentum parameter.
[0368] Leaky ReLU activation layer (LeakyReLU)
[0369] Function: Apply Leaky ReLU activation function.
[0370] parameter:
[0371] alpha=0.2: negative slope.
[0372] Convolutional Layer (Conv2D)
[0373] Function: Generate the final output image.
[0374] parameter:
[0375] filters=3: The number of convolution kernels, that is, the number of channels of the final generated image (RGB images have 3 channels).
[0376] kernel_size=3: the size of the convolution kernel, 3 3.
[0377] padding="same": keep the input shape unchanged after convolution.
[0378] activation='tanh': Use the tanh activation function to normalize the output values to [-1, 1] to match the normalization of the input image.
[0379] 2. Build a discriminator model: The discriminator receives image input and determines whether the image is real or generated.
[0380] Convolutional Layer (Conv2D)
[0381] Function: Extract local features of an image.
[0382] parameter:
[0383] filters=64: The number of convolution kernels, that is, the number of output feature maps.
[0384] kernel_size=3: the size of the convolution kernel, 3 3.
[0385] strides=2: The stride of the convolution, which halves the size of the feature map.
[0386] input_shape=img_shape: The shape of the input image, assumed to be (32, 32, 3).
[0387] padding="same": keep the input shape unchanged after convolution.
[0388] Leaky ReLU activation layer (LeakyReLU)
[0389] Function: Apply the Leaky ReLU activation function to allow some negative values to pass through and avoid neuron death.
[0390] parameter:
[0391] alpha=0.2: negative slope.
[0392] Dropout layer
[0393] Function: Randomly discard some neurons during training to prevent overfitting.
[0394] parameter:
[0395] rate=0.25: discard 25% of neurons.
[0396] Convolutional Layer (Conv2D)
[0397] Function: further extract image features.
[0398] parameter:
[0399] filters=128: The number of convolution kernels.
[0400] kernel_size=3: The size of the convolution kernel.
[0401] strides=2: the stride of the convolution.
[0402] padding="same": keep the input shape unchanged.
[0403] Leaky ReLU activation layer (LeakyReLU)
[0404] parameter:
[0405] alpha=0.2: negative slope.
[0406] Dropout layer
[0407] parameter:
[0408] rate=0.25: discard 25% of neurons.
[0409] Convolutional Layer (Conv2D)
[0410] Function: Further extract higher-level image features.
[0411] parameter:
[0412] filters=256: The number of convolution kernels.
[0413] kernel_size=3: The size of the convolution kernel.
[0414] strides=2: the stride of the convolution.
[0415] padding="same": keep the input shape unchanged.
[0416] Leaky ReLU activation layer (LeakyReLU)
[0417] parameter:
[0418] alpha=0.2: negative slope.
[0419] Dropout layer
[0420] parameter:
[0421] rate=0.25: discard 25% of neurons.
[0422] Convolutional Layer (Conv2D)
[0423] Function: Extract higher-level image features.
[0424] parameter:
[0425] filters=512: The number of convolution kernels.
[0426] kernel_size=3: The size of the convolution kernel.
[0427] strides=2: the stride of the convolution.
[0428] padding="same": keep the input shape unchanged.
[0429] Leaky ReLU activation layer (LeakyReLU)
[0430] parameter:
[0431] alpha=0.2: negative slope.
[0432] Dropout layer
[0433] parameter:
[0434] rate=0.25: discard 25% of neurons.
[0435] Flatten
[0436] Function: Flatten the multi-dimensional feature map into a one-dimensional vector for input into the fully connected layer.
[0437] Parameters: No parameters.
[0438] Fully connected layer (Dense)
[0439] Function: Output the classification result, that is, the probability that the input image is a real image.
[0440] parameter:
[0441] units=1: The number of output neurons is 1.
[0442] activation='sigmoid': Use the Sigmoid activation function to normalize the output value to [0, 1], indicating the classification probability.
[0443] 3. Build a GAN model: including the generator network and the discriminator network, and optimize them through adversarial training.
[0444] Compile the discriminator: Use binary cross entropy as the loss function to measure the classification performance of the discriminator. Use the optimizer Adam and set the learning rate to 0.0002 and the beta parameter to 0.5.
[0445] 4. Train GAN: Use the optimizer Adam, set the learning rate to 0.0002 and the beta parameter to 0.5, and use the current feature map to generate the model training data set for training.
[0446] 5. Obtain the trained current characteristic map generation model.
[0447] Step 3: Data preprocessing for appliance recognition model training
[0448] 1. Collect the current sequence containing the switching events of a single electrical appliance.
[0449] At the same time, the turning on or off of electrical appliances and the corresponding time should be recorded.
[0450] 2. Clean the collected continuous current time series data and normalize the maximum and minimum values, and divide it into several data containing five current cycle lengths and corresponding voltage time series data, the length of which should be n.
[0451] 3. Convert the 5-cycle current time series data into two-dimensional frequency domain data through fast Fourier transform. The size should be .
[0452] 4. Plot the current time series data according to time-current into a graph of size Line chart of .
[0453] 5. Use the current line graph as the input of the current characteristic graph generation model and obtain the current characteristic graph after calculation.
[0454] 6. Plot the current time series data into a line graph of size l×l (l=\sqrt{n}) according to time-voltage as a voltage line graph.
[0455] 8. Generate a two-dimensional thermal map with time as the horizontal axis using the current characteristic graph and the voltage line graph (general method). Use the R, G, and B of the two-dimensional thermal map as the 1st, 2nd, and 3rd channels of the electrical parameter characteristic map, and the current frequency domain characteristic map as the 4th channel to merge them into a 4-channel electrical parameter characteristic map.
[0456] 9. Label the types of electrical appliances, on / off states, and occurrence times corresponding to the electrical parameter characteristic diagram to form an electrical parameter characteristic diagram training set.
[0457] Step 4: Build a residual (ResNet) network and train the appliance recognition model
[0458] 1. Build the Resnet50 model (general model).
[0459] 2. Use the electrical appliance recognition model training set for training.
[0460] 3. Obtain a trained electrical appliance recognition model.
[0461] Step 5: Perform real-time appliance identification
[0462] 1. Collect real-time current and voltage data.
[0463] 2. The real-time current data is intercepted every 5 current cycles, with a length of n, and the corresponding voltage sequence data is intercepted.
[0464] 3. Plot the real-time current data in terms of time-current into a graph of size The line graph is then input into the feature graph generation model to generate an electrical appliance current feature graph that only contains a single electrical appliance switching event.
[0465] 4. Convert the captured real-time current data into a current frequency domain characteristic diagram through fast Fourier transform.
[0466] 5. Plot the captured real-time voltage data according to time-voltage into a graph of size The line graph is then combined with the current characteristic graph to generate a thermal map.
[0467] 6. Superimpose the R, G, and B channels of the thermal map with a single channel of the frequency domain feature map to obtain a 4-channel electrical parameter feature map, which is input into the electrical appliance identification model.
[0468] 7. The electrical appliance identification model outputs the type of electrical appliance, switch status, and switch occurrence time.
[0469] Through the method of the present invention, high-quality feature images can be efficiently generated from the time series data of current and voltage, and these images can be used to perform neural network recognition tasks, which significantly improves the efficiency and effect of data processing and analysis.
[0470] The embodiments of the present invention are described in detail above, but the contents are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the scope of the present invention shall be included in the protection scope of the present invention.
Claims
1. An electrical appliance identification method based on an electrical parameter characteristic diagram, characterized in that: include: 1) Collect electrical appliance data, cut the collected data into current sequence data with a length of 5 current cycles, and simultaneously intercept the corresponding voltage sequence data; 2) The current characteristic graph is generated into a model, the time and voltage two-dimensional data are constructed, and the current characteristic graph, the current line graph and the current frequency domain characteristic graph are obtained by fast Fourier transform respectively; 3) The current characteristic graph and the voltage line graph are combined into an electrical parameter thermal map, which is then combined with the current frequency domain characteristic graph into a three-channel electrical parameter characteristic map; 4) Input the electrical parameter characteristic diagram into the pre-trained electrical appliance recognition model; 5) The electrical appliance identification model outputs the type of electrical appliance, the switch status, and the time when the switch occurs; The training steps of the current characteristic diagram generation model in step 2) include: 2.1) Collecting current sequences including switching events of a single electrical appliance; 2.2) Add other electrical appliances to the circuit and collect current sequences containing switching events of multiple electrical appliances; 2.3) The two sets of sequences are truncated into subsequences with a length of 5 current cycles, which include switching events; 2.4) Plot these two sets of sequences into a single-appliance current line graph and a multi-appliance current line graph according to the time-current relationship; input them together into the adversarial neural network for training to obtain a current characteristic graph generation model.
2. The electrical appliance identification method based on the electrical parameter characteristic diagram according to claim 1, characterized in that: The training steps of the electrical appliance recognition model in step 4) include: 4.1) Constructing electrical parameter feature atlas for training; 4.2) Carry out the labeling of the type switching, on / off status, and occurrence time of electrical appliances to form a training set for the electrical appliance recognition model; 4.3) Input to the residual network for training; 4.4) Obtain the electrical appliance identification model.
Citation Information
Patent Citations
Electrical load classification method and system based on load characteristic visualization
CN111539275A
Load identification method based on feature fusion
CN113807225A
Event detection method based on attention mechanism
CN115616280A