EXPLAINABLE MACHINE LEARNING FOR SENSOR-BASED OCCUPANCY DETECTION IN SMART BUILDINGS
Main Article Content
Abstract
Accurate occupancy detection can enable demand responsive building operation without the privacy issues associated with camera-based monitoring. This study proposes and assesses critically an explainable machine-learning workflow for binary room-occupancy detection using the UCI Occupancy Detection dataset. The 20,560 minute-level observations of temperature, humidity, light, carbon dioxide, and humidity ratio were analyzed with the provided training partition (8,143 observations) and two external test partitions (2,665 and 9,752 observations). The following methods were compared: logistic regression, random forest and extremely randomized trees; a leakage-controlled day-blocked cross validation was used and only the selected random forest was tuned. The balanced accuracy, F1-score, ROC-AUC, and average precision of the locked model are 0.941, 0.913, 0.991, and 0.968, respectively. When light was used in permutation analysis, it was the most important predictor, and the balanced accuracy dropped from 0.928 to 0.749 on Test 1 and from 0.947 to 0.493 on Test 2 when it was removed. Results show high practical detection performance and an impactful lighting dependency that needs to be taken into account prior to deployment in a heterogeneous smart-building setting.
Downloads
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Author(s) and co-author(s) jointly and severally represent and warrant that the Article is original with the author(s) and does not infringe any copyright or violate any other right of any third parties, and that the Article has not been published elsewhere. Author(s) agree to the terms that the IJRDO Journal will have the full right to remove the published article on any misconduct found in the published article.
References
2. Arvidsson, S., Gullstrand, M., Sirmacek, B., & Riveiro, M. (2021). Sensor fusion and convolutional neural networks for indoor occupancy prediction using multiple low-cost low-resolution heat sensor data. Sensors, 21(4), 1036. https://doi.org/10.3390/s21041036
3. Breiman, L. (2001). Random forests. Machine Learning, 45, 5–32. https://doi.org/10.1023/A:1010933404324
4. Candanedo, L. (2016). Occupancy detection [Data set]. UCI Machine Learning Repository. https://doi.org/10.24432/C5X01N
5. Candanedo, L. M., & Feldheim, V. (2016). Accurate occupancy detection of an office room from light, temperature, humidity and CO2 measurements using statistical learning models. Energy and Buildings, 112, 28–39. https://doi.org/10.1016/j.enbuild.2015.11.071
6. Chen, Z., Xiao, F., Guo, F., & Yan, J. (2023). Interpretable machine learning for building energy management: A state-of-the-art review. Advances in Applied Energy, 9, 100123. https://doi.org/10.1016/j.adapen.2023.100123
7. Dai, X., Liu, J., & Zhang, X. (2020). A review of studies applying machine learning models to predict occupancy and window-opening behaviours in smart buildings. Energy and Buildings, 223, 110159. https://doi.org/10.1016/j.enbuild.2020.110159
8. Djenouri, D., Laidi, R., Djenouri, Y., & Balasingham, I. (2019). Machine learning for smart building applications: Review and taxonomy. ACM Computing Surveys, 52(2), Article 24, 1–36. https://doi.org/10.1145/3311950
9. Esrafilian-Najafabadi, M., & Haghighat, F. (2021). Occupancy-based HVAC control systems in buildings: A state-of-the-art review. Building and Environment, 197, 107810. https://doi.org/10.1016/j.buildenv.2021.107810
10. Geurts, P., Ernst, D., & Wehenkel, L. (2006). Extremely randomized trees. Machine Learning, 63, 3–42. https://doi.org/10.1007/s10994-006-6226-1
11. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., VanderPlas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830.
12. Rueda, L., Agbossou, K., Cardenas, A., Henao, N., & Kelouwani, S. (2020). A comprehensive review of approaches to building occupancy detection. Building and Environment, 180, 106966. https://doi.org/10.1016/j.buildenv.2020.106966
13. Saha, H., Florita, A. R., Henze, G. P., & Sarkar, S. (2019). Occupancy sensing in buildings: A review of data analytics approaches. Energy and Buildings, 188–189, 278–285. https://doi.org/10.1016/j.enbuild.2019.02.030
14. Salimi, S., & Hammad, A. (2019). Critical review and research roadmap of office building energy management based on occupancy monitoring. Energy and Buildings, 182, 214–241. https://doi.org/10.1016/j.enbuild.2018.10.007
15. Sayed, A. N., Himeur, Y., & Bensaali, F. (2022). Deep and transfer learning for building occupancy detection: A review and comparative analysis. Engineering Applications of Artificial Intelligence, 115, 105254. https://doi.org/10.1016/j.engappai.2022.105254
16. Stamatescu, G., & Chitu, C. (2021). Privacy-preserving sensing and two-stage building occupancy prediction using random forest learning. Journal of Sensors, 2021, 8000595. https://doi.org/10.1155/2021/8000595
17. Sun, K., Zhao, Q., & Zou, J. (2020). A review of building occupancy measurement systems. Energy and Buildings, 216, 109965. https://doi.org/10.1016/j.enbuild.2020.109965
18. Tan, S. Y., Jacoby, M., Saha, H., Florita, A., Henze, G., & Sarkar, S. (2022). Multimodal sensor fusion framework for residential building occupancy detection. Energy and Buildings, 258, 111828. https://doi.org/10.1016/j.enbuild.2021.111828
19. Tekler, Z. D., & Chong, A. (2022). Occupancy prediction using deep learning approaches across multiple space types: A minimum sensing strategy. Building and Environment, 226, 109689. https://doi.org/10.1016/j.buildenv.2022.109689
20. Wang, W., Chen, J., & Hong, T. (2018). Occupancy prediction through machine learning and data fusion of environmental sensing and Wi-Fi sensing in buildings. Automation in Construction, 94, 233–243. https://doi.org/10.1016/j.autcon.2018.07.007