Abstract: Accurate indoor occupancy measurement is essential for energy-efficient smart buildings and optimized HVAC control. Traditional deep-learning models often struggle with dynamic occupancy patterns and limited data availability. Recently, Large Language Models (LLMs) have emerged as promising solutions due to their adaptability and contextual learning capabilities. This study proposes an LLMs-based building occupancy detection and estimation framework with few-shot learning and in-context learning (ICL). This study evaluates three advanced LLMs (LLaMA 3.2, Gemini-Pro, DeepSeek-R1) against traditional models (Logistic Regression, Decision Tree, XGBoost) using real-world datasets collected in China and Singapore. Results indicate that LLMs consistently achieve superior performance, especially under limited training data conditions. For occupancy detection tasks, Gemini-Pro reached 95.0% accuracy with a 4-day training split and maintained 95.8% accuracy even with a reduced 1-day training period. Similarly, in occupancy estimation tasks, Gemini-Pro achieved 91.2% accuracy (4-day training) and maintained robust performance (94.1%) in a 1-day training scenario. Besides, this study simulates occupancy-centric control using real-world occupancy data in one office, verifying the potential of the proposed framework for saving building energy (10%–30%) and improving occupant comfort.
Loading