Real-Time Stress Detection from Raw Noisy PPG Signals Using LSTM Model Leveraging TinyML

Amin Rostami,Bahram Tarvirdizadeh,Khalil Alipour,Mohammad Ghamari
DOI: https://doi.org/10.1007/s13369-024-09095-2
IF: 2.807
2024-05-08
Arabian Journal for Science and Engineering
Abstract:The negative effects of stress on well-being demonstrate the need for real-time detection. The increasing prevalence of wearables with AI capabilities to continually monitor vital signs like heart rate and blood pressure highlights their growing value in promptly identifying stress. This paper presents a new approach for real-time stress detection employing an LSTM-based deep learning model, a technique with promising outcomes for time-series data analysis. Our model is trained on raw PPG signals from the WESAD dataset covering diverse stress scenarios. By learning patterns and fluctuations over time, it can effectively distinguish stressed and non-stressed states. The training uses only the raw PPG signals, segments them into windows, and creates labeled data for supervised learning. To enable real-time detection, we explore deploying our trained model on STM32H7xx microcontrollers equipped with a Cortex-M7 core offering low-power and hardware acceleration. We implement the LSTM model leveraging their capabilities for efficient inference. This implementation process involves optimizing the model and converting it into a format compatible with the microcontrollers. Within this study, we employ key TensorFlow toolkit optimization methods, including quantization-aware training (QAT), pruning, prune-preserving quantization-aware training (PQAT), and post-training quantization (PTQ), along with the TensorFlow Lite (TFL) toolkit, to evaluate and compare the outcomes obtained from applying these methods to the baseline model. Our goal is to select the most effective approach for the processor, enabling real-time detection. Through the utilization of these techniques, our objective is to reduce the size of the model and the necessary processing resources, such as RAM size, while ensuring that a high level of accuracy is maintained. Our results show the capability of the optimized LSTM model to accurately detect stress from raw PPG data on resource-constrained, low-power STM32H7xx MCUs. The final optimized model requires only 170 Kbytes of RAM, a nearly 12 times reduction in size, while still achieving a high accuracy of 87.76% when performing inference on the microcontroller.
multidisciplinary sciences
What problem does this paper attempt to address?