Научная статья на тему 'PERSONALIZED FEATURES-BASED STRESS DETECTION WITH HYPERPARAMETER TUNING USING GENETIC ALGORITHM'

PERSONALIZED FEATURES-BASED STRESS DETECTION WITH HYPERPARAMETER TUNING USING GENETIC ALGORITHM Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
27
11
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
Genetic Algorithm / HRV / Hyperparameters / LSTM / Personalised Features / Stress Detection

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Jigna Jadav, Uttam Chauhan

In recent years, there have been considerable improvements in how we keep track of mental health, especially with devices you can wear, which give us a better chance of spotting and dealing with problems like stress before they become serious. This research paper presents an innovative approach. Experimental validation uses a comprehensive dataset of 15 subjects working as multinational company employees. Heart Rate Variability(HRV) was obtained from wearable sensors using Apple Watch during working hours. We have calculated time, frequency and non-linear domains as well and added personalized features like a person's age, height, weight, etc. Recurrent Neural Network( RNN )and Long Short-Term Memory ( LSTM )models are applied and get an accuracy of 87% and 90%, respectively. To enhance stress detection accuracy by optimizing hyperparameters using a genetic algorithm (GA) explicitly targeting the configuration of LSTM models. Key hyperparameters, including the number of units in the LSTM layer and the number of training epochs, are optimized to maximize stress detection accuracy. Model Through 5 generations of evolution, the GA identifies optimal hyperparameter settings of 45 units in the LSTM layer 49 epochs, significantly improving stress detection accuracy compared to baseline configurations. It gives 92 % accuracy with optimized hyperparameters. Analyzing recorded data, we observe that the time per training step decreases gradually, indicating efficient convergence during optimization. Simultaneously, stress detection accuracy steadily improves over epochs, showcasing the model's effectiveness in learning patterns from physiological data. So, This study provides insights into the practical application of genetic algorithms for hyperparameter optimization in healthcare contexts, contributing to advancements in personalized monitoring and intervention strategies for mental well-being.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «PERSONALIZED FEATURES-BASED STRESS DETECTION WITH HYPERPARAMETER TUNING USING GENETIC ALGORITHM»

PERSONALIZED FEATURES-BASED STRESS DETECTION WITH HYPERPARAMETER TUNING USING GENETIC

ALGORITHM

Jigna Jadav1, Uttam Chauhan2

1 Research Scholar, Computer Engineering, Gujarat Technological University, Ahmedabad, India.

jigna.j.jadav@gmail.com

2 Assistant Professor, Computer Engineering department, Vishwakarma Government Engineering

College Chandkheda, Ahmedabad, India. ug_chauhan@gtu.edu.in

Abstract

In recent years, there have been considerable improvements in how we keep track of mental health, especially with devices you can wear, which give us a better chance of spotting and dealing with problems like stress before they become serious. This research paper presents an innovative approach. Experimental validation uses a comprehensive dataset of 15 subjects working as multinational company employees. Heart Rate Variability(HRV) was obtained from wearable sensors using Apple Watch during working hours. We have calculated time, frequency and non-linear domains as well and added personalized features like a person's age, height, weight, etc. Recurrent Neural Network( RNN )and Long Short-Term Memory ( LSTM )models are applied and get an accuracy of 87% and 90%, respectively. To enhance stress detection accuracy by optimizing hyperparameters using a genetic algorithm (GA) explicitly targeting the configuration of LSTM models. Key hyperparameters, including the number of units in the LSTM layer and the number of training epochs, are optimized to maximize stress detection accuracy. Model Through 5 generations of evolution, the GA identifies optimal hyperparameter settings of 45 units in the LSTM layer 49 epochs, significantly improving stress detection accuracy compared to baseline configurations. It gives 92 % accuracy with optimized hyperparameters. Analyzing recorded data, we observe that the time per training step decreases gradually, indicating efficient convergence during optimization. Simultaneously, stress detection accuracy steadily improves over epochs, showcasing the model's effectiveness in learning patterns from physiological data. So, This study provides insights into the practical application of genetic algorithms for hyperparameter optimization in healthcare contexts, contributing to advancements in personalized monitoring and intervention strategies for mental well-being.

