Virtual Sensors for Estimating District Heating Energy Consumption under Sensor Absences in a Residential Building

: District heating (DH) is an energy e ﬃ cient building heating system that entails low primary energy consumption and reduced environmental impact. The estimation of the required heating load provides information for operators to control district heating systems (DHSs) e ﬃ ciently. It also yields historical datasets for intelligent management applications. Based on the existing virtual sensor capabilities to estimate physical variables, performance, etc., and to detect the anomaly detection in building energy systems, this paper proposes a virtual sensor-based method for the estimation of DH energy consumption in a residential building. Practical issues, including sensor absences and limited datasets corresponding to actual buildings, were also analyzed to improve the applicability of virtual sensors in a building. According to certain virtual sensor development processes, model-driven, data-driven, and grey-box virtual sensors were developed and compared in a case study. The grey-box virtual sensor surpassed the capabilities of the other virtual sensors, particularly for operation patterns corresponding to low heating, which were di ﬀ erent from those in the training dataset; notably, a 16% improvement was observed in the accuracy exhibited by the grey-box virtual sensor, as compared to that of the data-driven virtual sensor. The former sensor accounted for a signiﬁcantly wider DHS operation range by overcoming training data dependency when estimating the actual DH energy consumption. Finally, the proposed virtual sensors can be applied for continuous commissioning, monitoring, and fault detection in the building, since they are developed based on the DH variables at the demand side.


District Heating Systems in a Building
District heating systems (DHSs) are widely adopted for heating buildings, especially in urban areas of several countries worldwide. This is because DHSs can provide efficient heating, with low primary energy resource consumption and less impact on the environment [1]. With the advancement of sensor networks, data analysis, and data-driven applications entailing building energy systems, various management and control technologies have been recently studied with regard to district heating (DH) substations [2]. The monitoring of DH energy consumption in a building can provide: (1) information regarding efficiently controlling the system and (2) historical energy datasets for 1.
The estimation models for the DH states and variables were usually proposed for the DH networks or primary sides without the relationships with the demand side of a terminal building (such as a multiunit building).

2.
Limited studies have been conducted on virtual sensors regarding the DH energy consumption.

3.
Previous studies typically involved laboratory experimental setups (because it is difficult to obtain various operational datasets in a real DH substation or to perform sensing in actual buildings). 4. Key sensors for system control are usually installed or managed in real systems. The absence of sensors makes it difficult (or impossible) to develop virtual sensors. 5.
The previous methods were usually evaluated under testing conditions that are similar to the training datasets used or under representative operative conditions. This is because it is difficult to obtain various testing datasets in the development of building-level virtual sensors. In this situation, the way to define the different operation patterns or several testing conditions should be proposed to determine the better virtual sensor under the limited data and sensing environments.

Purpose and Contributions
To overcome these challenges, this study provided a virtual sensing method for estimating the DH energy consumption in a residential building. We also proposed a method to define various operation patterns or testing conditions to develop a better virtual sensor under limited datasets. The contribution of this study is to present a virtual sensing method applicable for a residential building with the Energies 2020, 13, 6013 3 of 13 limited or general sensing environment of DHS. To the best of our knowledge, this is the first virtual sensor-based study for estimating the DH energy consumption in a multi-unit residential building. The suggested method included two main stages: (1) development stage and (2) validation stage. In the first phase, a virtual sensor development process entailing three virtual sensor modeling approaches was employed (under the sensor absences in the real systems). Testing methods were proposed to evaluate the available virtual sensors considering limited testing datasets. To develop and evaluate the proposed virtual sensors with regard to the heating energy consumption for a DHS, case studies were conducted for a high-rise residential building served by the DHS. The system variables in the DHS, heating energy consumption in the building, and outdoor air temperature and humidity data were gathered for approximately four months using a building automation system (BAS).

