Non-intrusive Load Monitoring Method Considering the Time-segmented State Probability

Appliance-level data is a prerequisite for establishing friendly two-way interactions between customers and the power company, and this data is now mainly obtained by non-intrusive load monitoring. However, as the number of loads increases, the number of possible appliances state combinations tends to grow exponentially, leading to a significant increase in the time of load identification. In order to reduce the search range of the load state combinations and shorten the algorithm response time, a non-intrusive load monitoring method based on the time-segmented state probability is proposed in this paper. Firstly, the affinity propagation (AP) clustering algorithm is introduced to obtain the power templates of the load, and then the power templates are used to count the time-segmented state probabilities. Secondly, a number of appliance state matrices are generated using the probabilities, and the optimal matrix is selected by the function as the identification result of the appliance state. Finally, the performance of the algorithm is tested on the public NILM dataset and compared to several state-of-the-art techniques. The results illustrate that the proposed method achieves an accuracy of 96% for load state identification and 89% for power decomposition of the load, and is able to meet the real-time application requirements.


I. INTRODUCTION
The feedback to the power company on the customer's electricity consumption can not only allow the customer to understand their electricity consumption habits but also help the power company to improve its supply strategy for bilateral reciprocity [1]. Current smart meters only provide total power data, while the electricity consumption of individual devices is not included in it, making it difficult to meet the two-way interaction between the customers and the power company. In addition, the monitoring of loads also helps in the detection of abnormal appliances and the identification of inefficient loads, which will contribute to power savings [2]. Among the methods of load monitoring, non-intrusive load monitoring (NILM) is widely used for appliance-level data acquisition due to its cost-effectiveness [3].
Hart at MIT first proposed NILM, which has received a lot of attention from researchers [3]. Compared to intrusive load monitoring, NILM does not require intrusion into the customer's premises. It uses a monitoring device installed at the customer's electricity entry point or relies directly on existing smart meters to obtain the customer's bus data. The bus data is then decomposed by a series of algorithms to obtain the usage of the various loads within the customer. Since NILM does not require the installation of sensors for each appliance, it has low economic and labor costs for installation and maintenance.
The NILM problem can be considered as a combination optimization (CO) problem. It uses the characteristics of each load to build a model, and then compares the total characteristics corresponding to the possible combinations of loads with the actual total characteristics to derive the operating state of the appliance. In recent years, NILM has gained a great deal of attention. Some scholars have provided publicly available datasets on this field, such as REDD [5], BLUED [6] and AMPds [7]. In addition, methods such as machine learning, neural networks and Hidden Markov Models are constantly being updated, providing researchers with algorithmic tools for solving load identification problems. Based on the sampling frequency of the observation, NILM can be divided into two main methods. One is based on high-frequency data and one is based on low-frequency data.
The NILM methods based on high-frequency data use the characteristics of the load in the high-frequency data as the basis for load identification. Among them, literature [8] proposes to use current phase, amplitude and frequency as load features and then combine them with Long Short-Term Memory (LSTM) networks for load identification. Literature [9] uses voltage, active and reactive currents, Fourier transformed and coded to form a color signature, and then uses two-stream convolutional neural networks for load identification. Literature [10] proposes to use reconstructed voltage and current trajectory features and use convolutional neural networks for device classification. Although these methods based on the unique features have achieved good results in terms of recognition accuracy, the extraction of features requires the use of high-frequency data from the load. However, such a high sampling rate is not the standard feature for currently available smart meters. For example, according to the minimum functional specification of the Australian National Smart Metering Program, smart meters only provide power consumption data once every 5 seconds [11].
The NILM methods based on low-frequency data infer the most likely combination of states from the observed power. In [12], a factorial Hidden Markov Model is established to achieve NILM, which is then solved using the Viterbi decoding framework and integer quadratic constraint programming. A convolutional neural networkbased energy decomposition method based on a multipleinput multiple-output regression model is proposed in [13], which considers the previous state of the device and the dependencies between devices for load decomposition. Graph signal processing (GSP) is used for NILM in [14]. The GSP-based method achieves load decomposition by minimizing the total variation of the graph as the starting condition and combining it with a simulated annealing algorithm. An improved cross-entropy algorithm is introduced in [15]. Under the constraint of the penalty function, it searches for the best combination of states by iteratively updating the operation probability of the equipment to achieve load decomposition. Generally, methods based on low-frequency data achieve load decomposition by finding the combination of states that makes the minimum error. The computational complexity of these methods tends to increase exponentially with the number of devices and the time of the calculation increases significantly. Therefore, it is beneficial to find fast and efficient solvers in order to suit the application conditions of existing grids.
Based on the above analysis, a NILM method based on the time-segmented state probability is proposed in this paper. The sample data is used to cluster the load power states, and the power template of the household load in various operating states is obtained. Then the operating probability of the load under each time period is calculated, which is used to reduce the solution space and generate the load state for power decomposition. Finally, the feasibility of the method is experimentally verified on the public data set AMPds, which has a sampling frequency similar to that of smart meters.
The main contributions of this paper are summarized as follows: (1) The time-segmented state probability is introduced to narrow the search set of the solution, which leads to improved recognition accuracy and efficiency.
(2) AP clustering strategy is adopted to establish the power template of the load, which makes the power template more accurate.
(3) The proposed NILM method can greatly reduce the time of load identification with limited data training. Meanwhile, the proposed method does not limit the number of load state changes over a single sampling cycle.