Keywords: Genetic Algorithm, HRV, Hyperparameters, LSTM, Personalised Features, Stress Detection

I. Introduction

Stress is the feeling of being unable to handle a lot of mental or emotional pressure. Some things that cause stress are worrying about your career, meeting tight deadlines, feeling pressure from your peers, making bad choices, job demands, work pressure, health worries, etc. Acute stress is the most common type of stress. All the challenges usually cause it and demand everyone to deal with it constantly. Some clear signs are excessive sweating, headaches, trouble focusing, changes in hunger, a weakened immune system, difficulty sleeping, etc. Stress can have effects that last for a long time. Long-term worry can lead to health problems like high blood pressure, heart disease, and memory loss. Many trackers like the Empatica E4, the Apple Watch, the FitBit, and others are on the market. The suggested way to find stress for working employees is to create a wristband that predicts stress based on constant, real-time data from physiological sensors. The role of stress management systems in identifying the levels of tension that disrupt our socioeconomic lifestyle is crucial. According to the World Health Organization (WHO), one in every four

citizens is afflicted with stress, which is a mental health issue [1]. Human stress gives rise to psychological and sodo-finandal complications, impaired task performance, and unclear thinking. Relationship difficulties, melancholy, and, in extreme cases, suicide. This requires counselling to assist overwhelmed individuals in managing their stress. Although stress avoidance is unattainable, taking preventative measures can help to surmount it [2]. At this time, distressing states of depression (such as tension) can only be identified by medical and physiological specialists. One of the conventional approaches to stress detection involves using questionnaires [3]. This method depends entirely on the responses provided by the participants; individuals may exhibit trepidation when asked whether they are experiencing tension or feeling it every day. Automated stress detection reduces the likelihood of health complications and enhances societal welfare. This creates the conditions for developing a scientific instrument that automates the detection of stress levels in individuals via physiological signals. Stress is also known as the flight-or-fight response, as it evolves as a survival mechanism, enabling people to react speedily to life-threatening or challenging situations. When met with a threat or challenge, an individual's body activates resources for self-protection. These resources either help face the situation or provide an expedited escape route. This flight-or-fight response is the reaction of the body's sympathetic nervous system that reacts to a stressor by producing larger quantities of chemicals like cortisol, adrenaline, and noradrenaline[4]. When you feel scared or threatened, your body enters an emergency mode. Your heart beats faster, your muscles tense up, your breathing gets faster, and your senses become sharper. This helps you react quickly in dangerous situations. It gives you more strength, energy, and focus to decide whether to fight or run away faster. It's like your body's way of helping you stay safe when you're in trouble.

The structure of this document is as follows. Section II provides an overview of the field's current state of the art. Section III provides an account of the research conducted in this study. Section IV presents the findings from the analysis of the Apple Watch dataset. The conclusions can be found in section V.

II. Related Work

Smartwatches have emerged as tools for stress detection and management [5] by measuring heart rate, heart rate variability (HRV), sleep quality, physical activity, and other stress-related variables. Real-time stress monitoring may provide immediate biofeedback to individuals and allow for early self-intervention [6]. How pervasive are smartwatches with stress detection among undergraduates? How effective are they as an unobtrusive way of providing biofeedback to students about their stress levels to lower their anxiety and increase their stress-management skills to be more effective in their Learning.

This exploratory pilot study examined the effect of smartwatches equipped with HRV sensors for stress detection on undergraduate students' anxiety. The study's research question was the following: Are smartwatches with stress detection sensors effective for supporting students in reducing their anxiety? A quasi-experimental pre-test post-test control group design was used. Thirteen students of an experimental group, who were self-selected, used the same commercially available smartwatch over 3-4 weeks and had access to their measured stress on a 24/7 basis. Nineteen students of a control group did not have access to smartwatches and used other means of stress management over the same period. Students' anxiety before and after the experiment was measured using a standardized instrument (GAD-7), which is based on participants' recollections of the frequency of experiencing specific anxiety symptoms over the last two weeks. GAD-7 scores range from 0 (no anxiety) to 21 (severe anxiety). The experimental group (M=6.00/21, SD=6.58) and the control group (M=8.18/21, SD=5.67) had "mild" anxiety levels before the study, based on GAD-7. An independent samples t-test compared students' anxiety before the experiment and established that the two groups were equivalent (t27=-0.97, p=0.341). A slight, non-significant decrease in anxiety was observed in the experimental group from the pre-test (M= 6.00, SD= 6.57) to the post-test (M=5.67 SD= 3.26). On the contrary, the control group's anxiety increased from the pre-test (M= 7.84, SD= 5.43) to the post-test (M= 10.11, SD= 5.24), indicating a "moderate" level of anxiety post-intervention. An independent samples t-test (t27=-2.5, p=0.019) for a comparison of students' post-test anxiety scores showed that the experimental

