Source-linked AI summary

Automatic HVAC Control with Real-time Occupancy Recognition and Simulation-guided Model Predictive Control in Low-cost Embedded System

Muhammad Aftab, Chien Chen, Chi-Kin Chau, Talal Rahwan

arXiv:1708.05208v1eess.SY

TL;DR

The paper addresses inaccurate occupancy sensing and oversimplified thermal models in HVAC automation, especially for dynamically used public spaces. It implements an occupancy-predictive system on Raspberry Pi 3 that combines video recognition, occupancy prediction, and EnergyPlus-guided model predictive control. In a mosque testbed, the system reports 90% occupancy-recognition accuracy, 85% occupancy-prediction accuracy, and more than 30% energy saving while maintaining acceptable comfort.

  • Problem

    Traditional HVAC automation relies on inaccurate occupancy sensors and simplified thermal models, while public-space occupancy patterns vary dynamically and challenge sensing and prediction.

  • Method

    The paper integrates real-time video-based occupancy recognition, dynamic occupancy prediction, and EnergyPlus-guided model predictive control on a Raspberry Pi 3 embedded system.

  • Results

    90% occupancy-recognition accuracy, 85% occupancy-prediction accuracy, and more than 30% energy saving are reported while maintaining comfort within an acceptable range.

  • Takeaways & Limitations

    The integrated system demonstrates automatic HVAC control using low-cost embedded hardware in a large public indoor mosque space.

  • Takeaways & Limitations

    The testbed was evaluated in buildings with somewhat predictable occupancy patterns, and irregular occupancy settings remain challenging.

Abstract

from arXiv · show

Intelligent building automation systems can reduce the energy consumption of heating, ventilation and air-conditioning (HVAC) units by sensing the comfort requirements automatically and scheduling the HVAC operations dynamically. Traditional building automation systems rely on fairly inaccurate occupancy sensors and basic predictive control using oversimplified building thermal response models, all of which prevent such systems from reaching their full potential. Such limitations can now be avoided due to the recent developments in embedded system technologies, which provide viable low-cost computing platforms with powerful processors and sizeable memory storage in a small footprint. As a result, building automation systems can now efficiently execute highly-sophisticated computational tasks, such as real-time video processing and accurate thermal-response simulations. With this in mind, we designed and implemented an occupancy-predictive HVAC control system in a low-cost yet powerful embedded system (using Raspberry Pi 3) to demonstrate the following key features for building automation: (1) real-time occupancy recognition using video-processing and machine-learning techniques, (2) dynamic analysis and prediction of occupancy patterns, and (3) model predictive control for HVAC operations guided by real-time building thermal response simulations (using an on-board EnergyPlus simulator). We deployed and evaluated our system for providing automatic HVAC control in the large public indoor space of a mosque, thereby achieving significant energy savings.

1. Introduction

The paper targets inaccurate occupancy sensing and oversimplified thermal models in public-space HVAC automation. It proposes a Raspberry Pi 3 system combining real-time recognition, occupancy prediction, and EnergyPlus-guided predictive control, evaluated in a mosque testbed.

  • Motivation: Traditional occupancy sensors struggle with stationary occupants and large areas, limiting automation responsiveness.Passive infrared and ultrasound sensors may miss occupants who remain stationary and have limited sensing range.
  • Motivation: Long-horizon predictive control can accumulate error when based on simplified linear thermal models.Physical building thermal-response models are presented as a feasible alternative to complicated nonlinear models.
  • System design: The system uses a low-cost Raspberry Pi 3 to integrate occupancy recognition, dynamic occupancy prediction, and simulation-guided HVAC control.The platform supports real-time video processing and on-board EnergyPlus thermal-response simulation.
  • System design: 90% accuracy is reported for real-time occupancy recognition, while dynamic prediction models capture occupancy trends across day-of-week and seasonal patterns.The recognition system is described as achieving 80-90% accuracy and improving performance in crowded settings through machine learning.
  • Evaluation: More than 30% energy saving is reported in a mosque testbed while maintaining comfort within an acceptable range.The deployment uses a large public indoor space equipped with a fisheye camera, environmental sensors, and an HVAC controller.

2. Background and Related Work

