Acute Stress Detection through Typing Behaviors, Smartphone Sensors and Machine Learning Techniques
Year: 2026
Type: article
Abstract: Objectives: To examine whether acute stress can be recognised from smartphone typing behaviour and device motion without wearable sensors, and to identify the classifier family best suited to such data. Method: A browser-based application recorded keystroke events together with accelerometer and gyroscope readings (2 Hz) while 288 participants typed simple number series (calm condition) and mental-arithmetic sequences (stress condition), yielding 2,016 samples. Five keystroke timing features and the inertial features were combined, and ten supervised classifiers were trained and tested on the same stratified 80:20 split using accuracy, AUC and weighted and macro precision, recall and F1-score. Findings: Ensemble methods outperformed the linear, probabilistic, distance-based and neural models. XGBoost achieved the best result, with 89.30% accuracy and an AUC of 95.42%, and Random Forest was close behind (88.72%, 95.32%); Naïve Bayes was weakest (57.98%). Weighted and macro F1 scores of the leading models differed by less than 0.3 points, indicating balanced detection of both classes. The accuracy exceeds the 87.56% reported by the closest smartphone motion-sensor study on 46 participants, and the ranking of XGBoost ahead of Random Forest agrees with recent wearable-sensor studies. Unlike deep models applied to dense physiological signals, the multilayer perceptron performed poorly on these compact behavioural features, which indicates that tree ensembles suit this type of data better. Novelty: Keystroke dynamics and smartphone inertial sensing are combined in one installation-free, synchronised protocol and benchmarked with ten classifiers on a cohort six times larger than the closest smartphone study. Keywords: Acute Stress Detection, Keystroke Dynamics, Smartphone Sensing, Machine Learning, Behavioural Biometrics
Authors: Purba Banerjee, Soumen Roy, Sandip Dutta, Utpal Roy
Institutions: Visva-Bharati University, Adamas University
Language: English
Topic: Emotion and Mood Recognition
Subfield: Experimental and Cognitive Psychology
Field: Psychology
Domain: Social Sciences
Open Access status: green
OpenAlex ID: W7224486061