group had significantly lower anxiety (M=5.67, SD=3.26) compared to the control group (M=10.06, SD=5.41)[8].

Authors[9] propose a novel approach for predicting stress severity by measuring sleep phasic heart rate variability (HRV) using a smart device. This device can potentially be applied for stress self-screening in large populations. Using a Holter electrocardiogram (ECG) and a Huawei smart device, we conducted 24-h dual recordings of 159 medical workers working regular shifts. Based on photoplethysmography (PPG) and accelerometer signals acquired by the Huawei smart device, we sorted episodes of cyclic alternating pattern (CAP; unstable sleep), non-cyclic alternating pattern (NCAP; stable sleep), wakefulness, and rapid eye movement (REM) sleep based on cardiopulmonary coupling (CPC) algorithms. We further calculated the HRV indices during NCAP, CAP and REM sleep episodes using the Holter ECG and smart-device PPG signals. This exploratory pilot[10] study showed that smartwatches with stress detection sensors are somewhat effective in helping students reduce their anxiety. Without any structured intervention for stress management, students' anxiety may increase over time. The sample size and duration of the study were too small to allow for the generalizability of findings. More research is needed on how smartwatches that detect stress can be used either in conjunction with stress management interventions, such as mobile apps for supporting resilience, to maximize their effectiveness, or as additional ways of measuring stress, complimenting self-reported data in interventions that target stress management, to optimize Learning. The author developed a machine learning model to predict stress severity based only on the smart device data obtained from the participants and a clinical evaluation of emotion and stress conditions. Sleep phasic HRV indices predict individual stress severity with better CAP or REM sleep performance than in NCAP. Using the smart device data only, the optimal machine learning-based stress prediction model exhibited an accuracy of 80.3 %, sensitivity of 87.2 %, and 63.9 % for specificity. Sleep phasic heart rate variability can be accurately evaluated using a smart device and subsequently used for stress prediction. Driving in urban areas can be challenging, and one can encounter acute stress. Collecting data on real roads without interfering with the driver is preferred to detect driver stress. A smartphone-based data collection protocol was developed to support a naturalistic driving study. Sixty-one participants drove on predetermined actual road routes, and driving information and physiological, psychological, and facial data were collected. The algorithm identified potentially stressful events based on the collected data. Participants classified these events as low, medium, or highly stressful by watching recorded videos after the experiment. These events were then used to train prediction models. The best model achieved an accuracy of 92.5% in classifying low/medium/highly stressful events. The contribution of physiological, psychological, and facial expression indices and individual profile information was evaluated. The method can be applied to visualize the geographical distribution of stressors, monitor driver behaviour, and help drivers regulate their driving habits [11].

III. Proposed Approach

We have prepared a data set using an optical heart sensor in the Apple Watch SE, which measures your heart rate and heart rhythm. Utilize the Breath application to calculate your stress with maximum precision. The Apple Watch has numerous capabilities that can be used to track stress levels. For instance, it features a heart rate monitor that can detect variations in the wearer's heart rate and heart rate variability, which can signal stress levels. A breathing app for the Watch also leads users through breathing exercises to lower stress. The gadget also monitors sleep patterns, physical activity levels, and other health indicators that may assist in pinpointing stress origins and offer insights into general well-being. It's crucial to remember that these features shouldn't be used to diagnose or treat any medical conditions and aren't intended to replace expert medical advice.

The study involved 15 employees from a multinational company working as developers, who were observed over ten working days. Raw data was collected using Apple Watch SE devices worn on the participants' non-dominant wrists. Participants performed a specific gesture (double tapping) with their non-dominant hand to ensure accurate data collection, generating a characteristic pattern in the