System Description
The proposed virtual sensor method was applied to a DHS serving a multifamily residential building in Korea. The target DHS consisted of a heat exchanger, two circulating pumps, a differential pressure valve (DPV), a temperature control valve (TCV), and several physical temperature and pressure sensors, as shown in Figure 1. The DHS had two setpoints: the supply water temperature (T H,sup ) and the pressure difference between the heating supply (P H,sup ) and return (P H,ret ) pipes at the secondary side. The supply water temperature setpoint was continuously redefined based on the outdoor reset control method [12], and the TCV was controlled to meet the defined setpoints. The pressure difference setpoint was fixed by operators and achieved by controlling the circulating pumps under the working of the DPV. The sensors for mass flow rates at the primary and secondary sides and for the primary return temperature were not installed in the control system, because they were unnecessary variables in terms of the control method (exemplifying the real situation of sensor absences in a residential building DHS). All system variables in the automatic control system of the DHS are specified in Figure 1.
Energies 2020, 13, x FOR PEER REVIEW 3 of 14 or general sensing environment of DHS. To the best of our knowledge, this is the first virtual sensor-based study for estimating the DH energy consumption in a multi-unit residential building. The suggested method included two main stages: (1) development stage and (2) validation stage. In the first phase, a virtual sensor development process entailing three virtual sensor modeling approaches was employed (under the sensor absences in the real systems). Testing methods were proposed to evaluate the available virtual sensors considering limited testing datasets. To develop and evaluate the proposed virtual sensors with regard to the heating energy consumption for a DHS, case studies were conducted for a high-rise residential building served by the DHS. The system variables in the DHS, heating energy consumption in the building, and outdoor air temperature and humidity data were gathered for approximately four months using a building automation system (BAS).

System Description
The proposed virtual sensor method was applied to a DHS serving a multifamily residential building in Korea. The target DHS consisted of a heat exchanger, two circulating pumps, a differential pressure valve (DPV), a temperature control valve (TCV), and several physical temperature and pressure sensors, as shown in Figure 1. The DHS had two setpoints: the supply water temperature (TH,sup) and the pressure difference between the heating supply (PH,sup) and return (PH,ret) pipes at the secondary side. The supply water temperature setpoint was continuously redefined based on the outdoor reset control method [12], and the TCV was controlled to meet the defined setpoints. The pressure difference setpoint was fixed by operators and achieved by controlling the circulating pumps under the working of the DPV. The sensors for mass flow rates at the primary and secondary sides and for the primary return temperature were not installed in the control system, because they were unnecessary variables in terms of the control method (exemplifying the real situation of sensor absences in a residential building DHS). All system variables in the automatic control system of the DHS are specified in Figure 1.

Gathering Operational Datasets under the Sensor Absences of DHS
Target DHS variables were collected every minute through the building automation system. As mentioned above, the water flow rates and return water temperature at the supply side were not obtained because these variables were not necessary for DHS control. The heating energy consumptions in the target building, obtained by a heat meter, were recorded every hour. To align the minute-to-minute data for the system variables to the hourly metered consumptions, the system value trends were averaged hourly.

Gathering Operational Datasets under the Sensor Absences of DHS
Target DHS variables were collected every minute through the building automation system. As mentioned above, the water flow rates and return water temperature at the supply side were not obtained because these variables were not necessary for DHS control. The heating energy consumptions in the target building, obtained by a heat meter, were recorded every hour. To align the minute-to-minute data for the system variables to the hourly metered consumptions, the system value trends were averaged hourly.

Virtual Sensor Development Process under Sensor Absences
As shown in Figure 2, the proposed method included two parts: (1) virtual sensor development and (2) virtual sensor evaluation. In the development phase, regarding the DH energy consumption estimation, several virtual sensor modeling methods can be employed (such as model-driven, data-driven, and grey-box methods) according to the conventional virtual sensor framework [3]. To produce effective virtual sensors, various system variables were deemed necessary inputs for modeling. If key sensors for temperature and mass flow rates were absent, control signals were obtained from the BAS (when possible). Based on first principles, affinity laws, and other domain knowledge, the unmeasured variables were estimated before virtual sensor development. For the virtual sensor evaluation, the testing conditions were defined by the different operation patterns of the DHS. The clustering method was used to determine the operation patterns in the given datasets. Thus, the three virtual sensors were developed using the estimated variables and then evaluated under different testing conditions. This method provided better virtual sensors that can be developed using limited training and testing datasets and employed in spite of real sensor absences in buildings.

