a novel transfer learning based intelligent non-intrusive ... novel transfer... · approach in...

8
1 A Novel Transfer Learning based Intelligent Non-intrusive Load Monitoring with Limited Measurements Zejian Zhou, Yingmeng Xiang, Hao Xu, Zhehan Yi, Di Shi, and Zhiwei Wang Abstract—In this paper, the real-time non-intrusive load mon- itoring (NILM) problem with limited measurements, i.e., low sampling rate data, is investigated. NILM is a technique to identify the various types of appliances by analyzing the voltage and current features collected by sensors such as smart outlets. It is one of the most important topics in smart grid management and optimization. Although recent NILM methods developed several general models that can be used for various scenarios, these algorithms either require high-frequency measurement devices or have been limited to use for some specific appliances. A real- time intelligent NILM algorithm that is able to be transferred among different appliances with low-frequency data is still lacking and desperately needed. In this paper, a novel online learning-based intelligent NILM algorithm has been developed that can online infer a variety of appliances using a transferred model with limited measurements. Specifically, the developed algorithm integrates the emerging transfer learning technique along with deep neural networks. Two neural networks are used in two different stages, i.e., 1) The long short-term memory (LSTM) neural network to extract the lower level spatial and temporal features from the grayscale image generated by the measurements, 2) The probabilistic neural network (PNN) to classify the appliance type as well as transfer between appliances. Finally, the algorithm is implemented into practical smart outlet hardware to demonstrate its effectiveness. Index Terms—Non-intrusive load monitoring, Smart sensors, Smart grid, Deep learning, Transfer Learning. I. INTRODUCTION R ECENTLY , the demand for monitoring power consump- tion of various appliances has become a crucial issue to the smart grid measurement and optimization [1]. By analyzing appliances’ real-time electric load data, the utility companies have the potential to adjust the power supply efficiently and further optimize energy allocation. This potential has moti- vated the development of “smart buildings”, where the appli- ances’ load is dynamically monitored. The specific appliance’s real-time load data provides the opportunity to profile the characteristics of a building’s power demand, e.g., frequency [2], scheduling [3], etc. As a result, the utility companies can autonomously optimize the power distribution by balancing the Zejian Zhou, Yingmeng Xiang, Zhehan Yi, Di Shi, & Zhiwei Wang are with GEIRI North America, San Jose, CA, USA. (e-mail: [email protected]; [email protected]; [email protected]; [email protected]; zhi- [email protected]). Hao Xu is with the Department of Electrical and Biomedical Engineering, University of Nevada, Reno, NV, 89557 USA. (email: [email protected]) This work was supported by the SGCC Science and Technology Program under project ”Distributed High-Speed Frequency Control under UHVDC Bipolar Blocking Fault Scenario” under Grant SGGR0000DLJS1800934. load demand response for every building based on the accurate individual appliance’s data. Nevertheless, obtaining such data is challenging since a single building may have hundreds of individual appliances. Due to the limit of communication and data fusion difficulties caused by large scale sensor net- works, previous researches focused on disaggregating specific appliance data from a general-purpose power meter which measures the sum of all appliances’ load [4]. Those approaches were organized into two steps, 1) disaggregating individual appliance load, 2) identify the appliance type through various load features. However, it becomes more and more difficult to disaggregate individual appliance data from a general meter with a large number of appliances. With the rapid growth of the Internet of Things (IoT) where large scale sensor networks are coordinated through edge com- puting, the appliances’ load can be analyzed using the smart outlets which measure individual load data instead of a general meter. This setting eliminates the burden of disaggregating individual load data such that all computational resources can be concentrated on appliance identification. Combined with the emerging edge computing technique where a local server is designed to implement computationally intensive tasks, the deep learning classifier can thus be applied to increase the classification performance. Our previous studies on IoT based load control yielded the Grid Sense system which has been successfully applied in several pilot projects in the operation of State Grid Jiangsu Electric Power Company in China [5]. The Grid Sense system provides a hierarchical scheme that integrates IoT, edge computing, and NILM to stabilize the grid frequency as well as optimize the grid performance. Specifi- cally, a large scale smart outlets networks are implemented to measure the load data and then send to a local server through communication networks. The local server analyzes the individual load data to compute the optimal load demand response strategy. For this practical Grid Sense system, we have an urgent need to detect the type of the appliances connected to the smart outlets in a real-time manner in order to better monitor and control the load demands, which is the main purpose of this paper. During the practical operation on several households in China, we noticed two major potential improvements: 1) Due to the limitation of the communication network, the real-time measurements (often up to 1MHz) are difficult to upload to the local server without delay. 2) Considering a nationwide implementation case, it is nearly impossible to collect enough data for all appliances to train a comprehensive NILM model.

Upload: others

Post on 23-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

1

A Novel Transfer Learning based IntelligentNon-intrusive Load Monitoring with Limited

MeasurementsZejian Zhou, Yingmeng Xiang, Hao Xu, Zhehan Yi, Di Shi, and Zhiwei Wang

