Behavioral Health Monitoring: Smartphone-Based Stress Detection

Gurleen Singh, Sugam Budhraja

Objective

The primary objective was to develop a statistical model capable of assessing stress levels based on behavioural health data collected from smartphone sensors, accommodating the reality that most users do not possess wearable technology. By leveraging the widespread availability of smartphones, our approach offers a scalable approach to assess stress and its implications on health and behaviour within the general population, setting the stage for a broader understanding and potential interventions.

Methodology

The Depression Anxiety Stress Scale known as the DASS-21, is used as a clinical screening tool for the overall assessment of the three conditions. This study analysed the results from the Stress sub-score of the questionnaire from participants. All participants installed the Sahha research app which collected and analysed digital heath data from smartphone sensors and any other wearables. Participants were prompted with the DASS-21 screening questionnaire weekly which assessed their internal state. Data analysis and feature engineering was conducted to surface behavioural features that could discern between different levels of stress. These features were use for model development.

Data Collection:

  • A total of 30,534 DASS-21 surveys were collected from 820 unique participants, providing a comprehensive dataset for analysis.

  • Users were recruited through an online platform (Prolific) across the following countries: UK, USA, Ireland, Germany, France, Australia, Canada, Iceland, Israel, Japan, Korea, Netherlands, New Zealand, Singapore, Taiwan

  • Age of recruitment was between 18-65

  • Health data included physical activity (steps), sleep patterns, phone unlocks, etc., collected over a period of 6 months.

Model Development:

  • The reliable and transparent statistical method logistic regression was employed for classification between healthy and stressed individuals.

  • 5-fold cross-validation was used, with each user either only being part of training set or only part of test set, to ensure a good measure of generalisability and performance.

  • To deal with heavy class imbalance, SMOTE (Synthetic Minority Over-sampling Technique) was used to oversample the training set in each fold.

Results

Data Analysis:

In-depth analysis of the collected dataset reveals significant insights into the behavioural patterns associated with varying levels of stress.

The following figure displays the average step count by hour for participants categorised by stress levels: normal, mild, moderate, severe, and extreme. Participants with 'normal' stress levels show a higher and more consistent step count, peaking in the late afternoon. Those with 'mild' to 'moderate' stress levels have a similar pattern but take fewer steps. 'Severe' and 'extreme' stress levels are associated with lower step counts and greater variability, with an unusual spike for 'extreme' stress late in the day. This suggests that higher stress may be linked to reduced physical activity throughout the day.


undefined



The next figure compares the average daily steps across different stress levels. Individuals with 'normal' stress levels have the highest daily step count, significantly more than those with 'mild' or 'moderate' stress. The 'severe' and 'extreme' categories show a noticeable decrease in daily steps. The trend suggests a negative correlation between stress level and physical activity, with higher stress associated with fewer steps.

undefined

The next figure shows the average deviation in steps throughout the day for different stress categories. The shaded areas show the variance of each severity of stage, while the trend line represents the average deviation. The figure reveals that individuals with 'normal' stress levels generally maintain a consistent step count throughout the day with minimal deviation. Those with 'mild' to 'moderate' stress exhibit slightly more variation, while 'severe' and 'extreme' stress levels show the greatest inconsistency in daily steps. This suggests that higher stress levels might be linked to irregular physical activity patterns.

undefined

The next figure is a bar chart that compares the average number of active hours per day across different stress levels: normal, mild, moderate, severe, and extreme. The chart shows that individuals with 'normal' stress levels tend to have more active hours in a day, averaging close to 6 hours. The number of active hours decreases as stress levels rise from 'mild' to 'moderate'. Interestingly, the 'severe' category reports a slight increase in active hours compared to 'moderate', while 'extreme' stress levels result in fewer active hours, indicating a possible non-linear relationship between stress level and activity. This could suggest that while moderate levels of stress may not significantly deter daily activity, extreme stress has a more pronounced effect on reducing physical activity.

undefined