acceleration signal for data synchronization. The Apple Watch SE offers various health monitoring features suitable for the study to analyze Heart Rate under three distinct mental health conditions:

• Stress condition: During company meetings or instances of sudden extra work.

• Daily work condition: Routine work activities during regular working hours.

• No stress condition: Periods of relaxation or when no work-related tasks were being performed.

By examining Heart Rates across these conditions, the study aimed to understand how stress impacts physiological responses during work, contributing to a deeper understanding of employee well-being in multinational workplace settings.

It mainly focuses on how stress impacts employees' physiological responses during work hours, contributing to understanding employee well-being in workplace environments.

The raw data collected for Heart Rate Bit per minute, initially in XML format, was converted into CSV format for analysis. Gathering data in real-life contexts remains uncommon due to challenges such as limited context and reliance on self-reported information. Real-world data collection possesses both advantages and challenges. While it maintains ethical constraints and context awareness, it lacks a clear ground truth and introduces noisy data. Investigated HRV in real-world scenarios and highlighted its small relationship with stress compared to controlled lab settings[12]. The heart rate is extracted using The Apple Watch and the Health application on your paired iPhone. It can accurately measure your heart rate.

3.1. Feature selection

Core functionality involves iterating through XML files from an Apple Health export, identifying and extracting heart rate data within a specified date range. Each 'Record' element is examined to isolate valid heart rate measurements by cross-referencing their timestamps. From these values, RR intervals—the temporal gaps between consecutive heartbeats—are calculated. These intervals serve as the foundation for HRV analysis, which includes addressing missing values and performing both frequency and time domain analyses using an HRV analysis library. The process uses the xml.etree.ElementTree module for XML parsing, and incorporates the Malik rule[13] via the hrvanalysis.remove_ectopic_beats function to clean the RR interval data of ectopic beats.

Time domain features quantify RR interval variability, revealing insights into heart rate fluctuations over specific time spans. The Mean NN Interval (Mean NNI) portrays the average duration between successive normal heartbeats [14]. The Standard Deviation of NN Intervals (SDNN) characterizes overall RR interval variability, indicative of autonomic modulation. The Root Mean Square of Successive Differences (RMSSD) reflects short-term variability with parasympathetic sensitivity [15]. The Percentage of NN50 Intervals (pNN50) gauges parasympathetic influence by identifying RR intervals differing by over 50 ms. Frequency domain analysis dissects HRV into frequency bands. Low Frequency (LF) power signifies both sympathetic and parasympathetic activity, whereas High Frequency (HF) power primarily denotes parasympathetic modulation [16]. The LF/HF ratio quantifies sympathetic-parasympathetic balance [17]. The non-linear analysis captures intricate patterns. Sample Entropy (SampEn) gauges HRV complexity based on pattern repetition. Poincaré plots visually explore RR interval relationships, providing insights into autonomic dynamics [18].

Additional PhysioBank, PhysioToolkit, and PhysioNet furnish resources for physiological signal access and analysis. Advanced HRV analysis methods are exhaustively covered, offering insights into diverse techniques [19].

So, Time-frequency, Frequency Domain and Non-linear domain features are calculated to understand physiological responses to stress. These features can provide additional insights into the dynamics and patterns of the stress response, enabling more accurate and personalized stress detection algorithms and systems. We divided all experimental data into 60-second windows and independently calculated each

window's accuracy. We selected eight features because they are the most relevant Features. Twenty-two features have been extracted from 149,000 records collected from 15 subjects. These features encompass various aspects of heart rate variability (HRV).

IV. Experimental Results and Discussion

We Have used the architecture of the LSTM model [20] using the Keras API provided by TensorFlow[21]. The model consists of an LSTM layer with 128 units, a fully connected (Dense) layer with three output units (matching the number of classes) and a softmax activation function. The model is compiled with the Adam optimizer and categorical cross-entropy loss function, which is suitable for multiclass classification. The experimental result is presented in Figure 1, where we compare our proposed LSTM model with existing approaches in stress detection studies. In our experimental setup, we achieved an overall accuracy of 88% by applying the LSTM model, considering the time-series property inherent in the data. Notably, neither of the previously referenced authors leveraged the time-series property to obtain their results.