Abstract—In this paper, the real-time non-intrusive load mon-itoring (NILM) problem with limited measurements, i.e., lowsampling rate data, is investigated. NILM is a technique toidentify the various types of appliances by analyzing the voltageand current features collected by sensors such as smart outlets. Itis one of the most important topics in smart grid management andoptimization. Although recent NILM methods developed severalgeneral models that can be used for various scenarios, thesealgorithms either require high-frequency measurement devicesor have been limited to use for some specific appliances. A real-time intelligent NILM algorithm that is able to be transferredamong different appliances with low-frequency data is stilllacking and desperately needed. In this paper, a novel onlinelearning-based intelligent NILM algorithm has been developedthat can online infer a variety of appliances using a transferredmodel with limited measurements. Specifically, the developedalgorithm integrates the emerging transfer learning techniquealong with deep neural networks. Two neural networks are usedin two different stages, i.e., 1) The long short-term memory(LSTM) neural network to extract the lower level spatial andtemporal features from the grayscale image generated by themeasurements, 2) The probabilistic neural network (PNN) toclassify the appliance type as well as transfer between appliances.Finally, the algorithm is implemented into practical smart outlethardware to demonstrate its effectiveness.

Index Terms—Non-intrusive load monitoring, Smart sensors,Smart grid, Deep learning, Transfer Learning.

I. INTRODUCTION

RECENTLY , the demand for monitoring power consump-tion of various appliances has become a crucial issue to

the smart grid measurement and optimization [1]. By analyzingappliances’ real-time electric load data, the utility companieshave the potential to adjust the power supply efficiently andfurther optimize energy allocation. This potential has moti-vated the development of “smart buildings”, where the appli-ances’ load is dynamically monitored. The specific appliance’sreal-time load data provides the opportunity to profile thecharacteristics of a building’s power demand, e.g., frequency[2], scheduling [3], etc. As a result, the utility companies canautonomously optimize the power distribution by balancing the

Zejian Zhou, Yingmeng Xiang, Zhehan Yi, Di Shi, & Zhiwei Wang are withGEIRI North America, San Jose, CA, USA. (e-mail: [email protected];[email protected]; [email protected]; [email protected]; [email protected]).

Hao Xu is with the Department of Electrical and Biomedical Engineering,University of Nevada, Reno, NV, 89557 USA. (email: [email protected])

This work was supported by the SGCC Science and Technology Programunder project ”Distributed High-Speed Frequency Control under UHVDCBipolar Blocking Fault Scenario” under Grant SGGR0000DLJS1800934.

load demand response for every building based on the accurateindividual appliance’s data. Nevertheless, obtaining such datais challenging since a single building may have hundredsof individual appliances. Due to the limit of communicationand data fusion difficulties caused by large scale sensor net-works, previous researches focused on disaggregating specificappliance data from a general-purpose power meter whichmeasures the sum of all appliances’ load [4]. Those approacheswere organized into two steps, 1) disaggregating individualappliance load, 2) identify the appliance type through variousload features. However, it becomes more and more difficult todisaggregate individual appliance data from a general meterwith a large number of appliances.

With the rapid growth of the Internet of Things (IoT) wherelarge scale sensor networks are coordinated through edge com-puting, the appliances’ load can be analyzed using the smartoutlets which measure individual load data instead of a generalmeter. This setting eliminates the burden of disaggregatingindividual load data such that all computational resources canbe concentrated on appliance identification. Combined withthe emerging edge computing technique where a local serveris designed to implement computationally intensive tasks, thedeep learning classifier can thus be applied to increase theclassification performance. Our previous studies on IoT basedload control yielded the Grid Sense system which has beensuccessfully applied in several pilot projects in the operationof State Grid Jiangsu Electric Power Company in China [5].The Grid Sense system provides a hierarchical scheme thatintegrates IoT, edge computing, and NILM to stabilize the gridfrequency as well as optimize the grid performance. Specifi-cally, a large scale smart outlets networks are implementedto measure the load data and then send to a local serverthrough communication networks. The local server analyzesthe individual load data to compute the optimal load demandresponse strategy. For this practical Grid Sense system, wehave an urgent need to detect the type of the appliancesconnected to the smart outlets in a real-time manner in orderto better monitor and control the load demands, which is themain purpose of this paper. During the practical operation onseveral households in China, we noticed two major potentialimprovements: 1) Due to the limitation of the communicationnetwork, the real-time measurements (often up to 1MHz)are difficult to upload to the local server without delay. 2)Considering a nationwide implementation case, it is nearlyimpossible to collect enough data for all appliances to train acomprehensive NILM model.

Page 2: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

2

Firstly, to overcome the communication limit, a commonapproach in industrial IoT is to limit the data transmissionrate at a low level (e.g., 1Hz) by sampling the high-frequencydata [6]. However, the most recent machine learning-basedNILM algorithms required high frequency measurements [7].Therefore, it is more preferred to design a deep learning-basedmodel that can be used on low-frequency data. In the existingresearches for appliance identification, numerous features [4]are calculated as the input of the NILM model. Luckily, someof them considered the features for low frequency data, e.g.,the active and reactive power difference [8], the shape ofwaveform [9], running state sequences [10], and the powerfactor.

