Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Constrained Tiny Machine Learning for Predicting Gas Concentration with I4.0 Low-cost Sensors

Published: 11 May 2024 Publication History

Abstract

Low-cost gas sensors (LCS) often produce inaccurate measurements due to varying environmental conditions that are not consistent with laboratory settings, leading to inadequate productivity levels compared to high-quality sensors. To address this issue, we propose the use of Machine Learning (ML) to predict accurate concentrations of pollutant gases acquired by LCS integrated into an embedded Internet of Things platform. However, a key challenge is to optimize an accurate ML design under low memory and computation power constraints of microcontrollers (MCUs) while maintaining accurate ML scores.
After data analysis and pre-processing, we assess and analyze the performance of five ML algorithms to predict the concentration of pollutants gases from multiple specifications (weather, presence of other gases, etc.). To support the experiments, datasets from three sources are used: (1) VOCSens, (2) Belgian Interregional Environment Agency cell, and (3) Visual-Crossing. Once the best model was optimized and validated, multiple hard constraints were added to the selected ML structure to satisfy material and expert requirements. Trained models were ported to be implemented locally in a MCU after comparing several porting libraries. The assembled code obtained is evaluated based on two metrics: storage memory consumption and inference time, relative to the highest attainable capacities.
The improved random forest is the best ML model for the used dataset with an R2 score meeting of 0.72 and Root Means Square Error of 0.0028 ppm. The best generated Tiny-ML model needs 3% of RAM and 98% of Flash storage.
The empirical results prove that the developed ML algorithm applied to LCS provides high accuracy to predict pollutant gases. This algorithm can also be used to adjust the LCS systems to provide calibrated data in real time, even if the platform being used is not particularly advanced or powerful.

References