II. HOME LOAD POWER TEMPLATE
In order to correspond the operating state of the load to the power, it is assumed in this paper that all appliances are capable of being represented by a finite number of states. As proposed by [16], we focus on three types of loads, Type-I, Type-II and Type-VI.

A. POWER TEMPLATE CONSTRUCTION
Since a single feature is prone to feature overlap, we choose easily available steady-state active power and the steady-state reactive power as the load features. Assuming that there are M appliances, and the corresponding states of appliance m have N modes, the templates of the appliance m (Tem) are established as: where n m p and n m q represent the active power and reactive power, respectively, when the appliance m is operating at mode n.

B. Power Template Acquisition Based on AP Clustering Algorithm
In order to reduce the influence of the human factor, we introduce the AP algorithm to cluster the power template. The AP algorithm was proposed by Brendan J. Frey and Delbert Dueck in 2007 [17]. It does not need to predetermine the number of categories. It directly treats each data point as a possible cluster center (exemplars) and clusters according to the similarity between objects and information transmission. The basic idea of the AP algorithm is to treat all data points as network nodes and find cluster sets by continuously transmitting information between nodes. The two kinds of information transmitted in the iterative process of the AP algorithm are responsibility and availability. Suppose the appliance m has L instances, then the similarity matrix O=(oik)L × L is defined through negative Euclidean distance. The oik that means the similarity between the instance i and the instance k is formulated as follows: where pm,i and qm,i represent the active and reactive power of appliance m at the i th instance, respectively. The diagonal elements of the similarity matrix are generally set to the median or minimum value of the non-diagonal elements and defined as preference. The preference degree affects the number of exemplars obtained by the clustering result. The responsibility and availability matrices are defined as R=(rik)L × L, A=(aik)L × L, respectively. The rik that means the responsibility between the i th and the k th instances is formulated as follows: The aik that means the availability between the i th and the k th instances is formulated as follows: The AP algorithm is not sensitive to the choice of the initial value. Still, because the number of the final cluster centres is affected by the reference degree, the number of exemplars is likely to be relatively large when the reference degree is unreasonably selected. Considering the situation of abnormal points, we adopt an adaptive method to filter out unreasonable cluster points and optimize the cluster centre.
The steps of the AP algorithm are as follows: Step 1: Initialize R and A as all-zero matrices, and calculate the similarity matrix O by (2).
Step 2: Calculate R and A successively by (3) and (4). In order to suppress data oscillations during the iteration process, the damping coefficient  is added in each iteration. The update formula is as follows: are the output of the previous iteration, t A and t R are the output of this iteration.
Step 3: Repeat step 2 until the matrices are stable or the maximum number of iterations is reached.
Step 4: Then, the instance e that satisfies the following condition is the exemplar: Step 5: Calculate which exemplar each instance belongs to.
Step 6: Determine whether the number of instances belonging to each exemplar meets more than a predefined threshold. If there are, remove the exemplar and return to step 5 to recalculate the attribution of each point; otherwise, output the exemplar.

