Machine Learning-Based Approach to Predict Energy Consumption


Conservation of energy has always been one of the foremost concerns for the entire society. As traditional energy sources decline, renewable energy solutions are becoming the need of the hour. Zunroof has been at the forefront of these issues by providing sustainable energy solutions. However, there are some barriers pertaining to practicing energy conservation at an individual level due to a lack of detailed knowledge of energy consumption patterns.

There are two techniques to measure the energy consumption of individual appliances.  Intrusive Load Monitoring uses individual smart devices for every appliance in the house but, this method increases the complexity of the household electrical framework and is very expensive (as multiple smart devices are required to monitor the respective appliances). On the other hand, Non-Intrusive Load Monitoring (NILM) technique can provide the energy consumption data of individual appliances without having sensors for each appliance. This technique requires only one smart meter/device to collect the energy consumption data for all appliances in a house. NILM technique can decipher and disintegrate it into the consumption data of individual appliances which can reduce network complexity and cost.

The significance of this innovation is that the information on each appliance is more valuable to the consumer, as compared to information for the overall household energy consumption. It has been scientifically proven that such user feedback brings about conscious changes in the consumption behavior of households to improve user efficiency.

Background/Related Work:

You might think, ‘Oh, the history! Why don’t we jump directly to the current timeline?’

But the current status has evolved gradually from it’s previous stages. It will give you more insights and alternate ways to progress. Here’s a quick look at the background.

There are several ways of categorizing NILM approaches. For example, one way of categorization can be into supervised and unsupervised techniques:

  • Supervised NILM uses measurements of every single appliance to build its respective model, thereby performing disaggregation. It is assumed that access to measurements of each appliance is available beforehand.
  • Unsupervised NILM does not require measurements of each appliance for its training. This approach involves standard appliance models as input, and such models might be further tuned to each test case.

Disaggregation algorithms are generally categorized into two segments: pattern recognition and optimization.

  • Pattern Recognition is based on the detection and classification of events. This methodology relies on the extraction of device-specific signatures/ events in certain features of the data. As an example of features to be extracted, we have the active and reactive power, harmonics, to name a few. These events are further classified by well-established classifiers used in Machine Learning and Deep Learning. 

A vital advantage of these methods is that they provide better results in the presence of unknown loads. However, these methods are sensitive to detecting false edges that arise from noise or non-linear loads.

Past work in this segment is related to extracting specific appliance features (like active and reactive power), using them to train machine learning algorithms (like k-NN, fuzzy nets, and decision trees), and using them to predict the patterns of unlabeled datasets.

  • Eventless/Optimization methods are based on the simultaneous matching of multiple loads. These algorithms try to identify the state of appliances by comparing different combinations with the recorded data. These methods provide better disaggregation performance and are less sensitive to edge detection. However, they are more susceptible to the fundamental problem that a complete set of operating states is never known. If such models are used in the presence of unknown appliances, they will attempt to describe their behavior as a combination of other known appliances.

Past work based on eventless methods includes methods based on probabilistic models like Hidden Markov Models (HMM). Other methods, such as integer programming, sparse coding, and genetic algorithms have also been used.

Overview of our work:

It was an enlightening path to attain this progress. Now let’s talk about the current status with a small overview

Currently, we are focusing on high power consumption devices. This is because a consumer can benefit more by knowing the information on consumption of high power-consuming devices owing to greater avenues for energy savings. Among the high-power consuming devices, we aim to predict the consumption of Heating, Ventilation, and air conditioning (HVAC) systems. HVAC systems maintain the temperature and quality of air to an acceptable and comfortable value. One of the main components of an HVAC system is the air conditioner (AC). The figures below illustrate typical power consumption patterns of non-inverter and inverter AC units respectively.

Smart Bulb
Smart Downlight
Smart Camera
Smart Security
Smart Doorbell
Smart Door Lock
Smart AC Remote
Smart TV Remote
Smart Energy Monitor
Smart Striplight
Smart Plug

A non-inverter AC unit compressor works in two states – ON and OFF. An inverter AC can regulate the speed of the compressor. On the other hand, for a non-inverter AC, the compressor runs only in ON state (when the AC is ON) and turns OFF when the required temperature is reached. An inverter AC continuously keeps the compressor ON but adjusts its speed according to the temperature difference in the ambient and required conditions. These operational patterns are captured in the power, delta power (power consumed in a specific time period), and reactive power graphs shown above.