Figure 1: Epochwise Accuracy Plot

4.1. Personalized Features

As different users have relatively different responses to stress conditions, examining the individuals' heart rate variability ranges, the dataset and machine learning model should be designed carefully. We have added personalized features as defined in Figure 2, like a person's gender, age, country, height, body mass, resting heart rate, VO2MaxmL/minA-kg measures the maximum amount of oxygen a person can use during intense exercise, relative to body weight. It's expressed in millilitres per minute per kilogram and

Figure 2: Personalized Features

It is a key indicator of cardiovascular fitness and aerobic endurance. Walking Heart Rate Average refers to the average heart rate observed during walking activities. It helps assess cardiovascular health at a

moderate intensity, with lower averages suggesting better fitness and heart efficiency. So, eight personalized features and other 22-time domain, frequency domain and non-linear features are added.

Figure 3: Features According to PCA

Figure 3 indicates the most influential features by examining the Aggregate values associated with each principal component. These ratios indicate the proportion of total variance in each component's dataset. A heatmap of the correlation matrix is created to visualize the relationships and dependencies between these features.

This heatmap illustrates in figure 4 the strength and direction of linear relationships between each pair of features. Correlation values range from -1 to 1, where 1 indicates a perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no linear correlation. By examining the heatmap, we can identify which features are strongly correlated, either positively or negatively, which can provide insights into potential redundancies or synergies among the features. Personalized features are tailored to individual characteristics or behaviours, while time domain features typically involve statistical measures like mean, variance, and standard deviation calculated over time-series data. Frequency domain features

involve transformations like Fourier transforms to analyze the frequency components of the data. Nonlinear features capture more complex, non-linear relationships in the data that are not apparent through linear analysis alone.

Figure 4: Heatmap of Correlation of Features

The indices of the most impactful features are identified by sorting these ratios in descending order. The actual feature names are then extracted from the original dataset columns.

The Long Short-Term Memory (LSTM) network, a type of recurrent neural network (RNN), was introduced by [22] in 1997 to address real-world time-series problems. LSTM networks have been shown to effectively learn long-term dependencies and overcome issues such as vanishing and exploding gradients [23]. The analysis involving LSTM (Long Short-Term Memory) and RNN (Recurrent Neural Network) models on a dataset of heart rate variability (HRV) data from an Apple Watch effectively preprocesses, trains, and evaluates both models. After preprocessing steps that include label encoding,

one-hot encoding, and standardizing the data, the models are reshaped for LSTM and RNN inputs. Two distinct neural network architectures are employed: an LSTM model and an RNN model, each designed with a recurrent layer comprising 128 units followed by a dense output layer with softmax activation to handle multiclass classification. Both models are compiled using the Adam optimizer and categorical cross-entropy loss, emphasizing their suitability for sequence data processing. The models are trained using a StratifiedShuffleSplit approach, ensuring balanced class distribution in both training and testing datasets. This setup allows for robust training over 32 epochs with a batch size of 32. Upon evaluation, the LSTM model demonstrates a superior performance with an accuracy of 90%, compared to the RNN model, which achieves 87% accuracy. Figure 5 presents the training and validation accuracy of LSTM and RNN models over a series of epochs. The plot is designed to illustrate how well each model learns from the training data and generalizes it to the validation data.

LSTM Model Training and Validation Accuracy Over Epochs RNN Model Training and Validation Accuracy Over Epochs

Epoch Epoch

Figure 5: LSTM & RNN Training and Validation Accuracy

Visual analysis through various plots—accuracy and loss graphs over epochs and confusion matrices — provides deeper insights into each model's performance. The accuracy plots confirm the LSTM's slightly better capability than RNN in capturing and leveraging long-term dependencies, which is crucial for the temporal dynamics inherent in HRV data from wearable devices, as shown in figure 6. These detailed evaluations and visual representations are critical for understanding the model. Dynamics, guiding further improvements in model architecture or training strategies for enhanced performance in medical data analysis tasks.

Co m pari bo n of LSTM and RM M Models

Mod el

Figure 6: Comparison of LSTM & RNN

4.2. Genetic Algorithm

