Skip to main content
QUICK REVIEW

[Paper Review] Occupancy Detection in Room Using Sensor Data

Mohammadhossein Toutiaee|arXiv (Cornell University)|Jan 10, 2021
Video Surveillance and Tracking Methods11 references5 citations
TL;DR

This study evaluates seven machine learning models—Decision Tree, Random Forest, Gradient Boosting, Logistic Regression, Naive Bayes, Kernelized SVM, and K-Nearest Neighbors—on sensor data (temperature, humidity, light, CO2) to detect room occupancy. Using a publicly available dataset with ground truth from camera labeling, the models achieved over 98% accuracy, with Light and CO2 as the most predictive variables, demonstrating high performance even with minimal feature sets.

ABSTRACT

With the advent of Internet of Thing (IoT), and ubiquitous data collected every moment by either portable (smart phone) or fixed (sensor) devices, it is important to gain insights and meaningful information from the sensor data in context-aware computing environments. Many researches have been implemented by scientists in different fields, to analyze such data for the purpose of security, energy efficiency, building reliability and smart environments. One study, that many researchers are interested in, is to utilize Machine Learning techniques for occupancy detection where the aforementioned sensors gather information about the environment. This paper provides a solution to detect occupancy using sensor data by using and testing several variables. Additionally we show the analysis performed over the gathered data using Machine Learning and pattern recognition mechanisms is possible to determine the occupancy of indoor environments. Seven famous algorithms in Machine Learning, namely as Decision Tree, Random Forest, Gradient Boosting Machine, Logistic Regression, Naive Bayes, Kernelized SVM and K-Nearest Neighbors are tested and compared in this study.

Motivation & Objective

  • To evaluate and compare the performance of seven established machine learning algorithms in detecting indoor occupancy using sensor data.
  • To assess the predictive power of individual and combined sensor variables—temperature, humidity, light, and CO2—on occupancy detection.
  • To reproduce and extend prior work using the same dataset, including models not previously tested in the original study.
  • To determine whether simplified feature sets (e.g., Light and CO2 only) can achieve high accuracy, enabling deployment in low-resource environments.

Proposed method

  • The study uses a public dataset with three splits: training (8,143 samples), validation (2,665), and test (9,752), collected under open- and closed-door conditions.
  • Sensor variables include temperature, humidity, light (illuminance), CO2 concentration, and a ratio variable; occupancy is the binary target (0 = unoccupied, 1 = occupied).
  • All models are trained on the training set and evaluated on the validation and test sets, excluding the 'Date' variable to avoid data leakage.
  • Feature combinations are tested, including Light and CO2, CO2 and Temperature, and others, to assess variable importance and model robustness.
  • Performance is measured using accuracy, with cross-validation and hyperparameter tuning applied to optimize each model.
  • Models include: Decision Tree, Random Forest, Gradient Boosting Machine, Logistic Regression, Naive Bayes, Kernelized SVM, and K-Nearest Neighbors, all implemented in Python.

Experimental results

Research questions

  • RQ1Which machine learning algorithm achieves the highest accuracy in occupancy detection using only environmental sensor data?
  • RQ2How well can occupancy be predicted using only two sensor variables—light and CO2—compared to full feature sets?
  • RQ3Does the performance of models vary significantly between open-door (validation) and closed-door (test) conditions?
  • RQ4How do different models compare in terms of robustness and generalization across training, validation, and test sets?
  • RQ5Can models trained on sensor data alone achieve high accuracy without relying on human presence tracking or complex fusion techniques?

Key findings

  • The Decision Tree model achieved over 98% accuracy on all three datasets (training, validation, and test), outperforming most other models.
  • Random Forest and Gradient Boosting Machine both achieved over 99% accuracy on the training and test sets when using Light and CO2 as features.
  • Naive Bayes achieved 98% accuracy using only Light and CO2, indicating strong performance with minimal feature input.
  • K-Nearest Neighbors achieved 98% accuracy on the validation set and 97% on the test set using Light and CO2, showing high generalization.
  • Models using CO2 and Temperature together performed poorly, with accuracy dropping significantly compared to Light-CO2 combinations.
  • The combination of Light and CO2 alone achieved over 98% accuracy across multiple models and datasets, suggesting they are the most informative predictors.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.