Prior work covers occupancy sensing and prediction plus three MPC approaches, but important gaps remain in embedded, real-world deployment. This paper addresses those gaps by integrating recognition, prediction, and EnergyPlus-guided MPC on low-cost hardware.

  • Occupancy recognition and prediction: PIR sensors can produce erroneous observations when people remain stationary, motivating video-based occupancy detection.Video-based methods can provide better accuracy than PIR counterparts.
  • Occupancy recognition and prediction: Existing video methods may be computationally intensive or depend on head detection, whereas this system is designed for real-time embedded operation without head detection.The latter property makes the approach insensitive to whether occupants wear head covers in the mosque testbed.
  • Occupancy recognition and prediction: Occupancy prediction supports anticipation of building usage and advance pre-cooling through statistical, machine-learning, and stochastic techniques.The literature includes general reviews of occupancy prediction methods.
  • Model predictive control: LTI MPC uses simplified short-horizon thermal models, while nonlinear MPC requires parameter spaces that are difficult to calibrate.Simulation-guided MPC instead uses real-time physical simulators such as EnergyPlus and TRNSYS.
  • Model predictive control: Earlier EnergyPlus co-simulation studies were limited to simulations, while real-world MPC studies often required costly desktop computation.The paper implements real-world MPC using free software, low-cost embedded systems, and real-time EnergyPlus simulation.

3. Occupancy Recognition

The occupancy-recognition system infers people entering and leaving from fisheye video on an embedded platform. Its pipeline isolates backgrounds, detects and tracks silhouettes, logs crossings, and resolves inconsistencies.

  • System challenges: The system addresses building-specific occlusions and embedded hardware limits when inferring occupancy from video streams.Occupants may be obscured by obstacles such as pillars, while Raspberry Pi has less processing power and memory than desktop computers.
  • Recognition approach: The core method counts moving blobs crossing a virtual reference line near the entrance to update the number of occupants.Each connected moving blob is interpreted as a person and tracked to determine whether it crosses the line.
  • Recognition pipeline: The five-stage pipeline comprises background isolation, silhouette detection, object tracking, inward/outward logging, and inconsistency resolution.The flowchart is presented in Figure 2 and the implementation uses OpenCV and openFrameworks.
  • Background isolation: Background isolation uses Gaussian mixture-based background/foreground segmentation to handle changing illumination and occupant shadows.The background can vary with time of day, including changes caused by artificial lighting.

3.2. Silhouette Detection

The system detects moving silhouettes from video, tracks them across frames, and counts occupants crossing a virtual reference line. Overlapping silhouettes remain a key source of missed occupants, especially when people leave rapidly.

  • Silhouettes are extracted by comparing consecutive frames, with area thresholds adjusted for camera viewpoint, orientation, and distance.Silhouettes smaller than threshold A are ignored, and different space regions use different A values.
  • The algorithm tracks silhouette bounding boxes between consecutive frames using a distance threshold d.Current-frame boxes are matched to previous-frame boxes when they are sufficiently close.
  • Occupants are counted when tracked objects cross a virtual reference line near the entrance.Inward crossings increment the count, while outward crossings decrement it.
  • Overlapping silhouettes can merge into one detected individual, causing more missed occupants when people leave faster than they enter.The resulting count may incorrectly suggest that occupants remain after the building has emptied.
  • Counter freezing and resetting reduce inconsistency errors but are insufficient, motivating a dedicated resolution technique.

3.6. Improvement by Machine Learning

Machine learning improves occupancy recognition when overlapping people make geometric detection unreliable. The system trains a classifier on manually labeled silhouette images after reducing their visual representation.

  • Machine learning and image classification address cases where one bounding box contains occupants positioned directly behind one another.Bounding-box width alone was insufficient for these overlapping silhouettes.
  • The training dataset contains 13,000 manually labeled blobs collected from one week of video footage.
  • Images are converted to grayscale, resized to 30×15 pixels, and projected by randomized PCA into 25 features.
  • Gaussian Naive Bayes classifies each blob according to its estimated number of occupants.

3.7. Privacy Enhancement