We further describe the basic workflow of our prediction algorithm for energy consumption of an AC. Firstly, the data recorded from the smart meter is fed into a model, which identifies whether a specific device is in ON or OFF state. Furthermore, this information, along with the smart meter data, is passed to a separate model, which further predicts the actual energy consumption for that device. We have worked with multiple Machine Learning algorithms to perform energy disaggregation. We develop independent models for every individual appliance to ensure that the performance of one appliance does not interfere with the other. 

The confusion matrix resulting from the evaluation of the classification model is as follows:

Actual ONActual OFF
Predicted ON1088610
Predicted OFF213077
Confusion Matrix for XGBoost Based Classification Model

As mentioned in the table below, the classification accuracy comes out to be≃ 99.8%

Also, the error of the model is ≃ 0.02%

This signifies that our classification model is able to predict whether the AC is ON or OFF almost every time. Then, we send the data points when the AC is ON to the regression model which predicts the actual energy consumption of the appliance (one or more ACs).

The table below depicts a comparison of different ML techniques for predicting the energy consumption of a non-inverter AC:

Algorithm UsedClassification accuracyRMSE (Day aggregated)(Watts)
Linear Regression90%1500
Random Forest98%800

Ohh… data, data, data, and more data! You must be tired, no?!
Hold your horses, we are approaching the more interesting bit.

Benefits of NILM:

Now let’s look at the benefits of NILM (the real reason of going through all the hardships!)

  • NILM is helpful as it can detect the power consumption patterns for each appliance. Households can save electricity by improving their consumption plan according to the information provided by NILM. The same information can help users check and eliminate electrical failures. It can also help in making decisions on the replacement of low-efficiency electrical appliances.
  • Energy management of micro-grids is critical to implement load schedules & demand response models and maximize renewable energy utilization. However, current microgrid energy management technology is stochastic from the demand side, and it ignores a certain level of flexibility. NILM can provide flexible real-time energy information for microgrid energy management.

Key challenges in NILM:


There are challenges in NILM too. Let’s track them down.

A practical NILM system has five requirements: (1) compatibility of feature selection, (2) decent algorithm accuracy, (3) capabilities of near real-time data management, (4) feasible scalability, and (5) identification of various appliance types (ON-OFF types, finite-states, various states, permanent load). For these requirements, we list some key issues to consider:

Data Acquisition:
  • One requires intelligent devices connected to the internet for the entire day (24*7) for data acquisition. This poses a constraint because connectivity/ power disruptions can hamper the acquisition process.

Also, while acquiring data from multiple sources, it is crucial to standardize the measurement values to a common base point for practical processing moving forward.

The acquisition process is often expensive and time-consuming too.

Robust disaggregation framework:

Various algorithms have been implemented to improve the accuracy of distinctive load features, ranging from fundamental power analysis to hybrid programming solutions. There still exists a case to be made for the improvement of robust algorithms, especially in regards to resolving constraints of unknown appliances, similar load behaviors, and unknown house energy consumption.

Current Work and Conclusion:

Now it’s time for the conclusion!

We are currently focusing on expanding our algorithms to more appliances (especially HVAC). However, data acquisition is a barrier to this process. Hence, we focus on building synthetic data to mitigate the issue.

We are also experimenting with the implementation of Deep Neural Network models (RNN architectures)/Bayesian Optimization techniques (for tuning the model) for gaining outperformance over our current xgBoost model. 

NILM technology has the potential to pave the way for a disruptive change in the smart appliances domain. It has given a tremendous boost to energy management and energy efficiency at the appliance level. Such a methodology can provide monetary savings, energy savings, and several benefits to the environment. 

Related Posts


  1. excellent post, very informative. I wonder why the other experts of this sector don’t notice this. You should continue your writing. I am confident, you have a huge readers’ base already!

  2. Having read this I believed it was rather informative. I appreciate you spending some time and energy to put this informative article together. I once again find myself spending way too much time both reading and posting comments. But so what, it was still worth it!

Leave a Reply

Your email address will not be published. Required fields are marked *