Secondly, we aim at reusing models to adapt to differentappliances to solve the lack of training data problems whilethe existing NILM models rely on a rich set of training datafrom all the target appliances during the training process [8],[10]. Due to the rapid growth of machine learning techniquesespecially in signal processing, recent studies of NILM areexploring algorithms based on Artificial Neural Networks(ANNs) for further improving the inference result [9]. How-ever, due to the variety of appliances in different households,it is unrealistic to collect enough labeled data to learn a com-prehensive model. Meanwhile, transfer learning, which reusesthe knowledge stored in the model to generate a new model,is an emerging technique in instruments and measurements[11]. Since the original model has been reused for training thenew model, transfer learning requires significantly less trainingdata compared with other learning algorithms. However, noneof the existing algorithms can provide a practical way oftransferring the trained model from one power consumptionscenario to another. There are several previous studies [12]tried to design models based on convolutional neural networksand LSTM that can implement transfer learning by retainingthe last few layers. These approaches require high samplingrate data, e.g. 30kHz in [12], which cannot be delivered by thecurrent smart plugs (1Hz) and smart meters. To break thesebottlenecks, we developed a novel Long short-term memory- Probabilistic Neural Network (LSTM-PNN) classifier whichimplements a two-level structure to infer the appliance type.

In summary, we seek a transfer learning-enabled deep learn-ing NILM algorithms for low-frequency measurements. Tobetter describe the task, we classify the transfer learning abilityfor NILM as 3 levels, i.e., 1) Transfer between the same typeof appliances with different power ratings, 2) Transfer betweendifferent types of appliances in the same category, which hassimilar electrical characteristics, 3) Transfer between differentcategories. In this paper, we aim at developing an algorithmto achieve level 1 and 2 by a joint LSTM-PNN model.Specifically, the model is transferred in three steps: 1) Preparethe input data to calculate features and generate a regularizedgreyscale image. The features are specially selected so thatthey are not related to the power rating. 2) Train the LSTMclassifier to identify the appliance category by the spatial andtemporal characteristics in the visualized grayscale data. 3)Transfer the template PNN to adapt the current appliance bymean shifting.

The contribution of this paper can be summarized as fol-

lows:• A novel LSTM-PNN NILM algorithm is proposed and

engaged with transfer learning techniques which caneffectively broaden the usage of the proposed design aswell as lower the requirements for training data.

• The proposed LSTM-PNN algorithm can efficiently iden-tify and monitor appliances even with the low-resolutiondata, which is compatible with the popular Grid Sensesystem.

II. FEATURE SELECTION AND DATA PREPARATION

A. Feature Selection

Feature extraction is one of the most critical parts ofNILM. Numerous types of features are summarized in surveyliteratures such as [4]. However, in this paper, we specificallyseek the features extracted from the low-resolution data, e.g., 1Hz sampling rate. For this reason, the features based on high-frequency measurements, e.g., the harmonic and frequencydomain analysis, are difficult to obtain due to the limitationof the communication bandwidth.

First, consider the target of level one transfer learning, weseek features that remain similar between the same type ofappliances with different power rating and also effective forlow-frequency measurements. First, the power factor (PF),which is only decided by the proportion of the inductive loadin the appliance, is considered as an important feature. Forexample, the 200W kettle and 50 W kettle should have thesame power factor near 1.0.

Second, due to the different functions of different appli-ances, the stability of the active power can also be different.For most electronics such as laptops, smart TVs, and so on,the power consumption is adjusted automatically to meet thedemand from users. Hence, the power variation is obviouswhen those appliances are running. However, for resistiveappliances, the power variation is negligible since the changein active power is only caused by the resistance change. Forinstance, Figs. 1(a) and 1(b) demonstrate the active powerdata of the incandescent lamp and laptop. The active powervariation of the lamp is clearly smaller than the laptop. Such adifference is caused by the functionality of the appliances thuscan be transferred in the same type of appliances. To measurethe variation of active power, we define the evaluation indexas the sum the first derivative of active power, i.e.,

α =

b−dt∑t=a

(pn,t+dt − pn,t) (1)

where pn, t represents the normalized active power at time t,dt represents the sampling interval a, b are the time durationof steady state. To further demonstrate the difference of activepower stability among different appliances, we collected theactive data of different appliances, that contains 100 ON/OFFevents, and list their averaged steady state power stability inthe Table I. From the Table I, we can clearly find the differencein active power stability, e.g., the incandescent lamps’ activepower are much more stable than others.

Page 3: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

3

(a) incandescent lamp (b) laptop

(c) collected fridge data (d) IAWE fridge data [13]

Fig. 1. Comparison of the active power of fridges, incandescent lamp, andlaptop

TABLE ICOMPARISON OF ACTIVE POWER STEADY STATE STABILITY

Fridge1 Fridge2Average 0.08 0.13

Hair dryer1 Laptop1Average 0.06 3.51

Laptop2 Incandescent lamp1Average 1.58 0.05

Incandescent lamp2 Microwave1Average 0.04 0.06

Monitor1 Vacuum1Average 0.13 0.07

Vacuum2 Kettle1Average 0.05 0.05

