Skip to main content
medRxiv
  • Home
  • About
  • Submit
  • ALERTS / RSS
Advanced Search

One does not fit all: Detecting work-related stress from mouse, keyboard, and cardiac data in the field

View ORCID ProfileMara Naegelin, View ORCID ProfileRaphael P. Weibel, View ORCID ProfileJasmine I. Kerr, View ORCID ProfileFlorian von Wangenheim, View ORCID ProfileVictor R. Schinazi, View ORCID ProfileRoberto La Marca, View ORCID ProfileChristoph Hoelscher, View ORCID ProfileUrs M. Nater, View ORCID ProfileAndrea Ferrario
doi: https://doi.org/10.1101/2025.08.02.25332538
Mara Naegelin
1Mobiliar Lab for Analytics, ETH Zurich, Switzerland
2Chair of Technology Marketing, ETH Zurich, Switzerland
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Mara Naegelin
Raphael P. Weibel
1Mobiliar Lab for Analytics, ETH Zurich, Switzerland
2Chair of Technology Marketing, ETH Zurich, Switzerland
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Raphael P. Weibel
Jasmine I. Kerr
1Mobiliar Lab for Analytics, ETH Zurich, Switzerland
2Chair of Technology Marketing, ETH Zurich, Switzerland
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Jasmine I. Kerr
Florian von Wangenheim
2Chair of Technology Marketing, ETH Zurich, Switzerland
3Future Health Technologies, Singapore-ETH Centre, Singapore
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Florian von Wangenheim
Victor R. Schinazi
3Future Health Technologies, Singapore-ETH Centre, Singapore
4Department of Psychology, Bond University, Australia
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Victor R. Schinazi
Roberto La Marca
5Centre for Stress-Related Disorders, Clinica Holistica Engiadina, Switzerland
6Chair of Clinical Psychology and Psychotherapy, University of Zurich, Switzerland
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Roberto La Marca
Christoph Hoelscher
3Future Health Technologies, Singapore-ETH Centre, Singapore
7Chair of Cognitive Science, ETH Zurich, Switzerland
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Christoph Hoelscher
Urs M. Nater
8Chair of Clinical Psychology of Adulthood, University of Vienna, Austria
9Research Platform The Stress of Life (SOLE) – Processes and Mechanisms underlying Everyday Life Stress, University of Vienna, Austria
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Urs M. Nater
Andrea Ferrario
10Institute of Biomedical Ethics and History of Medicine, University of Zurich, Switzerland
11University of Applied Sciences and Arts of Southern Switzerland, Dalle Molle Institute for Artificial Intelligence, Switzerland
12ETH Zurich, Switzerland
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Andrea Ferrario
  • For correspondence: aferrario{at}ethz.ch
  • Abstract
  • Full Text
  • Info/History
  • Metrics
  • Data/Code
  • Preview PDF
Loading

Abstract

Background Continuously and unobtrusively monitoring work-related stress may help combat its detrimental effects on mental and physical health. For work in offices specifically, mouse and keyboard data have been suggested as highly suitable data sources for stress detection, in addition to physiological data such as heart rate variability (HRV). However, previous studies have yielded mixed results regarding the potential of mouse and keyboard data to detect stress, and very few works have examined the connection in real work environments. Moreover, concerns regarding the robustness and validity of existing stress detection approaches have been raised, emphasising the need for more rigorous investigations in the field.

Methods We conducted an 8-week observational field study with office employees (N = 36) where we collected mouse, keyboard, and cardiac data as well as self-reported stress during working hours. We derived mouse movement, keystroke dynamics, and HRV features, and trained regression models to detect self-reported stress levels using machine learning algorithms including Elastic Net, Random Forest, eXtreme Gradient Boosting (XGBoost), and Recurrent Neural Networks in two distinct modelling approaches: (1) one-fits-all, and (2) personalised. The first approach aims to detect the stress levels of a participant using training data from other participants. In the second, individual models are trained per participant.

Results The one-fits-all modelling approach yields modest correlations with true labels (Spear-man’s ρ = 0.078) under leave-one-subject-out cross-validation, with a slight improvement when incorporating time series of feature values (Spearman’s ρ = 0.096). In the personalised approach, XGBoost models trained on mouse and keyboard features reach an average Spearman’s ρ of 0.188 under blocked cross-validation. When optimised across machine learning models and feature sets, performance of the personalised approach further improves, reaching an average Spearman’s ρ of 0.296.

Conclusion Our results suggest that that developing robust and valid stress detection models from in-field data remains challenging, reflecting the complexity of affective computing in naturalistic settings. Personalised modelling approaches show encouraging potential and warrant further exploration. We offer actionable recommendations to advance research on automated stress detection in real-world settings and openly share our dataset to promote innovation and collaboration within the research community.

