Ground truth human activities are not provided, our first step is to make reasonable assumptions about human activities from plug-level power consumption data. 2012-06-03 plugs data is shown below, 12 appliances power consumption data is visualized in red lines against time from 0:00 to 24:00.
Our first goal is to find appliances capable of representing human activities. Thresholds are used to decide the on/off states of their activities. For example, if Dishwasher/Kettle power consumption exceeds 100 w, we say that kitchen work is ongoing.
In our project, we split our data set into train set, validation set and test set. The training set and validation sets are used during training, once training is finished, we run against our test set and verify that the accuracy is sufficient. Specifically, we split data set so that 80% would be training and validation set, 20% would be test set. For training and validation set, we do 10 fold cross-validation and observe statistics including accuracy scores across 10 folds and importance of features. For test set, we apply our classifier on it and show f1-score, confusion matrix and accuracy score.
Different from human occupancy prediction, we only use smart meters power consumption to predict human occupancy, however we evaluate results for two different sets of features.
In the Using smart meters power consumption to predict human occupancy section in Human Occupancy Prediction page, we extracted min, max, range, mean, standard variation, correlation, onoff statistics for each type of four power, as well as sad12, sad13, sad23 across phases of power. We inherit the same features here for comparison.
We scan through a 15 min time window, find the power consumption and increase the count of corresponding power bucket by 1, and use power buckets as features for human activities prediction.
Here is an example, for 2012-06-06 smart meter or plugs data, the power consumption range is 0~2000 w, the time window is 15 min. We construct 40 power buckets, each accommodate up to 50 w. The bar chart is shown below. Six bar charts show the power distribution of six combination of states: No activities, Dishwasher/Kettle+Laptop, Laptop, Entertainment+Laptop, Entertainment+Lamp+Laptop, Lamp. From the bar chart we can see that power consumption is likely to have lower mean and standard deviation with lamp working, but a higher mean and standard deviation when dishwasher/kettle is involved. Thus, with proper classification method trained on these features, it is prospective to achieve good classification results.
Also, as what we have implemented in human occupancy prediction, to make sure that the classifier is not overfitting the data, we divide the data into training, validation and test sets.
We have more than 23000 sets of data this time. Firstly we use 80% data to train the model and verify the model using the 10-cross validation. Then we test the model with the remaining 20% of data, which is the test set.
The figure below shows the 10-cross validation results of using MLP, KNN, SVM and Random Forest. We can see that the Random Forest still gives the best performance of prediction, which has 85% average accuracy and 0.0006 variation, KNN is the runner-up, which gives 82% average accuracy. The performance of MLP only has 66% average accuracy. For SVM, even though it gives 63% average accuracy, but we can easily find from the figure that it gives almost totally incorrect result for one set of validation data, which is really unacceptable.
We using the similar way to train and test the 4 classifiers and predict the human activities. Compared to the features we use in the previous prediction methods, the features we use here look more straightforward for predicting the human activities. We generate the power distribution features by slicing the power consumption into 80 power slots in order to let the power consumption of different appliances fall into different slots. The prediction result by this method gives a similar performance with the previous one.
We can see that the Random Forest gives the best performance of prediction, which has 80% average accuracy and 0.0006 variation, KNN is the runner-up, which gives 78% average accuracy. The performance of MLP and SVM have some improvement. MLP gives a 74% average accuracy and SVM has 71%. Importantly, SVM does not have the similar problem we find in the previous method.
The two methods are based on two ways to get features. The first one tries to use absolute value and variablity of power consumption as feature and the second one tries to get into the power consumption and use the power distribution information. However, the results present that the two methods give out similar prediction accuracy. In detail, the first method has higher best prediction accuracy but the prediction is less stable than that of the second method.