The next plot illustrates the average difference in step counts between consecutive hours throughout the day, categorised by different levels of stress: normal, mild, moderate, severe, and extreme. The data shows relatively small average differences in step counts for those with 'normal' stress, indicating consistent activity levels. As stress levels increase from 'mild' to 'extreme', there's a noticeable trend of larger variations in step counts, suggesting that higher stress levels may lead to more erratic physical activity patterns. The 'extreme' stress category, in particular, displays the widest range of change, which could reflect the most significant fluctuations in activity levels. This may imply that individuals experiencing higher stress are more likely to have inconsistent activity patterns hour-to-hour.

undefined

The next figure containing side-by-side line graphs compares sleep patterns across different stress levels by depicting the average seconds of sleep at each hour of the day.

Amongst the individuals with the sleep chronotype "Early Bird", individuals with 'no' stress tend to wake up earlier and have a more consistent sleep pattern, as evidenced by the concentration of sleep towards the early morning hours. As stress levels increase, the waking time shifts later, with 'severe' and 'extreme' stress levels associated with the latest wake times.

Amongst individuals with "Night Owl" chronotype, those with higher stress levels are associated with more variability in sleep timing, particularly for 'severe' and 'extreme' stress levels. The 'extreme' stress group exhibits the most irregular sleep pattern, with significant activity during usual sleeping hours. Both graphs together suggest that higher stress levels may be correlated with disrupted and inconsistent sleep patterns, with a tendency towards later sleep and wake times.

undefined



Classification Results

The logistic regression model employed to differentiate between healthy and stressed individuals was evaluated using several metrics and visualisations to provide a comprehensive understanding of its performance in distinguishing between the classes.

Receiver Operating Characteristic (ROC) Curve The ROC curve illustrates the model's diagnostic ability across various discrimination thresholds. Our model achieved an Area Under the Curve (AUC) of 0.76, which reflects a good predictive performance. This AUC score indicates that the model has a 76% chance of correctly distinguishing between the positive and negative class for a randomly selected pair of instances, one from each class. The curve, which plots the true positive rate against the false positive rate, demonstrates the model's capability to balance sensitivity and specificity effectively.

undefined


Precision-Recall (PR) Curve The PR curve, which evaluates the trade-off between precision and recall, yielded an Average Precision (AP) score of 0.78. This score demonstrates that the model maintains a high level of precision across various levels of recall, which is essential in scenarios where the cost of false positives is high. The high AP value suggests that the model is particularly adept at identifying the positive class without incurring a significant number of false positives.

undefined

Normalised Confusion Matrix The normalised confusion matrix provides a detailed breakdown of the model's classification accuracy for each class. The model correctly predicted true negatives 66% of the time and true positives 71% of the time. The misclassification rates are 34% for false positives and 29% for false negatives. This indicates a balanced performance by the model with a slight preference towards correctly identifying positive cases.


undefined


Discussion

The research aimed to develop a statistical model capable of assessing stress levels based on behavioural health data collected from smartphone sensors, a novel approach that leverages the ubiquity of smartphones. This method is particularly advantageous as it does not rely on wearable technology, making it more accessible to a broader population. The findings of this study offer significant insights into the relationship between stress and behavioural patterns, particularly physical activity and sleep.

Relationship Between Stress and Physical Activity

The study's analysis demonstrated a clear correlation between stress levels and physical activity, as evidenced by step count data. Participants with normal stress levels exhibited higher and more consistent step counts, suggesting a possible protective effect of physical activity against stress or a decline in physical activity due to increased stress. The trend of reduced step counts and increased variability in physical activity at higher stress levels supports this hypothesis. This pattern was further emphasised by the analysis of active hours and step count deviation, showing that higher stress levels might lead to irregular physical activity patterns. These findings align with existing literature indicating that stress can negatively impact physical activity and overall health (Smyth et al., 2016) while the converse also being evident where reduced physical activity can lead to lower ability to handle stressful events (Nguyen-Michel et al., 2006).

Stress and Sleep Patterns

The analysis of sleep patterns revealed that stress levels significantly influence sleep, with higher stress associated with later sleep and wake times and more variability in sleep patterns. This finding is particularly crucial as it underscores the impact of stress on circadian rhythms and overall sleep quality. The distinct patterns observed between different stress levels, especially in the 'severe' and 'extreme' categories, highlight the need for targeted interventions to address sleep disturbances in highly stressed individuals.

Model Performance and Implications