The genetic algorithm (GA) operates on the principle of evolution, where individuals with superior traits have a higher chance of survival and pass on their characteristics to the next generation. Each individual in the population represents a set of hyperparameters, with its genetic makeup determining the specific values of these parameters. The algorithm seeks to optimize these hyperparameters for a given problem through selection, crossover, and mutation. GA continually refines the population through these mechanisms, gradually converging towards optimal hyperparameter values. By iteratively selecting, recombining, and mutating individuals, the algorithm explores the hyperparameter space to discover configurations that maximize performance. Recent studies have shown the effectiveness of GA for optimizing LSTM hyperparameters in various applications, such as COVID-19 dataset classification [24]. In GA-based hyperparameter optimization, each hyperparameter is analogous to a gene within an individual's chromosome. The population encompasses a range of potential parameter values, and the fitness function evaluates how well a set of parameters performs. By selecting individuals with high fitness values, the algorithm ensures that favourable traits are carried over to subsequent generations for sepsis prediction [25]. Researchers [26] introduce a straightforward genetic algorithm method for hyperparameter tuning in a standard language model. This approach efficiently optimizes the parameters without relying on exhaustive search techniques.GA continually refines the population through these mechanisms, gradually converging towards optimal hyperparameter values. By iteratively selecting, recombining, and mutating individuals, the algorithm explores the hyperparameter space to discover configurations that maximize performance and also provides a robust mechanism for handling the complex hyperparameter space.

an

GA-based hyperparameter optimization, each hyperparameter is analogous to a gene within individual's chromosome. The population encompasses a range of potential parameter values, and the fitness function evaluates how well a set of parameters performs. By selecting individuals with high fitness values, the algorithm ensures that favourable traits are carried over to subsequent generations. Crossover involves combining genetic material from two individuals to create offspring with a mix of their traits, while mutation introduces random changes to individual genes, promoting diversity in the population.GA continually refines the population through these mechanisms, gradually converging towards optimal hyperparameter values. By iteratively selecting, recombining, and mutating individuals, the algorithm explores the hyperparameter space to discover configurations that maximize performance.

Figure 7: Flow of Hyperparameter tunning With GA

Figure 7 shows a flowchart of a process involving a genetic algorithm to optimize hyperparameters in a sequence model that is LSTM. The data that is relevant to the model should be collected or aggregated. After that, feature selection, which means feature selection, should be done from the data that will be input into the LSTM model learning. A genetic algorithm is applied to learn the optimal hyperparameters. From the genetic algorithm, an evaluating function judges the fitness of each approach in its ability to solve a problem; each individual, usually referred to with a hyperparameter set, is referred to as an individual. The result of the evaluating functions is used to adjust the hyperparameters using GA. The GA optimizes the hyperparameters to maximize the fitness function, which is done iteratively and without reinvention by simulating the process of natural selection. The Individual over the Generation: It says the best individual is used to highlight the best hyperparameter set found over all the generations. With the results of the best hyperparameters, the LSTM model is finalized and evaluated, and this has been done on a test dataset to check accuracy. So, this flowchart describes the whole process, from preparing the data to hyperparameter tuning, and then outputs are produced. The interesting aspect is the close relationship between the output and the final model to be evaluated.

Tine per Training Step Accuracy over Epochs

-1-1-1-1-1-1-1-r1 -1-1-1-1-1-r—

0 5 10 15 20 25 30 35 0 10 20 30 40 50

"Faining Step Epoch

Figure 8. Hyperparameter Tunning setting

Figure 8 shows hyperparameter tunning in that the left plot shows each training step's time (in seconds). The times appear to vary significantly, ranging from as low as 1 second to as high as 14 seconds per step. There is no clear trend in the data, indicating that the variation in step times may be due to different computational demands at each step or other varying factors during the training process. The right plot shows the accuracy of the model over several epochs, plotted in orange. The accuracy starts at around 60% and steadily increases, reaching above 90% in later epochs. The plot shows a typical learning curve where the model initially improves rapidly before the gains in accuracy begin to diminish, suggesting that the model is approaching its performance limit. So, after setting the hyperparameter at epoch 49, we get 92 % accuracy.

V. Conclusion and Future Work