The system enhances privacy by restricting camera-stream access and using a frosted lens. The lens makes occupants’ faces unrecognizable while preserving the privacy-oriented design.

  • Video and image files are discarded immediately after processing, while camera access is restricted to a single process.Other programs are blocked from accessing the camera while the system runs.
  • A hardware-based frosted lens prevents occupants’ faces from being recognizable.

3.8. Evaluation Results

Evaluation measures occupancy-recognition accuracy across crowding, day types, privacy-preserving imaging, machine learning, and daily occupancy trends. The system captures general occupancy patterns, while accuracy decreases under heavier crowding and overlapping silhouettes.

  • Occupancy recognition is evaluated against manually counted occupants from 800×600-pixel videos sampled at 30 frames per second.Manual ground truth was available for only a small number of videos because counting every frame was laborious.
  • Accuracy is defined separately for entering and exiting occupants using detected versus missed individuals.The definitions use Totalin, Missingin, Totalout, and Missingout.
  • The algorithm recognizes occupancy with high accuracy even when over 400 individuals enter in 20 minutes, but accuracy decreases as entry rates increase.Higher rates create more overlapping silhouettes, making exact occupancy harder to determine.
  • Accuracy is lowest on Friday and highest during the weekend, corresponding to the busiest and least busy experimental days.
  • The frosted lens reduces accuracy only slightly despite considerably blurring the video footage.
  • Machine learning significantly improves F1-Score under 10-fold cross-validation on the 13,000-blob dataset.Precision, Recall, and F1-Score are compared before and after applying the technique.
  • Detected occupancy clearly captures the general occupancy trend on typical Friday and Saturday days.The daily pattern includes peaks associated with the five daily prayers, with Friday distinguished because of the sermon and larger attendance.

4. Occupancy Prediction

The paper predicts future occupancy using general and mosque-specific regression models that incorporate temporal, weekly, holiday, and prayer-related patterns. Domain-specific models outperform alternatives, with polynomial regression selected for HVAC control.

  • Approach: Occupancy prediction uses regression models to capture future trends across day-of-week, seasonal, and application-specific usage patterns.The predicted trends support HVAC optimization, including pre-cooling before large occupant arrivals.
  • General-purpose approach: The general approach extends linear regression with special-event features, including time differences from past and upcoming events and binary event indicators.The framework permits application-specific features such as whether the time coincides with New Year’s Eve.
  • Domain-specific approach: The mosque-specific models use time relative to past and next prayers, day of week, and public-holiday status; polynomial regression uses the same features as linear regression.Prayer times shift throughout the year, motivating features based on the current and neighboring prayer times.
  • Evaluation: R-squared increases with better performance, whereas RMSE decreases; both metrics are used to evaluate the occupancy prediction models.The evaluation uses a 24-hour forecasting horizon and compares multiple regression approaches with the LastWeek baseline.
  • Evaluation results: R-squared 0.87 and RMSE 0.03 characterize c PRDomSp, which outperforms the alternatives and is adopted for HVAC control.Its domain-specific features include weekday effects, public holidays, and training on only the past 30 days; c LRSpEv performs about as well as LastWeek.

5. Building Thermal Response Simulation

The system builds and calibrates an EnergyPlus model to simulate building thermal response for real-time HVAC control. Calibration iteratively reduces measured–simulated temperature error, with performance depending on the parameters selected and running feasibly on Raspberry Pi 3.

  • Simulation framework: EnergyPlus provides detailed physical building and system models, while co-simulation couples simulators and tools for simulation and calibration.The approach uses more realistic thermal modeling than simplified first-principle linear models.
  • Building model: The testbed model represents a mosque’s large indoor space with packaged rooftop HVAC units and ceiling-based cool-air distribution.SketchUp supplies the 3D geometry, which is imported into OpenStudio for HVAC parameters based on vendor specifications.
  • Calibration targets: Calibration targets uncertain HVAC capacity and airflow parameters plus roof, wall, and window thickness and conductivity.These parameters are selected because they are unknown or may differ from datasheet values.
  • Calibration algorithm: The calibration algorithm varies one parameter across repeated co-simulations, selects the value minimizing temperature error, and iterates until an acceptable threshold is reached.The algorithm updates parameters sequentially, and its outcome does not depend on iteration order.
  • Calibration evaluation: A 24-hour calibration test uses about 100 co-simulations with 10-minute sampling, and CVRMSE below 2.0% is treated as acceptable.CVRMSE and MBE measure calibration performance; CVRMSE avoids the cancellation effect that can affect MBE.
  • Runtime and results: 43 seconds per co-simulation on Raspberry Pi 3 permits about 2000 co-simulations daily, while calibrated results support continuous model correction for real-time HVAC control.Performance improvements vary significantly depending on which parameters are calibrated.

