A non-intrusive electrical load classification method based on multi-scale feature fusion
Through the methods of multi-scale feature fusion and transfer learning, the problems of low recognition accuracy and insufficient model generalization ability in non-invasive electrical load classification are solved, and efficient electrical status monitoring and power consumption prediction are achieved to meet the lightweight requirements of embedded devices.
Patent Information
- Application Number
- CN202310640027.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-05-31
AI Technical Summary
Existing technologies have difficulty effectively distinguishing the status of electrical appliances, and traditional non-intrusive electrical load classification methods cannot fully utilize data diversity, resulting in low recognition accuracy, inability to run effectively on embedded devices, and insufficient model generalization capabilities.
A non-intrusive electrical load classification method based on multi-scale feature fusion is adopted. Multi-scale features are extracted through a U-shaped network, an expanded convolution module and a residual module. Combined with transfer learning, a lightweight multi-task learning model is established to realize electrical event detection and status classification.
It improves the accuracy and stability of appliance event detection and status classification, realizes real-time monitoring of household appliances and power consumption prediction, adapts to different home environments, saves electricity costs, and provides a convenient lifestyle.
Smart Images

Figure CN116738280B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power identification, and in particular relates to a non-invasive electrical load classification method based on multi-scale feature fusion. Background Art
[0002] Existing feature extraction methods for high-frequency and low-frequency datasets struggle to effectively distinguish appliance states, necessitating multi-scale feature extraction methods. Non-intrusive appliance load classification technology, which identifies loads connected to the power grid by measuring and analyzing current and voltage signals from intelligent appliance control systems, has recently seen rapid development and progress in the field of artificial neural networks. However, higher requirements are currently being placed on the classification performance and generalization capabilities of non-intrusive appliance load classification technology. However, the limited computing resources and storage space of embedded devices and smart home appliances make complex non-intrusive appliance load classification methods impractical. Low-cost electricity meters are widely used in some specialized applications, but their limited computing power and storage capacity necessitate lightweight non-intrusive appliance load classification methods. Furthermore, traditional non-intrusive appliance load classification methods use a single classifier to classify load data, failing to fully exploit the diversity within the data. Therefore, non-intrusive appliance load classification technology needs to explore how to combine appliance event detection and appliance state classification into a multi-task learning problem to improve classification accuracy and stability. Summary of the Invention
[0003] The purpose of the present invention is to address the above problems and propose a non-intrusive electrical load classification method based on multi-scale feature fusion, which can improve the accuracy and stability of electrical event detection and electrical state classification, realize automated household appliance management and electricity consumption prediction, and provide users with a more convenient lifestyle to achieve energy conservation and environmental protection effects, with good generalization ability.
[0004] To achieve the above object, the technical solution adopted by the present invention is:
[0005] The present invention proposes a non-intrusive electrical load classification method based on multi-scale feature fusion, comprising the following steps:
[0006] S1. Collecting non-invasive electrical load signals from an electrical control system, where the non-invasive electrical load signals include at least one of current signals, voltage signals, and power signals;
[0007] S2. pre-processing the non-intrusive electrical load signal;
[0008] S3, classifying the pre-processed non-intrusive electrical load signals into a first data set;
[0009] S4. Establish a multi-scale feature fusion classification model. The multi-scale feature fusion classification model includes a U-shaped network, a first feature extraction unit, a residual module, a first feature splicing unit, a Flatten layer, and a classification unit. The U-shaped network, the first feature extraction unit, and the residual module are performed in parallel, wherein:
[0010] A U-shaped network includes a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a second maximum pooling layer, a second feature splicing unit, a third convolutional layer, a fourth convolutional layer, a third feature splicing unit, a fifth convolutional layer, a sixth convolutional layer, and a seventh convolutional layer. The output feature of the first convolutional layer is formed into a first extracted feature by the first maximum pooling layer. The first extracted feature is downsampled by the second convolutional layer to form a second extracted feature. The second extracted feature is formed into a third extracted feature by the second maximum pooling layer. The third extracted feature is downsampled by the seventh convolutional layer to obtain a fourth extracted feature. The third feature splicing unit is used to splice the third extracted feature and the fourth extracted feature to form a first fused feature. The first fused feature is sequentially passed through the fifth convolutional layer and the sixth convolutional layer to form a fifth extracted feature. The second feature splicing unit is used to splice the first extracted feature and the fifth extracted feature to form a second fused feature. The second fused feature is sequentially passed through the third convolutional layer and the fourth convolutional layer to form a sixth extracted feature.
[0011] A first feature extraction unit includes a first dilated convolution module, a fourth feature splicing unit, and a second dilated convolution module, wherein the fourth feature splicing unit is configured to add the fourth extracted feature and the output feature of the first dilated convolution module as an input feature of the second dilated convolution module;
[0012] a sixth feature concatenation unit, configured to add the output features of the U-shaped network, the first feature extraction unit, and the residual module to form a third fusion feature;
[0013] Flatten layer, used to flatten the third fusion feature;
[0014] a classification unit, comprising a first classifier and a second classifier in parallel, wherein the first classifier is used to detect appliance events based on the third fused features after the flattening process, and the second classifier is used to classify appliance states based on the third fused features after the flattening process;
[0015] S5. Use transfer learning methods to obtain a transfer learning model, including:
[0016] S51, using the first data set to pre-train the multi-scale feature fusion classification model and updating the parameters through the loss function, and saving the pre-trained model parameters;
[0017] S52. Use the family private data set to retrain the pre-trained multi-scale feature fusion classification model, and only optimize the parameters of the classification unit to form a transfer learning model.
[0018] Preferably, the preprocessing is to perform discrete wavelet transform on the non-intrusive electrical appliance load signal.
[0019] Preferably, the discrete wavelet transform formula is as follows:
[0020]
[0021]
[0022] Where f(t) represents the input time domain signal at time t, represents the wavelet function, DWT(f) represents the output of discrete wavelet transform, ψ j,k (t) represents the wavelet basis, is the normalization coefficient, ψ(2 j tk) represents the scaling and translation of the wavelet basis, k determines the wavelet basis ψ j,k The position of (t), j determines the width and height.
[0023] Preferably, each dilated convolution module includes an eighth convolution layer, a first activation function, a ninth convolution layer, a second activation function, a tenth convolution layer, a fifth feature splicing unit, an eleventh convolution layer and a twelfth convolution layer. The eighth convolution layer, the first activation function, the ninth convolution layer, the second activation function and the tenth convolution layer are connected in series in sequence. The eleventh convolution layer and the eighth convolution layer share a common input end. The fifth feature splicing unit is used to add the output features of the tenth convolution layer and the output features of the eleventh convolution layer as the input features of the twelfth convolution layer.
[0024] Preferably, the convolution layer in each dilated convolution module satisfies the following formula:
[0025] RF l+1 =RF l +(k-1)*S l
[0026] Among them, RF l+l Represents the receptive field of the l+1th layer, RF i represents the receptive field of the lth layer, k represents the convolution kernel size of the l+1th layer, S l Represents the product of the strides of the first l layers.
[0027] Preferably, each convolution layer in the U-shaped network is a one-dimensional convolution, and the convolution kernel size is 3×3.
[0028] Preferably, the first classifier and the second classifier both use linear fully connected layers and Softmax activation functions connected in sequence.
[0029] Preferably, the parameters are updated through the loss function, as follows:
[0030] The loss function for event type detection is the binary cross entropy loss function, which is expressed as follows:
[0031]
[0032] Where N is the total number of samples in event type detection, u i is the expected probability of the lth sample in event type detection, is the predicted probability of the lth sample in event type detection;
[0033] The appliance status classification uses the category cross entropy as the loss function, which is expressed as follows:
[0034]
[0035] Among them, M is the total number of samples in the appliance status classification, y c is the expected probability of the cth sample in the appliance status classification, is the predicted probability of the cth sample in the appliance status classification.
[0036] Preferably, the residual module includes a thirteenth convolutional layer.
[0037] Preferably, before the preprocessed non-invasive electrical load signal is classified into the first data set, feature extraction is also performed on the preprocessed non-invasive electrical load signal by a second feature extraction unit, and the second feature extraction unit includes a first convolution module and a second convolution module connected in sequence, and each convolution module includes a fourteenth convolution layer, a third activation function and a third maximum pooling layer connected in sequence.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] 1) The present invention proposes a non-invasive electrical load classification method based on multi-scale feature fusion to improve the low recognition accuracy of existing non-invasive electrical load classification technologies when identifying loads connected to the power grid. The proposed method can effectively extract subtle features at multiple scales and fully consider the network's ability to extract features. It uses a lightweight U-shaped network to extract small-scale features, uses an expanded convolution mode to extract large-scale features, and uses a residual module to make the model more flexible and avoid overfitting. Finally, feature fusion is performed to implement three-path multi-scale feature extraction, multi-task learning, and transfer learning technologies, thereby achieving efficient monitoring and prediction of household electrical appliance power consumption, improving the model's generalization ability in real scenarios, and thus improving the accuracy and stability of electrical event detection and electrical appliance status classification.
[0040] 2) It realizes real-time monitoring and management of household appliances, which can help users understand the electricity consumption of each appliance, thereby effectively controlling electricity consumption and saving electricity costs; through multi-scale feature extraction, it can more accurately analyze the energy consumption characteristics of appliances, thereby improving the accuracy and precision of electricity consumption prediction; the use of transfer learning and multi-task learning can improve the generalization and performance of the model, and has good adaptability in the management and electricity consumption prediction tasks of different household appliances; the use of lightweight means can better adapt to actual application scenarios, and improve the practicality and universality of NILM technology in the fields of household appliance management and electricity consumption prediction; with the advantages of non-explicit feature extraction and practicality, it realizes automated household appliance management and electricity consumption prediction, provides users with a more convenient lifestyle, achieves energy conservation and environmental protection effects, and brings actual economic and social benefits to related enterprises and users. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Flowchart of the non-intrusive electrical load classification method based on multi-scale feature fusion of the present invention;
[0042] Figure 2 This is a flow chart for obtaining the transfer learning model of the present invention;
[0043] Figure 3 Schematic diagram of the structure of the multi-scale feature fusion classification model of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0045] It should be noted that when a component is referred to as being "connected" to another component, it may be directly connected to the other component or there may be an intermediate component. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art in the art of this application. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0046] The present invention provides a non-invasive electrical load classification method based on multi-scale feature fusion, which mainly solves the following problems: (1) Existing deep learning algorithms cannot effectively extract similar features of different electrical appliances, and it is difficult to distinguish the status of different electrical appliances. (2) Traditional non-invasive electrical load classification methods usually use a single classifier to classify load data. This method cannot fully utilize the diversity in the data to maximize the use of information in the power bus data to simultaneously predict electrical events and classify electrical appliance status. (3) There are indeed great differences in the use of electrical appliances in different households, and user behavior will also affect the prediction results of the model. A method that can improve the performance and generalization ability of the model is needed to deal with this practical problem. (4) The non-invasive electrical load identification model needs to run on embedded devices or smart home devices, which often have limited computing resources and storage space. (5) The lightweight NILM algorithm can better adapt to actual application scenarios and improve the practicality and universality of NILM technology in fields such as home appliance management and electricity consumption prediction.
[0047] like Figure 1-3 As shown in FIG, a non-intrusive electrical load classification method based on multi-scale feature fusion includes the following steps:
[0048] S1. Collect non-intrusive electrical load signals from an electrical control system. The non-intrusive electrical load signals include at least one of current signals, voltage signals, and power signals.
[0049] Non-intrusive load monitoring (NILM) signals are collected by sensors such as current sensors, voltage sensors, and magnetic sensors. These sensors can measure the current, voltage, or magnetic field of an appliance and convert them into load signals.
[0050] S2. Preprocess the non-intrusive electrical load signal.
[0051] In one embodiment, the preprocessing is to perform discrete wavelet transform on the non-intrusive electrical load signal.
[0052] In one embodiment, the discrete wavelet transform is as follows:
[0053]
[0054]
[0055] Where f(t) represents the input time domain signal at time t, represents the wavelet function, DWT(f) represents the output of discrete wavelet transform, ψ j,k (t) represents the wavelet basis, is the normalization coefficient, ψ(2 j tk) represents the scaling and translation of the wavelet basis, k determines the wavelet basis ψ j,k The position of (t), j determines the width and height.
[0056] In order to make the electrical load signal better show the frequency domain characteristics, the collected original electrical load signal needs to be preprocessed, such as using the discrete wavelet transform (DWT) of the continuous signal for the non-intrusive electrical load signal.
[0057] S3. Classify the pre-processed non-intrusive electrical appliance load signals into a first data set.
[0058] In one embodiment, before the preprocessed non-intrusive electrical load signals are grouped into the first dataset, feature extraction is further performed on the preprocessed non-intrusive electrical load signals by a second feature extraction unit. The second feature extraction unit includes a first convolution module and a second convolution module connected in sequence. Each convolution module includes a fourteenth convolution layer, a third activation function, and a third maximum pooling layer connected in sequence. This allows for data compression, facilitating subsequent model processing.
[0059] S4. Establish a multi-scale feature fusion classification model. The multi-scale feature fusion classification model includes a U-shaped network, a first feature extraction unit, a residual module, a first feature splicing unit, a Flatten layer, and a classification unit. The U-shaped network, the first feature extraction unit, and the residual module are performed in parallel, wherein:
[0060] A U-shaped network includes a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a second maximum pooling layer, a second feature splicing unit, a third convolutional layer, a fourth convolutional layer, a third feature splicing unit, a fifth convolutional layer, a sixth convolutional layer, and a seventh convolutional layer. The output feature of the first convolutional layer is formed into a first extracted feature by the first maximum pooling layer. The first extracted feature is downsampled by the second convolutional layer to form a second extracted feature. The second extracted feature is formed into a third extracted feature by the second maximum pooling layer. The third extracted feature is downsampled by the seventh convolutional layer to obtain a fourth extracted feature. The third feature splicing unit is used to splice the third extracted feature and the fourth extracted feature to form a first fused feature. The first fused feature is sequentially passed through the fifth convolutional layer and the sixth convolutional layer to form a fifth extracted feature. The second feature splicing unit is used to splice the first extracted feature and the fifth extracted feature to form a second fused feature. The second fused feature is sequentially passed through the third convolutional layer and the fourth convolutional layer to form a sixth extracted feature.
[0061] A first feature extraction unit includes a first dilated convolution module, a fourth feature splicing unit, and a second dilated convolution module, wherein the fourth feature splicing unit is configured to add the fourth extracted feature and the output feature of the first dilated convolution module as an input feature of the second dilated convolution module;
[0062] a sixth feature concatenation unit, configured to add the output features of the U-shaped network, the first feature extraction unit, and the residual module to form a third fusion feature;
[0063] Flatten layer, used to flatten the third fusion feature;
[0064] The classification unit includes a first classifier and a second classifier in parallel. The first classifier is used to detect electrical appliance events based on the third fusion feature after flattening, and the second classifier is used to classify electrical appliance states based on the third fusion feature after flattening.
[0065] In one embodiment, each dilated convolution module includes an eighth convolution layer, a first activation function, a ninth convolution layer, a second activation function, a tenth convolution layer, a fifth feature splicing unit, an eleventh convolution layer and a twelfth convolution layer. The eighth convolution layer, the first activation function, the ninth convolution layer, the second activation function and the tenth convolution layer are connected in series in sequence. The eleventh convolution layer and the eighth convolution layer share a common input end. The fifth feature splicing unit is used to add the output features of the tenth convolution layer and the output features of the eleventh convolution layer as the input features of the twelfth convolution layer.
[0066] In one embodiment, the convolution layer in each dilated convolution module satisfies the following formula:
[0067] RF l+1 =RF l +(k-1)*S l
[0068] Among them, RF l+1 Represents the receptive field of the l+1th layer, RF l represents the receptive field of the lth layer, k represents the convolution kernel size of the l+1th layer, S l Represents the product of the strides of the first l layers.
[0069] In one embodiment, each convolution layer in the U-shaped network is a one-dimensional convolution, and the convolution kernel size is 3×3.
[0070] In one embodiment, both the first classifier and the second classifier use linear fully connected layers and Softmax activation functions connected in sequence.
[0071] In one embodiment, the residual module includes a thirteenth convolutional layer.
[0072] Specifically, large-scale convolution kernels and dilated convolution strategies can enable the model to obtain a larger receptive field, but they will inevitably lead to the loss of local information. To compensate for this shortcoming, the present invention adopts a lightweight U-shaped network. This structure is inspired by the U-net network and is similar to but different from the U-net network. Compared to the U-net network, the U-shaped network in the present invention uses one-dimensional convolution, and the number of convolutions is half of the original, with only two downsampling and upsampling processes. The number of convolution kernels is related to the number of layers in which the convolution is located and the input parameters. There is only one convolution before each downsampling, and there are two convolutions during the upsampling process. The first convolution in the upsampling is to ensure that the shape of the data spliced before and after is unified, while maintaining good model performance while also having the characteristics of lightweight. In this structure, each layer uses a 3×3 convolution kernel, which can fully extract local features without increasing the number of model parameters. The same filter size and step size are used for upsampling and downsampling, so that the spatial resolution of the feature map remains consistent between upsampling and downsampling, which helps to reduce information loss. The last down-sampled feature in the U-shaped network (i.e., the fourth extracted feature) is sent to the first feature extraction unit of another path, so that small-scale feature information can be transmitted and information interaction between different paths can be realized.
[0073] The first feature extraction unit uses an expanded convolution module. When processing current information data, the current is stable in most time periods without any significant changes. Only in a few time periods does the current jump. For a section of current data, only a small part of the information needs to be feature extracted. Therefore, in view of such data characteristics, a convolution layer with a larger convolution kernel is used in the model to extract features. This can expand the receptive field of the convolution layer and extract more effective features, while also preventing the model from extracting too many useless features. The operations of each convolution layer in the expanded convolution module can be expressed as:
[0074] RF l+1 =RF l +(k-1)*S l
[0075] Among them, RF l+1 Represents the receptive field of the l+1th layer, RF l represents the receptive field of the lth layer, k represents the convolution kernel size of the l+1th layer, S l Represents the product of the strides of the first l layers.
[0076] The present invention introduces dilated convolution when using convolutional layers. Dilated convolution can expand the receptive field without increasing parameters. When dilated convolution is stacked too many times, some data points will be skipped, which can be regarded as discarding some features. For current data with a lot of invalid information, this can improve model performance to a certain extent, while reducing the number of model parameters and achieving the purpose of lightweighting.
[0077] The lightweight structure of the U-shaped network and the first feature extraction unit significantly reduces the number of data points actually used for model training, potentially leading to problems such as overfitting or vanishing gradients. Therefore, the present invention incorporates a residual module. The residual module allows skipping certain layers in the network, making the model more flexible and preventing overfitting of the training data. It also makes the model easier to train and more robust.
[0078] Three parallel paths are used to extract features: one path is based on U-shaped network extraction, one path is based on the first feature extraction unit extraction, and the other path is the residual module extraction. At the end of the feature extraction, the feature extraction results of the three paths are added and fused. For example, the output feature U(x) extracted by the U-shaped network, that is, the sixth extracted feature, the output feature D(x) extracted by the first feature extraction unit, that is, the output feature of the second dilated convolution module, and the output feature R(x) extracted by the residual module are added and fused. These three structures have different advantages and applicability in feature extraction and representation. Through the multi-path feature extraction method, feature information of different time slice scales and different frequency band scales can be captured simultaneously, and the residual method can be used to enhance the feature representation capability. The output result F(x) of the sixth feature splicing unit is expressed as:
[0079] F(x)=D(x)+U(x)+R(x).
[0080] A dual-task end-to-end model is used, with one task being appliance event detection and the other being appliance state classification. The classifiers for both tasks use a linear fully connected layer and a Softmax activation function, with different numbers of final classification nodes. For example, appliance event detection includes appliance on events, appliance off events, and no appliance on / off events. Appliance state classification includes on and off states, with on being 1 and off being 0. Specific settings can be made based on actual needs. The loss function for the appliance event detection (event type detection) task is a binary cross-entropy loss function, while the category cross-entropy loss function is used for the appliance state classification task.
[0081] S5. Use transfer learning methods to obtain a transfer learning model, including:
[0082] S51. Use the first data set to pre-train the multi-scale feature fusion classification model and update the parameters through the loss function, and save the pre-trained model parameters.
[0083] It should be noted that, those skilled in the art usually divide the first data set, i.e., the preprocessed non-invasive electrical load signal, into, for example, a 60% training set, a 20% validation set, and a 20% test set, and then perform model training, validation, and testing to obtain a pre-trained model. This is a routine operation for those skilled in the art and will not be described in detail here.
[0084] In one embodiment, the parameters are updated through the loss function, as follows:
[0085] The loss function for event type detection is the binary cross entropy loss function, which is expressed as follows:
[0086]
[0087] Where N is the total number of samples in event type detection, y i is the expected probability of the lth sample in event type detection, is the predicted probability of the lth sample in event type detection;
[0088] The appliance status classification uses the category cross entropy as the loss function, which is expressed as follows:
[0089]
[0090] Among them, M is the total number of samples in the appliance status classification, y c is the expected probability of the cth sample in the appliance status classification, is the predicted probability of the cth sample in the appliance status classification.
[0091] S52. Use the family private data set to retrain the pre-trained multi-scale feature fusion classification model, and only optimize the parameters of the classification unit to form a transfer learning model.
[0092] To address the model's weak generalization capabilities in private home environments, transfer learning can be used. This involves first training with a public dataset and then performing transfer learning with a small amount of data collected in a specific area. This transfer learning approach can be divided into two steps: pre-training and transfer training.
[0093] 1) Pre-training process: Use data from public datasets to train the multi-scale feature fusion classification model and save the pre-trained model parameters.
[0094] 2) Transfer training process. Training is performed using a small number of training samples extracted from a private household dataset. In the transfer learning task, the Flatten layer fuses and flattens these multi-scale features and uses them as input to the classification unit. During training, the parameters of the feature extraction layer (including the U-shaped network, the first feature extraction unit, the residual module, the first feature concatenation unit, and the Flatten layer) remain unchanged. Only the parameters of the classification unit are optimized to obtain the transfer learning model. Using the transfer learning model, electrical load classification can be completed in the corresponding scenario.
[0095] Performance evaluation of the transfer learning model: The performance of the model is evaluated using the accuracy rate ACC, recall rate Rec, precision rate Pre, and F1 score F1-Score. First, a confusion matrix of normal and abnormal behaviors is generated to obtain the number of true positives, true negatives, false positives, and false negatives. Then, the confusion matrix is used to calculate the accuracy rate ACC, recall rate Rec, precision rate Pre, and F1 score F1-Score. The calculation formula is as follows:
[0096]
[0097]
[0098]
[0099]
[0100] Among them, K is the number of categories, tp i is the number of correctly classified into the i-th category, fp i is the number of samples that do not belong to class i but are mistakenly classified into class i, fn i is the number of items that belong to class i but are not classified into class i.
[0101] It's easy to understand that widely recognized public datasets, such as the LIT dataset from the Laboratory for Innovation and Technology (LIT) for Embedded Systems, or the UK-DALE dataset, can also be used for non-intrusive multi-label classification of electrical loads. This method can effectively detect electrical events and classify electrical states, achieving an accuracy of 98.4% and an F1 score of 97.2%.
[0102] The multi-scale feature fusion classification model of the present invention improves the accuracy and generalization ability of the NILM technology by adopting three-path multi-scale feature extraction, multi-task learning and lightweight operations; in practical applications, the transfer learning technology is used to further improve the generalization ability and performance of the model, so that the model can adapt to the actual needs of different families and environments, and accurately monitor the load and predict the power consumption of household appliances to achieve energy conservation and environmental protection effects. Among them, a multi-scale feature extraction method is adopted, which can extract the key features of the data at different time scales. These features can more accurately reflect the power consumption of household appliances, thereby improving the precision and accuracy of the prediction, and can be applied to actual household appliance management and power consumption prediction. The effect of lightweight model parameters and low-latency reasoning is achieved, and the reasoning speed, number of parameters, and accuracy are all superior to the existing technology.
[0103] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0104] The above-described embodiments merely represent specific and detailed examples of the present application and should not be construed as limiting the scope of the patent application. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A non-intrusive electrical load classification method based on multi-scale feature fusion, characterized by: The non-intrusive electrical load classification method based on multi-scale feature fusion comprises the following steps: S1. Collecting a non-invasive electrical load signal from an electrical control system, where the non-invasive electrical load signal includes at least one of a current signal, a voltage signal, and a power signal; S2. pre-processing the non-intrusive electrical load signal; S3, classifying the pre-processed non-intrusive electrical load signals into a first data set; S4. Establish a multi-scale feature fusion classification model, wherein the multi-scale feature fusion classification model includes a U-shaped network, a first feature extraction unit, a residual module, a first feature splicing unit, a Flatten layer, and a classification unit. The U-shaped network, the first feature extraction unit, and the residual module are operated in parallel, wherein: The U-shaped network includes a first convolutional layer, a first maximum pooling layer, a second convolutional layer, a second maximum pooling layer, a second feature splicing unit, a third convolutional layer, a fourth convolutional layer, a third feature splicing unit, a fifth convolutional layer, a sixth convolutional layer and a seventh convolutional layer, wherein the output feature of the first convolutional layer is subjected to the first maximum pooling layer to form a first extracted feature, the first extracted feature is downsampled by the second convolutional layer to form a second extracted feature, the second extracted feature is subjected to the second maximum pooling layer to form a third extracted feature, the third extracted feature is downsampled by the seventh convolutional layer to obtain a fourth extracted feature, the third feature splicing unit is used to splice the third extracted feature and the fourth extracted feature to form a first fused feature, the first fused feature is sequentially passed through the fifth convolutional layer and the sixth convolutional layer to form a fifth extracted feature, the second feature splicing unit is used to splice the first extracted feature and the fifth extracted feature to form a second fused feature, and the second fused feature is sequentially passed through the third convolutional layer and the fourth convolutional layer to form a sixth extracted feature; The first feature extraction unit includes a first dilated convolution module, a fourth feature splicing unit and a second dilated convolution module, wherein the fourth feature splicing unit is used to add the fourth extracted feature and the output feature of the first dilated convolution module as the input feature of the second dilated convolution module; The first feature splicing unit is used to add the output features of the U-shaped network, the first feature extraction unit and the residual module to form a third fusion feature; The Flatten layer is used to flatten the third fusion feature; The classification unit includes a first classifier and a second classifier in parallel, wherein the first classifier is used to detect appliance events based on the third fused features after flattening, and the second classifier is used to classify appliance states based on the third fused features after flattening; S5. Use transfer learning methods to obtain a transfer learning model, including: S51, using the first data set to pre-train the multi-scale feature fusion classification model and updating the parameters through the loss function, and saving the pre-trained model parameters; S52. Use the family private data set to retrain the pre-trained multi-scale feature fusion classification model, and only optimize the parameters of the classification unit to form a transfer learning model.
2. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 1, characterized in that: The preprocessing is to perform discrete wavelet transform on the non-intrusive electrical appliance load signal.
3. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 2, characterized in that: The discrete wavelet transform formula is as follows: Where f(t) represents the input time domain signal at time t, represents the wavelet function, DWT(f) represents the output of discrete wavelet transform, ψ j,k (t) represents the wavelet basis, is the normalization coefficient, ψ(2 j tk) represents the scaling and translation of the wavelet basis, k determines the wavelet basis ψ j,k The position of (t), j determines the width and height.
4. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 1, characterized in that: Each of the dilated convolution modules includes an eighth convolution layer, a first activation function, a ninth convolution layer, a second activation function, a tenth convolution layer, a fifth feature splicing unit, an eleventh convolution layer and a twelfth convolution layer. The eighth convolution layer, the first activation function, the ninth convolution layer, the second activation function and the tenth convolution layer are connected in series in sequence. The eleventh convolution layer and the eighth convolution layer share a common input end. The fifth feature splicing unit is used to add the output features of the tenth convolution layer and the output features of the eleventh convolution layer as the input features of the twelfth convolution layer.
5. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 4 is characterized in that: The convolutional layers in each of the dilated convolution modules satisfy the following formula: RF l+1 =RF l +(k-1)*S l Among them, RF l+1 Represents the receptive field of the l+1th layer, RF l represents the receptive field of the lth layer, k represents the convolution kernel size of the l+1th layer, S l Represents the product of the strides of the first l layers.
6. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 1, characterized in that: Each convolution layer in the U-shaped network is a one-dimensional convolution, and the convolution kernel size is 3×3.
7. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 1, characterized in that: The first classifier and the second classifier both use linear fully connected layers and Softmax activation functions connected in sequence.
8. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 1, characterized in that: The parameter update is performed through the loss function, as follows: The loss function for event type detection is the binary cross entropy loss function, which is expressed as follows: Where N is the total number of samples in event type detection, y i is the expected probability of the lth sample in event type detection, is the predicted probability of the lth sample in event type detection; The appliance state classification uses the category cross entropy as the loss function, which is expressed as follows: Among them, M is the total number of samples in the appliance status classification, y c is the expected probability of the cth sample in the appliance status classification, is the predicted probability of the cth sample in the appliance status classification.
9. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 1, characterized in that: The residual module includes a thirteenth convolutional layer.
10. The non-intrusive electrical load classification method based on multi-scale feature fusion according to claim 1, characterized in that: Before the preprocessed non-invasive electrical load signal is classified into the first data set, feature extraction is also performed on the preprocessed non-invasive electrical load signal by a second feature extraction unit, and the second feature extraction unit includes a first convolution module and a second convolution module connected in sequence, and each of the convolution modules includes a fourteenth convolution layer, a third activation function and a third maximum pooling layer connected in sequence.
Citation Information
Patent Citations
U-shaped brain tumor segmentation network fused with cavity convolution
CN110675379A
Remote sensing image semantic segmentation method based on regional attention multi-scale feature fusion
CN111797779A