A. THE TIME-SEGMENTED STATE PROBABILITY
Different appliance has different electricity consumption rules, so the probability of each appliance in various operating states is different. At the same time, combined with the characteristics of household electricity consumption habits, the operating state of the household load reflects a unique law within 24 hours. Taking the four loads in AMPds as an example, the active and reactive power dispersions are drawn for a typical 24h period, as shown in Fig.2.
It can be seen from Fig.2 that different home appliances exhibit different distributions over time due to different functions and the characteristics of user behaviour habits. For example, as a device for maintaining indoor temperature, the heat pump frequently runs at night when the temperature is low to maintain a suitable indoor temperature. Related entertainment appliances such as TV are mostly used before dinner and before going to bed, while dishwashers are generally used at dinner time. VOLUME XX, 2017 1

FIGURE 2. Time distribution of typical load operating state.
Effective division of the load's typical state behaviour time period can improve the effect of load disaggregation. Taking into account the general residential electricity consumption behaviour, the division of the load operation time period in this paper is shown in Fig.3. According to the life pattern of the general family, 1:00 to 5:00 is bedtime, the load usage is simple, and the load changes less, classified as a section. Except for this section, dividing the other time periods into two-hour intervals is reasonable. This division will not make the section too complicated to process, and it can also fully reflect the difference in the load operation status of different sections. For example, 7:00-9:00, 11:00-13:00, and 17:00-19:00 are generally mealtime, and the operation of the cooking-related appliance is very different from other time periods. 19:00-21:00 is generally in the relaxation time after a meal, and the entertainment load usage is quite different from the rest of the time period.
We assume that the training set contains D days, the load category is M, and data for each load is sampled once a minute. Then the operating probability factors of the load appliance in different time periods can be expressed as follows: , , where , represents the probability that the appliance m is in the state n during i t ; , represents the total number of minutes that the device m is in the state n during i t in the entire training set, and i , 1 Then the time-segmented probabilities of each load are stored as 11 probability matrices according to time segments so that they can be easily called. Each matrix i t F is represented as follows:

B. NILM MATHEMATICAL MODEL
The essence of the NILM problem is to decompose the total power consumption collected from the user's power inlet into a combination of various appliance power consumption. Assuming that the total active power recorded at a certain time is total P and the total reactive power is total Q , they can be expressed by the sum of the power of each load: where noise p and noise q represent background noise; n m s represents the state of the appliance m, and the value is 0 or 1. When the appliance m is running in mode n, the n m s is 1; otherwise, it is 0. The appliance state matrix S can be expressed as: represent the active and reactive power templates of the load m, respectively. The purpose of NILM algorithm is to disaggregate the measured signal Ptotal into its various components pi. Based on these definitions above, the optimization problem can be formulated as: where  represents the weighting factor of power. The number of load status types in S, P, and Q are all marked as N. When the load type of m is less than N, the excess is made up by 0.