Next, the ratio of maximum power and average power isconsidered. When the appliances with motors are turned on, asudden power surge will occur due to the rotor switching fromstatic to dynamic status, and then turn to stable. This feature isespecially noticeable in brushed DC motors and AC motors.Figs. 1(c) and 1(d) depicts the active power plot of fridgesfrom both the test appliance and public data set, where theactive power surges have been marked by the red circles. Then,we can use the following formula to calculate the feature:

β =max(~pn)

ps(2)

with ~pn being the sequence of normalized active power, and psbeing the mean value of active power. Similarly, we measuredthis ratio for several appliances where the results have beenlisted in the Table II.

It is clear in Table II that the fridges and the vacuum2 have astronger power surge compared to other appliances. However,the ratio of max over average vacuum1’s power is even lowerthan laptop’s while the laptop has no motors. The active power

TABLE IICOMPARISON OF MAX POWER OVER AVERAGE POWER

Fridge1 Fridge2Average 4.17 2.46

Hair dryer1 Laptop1Average 1.00 1.47

Laptop2 Incandescent lamp1Average 1.08 1.00

Incandescent lamp2 Microwave1Average 1.06 1.01

Monitor1 Vacuum1Average 1.07 1.07

Vacuum2 Kettle1Average 1.56 1.01

TABLE IIICOMPARISON OF AVERAGED MAXIMUM POWER INDEX

Fridge1 Fridge2Average 1.00 6.03

Hair dryer1 Laptop1Average 80.86 25

Laptop2 Incandescent lamp1Average 56.52 14.54

Microwave1 kettle1Average 108 47.75

Monitor1 Vacuum1Average 12.08 1.00

Vacuum2Average 1.00

consumed by a laptop varies often due to the operation ofthe user, and thus causes the difference of active power andaverage power. However, by comparing Fig. 1(b) with 1(c) and1(d), we can observe that instead of random times, the powersurge of the fridge typically only appears at the beginning.Therefore, a new feature, i.e., the maximum active power indexis designed to deal with this issue.

γ = argmax~pn − ton (3)

where ton is the index when the appliance is on.The comparison of averaged maximum active power index

among different appliances can be found in the Table III.

B. Data Preparation

The input data for the LSTM and PNN are prepared sepa-rately. Firstly, the collected one-dimensional data is reformedas a grayscale image for the LSTM. The detailed process ofdata visualization is given as follows.

Step 1: Acquire the sequence of voltage, current, and activepower data using the smart outlet, and then calculate the powerfactor cos(θ).

Step 2: Normalize the voltage, current, active power, andreactive power with Min-Max feature scaling, i.e.,

Z ′ =Z − Zmin

Zmax − Zmin(4)

Page 4: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

4

with Z being the sequence to be normalized, Zmax being themaximum value of the sequence, and Zmin being the minimumvalue of the sequence.

Step 3: Augment the normalized sequences, i.e.,

XL = [U ′T I ′T P ′T cos(θ)T ]T ∈ R4×wz (5)

where U ′, I ′, and P ′ represent the normalized voltage, current,and active power sequences, respectively, and wz is a constantthat denotes the size of each sequence.

Step 4: Calculate the corresponding grayscale image by

IM =255XLXL,max

(6)

with XL,max being the maximum value in the augmented datamatrix.

Secondly, the input vector of PNN can be represented asXP = [P I cos(θ) α β γ]T ∈ R6, where cos(θ) P ,I represents the value averaged over the power factors, activepower, current when the appliance is ON, and other parametersare the features introduced in the last subsection.

III. THE LSTM-PNN BASED APPLIANCE CLASSIFICATIONALGORITHM

In this section, the proposed algorithm is introduced alongwith novel categorization methods for various appliances.Compared to existing deep neural networks based NILMalgorithms, such as [9], the proposed algorithm follows a two-stage setup where the LSTM is designed to recognize thecategories of the appliances while the Probabilistic NeuralNetwork (PNN) is used to further infer the appliance type.Figure 2 shows the block diagram of the developed algorithmwhere the input is the grayscale image, and the output is theappliance’s type. In addition, the PNN can be transferred fromthe appliances in one power consumption scenario to the sametype of appliances in different scenarios.

A. LSTM Neural Networks

Deep neural networks (DNN)s are widely used in imagerecognition and proved to be powerful for handling classifi-cation tasks by many pieces of research [14]. In this paper,a special DNN which combines the convolution layers andLSTM layers are constructed.

The grayscale image is input and filtered by the 2 × 2convolution. And then it is pooled by 2 × 2 max-poolinglayer. After repeating that process for two times, the resultingdata is flattened to 1-dimension. The flattened data is thensent to two LSTM layers with Relu activation functions toextract timing features. The number of neurons in the twoLSTM layers can be adjusted according to the output of thelast convolution layer. Eventually, the data is sent to the fullyconnected layer with a softmax activation function to get theprobability of classification. The number of neurons in thefully connected layer can also be adjusted according to theclassification performance.

In [12], the LSTM model has been transferred by retrainingthe last softmax layer along with a small amount of datafrom appliances in the target scenario. Although [12] proved

