# Hierarchical Modelling for CO\({}_{2}\) Variation Prediction for HVAC System Operation
## 4 Method: Hierarchical Model for CO\({}_{2}\) Variation Predictions (HMCOVP)
### Individual Learners  
The GAF images resulting from the time-series transformation process reflect the correlation by colour intensities. In their turn, these intensities translate the time correlation aspect of environmental sensory data through spatial resolution. CNNs, one of the variations of DNNs, are a strong candidate to find patterns in the produced grid-like structures and the output variable of concern. This selection stems from a CNN's capability to infer spatial dependencies in a gird-structured input via its filters that extract specific features. Moreover, a CNN's architecture is characterized by its sparse connections and weight sharing, which enables any developed model to be swiftly retrained and tested [40] compared to other resource-intensive and data-intensive DNN models such as LSTM. These properties are desirable for CNN models' deployment in a resource-constrained and dynamically changing environment. Predicting the variations in CO\({}_{2}\) values is split into two steps. The first step is achieved using the individual learners considering the future direction of CO\({}_{2}\) variations as its output variable. The direction is divided into three groups, decreasing equivalent to 0, increasing equivalent to 2, and constant equivalent to 1. The new definition of the output variables transforms the task at hand from regression to a classification task, which allows exploiting the wealth of literature for CNN-related classification tasks. The second step is achieved using the ensemble learner explained in the following sections. A large body of research was conducted in the field of image recognition that experimented with different CNN architectures to obtain good accuracy results for their respective tasks. Therefore, a Transfer Learning (TL) approach is adopted to extract spatial features in the GAF representations to exploit these accumulated contributions. TL is a methodology to transfer the knowledge gained from an extensive source dataset to improve the learning process in the target dataset [41]. In DL, this methodology is implemented by transferring the weights learned from the source model to the target model. The differences between the source task, trained on the ImageNet dataset [42], and target tasks,trained on GAF representations, necessitate re-tuning the model's weights using the target dataset or augmenting the initial model with extra layers so that the resulting model can accrue some of the characteristics of the target dataset. The employment of a TL approach has several benefits. The available pre-trained CNN models have proven their merit in a similar domain, saving the time needed to train and tune CNN models from scratch. The addition of more layers and consequently the exponential growth in the number of parameters are required to extract more abstract features from the input images. This step is integral for pattern recognition, which pre-conditions the existence of a large amount of data. The limitations of the deployment environment in terms of the constrained resources and gathered data drive the adoption of the TL approach. The newly developed CNN model is built on each of the environmental features, such that the predictor of each variable is the feature's GAF image for the history time window and the response variable is the direction of the variation of CO\({}_{2}\) concentration levels for the future time window. The past and future time windows are denoted by \(h\) and \(f\). Assuming that the CNN model is denoted by a function \(\Phi_{i}\) built on the data from the environmental feature \(X_{i}\), the predictor input GAF image by \(GAF_{(X_{i}h)}\), and the prediction is \(d_{f}\), the created CNN model on the feature \(X_{i}\) is as follows:  
\[\Phi_{i}(GAF_{(X_{i}h)},d_{f}) \tag{5}\]  
The following example is given to clarify the notation, the notions of history and future time windows, and the expression in general.