C. NILM BASED ON THE TIME-SEGMENTED STATE PROBABILITY
We regard load disaggregation as integer programming, and all possible solutions have been determined when the number and state of the appliance are determined. The proposed NILM algorithm is based on the time-segmented state probability (TSSP). It uses the probabilities to generate load state combinations. The purpose is to reduce the range of the search set and accelerate the speed and accuracy of recognition. The optimal combination of states for the load is obtained by Algorithm 1.
In the initialization phase, the time-stamped aggregated data are input and the TSSP matrix i t F is selected based on the time. In the main loop, set a random valueˆm s for each appliance m in the solutionŜ according to the probability , i n t m f , which is the probability that appliance m will operate as mode n in time segment ti. For the state estimation matrix S , an appropriate number is chosen, taking into account both time cost and accuracy. Finally, the optimal state estimation matrix is filtered by the function (12) and (13 , j=j+1  End  Select the bestŜ by (12) and (13) Output:Ŝ The steps of the overall proposed approach for NILM are as follows: Step 1: Use the data in the training set and the AP algorithm to obtain the appliance's power template matrix P and Q.
Step 2: The data in the training set is divided into subdatasets according to time segments, and the status of the appliance is tagged according to the power template obtained in step 1.
Step 3: Count the TSSP for each appliance and save the probability matrix of each time segment.
Step 4: Time-label each data set in the testing set (Existing smart meters often come with a time scale).
Step 5: Solve the state combination of the load using Algorithm 1.
Unlike [18], the proposed algorithm does not require information from the previous moment. Furthermore, it does not limit the number of state changes between two adjacent moments.

A. EVALUATION METRICS
Many different kinds of metrics exist in the study of NILM algorithms. In this paper, the NILM problem is classified as integer programming, and the load state is compared with a binary classification task. There are four classification results, namely: 1) the number of times an appliance was correctly identified as turned on (TP); 2) the number of times an appliance was correctly identified as turned off (TN); 3) the number of times an appliance was incorrectly identified as turned on (FP); 4) The number of times that a device was wrongly identified as closed (FN). Based on the above four recognition results, the following metrics can be used to evaluate the performance of NILM algorithms: where FM represents F-measure, which denotes the harmonic average of recall rate Re and precision rate Pre [19]. Re and Pre are calculated as follows: , where Pre is defined as the precision classification in all positive estimations; Re is expressed as the percentage of correctly recognized appliances. In addition, the method mentioned in [20] is also used to evaluate the accuracy of power decomposition. For T samples, the total power decomposition accuracy is defined as PDacc; the power decomposition accuracy for each load is defined as PD(m)acc: whereˆt m p represents the active power estimated by the NILM method, t m p is the real active power of appliance m at t, and t P is the total power at t.

B. SIMULATION RESULTS ON AMPDS
Our research work is to realize the identification and intelligent control of user sideload for the demand-oriented response. In order to reduce the additional economic burden, the data available on the smart meter is used for identification. For this reason, AMPds2 is chosen to test the proposed method. AMPds2 records 2 years of electricity consumption data for a Canadian household, including electrical characteristics such as voltage, current, active and reactive power, collected at 1-minute intervals. We choose eight kinds of loads as test objects: basement plugs & lights (BME), dishwasher (DWE), clothes washer (CWE), entrainment TV/PVR/AMP (TVE), kitchen fridge (FGE), heat pump (HPE), HVAC furnace fan & thermostat (FRE), kitchen well oven (WOE). Three test cases will be carried out, and all three cases use the first two weeks of data to obtain TSSP. The first case (CASE I) decomposes the data of eight appliances for 30 days to verify the algorithm of this paper. The second case (CASE II) adds to the first one the data obtained from the actual detection of electric vehicle (EV) and is used to test the effectiveness of our method for the recognition of electric vehicles. The third case (CASE III) chooses the literature [21] as a reference to compare the accuracy of the proposed method in terms of power decomposition. The fourth case (CASE IV) chooses the literature [22] as a reference to compare the accuracy of the algorithm in terms of load states identification.

