Skip to main content

07.05.2024 | Research Article-Computer Engineering and Computer Science

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

verfasst von: Amin Rostami, Bahram Tarvirdizadeh, Khalil Alipour, Mohammad Ghamari

Erschienen in: Arabian Journal for Science and Engineering

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

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.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Literatur
4.
Zurück zum Zitat Derevenco, P.; Popescu, G.; Deliu, N.: Stress assessment by means of questionnaires. Rom J Physiol Physiol Sci 37(1–4), 39–49 (2000) Derevenco, P.; Popescu, G.; Deliu, N.: Stress assessment by means of questionnaires. Rom J Physiol Physiol Sci 37(1–4), 39–49 (2000)
7.
Zurück zum Zitat Praveena, G.; Mathana, J.M.: “Review on stress detection and management techniques using nano EEG sensors,” in 2022 IEEE International Conference on Nanoelectronics, Nanophotonics, Nanomaterials, Nanobioscience & Nanotechnology (5NANO), IEEE, Apr 1–7 (2022). doi: https://doi.org/10.1109/5NANO53044.2022.9828889. Praveena, G.; Mathana, J.M.: “Review on stress detection and management techniques using nano EEG sensors,” in 2022 IEEE International Conference on Nanoelectronics, Nanophotonics, Nanomaterials, Nanobioscience & Nanotechnology (5NANO), IEEE, Apr 1–7 (2022). doi: https://​doi.​org/​10.​1109/​5NANO53044.​2022.​9828889.
12.
Zurück zum Zitat Hasanpoor, Y.; Motaman, K.; Tarvirdizadeh, B.; Alipour, K.; Ghamari, M.: “Stress detection using ppg signal and combined deep CNN-MLP network,” in 2022 29th National and 7th International Iranian Conference on Biomedical Engineering, ICBME 2022, Institute of Electrical and Electronics Engineers Inc., 223–228 (2022). https://doi.org/10.1109/ICBME57741.2022.10052957. Hasanpoor, Y.; Motaman, K.; Tarvirdizadeh, B.; Alipour, K.; Ghamari, M.: “Stress detection using ppg signal and combined deep CNN-MLP network,” in 2022 29th National and 7th International Iranian Conference on Biomedical Engineering, ICBME 2022, Institute of Electrical and Electronics Engineers Inc., 223–228 (2022). https://​doi.​org/​10.​1109/​ICBME57741.​2022.​10052957.
16.
Zurück zum Zitat Awasthi, K.; Nanda, P.; Suma, K.V.: “Performance analysis of machine learning techniques for classification of stress levels using PPG signals,” in 2020 IEEE International Conference on Electronics, Computing and Communication Technologies (CONECCT), IEEE, Jul. 1–6 (2020). https://doi.org/10.1109/CONECCT50063.2020.9198481. Awasthi, K.; Nanda, P.; Suma, K.V.: “Performance analysis of machine learning techniques for classification of stress levels using PPG signals,” in 2020 IEEE International Conference on Electronics, Computing and Communication Technologies (CONECCT), IEEE, Jul. 1–6 (2020). https://​doi.​org/​10.​1109/​CONECCT50063.​2020.​9198481.
20.
Zurück zum Zitat Castaldo, R.; Xu, W.; Melillo, P.; Pecchia, L.; Santamaria, L.; James, C.: “Detection of mental stress due to oral academic examination via ultra-short-term HRV analysis,” in 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), IEEE, Aug, 3805–3808 (2016). https://doi.org/10.1109/EMBC.2016.7591557. Castaldo, R.; Xu, W.; Melillo, P.; Pecchia, L.; Santamaria, L.; James, C.: “Detection of mental stress due to oral academic examination via ultra-short-term HRV analysis,” in 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), IEEE, Aug, 3805–3808 (2016). https://​doi.​org/​10.​1109/​EMBC.​2016.​7591557.
22.
24.
Zurück zum Zitat Zagajewski, B.; Kluczek, M.; Raczko, E.; Njegovec, A.; Dabija, A.; Kycko, M.: Comparison of random forest, support vector machines, and neural networks for post-disaster forest species mapping of the Krkonoše/Karkonosze transboundary biosphere reserve. Remote Sens. 13(13), 2581 (2021). https://doi.org/10.3390/rs13132581CrossRef Zagajewski, B.; Kluczek, M.; Raczko, E.; Njegovec, A.; Dabija, A.; Kycko, M.: Comparison of random forest, support vector machines, and neural networks for post-disaster forest species mapping of the Krkonoše/Karkonosze transboundary biosphere reserve. Remote Sens. 13(13), 2581 (2021). https://​doi.​org/​10.​3390/​rs13132581CrossRef
27.
Zurück zum Zitat Han, H.; Byun, K; Kang, H.G.: “A deep learning-based stress detection algorithm with speech signal,” in Proceedings of the 2018 Workshop on Audio-Visual Scene Understanding for Immersive Multimedia, New York, NY, USA: ACM, Oct, 11–15 (2018). https://doi.org/10.1145/3264869.3264875. Han, H.; Byun, K; Kang, H.G.: “A deep learning-based stress detection algorithm with speech signal,” in Proceedings of the 2018 Workshop on Audio-Visual Scene Understanding for Immersive Multimedia, New York, NY, USA: ACM, Oct, 11–15 (2018). https://​doi.​org/​10.​1145/​3264869.​3264875.
29.
Zurück zum Zitat Schmidt, P.; Reiss, A.; Duerichen, R.; Marberger, C.; Van Laerhoven, K.: “Introducing WESAD, a multimodal dataset for wearable stress and affect detection,” in Proceedings of the 20th ACM International Conference on Multimodal Interaction, New York, NY, USA: ACM, Oct. 400–408 (2018). https://doi.org/10.1145/3242969.3242985. Schmidt, P.; Reiss, A.; Duerichen, R.; Marberger, C.; Van Laerhoven, K.: “Introducing WESAD, a multimodal dataset for wearable stress and affect detection,” in Proceedings of the 20th ACM International Conference on Multimodal Interaction, New York, NY, USA: ACM, Oct. 400–408 (2018). https://​doi.​org/​10.​1145/​3242969.​3242985.
41.
Zurück zum Zitat Ingolfsson, T.M.; Wang, X.; Hersche, M; Burrello, A.; Cavigelli, L.; Benini, L.: “ECG-TCN: wearable cardiac arrhythmia detection with a temporal convolutional network,” in 2021 IEEE 3rd International Conference on Artificial Intelligence Circuits and Systems (AICAS), IEEE, Jun 1–4 (2021). https://doi.org/10.1109/AICAS51828.2021.9458520. Ingolfsson, T.M.; Wang, X.; Hersche, M; Burrello, A.; Cavigelli, L.; Benini, L.: “ECG-TCN: wearable cardiac arrhythmia detection with a temporal convolutional network,” in 2021 IEEE 3rd International Conference on Artificial Intelligence Circuits and Systems (AICAS), IEEE, Jun 1–4 (2021). https://​doi.​org/​10.​1109/​AICAS51828.​2021.​9458520.
44.
Zurück zum Zitat Zanetti, R.; Aminifar, A.; Atienza, D.: “Robust epileptic seizure detection on wearable systems with reduced false-alarm rate,” in 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), IEEE, Jul 4248–4251 (2020). https://doi.org/10.1109/EMBC44109.2020.9175339. Zanetti, R.; Aminifar, A.; Atienza, D.: “Robust epileptic seizure detection on wearable systems with reduced false-alarm rate,” in 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), IEEE, Jul 4248–4251 (2020). https://​doi.​org/​10.​1109/​EMBC44109.​2020.​9175339.
46.
54.
Zurück zum Zitat Gao, H.; Wu, X.; Shi, C.; Gao, Q.; Geng, J.: “A LSTM-based realtime signal quality assessment for photoplethysmogram and remote photoplethysmogram,” in 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), IEEE, Jun 3826–3835 (2021). https://doi.org/10.1109/CVPRW53098.2021.00424. Gao, H.; Wu, X.; Shi, C.; Gao, Q.; Geng, J.: “A LSTM-based realtime signal quality assessment for photoplethysmogram and remote photoplethysmogram,” in 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), IEEE, Jun 3826–3835 (2021). https://​doi.​org/​10.​1109/​CVPRW53098.​2021.​00424.
65.
Zurück zum Zitat van den Dool, W.; Blankevoort, T.; Welling, M.; Asano, Y.: “Efficient Neural PDE-Solvers Using Quantization Aware Training,” in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops, Oct. 1423–1432 (2023). van den Dool, W.; Blankevoort, T.; Welling, M.; Asano, Y.: “Efficient Neural PDE-Solvers Using Quantization Aware Training,” in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops, Oct. 1423–1432 (2023).
Metadaten
Titel
Real-Time Stress Detection from Raw Noisy PPG Signals Using LSTM Model Leveraging TinyML
verfasst von
Amin Rostami
Bahram Tarvirdizadeh
Khalil Alipour
Mohammad Ghamari
Publikationsdatum
07.05.2024
Verlag
Springer Berlin Heidelberg
Erschienen in
Arabian Journal for Science and Engineering
Print ISSN: 2193-567X
Elektronische ISSN: 2191-4281
DOI
https://doi.org/10.1007/s13369-024-09095-2

    Marktübersichten

    Die im Laufe eines Jahres in der „adhäsion“ veröffentlichten Marktübersichten helfen Anwendern verschiedenster Branchen, sich einen gezielten Überblick über Lieferantenangebote zu verschaffen.