{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,4,17]],"date-time":"2026-04-17T11:49:29Z","timestamp":1776426569692,"version":"3.51.2"},"reference-count":46,"publisher":"MDPI AG","issue":"6","license":[{"start":{"date-parts":[[2022,3,19]],"date-time":"2022-03-19T00:00:00Z","timestamp":1647648000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"Institut of Research in Solar Energy and New Energies","award":["2020-2022, Green Inno-PROJECT-2018"],"award-info":[{"award-number":["2020-2022, Green Inno-PROJECT-2018"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Sensors"],"abstract":"<jats:p>Controlling active and passive systems in buildings with the aim of optimizing energy efficiency and maintaining occupants\u2019 comfort is the major task of building management systems. However, most of these systems use a predefined configuration, which usually do not match the occupants\u2019 preferences. Therefore, occupancy detection is imperative for energy use management mainly in residential and industrial buildings. Most works related to data-driven-based occupancy detection have used batch learning techniques, which need to store first and then train the data. It is not appropriate for a non-stationary environment. Therefore, this work sheds more light on the use of non-stationary machine learning techniques. To this end, three machine learning algorithms for stream data processing are presented, tested, and evaluated in term of accuracy and resources performance (i.e., RAM, CPU), with the aim of predicting the number of occupants in smart buildings. A platform architecture that integrates IoT technologies with stream machine learning is implemented and deployed. The experimental results show the effectiveness of this approach and illustrate that the number of occupants can be predicted with an accuracy of more than 83% and without resource wasting (i.e., time of CPU use varied between 0.04s and 3.85 \u22c5 10\u221211 GB of RAM could be exploited per hour).<\/jats:p>","DOI":"10.3390\/s22062371","type":"journal-article","created":{"date-parts":[[2022,3,20]],"date-time":"2022-03-20T21:37:17Z","timestamp":1647812237000},"page":"2371","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":25,"title":["Using Stream Data Processing for Real-Time Occupancy Detection in Smart Buildings"],"prefix":"10.3390","volume":"22","author":[{"given":"Hamza","family":"Elkhoukhi","sequence":"first","affiliation":[{"name":"LERMA-Lab, College of Engineering and Architecture, International University of Rabat, Sala El Jadida 11103, Morocco"},{"name":"IA Lab, Science Faculty, My Ismail University, Mekn\u00e8s 11201, Morocco"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Mohamed","family":"Bakhouya","sequence":"additional","affiliation":[{"name":"LERMA-Lab, College of Engineering and Architecture, International University of Rabat, Sala El Jadida 11103, Morocco"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Driss","family":"El Ouadghiri","sequence":"additional","affiliation":[{"name":"IA Lab, Science Faculty, My Ismail University, Mekn\u00e8s 11201, Morocco"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Majdoulayne","family":"Hanifi","sequence":"additional","affiliation":[{"name":"LERMA-Lab, College of Engineering and Architecture, International University of Rabat, Sala El Jadida 11103, Morocco"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"1968","published-online":{"date-parts":[[2022,3,19]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"332","DOI":"10.1016\/j.energy.2016.02.035","article-title":"Auditing and analysis of energy consumption of an industrial site in Morocco","volume":"101","author":"Boharb","year":"2016","journal-title":"Energy"},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"98","DOI":"10.1016\/j.energy.2015.02.048","article-title":"Morocco\u2019s strategy for energy security and low-carbon growth","volume":"84","author":"Kousksou","year":"2015","journal-title":"Energy"},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Hayduk, G., Kwasnowski, P., and Miko\u015b, Z. (June, January 29). Building management system architecture for large building automation systems. Proceedings of the 2016 17th International Carpathian Control Conference (ICCC), High Tatras, Slovakia.","DOI":"10.1109\/CarpathianCC.2016.7501100"},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"333","DOI":"10.4028\/www.scientific.net\/AMR.856.333","article-title":"Effect of Building Management System on Energy Saving","volume":"Volume 856","author":"Kamali","year":"2014","journal-title":"Advanced Materials Research"},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"1061","DOI":"10.1016\/j.rser.2017.05.264","article-title":"The impact of occupants\u2019 behaviours on building energy analysis: A research review","volume":"80","author":"Delzendeh","year":"2017","journal-title":"Renew. Sustain. Energy Rev."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"317","DOI":"10.1016\/j.enbuild.2018.05.007","article-title":"Linking building energy consumption with occupants\u2019 energy-consuming behaviors in commercial buildings: Non-intrusive occupant load monitoring (NIOLM)","volume":"172","author":"Rafsanjani","year":"2018","journal-title":"Energy Build."},{"key":"ref_7","doi-asserted-by":"crossref","unstructured":"Rafsanjani, H.N., Ahn, C.R., and Alahmad, M. (2015). Development of non-intrusive occupant load monitoring (NIOLM) in commercial buildings: Assessing occupants\u2019 energy-use behavior at entry and departure events. Sustainable Human\u2013Building Ecosystems, Proceedings of the First International Symposium on Sustainable Human\u2013Building Ecosystems, Pittsburgh, PA, USA, 5\u20136 October 2015, American Society of Civil Engineers.","DOI":"10.1061\/9780784479681.005"},{"key":"ref_8","first-page":"4","article-title":"Using existing network infrastructure to estimate building occupancy and control plugged-in devices in user workspaces","volume":"12","author":"Christensen","year":"2014","journal-title":"Int. J. Commun. Netw. Distrib. Syst."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"303","DOI":"10.1016\/j.enbuild.2015.02.028","article-title":"Occupancy measurement in commercial office buildings for demand-driven control applications\u2014A survey and detection system evaluation","volume":"93","author":"Labeodan","year":"2015","journal-title":"Energy Build."},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"106154","DOI":"10.1016\/j.buildenv.2019.05.032","article-title":"Opportunistic occupancy-count estimation using sensor fusion: A case study","volume":"159","author":"Hobson","year":"2019","journal-title":"Build. Environ."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"960","DOI":"10.1177\/0037549713489918","article-title":"A systematic approach to occupancy modeling in ambient sensor-rich buildings","volume":"90","author":"Yang","year":"2013","journal-title":"Simulation"},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"25","DOI":"10.1007\/s00450-017-0344-9","article-title":"Exploring zero-training algorithms for occupancy detection based on smart meter measurements","volume":"33","author":"Becker","year":"2017","journal-title":"Comput. Sci.-Res. Dev."},{"key":"ref_13","doi-asserted-by":"crossref","unstructured":"Raykov, Y.P., Ozer, E., Dasika, G., Boukouvalas, A., and Little, M.A. (2016, January 12\u201316). Predicting room occupancy with a single passive infrared (PIR) sensor through behavior extraction. Proceedings of the 2016 ACM International Joint Conference on Pervasive and Ubiquitous Computing\u2014UbiComp \u201916, Heidelberg, Germany.","DOI":"10.1145\/2971648.2971746"},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Elmouatamid, A., NaitMalek, Y., Ouladsine, R., Bakhouya, M., Elkamoun, N., Khaidar, M., and Zine-Dine, K. (2020). A Micro-Grid System Infrastructure Implementing IoT\/Big-Data Technologies for Efficient Energy Management in Buildings. ATSPES\u20191 (Advanced Technologies for Solar Photovoltaics Energy Systems), Springer.","DOI":"10.1007\/978-3-030-64565-6_20"},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"97","DOI":"10.1177\/027836498800700608","article-title":"Sensor models and multisensor integration","volume":"7","year":"1988","journal-title":"Int. J. Robot. Res."},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"704504","DOI":"10.1155\/2013\/704504","article-title":"A review of data fusion technique","volume":"2013","author":"Castenedo","year":"2013","journal-title":"Sci. World J."},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"173","DOI":"10.1016\/j.procs.2019.09.458","article-title":"A comparative study of predictive approaches for load forecasting in smart buildings","volume":"160","author":"Hadri","year":"2019","journal-title":"Procedia Comput. Sci."},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"e5651","DOI":"10.1002\/cpe.5651","article-title":"A platform architecture for occupancy detection using stream processing and machine learning approaches","volume":"32","author":"Elkhoukhi","year":"2020","journal-title":"Concurr. Comput. Pract. Exp."},{"key":"ref_19","unstructured":"Wu, E.Q., Zhou, M., Hu, D., Zhu, L., Tang, Z., Qiu, X., Deng, P., Zhu, L., and Ren, H. (2021). Self-Paced Dynamic Infinite Mixture Model for Fatigue Evaluation of Pilots\u2019 Brains. IEEE Trans. Cybern., 1\u201316."},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Ran, X., Zhou, X., Lei, M., Tepsan, W., and Deng, W. (2021). A novel k-means clustering algorithm with a noise algorithm for capturing urban hotspots. Appl. Sci., 11.","DOI":"10.3390\/app112311202"},{"key":"ref_21","first-page":"945","article-title":"MAPCAST: An Adaptive Control Approach using Predictive Analytics for Energy Balance in Micro-Grid Systems","volume":"10","author":"Elmouatamid","year":"2020","journal-title":"Int. J. Renew. Energy Res. (IJRER)"},{"key":"ref_22","unstructured":"Wang, H., and Abraham, Z. (2015, January 12\u201317). Concept drift detection for streaming data. Proceedings of the 2015 International Joint Conference on Neural Networks (IJCNN), Killarney, Ireland."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"12","DOI":"10.1109\/MCI.2015.2471196","article-title":"Learning in nonstationary environments: A survey","volume":"10","author":"Ditzler","year":"2015","journal-title":"IEEE Comput. Intell. Mag."},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"6","DOI":"10.1145\/3373464.3373470","article-title":"Machine learning for streaming data: State of the art, challenges, and opportunities","volume":"21","author":"Gomes","year":"2019","journal-title":"ACM SIGKDD Explor. Newsl."},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"\u017dliobait\u0117, I., Pechenizkiy, M., and Gama, J. (2016). An overview of concept drift applications. Big data analysis: New algorithms for a new society. Big Data Analysis: New Algorithms for a New Society, Springer.","DOI":"10.1007\/978-3-319-26989-4_4"},{"key":"ref_26","doi-asserted-by":"crossref","unstructured":"Bifet, A., and Gavalda, R. (2007, January 26\u201328). Learning from time-changing data with adaptive windowing. Proceedings of the 2007 SIAM International Conference on Data Mining, Minneapolis, MN, USA.","DOI":"10.1137\/1.9781611972771.42"},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Bifet, A., Gavald\u00e0, R., Holmes, G., and Pfahringer, B. (2018). Machine Learning for Data Streams: With Practical Examples in MOA, MIT Press.","DOI":"10.7551\/mitpress\/10654.001.0001"},{"key":"ref_28","first-page":"58","article-title":"The problem of concept drift: Definitions and related work","volume":"106","author":"Tsymbal","year":"2004","journal-title":"Comput. Sci. Dep. Trinity Coll. Dublin"},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"119","DOI":"10.5121\/ijdkp.2013.3408","article-title":"Methods for incremental learning: A survey","volume":"3","author":"Ade","year":"2013","journal-title":"Int. J. Data Min. Knowl. Manag. Process"},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"517","DOI":"10.1016\/j.buildenv.2017.07.027","article-title":"Predicting occupancy counts using physical and statistical Co2-based modeling methodologies","volume":"123","author":"Zuraimi","year":"2017","journal-title":"Build. Environ."},{"key":"ref_31","doi-asserted-by":"crossref","first-page":"327","DOI":"10.1016\/j.enbuild.2017.05.031","article-title":"A methodology based on Hidden Markov Models for occupancy detection and a case study in a low energy residential building","volume":"148","author":"Candanedo","year":"2017","journal-title":"Energy Build."},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"28","DOI":"10.1016\/j.enbuild.2015.11.071","article-title":"Accurate occupancy detection of an office room from light, temperature, humidity and CO2 measurements using statistical learning models","volume":"112","author":"Candanedo","year":"2016","journal-title":"Energy Build."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"97","DOI":"10.1007\/s12065-019-00203-y","article-title":"Incremental supervised learning: Algorithms and applications in pattern recognition","volume":"12","author":"Chefrour","year":"2019","journal-title":"Evol. Intell."},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Agarwal, Y., Balaji, B., Gupta, R., Lyles, J., Wei, M., and Weng, T. (2010, January 2). Occupancy-driven energy management for smart building automation. Proceedings of the 2nd ACM Workshop on Embedded Sensing Systems for Energy-Efficiency in Building, Zurich, Switzerland.","DOI":"10.1145\/1878431.1878433"},{"key":"ref_35","doi-asserted-by":"crossref","unstructured":"Berouine, A., Ouladsine, R., Bakhouya, M., Lachhab, F., and Essaaidi, M. (2019, January 22\u201325). A model predictive approach for ventilation system control in energy efficient buildings. Proceedings of the 2019 4th World Conference on Complex Systems (WCCS), Ouarzazate, Morocco.","DOI":"10.1109\/ICoCS.2019.8930739"},{"key":"ref_36","first-page":"877","article-title":"A context-driven platform using Internet of things and data stream processing for heating, ventilation and air conditioning systems control","volume":"233","author":"Lachhab","year":"2019","journal-title":"Proc. Inst. Mech. Eng. Part I J. Syst. Control. Eng."},{"key":"ref_37","doi-asserted-by":"crossref","first-page":"377","DOI":"10.1177\/1420326X9900800605","article-title":"Experimental validation of CO2-based occupancy detection for demand-controlled ventilation","volume":"8","author":"Wang","year":"1999","journal-title":"Indoor Built Environ."},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"521","DOI":"10.1016\/j.apenergy.2012.06.014","article-title":"Importance of occupancy information for building climate control","volume":"101","author":"Oldewurtel","year":"2013","journal-title":"Appl. Energy"},{"key":"ref_39","doi-asserted-by":"crossref","first-page":"114","DOI":"10.1016\/j.procs.2018.07.151","article-title":"Towards a real-time occupancy detection approach for smart buildings","volume":"134","author":"Elkhoukhi","year":"2018","journal-title":"Procedia Comput. Sci."},{"key":"ref_40","doi-asserted-by":"crossref","unstructured":"Vafeiadis, T., Zikos, S., Stavropoulos, G., Ioannidis, D., Krinidis, S., Tzovaras, D., and Moustakas, K. (2017, January 20\u201322). Machine learning based occupancy detection via the use of smart meters. Proceedings of the 2017 International Symposium on Computer Science and Intelligent Controls (ISCSIC), Budapest, Hungary.","DOI":"10.1109\/ISCSIC.2017.15"},{"key":"ref_41","doi-asserted-by":"crossref","first-page":"39","DOI":"10.1016\/j.buildenv.2014.12.011","article-title":"CO2 based occupancy detection algorithm: Experimental analysis and validation for office and residential buildings","volume":"86","author":"Matthes","year":"2015","journal-title":"Build. Environ."},{"key":"ref_42","doi-asserted-by":"crossref","unstructured":"Domingos, P., and Hulten, G. (2000, January 20\u201323). Mining high-speed data streams. Proceedings of the Sixth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Boston, MA, USA.","DOI":"10.1145\/347090.347107"},{"key":"ref_43","first-page":"28","article-title":"A survey on Hoeffding tree stream data classification algorithms","volume":"1","author":"Kumar","year":"2015","journal-title":"CPUH-Res. J."},{"key":"ref_44","doi-asserted-by":"crossref","unstructured":"Bahri, M., Maniu, S., and Bifet, A. (2018, January 10\u201313). A Sketch-Based Naive Bayes Algorithms for Evolving Data Streams. Proceedings of the 2018 IEEE International Conference on Big Data (Big Data), Seattle, WA, USA.","DOI":"10.1109\/BigData.2018.8622178"},{"key":"ref_45","unstructured":"Bifet, A., Holmes, G., Pfahringer, B., Kranen, P., Kremer, H., Jansen, T., and Seidl, T. (2010, January 1\u20133). Moa: Massive online analysis, a framework for stream classification and clustering. Proceedings of the First Workshop on Applications of Pattern Analysis, Cumberland Lodge, Windsor, UK."},{"key":"ref_46","doi-asserted-by":"crossref","unstructured":"Losing, V., Hammer, B., and Wersing, H. (2016, January 12\u201315). KNN classifier with self-adjusting memory for heterogeneous concept drift. Proceedings of the 2016 IEEE 16th International Conference on Data Mining (ICDM), Barcelona, Spain.","DOI":"10.1109\/ICDM.2016.0040"}],"container-title":["Sensors"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1424-8220\/22\/6\/2371\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T22:39:26Z","timestamp":1760135966000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1424-8220\/22\/6\/2371"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,3,19]]},"references-count":46,"journal-issue":{"issue":"6","published-online":{"date-parts":[[2022,3]]}},"alternative-id":["s22062371"],"URL":"https:\/\/doi.org\/10.3390\/s22062371","relation":{},"ISSN":["1424-8220"],"issn-type":[{"value":"1424-8220","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,3,19]]}}}