Virtual Sensor Development Process under Sensor Absences
As shown in Figure 2, the proposed method included two parts: (1) virtual sensor development and (2) virtual sensor evaluation. In the development phase, regarding the DH energy consumption estimation, several virtual sensor modeling methods can be employed (such as model-driven, datadriven, and grey-box methods) according to the conventional virtual sensor framework [3]. To produce effective virtual sensors, various system variables were deemed necessary inputs for modeling. If key sensors for temperature and mass flow rates were absent, control signals were obtained from the BAS (when possible). Based on first principles, affinity laws, and other domain knowledge, the unmeasured variables were estimated before virtual sensor development. For the virtual sensor evaluation, the testing conditions were defined by the different operation patterns of the DHS. The clustering method was used to determine the operation patterns in the given datasets. Thus, the three virtual sensors were developed using the estimated variables and then evaluated under different testing conditions. This method provided better virtual sensors that can be developed using limited training and testing datasets and employed in spite of real sensor absences in buildings.

Virtual Sensor Modeling
According to the suggested virtual sensor method (Figure 2), the model-driven, data-driven, and grey-box virtual sensors for estimating heating energy consumption were developed for the target system. Each virtual sensor was defined as a different case.
The model-driven virtual sensor (Case 1) was formulated (Equation (1)) based on the heat equation in the DH substation. It is important to note that the temperature differences were measured, but the water flow rates were not measured by the control system. To overcome the sensor absence, the design information and the control signal (fH) for the pumps were used to estimate the unmeasured water flow rates. During the design phase, the water flow rate was defined as 2120 LPM at a pump signal of 60 Hz. Based on the affinity law between revolutions per minute (RPM) and water flow rates, assuming the pump head is constant in operation, the water flow rates were calculated as in Equation (2) using the designed flow rates at the design frequency (fdesign). This is an example of overcoming sensor absences using domain knowledge for developing virtual sensors in a real building.
The data-driven virtual sensor (Case 2) was modeled, as in Equation (3), by incorporating the relevant variables using a multilayer perceptron (MLP) neural network [13]. As shown in Figure 3, the relevant variables were divided into two categories, namely system variables (xsys) and environmental variables (xenv). System variables were internal information of the system, including pressures, temperatures, and control signals. Additionally, the calculated pressure difference (ΔPH) and temperature difference (ΔTH) at the secondary supply and return side were defined as the MLP input variables. The environmental variables, that is, the outdoor air temperature (TOA), relative

Virtual sensor modeling
Estimate unmeasured variables using domain knowledge

Virtual sensor testing
Apply the best virtual sensor

