Alcohol Sensor Calibration on the Edge Using Tiny Machine Learning (Tiny-ML) Hardware

IntroductionDetecting precise concentrations of alcohol by means of a wearable sensor with varying relative humidity and temperature, has been a challenge in gas detection methods. By acquiring sensor data under these varying conditions and analyzing the data, we can better quantify the sensor behavior and extract precise measurements from the sensor. Improved analysis of the system behavior is required to identify decay or drift over a period of time Machine Learning (ML) can be used to improve the sensor calibration by using the collected data. Machine Learning can be leveraged for a reduction in costs and implementation effort for decorrelating the effect of changing humidity and temperature on sensor response. Microcontrollers offer benefits such as low energy consumption, small size and are suitable as a computing device for wearable applications. By running machine learning inference on microcontrollers, dependency on the network connectivity can be reduced, which is generally focused on bandwidth and power limitation and results in higher latency. Since data is processed at the device itself during testing, it can preserve the confidentiality of data under test. Previous studies have implemented decorrelation of temperature and humidity for the gas sensor, where model building and testing of sensor data were done at the remote computer. The goal of this study is to improve the precision of alcohol sensing by decorrelating the effect caused due to change in environmental conditions by applying machine learning at the edge.MethodologyWe have implemented an alcohol sensor for wearable applications to find the level of alcohol consumed by the subject. An alcohol sensor is interfaced with nRF52480 microcontroller with Bluetooth Low Energy (BLE) being a special feature to send sensor data to other computing devices as shown in Fig. 1. The response of the sensor was assessed under precise test environments to recognize the and compute their relation with the alcohol sensor output. In this study, data from a temperature sensor, humidity sensor and alcohol sensor are collected over a period of a week at the local computer and these are used as a training dataset for building the machine learning model. The received dataset is pre-processed and an ML model is trained to quantify the sensor output. Google Colab is used to build a Tiny Machine Learning (Tiny-ML) model with the help of a tensor-flow lite micro-library. The generated machine learning model is uploaded to the microcontroller for the prediction of data under test to compensates for the influence of ambient situations on an alcohol sensor. The novelty of this study is to quantify the output of an alcohol sensor by applying the ML model on test data at the embedded system itself and to calibrate the sensor response locally. The corrective procedure appears to be effective in refining the sensor response enactment under a variety of thermal and humidity situations.Keyword: Sensor Calibration, Tiny Machine Learning, Edge ComputingReference 1. Huerta, Ramon, et al. "Online decorrelation of humidity and temperature in chemical sensors for continuous monitoring." Chemometrics and Intelligent Laboratory Systems 157 (2016): 169-176. doi: 10.1016/j.chemolab.2016.07.0042. Jalal, A. H.; Umasankar, Y.; Gonzalez, P. J.; Alfonso, A.; Bhansali, S. 2017. Multimodal technique to eliminate humidity interference for specific detection of ethanol, Biosensors and Bioelectronics, 2017Jan 15;87:522-530. doi: 10.1016/j.bios.2016.08.1063. Peng Wei, Zhi Ning, Sheng Ye, Li Sun, Fenhuan Yang, Ka Chun Wong, Dane Westerdahl, and Peter K. K. Louie, Impact Analysis of Temperature and Humidity Conditions on Electrochemical Sensor Response in Ambient Air Quality Monitoring, Sensors (Basel). 2018 Feb; 18(2): 59, doi: 3390/s180200593. Tyagi, V Singh, Decorrelation of Temperature and Humidity Sensor's by Comparing Classifier's Performance on Metal Oxide Semiconductor Sensor's Dataset,2018 International Conference on Bioinformatics and Systems Biology(BSB), doi: 10.1109/BSB.2018.8770589Figure 1