1) TEST CASE I
The training set is the active and reactive power of eight appliances between April 1, 2012, 0:00 to April 14, 2012, 23:59. In order to avoid too much data used for clustering and to improve the efficiency of clustering, a sampling method is adopted for clustering. The training set data is classified by time segments, and the total data is divided into eleven sub-datasets [t1, t2...t11]. When solving the power template of the appliance, according to the operating conditions of different equipment in different periods, a subdata set containing more equipment states is selected as the clustering data. After preliminary screening, BME and CDE select t9, t10, and t11 data sets, FGE and FRE select t8, t9, and t10 data sets, DWE selects t7, t8, t9, and t10 data sets, HPE selects t1, t2, t3 data sets, TVE selects t7, t8, t9, t10, and t11 data sets, WOE selects t7, t8, and t9 data sets. The damping coefficient in (5) is 0.5, and the maximum number of iterations is 200. After the AP algorithm, the power templates of each appliance are shown in Table I. There is also power consumption when the appliance is on standby. For example, the BME always has 8W active power and 7var reactive power on standby, so it is considered a state.
Through the power template of Table I, the samples in the training set are labelled, and the TSSP is counted. The probabilities are shown in Fig.4. VOLUME XX, 2017 1 The testing set selects the data from April 15, 2012, 0:00 to May 14, 2021, 23:59 for 30 days. For each moment, we use the probability distribution to generate 100, 150, and 200 state estimation matrices, calculate their F-measure. We calculate the state accuracy rate Sacc when the number of state estimation matrices is 150. The power weighting factor  in (12) is 0.6. The recognition results are shown in Table II and  Table III. The results show that HPE has the lowest score of the FM parameter. On the one hand, HPE has four modes, and it is easier to identify errors than the two-state appliance. On the other hand, in the probability distribution diagram of the testing set in Fig.3(f), HPE may be in operation at any time of the day, increasing the possibility of incorrect judgments. In addition, the PDacc is mainly affected by the Sacc and the appliance power template. Due to the complex operation of the appliance, the actual power of the load is not based on the ideal power template. Although the AP algorithm is as accurate as possible for the power template of the appliance, the PDacc is below 90%.
As can be seen from Table I, for the eight appliances of CASE I, there are a total of 5184 possible state combinations. However, the range of solution sets is narrowed down by restricting the TSSP at different time segments so that satisfactory results can be obtained when the estimation matrix is around 150.
In order to observe more details of the estimated decomposition results, the decomposition results are employed for the two days from May 7, 12:00 to May 9, 12:00 in CASE I, which is plotted as Fig.5. As can be seen from Fig.5, around the 500th minute the decomposition results for CDE, DWE, TVE and HPE appear to be abnormal. This is because all these appliances may be running at this time. And the CDE's third mode was falsely recognized as a combination of the other appliances. In the time range 700-1100 and 2300-2700 in Fig.5, corresponding to time segments t1, t2 and t3, the use of TSSP allows for the limitation of incorrect load combinations and higher accuracy of load state identification. A better overlap between the real power and the estimated power is shown in the graph.
The method succeeds in preventing the mismatch during most periods. However, there are still cases of mismatching during periods with complex load operating conditions, such as t9.

2) TEST CASE II: WITH EV
Due to the popularity of EV, more and more users are charging their EVs at home. Considering this situation, we added EV to the conventional load to test the accuracy of our algorithm in recognizing EV. The EV charging data obtained from the actual test is shown in Fig.6. Since only the active power of this EV is available, we add the EV load to CASE I and consider only the active power of the appliance as a template. In this case, the state estimation matrix is 150, and only two states are considered for EV: ON (3825W) and OFF (0W).
In the probability matrix of CASE I, we supplement the TSSP for fourteen days of EV. The results obtained from the decomposition of the data for one week during the testing phase are shown in Table IV. From these results, it was observed that, with the proposed method, the average appliance state identification accuracy is more than 95%, and the power decomposition accuracy is more than 87%. In addition, the state identification accuracy for EV exceeds 99% and the power decomposition accuracy reaches 97.1% due to the obvious charging pattern of EV. This suggests that the proposed algorithm is equally applicable to households with EVs.

3) TEST CASE III
CASE III is designed to have the same setups as in [21], which proposes a NILM algorithm based on mixed-integer linear programming (MILP). This case considers a shorter period of one week. The proposed method is also compared with the CO algorithm mentioned in the literature [21]. In order to avoid the effect of power templates, we choose the power template from Table II in [21] and recalculate the TSSP using the data from the first two weeks. In this case, the state estimation matrix is 150, and the load power decomposition accuracy is shown in Table V. The optimization objectives of the model proposed in this paper are the same as those of CO and MILP, but both CO and MILP add windows to the signals and solve them within a single window. On the other hand, the proposed model is solved separately at each moment. In this way, even if the identification results of the previous moments are abnormal, they do not affect the subsequent load power decomposition. Table V shows the most problematic appliances are DWE and BME. This seems to be mainly due to the overlap of the periods of BME, DWE and TVE, and the DWE power values are close to the combination of BME and TVE. Nonetheless, the power decomposition accuracy of the proposed method is still higher than CO and MILP.