[1]
Sharafat Ali, Tyrel Glass, Baden Parr, Johan Potgieter, and Fakhrul Alam. 2020. Low cost sensor with IoT LoRaWAN connectivity and machine learning-based calibration for air pollution monitoring. IEEE Trans. Instrum. Meas. 70 (2020), 1–11.
[2]
Alphasense. 2023. Retrieved from https://www.alphasense.com/products.
[3]
Ambiq. 2022. Ambiq Apollo 3 Blue. Retrieved September 19, 2022 from https://ambiq.com/apollo3-blue/.
[4]
Arduino. 2022. Arduino Mega 2560 Rev3. Retrieved September 19, 2022 from https://store.arduino.cc/products/arduino-mega-2560-rev3.
[5]
Eloquent Arduino. 2020. micromlgen. Retrieved September 19, 2022 from https://github.com/eloquentarduino/micromlgen. ([online] 2020).
[6]
Eloquent Arduino. 2020. TinyMLgen. Retrieved August 05, 2022 from https://github.com/eloquentarduino/tinymlgen.
[7]
Kasimir Aula, Eemil Lagerspetz, Petteri Nurmi, and Sasu Tarkoma. 2022. Evaluation of low-cost air quality sensor calibration models. ACM Trans. Sens. Netw. 18, 4 (2022), 1–32.
[8]
Belgian Interregional Environment Agency (IRCEL CELINE). Air Quality Measurements. CELINE. Retrieved from https://irceline.be/en/front-page?set_language=en.
[9]
Tianqi Chen, Thierry Moreau, Ziheng Jiang, Lianmin Zheng, Eddie Yan, Haichen Shen, Meghan Cowan, Leyuan Wang, Yuwei Hu, Luis Ceze, et al. 2018. \(\lbrace\) TVM \(\rbrace\) : An automated \(\lbrace\) End-to-End \(\rbrace\) optimizing compiler for deep learning. In Proceedings of the 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI’18). 578–594.
[10]
Francesco Concas, Julien Mineraud, Eemil Lagerspetz, Samu Varjonen, Xiaoli Liu, Kai Puolamäki, Petteri Nurmi, and Sasu Tarkoma. 2021. Low-cost outdoor air quality monitoring and sensor calibration: A survey and critical analysis. ACM Trans. Sens. Netw. 17, 2 (2021), 1–44.
[11]
Robert David, Jared Duke, Advait Jain, Vijay Janapa Reddi, Nat Jeffries, Jian Li, Nick Kreeger, Ian Nappier, Meghna Natraj, Tiezhen Wang, et al. 2021. Tensorflow lite micro: Embedded machine learning for TinyML systems. Proc. Mach. Learn. Syst. 3 (2021), 800–811.
[12]
Saverio De Vito, Ettore Massera, Marco Piga, Luca Martinotto, and Girolamo Di Francia. 2008. On field calibration of an electronic nose for benzene estimation in an urban pollution monitoring scenario. Sens. Actuat. B: Chem. 129, 2 (2008), 750–757.
[13]
Darius Morawiec et al.2017. weka-porter. Retrieved August 05, 2022 from https://github.com/nok/weka-porter.
[14]
Darius Morawiec et al.2019. sklearn-porter. Retrieved August 05, 2022 from https://github.com/nok/sklearn-porter.
[15]
Fraunhofer-IMS. 2021. AIfES. Retrieved January 04, 2022 from https://github.com/Fraunhofer-IMS/AIfES_for_Arduino.
[16]
Jerome H. Friedman. 1997. On bias, variance, 0/1–loss, and the curse-of-dimensionality. Data Min. Knowl. Discov. 1, 1 (1997), 55–77.
[17]
Pierre Geurts, Damien Ernst, and Louis Wehenkel. 2006. Extremely randomized trees. Mach. Learn. 63, 1 (2006), 3–42.
[18]
Chen Huan, Liu Zhiyu, and Fu Gang. 2011. Analysis of the aging characteristics of SnO2 gas sensors. Sens. Actuat. B: Chem. 156, 2 (2011), 912–917.
[19]
Kazuki Iwata, Hiroyuki Abe, Teng Ma, Daisuke Tadaki, Ayumi Hirano-Iwata, Yasuo Kimura, Shigeaki Suda, and Michio Niwano. 2022. Application of neural network based regression model to gas concentration analysis of TiO2 nanotube-type gas sensors. Sens. Actuat. B: Chem. 361 (2022), 131732.
[20]
Ronit Jakob, Anja Roth, Karsten Haas, Eva M. Krupp, Andrea Raab, Patricia Smichowski, Darío Gómez, and Jörg Feldmann. 2010. Atmospheric stability of arsines and the determination of their oxidative products in atmospheric aerosols (PM 10): Evidence of the widespread phenomena of biovolatilization of arsenic. J. Environ. Monitor. 12, 2 (2010), 409–416.
[21]
Andrew A. Lacis, Donald J. Wuebbles, and Jennifer A. Logan. 1990. Radiative forcing of climate by changes in the vertical distribution of ozone. J. Geophys. Res.: Atmosph. 95, D7 (1990), 9971–9981.
[22]
Michael P. LaValley. 2008. Logistic regression. Circulation 117, 18 (2008), 2395–2399.
[23]
Ji Lin, Wei-Ming Chen, Yujun Lin, Chuang Gan, Song Han, et al. 2020. Mcunet: Tiny deep learning on iot devices. Adv. Neural Inf. Process. Syst. 33 (2020), 11711–11722.
[24]
Shuai Liu, Mengye Lu, Hanshuang Li, and Yongchun Zuo. 2019. Prediction of gene expression patterns with generalized linear regression model. Front. Genet. 10 (2019), 120.
[25]
Géraldin Nanfack, Paul Temple, and Benoît Frénay. 2022. Constraint enforcement on decision trees: A survey. ACM Comput. Surv. (2022).
[26]
neil-tan et al.2017. uTensor. Retrieved August 05, 2022 from https://github.com/uTensor/uTensor.
[27]
nikita titov et al.2019. m2cgen. Retrieved September 19, 2022 from https://github.com/BayesWitnesses/m2cgen.
[28]
Jon Nordby. 2019. emlearn: Machine learning inference engine for microcontrollers and embedded devices.
[29]
Nwamaka U. Okafor, Yahia Alghorani, and Declan T. Delaney. 2020. Improving data quality of low-cost IoT sensors in environmental monitoring networks using data fusion and machine learning approach. ICT Expr. 6, 3 (2020), 220–228.
[30]
E. Ramanujam, Thinagaran Perumal, and S. Padmavathi. 2021. Human activity recognition with smartphone and wearable sensors using deep learning techniques: A review. IEEE Sens. J. 21, 12 (2021), 13029–13040.
[31]
Partha Pratim Ray. 2021. A review on TinyML: State-of-the-art and prospects. J. King Saud Univ.-Comput. Inf. Sci. (2021).
[32]
Fouad Sakr, Francesco Bellotti, Riccardo Berta, and Alessandro De Gloria. 2020. Machine learning on mainstream microcontrollers. Sensors 20, 9 (2020), 2638.
[33]
Swapnil Sayan Saha, Sandeep Singh Sandha, and Mani Srivastava. 2022. Machine learning for microcontroller-class hardware–A review. (unpublished).
[34]
Minxing Si, Ying Xiong, Shan Du, and Ke Du. 2020. Evaluation and calibration of a low-cost particle sensor in ambient conditions using machine-learning methods. Atmos. Meas. Techn. 13, 4 (2020), 1693–1707.
[35]
Domenico Suriano and Michele Penza. 2022. Assessment of the performance of a low-cost air quality monitor in an indoor environment through different calibration models. Atmosphere 13, 4 (2022), 567.
[36]
Enrico Tabanelli, Giuseppe Tagliavini, and Luca Benini. 2022. Optimizing random forest-based inference on RISC-V MCUs at the extreme edge. IEEE Trans. Comput.-Aid. Des. Integr. Circ. Syst. 41, 11 (2022), 4516–4526.
[37]
Hind Taud and J. F. Mas. 2018. Multilayer perceptron (MLP). In Geomatic Approaches for Modeling Land Change Scenarios. Springer, 451–455.
[38]
Dipanwita Thakur and Suparna Biswas. 2021. Feature fusion using deep learning for smartphone based human activity recognition. Int. J. Inf. Technol. 13, 4 (2021), 1615–1624.
[39]
Jacob Thorson, Ashley Collier-Oxandale, and Michael Hannigan. 2019. Using a low-cost sensor array and machine learning techniques to detect complex pollutant mixtures and identify likely sources. Sensors 19, 17 (2019), 3723.
[40]
Wataru Tsujita, Akihito Yoshino, Hiroshi Ishida, and Toyosaka Moriizumi. 2005. Gas sensor network for air-pollution monitoring. Sens. Actuat. B: Chem. 110, 2 (2005), 304–311.
[41]
Zushuai Wei, Yizhuo Meng, Wen Zhang, Jian Peng, and Lingkui Meng. 2019. Downscaling SMAP soil moisture estimation with gradient boosting decision tree regression over the Tibetan Plateau. Remote Sens. Environ. 225 (2019), 30–44.
[42]
Jiecao Yu, Andrew Lukefahr, Reetuparna Das, and Scott Mahlke. 2019. Tf-net: Deploying sub-byte deep neural networks on microcontrollers. ACM Trans. Embed. Comput. Syst. 18, 5s (2019), 1–21.
[43]
Wengang Zhang, Chongzhi Wu, Yongqin Li, Lin Wang, and P. Samui. 2021. Assessment of pile drivability using random forest regression and multivariate adaptive regression splines. Georisk 15, 1 (2021), 27–40.
[44]
Naomi Zimmerman, Albert A. Presto, Sriniwasa P. N. Kumar, Jason Gu, Aliaksei Hauryliuk, Ellis S. Robinson, Allen L. Robinson, and Ramachandran Subramanian. 2018. A machine learning calibration model using random forests to improve sensor performance for lower-cost air quality monitoring. Atmos. Meas. Techn. 11, 1 (2018), 291–313.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Embedded Computing Systems
ACM Transactions on Embedded Computing Systems  Volume 23, Issue 3
May 2024
452 pages
EISSN:1558-3465
DOI:10.1145/3613579
  • Editor:
  • Tulika Mitra
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Journal Family

Publication History

Published: 11 May 2024
Online AM: 14 April 2023
Accepted: 28 March 2023
Revised: 21 March 2023
Received: 30 September 2022
Published in TECS Volume 23, Issue 3

Check for updates

Author Tags

  1. Constrained machine learning
  2. TinyML
  3. low-cost sensors
  4. regression
  5. random forest
  6. gas concentration
  7. calibration

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 374
    Total Downloads
  • Downloads (Last 12 months)283
  • Downloads (Last 6 weeks)20
Reflects downloads up to 13 Sep 2024

Other Metrics

Citations

View Options

Get Access

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Full Text

View this article in Full Text.

Full Text

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media