Competing Interest Statement

The authors have declared no competing interest.

Funding Statement

This study is part of a larger project and supported by an ETH Research Grant, Switzerland (ETH-09 19-2).

Author Declarations

I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.

Yes

The details of the IRB/oversight body that provided approval or exemption for the research described are given below:

The study was approved by the ETH's Ethics Commission (EK 2021-N-209) and conducted in accordance with the Declaration of Helsinki.

I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.

Yes

I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).

Yes

I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.

Yes

Data Availability

Data are added to a repository in the Open Science Framework (OSF) under https://osf.io/qpekf/ and are available upon request.

https://osf.io/qpekf/

Copyright 
The copyright holder for this preprint is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. It is made available under a CC-BY-NC 4.0 International license.
Back to top
PreviousNext
Posted August 05, 2025.
Download PDF
Data/Code
Email

Thank you for your interest in spreading the word about medRxiv.

NOTE: Your email address is requested solely to identify you as the sender of this article.

Enter multiple addresses on separate lines or separate them with commas.
One does not fit all: Detecting work-related stress from mouse, keyboard, and cardiac data in the field
(Your Name) has forwarded a page to you from medRxiv
(Your Name) thought you would like to see this page from the medRxiv website.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Share
One does not fit all: Detecting work-related stress from mouse, keyboard, and cardiac data in the field
Mara Naegelin, Raphael P. Weibel, Jasmine I. Kerr, Florian von Wangenheim, Victor R. Schinazi, Roberto La Marca, Christoph Hoelscher, Urs M. Nater, Andrea Ferrario
medRxiv 2025.08.02.25332538; doi: https://doi.org/10.1101/2025.08.02.25332538
Twitter logo Facebook logo LinkedIn logo Mendeley logo
Citation Tools
One does not fit all: Detecting work-related stress from mouse, keyboard, and cardiac data in the field
Mara Naegelin, Raphael P. Weibel, Jasmine I. Kerr, Florian von Wangenheim, Victor R. Schinazi, Roberto La Marca, Christoph Hoelscher, Urs M. Nater, Andrea Ferrario
medRxiv 2025.08.02.25332538; doi: https://doi.org/10.1101/2025.08.02.25332538

Citation Manager Formats

  • BibTeX
  • Bookends
  • EasyBib
  • EndNote (tagged)
  • EndNote 8 (xml)
  • Medlars
  • Mendeley
  • Papers
  • RefWorks Tagged
  • Ref Manager
  • RIS
  • Zotero
  • Tweet Widget
  • Facebook Like
  • Google Plus One

Subject Area

  • Health Informatics
Subject Areas
All Articles
  • Addiction Medicine (576)
  • Allergy and Immunology (868)
  • Anesthesia (306)
  • Cardiovascular Medicine (4483)
  • Dentistry and Oral Medicine (449)
  • Dermatology (385)
  • Emergency Medicine (615)
  • Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1528)
  • Epidemiology (15282)
  • Forensic Medicine (31)
  • Gastroenterology (1134)
  • Genetic and Genomic Medicine (6650)
  • Geriatric Medicine (671)
  • Health Economics (1006)
  • Health Informatics (4606)
  • Health Policy (1378)
  • Health Systems and Quality Improvement (1624)
  • Hematology (544)
  • HIV/AIDS (1276)
  • Infectious Diseases (except HIV/AIDS) (15965)
  • Intensive Care and Critical Care Medicine (1111)
  • Medical Education (626)
  • Medical Ethics (147)
  • Nephrology (674)
  • Neurology (6698)
  • Nursing (346)
  • Nutrition (1006)
  • Obstetrics and Gynecology (1153)
  • Occupational and Environmental Health (961)
  • Oncology (3370)
  • Ophthalmology (988)
  • Orthopedics (370)
  • Otolaryngology (421)
  • Pain Medicine (437)
  • Palliative Medicine (131)
  • Pathology (670)
  • Pediatrics (1704)
  • Pharmacology and Therapeutics (700)
  • Primary Care Research (717)
  • Psychiatry and Clinical Psychology (5497)
  • Public and Global Health (9287)
  • Radiology and Imaging (2225)
  • Rehabilitation Medicine and Physical Therapy (1375)
  • Respiratory Medicine (1202)
  • Rheumatology (598)
  • Sexual and Reproductive Health (721)
  • Sports Medicine (536)
  • Surgery (722)
  • Toxicology (100)
  • Transplantation (290)
  • Urology (267)