Variational Autoencoders for Anomaly Detection and Transfer Knowledge in Electricity and District Heating Consumption
Zahraa Khais Shahid, Saguna Saguna, Christer Åhlund
Abstract
Real-time anomaly detection in energy consumption supports identifying issues related to technical and user behaviour that result in significant energy waste. It enables end users to provide feedback, which could contribute to reducing drift operation costs and saving energy in the building. Detecting anomalies relies mainly on learning patterns in past consumption behaviours over the years, where historical data can be difficult to obtain. Therefore, a method is proposed to evaluate different learning settings of consumption behaviour to build an anomaly detection system that can be generalised to different school buildings with similar characteristics. This study proposes deep learning reconstruction models to detect anomalies in daily energy consumption data for nine school buildings. The performance of three proposed models, the RNN-LSTM autoencoder, the CNN-LSTM autoencoder, and the Variational Autoencoder (VAE), was evaluated to learn the characteristics of normal consumption and detect anomalies based on reconstruction error in an unsupervised manner. The Exponential Moving Average (EMA) and static threshold were used to detect local and global anomalies. The experimental results demonstrate that the local CNN-LSTM autoencoder performs better than the local Stacked Autoencoder (AE).When trained on aggregated training data sets from schools with comparable energy usage and building characteristics, the VAE model outperforms the local model. In addition, the transfer of knowledge gained from a previous task is evaluated to detect anomalies in the target dataset of other schools that have few or no training data sets. Most of the evaluated school buildings show results comparable to those of the Building Dependent (BDM) approach, where the school buildings' reference as well as target datasets are included in the trained model.