{"title":"Exploring large language models for indoor occupancy measurement in smart office buildings","authors":"Irfan Qaisar , Kailai Sun , Qianchuan Zhao","doi":"10.1016/j.buildenv.2025.113860","DOIUrl":null,"url":null,"abstract":"<div><div>Accurately measuring building occupancy is essential for optimizing Heating, Ventilation, and Air Conditioning control and enhancing energy efficiency in smart buildings. However, existing machine learning models often struggle to generalize across diverse occupancy patterns with limited data. Recent advances in large language models present new opportunities by leveraging contextual reasoning and few-shot learning to enhance performance in smart building systems. This study proposes an LLM-based framework for real-time indoor occupancy measurement, incorporating few-shot learning, chain-of-thought reasoning, and in-context learning techniques. This study explores how LLMs can enable accurate and data-efficient occupancy measurement for indoor occupant-centric control and energy optimization. We evaluate LLMs’ performance against traditional models across two case studies: binary occupancy detection and multi-level occupancy estimation. Experiments are conducted using two real-world datasets collected from office buildings in China and Singapore. Results indicate that LLMs consistently outperform traditional models across various time intervals and training/testing configurations. Under a 4-day training/1-day testing setup, DeepSeek-R1 achieves 95.92% accuracy and a 96.1% F1-score, while Gemini-Pro attains 94.14% accuracy in multi-level estimation with only 1 day of training. An occupant-centric control (OCC) simulation and ablation study were implemented in EnergyPlus with real data to improve energy efficiency and comfort. These findings highlight the adaptability and robustness of LLMs, positioning them as promising tools for real-time occupancy measurement in smart office environments. Code and implementation details are available at: <span><span>https://github.com/kailaisun/LLM-occupancy</span><svg><path></path></svg></span>.</div></div>","PeriodicalId":9273,"journal":{"name":"Building and Environment","volume":"287 ","pages":"Article 113860"},"PeriodicalIF":7.6000,"publicationDate":"2025-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Building and Environment","FirstCategoryId":"5","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0360132325013307","RegionNum":1,"RegionCategory":"工程技术","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"CONSTRUCTION & BUILDING TECHNOLOGY","Score":null,"Total":0}
引用次数: 0
Abstract
Accurately measuring building occupancy is essential for optimizing Heating, Ventilation, and Air Conditioning control and enhancing energy efficiency in smart buildings. However, existing machine learning models often struggle to generalize across diverse occupancy patterns with limited data. Recent advances in large language models present new opportunities by leveraging contextual reasoning and few-shot learning to enhance performance in smart building systems. This study proposes an LLM-based framework for real-time indoor occupancy measurement, incorporating few-shot learning, chain-of-thought reasoning, and in-context learning techniques. This study explores how LLMs can enable accurate and data-efficient occupancy measurement for indoor occupant-centric control and energy optimization. We evaluate LLMs’ performance against traditional models across two case studies: binary occupancy detection and multi-level occupancy estimation. Experiments are conducted using two real-world datasets collected from office buildings in China and Singapore. Results indicate that LLMs consistently outperform traditional models across various time intervals and training/testing configurations. Under a 4-day training/1-day testing setup, DeepSeek-R1 achieves 95.92% accuracy and a 96.1% F1-score, while Gemini-Pro attains 94.14% accuracy in multi-level estimation with only 1 day of training. An occupant-centric control (OCC) simulation and ablation study were implemented in EnergyPlus with real data to improve energy efficiency and comfort. These findings highlight the adaptability and robustness of LLMs, positioning them as promising tools for real-time occupancy measurement in smart office environments. Code and implementation details are available at: https://github.com/kailaisun/LLM-occupancy.
期刊介绍:
Building and Environment, an international journal, is dedicated to publishing original research papers, comprehensive review articles, editorials, and short communications in the fields of building science, urban physics, and human interaction with the indoor and outdoor built environment. The journal emphasizes innovative technologies and knowledge verified through measurement and analysis. It covers environmental performance across various spatial scales, from cities and communities to buildings and systems, fostering collaborative, multi-disciplinary research with broader significance.