that the deep neural networks are effective for high samplingrate data, its performance for low sampling data is relativelypoor. Therefore, we only use the LSTM models to roughlyclassify appliance categories shown in Fig. 3 instead of theexact appliance type. The categories in Fig. 3 is designed basedon the appliances’ electrical characteristics where appliancesin the same category share the common features. For instance,appliances in category 1 are all resistive and the power factoris 1.00. By identifying the categories, the possibilities of theunknown appliance type will be narrowed down and furtheridentified by the transferred PNN.

B. PNN Classification Based on Transfer Learning

Due to the limitation from low-resolution data, the LSTMmodel cannot infer the specific type of the appliance accu-rately. Therefore, the Probabilistic Neural Networks (PNN) isintroduced to further infer the appliance type by building aprobability density function for different types of appliances.The PNN is essentially a Bayesian classifier that can beapproximated by the summary of a list of normal distributions[15]. To enable transfer learning in PNNs, we need to shiftthe mean of these normal distributions.

The k-th training instance of i-th appliance in thetraining set for the PNN includes 6 entries, i.e.,XP,ik = [Pik Iik cos(θik) αik βik γik]T , wherecos(θik), Pik, Iik represents the value averaged over thepower factors, active power, current when the appliance isON. Other parameters are the features introduced in sectionII. Each training instance in the training set represents themean of one radial basis function, i.e. Gaussian distributionfunction. Given an appliance j belongs to the same typewith i but the average power Pj is ∆P more than i’s, i.e.,Pj = Pi + ∆P , the training set of the j-th appliance can bederived as

XP,jk = XP,ik + ∆X,∀k = 1, 2, 3, · · · (7)

where ∆X =[∆P ∆P

Ucos(θik)0 0 0 0

]. By obtaining

the new training set XP,jk, the new activation functions inthe model for appliance j can be calculated by shifting themean of the original normal distributions in the pattern layer.Specifically, the transferred PNN model classifying the j-thappliance can be obtained by replacing the functions in thepattern layer [15] to the following functions as

y1jk = exp

[− (y0 − (XP,ik + ∆X))T (y0 − (XP,ik + ∆X))

2ξ2

](8)

By using the transfer method mentioned above, the PNNmodel learned from the i-th appliance can be transferred tothe same type of appliances j. Finally, after the transferredmodel is obtained, the detection process is illustrated in Fig.2.

IV. EXPERIMENTS RESULTS AND DISCUSSIONS

In this section, the proposed LSTM-PNN algorithm is testedon a practical testbed. A diagram of the hardware setup can

Page 5: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

5

Fig. 2. The diagram of the LSTM-PNN algorithm. The input active power, inactive power, and current are first prepared as the greyscale image and features.Then the greyscale image is sent to the LSTM neural network to identify the category. Finally, a PNN for that category is selected to infer the specificappliance type using the extracted features.

Fig. 3. The categories of appliances

be found in Fig. 4. Each appliance’s active power is measuredby a smart outlet, i.e,. SONOFF S31 smart outlet [16], andthen sent to the central data hub. The code in the SONOFFS31 has been rewritten to measure the voltage, current, andactive power at the 1Hz sampling rate and send the dataout using the MQTT protocol. A wireless mesh network hasbeen constructed using a router that serves as the central datahub to distribute the data into a processing computer wherethe proposed NILM algorithm runs. Based on the categoriesshown in Fig. 3, several appliances are selected from differentcategories to evaluate the performance of the algorithm. Inorder to evaluate the model’s transferable performance, weselect at least two appliances from each appliance type, one ofwhich is used to train the NILM model as ground truth and theother one is used as the evaluating device. These two deviceswill have different power ratings. It is worth noting that wedon’t use any data from the test appliances while training themodel.

Two experiments are carried out. The first experiment teststhe transferability at level 1, where the types of appliancesare similar to the training appliances but with different powerratings. The other one tests the transfer learning performanceat level 2 where different appliances in the same categoriesare selected. The evaluation procedure of most appliances isdesigned as: turn on, hold for 3 minutes, turn off, and thenhold for 3 minutes. Each test appliance will run such test

circles five times hence the test time of each appliance is 30minutes. During testing, a buffer of 2 minutes of data pointsis maintained. Every second, the LSTM-PNN algorithm willbe applied to the buffer and a new measured data will replacethe oldest data in the buffer. Additionally, the fridge and AC’sprocedure is different than the regular test circle because theircompressors do not turn on every time when it’s powered on.Instead, they are kept on continuously for 2 hours and onlythe data includes compressor on and off are used.

The detailed experiment procedure is given as:1) Training: Collect the necessary training data from thetraining appliances using the smart outlet to train the model.The selected appliances include (1) C1: kettle, (2) C2: lamp,(3) C3: fridge, (4) C4: vacuum cleaner, (5) C5: laptop, (6)C6: monitor, (7) C7: phone charger where the “Ci” representsappliance category number i introduced in Fig. 3.2) Test 1: Test with the training data.3) Test 2: Experiment of the same type of appliances withdifferent power ratings to test the transferability at level 1.4) Test 3: Experiment of different types of appliance to test thetransferability at level 2. The newly added appliances include(1) C1: stove, (2) C3: AC, (3) C6: smart TV, (4) C5: desktop,(5) C7: small toy.

We evaluate the proposed algorithm’s performance by theconfusion matrix and other metrics calculated as :