Virtual Sensor Modeling
According to the suggested virtual sensor method ( Figure 2), the model-driven, data-driven, and grey-box virtual sensors for estimating heating energy consumption were developed for the target system. Each virtual sensor was defined as a different case.
The model-driven virtual sensor (Case 1) was formulated (Equation (1)) based on the heat equation in the DH substation. It is important to note that the temperature differences were measured, but the water flow rates were not measured by the control system. To overcome the sensor absence, the design information and the control signal (f H ) for the pumps were used to estimate the unmeasured water flow rates. During the design phase, the water flow rate was defined as 2120 LPM at a pump signal of 60 Hz. Based on the affinity law between revolutions per minute (RPM) and water flow rates, assuming the pump head is constant in operation, the water flow rates were calculated as in Equation (2) using the designed flow rates at the design frequency (f design ). This is an example of overcoming sensor absences using domain knowledge for developing virtual sensors in a real building.
The data-driven virtual sensor (Case 2) was modeled, as in Equation (3), by incorporating the relevant variables using a multilayer perceptron (MLP) neural network [13]. As shown in Figure 3, the relevant variables were divided into two categories, namely system variables (x sys ) and environmental variables (x env ). System variables were internal information of the system, including pressures, temperatures, and control signals. Additionally, the calculated pressure difference (∆P H ) and Energies 2020, 13, 6013 5 of 13 temperature difference (∆T H ) at the secondary supply and return side were defined as the MLP input variables. The environmental variables, that is, the outdoor air temperature (T OA ), relative humidity (RH OA ), and operation hours (t), were also defined as the MLP input variables. The metered heating energy consumption was used as the MLP output.
The grey-box virtual sensor (Case 3) was defined as the second-degree polynomial function of the model-driven value (Q model ), as in Equation (4). Three coefficients (α) of the function were considered as the operational unknown factors between the model-driven virtual sensor value and the metered energy consumption value. Coefficients were calculated by the least squares method, which is the popular regression method for polynomial functions.
Energies 2020, 13, x FOR PEER REVIEW 5 of 14 humidity (RHOA), and operation hours (t), were also defined as the MLP input variables. The metered heating energy consumption was used as the MLP output. The grey-box virtual sensor (Case 3) was defined as the second-degree polynomial function of the model-driven value (Qmodel), as in Equation (4). Three coefficients ( ) of the function were considered as the operational unknown factors between the model-driven virtual sensor value and the metered energy consumption value. Coefficients were calculated by the least squares method, which is the popular regression method for polynomial functions.
= (4) As shown in Table 1, identical MLP structures and settings were used for training the datadriven model. The structure consisted of an input layer, three hidden layers, and an output layer. In the layers, ReLU and linear activation functions were used, as shown in Figure 3, and the weights of neurons were initialized using the Kaiming initializer [14]. For enhanced training, bias neurons were applied at the input layer and in each hidden layer with zero initialization. Optimization was performed using the Adam optimizer [15], and early stopping was employed, to prevent overfitting, when the validation loss decreased by less than 1% during 10 epochs. The hourly operational dataset corresponding to January was employed in this study. This dataset was split to 15% and 85% for the validation and training of the models, respectively. For the regression in Case 3, the defined regression parameters were listed in Table 2. The trained models were evaluated using three indices, shown in Equations (5)- (7).
where a is the actual (true) value, p is the predicted value from the MLP neural network, is the mean of the actual value, n is the total number of the dataset time steps, and i is the time step. As shown in Table 1, identical MLP structures and settings were used for training the data-driven model. The structure consisted of an input layer, three hidden layers, and an output layer. In the layers, ReLU and linear activation functions were used, as shown in Figure 3, and the weights of neurons were initialized using the Kaiming initializer [14]. For enhanced training, bias neurons were applied at the input layer and in each hidden layer with zero initialization. Optimization was performed using the Adam optimizer [15], and early stopping was employed, to prevent overfitting, when the validation loss decreased by less than 1% during 10 epochs. The hourly operational dataset corresponding to January was employed in this study. This dataset was split to 15% and 85% for the validation and training of the models, respectively. For the regression in Case 3, the defined regression parameters were listed in Table 2. The trained models were evaluated using three indices, shown in Equations (5)- (7).
Energies 2020, 13, 6013 where a is the actual (true) value, p is the predicted value from the MLP neural network, a is the mean of the actual value, n is the total number of the dataset time steps, and i is the time step.

Determining Testing Conditions Using a Clustering Method
Clustering is the process of partitioning a dataset into subgroups based on similarity. The similarity between clusters is normally determined by distance. K-means is a centroid-based clustering algorithm that has been widely used in identifying system operation patterns in buildings [16,17]. In this study, k-means clustering was used to define the operation patterns of the DHS. The cost function is defined in Equation (8). The input variables of the k-means clustering included the hourly heating energy consumption over a day to identify the daily operation patterns. The clustering period was from December to March. The value of K, the number of clusters, was defined as K = 3 based on the elbow method [18], as shown in Figure 4. The k-means process was conducted using Python libraries.
where C is the cost function of clustering, k is the number of clusters, S i is ith cluster from dataset, x j is the jth data object in S i , and µ i is the centroid of cluster S i .

Determining Testing Conditions Using a Clustering Method
Clustering is the process of partitioning a dataset into subgroups based on similarity. The similarity between clusters is normally determined by distance. K-means is a centroid-based clustering algorithm that has been widely used in identifying system operation patterns in buildings [16,17]. In this study, kmeans clustering was used to define the operation patterns of the DHS. The cost function is defined in Equation (8). The input variables of the k-means clustering included the hourly heating energy consumption over a day to identify the daily operation patterns. The clustering period was from December to March. The value of K, the number of clusters, was defined as K = 3 based on the elbow method [18], as shown in Figure 4. The k-means process was conducted using Python libraries.
where C is the cost function of clustering, k is the number of clusters, Si is ith cluster from dataset, xj is the jth data object in Si, and is the centroid of cluster Si.  Figure 5a shows the clustering results for the entire heating period (December to March). Three operation patterns were determined based on the daily heating energy consumption levels (severe, moderate, and light heating levels). According to the three clusters, to evaluate the virtual sensor performance, the three operation patterns were defined as follows: (1) Test condition 1: severe level, (2) Test condition 2: moderate level, and (3) Test condition 3: light level. For each testing condition, three different days were selected from the testing datasets. Figure 5b shows the average heating energy consumptions for the three days selected for each test condition.