By employing HRV data from Apple Watches worn by employees during work, the study bridges the gap between controlled laboratory conditions and the variability in everyday environments. This approach enhances the model's applicability in real-life scenarios, providing insights into its practical deployment. The study's focus on feature selection and incorporating personalized features such as age, gender, and physical metrics further tailors stress detection to individual profiles, potentially increasing the model's sensitivity and accuracy in diverse populations. We presented an innovative approach to enhancing stress detection accuracy using wearable devices, focusing on optimizing LSTM models with GA. By employing a comprehensive dataset from 15 multinational company employees, we gathered HRV data through Apple Watches during working hours and calculated time, frequency, and non-linear domain features, supplemented by personalized characteristics such as age, height, and weight. The application of RNN and LSTM models yielded accuracy rates of 87% and 90%, respectively. Through GA optimization, we targeted key hyperparameters, including the number of units in the LSTM layer and the number of training epochs. The GA identified optimal settings of 45 units in the LSTM layer and 49 epochs, achieving a significant improvement in stress detection accuracy, reaching 92%. Our analysis indicated that the training time per step decreased, suggesting efficient convergence, while stress detection accuracy improved steadily over epochs, demonstrating the model's effectiveness in learning from physiological data. These findings underscore the potential of genetic algorithms in optimizing hyperparameters for LSTM models, contributing to advancements in personalized mental health monitoring and intervention strategies.As Future work remedies can be suggested, and a wider population can be used for real-life experiments. Incorporating additional physiological and environmental data sources, such as skin conductance, body temperature, and ambient noise levels, could improve the robustness and accuracy of stress detection.

References

[1]Communications, N. World health report. 2001. URL: http://www.who.int/whr/2001/media_centre/press_release/en/

[2]Bakker, J., Holenderski, L., Kocielnik, R., Pechenizkiy, M., Sidorova, N.. Stess@ work: From measuring stress to its understanding, prediction and handling with personalized coaching. In: Proceedings of the 2nd ACM SIGHIT International Health Informatics Symposium. ACM; 2012, p. 673678.

[3] Deng, Y., Wu, Z., Chu, C.H., Zhang, Q., Hsu, D.F.. Sensor feature selection and combination for stress identification using combinatorial fusion. International Journal of Advanced Robotic Systems 2013;10(8):306.

[4]S. A. Singh, P. K. Gupta, M. Rajeshwari, and T. Janumala, "Detection of stress using biosensors," Mater. Today, vol. 5, no. 10, pp 21003_21010, 2018.

[5]Jerath R, Syam M, Ahmed S. The Future of Stress Management: Integration of Smartwatches and HRV Technology. Sensors. 2023; 23(17):7314. https://doi.org/10.3390/s23177314 2nd ed., vol. 3, J. Peters, Ed. New York, NY, USA: McGraw-Hill, 1964, pp. 15-64.

[6] Chalmers T, Hickey BA, Newton P, Lin CT, Sibbritt D, McLachlan CS, Clifton-Bligh R, Morley JW, Lal S. Associations between Sleep Quality and Heart Rate Variability: Implications for a Biological Model of Stress Detection Using Wearable Technology. Int J Environ Res Public Health. 2022 May 9;19(9):5770. doi: 10.3390/ijerph19095770. PMID: 35565165; PMCID: PMC9103972.

[7] I. Nicolaidou (2024) CAN SMARTWATCHES WITH STRESS DETECTION LOWER STUDENTS' ANXIETY? AN EXPLORATORY PILOT STUDY USING WEARABLES, INTED2024 Proceedings, pp. 30803083.

[8] Spitzer RL, Kroenke K, Williams JB, Lowe B. A brief measure for assessing generalized anxiety disorder: the GAD-7. Arch Intern Med. 2006 May 22;166(10):1092-7. doi: 10.1001/archinte.166.10.1092. PMID: 16717171.

[9] Fan J, Mei J, Yang Y, Lu J, Wang Q, Yang X, Chen G, Wang R, Han Y, Sheng R, Wang W, Ding F. Sleep-phasic heart rate variability predicts stress severity: Building a machine learning-based stress prediction model. Stress Health. 2024 Feb 27:e3386. doi: 10.1002/smi.3386. Epub ahead of print. PMID: 38411360.

