Non-intrusive load detection method and system based on multi-state power consumption and machine learning
By extracting appliance-level power consumption patterns from aggregated household power consumption data using the NILM model and machine learning methods, and combining a dual-network architecture and feature fusion, the problem of incomplete information and high false alarm rate in traditional power theft detection is solved, achieving higher accuracy and robustness in power theft detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional methods for detecting electricity theft rely on single-source data, resulting in incomplete information, high false alarm rates, and poor generalization ability. Furthermore, multi-source data fusion is difficult to apply efficiently in AMI scenarios and cannot accurately reflect users' actual electricity consumption behavior.
The non-intrusive load monitoring model NILM extracts appliance-level power consumption patterns from aggregated household power consumption data. It combines a dual-network architecture with a machine learning model for feature extraction and fusion, and uses a binary cross-entropy loss and gradient optimization algorithm to train the detection model, thereby achieving non-intrusive acquisition and anomaly detection of appliance-level power consumption data.
It improves the accuracy and robustness of electricity theft detection, reduces the false alarm rate, enhances the adaptability and generalization ability of the model, and can more accurately identify the normal power consumption patterns of electrical appliances, reducing abnormal misjudgments.
Smart Images

Figure CN121434698B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent power grids combined with artificial intelligence large models, and in particular to a non-intrusive load detection method and system based on multi-state power consumption and machine learning. BACKGROUND
[0002] Advanced Metering Infrastructure (AMI) is an important part of the smart grid, which provides key support for efficient management of energy by realizing two-way communication between power companies and users. However, the digital features of AMI also make it a potential target for cyber attacks, among which electricity theft is particularly prominent. According to statistics, the economic loss caused by electricity theft worldwide increased from 96 billion US dollars in 2017 to 1012 billion US dollars in 2021. Effective detection and defense of electricity theft behavior has become an important issue to ensure the safe and stable operation of the smart grid.
[0003] Traditional electricity theft detection methods mainly include two categories: one is a detection method based on fixed rules or thresholds, which relies on expert experience and statistical rules to judge abnormal electricity consumption behavior; the other is a model based on machine learning, which trains aggregated electricity consumption data to identify potential electricity theft patterns. However, these two methods generally have poor adaptability and high false positive rates. To make up for the shortcomings of a single data source, researchers have begun to try multi-source data fusion, introducing auxiliary information such as temperature, water or gas consumption into the detection model to improve the accuracy of judgment.
[0004] Although multi-source fusion provides a new way for electricity theft detection, the correlation between these auxiliary data and electricity usage is weak, making it difficult to accurately reflect the user's real electricity consumption behavior. SUMMARY
[0005] To solve the technical problems in traditional non-intrusive load anomaly (such as electricity theft) detection, such as relying on single-source data leading to one-sided information, high false positive rate, poor generalization ability, high cost of directly obtaining appliance-level data, and difficulty in efficient application of NILM technology and multi-source data fusion in the AMI scenario to improve detection accuracy, the present application provides a non-intrusive load detection method and system based on multi-state power consumption and machine learning. By extracting appliance-level electricity consumption patterns from aggregated metering data and fusing them with total household load data based on a dual network architecture, the false classification bias is reduced, and the user's electricity consumption behavior is characterized in more detail.
[0006] In a first aspect, the present application provides a non-intrusive load detection method based on multi-state power consumption and machine learning:
[0007] S1, obtain the household aggregate power consumption data of the target user, the household aggregate power consumption data representing the total power consumption of the household, decompose the household aggregate power consumption data by a non-intrusive load monitoring model (NILM), identify the unique power consumption waveform features of various types of electrical appliances contained in the aggregate power consumption data, and infer the single-appliance power consumption data corresponding to the various types of electrical appliances;
[0008] S2, respectively pre-process the household aggregate power consumption data and the single-appliance power consumption data to obtain a pre-processed aggregate power consumption sequence and an appliance power consumption matrix;
[0009] S3, load a pre-set machine learning detection model, the machine learning detection model including an aggregate power consumption feature extractor, an appliance power consumption feature extractor, and a feature classifier;
[0010] S4, input the pre-processed aggregate power consumption sequence into the aggregate power consumption feature extractor to extract overall aggregate features, input the appliance power consumption matrix into the appliance power consumption feature extractor to extract appliance local features, and perform feature fusion on the overall aggregate features and the appliance local features to obtain fusion features;
[0011] S5, input the fusion features into the feature classifier, and output a classification result of whether the load of the target user is abnormal by the feature classifier;
[0012] S6, calculate the loss value of the classification result and the true label using a binary cross-entropy loss function, iteratively update the parameters of the machine learning detection model by a gradient optimization algorithm, and determine whether to terminate the training according to a pre-set training termination condition to obtain a trained machine learning detection model;
[0013] S7, use the trained machine learning detection model to perform steps S2-S5 on real-time household aggregate power consumption data and corresponding single-appliance power consumption data of the target user to realize non-intrusive load detection.
[0014] By using the above technical solution, the appliance-level power consumption data is obtained non-intrusively by the NILM model, avoiding the high cost problem of installing sensors for each electrical appliance. The dual-feature extractor and feature fusion architecture are used to capture global power consumption trends and device-level fine-grained features, solving the defect of the traditional single-source data detection information being one-sided. The binary cross-entropy loss and gradient optimization are combined for model training to realize end-to-end load anomaly detection, which not only improves the recognition accuracy of abnormal behaviors such as electricity theft, but also ensures the robustness and generalization ability of the model through training optimization, effectively solving the problems of high false alarm rate and poor adaptability of traditional methods.
[0015] Optionally, in step S1, the various types of electrical appliances include constant-type electrical appliances, switch-type electrical appliances, and multi-state-type electrical appliances.
[0016] The characteristic power consumption waveform feature of the constant-type electric appliance is that the power consumption remains stable within a preset time and the fluctuation amplitude is less than a first threshold value;
[0017] The characteristic power consumption waveform feature of the switch-type electric appliance is that the power consumption alternates between a fixed power consumption value in an on state and a zero value in an off state;
[0018] The characteristic power consumption waveform feature of the multi-state-type electric appliance is that the power consumption operates in multiple discrete states and has a periodic variation rule.
[0019] By adopting the above technical solutions, the normal power consumption rules of different types of electric appliances can be identified by the load detection device by clearly defining the characteristic power consumption waveform features of constant-type, switch-type and multi-state-type electric appliances, avoiding abnormal misjudgments caused by differences in electric appliance operation characteristics. At the same time, based on the characteristic deviation, the preliminary judgment of abnormality is made, the suspicious power consumption data is screened in advance, and the invalid data amount of subsequent model operation is reduced, which not only improves the accuracy of preliminary abnormality identification, but also lays a foundation for subsequent detailed detection, and enhances the adaptability to diversified electric appliance load abnormalities.
[0020] Optionally, in step S2, the pre-processing of the household aggregated power consumption data and the single electric appliance power consumption data respectively includes:
[0021] The household aggregated power consumption data is subjected to mean resampling processing of a fixed time window, and the resampled power consumption sequence is subjected to normalization processing to obtain the pre-processed aggregated power consumption sequence;
[0022] The single electric appliance power consumption data is subjected to mean resampling processing of a fixed time window, and the resampled power consumption sequence is subjected to normalization processing, and the normalized power consumption sequences of various types of electric appliances are aligned and merged according to time steps to obtain the electric appliance power consumption matrix.
[0023] Optionally, in step S2, the normalization processing includes:
[0024] The normalized power consumption value is calculated according to the following formula:
[0025]
[0026] wherein x is the power consumption data before normalization, is the average value of the power consumption data, and σ is the standard deviation of the power consumption data;
[0027] The dimension of the electric appliance power consumption matrix is time step number x electric appliance number:
[0028]
[0029] wherein, Electric appliance In Power consumption at a moment.
[0030] By adopting the technical scheme, the normalization processing eliminates the dimensional difference of different power consumption data through a fixed formula, avoids the model training from being biased to high power consumption data due to the large difference in data magnitude, and improves the stability and convergence speed of model training; the electric appliance power consumption matrix organizes data in a time step x electric appliance quantity structure, so that the power consumption information of "a certain time step-a certain electric appliance" can be accurately located for subsequent feature extraction, data confusion is avoided, the data processing efficiency is improved, and the integrity of time and equipment dimension information during feature extraction is ensured, thereby providing a data basis for accurate feature extraction.
[0031] Optionally, in step S3, the aggregated power consumption feature extractor adopts a convolutional long short-term memory network (ConvLSTM) or a convolutional autoencoder (CAE) to capture global time sequence features of the aggregated power consumption sequence, and obtain the overall aggregated features.
[0032] The electric appliance power consumption feature extractor adopts a convolutional neural network (CNN) to extract fine-grained features at the equipment level in the electric appliance power consumption matrix, and obtain the electric appliance local features.
[0033] The feature classifier adopts a fully connected neural network layer (FC), a support vector machine (SVM), or a random forest (RF) to perform a binary classification task of whether the load is abnormal, and obtain a classification result.
[0034] Optionally, in step S4, the overall aggregated features and the electric appliance local features are fused to obtain the fusion features, including:
[0035] The overall aggregated features and the electric appliance local features are spliced in dimensions to obtain the fusion features, and the splicing formula is:
[0036]
[0037] Among them, the fusion features, the overall aggregated features, and the electric appliance local features.
[0038] Optionally, in step S6, the gradient optimization algorithm includes a stochastic gradient descent method (SGD) or an adaptive momentum estimation algorithm (Adam).
[0039] The training termination condition includes at least one of the following:
[0040] The performance indicators of the validation set do not improve for a continuous preset number of rounds, the change amplitude of the training loss value in a continuous preset number of rounds is lower than a second threshold value, or the number of model training iterations reaches a preset maximum number of rounds.
[0041] When the performance indicators of the verification set do not improve for a preset number of rounds in succession, the load detection device triggers an early stop mechanism, and rolls back to the model parameters at the time when the performance of the verification set is optimal.
[0042] By adopting the technical solution described above, the SGD / Adam gradient optimization algorithm can efficiently iteratively update the model parameters, ensuring that the model quickly converges to an optimal state; the multi-dimensional training termination condition (early stopping, loss stabilization, and maximum number of rounds) can address the training pain points in a targeted manner: the early stopping mechanism avoids model overfitting, loss stabilization and maximum number of rounds limit prevent training redundancy, which not only ensures the generalization ability of the model after training, but also balances the training performance and computational efficiency, reduces the consumption of invalid computing power, and at the same time, the parameter rollback mechanism further ensures the optimal performance of the model, reducing the false positive rate and false negative rate of subsequent detection.
[0043] Optionally, step S6 further includes model testing: inputting test set data that has no intersection with the training set into the trained machine learning detection model to obtain test classification results.
[0044] The test classification results are evaluated by a preset evaluation indicator, and the preset evaluation indicator includes the area under the receiver operating characteristic curve (AUC), F1 score, recall rate (Recall), precision rate (Precision), and false positive rate (FPR).
[0045] By adopting the technical solution described above, the non-intersection test set ensures that the evaluation results can truly reflect the generalization ability of the model, avoiding performance misjudgment due to data overlap; the AUC, F1 score, and other multi-indexes comprehensively measure the model performance from the overall discrimination ability, precision and recall balance, and false positive rate dimensions, solving the problem of incomplete evaluation by a single indicator, and accurately determining whether the model meets the actual application requirements.
[0046] In a second aspect, the present application provides a non-invasive load detection system based on multi-state power consumption and machine learning; the system includes various modules for executing the method in the first aspect or any possible implementation manner of the first aspect:
[0047] The system includes:
[0048] A power consumption data acquisition module is configured to acquire household aggregate power consumption data of a target user (from an AMI smart meter without the need for additional sensors), wherein the household aggregate power consumption data represents the overall power consumption of the household, and the household aggregate power consumption data is decomposed by a non-invasive load monitoring model (NILM) to identify the unique power consumption waveform characteristics of various types of electrical appliances included in the aggregate power consumption data, and to infer the single-appliance power consumption data corresponding to the various types of electrical appliances.
[0049] a preprocessing module, configured to preprocess the household aggregate power consumption data and the single-appliance power consumption data respectively to obtain a preprocessed aggregate power consumption sequence and an appliance power consumption matrix;
[0050] a loading module, configured to load a preset machine learning detection model, the machine learning detection model comprising an aggregate power consumption feature extractor, an appliance power consumption feature extractor, and a feature classifier;
[0051] a feature extraction module, configured to input the preprocessed aggregate power consumption sequence into the aggregate power consumption feature extractor to extract overall aggregate features, and input the appliance power consumption matrix into the appliance power consumption feature extractor to extract appliance local features;
[0052] a feature fusion module, configured to perform feature fusion on the overall aggregate features and the appliance local features to obtain fused features;
[0053] a classification and identification module, configured to input the fused features into the feature classifier, and output a classification result of whether a load of a target user is abnormal through the feature classifier;
[0054] a model training module, configured to calculate a loss value of the classification result and a true label by using a binary cross-entropy loss function, iteratively update parameters of the machine learning detection model through a gradient optimization algorithm, and determine whether to terminate training according to a preset training termination condition to obtain a trained machine learning detection model;
[0055] a load detection module, configured to perform steps S2-S5 on real-time household aggregate power consumption data and corresponding single-appliance power consumption data of a target user by using the trained machine learning detection model, to implement non-intrusive load detection.
[0056] In a third aspect, a computer device is provided, comprising a processor, a memory, and a communication bus configured to realize communication connection between the processor and the memory, and the processor is configured to execute a computer program stored in the memory to implement the method according to any one of the preceding aspects.
[0057] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program; the computer program can be executed by a processor to implement the method according to any one of the preceding aspects.
[0058] In a fifth aspect, a computer program product is provided, comprising a computer program, which can be executed by a processor to implement the method according to any one of the preceding aspects.
[0059] The present application has at least the following beneficial technical effects:
[0060] By receiving the aggregated power consumption sequence and the appliance power consumption matrix as inputs, the overall household power consumption information and the single device level features are organically integrated, thereby achieving more comprehensive modeling and analysis of user power consumption behavior, and significantly enhancing the identification ability of abnormal behavior such as electricity stealing. In terms of model structure, the dual-encoder architecture composed of the aggregated power consumption feature extractor and the appliance power consumption feature extractor can not only depict the user's power consumption features at the global and local levels, but also provide a semantically complementary representation space for subsequent feature fusion and anomaly detection. This hierarchical feature modeling method effectively improves the detection accuracy and robustness of the model in complex scenarios. Through further feature fusion and classification mechanism, the system can comprehensively determine the user's power consumption behavior in the multi-level feature space, realize joint analysis from the macro trend to the micro device level, and significantly improve the accuracy, stability and generalization performance of electricity stealing detection. BRIEF DESCRIPTION OF DRAWINGS
[0061] Figure 1 A non-intrusive load detection system architecture schematic diagram is provided for the embodiments of the present application.
[0062] Figure 2 A non-intrusive load detection method flowchart schematic diagram is provided for the embodiments of the present application.
[0063] Figure 3 A non-intrusive load detection system structure schematic diagram is provided for the embodiments of the present application.
[0064] Figure 4 Another non-intrusive load detection system structure schematic diagram is provided for the embodiments of the present application.
[0065] Figure 5 A computer device structure schematic diagram is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0066] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0067] The terminology used in the following description of the embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the embodiments and the appended claims herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It also will be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "exemplary" is used herein to mean "serving as an example, instance, or illustration," any embodiment described as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The term "first," "second," and the like, merely denote different categorizations and does not imply a sequence or order unless clearly indicated by the context. Thus, features referred to as "first," "second," etc., can implicitly include one or more of the other features, unless otherwise clear from the context. The term "plurality" as used herein means two or more.
[0068] The application provides a non-intrusive load detection method and system based on multi-state power consumption and machine learning. The core goal is to integrate household total power consumption features and appliance-level features, more comprehensively model and analyze user power consumption behavior, and thus realize more fine-grained electricity stealing behavior detection, and improve the security of AMI in a more economical way.
[0069] Figure 1 For the system architecture of the method of the application, as shown in the figure, the application individually trains a dedicated machine learning detection model for the power consumption features of each user. Each detection model includes two feature extractors and a feature classifier. One of the feature extractors takes the user's household total power consumption as input, generates overall aggregated features reflecting global power consumption rules and time sequence dependencies through time sequence modeling and feature extraction mechanism. The other feature extractor extracts features from single-appliance fine-grained power consumption data to obtain device-level local features of the electric appliance. After the global and local features generated by the feature extractors are fused, they are input to the feature classifier for load anomaly detection, i.e., to determine whether the current user behavior belongs to the "electricity stealing" or "non-electricity stealing" category. Through the above multi-level feature coding and supervised optimization, the model can not only learn the macro user power consumption behavior pattern, but also accurately identify device-level anomalies at the micro level, realizing high-precision detection of complex electricity stealing behaviors.
[0070] Reference Figure 2 A non-intrusive load detection method based on multi-state power consumption and machine learning mainly includes the following steps:
[0071] S1: Obtain the household aggregate power consumption data of the target user (collected and recorded by the household smart meter in real time), which represents the total power consumption of the household, i.e., at any sampling time, the household aggregate power consumption value is equal to the sum of the power values of each running appliance. The household aggregate power consumption data is decomposed by the non-intrusive load monitoring model (NILM) to identify the unique power consumption waveform features of various types of appliances contained in the aggregate power consumption data, and to infer the single-appliance power consumption data corresponding to various types of appliances.
[0072] The household aggregate power consumption data of the target user is obtained, and the non-intrusive load monitoring model (NILM) is used to decompose the household aggregate power consumption data to identify the unique power consumption waveform features of various types of appliances contained in the aggregate power consumption data, thereby directly inferring the single-appliance power consumption data corresponding to various types of appliances. This makes it possible to decompose and analyze the aggregate power consumption data without the need to install independent sensors for each appliance, thereby obtaining the power consumption sequence at the appliance level. The core idea is to identify the unique power consumption waveform features (such as startup current spikes, steady-state power levels, and working period characteristics) of each appliance in the aggregate power consumption signal, and to infer the running state and power consumption of each appliance at different time periods. Through this process, the system can obtain the original power consumption sequence corresponding to multiple appliances:
[0073] (1)
[0074] wherein represents the appliance
[0075] In this embodiment, the non-intrusive load monitoring model (NILM) is mainly used to decompose the various types of single-appliance power consumption data contained in the household aggregate power consumption data, which can be used to provide input data (appliance power matrix) for subsequent machine learning detection models, thereby achieving more accurate load detection.
[0076] In this embodiment, the power waveform feature library of various appliances needs to be constructed for the non-intrusive load monitoring model (NILM). The running process of different types of appliances will produce unique and distinguishable power waveform features (such as significant differences in startup current spikes, steady-state power levels, and working periods of different appliances), and the model first establishes the feature library through offline learning:
[0077] The unique power consumption waveform feature of the constant-type electrical appliance is that the power consumption remains stable within a preset time and the fluctuation amplitude is less than a first threshold value; the first threshold value can be flexibly set according to the fluctuation range of the electrical appliance function. For example, the power waveform feature of a refrigerator on standby or a router is a low fluctuation steady state segment (fluctuation amplitude < 5%) accompanied by a periodic start-stop process. Taking a refrigerator as an example, there is a power spike when the compressor starts, the spike power is about 100-150W, and the duration is usually short (a few hundred milliseconds to a few seconds), and then enters the steady state running stage, the steady state power is about 30-50W.
[0078] The power waveform feature of the switch-type electrical appliance (such as a microwave oven or an electric rice cooker) mainly shows that the power consumption alternates between an on state and an off state. The on state includes a startup transient process and a subsequent steady state working stage: the startup stage is usually accompanied by a power mutation with a very short duration (< 10ms), and then enters a steady state segment with a basically fixed power, for example, the steady state power of a microwave oven during heating is 1000-1200W; in the off state, the power quickly drops to 0W.
[0079] The power waveform feature of the multi-state type electrical appliance (such as a washing machine or an air conditioner) is a multi-segment steady state and a switching transition segment (such as an air conditioner with a refrigeration steady state of 1200W and a blowing steady state of 200W, and a power transition zone of 0.5-1s during switching).
[0080] Then, feature matching and separation processing are performed based on the household aggregate power consumption data. The household aggregate power consumption data is obtained by real-time acquisition by a household smart meter, and is used to record the total power consumption of the household at each sampling time, directly representing the total power consumption level of the household. The non-intrusive load monitoring model analyzes the household aggregate power consumption data by segmenting through a sliding time window, and the window length is set according to the maximum startup duration of the electrical appliance, for example, 200ms. For the power signal in each time window, the corresponding time domain features and frequency domain features are extracted, the time domain features include peak value, mean value and variance, and the frequency domain features include fundamental frequency and harmonic amplitude. Then, the extracted features are matched with the pre-constructed electrical appliance power waveform feature library, so as to separate and identify the power consumption components of various electrical appliances in the household aggregate power consumption data.
[0081] In the feature matching process, corresponding discrimination rules and parameter ranges are pre-set for different types of electrical appliances. For example, when the household aggregate power consumption data in a certain time window simultaneously satisfies the following conditions, it is determined that a microwave oven is running in the time period: (1) the power signal shows a significant rise in a very short time, forming a transient power spike, and the spike power amplitude is greater than a pre-set threshold (e.g. 1000W); (2) after the spike, the power signal enters a steady state interval with a duration significantly longer than the start-up phase, and the steady state power value falls within the pre-set power range of the microwave oven (e.g. 1000-1200W); (3) the duration of the steady state interval matches the typical working time length characteristic of the microwave oven. By simultaneously satisfying multiple constraints of power amplitude, duration, and steady state interval characteristics, the microwave oven can be distinguished from other electrical appliances with different power levels or working modes (such as a pressure cooker).
[0082] After completing the microwave oven identification, the microwave oven power consumption component in the household aggregate power consumption data can be separated by power difference method. Specifically, in the time interval determined to be running the microwave oven, the steady state power value of the microwave oven is subtracted from the power value corresponding to the household aggregate power consumption data, thereby obtaining the remaining aggregate power consumption data after removing the microwave oven power consumption. The remaining aggregate power consumption data is used for subsequent identification and decomposition of electrical appliances.
[0083] Similarly, when the household aggregate power consumption data presents a periodic low fluctuation steady state with small amplitude start-stop power spikes, and the cycle length and steady state power range match the pre-set working cycle characteristics of the refrigerator, it is determined that the refrigerator is running in the corresponding time period. By time aligning the detected start-stop cycle and calculating the difference between the aggregate power consumption change in each cycle and the steady state power of the refrigerator, the power consumption sequence of the refrigerator can be separated cycle by cycle. Through the combined discrimination of cycle characteristics, power amplitude, and start-stop law, the refrigerator can be distinguished from electrical appliances with long-term constant power and no obvious start-stop cycle (such as a router).
[0084] After separating the power consumption sequence of a certain electrical appliance, the instantaneous power of the separated electrical appliance at each time is determined according to the power value of the power consumption sequence at the corresponding time window or sampling time. Then, the difference between the aggregate power consumption and the instantaneous power of the separated electrical appliance is calculated by taking the corresponding power value in the household aggregate power consumption data at the same time window or sampling time as the aggregate power consumption, and the residual signal is obtained. The steps of feature matching and separation are repeatedly performed on the residual signal until the power value of the residual signal is less than a pre-set threshold (e.g. 5W, representing the measurement noise level), and finally the independent power consumption sequences corresponding to all running electrical appliances are obtained, thereby realizing the inversion from household aggregate power consumption data to single electrical appliance power consumption data.
[0085] Optionally, a non-intrusive load monitoring model (NILM) is used to decompose the aforementioned acquired household aggregate power consumption data, so as to realize inversion from the household aggregate power consumption data to the single-appliance power consumption data. The NILM model comprises an input layer, a feature extraction layer and a decomposition output layer. The input layer comprises a time series data adaptation unit, configured to receive household aggregate power consumption time series data of a target user, the household aggregate power consumption time series data being household overall power consumption values obtained at continuous sampling time points, the sampling frequency being 1 Hz, the time step being T=120 s, and the corresponding input dimension being [B, T, 1], wherein B is the batch size. The input data is length-aligned by zero padding, so as to ensure that different samples can be input to the model in a unified format. The feature extraction layer is configured to extract power features related to the running states of different types of appliances from the household aggregate power consumption time series data, and specifically comprises two one-dimensional convolution layers, a ConvLSTM layer and a channel attention layer. The one-dimensional convolution layer (convolution kernel size 3x1, step 1) is configured to extract local power change features; the ConvLSTM layer (hidden layer dimension 64) is configured to model the periodicity and long-term dependence of the power signal in the time dimension; and the channel attention layer adopts a SENet structure, configured to enhance the significant features related to specific appliances and suppress irrelevant noise. The decomposition output layer is configured to map the features output by the feature extraction layer to the power consumption sequences of each appliance at the corresponding time step, and comprises two fully connected layers and an activation function, the number of neurons of the fully connected layers being 128 and N in sequence, wherein N is the total number of appliances in the target household. The output result is constrained by the activation function, and output data with a dimension of [B, T, N] is obtained, which represents the independent power consumption sequences of each appliance at the corresponding time step, thereby realizing decomposition of the household aggregate power consumption data.
[0086] Specifically, a public real data set REDD can be used, and a supplementary data set can also be built to train the model. A joint loss function of mean square error (MSE) and aggregate constraint loss can be used, and an Adam optimizer can be used, with an initial learning rate of 0.001, a learning rate decay strategy of “decrease to 1 / 10 if the validation set loss does not decrease for 3 rounds”, a batch size B of 32 (balance memory occupation and training stability) for training batches, and 100 iteration rounds. After training, two households of the REDD data set that do not participate in training are used as a test set to verify the decomposition accuracy, and the core indicators are as follows:
[0087] Appliance power decomposition error (MAE): refrigerator <5W, microwave oven <10W, washing machine <15W;
[0088] Appliance recognition accuracy: the recognition accuracy of 3 types of core appliances is >92% (to ensure that the decomposed appliance types are not confused);
[0089] The power matching degree of aggregation: the error between the total power of all appliances after decomposition and the real aggregated power is less than 3%.
[0090] The non-intrusive load monitoring model (NILM) after training receives the household aggregated power consumption data (from the AMI smart meter without additional sensors) and automatically outputs the independent power consumption sequences of N appliances.
[0091] Of course, in the optional embodiments of the present application, the existing known non-intrusive load monitoring model (NILM) can also be used to decompose the household aggregated power consumption data to obtain the single-appliance power consumption data corresponding to various types of appliances.
[0092] S2: The household aggregated power consumption data and the single-appliance power consumption data are respectively preprocessed to obtain the preprocessed aggregated power consumption sequence and the appliance power consumption matrix.
[0093] To ensure the applicability of the input data to the electricity theft detection task, the obtained data set needs to be preprocessed, specifically including two steps of resampling and normalization.
[0094] First, the original data set recorded at a high frequency (every few seconds) is resampled, that is, the mean value in a fixed time window is used for downsampling, thereby reducing the time resolution while retaining the main power consumption trend features.
[0095] Second, the resampled data set is normalized to improve the training efficiency and convergence. Specifically, each value The normalization operation is shown in formula (2).
[0096] (2)
[0097] Wherein and represent the mean and standard deviation, respectively.
[0098] On this basis, the normalized power consumption sequences of the N appliances are aligned and merged according to the time steps to construct the appliance power consumption matrix , which has the following form:
[0099] (3)
[0100] Wherein, the row represents the time step , the column represents the device, and the element represents the power consumption of the appliance .
[0101] After generating the aggregated power consumption sequence and the appliance power consumption matrix, the processed data is loaded through a sliding window mechanism, and corresponding batches are defined to enable efficient training of the machine learning detection model.
[0102] The machine learning detection model receives the aggregated power consumption data and the appliance power consumption data in the form of multi-source input in parallel, thereby capturing the user's power consumption behavior characteristics at both the global and fine-grained levels. Specifically, for each user , M is the total number of users, and the input includes the following two parts:
[0103] Aggregated power consumption sequence : represents the total power consumption of the household within a time period of length , reflecting the overall power consumption trend and its potential anomalies;
[0104] Appliance power consumption matrix : Appliance power consumption consumption matrix is used to describe the power consumption of each appliance at multiple time steps, and its overall form is a two-dimensional matrix of , where represents the number of time steps, represents the number of appliances. At any time step , the th row of the matrix can be represented as a -dimensional appliance power consumption vector , where represents the power consumption of the th appliance at time , , reflecting the power consumption behavior characteristics at the device level.
[0105] S3: Load a pre-set machine learning detection model, which includes an aggregated power consumption feature extractor, an appliance power consumption feature extractor, and a feature classifier.
[0106] This method trains a dedicated electricity theft detection model (i.e., machine learning detection model) for each user, and each model consists of three parts:
[0107] Aggregated power consumption feature extractor, used to extract global feature representation from total household power consumption to capture overall power consumption patterns and time dependence;
[0108] Appliance power consumption feature extractor, used to extract more fine-grained, specific device-level feature representation;
[0109] The feature classifier is used to perform the final classification judgment. The features output by the two feature extractors are fused and input into the feature classifier to realize the binary classification prediction of "electricity stealing / non-electricity stealing".
[0110] In this embodiment, the feature extractor can be implemented in various deep learning model structures, such as convolutional neural network, convolutional autoencoder or convolutional long short-term memory network, etc., for automatically extracting multi-level representation features from input data.
[0111] Specifically, different feature extractor structures are set for the differences in time scale and semantic level of different input data.
[0112] The aggregated power consumption feature extractor takes household aggregated power consumption time series data as input, which reflects the overall electricity consumption behavior after superimposing the power consumption of multiple appliances, and has obvious long-term trend and periodic characteristics. Therefore, the aggregated power consumption feature extractor is implemented by using a convolutional long short-term memory network (ConvLSTM) or a convolutional autoencoder (CAE), wherein the convolutional layer is used to extract local power change features within a short time window, and the long short-term memory unit or the encoding-decoding structure is used to model the long-term dependence relationship across time steps, thereby obtaining global feature representation reflecting the overall electricity consumption pattern of the household.
[0113] The appliance power consumption feature extractor takes the power consumption sequence of a single or multiple appliances as input, which has device-level granularity and exhibits obvious power amplitude difference, startup peak and working state switching characteristics. In view of the above characteristics, the appliance power consumption feature extractor adopts a convolutional neural network (CNN) structure, which extracts power waveform pattern features within a local time window through multi-layer one-dimensional convolution operation to characterize the distinguishability of different appliances in power features.
[0114] The feature classifier can be flexibly implemented by various machine learning models, including fully connected neural network layer (FC), support vector machine (SVM) or random forest (RF) etc.
[0115] The supervised training of the machine learning detection model combines the classification loss based on real labels and the joint embedding loss of feature alignment to improve the accuracy and robustness of detection in different electricity stealing scenarios.
[0116] Specifically, in the supervised training of the machine learning detection model, the classification loss based on the true label adopts binary cross-entropy loss (BCE), taking the true label of electricity stealing / non-electricity stealing (1 represents electricity stealing and 0 represents normal) as the benchmark, measuring the difference between the electricity stealing probability output by the model and the true label, and guiding the model to optimize the parameters to ensure the basic classification accuracy; the joint embedding loss of feature alignment is aimed at the overall aggregated features and the local features of the electrical appliances, and by calculating the feature embedding distance of the same samples (belonging to normal electricity or electricity stealing) and minimizing it, and calculating the feature embedding distance of different samples (normal electricity and electricity stealing) and maximizing it, the two types of electricity behaviors form a clear boundary in the feature space; the two are combined according to the preset weight (usually the classification loss weight is 0.7 and the joint embedding loss weight is 0.3, which is adjusted according to the performance of the verification set), which not only ensures that the model prediction conforms to the true label, but also enhances the adaptability of the features to different electricity stealing scenarios (such as single device bypassing the meter and multiple devices cooperating to steal electricity), reduces the false positives and false negatives caused by scene differences, and thus improves the detection accuracy and robustness.
[0117] S4: inputting the preprocessed aggregated power consumption sequence into an aggregated power consumption feature extractor to extract overall aggregated features; inputting the electrical appliance power consumption matrix into an electrical appliance power consumption feature extractor to extract electrical appliance local features; and performing feature fusion on the overall aggregated features and the electrical appliance local features to obtain fused features.
[0118] Specifically, the aggregated power consumption sequence is a one-dimensional time series signal sampled at a fixed time step, and the aggregated power consumption feature extractor processes the aggregated power consumption sequence in a sliding time window manner, extracts local power change features through a convolution layer, and integrates the features of multiple time windows through a time series modeling unit to output a global feature vector representing the overall electricity consumption mode of the family. The electrical appliance power consumption matrix is a two-dimensional data structure arranged by time steps, where each column corresponds to the power consumption time series of an electrical appliance. The electrical appliance power consumption feature extractor processes the electrical appliance power consumption matrix by electrical appliance dimension respectively or in parallel, extracts local power waveform features of each electrical appliance in the time dimension through one-dimensional convolution operation, and generates a feature representation representing the electrical appliance level fine-grained behavior mode through a feature aggregation operation. Both the overall aggregated features and the electrical appliance local features
[0119] are represented in the form of vectors or tensors, where the feature dimensions are determined by the network structure of the feature extractor. To fully model the differences and complementarities of aggregated power consumption data and electrical appliance power consumption data in the time scale and semantic level, the present application designs two independent feature encoders: an aggregated power consumption feature extractor and an electrical appliance power consumption feature extractor, which are respectively used to process the aggregated power consumption sequence , which is shown in equation (4):
[0120] (4)
[0121] wherein, represents the aggregated power consumption feature extractor, represents the appliance power consumption feature extractor, represents the global features extracted from the aggregated power consumption sequence , and represents the appliance-level fine-grained features extracted from the appliance power consumption matrix Y.
[0122] After completing the feature extraction, the system fuses the aggregated local features with the appliance local features, and the fusion mechanism can retain both global trends and local behavior patterns, providing more comprehensive feature representation for subsequent classification tasks to comprehensively utilize the information complementarity of the two types of features. The fusion method adopts feature-level splicing, which is specifically shown in equation 5:
[0123] (5)
[0124] It should be understood that the essence of dimension-by-dimension splicing is to directly combine dimension-by-dimension in order to form a complete high-dimensional feature vector containing global power consumption trend information and device-level fine-grained behavior information, thereby retaining the original information integrity of the two types of features and providing a more comprehensive basis for the subsequent classifier.
[0125] S5: input the fused features into the feature classifier, and output the classification result of whether the load of the target user is abnormal through the feature classifier.
[0126] The fused features obtained in S4 are input into the feature classifier for identification of electricity stealing behavior, and the specific classification process can be represented as:
[0127] (6)
[0128] wherein, is the intermediate score output by the feature classifier, represents the prediction result, and after normalization by the Sigmoid function, the probability that the current user belongs to the electricity stealing category is obtained, i.e., the size of the possibility of electricity stealing. The final determination of whether there is electricity stealing behavior is shown in equation 7:
[0129] (7)
[0130] wherein, =1 indicates that there is electricity stealing behavior at present, and there is not; the decision threshold can be flexibly set according to actual needs, for example .
[0131] S6: For the machine learning detection model, the binary cross-entropy loss function is used to calculate the loss value between its classification result and the true label. The parameters of the model are iteratively updated through the gradient optimization algorithm. The training is terminated according to the preset training termination condition to obtain the machine learning detection model that has been trained.
[0132] The training process uses the binary cross-entropy loss function to measure the difference between the model's predictions and the true labels. By minimizing this loss function, the model can continuously optimize its parameters, thereby improving classification performance and prediction accuracy. Its mathematical definition is shown in Equation 8:
[0133] (8)
[0134] in, Represents the total number of samples. The model predicts the first The probability that a sample belongs to the category of electricity theft. The corresponding true labels are 1 for electricity theft samples and 0 for normal samples. By minimizing this cross-entropy loss, the model is guided to increase the confidence of correctly classified samples and reduce the probability of incorrect predictions, thereby achieving a continuous improvement in overall classification performance.
[0135] Optionally, during training, the model parameters are updated iteratively by calculating gradients using the backpropagation algorithm and combining them with gradient optimization strategies (such as stochastic gradient descent (SGD) or the adaptive momentum estimation algorithm Adam). Backpropagation uses the chain rule to propagate the gradient of the loss to the model parameters layer by layer, enabling the network to adaptively adjust the weights to minimize the overall loss.
[0136] During model training, clear convergence and termination conditions were set to ensure that the network parameters could converge stably and to avoid overfitting.
[0137] If the performance metrics of the validation set do not improve for a preset number of consecutive training iterations, or if the change in the training loss value within a preset number of consecutive training iterations is lower than the second threshold (which can be flexibly set), or if the number of model training iterations reaches the preset maximum number of iterations, it indicates that the network parameters are stabilizing and training can be terminated early. It should be understood that the second threshold can be flexibly set according to the loss fluctuation range when it usually tends to stabilize, and the specific value is not limited in this embodiment.
[0138] If the validation set performance does not improve for consecutive rounds, an early stopping mechanism is triggered, and the model parameters with the best performance are automatically rolled back to prevent overfitting. In addition, to control the consumption of computing resources, the training process also sets an upper limit on the maximum number of iterations, and when this number is reached, the training is forcibly terminated and the optimal model is output. Through the above mechanisms, a balance between performance and computational efficiency is ensured, and the training process has good stability and controllability.
[0139] S7, using the trained machine learning detection model, performing steps S2-S5 on the real-time household aggregate power consumption data of the target user and the corresponding single-appliance power consumption data to realize non-intrusive load detection.
[0140] When it is necessary to perform abnormal monitoring on the electricity consumption of a certain user's household, the total household electricity consumption can be collected by a smart meter, input into the non-intrusive load monitoring model NILM, and decomposed to obtain single-appliance power consumption data corresponding to various types of appliances; after preprocessing the total household electricity consumption and the single-appliance power consumption data, the preprocessed aggregate power consumption sequence and the appliance power consumption matrix are obtained; the machine learning detection model is used to extract the overall aggregate features and appliance local features, and after fusion processing, the fusion features are obtained; the machine learning detection model feature classifier is used to output whether the load of the user is abnormal, thereby realizing automatic non-intrusive load detection.
[0141] In an optional embodiment of the present application, the machine learning detection model is also tested to ensure the generalization ability of the model. The trained model is loaded, the data of the test set is input into the model, the prediction result of the model is obtained, and the output label is compared with the real label. In the present embodiment, the following five indicators are used to evaluate the performance of the model:
[0142] AUC (Area Under Curve), which is the area under the receiver operating characteristic curve (ROC), is used to measure the overall discriminant ability of the model at different thresholds;
[0143] F1 score (F1 Score), which is the harmonic mean of precision and recall, is used to balance the precision and recall of the model;
[0144] FPR (False Positive Rate), which is the false positive rate, represents the proportion of normal users who are incorrectly identified as electricity stealing users;
[0145] Recall, also known as true positive rate, reflects the identification ability of the model for all electricity stealing samples;
[0146] Precision, the proportion of actual electricity stealing samples in the electricity stealing samples predicted by the model, is used to evaluate the reliability of the prediction results.
[0147] The scheme solves the problem of limited generalization ability and low accuracy of traditional electricity stealing detection methods, has broad application prospects, including but not limited to the following fields:
[0148] (1) Power system monitoring and protection: The scheme can be applied in smart grid and advanced metering infrastructure (AMI), and can identify abnormal behaviors such as electricity stealing, meter bypassing, and data falsification through real-time monitoring of user power consumption patterns and power consumption characteristics. The system can timely discover potential power loss and safety hazards, thereby improving the operation reliability and economic benefits of the power system.
[0149] (2) Device security and abnormal power consumption monitoring: By monitoring the load characteristics and power consumption curves of devices, the scheme can identify illegally accessed devices or tampered power terminals, and achieve security protection for home and enterprise electrical systems. At the same time, this method helps to discover that devices have been subjected to malicious attacks or unauthorized use, and improves the security of the overall network and devices.
[0150] (3) Industrial production and device maintenance: In the industrial field, the scheme can be used to monitor the running characteristics of various high-power devices (such as motors, conveying systems, sensors, etc.) on the production line, identify abnormal power consumption patterns, and assist in fault prediction and preventive maintenance. Through accurate energy consumption analysis, production energy efficiency optimization and early warning of abnormal working conditions can be realized.
[0151] (4) Smart home and energy saving management: In the smart home scenario, the scheme can analyze the power consumption characteristics of various home appliances (such as washing machines, lighting, water heaters, etc.), realize device identification, energy consumption statistics and intelligent scheduling. At the same time, it can detect whether there are illegal electricity use behaviors or abnormal device access in the residence, and protect the safety of household electricity use and realize energy saving optimization.
[0152] (5) Policy supervision and power market management: The scheme can also be used as an auxiliary decision-making tool for power regulatory departments and energy companies to identify high-risk areas and suspicious user behaviors, support power market settlement audit and anti-fraud management. Through the introduction of intelligent analysis models, it helps to improve the policy implementation and the comprehensive governance level of the power system.
[0153] On the basis of the above method embodiment, the embodiment also provides a non-invasive load detection system which can be used to realize the steps of the above method.
[0154] Reference Figure 3 The non-invasive load detection system comprises:
[0155] The power consumption data acquisition module 31 is configured to acquire household aggregate power consumption data of a target user, the household aggregate power consumption data representing overall household power consumption, and to decompose the household aggregate power consumption data by using a non-intrusive load monitoring (NILM) model, identify unique power consumption waveform features of various types of electrical appliances contained in the aggregate power consumption data, and infer single-appliance power consumption data corresponding to the various types of electrical appliances;
[0156] The preprocessing module 32 is configured to preprocess the household aggregate power consumption data and the single-appliance power consumption data respectively, to obtain a preprocessed aggregate power consumption sequence and an electrical appliance power consumption matrix.
[0157] The loading module 33 is configured to load a preset machine learning detection model, the machine learning detection model including an aggregate power consumption feature extractor, an electrical appliance power consumption feature extractor, and a feature classifier.
[0158] The feature extraction module 34 is configured to input the preprocessed aggregate power consumption sequence into the aggregate power consumption feature extractor to extract overall aggregate features, and to input the electrical appliance power consumption matrix into the electrical appliance power consumption feature extractor to extract electrical appliance local features.
[0159] The feature fusion module 35 is configured to fuse the overall aggregate features and the electrical appliance local features to obtain fused features.
[0160] The classification and identification module 36 is configured to input the fused features into the feature classifier, and to output a classification result of whether a load of the target user is abnormal by using the feature classifier.
[0161] The model training module 37 is configured to calculate a loss value of the classification result and a true label by using a binary cross-entropy loss function, to iteratively update parameters of the machine learning detection model by using a gradient optimization algorithm, and to determine whether to terminate training according to a preset training termination condition, to obtain a trained machine learning detection model.
[0162] The load detection module 38 is configured to implement non-intrusive load detection on real-time household aggregate power consumption data and corresponding single-appliance power consumption data of the target user by using the trained machine learning detection model.
[0163] In optional embodiments of the present application, with reference to Figure 4 The non-intrusive load detection system further includes:
[0164] The model testing module 39 is configured to input test set data without intersection with the training set into the trained machine learning detection model to obtain a test classification result; and evaluate the test classification result by using preset evaluation indexes, wherein the preset evaluation indexes include an area under the receiver operating characteristic curve (AUC), an F1 score, a recall, a precision, and a false positive rate (FPR).
[0165] The various variations and specific examples of the method provided in the above embodiments are also applicable to the system of the present embodiment. Those skilled in the art can clearly understand the implementation method of the system in the present embodiment through the foregoing detailed description of the method. For the sake of brevity of the specification, the implementation method of the system in the present embodiment is not described in detail here.
[0166] In order to better execute the program of the above method, the present embodiment further provides a computer device, as shown in the accompanying drawings. Figure 5 As shown in the accompanying drawings, the computer device includes a processor 51, a memory 52, and a communication bus 53 for realizing communication connection between the processor 51 and the memory 52.
[0167] The computer device can be implemented in various forms, including mobile phones, tablet computers, palmtop computers, notebook computers, and desktop computers, etc.
[0168] The memory can be used to store instructions, programs, codes, code sets, or instruction sets. The memory can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the method provided in the above embodiments, etc.; and the data storage area can store data involved in the method provided in the above embodiments, etc.
[0169] Optionally, the memory is a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disk (including a compact disc read-only memory (CD-ROM), a compact disk, a laser disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and capable of being accessed by a computer, but is not limited thereto. The memory exists independently and is connected to the processor through the communication bus, or the memory is integrated with the processor.
[0170] The processor can include one or more processing cores. The processor invokes data stored in the memory by running or executing instructions, programs, code sets or instruction sets stored in the memory, performs various functions and processes data of the present application. The processor can be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that the electronic device for implementing the functions of the processor described above can also be other devices for different devices, and the embodiments of the present application are not limited specifically.
[0171] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience, only one thick line is used to represent the communication bus in the figure, but it does not mean that there is only one bus or only one type of bus.
[0172] In an optional embodiment, the computer device can further include a communication interface (not shown) for communication with other devices.
[0173] The embodiments of the present application provide a computer readable storage medium, for example, including: a U disk, a mobile hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes. The computer readable storage medium stores a computer program capable of being loaded by the processor and executing the method of the above embodiments.
[0174] The embodiments of the present application further provide a computer program product, which comprises a computer program tangibly embodied on a computer readable medium, the computer program comprising program codes for executing any of the methods of the embodiments of the present application. The computer program can be downloaded and installed on the network, and / or installed from a detachable medium (such as a disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc.).
[0175] The above embodiments are only used to specifically introduce the technical solutions of the present application, and the above descriptions are only used to help understand the method and the core idea of the present application, and should not be understood as limitations on the present application. Those skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.
Claims
1. A non-intrusive load detection method based on multi-state power consumption and machine learning, characterized in that, The method includes: S1. Obtain the household aggregated power consumption data of the target user. The household aggregated power consumption data represents the total power consumption of the household. The household aggregated power consumption data is decomposed by the non-intrusive load monitoring model NILM to identify the unique power consumption waveform characteristics of various types of electrical appliances contained in the aggregated power consumption data and infer the power consumption data of a single appliance corresponding to each type of appliance. S2. Preprocess the aggregated power consumption data of the household and the power consumption data of the single appliance respectively to obtain the preprocessed aggregated power consumption sequence and appliance power consumption matrix. S3. Load a preset machine learning detection model, which includes an aggregated power consumption feature extractor, an appliance power consumption feature extractor, and a feature classifier; S4. Input the preprocessed aggregated power consumption sequence into the aggregated power consumption feature extractor to extract the overall aggregated features; input the appliance power consumption matrix into the appliance power consumption feature extractor to extract the appliance local features; perform feature fusion on the overall aggregated features and the appliance local features to obtain the fused features; S5. Input the fused features into the feature classifier, and output the classification result of whether the target user's load is abnormal through the feature classifier; S6. The loss value between the classification result and the true label is calculated using the binary cross-entropy loss function. The parameters of the machine learning detection model are iteratively updated using the gradient optimization algorithm. The training is terminated according to the preset training termination condition to obtain the machine learning detection model that has been trained. S7. Using the trained machine learning detection model, perform steps S2-S5 on the target user's real-time aggregated household power consumption data and the corresponding power consumption data of a single appliance to achieve non-intrusive load detection.
2. The method as described in claim 1, characterized in that, In step S1, the various types of electrical appliances include constant-type electrical appliances, switching type electrical appliances, and multi-state type electrical appliances; The unique power consumption waveform characteristic of the constant-type electrical appliance is that the power consumption remains stable within a preset time and the fluctuation amplitude is less than a first threshold. The unique power consumption waveform characteristic of the switching electrical appliance is that the power consumption alternates between a fixed power consumption value in the on state and zero value in the off state. The unique power consumption waveform characteristic of the multi-state electrical appliance is that the power consumption operates in multiple discrete states and has a periodic variation pattern.
3. The method as described in claim 1, characterized in that, In step S2, the preprocessing of the aggregated household power consumption data and the power consumption data of a single appliance includes: The household aggregated power consumption data is subjected to mean resampling processing within a fixed time window, and the resampled power consumption sequence is normalized to obtain the preprocessed aggregated power consumption sequence. The power consumption data of the single appliance is subjected to mean resampling processing within a fixed time window. The resampled power consumption sequence is then normalized. Finally, the power consumption sequences of various types of appliances after normalization are aligned and merged according to the time step to obtain the appliance power consumption matrix.
4. The method as described in claim 3, characterized in that, In step S2, the normalization process includes: Calculate the normalized power consumption using the following formula: Where x is the power consumption data before normalization. σ represents the average power consumption data, and σ represents the standard deviation of the power consumption data. The dimension of the electrical appliance power consumption matrix is the number of time steps × the number of electrical appliances: in, Electrical appliances exist Power consumption at any given moment.
5. The method as described in claim 1, characterized in that, In step S3, the aggregated power consumption feature extractor uses a convolutional long short-term memory network (ConvLSTM) or a convolutional autoencoder (CAE) to capture the global temporal features of the aggregated power consumption sequence and obtain the overall aggregated features. The electrical appliance power consumption feature extractor uses a convolutional neural network (CNN) to extract fine-grained features at the device level from the electrical appliance power consumption matrix, thereby obtaining the local features of the electrical appliance. The feature classifier uses a fully connected neural network (FC), support vector machine (SVM), or random forest (RF) to perform a binary classification task to determine whether the load is abnormal, and obtain the classification result.
6. The method as described in claim 1, characterized in that, In step S4, the feature fusion of the overall aggregated features and the local features of the electrical appliance to obtain the fused features includes: The overall aggregated feature and the local feature of the electrical appliance are concatenated dimensionally to obtain the fused feature. The concatenation formula is as follows: in, This indicates the fusion feature. This represents the overall aggregation characteristic. To represent the local features of the electrical appliance.
7. The method as described in claim 1, characterized in that, In step S6, the gradient optimization algorithm includes stochastic gradient descent (SGD) or adaptive momentum estimation algorithm Adam. The training termination condition includes at least one of the following: The performance metrics of the validation set do not improve for a consecutive preset number of rounds; the change in the training loss value within a consecutive preset number of rounds is less than the second threshold; and the number of model training iterations reaches the preset maximum number of rounds. If the performance metrics of the validation set do not improve for a preset number of consecutive rounds, the load detection device triggers an early stop mechanism to roll back to the model parameters when the validation set performance is optimal.
8. The method as described in claim 1, characterized in that, Step S6 is followed by model testing: inputting test set data that does not overlap with the training set into the trained machine learning detection model to obtain the test classification results; The test classification results are evaluated using preset evaluation metrics, which include the area under the receiver operating characteristic curve (AUC), F1 score, recall, precision, and false positive rate (FPR).
9. A non-intrusive load detection system based on multi-state power consumption and machine learning, characterized in that, include: The power consumption data acquisition module is used to acquire the household aggregated power consumption data of the target user. The household aggregated power consumption data represents the total electricity consumption of the household. The household aggregated power consumption data is decomposed by the non-intrusive load monitoring model NILM, and the unique power consumption waveform characteristics of various types of electrical appliances contained in the aggregated power consumption data are identified. The power consumption data of each type of electrical appliance is inferred. The preprocessing module is used to preprocess the aggregated power consumption data of the household and the power consumption data of the single appliance respectively, to obtain the preprocessed aggregated power consumption sequence and appliance power consumption matrix; The loading module is used to load a preset machine learning detection model, which includes an aggregated power consumption feature extractor, an appliance power consumption feature extractor, and a feature classifier. The feature extraction module is used to input the preprocessed aggregated power consumption sequence into the aggregated power consumption feature extractor to extract overall aggregated features; and to input the appliance power consumption matrix into the appliance power consumption feature extractor to extract local appliance features. The feature fusion module is used to fuse the overall aggregated features with the local features of the electrical appliance to obtain fused features; The classification and recognition module is used to input the fused features into the feature classifier, and output the classification result of whether the target user's load is abnormal through the feature classifier; The model training module is used to calculate the loss value between the classification result and the true label using the binary cross-entropy loss function, iteratively update the parameters of the machine learning detection model through the gradient optimization algorithm, and determine whether to terminate the training according to the preset training termination condition to obtain the trained machine learning detection model. The load detection module is used to perform non-intrusive load detection on the target user's real-time aggregated household power consumption data and the corresponding power consumption data of individual appliances using a trained machine learning detection model.
10. A computer device, characterized in that, It includes a processor, a memory, and a communication bus, wherein the communication bus is used to establish a communication connection between the processor and the memory, and the processor is used to execute a computer program stored in the memory to implement the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Non-invasive load identification algorithm based on hybrid neural network and ensemble learning
CN107122790A
Non-intrusive load detection method and system based on deep learning
CN118673798A