Clustering Results
Energies 2020, 13, x FOR PEER REVIEW 7 of 14 Figure 5a shows the clustering results for the entire heating period (December to March). Three operation patterns were determined based on the daily heating energy consumption levels (severe, moderate, and light heating levels). According to the three clusters, to evaluate the virtual sensor performance, the three operation patterns were defined as follows: (1) Test condition 1: severe level, (2) Test condition 2: moderate level, and (3) Test condition 3: light level. For each testing condition, three different days were selected from the testing datasets. Figure 5b shows the average heating energy consumptions for the three days selected for each test condition.

Clustering Results
Furthermore, the cluster composition was analyzed for the training dataset (corresponding to January), as shown in Figure 6. Severe clusters were the most prevalent (approximately 72%) in the training dataset. Moderate days were included, but no days corresponded to the light cluster. Thus, testing condition 3 (light cluster) was regarded as the difficult condition for the virtual sensor evaluation.

Results of Training for the Virtual Sensors
The training results for the three virtual sensors are shown in Figure 7. The root mean square errors (RMSEs) were 0.11, 0.05, and 0.054, respectively, for the model-driven virtual sensor, the datadriven virtual sensor, and the grey-box virtual sensor. The three coefficients (α , α , and α ) for the grey-box model as in Equation (4) were 0.5095, 0.7011, and −0.0628. Figure 8 shows the DH energy consumption trends obtained by the three virtual sensors over the training period. All of the virtual sensors showed reasonable distributions, as compared to the metered heating energy consumptions. The data-driven and grey-box virtual sensors exhibited a  Furthermore, the cluster composition was analyzed for the training dataset (corresponding to January), as shown in Figure 6. Severe clusters were the most prevalent (approximately 72%) in the training dataset. Moderate days were included, but no days corresponded to the light cluster. Thus, testing condition 3 (light cluster) was regarded as the difficult condition for the virtual sensor evaluation.
Energies 2020, 13, x FOR PEER REVIEW 7 of 14 Figure 5a shows the clustering results for the entire heating period (December to March). Three operation patterns were determined based on the daily heating energy consumption levels (severe, moderate, and light heating levels). According to the three clusters, to evaluate the virtual sensor performance, the three operation patterns were defined as follows: (1) Test condition 1: severe level, (2) Test condition 2: moderate level, and (3) Test condition 3: light level. For each testing condition, three different days were selected from the testing datasets. Figure 5b shows the average heating energy consumptions for the three days selected for each test condition.

Clustering Results
Furthermore, the cluster composition was analyzed for the training dataset (corresponding to January), as shown in Figure 6. Severe clusters were the most prevalent (approximately 72%) in the training dataset. Moderate days were included, but no days corresponded to the light cluster. Thus, testing condition 3 (light cluster) was regarded as the difficult condition for the virtual sensor evaluation.

Results of Training for the Virtual Sensors
The training results for the three virtual sensors are shown in Figure 7. The root mean square errors (RMSEs) were 0.11, 0.05, and 0.054, respectively, for the model-driven virtual sensor, the datadriven virtual sensor, and the grey-box virtual sensor. The three coefficients (α , α , and α ) for the grey-box model as in Equation (4) were 0.5095, 0.7011, and −0.0628. Figure 8 shows the DH energy consumption trends obtained by the three virtual sensors over the training period. All of the virtual sensors showed reasonable distributions, as compared to the metered heating energy consumptions. The data-driven and grey-box virtual sensors exhibited a

Results of Training for the Virtual Sensors
The training results for the three virtual sensors are shown in Figure 7. The root mean square errors (RMSEs) were 0.11, 0.05, and 0.054, respectively, for the model-driven virtual sensor, the data-driven virtual sensor, and the grey-box virtual sensor. The three coefficients (α 1 , α 2 , and α 3 ) for the grey-box model as in Equation (4)  higher accuracy. The two virtual sensors provided a more reliable trend, as compared to the modeldriven sensor. Further, the model-driven virtual sensor exhibited significant errors, especially for periods corresponding to low heating. This indicated that the steady-state model formulated based on the design information under the sensor absences was unable to consider dynamic thermal behavior and various operational uncertainties in the system. The following sections highlight the detailed performance evaluation under multiple testing conditions.