recall =TP

TP + FN(9)

precision =TP

TP + FP(10)

accuracy =

∑TP +

∑TN∑

T(11)

where TP denotes the number of true “on” event classifica-tions, FP denotes the number of false “on” event classifica-tions, FN denotes the number of false “off” event classifica-tions, and T denotes the number of total samples.

To demonstrate the performance, the normalized confusionmatrices are plotted, e.g. Fig. 5. In Fig. 5, the rows represent

Page 6: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

6

Fig. 4. The diagram of experiment hardware test set

Fig. 5. Test 2 confusion matrix, recall, and precision

the actual class and columns denotes the predicted classes. Thepercentage in the main confusion matrix block represents theratio of that categories’ instance number over all data. On theright side of the main block, the recalls are calculated. Andthe the precisions are listed below the main block.

The results of test 1 show 100% accuracy thus omitted. Intest 2, the trained model is transferred by the PNN transferlearning method and tested on similar appliances. The con-fusion matrix, recall, precision is shown in Fig. 5. And theoverall accuracy for test 2 is 92%. Test 2 has demonstratedthat the transferred model responds to several appliances suchas kettle (C1), lamp (C2), vacuum cleaner (C4), monitor (C6),and phone charger (C7). However, some fridges (C3) are miss-classified as lamp (C2) and laptop (C5). It is expected becausethe fridge used for testing is a smart fridge which has a smartcontrol unit and a light bulb. Even when the compressor is notrunning, the smart control unit works occasionally which canbe classified as the laptop. Moreover, when the fridge door isopened, a light bulb is powered on to illuminate the inside.These parts on the fridge has caused trouble for classification.The same thing appears on the laptop (C5) miss-classifiedas a monitor (C6) because a laptop has a built-in monitor.This reveals that the integrated appliances, especially multi-sate ones, are easy to be miss-classified by the current features.However, for most multi-state appliances such as the fridge,

Fig. 6. Test 3 confusion matrix, recall, and precision

the active power of different components varies greatly (e.g.the compressor’s power is larger than light bulb and smartcontrol unit). Therefore, in the future, it’s promising to usethe events associated with the largest active power to calculatethe features so that the effects from small components can beeliminated.

Next, the transferred model is tested with different typesof appliances in test 3. The confusion matrix, recall, andprecision are shown in Fig. 6. The overall precision is 64%.By observing recall in Fig. 6, it is not difficult to see thatthe stove (C1) and desktop (C5)’s performance significantlydropped. The stove is miss-classified as AC (C3) and vacuumcleaner (C4) because the active power of the stove is not asstable as the kettle. And the desktop (C5) is miss-classified asAC (C3) and smart TV (C6) because both of AC and smart TVhave a build-in computer. Therefore, the main issue that affectsthe transfer models to be used is the growing development ofthe smart appliances. They usually have computers build in sothat their active power may show similar features which arethe electronics feature. This remains a problem to be solvedin the future.

Finally, the proposed algorithm’s performance are comparedwith both transfer learning and non-transfer learning state-of-art algorithms. Similar to this paper, the authors in [12] useda pretrained deep neural network named the AlexNet and thenretrained the last fully connected layer using the appliance datafrom a new dataset. This algorithm is claimed as a transferlearning approach because the AlexNet is a pretrained neuralnetwork and model transfer will be realized by retraining thelast fully connected layer of the NN. However, the transferlearning method proposed in this paper is significantly dif-ferent than [12] because it still requires a small amount oftraining data whereas the developed algorithm only requiresone instance of data to transfer the model. In other words, thedeveloped algorithm in this paper focuses on a more practicalscenario, i.e., the users need only one confirmation to eachappliance rather than label lots of data. Then, two state-of-the-art non-transfer learning method has also been included forcomparison. [17] proposed to use random forest (RF) to infer

Page 7: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

7

Fig. 7. The comparison of accuracies.

TABLE IVCOMPARISON OF ALEXNET [12] AND THE PROPOSED ALGORITHM

Algorithm Retrain instances AccuracyLSTM-PNN 1 92.27%AlexNet[12] 0 23.82%AlexNet[12] 1133 99.05%

the appliances from the V-I trajectory plot. [18] utilizes multi-layer perceptron (MLP) to classify the appliances. All thesealgorithms are tested on the PLAID dataset [19]. Since wereevaluating the classification score based on the categories, theappliances in the PLAID dataset has been included in the 7categories as:• C1: Heater• C2: Compact fluorescent lamp (CFL), Incandescent light

bulb (ILB)• C3: Air conditioner (AC), Fridge, Washing machine

(WM)• C4: Fan, Hairdryer, Vacuum• C5: Laptop, Microwave

Note that therere no appliances in the PLAID dataset fall intothe C6 (monitor) and C7 (small appliances).

The overall accuracies of all algorithms are plotted in Fig.7. Its clear to see that the proposed algorithm outperforms alltraditional algorithms but is still slightly worse than AlexNet(-6%). Note that even with transferred models, the proposedalgorithm still outperforms the traditional non-transferred al-gorithms.

