# Hierarchical Modelling for CO\({}_{2}\) Variation Prediction for HVAC System Operation
## 1 Introduction
The predictions of CO\({}_{2}\) concentration changes reveal two things about the environment, both signalling changes in the ventilation demands of the indoor environment. The lagged effect of the current collective occupants' respiration can be reflected in the prediction of CO\({}_{2}\) concentration changes. Similarly, due to its hysteresis property, the prediction of CO\({}_{2}\) concentration changes shows the lagged effect of the current ventilation controls on indoor CO\({}_{2}\) concentrations [20]. Therefore, these predictions serve to piece together different parts of the indoor environment that can aid DCV in producing an informed decision about its activity. As a result, the optimization of HVAC system energy consumption while maintaining the indoor occupants' comfort is a downstream effect of accurate predictions of the variation in CO\({}_{2}\) concentrations [23]. The reduction in HVAC system energy consumption aligns with the overall sustainability goals of reducing the buildings' carbon footprint. The abundance of computing resources and the miniaturization of sensors have promoted the implementation of Machine Learning (ML) and Deep Learning (DL) applications in estimating indoor environmental conditions using different sensors [24]. The state-of-the-art approaches to predicting occupancy lack the incorporation of time dependencies or suffer from transferability issues. Therefore, to address these issues, this paper proposes a Hierarchical Model for CO\({}_{2}\) Variation Predictions (HMCOVP), which divides the problem of predicting CO\({}_{2}\) variations into two complementary sub-problems, each solved using supervised Machine Learning (ML) techniques. The first sub-problem uses lagged versions of time-series environmental features transformed into images to predict the variations' future direction, which can be increasing, decreasing, or constant. The second sub-problem combines the predictions of the first step with the historical difference between the minimum and maximum value (e2s) of the feature to predict the variations in CO\({}_{2}\) concentrations in a pre-defined time window. The proposed framework serves to achieve two main goals. The first goal is to accurately predict the CO\({}_{2}\) variations. The second goal is to facilitate the transferability of the model to other buildings or rooms, which is a missing component in state-of-the-art implementations. The second goal is achieved by the framework's hierarchical structure that enables the fine-tuning of specific blocks of the proposed architecture. The HMCOVP is applied to a publicly available dataset [25], encompassing CO\({}_{2}\) levels, humidity, pressure, temperature, and Passive Infrared (PIR) Count, and its transferability is evaluated in different spatial settings. The main contributions of this paper are as follows:  
* Propose a hierarchical framework, including Convolutional Neural Networks (CNNs), transfer learning, and supervised learning that accurately predicts CO\({}_{2}\) variations to serve as proxy estimators of occupancy and provide feedback about the utility of the current ventilation system controls;
* Utilize a novel time-series-to-image data transformation strategy that reflects the time-correlation aspect of time-series data in general and environmental sensory data in particular;
* Evaluate and compare the proposed approaches with state-of-the-art approaches applied to the same dataset in terms of prediction accuracy using different history and future time windows;
* Evaluate the proposed approach to different office spaces using transfer learning and re-tuning techniques. The rest of the paper is organized as follows. Section 2 discusses the related work to shed light on the novelty of this manuscript. Section 3 explains some preliminaries pertaining to the dataset. Section 4 describes the different steps of the proposed methodology. Section 5 details the experimental procedure. Section 6 investigates the results of applying the proposed methodology, and Section 7 concludes the paper.