Comparison between Data-driven and Grey-box Virtual Sensors (Test Condition 1)
The virtual sensors were evaluated with regard to the first testing condition, according to which the days in the test set that correspond to the severe cluster are employed. This was regarded as a favorable testing condition because it is similar to the training conditions. Figure 9 shows the time-series plots of the estimated heating energy consumption obtained by the virtual sensors. As mentioned for the training results, the model-driven virtual sensor showed a substantial difference between the estimated and metered trends (RMSE = 0.10). Comparing the datadriven and grey-box virtual sensors, the grey-box virtual sensor performed slightly better than the data-driven virtual sensor in terms of the three evaluation indices. This demonstrates that the datadriven and grey-box virtual sensors can considerably adapt to the operation patterns exhibited by the training datasets. Nevertheless, all virtual sensors did not capture the dramatic increase and decrease in heating energy consumption in the building. This was because of the data acquisition frequency difference between the system sensors and meters.  Figure 8 shows the DH energy consumption trends obtained by the three virtual sensors over the training period. All of the virtual sensors showed reasonable distributions, as compared to the metered heating energy consumptions. The data-driven and grey-box virtual sensors exhibited a higher accuracy. The two virtual sensors provided a more reliable trend, as compared to the model-driven sensor. Further, the model-driven virtual sensor exhibited significant errors, especially for periods corresponding to low heating. This indicated that the steady-state model formulated based on the design information under the sensor absences was unable to consider dynamic thermal behavior and various operational uncertainties in the system. The following sections highlight the detailed performance evaluation under multiple testing conditions. Energies 2020, 13, x FOR PEER REVIEW 8 of 14 higher accuracy. The two virtual sensors provided a more reliable trend, as compared to the modeldriven sensor. Further, the model-driven virtual sensor exhibited significant errors, especially for periods corresponding to low heating. This indicated that the steady-state model formulated based on the design information under the sensor absences was unable to consider dynamic thermal behavior and various operational uncertainties in the system. The following sections highlight the detailed performance evaluation under multiple testing conditions.

Comparison between Data-driven and Grey-box Virtual Sensors (Test Condition 1)
The virtual sensors were evaluated with regard to the first testing condition, according to which the days in the test set that correspond to the severe cluster are employed. This was regarded as a favorable testing condition because it is similar to the training conditions. Figure 9 shows the time-series plots of the estimated heating energy consumption obtained by the virtual sensors. As mentioned for the training results, the model-driven virtual sensor showed a substantial difference between the estimated and metered trends (RMSE = 0.10). Comparing the datadriven and grey-box virtual sensors, the grey-box virtual sensor performed slightly better than the data-driven virtual sensor in terms of the three evaluation indices. This demonstrates that the datadriven and grey-box virtual sensors can considerably adapt to the operation patterns exhibited by the training datasets. Nevertheless, all virtual sensors did not capture the dramatic increase and decrease in heating energy consumption in the building. This was because of the data acquisition frequency difference between the system sensors and meters.

Comparison between Data-Driven and Grey-Box Virtual Sensors (Test Condition 1)
The virtual sensors were evaluated with regard to the first testing condition, according to which the days in the test set that correspond to the severe cluster are employed. This was regarded as a favorable testing condition because it is similar to the training conditions. Figure 9 shows the time-series plots of the estimated heating energy consumption obtained by the virtual sensors. As mentioned for the training results, the model-driven virtual sensor showed a substantial difference between the estimated and metered trends (RMSE = 0.10). Comparing the data-driven and grey-box virtual sensors, the grey-box virtual sensor performed slightly better than the data-driven virtual sensor in terms of the three evaluation indices. This demonstrates that the data-driven and grey-box virtual sensors can considerably adapt to the operation patterns exhibited by the training datasets. Nevertheless, all virtual sensors did not capture the dramatic increase and decrease in heating energy consumption in the building. This was because of the data acquisition frequency difference between the system sensors and meters.