Now, let’s evaluate the performance between the two trans-fer learning algorithms under the same practical scenariowhere the user provides only one instance of the labeled datafor each appliance. In [12], the authors tried to apply the modeltrained using the PLAID dataset to another dataset (WHITED)directly. This test is similar to the test 2 for the proposedalgorithm. The only difference is that the proposed algorithmutilized that one labeled sample but the AlexNet doesnt. Theoverall accuracy is listed in table IV.

In table IV, its not difficult to observe that the AlexNetperforms better when it has enough dataset to retain the lastlayer. Retraining the last layer of a pretrained deep neuralnetwork is indeed called transfer learning in many other

applications such as image recognition. It has also been provedthat this method is useful in reducing the training set size togenerate a new model. However, unlike the image recognitiontasks, the NILM requires the algorithm to interact with the useras less as possible. The ideal case would require no interactionat all but that is very difficult and even impossible at thecurrent stage. Compared with [12] which asks the user to label1133 data instances, the developed algorithm is more realisticby asking the user once about each appliance. Therefore, theproposed algorithm provides a realistic method to regeneratea model which has reasonable accuracy.

V. CONCLUSIONS

This paper proposed a novel non-intrusive load monitoring(NILM) algorithm based on LSTM-PNN and transfer learning,and further tested using a smart outlet. In the developed two-stage scheme, the LSTM is first used to automatically extractthe lower special and temporal features of the appliances’augmented data matrix. Then, the hand-picked transferablefeatures are used in PNN to determine the appliance type. Un-like the traditional NILM algorithms, the proposed method isbased on the limited measurement, i.e. 1Hz sampling rate data.Moreover, the proposed model can be easily transferred toother appliances without a tedious retraining process. Besidescomputer-aid simulation, the developed algorithm has alsobeen tested through the real-time Smart outlet hardware whichis more comprehensive for demonstrating its effectiveness.Through comparing with the latest NILM research works, thetest results showed that the proposed online transfer learning-based intelligent NILM algorithm can better identify andmonitor a variety of energy appliance under various scenarioseven with limited measurements. In the future, the proposedalgorithm will be improved to adapt to multi-state appliances.Moreover, we notice that it is promising to bring the coloredV-I trajectory feature [12] to the developed algorithm forimproving the accuracy.

REFERENCES

[1] D. Egarter, V. P. Bhuvana, and W. Elmenreich, “Paldi: Online load dis-aggregation via particle filtering,” IEEE Transactions on Instrumentationand Measurement, vol. 64, no. 2, pp. 467–477, 2014.

[2] Y. Xiang, Z. Yi, X. Lu, Z. Yu, D. Shi, C. Xu, X. Li, and Z. Wang,“Distributed frequency emergency control with coordinated edge intel-ligence,” arXiv preprint arXiv:2002.10429, 2020.

[3] Y. Li, B. Hu, K. Xie, L. Wang, Y. Xiang, R. Xiao, and D. Kong,“Day-ahead scheduling of power system incorporating network topologyoptimization and dynamic thermal rating,” IEEE Access, vol. 7, pp.35 287–35 301, 2019.

[4] A. Zoha, A. Gluhak, M. A. Imran, and S. Rajasegarar, “Non-intrusiveLoad Monitoring approaches for disaggregated energy sensing: A sur-vey,” Sensors (Switzerland), vol. 12, no. 12, pp. 16 838–16 866, 2012.

[5] Y. Xiang, X. Lu, Z. Yu, D. Shi, H. Li, and Z. Wang, “Iot andedge computing based direct load control for fast adaptive frequencyregulation,” in IEEE PES General Meeting, 2019.

[6] M. Rizzi, P. Ferrari, A. Flammini, and E. Sisinni, “Evaluation of theiot lorawan solution for distributed measurement applications,” IEEETransactions on Instrumentation and Measurement, vol. 66, no. 12, pp.3340–3349, 2017.

[7] J. Alcala, J. Urena, A. Hernandez, and D. Gualda, “Event-based energydisaggregation algorithm for activity monitoring from a single-point sen-sor,” IEEE Transactions on Instrumentation and Measurement, vol. 66,no. 10, pp. 2615–2626, 2017.

[8] G. W. Hart, “Nonintrusive appliance load monitoring,” Proceedings ofthe IEEE, vol. 80, no. 12, pp. 1870–1891, 1992.

Page 8: A Novel Transfer Learning based Intelligent Non-intrusive ... Novel Transfer... · approach in industrial IoT is to limit the data transmission rate at a low level (e.g., 1Hz) by

8

[9] J. Kelly and W. Knottenbelt, “Neural nilm: Deep neural networksapplied to energy disaggregation,” in Proceedings of the 2nd ACMInternational Conference on Embedded Systems for Energy-EfficientBuilt Environments. ACM, 2015, pp. 55–64.

[10] J. Z. Kolter and T. Jaakkola, “Approximate inference in additive factorialhmms with application to energy disaggregation,” in Artificial Intelli-gence and Statistics, 2012, pp. 1472–1482.

[11] K. Weiss, T. M. Khoshgoftaar, and D. Wang, “A survey of transferlearning,” Journal of Big data, vol. 3, no. 1, p. 9, 2016.