The logistic regression model, with its ROC curve AUC of 0.76 and AP score of 0.78, indicates a good predictive performance in distinguishing between healthy and stressed individuals. The balanced performance of the model, as evidenced by the normalised confusion matrix, suggests promise for applications in remote monitoring, self and early intervention in stress-related disorders.

Limitations

While our study provides valuable insights, there are limitations to consider:

  1. Sample Diversity: The sample was limited to smartphone users who opted to participate, which might not fully represent the general population.

  2. Self-Reported Measures: The DASS-21 is a self-reported measure, which can introduce biases or inaccuracies in reporting stress levels.

  3. Short-Term Data Collection: Data was collected over six months, which may not capture long-term trends or seasonal variations in stress and behaviour.

  4. Single Modality of Stress Assessment: Our study relied solely on logistic regression; incorporating other machine learning techniques could provide a more robust analysis.


Future Research Directions

Future research should aim to:

  1. Expand Sample Size and Diversity: Include a more diverse sample, covering different demographics, to enhance the generalisability of the findings.

  2. Longitudinal Studies: Conduct longer-term studies to observe changes over different seasons and life events.

  3. Integrate Multimodal Data Analysis: Combine smartphone sensor data with other data types, such as biometric data from wearables, for a more comprehensive stress assessment.

  4. Explore Intervention Strategies: Utilise the model to test intervention strategies and monitor their effectiveness in real-time.


Exploratory Data Analysis and Feature Engineering

The study faced constraints in terms of time and resources, which limited the extent of exploratory data analysis and feature engineering. A more thorough exploration of the collected data and a more sophisticated approach to feature engineering could uncover deeper insights and strengthen the model's predictive capabilities. The next step in feature engineering would include using raw data from smartphone sensors like accelerometers and gyroscopes could significantly increase the number of features available for analysis. Processing and extracting meaningful patterns from this high-volume, raw sensor data would require advanced data analysis techniques such as neural network models and significant computational resources.

Integration of Wearable Data and Vital Sign Monitoring

While our study didn't use wearable data in the analysis, incorporating it presents a significant opportunity for model improvement. Wearables like Apple Watches provide detailed data on heart rate and heart rate variability (HRV), which are critical indicators of heart health and the nervous system's response to stress. HRV, in particular, offers insights into transient stress and the body's physiological responses. Monitoring these vital signs can not only enhance the accuracy of stress level assessments but also provide a means to gauge the effectiveness of interventions aimed at stress management. The integration of this data could lead to a more holistic understanding of an individual's stress response and overall health.

Expanding Dataset in a Production Environment

The dataset skew towards healthy and mild to moderate stress categories limits the model's ability to accurately predict higher stress levels. Deploying the model in a production environment, where it is used by real-world users, offers a pathway to address this limitation. In a production setting, the model would have access to a broader and more representative population, enabling continuous feedback and iterative improvements. This approach aligns with common practices in machine learning, where real-world data is used to refine and enhance model performance over time. The use of a more diverse dataset would not only balance the representation of different stress levels but also ensure that the model remains relevant and effective in practical applications.

Conclusion

This study successfully demonstrates the feasibility of using smartphone sensor data to assess stress levels in the general population. The findings provide valuable insights into the relationship between stress and daily behavioural patterns, offering potential pathways for self-management in stress-related health issues, providing agency back to the user. The use of widely accessible technology like smartphones for health monitoring marks a significant step towards more personalised and preventive healthcare strategies.



1. Smyth, J., Sliwinski, M., Zawadzki, M., Scott, S., Conroy, D., Lanza, S., Marcusson-Clavertz, D., Kim, J., Stawski, R., Stoney, C., Buxton, O., Sciamanna, C., Green, P., & Almeida, D. (2016). Everyday stress response targets in the science of behavior change.. Behaviour research and therapy, 101, 20-29 . https://doi.org/10.1016/j.brat.2017.09.009.

2. Nguyen-Michel, S., Unger, J., Hamilton, J., & Spruijt-Metz, D. (2006). Associations between physical activity and perceived stress/hassles in college students. Stress and Health, 22, 179-188. https://doi.org/10.1002/SMI.1094.

©Sahha 2024