[10] Zhu, Lili & Spachos, P. & Ng, Pc & Yu, Yuanhao & Wang, Yang & Plataniotis, Konstantinos & Hatzinakos, Dimitrios. (2023). Stress Detection Through Wrist-Based Electrodermal Activity Monitoring and Machine Learning. IEEE Journal of Biomedical and Health Informatics. PP. 1-11. 10.1109/JBHI.2023.3239305.

[11] Healey, Jennifer A, & Picard, R. W. (2008). Stress Recognition in Automobile Drivers [Data set]. physionet.org. https://doi.org/10.13026/C2SG6B.

[12] I. Nouira, A. Ben Abdallah, and M. H. Bedoui, "A Robust R Peak Detection Algorithm Using Wavelet Transform for Heart Rate Variability Studies," Int. J. Electr. Eng. Informatics, vol. 5, no. 3, pp. 270284, Sep. 2013, doi: 10.15676/ijeei.2013.5.3.3.

[13]Malik, M., et al. (1996). Heart rate variability: standards of measurement, physiological interpretation, and clinical use. Circulation, 93(5), 1043-1065.

[14]]Thayer, J. F., & Brosschot, J. F. (2005). Psychosomatics and psychopathology: looking up and down from the brain. Psychoneuroendocrinology, 30(10), 1050-1058.

[15]Mietus, J. E., et al. (2002). The pNNx files: re-examining a widely used heart rate variability measure. Heart, 88(4), 378-380.

[16]Pomeranz, B., et al. (1985). Assessment of autonomic function in humans by heart rate spectral analysis. American Journal of Physiology-Heart and Circulatory Physiology, 248(1), H151-H153.

[17] Tarvainen, M. P., et al. (2010). Advanced methods for heart rate variability analysis. In The Handbook of Behavioral Medicine (pp. 161-181). Springer .

[18]Brennan, M., et al. (2001). Do existing measures of Poincare plot geometry reflect non-linear features of heart rate variability? IEEE Transactions on Biomedical Engineering, 48(11), 1342-1347.

[19]Goldberger, A. L., et al. (2000). PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation, 101(23), e215-e220.

[20] Fandango A. Mastering TensorFlow 1. x: Advanced machine learning and deep learning concepts using TensorFlow 1. x and Keras. Packt Publishing Ltd; 2018 Jan 22.

[21] Gulli A, Kapoor A, Pal S. Deep learning with TensorFlow 2 and Keras: regression, ConvNets, GANs, RNNs, NLP, and more with TensorFlow 2 and the Keras API. Packt Publishing Ltd; 2019 Dec 27.

[22] Hochreiter, S., & Schmidhuber, J. (1997). Long Short-Term Memory. Neural Computation, 9(8), 1735-1780. https://doi.org/10.1162/neco.1997.9.8.1735.

[23] Andersen, R. S., Peimankar, A., & Puthusserypady, S. (2019). A deep learning approach for realtime detection of atrial fibrillation. Expert Systems with Applications, 115, 465-473. https://doi.org/10.1016/j.eswa.2018.08.011

[24] M. Parvizimosaed, M. Esnaashari, A. Damia and M. T. Paband, "Hyper-parameter Optimization of LSTM Network Using Genetic Algorithm and Q-Learning Algorithm for Classification of COVID-19 Dataset," 2023 9th International Conference on Web Research (ICWR), Tehran, Iran, Islamic Republic of, 2023, pp. 167-172, doi: 10.1109/ICWR57742.2023.10139161.

[25] Nejedly P, Plesinger F, Viscor I, Halamek J, Jurak P. Prediction of sepsis using LSTM neural network with hyperparameter optimization with a genetic algorithm. In2019 Computing in Cardiology (CinC) 2019 Sep 8 (pp. Page-1). IEEE.

[26] Gorgolis N, Hatzilygeroudis I, Istenes Z, Gyenne LG. Hyperparameter optimization of LSTM network models through genetic algorithm. In2019 10th International Conference on Information, Intelligence, Systems and Applications (IISA) 2019 Jul 15 (pp. 1-4). IEEE.

i Надоели баннеры? Вы всегда можете отключить рекламу.