Abstract
Mental health issues and suicide are continuously rising global concerns. Interventions have expanded from traditional counseling and hotline calls to digital mental health care apps and online support services. Similarly, AI is proliferating in different domains and raising questions about its consequent impact on human well-being. In this paper, we sought to integrate AI into current human-supported, chat-based mental health interventions with the goal of enhancing their quality of care. A laboratory study was carried out to investigate the potential of analysing keyboard typing and text messaging patterns as rich sources of emotional information. We collected keystroke dynamics (KD) and text data from 31 participants and trained AI models, leveraging the capabilities of machine learning and LLMs. We also collected heart rate and facial expression data to validate that this passive method of emotion recognition performs comparably to existing affective computing technologies based on non-behavioural measures. Models trained on the fusion of KD and text were able to predict levels of affective arousal (MSE = 0.213) and valence (MSE = 0.387) and seven discrete emotional states (highest F1 scores = 0.985, 0.980, and 0.965 for anger, surprise, and fear respectively). Across all target emotion classes, there was no significant difference between fusion models and those that included heart rate and facial expressions, verifying that KD and text analysis can be sufficiently utilised for emotion recognition in online messaging platforms. By enabling emotion awareness in such platforms used by text-based helplines, we might be able to assist helpline responders and ultimately their clients. This work presents a novel contribution in emotion recognition methodologies while laying the groundwork for AI applications that support critical mental health services with guided decision-making and reinforced empathy.