A non-intrusive load detection method based on self-supervised conditional autoencoder
By learning load characteristics through a self-supervised conditional autoencoder, the problem of insufficient generalization ability of the NILM method across users and scenarios is solved, achieving high-precision load identification and detection, adapting to complex power consumption scenarios, and possessing good generalization and robustness.
Patent Information
- Application Number
- CN202511510827.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2045-10-22
AI Technical Summary
Existing NILM methods lack generalization ability across users and scenarios, rely on manually designed features and are sensitive to changes in data distribution, making it difficult to adapt to dynamically changing electrical equipment and diverse load scenarios. They also suffer from insufficient labels and incomplete training categories.
A non-intrusive load detection method based on a self-supervised conditional autoencoder is adopted. The method learns transformation invariance and discriminative features through a self-supervised pre-training stage, and optimizes the model by combining the reconstruction loss function and the overall loss function to construct clear feature boundaries. The detection capability is improved by utilizing trajectory features and image transformation operations.
It achieves high-precision identification of known loads and detection of unseen loads, adapts to complex power consumption scenarios, has good generalization and robustness, is highly applicable, and requires no additional sample modeling.
Smart Images

Figure CN120974246B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power load monitoring, and in particular to a non-intrusive load detection method based on a self-supervised conditional autoencoder. BACKGROUND
[0002] Under the background of the "double carbon" strategy, the energy structure is accelerating transformation, and the power system is facing a higher proportion of renewable energy access and diversified load structure. To achieve the goal of carbon peak and carbon neutral, not only the green development of the power supply side is needed, but also efficient regulation and intelligent perception of the load side. NILM (Non-Intrusive Load Monitoring) technology collects user-side total power signals, identifies and restores the power consumption behavior of various loads, and provides basic data support for user energy management, power grid side load prediction, and power demand response strategy formulation. Compared with traditional socket or smart plug monitoring methods, NILM has the advantages of low deployment cost, high user acceptance, and low communication cost, and has become one of the key technologies in smart grid and energy efficiency management. At the same time, NILM also has broad application prospects in device state monitoring, power safety warning, and power quality analysis, so in-depth study of high-precision and high-generalization NILM methods has important theoretical value and practical significance.
[0003] However, the existing technology currently mainly faces the following technical challenges:
[0004] (1) The classifier relies on manual design and is sensitive to changes in data distribution, and the generalization ability across users and scenes needs to be improved. Traditional NILM methods that use feature engineering combined with classifiers have features that rely on manual design and are sensitive to changes in data distribution.
[0005] (2) A large number of research methods are generally based on the "closed set assumption", which can easily lead to the problem of insufficient labels for some loads. Most existing methods are generally based on an idealized assumption that the load category set at the training and testing stages remains the same, i.e., the so-called "closed set assumption". This can lead to the inability to cover user loads with great dynamicity and diversity in real-world scenarios during training, resulting in decreased recognition accuracy and even interference with the entire load identification process, thereby restricting the large-scale deployment of NILM systems.
[0006] (3) Some methods have difficulty identifying new load types when the training categories are incomplete. In actual NILM tasks, user power devices can change dynamically, and the test stage often encounters loads not involved in the training stage. Some traditional methods only model known load categories, making it difficult to adapt to the load diversity in actual scenarios.
[0007] To solve the above problems, researchers have proposed methods combining deep learning with NILM, such as convolutional neural networks (CNN), recurrent neural networks (RNN), sequence-to-point models, attention mechanisms, and autoencoders, which are widely used in load identification tasks and can achieve end-to-end feature learning and classification decisions. Some researchers have introduced semi-supervised or transfer learning techniques to address the lack of labels and cross-scene generalization problems. However, these methods generally have difficulty in constructing effective models under the condition of label scarcity, may not cover the highly dynamic and diverse user loads in real-world scenarios during training, and are difficult to adapt to the load diversity in actual scenarios when the training classes are incomplete. SUMMARY
[0008] The present application provides a self-supervised conditional autoencoder-based non-intrusive load detection method that improves the representation and subsequent detection of loads, is practical and efficient, and has strong generalization and applicability. It can not only guarantee known load identification accuracy but also construct clear feature boundaries to assist load differentiation and adapt to load identification needs in complex power consumption scenarios.
[0009] To achieve the above purpose, the technical solution adopted by the present application is as follows: a self-supervised conditional autoencoder-based non-intrusive load detection method, comprising:
[0010] An abnormal energy load sample set is obtained based on a power system, and the load sample set includes at least one load sample. The load category set of the load sample set is preset, and the load category set includes at least one load category.
[0011] The trajectory features and trajectory images of each load sample are extracted based on the load sample set.
[0012] A classifier is trained based on the trajectory features and load identification is performed based on the load sample set.
[0013] A pre-training model is self-supervised trained based on the load sample set, the trajectory images, and a reconstruction loss function to obtain a reconstruction image set. The pre-training model learns to restore the original structure from different perspectives through the reconstruction loss function, so that the final features have invariance to input transformation and contain discriminative semantic information.
[0014] The pre-training model is optimized and trained based on the load category set, the reconstruction image set, and a global loss function to obtain a detection model.
[0015] The detection model is used to perform non-intrusive detection on the abnormal energy load based on the abnormal score.
[0016] The overall loss function is constructed based on a classification loss function and a learning loss function; the overall loss function combines the classification loss function and the learning loss function, and this combined optimization strategy not only guarantees a high recognition rate for known loads, but also constructs clear inter-class boundaries in the feature space, thereby providing a separable geometric basis for subsequent load detection.
[0017] The classification loss function is constructed based on the load category set and the reconstructed image set using cross-entropy loss, and the classification loss function explicitly promotes the encoder to learn a feature representation with good class discriminability, and uses cross-entropy to optimize the latent representation feature vector output by the encoder.
[0018] The learning loss function is constructed based on the load category set and the reconstructed image set using a modified linear operation, and the introduction of the learning loss function can further improve the feature discrimination between different categories and strengthen the robustness of the model to unseen loads.
[0019] In some embodiments, the pre-trained model is subjected to self-supervised training based on the load sample set, according to the trajectory image and a reconstruction loss function to obtain the reconstructed image set:
[0020] A preset image transformation category is provided.
[0021] An initial transformation function, an initial extraction function and an initial reconstruction function are constructed in the pre-trained model, the initial transformation function is constructed based on the trajectory image, the initial extraction function is constructed based on the initial transformation function, and the initial reconstruction function is constructed based on the initial extraction function.
[0022] The reconstruction loss function is constructed based on the image transformation category, the trajectory image and the reconstruction function.
[0023] The pre-trained model is subjected to self-supervised training based on the load sample set, according to the reconstruction loss function to obtain an optimized transformation function, an optimized extraction function and an optimized reconstruction function.
[0024] Based on the load sample set, at least one image transformation operation is performed on each of the trajectory images according to the optimized transformation function to obtain an intermediate image set, the intermediate image set includes at least one intermediate image, and the trajectory image is subjected to the image transformation operation according to the optimized transformation function to obtain the intermediate image.
[0025] The feature vector of each of the intermediate images is extracted according to the optimized extraction function.
[0026] The feature vector is subjected to a reconstruction operation according to the optimized reconstruction function to obtain a reconstructed image.
[0027] The reconstructed image set is obtained according to the reconstructed image.
[0028] The present stage is a supervised pre-training stage, which learns discriminative and generalization representation of load by image transformation operation and reconstruction operation, and enhances the detection ability of the pre-training model or the final detection model for unseen load.
[0029] In some embodiments, the pre-training model comprises an input conversion module, an encoder module and a decoder module.
[0030] The input conversion module is configured to construct the initial transformation function, and obtain a set of intermediate images by performing at least one image transformation operation on each of the trajectory images based on the load sample set according to the optimized transformation function; the function of the input conversion module is to perform various image transformation operations such as rotation on the V-I trajectory images of the load sample, to generate transformed images, i.e., intermediate images, to provide diversified input for self-supervised pre-training, and to help the pre-training model learn load features that are invariant to transformation; the encoder module is configured to construct the initial extraction function, and extract a feature vector of each of the intermediate images according to the optimized extraction function; the function of the encoder module is to extract the feature vector of the transformed image in the pre-training stage, to retain the pre-training parameters in the fine-tuning stage, and to continue to output load feature representation, to provide key feature support for the reconstruction of the decoder module, the classification of the classifier module, and the non-intrusive detection of abnormal energy consumption load;
[0031] The decoder module is configured to construct the initial reconstruction function, and reconstruct the feature vector to obtain a reconstructed image according to the optimized reconstruction function; the function of the decoder module is to receive the feature vector output by the encoder module in the pre-training stage, to reconstruct the feature vector into the original untransformed V-I trajectory image, to minimize the reconstruction error, and to assist the encoder module to learn more robust and discriminative load essential features.
[0032] In some embodiments, the image transformation operation at least includes a rotation operation, through which the adaptability of the pre-training model to the direction change of the load sample can be enhanced, and the pre-training model can be prevented from overfitting to a specific direction.
[0033] In some embodiments, the step of obtaining the anomaly score comprises:
[0034] calculating a cluster center of a load category corresponding to the abnormal energy consumption load in a feature space;
[0035] calculating the Euclidean distance from the abnormal energy consumption load to each cluster center according to the cluster center and the feature vector; the Euclidean distance conforms to the spatial distance cognition, is convenient for visual analysis, and is efficient and applicable in calculation;
[0036] The abnormal score of the abnormal energy consumption load is obtained according to the minimum value of the Euclidean distance.
[0037] In some embodiments, the non-intrusive detection of the abnormal energy consumption load based on the abnormal score using the detection model comprises:
[0038] An abnormal threshold is set;
[0039] When the abnormal score is not greater than the abnormal threshold, a load category of the abnormal energy consumption load is obtained according to the cluster center corresponding to the minimum value of the Euclidean distance;
[0040] When the abnormal score is greater than the abnormal threshold, it is considered that the abnormal energy consumption load is from an unknown load category and is rejected.
[0041] In some embodiments, the setting of the abnormal threshold comprises:
[0042] An abnormal score of each load sample in the load sample set is obtained;
[0043] An abnormal score set is obtained according to the abnormal scores;
[0044] The abnormal threshold is obtained according to the abnormal score set selected by the first q percentile, q which is a hyperparameter for controlling the rejection sensitivity. The percentile threshold only depends on the order of the data distribution and is not affected by extreme values, and can accurately reflect the detection result.
[0045] In some embodiments, the pre-training model further comprises a classifier module for non-intrusive detection of the abnormal energy consumption load based on the abnormal score. The classifier module only plays a role in the fine-tuning stage, and uses the load category labels of known load samples to optimize the cross-entropy loss through a classification loss function based on the feature vectors output by the encoder module, so as to realize accurate classification of known loads and improve the category discrimination ability of the detection model.
[0046] In some embodiments, the trajectory feature is a V-I trajectory feature, and the trajectory image is a V-I trajectory image. The V-I trajectory feature and the V-I trajectory image have the characteristics of rich information, strong dynamic representation ability, strong anti-interference ability and strong applicability, and can comprehensively reflect the circuit state, adapt to time-varying systems, and facilitate classification through machine learning or threshold comparison.
[0047] In some embodiments, the extraction of the trajectory feature of each load sample based on the load sample set comprises:
[0048] Based on the non-intrusive load monitoring framework, the voltage and current waveforms of the load sample are extracted using the load switching event.
[0049] The V-I trajectory feature is extracted according to the voltage-current waveform, feature extraction is simple, and cost and efficiency are balanced.
[0050] Compared with the prior art, the present application has the following beneficial effects:
[0051] (1) The non-intrusive load detection method based on the self-supervised conditional autoencoder has self-supervised pre-training to enhance feature robustness: through image transformation and reconstruction operations, the load universal features are learned without labels, so that the features are invariant to input transformation, and the representation and subsequent detection ability of abnormal energy load are improved.
[0052] (2) The non-intrusive load detection method based on the self-supervised conditional autoencoder has two-stage training to meet dual task requirements: the pre-training stage learns generalization features, and the fine-tuning stage combines classification loss and learning loss, which can guarantee the identification accuracy of known abnormal energy load and construct clear feature boundaries to help distinguish abnormal energy load.
[0053] (3) The non-intrusive load detection method based on the self-supervised conditional autoencoder is innovative, practical and efficient: based on feature distance, an abnormal threshold is set, without additional sample modeling, the distance from the sample to the known class center is calculated to identify abnormal energy load, and the generalization and applicability are strong.
[0054] (4) The feature extraction of the non-intrusive load detection method based on the self-supervised conditional autoencoder is in line with the characteristics of abnormal energy load: the V-I trajectory image before and after load switching is input, the electrical behavior mode of the load is captured, the discrimination degree of different abnormal energy loads is enhanced, and the abnormal energy load identification demand in complex power consumption scenarios is adapted. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 The figure is a flowchart of the non-intrusive load detection method based on the self-supervised conditional autoencoder of the present application;
[0056] Figure 2 The figure is a schematic diagram of the non-intrusive load detection method based on the self-supervised conditional autoencoder of the two-stage training in the embodiment of the present application. DETAILED DESCRIPTION
[0057] The present application aims to solve the three major problems faced by non-intrusive load monitoring: first, the classifier relies on manual design and is sensitive to data distribution changes, and the generalization ability across users and scenes needs to be improved; second, a large number of research methods are generally based on the "closed set assumption", which is prone to the problem of insufficient labels for some loads; third, some methods have difficulty in identifying new load types in the case of incomplete training categories.
[0058] To this end, the application proposes a non-intrusive load detection method based on a self-supervised conditional autoencoder (CAE). The method learns load universal features with transformation invariance and discriminability under a label-free condition by introducing a self-supervised pre-training strategy, and improves the detection capability of the load through a double mechanism of reconstruction error and feature space similarity. To clearly illustrate the technical features of the present scheme, the embodiments of the present application will be described in detail below in conjunction with the drawings and examples, so that the implementation process of how to apply technical means to solve technical problems and achieve corresponding technical effects can be fully understood and implemented. The embodiments of the present application and the various features in the examples can be combined with each other without conflict, and the formed technical solutions are all within the protection scope of the present application.
[0059] Referring to Figure 1 , the application proposes a non-intrusive load detection method based on a self-supervised conditional autoencoder, which includes:
[0060] Obtain a non-intrusive load sample set of abnormal energy consumption load based on a power system, and the load sample set includes at least one load sample; predefine a load category set of the load sample set, and the load category set includes at least one load category;
[0061] Extract a trajectory feature and a trajectory image of each load sample based on the load sample set;
[0062] Train a classifier according to the trajectory feature and perform load identification based on the load sample set; the trajectory feature can be regarded as a delta form of load feature, which utilizes the difference between two consecutive snapshots and satisfies the feature additive criterion;
[0063] Obtain a reconstructed image set by performing self-supervised training on a pre-training model based on the load sample set, the trajectory image and a reconstruction loss function; the pre-training model learns a latent representation capable of restoring the original structure from different perspectives through the reconstruction loss function, so that the final feature has invariance to input transformation and contains discriminative semantic information;
[0064] Obtain a detection model by performing optimization training on the pre-training model according to the load category set, the reconstructed image set and an overall loss function;
[0065] The overall loss function is constructed based on a classification loss function and a learning loss function; the overall loss function is:
[0066] ;
[0067] In the formula, is the overall loss function, is the classification loss function, to adjust the weight coefficient between the classification loss and the learning loss, to learn the loss function;
[0068] The classification loss function is constructed based on the load category set and the reconstructed image set using cross-entropy loss. The classification loss function explicitly promotes the encoder to learn a feature representation with good category discriminability. The cross-entropy is used to optimize the latent representation feature vector output by the encoder. The classification loss function is:
[0069]
[0070] In the formula, is the total number of load samples, is the load sample serial number, is the classifier weight of the th load category, is the load category serial number, is the number of load categories, i.e., the total number of load categories in the load category set, is the feature vector of the trajectory image corresponding to the th load sample, is the load category of the th load sample, is the feature center of the load category corresponding to the th load sample, and the superscript T represents transposition;
[0071] The learning loss function is constructed based on the load category set and the reconstructed image set using modified linear operation. The introduction of the learning loss function can further improve the feature discrimination between different categories and strengthen the robustness of the model to unseen loads.
[0072]
[0073] In the formula, represents the ReLU (Rectified Linear Unit) operation, is the feature center of the load category corresponding to the th load sample, is the feature center of the th load category, is the load category serial number, is a preset interval threshold parameter for controlling the lower bound of category separation; the learning loss function encourages load samples of the same category to gather around the corresponding center while being far away from the centers of other load categories, thereby constructing a clear feature boundary, which is beneficial for the subsequent identification of unknown load categories.
[0074] The overall loss function combines the classification loss function and the learning loss function, and this joint optimization strategy not only guarantees a high recognition rate for known loads, but also constructs clear inter-class boundaries in the feature space, providing a separable geometric basis for subsequent load detection.
[0075] The detection model obtained after the optimized training fine-tuning retains the transform-invariant features learned by the CAE in the pre-training stage, i.e., the self-supervised training, while having strong discrimination ability and load exclusion ability;
[0076] Based on the anomaly score, the detection model is used to non-invasively detect abnormal energy consumption loads; without using additional load samples, the modeling of the category can be completed, and good generalization and practical applicability are achieved.
[0077] In some embodiments, based on the load sample set, a pre-training model is subjected to self-supervised training according to the trajectory image and the reconstruction loss function to obtain a reconstructed image set:
[0078] The preset image transformation category includes one or more combinations of rotation operation, flip operation and scaling operation, and preferably, the image transformation in the embodiment selects the rotation operation, and different rotation angles are set to preset M The image transformation category includes one or more combinations of rotation operation, flip operation and scaling operation, and preferably, the image transformation in the embodiment selects the rotation operation, and different rotation angles are set to preset M The total number of image transformation categories, such as rotation 、 、 and ;
[0079] In the pre-training model, an initial transformation function, an initial extraction function and an initial reconstruction function are constructed, the initial transformation function is constructed based on the trajectory image, the initial extraction function is constructed based on the initial transformation function, and the initial reconstruction function is constructed based on the initial extraction function;
[0080] Based on the image transformation category, the trajectory image and the reconstruction function, a reconstruction loss function is constructed;
[0081] Based on the load sample set, the pre-training model is subjected to self-supervised training according to the reconstruction loss function to obtain an optimized transformation function, an optimized extraction function and an optimized reconstruction function;
[0082] Based on the load sample set, at least one image transformation operation is performed on each trajectory image according to the optimized transformation function to obtain an intermediate image set, the intermediate image set includes at least one intermediate image, and the trajectory image is subjected to image transformation operation according to the optimized transformation function to obtain the intermediate image;
[0083] The feature vector of each intermediate image is extracted according to the optimized extraction function;
[0084] The feature vector is subjected to reconstruction operation according to the optimized reconstruction function to obtain a reconstructed image;
[0085] A set of reconstructed images is obtained according to the reconstructed images.
[0086] This stage is a supervised pre-training stage, and the discriminative and generalization representation of the load is learned through image transformation operation and reconstruction operation, so as to enhance the detection ability of the pre-training model or the final detection model to the unseen load;
[0087] Taking the trajectory feature as the V-I trajectory feature and the trajectory image as the V-I trajectory image as an example:
[0088] In the CAE structure, the input is the V-I trajectory image , , wherein is a real set, C represents the number of channels of the V-I trajectory image, which corresponds to the number of load categories, W represents the width of the V-I trajectory image, H represents the height of the V-I trajectory image;
[0089] First, the V-I trajectory image is subjected to at least one image transformation operation to obtain a set of intermediate images, , wherein is the intermediate image obtained by the V-I trajectory image through the first image transformation operation, t represents the serial number of the image transformation operation, represents the first image transformation operation;
[0090] Second, the feature vector of each intermediate image is extracted according to the optimization extraction function , , wherein represents the feature vector of the V-I trajectory image after the first image transformation operation, represents the optimization extraction function;
[0091] Then, the feature vector is subjected to a reconstruction operation according to the optimization reconstruction function to obtain a reconstructed image, , wherein represents the reconstructed image of the V-I trajectory image after the first image transformation operation, represents the optimization reconstruction function,
[0092] In order to enable the pre-training model to learn the strong generalization of the load essence feature of the image transformation operation, an inverse transformation reconstruction loss is designed in this embodiment, that is, the original untransformed V-I trajectory image is taken as the reconstruction target, and a reconstruction loss function is constructed:
[0093] ;
[0094] wherein, is a reconstruction loss function, M is a total number of image transformation categories.
[0095] In some embodiments, the pre-training model comprises an input transformation module, an encoder module and a decoder module;
[0096] The input transformation module is configured to construct an initial transformation function, and to obtain a set of intermediate images by performing at least one image transformation operation on each trajectory image according to the optimized transformation function based on the load sample set; the function of the input transformation module is to perform a plurality of image transformation operations such as rotation on the V-I trajectory images of the load sample to generate transformed images, i.e., intermediate images, to provide diversified inputs for self-supervised pre-training and help the pre-training model learn load features that are invariant to transformation;
[0097] The encoder module is configured to construct an initial extraction function, and to extract a feature vector of each intermediate image according to the optimized extraction function; the function of the encoder module is to extract feature vectors of the transformed images in the pre-training stage, to retain the pre-training parameters in the fine-tuning stage, and to continue to output load feature representations to provide key feature support for the reconstruction of the decoder module, the classification of the classifier module, and the non-intrusive detection of abnormal energy-using loads;
[0098] The decoder module is configured to construct an initial reconstruction function, and to perform a reconstruction operation on the feature vector according to the optimized reconstruction function to obtain a reconstructed image. The function of the decoder module is to receive the feature vector output by the encoder module in the pre-training stage, to reconstruct the feature vector into the original untransformed V-I trajectory image, to minimize the reconstruction error, and to assist the encoder module to learn more robust and discriminative load essential features.
[0099] In some embodiments, the step of obtaining an anomaly score is:
[0100] calculating a cluster center of a load category corresponding to the abnormal energy-using load in a feature space;
[0101] calculating, according to the cluster center and the feature vector, an Euclidean distance from the abnormal energy-using load to each cluster center;
[0102] obtaining an anomaly score of the abnormal energy-using load according to the minimum value of the Euclidean distances, wherein the anomaly score is:
[0103] ;
[0104] wherein, is the anomaly score of is a minimization function, is a feature vector, is a feature center of the th load class, is a load class index, is a load class set.
[0105] In some embodiments, the non-intrusive detection of the abnormal energy consumption load based on the anomaly score and using the detection model comprises:
[0106] setting an anomaly threshold;
[0107] when the anomaly score is not greater than the anomaly threshold, obtaining the load class of the abnormal energy consumption load according to the cluster center corresponding to the minimum value of the Euclidean distance:
[0108]
[0109] wherein, is the load class, is the anomaly threshold, min represents the load class that makes the anomaly score minimum.
[0110] In some embodiments, setting the anomaly threshold comprises:
[0111] obtaining the anomaly score of each load sample in the load sample set;
[0112] obtaining an anomaly score set according to the anomaly score;
[0113] obtaining the anomaly threshold according to the anomaly score set selected by the q th percentile, q is a hyperparameter for controlling the rejection sensitivity, that is:
[0114]
[0115] wherein, represents the q th percentile, which is usually q set to 95, is the th load sample.
[0116] In some embodiments, the pre-trained model further comprises a classifier module, which is used for non-intrusive detection of the abnormal energy consumption load based on the anomaly score. The classifier module only plays a role in the fine-tuning stage, and uses the load class labels of known load samples to realize accurate classification of known loads and improve the classification ability of the detection model by cross-entropy loss optimization through a classification loss function based on the feature vectors output by the encoder module.
[0117] In some embodiments, the extracting of the trajectory feature of each load sample based on the load sample set comprises:
[0118] Based on the non-intrusive load monitoring framework, the voltage and current waveforms of the load sample are extracted by using the load switching event.
[0119] The V-I trajectory feature is extracted according to the voltage and current waveforms.
[0120] In the NILM framework, the voltage and current waveforms of the load can be extracted by using the changes of the front-end and back-end voltage and total current before and after the load switching event, and then the load feature is extracted, the load feature in the embodiment is the V-I trajectory feature, and the classifier is trained to identify the load. The extraction process of the event load voltage and the event load current is as follows:
[0121]
[0122]
[0123] In the formula, is the voltage waveform of the event load, is the back-end voltage waveform after the load state change, is the front-end voltage waveform before the load state change, is the current waveform of the event load, is the total current waveform after the load state change, is the total current waveform before the load state change;
[0124] The V-I trajectory feature of the load sample can be extracted according to the voltage and current waveforms of the event load. The V-I trajectory feature of the load sample can be regarded as a delta form of the load feature, which utilizes the difference between two consecutive snapshots and satisfies the feature additive criterion.
[0125] In view of the label space heterogeneity problem in the training data and the test data in the NILM task, the non-intrusive load detection method based on the self-supervised conditional autoencoder proposed in the embodiment of the application realizes effective distinction of different categories in the load feature space through two-stage training. The training process includes two core steps:
[0126] (1) The pre-training stage uses the conditional autoencoder to perform self-supervised modeling on the V-I trajectory images of all load samples, and learns a general load representation with transformation invariance.
[0127] (2) The fine-tuning stage introduces a classification loss function and a learning loss function to supervise and optimize the detection model, further enhances the discrimination ability of the known load, and constructs a feature boundary that is helpful for distinguishing the load.
[0128] A two-stage training self-supervised conditional autoencoder-based non-intrusive load detection method as shown in Figure 2 Figure 2 Decoder represents a decoder module, encoder represents an encoder module, and classifier represents a classifier module.
[0129] To comprehensively evaluate the performance of the detection model proposed in the present application in known load identification and load detection tasks, the F1 score (F1-Score) is used as one of the main evaluation indicators in the embodiments of the present application. The F1 score is the harmonic mean of precision (Precision) and recall (Recall), which can comprehensively reflect the accuracy and coverage ability of the detection model in positive class identification, and is especially suitable for scenarios with uneven sample distribution or containing categories.
[0130] In the experiment, the F1 score is calculated for known categories and misidentified loads respectively, and the average value is taken as the overall performance measure. The calculation formula is as follows:
[0131]
[0132]
[0133]
[0134] In the formula, is the number of correctly classified or correctly rejected samples, is the number of misclassified or misrejected samples, is the number of missed positive samples; represents how many of the predicted positive classes are true positive classes, represents how many of the actual positive classes are correctly identified; To evaluate the effectiveness of the present application in non-intrusive monitoring of abnormal energy consumption loads, two public high-frequency watt-hour meter current and voltage signal datasets were used to test the proposed model: PLAID released in 2017. The PLAID dataset contains short-circuit current and voltage measurement data of different household loads in Pittsburgh, Pennsylvania, USA. The dataset released in 2017 contains measurement data of more than 82 different load instances, representing 11 load categories of 9 households, and 1793 records collected at a sampling rate of 30 kHz.
[0135] To evaluate the effectiveness of the present application in non-intrusive monitoring of abnormal energy consumption loads, two public high-frequency watt-hour meter current and voltage signal datasets were used to test the proposed model: PLAID released in 2017. The PLAID dataset contains short-circuit current and voltage measurement data of different household loads in Pittsburgh, Pennsylvania, USA. The dataset released in 2017 contains measurement data of more than 82 different load instances, representing 11 load categories of 9 households, and 1793 records collected at a sampling rate of 30 kHz.
[0136] On the PLAID dataset, air conditioner, heater, microwave, vacuum cleaner, washing machine are selected as the load respectively. Under the experimental setting that the five kinds of loads (air conditioner, heater, microwave, vacuum cleaner, washing machine) are sequentially taken as the load category, the application achieves high and known load identification effect in various test scenarios, and the experimental results are shown in Table 1.
[0137] Table 1 F1 score of unknown device detection of the method proposed in the application on the PLAID dataset
[0138]
[0139] The experimental results on the multiple public datasets show that the method proposed in the application is superior to the existing mainstream methods in terms of classification accuracy and load detection performance, and has good generalization ability and practical application potential.
[0140] Finally, it should be noted that the above content is only used to illustrate the technical solutions of the application, and is not a limitation on the protection scope of the application. Simple modifications or equivalent replacements of the technical solutions of the application made by those skilled in the art do not deviate from the essence and scope of the technical solutions of the application.
Claims
1. A non-intrusive load detection method based on a self-supervised conditional autoencoder, characterized in that, include: A non-intrusive load sample set for obtaining abnormal energy consumption loads based on the power system, wherein the load sample set includes at least one load sample; A load category set is preset for the load sample set, and the load category set includes at least one load category; Based on the load sample set, the trajectory features and trajectory images of each load sample are extracted respectively; Based on the load sample set, a classifier is trained according to the trajectory features and load identification is performed. Based on the load sample set, the pre-trained model is self-supervised to obtain the reconstructed image set according to the trajectory image and the reconstruction loss function; The pre-trained model is optimized and trained based on the load category set, the reconstructed image set, and the overall loss function to obtain the detection model. Based on the anomaly score, the aforementioned detection model is used to perform non-invasive detection of the abnormal energy load; The overall loss function is constructed based on the classification loss function and the learning loss function; The classification loss function is constructed using cross-entropy loss based on the load category set and the reconstructed image set; The learning loss function is constructed using a modified linear operation based on the load category set and the reconstructed image set; The pre-trained model includes an input conversion module, an encoder module, and a decoder module; The input conversion module is used to construct an initial transformation function, and to perform at least one image transformation operation on each trajectory image based on the load sample set and the optimized transformation function to obtain an intermediate image set; The encoder module is used to construct an initial extraction function and to extract feature vectors for each intermediate image according to the optimized extraction function; The decoder module is used to construct an initial reconstruction function and to perform a reconstruction operation on the feature vector according to the optimized reconstruction function to obtain a reconstructed image; The steps to obtain the anomaly score are as follows: Calculate the cluster center of the load category corresponding to the abnormal energy load in the feature space; Calculate the Euclidean distance from the abnormal energy load to each cluster center based on the cluster centers and the feature vectors; The abnormal score of the abnormal energy load is obtained by taking the minimum value of the Euclidean distance.
2. The non-intrusive load detection method based on a self-supervised conditional autoencoder according to claim 1, characterized in that, Based on the load sample set, and using the trajectory image and reconstruction loss function, the pre-trained model is self-supervised to obtain the reconstructed image set: Preset image transformation categories; In the pre-trained model, an initial transformation function, an initial extraction function, and an initial reconstruction function are constructed respectively. The initial transformation function is constructed based on the trajectory image, the initial extraction function is constructed based on the initial transformation function, and the initial reconstruction function is constructed based on the initial extraction function. The reconstruction loss function is constructed based on the image transformation category, the trajectory image, and the reconstruction function. Based on the load sample set, the pre-trained model is self-supervised to obtain the optimized transformation function, optimized extraction function and optimized reconstruction function according to the reconstruction loss function; Based on the load sample set, at least one image transformation operation is performed on each trajectory image according to the optimized transformation function to obtain an intermediate image set, the intermediate image set including at least one intermediate image, the trajectory image is obtained by performing the image transformation operation according to the optimized transformation function to obtain the intermediate image; The feature vector of each intermediate image is extracted according to the optimized extraction function; The reconstructed image is obtained by performing a reconstruction operation on the feature vector according to the optimized reconstruction function; The reconstructed image set is obtained based on the reconstructed image.
3. The non-invasive load detection method based on a self-supervised conditional autoencoder according to claim 2, characterized in that, The image transformation operation includes at least a rotation operation.
4. The non-intrusive load detection method based on a self-supervised conditional autoencoder according to claim 1, characterized in that, The non-invasive detection of abnormal energy loads based on anomaly scores and using the aforementioned detection model includes: Set an abnormal threshold; When the anomaly score is not greater than the anomaly threshold, the load category of the abnormal energy load is obtained according to the cluster center corresponding to the minimum value of the Euclidean distance.
5. The non-invasive load detection method based on a self-supervised conditional autoencoder according to claim 4, characterized in that, Setting the abnormal threshold includes: Obtain the anomaly score for each load sample in the load sample set; An abnormal score set is obtained based on the abnormal scores; Select the first one based on the abnormal score set. q The percentile is used to obtain the abnormal threshold. q Hyperparameters for controlling rejection sensitivity.
6. The non-invasive load detection method based on a self-supervised conditional autoencoder according to claim 4, characterized in that, The pre-trained model also includes a classifier module, which is used to perform non-invasive detection of the abnormal energy load based on the anomaly score.
7. The non-intrusive load detection method based on a self-supervised conditional autoencoder according to any one of claims 1-6, characterized in that, The trajectory feature is a VI trajectory feature, and the trajectory image is a VI trajectory image.
8. The non-invasive load detection method based on a self-supervised conditional autoencoder according to claim 7, characterized in that, The trajectory features extracted for each load sample based on the load sample set include: Based on a non-intrusive load monitoring framework, the voltage and current waveforms of the load samples are extracted using load switching events; The VI trajectory features are extracted based on the voltage and current waveforms.
Citation Information
Patent Citations
Few-label NILM method based on time sequence power data enhancement and comparative learning
CN118798266A
Non-intrusive load identification method and system based on hybrid supervised learning
CN119006955A