Accurate Indoor Air Quality (IAQ) forecasting can support affordable and privacy-conscious interventions in classrooms and workplaces. However, most existing systems depend on cloud-based inference, which introduces additional cost, network dependency, and reliability issues. In this work, we present a comparative evaluation of three ensemble tree models—Random Forest, XGBoost, and LightGBM—implemented directly on an ESP32-S3 microcontroller for edge-based IAQ prediction of CO2 and PM2.5. A unified feature extraction strategy was employed, combining temporal encodings, lagged variables, and short rolling aggregates. Models were trained offline, converted into C, and embedded into the device firmware. Their performance was assessed with respect to (i) forecasting accuracy, using MAPE and RMSPE, and (ii) resource efficiency, including flash storage, RAM usage, and inference latency. Experimental results indicate that boosted methods (XGBoost and LightGBM) provide higher accuracy than Random Forest while staying within the strict memory and timing limits of the ESP32. This demonstrates the feasibility of fully self-contained IAQ forecasting on ultra-low-cost hardware, without reliance on cloud resources. Furthermore, we outline trade-offs between model complexity and efficiency, and provide a reproducible toolchain for exporting tree ensembles into deployable ESP32 firmware, highlighting their practicality for resource-constrained IAQ monitoring.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

On-Device Tree-Based IAQ Forecasting on ESP32: A Comparative Evaluation

  • Hasin Mahir,
  • Tahfizul Hasan Zihan,
  • Md. Shirazim Munir,
  • M. M. Kamal,
  • Mahady Hasan,
  • Md. Tarek Habib

摘要

Accurate Indoor Air Quality (IAQ) forecasting can support affordable and privacy-conscious interventions in classrooms and workplaces. However, most existing systems depend on cloud-based inference, which introduces additional cost, network dependency, and reliability issues. In this work, we present a comparative evaluation of three ensemble tree models—Random Forest, XGBoost, and LightGBM—implemented directly on an ESP32-S3 microcontroller for edge-based IAQ prediction of CO2 and PM2.5. A unified feature extraction strategy was employed, combining temporal encodings, lagged variables, and short rolling aggregates. Models were trained offline, converted into C, and embedded into the device firmware. Their performance was assessed with respect to (i) forecasting accuracy, using MAPE and RMSPE, and (ii) resource efficiency, including flash storage, RAM usage, and inference latency. Experimental results indicate that boosted methods (XGBoost and LightGBM) provide higher accuracy than Random Forest while staying within the strict memory and timing limits of the ESP32. This demonstrates the feasibility of fully self-contained IAQ forecasting on ultra-low-cost hardware, without reliance on cloud resources. Furthermore, we outline trade-offs between model complexity and efficiency, and provide a reproducible toolchain for exporting tree ensembles into deployable ESP32 firmware, highlighting their practicality for resource-constrained IAQ monitoring.