Data-driven Virtual Sensor vs. Grey-box Virtual Sensor under Different Testing Conditions (Test Conditions 2 and 3)
The data-driven and grey-box virtual sensors were compared with regard to the remaining test conditions; the comparison was based on the relative absolute error (RAE) index. The days corresponding to moderate and light clusters in the test dataset were included. Regarding the moderate cluster, as shown in Figure 10, the two virtual sensors exhibited slightly lower accuracies compared to those in the first test condition. This was because of the lower ratio of datapoints corresponding to the moderate cluster in the total training datasets.
For the light cluster testing condition, as shown in Figure 11, the RAE was considerably increased from 0.474 to 0.536 for the data-driven virtual sensor. This is because this testing condition was not included in the training dataset. This reveals that the issue of training data dependency exists with regard to developing virtual sensors for a building. Under these undesirable conditions, the grey-box virtual sensor surpassed the data-driven virtual sensor in terms of accuracy. The accuracy differences between the virtual sensors were the most significant when testing under low heating operation, which primarily corresponds to the light cluster, as shown in Figure 12. It showed a 16% improvement in the grey-box virtual sensor, compared to the data-driven virtual sensor. This means that the grey-box virtual sensor had a wider system operation coverage based on its combination of model-driven and data-driven features. Based on the results, in the case of a real building with limited datasets and physical sensors, the grey-box virtual sensor demonstrably overcame the training data dependency found for the data-driven virtual sensor. It was confirmed that the grey-box virtual sensor

Data-Driven Virtual Sensor vs. Grey-Box Virtual Sensor under Different Testing Conditions (Test Conditions 2 and 3)
The data-driven and grey-box virtual sensors were compared with regard to the remaining test conditions; the comparison was based on the relative absolute error (RAE) index. The days corresponding to moderate and light clusters in the test dataset were included. Regarding the moderate cluster, as shown in Figure 10, the two virtual sensors exhibited slightly lower accuracies compared to those in the first test condition. This was because of the lower ratio of datapoints corresponding to the moderate cluster in the total training datasets.
For the light cluster testing condition, as shown in Figure 11, the RAE was considerably increased from 0.474 to 0.536 for the data-driven virtual sensor. This is because this testing condition was not included in the training dataset. This reveals that the issue of training data dependency exists with regard to developing virtual sensors for a building. Under these undesirable conditions, the grey-box virtual sensor surpassed the data-driven virtual sensor in terms of accuracy. The accuracy differences between the virtual sensors were the most significant when testing under low heating operation, which primarily corresponds to the light cluster, as shown in Figure 12. It showed a 16% improvement in the grey-box virtual sensor, compared to the data-driven virtual sensor. This means that the grey-box virtual sensor had a wider system operation coverage based on its combination of model-driven and data-driven features. Based on the results, in the case of a real building with limited datasets and physical sensors, the grey-box virtual sensor demonstrably overcame the training data dependency found for the data-driven virtual sensor. It was confirmed that the grey-box virtual sensor can be applied more effectively under varying system operation conditions and a building whose energy consumption is to be reduced by operators. The complete test results are summarized in Table 3. can be applied more effectively under varying system operation conditions and a building whose energy consumption is to be reduced by operators. The complete test results are summarized in Table 3.     Comparison between data-driven and grey-box virtual sensors. Figure 12. Comparison between data-driven and grey-box virtual sensors.

Conclusions
Virtual sensor development and validation for determining DH energy consumption in a building was the focus of this study, and it considered the issue of sensor absence in real DH substations. Based on the suggested method, three virtual sensors were developed via the model-driven, data-driven, and grey-box approaches. Additionally, three test conditions were defined using the clustering method to account for daily heating energy patterns. According to the case study results, the data-driven and grey-box virtual sensors all showed reasonable estimation accuracies under the various operational uncertainties of the DHS. Specifically, the data-driven virtual sensor showed more accurate heating energy consumption predictions compared to those of the model-driven sensor. Unfortunately, the accuracy of the data-driven virtual sensor considerably decreased for operation patterns corresponding to low heating (Test Condition 3); this is because this condition was different from that found in the training datasets used. This indicated that a training data dependency issue is entailed in developing data-driven virtual sensors. The system operation patterns can change as a result of continuous monitoring and various energy conservation efforts; therefore, the virtual sensors are required to account for the entire operation range, including operating patterns different from those in the given training datasets. In such situations, based on the combined capabilities of model-driven and data-driven methods, the grey-box virtual sensor method could exhibit an enhanced estimation accuracy under various test conditions or a wider operation range. Thus, it can overcome the training data dependency issue observed for the data-driven virtual sensor.
As the suggested virtual sensors are developed based on the DH variables within the demand side of a building, they can be widely used as the replacement and backup purposes for continuous commissioning, monitoring, and fault detection in the terminal buildings.