4) TEST CASE IV
We select scenario 3 from [22] as the comparison object in this case. The modified cross-entropy (MCE) algorithm uses the previous moment's state and adds a penalty function to achieve the load decomposition in [22]. In contrast to MCE, our model has no additional penalty function. All constraints are embodied through the TSSP and will only come into play during the solution of the optimisation problem. The training set uses data for the two weeks starting April 1. The power templates are the same as [22], containing only active power. The testing set selection starts at 12:18:00 on April 18, 2012, as does the MCE, for a total of 600 hours. The number of the generated matrices is set to 150, and the decomposition results are as follows: As can be seen from Table VI and Table VII, compared with MCE, the Sacc and PDacc of this paper have improved significantly. Although the proposed method needs to use historical data to obtain the TSSP, it is more accurate than MCE for load recognition. The proposed method does not require iterations and is less time-consuming.

C. PRACTICAL DISCUSSION
Power line communications (PLC) network has been considered as the favourite choice for communicating with electricity meters. In a typical PLC network, smart meters are connected to the data concentrator [23]. A single data concentrator is usually responsible for remote reading of up to 200-500 smart meters. We want to deploy load recognition algorithms in the concentrator, which would be more costeffective and less invasive of customer privacy than embedding the algorithm at each smart meter. The complexity of the proposed algorithm is O(M·Th), where M is the number of appliances and Th is the number of estimation matrices in algorithm 1. The simulation results as presented in this paper were attained by MATLAB, and the hardware platform is Intel(R) Core (TM) i5-7300HQ CPU @ 2.50GHz 2.50 GHz, 8.00GB RAM notebook computer. The time required for the proposed algorithm to calculate a month's data with a sampling frequency of 1/60Hz is shown in Table VII. For a concentrator with 500 smart meters connected, a complete reading cycle is 500s, which means that every second meter's data is transferred to the concentrator[24]. To achieve real-time load disaggregation in the concentrator, and take into account transmission times and other functional time consumption, the algorithm needs to be completed within 0.5s. As can be seen in Table VIII, the time of our algorithm satisfies this requirement. Therefore, our scheme has strong implementability under the existing electricity information collection systems.

D. METHODOLOGY ANALYSIS
Through testing on publicly available datasets and comparative discussions with other methods, our approach has the following advantages: (1) The model is simple, the probabilities and power templates are stored as matrices and can be called up quickly. (2) The use of TSSP limits the possible combinations of states of the load and reduces the search space. (3) The short computation time and low-rate sampling required for our approach allow deployment in a concentrator, thus reducing economic costs and accommodating the consumer's privacy and comfort.
However, there are some weaknesses in the proposed approach: (1) The construction of power templates assumes that the load is a finite state machine, so it is poor at identifying appliances with continuously adjustable power during operation. (2) Both the templates and the TSSP acquisition of the appliances require historical data for training. (3) The method may be less effective in identifying when several appliances have similar operating times and similar operating power.

V. CONCLUSIONS
In this paper, a new NILM method is proposed based on the TSSP. The algorithm is easy to implement and consumes a little time. On the one hand, the AP algorithm is introduced to reduce the human interference of load power templates and make the power template more reliable. On the other hand, the time-segmented state probability is proposed in this paper, which reflects the intrinsic connection between the appliance state and time, thus reducing the search space. At the same time, the algorithm considers multi-state appliances and does not limit the number of state-changing devices in a single sampling period.
The proposed algorithm shows good performance when tested on the AMPds dataset. When the number of appliances is eight, for one month's data, the accuracy of load state identification reaches over 96% and the accuracy of the power decomposition is over 89%. Meanwhile, the results show that our method has a significant accuracy advantage over MCE and MILP disaggregation methods. In fact, because of the short time used, our method is suitable to be arranged in a concentrator.
However, the power template acquisition and the timesegmented state probability of appliances need to be trained in advance. Next, we will explore the relationship between appliance operation status and time-segmented probability distribution among different users to simplify the acquisition of prior conditions.