6. Simulation-guided Model Predictive Control

HVAC-MPC combines occupancy prediction with EnergyPlus thermal-response simulation to schedule setpoints and pre-cooling. In mosque testbed experiments, it reduced HVAC operation while maintaining acceptable occupied-period thermal comfort and saving 23%–39% energy.

  • HVAC-MPC framework: HVAC-MPC uses occupancy prediction and EnergyPlus simulation to determine HVAC setpoint schedules and pre-cooling times.The control algorithm simulates temperature responses under candidate pre-cooling schedules and iteratively adjusts the start time.
  • HVAC-MPC framework: When the building is unoccupied, HVAC-MPC raises the temperature setpoint; it later lowers the setpoint when pre-cooling should begin.The algorithm checks current occupancy, predicts future occupancy, and waits or starts pre-cooling accordingly.
  • Evaluation: During occupied periods, HVAC-MPC keeps PMV almost always within the recommended range and PPD close to 5%.The baseline instead operates HVAC throughout the day, with PMV outside the recommended range and considerable dissatisfaction most of the day.
  • Evaluation: 23%–39% energy savings were achieved relative to corresponding days when HVAC-MPC was not activated.The algorithm was evaluated in the testbed over one week, with comparisons made against corresponding days from the previous week.

7. Testbed Design and Implementation

The testbed implements automatic HVAC control through building-installed sensing, occupancy monitoring, energy measurement, and wireless control hardware, connected to a cloud management system. Raspberry Pi modules process fish-eye camera video and execute the MPC-derived HVAC schedule.

  • System architecture: The system uses a low-cost Raspberry Pi 3 platform for automatic HVAC control with real-time occupancy recognition and EnergyPlus-guided MPC.The platform cost as little as $35 per unit as of 2016.
  • System architecture: The system comprises a building automation subsystem and a cloud-based management subsystem.The cloud subsystem includes a remote server for data storage and a web GUI for visualization, analysis, and remote access.
  • Building automation subsystem: Building hardware includes temperature and humidity sensors, occupancy monitors, energy meters, and customized wireless HVAC controllers.The sensors are self-powered and maintenance-free, while the occupancy monitor uses a Raspberry Pi and fish-eye camera.
  • Building automation subsystem: Occupancy modules are installed above entry doors, with multiple modules needed when a building has multiple entry or exit points.Each module covers a single entry or exit point.
  • Building automation subsystem: The wireless HVAC controller operates the unit according to MPC setpoints and can switch control back to the default thermostat.Relays control compressor and fan circuits, while a switchover relay allows occupants to disable automatic control.

8. Conclusion

The paper presents a low-cost embedded HVAC system combining real-time occupancy recognition, occupancy prediction, and EnergyPlus-guided MPC. In the mosque testbed, it achieved reported accuracy and energy-saving results while maintaining acceptable comfort, but evaluation remains bounded by somewhat predictable occupancy patterns.

  • Conclusion: The system combines real-time occupancy recognition, dynamic occupancy prediction, and simulation-guided MPC on a low-cost Raspberry Pi platform.It was deployed and evaluated in a large public indoor space of a mosque.
  • Conclusion: 90% occupancy-recognition accuracy, 85% occupancy-prediction accuracy, and more than 30% energy savings were reported while maintaining acceptable comfort.These results summarize the reported testbed performance.
  • Conclusion: The Raspberry Pi version of EnergyPlus was publicly released for other researchers’ future building-automation projects.The release extends the paper’s implementation beyond the reported testbed.
  • Conclusion: The system was evaluated in buildings with somewhat predictable occupancy patterns, making irregular-occupancy settings challenging for application.Future work proposes robust online HVAC control using minimal occupancy prediction.
Loading 1708.05208v1…