A Data Filling Methodology for Time Series Based on CNN and (Bi)LSTM Neural Networks
Kostas Tzoumpas, Aaron Estrada, Pietro Miraglio, Pietro Zambelli
Abstract
In the process of collecting data from sensors, several circumstances can affect their continuity and validity, resulting in alterations of the data or loss of information. Although classical methods of statistics, such as interpolation-like techniques, can be used to approximate the missing data in a time series, the recent developments in Deep Learning (DL) have given impetus to innovative and much more accurate forecasting techniques. In the present paper, we develop two DL models aimed at filling data gaps, for the specific case of internal temperature time series obtained from monitored apartments located in Bolzano, Italy. The DL models developed in the present work are based on the use of both pre- and post-gap data, and the exploitation of a correlated time series (the external temperature) in order to predict the target one (the internal temperature). The first model consists of two twin networks, each of which is a combination of Convolutional Neural Networks (CNN) and Long Short-Term Memory Neural Networks (LSTM), which are run in opposite directions on the time series data and whose predictions for the data gap are interpolated using a sigmoid function. The second DL model we developed, instead, is a single-network combination of CNN and Bidirectional LSTM (BiLSTM). Both our models succeed in capturing the fluctuating nature of the data and show good accuracy in reconstructing the target time series. The results they achieve, both in terms of error metrics and of <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">R</i> <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup> -score, are better than those of a simpler DL architecture proposed in the literature for a similar scope, that we take as a baseline. Comparing our two models, the CNN-BiLSTM outperforms the CNN-LSTM, indicating a more effective way of combining past and future information, which is learnt from the data, than the explicit interpolation via sigmoid function of onward and backwards predictions.