[12] Y. Liu, X. Wang, and W. You, “Non-intrusive Load Monitoring byVoltage-Current Trajectory Enabled Transfer Learning,” IEEE Transac-tions on Smart Grid, vol. PP, no. XX, p. 1, 2018.

[13] N. Batra, M. Gulati, A. Singh, and M. B. Srivastava, “It’s different:Insights into home energy consumption in india,” in Proceedings ofthe 5th ACM Workshop on Embedded Systems For Energy-EfficientBuildings, 2013, pp. 1–8.

[14] V. A. Sindagi and V. M. Patel, “A survey of recent advances in cnn-based single image crowd counting and density estimation,” PatternRecognition Letters, vol. 107, pp. 3–16, 2018.

[15] D. F. Specht, “Probabilistic neural networks for classification, mapping,or associative memory,” in IEEE international conference on neuralnetworks, vol. 1, no. 24, 1988, pp. 525–532.

[16] “Sonoff s31 smart plug,” May 2020. [Online]. Available: https://sonoff.tech/product/wifi-smart-plugs/s31-s31lite

[17] Z. Zheng, H. Chen, and X. Luo, “A supervised event-based non-intrusiveload monitoring for non-linear appliances,” Sustainability, vol. 10, no. 4,p. 1001, 2018.

[18] J. Gao, E. C. Kara, S. Giri, and M. Berges, “A feasibility study ofautomated plug-load identification from high-frequency measurements,”in 2015 IEEE Global Conference on Signal and Information Processing(GlobalSIP). IEEE, 2015, pp. 220–224.

[19] J. Gao, S. Giri, E. C. Kara, and M. Berges, “Plaid: A public dataset ofhigh-resolution electrical appliance measurements for load identificationresearch: Demo abstract,” in Proceedings of the 1st ACM Conferenceon Embedded Systems for Energy-Efficient Buildings, ser. BuildSys ’14.New York, NY, USA: ACM, 2014, pp. 198–199. [Online]. Available:http://doi.acm.org/10.1145/2674061.2675032

Zejian Zhou received the Master’s degree in Elec-tric Engineering from the Stevens Institute of Tech-nology, New Jersey. Since 2017 fall, he is pursuinghis Ph.D. degree and is working as a researchassistant at the Electrical & Biomedical Engineeringdepartment in University of Nevada, Reno. His re-search interests include smart grid monitoring, multi-agent systems, and transfer learning.

Yingmeng Xiang (S11-M18) received the B.S. de-gree from Chongqing University, Chongqing, China,in 2010, M.S. degree from the Huazhong Univer-sity of Science and Technology, Wuhan, China, in2013, Ph.D. degree from University of Wisconsin-Milwaukee, Milwaukee, WI, USA, in 2017. He iscurrently a power system research engineer withGlobal Energy Interconnection Research InstituteNorth America (GEIRINA), San Jose, CA, USA.His research interests include IoT for power systems,artificial intelligence, smart grid reliability, cyber-

physical system resiliency. He is an Associate Editor of the IEEE Transactionson Smart Grid.

Hao Xu (M12) was born in Nanjing, China. Hereceived the masters degree in electrical engineeringfrom Southeast University, Nanjing, in 2009, andthe Ph.D. degree in Electrical Engineering fromthe Missouri University of Science and Technology,Rolla, MO, USA, in 2012. He is currently an As-sistant Professor with the Department of Electricaland Biomedical Engineering, University of Nevada,Reno, NV, USA. His current research interests in-clude intelligent control design for advanced powersystems, smart grid, autonomous unmanned aircraft

systems, and wireless passive sensor network.

Zhehan Yi (S13M17) received the B.S. degree inelectrical engineering from Beijing Jiaotong Uni-versity, Beijing, China, in 2012, and the M.S. andPh.D. degrees in electrical engineering from TheGeorge Washington University, Washington, DC,USA, in 2014 and 2017, respectively. He is cur-rently a senior research engineer with GEIRI NorthAmerica, San Jose, CA, USA. His research interestsare power system dynamics and control, IoT andenergy blockchain, machine learning, and renewableintegration. He is an Associate Editor of IEEE

Access.

Di Shi (M12SM17) received the Ph.D. degree inelectrical engineering from Arizona State University.He is currently the Department Head of the AI&System Analytics Group, Global Energy Inter-connection Research Institute North America (GEI-RINA), San Jose, CA, USA. Prior to joining GEI-RINA, He was a Research Staff Member with NECLaboratories America. His research interests includePMU data analytics, AI, energy storage systems, theIoT for power systems, and renewable integration.He is an Editor of the IEEE Transactions on Smart

Grid and the IEEE Power Engineering Letters.

Zhiwei Wang (M16-SM18) received the B.S. andM.S. degrees in electrical engineering from South-east University, Nanjing, China, in 1988 and 1991,respectively. He is President of GEIRI North Amer-ica, San Jose, CA, USA. Prior to this assignment, heserved as President of State Grid US RepresentativeOffice, New York City, from 2013 to 2015, andPresident of State Grid Wuxi Electric Power SupplyCompany from 2012-2013. His research interestsinclude power system operation and control, relayprotection, power system planning, and WAMS.