Detecting stress in the office from how people type and click

Researchers at ETH Zurich have developed a model that detects workplace stress just by how people type and move their computer mouse. This might enable employees to prevent chronic stress early on.
In Switzerland, one in three employees suffers from workplace stress. (Photograph: Andrey Popov / Adobe Stock)

Brief summary of key points

  • Study participants’ typing and mouse behaviour in the office is a better predictor of how stressed they feel than their heart rate.
  • People who are stressed move the mouse pointer more often and less precisely. They also make more mistakes when typing.
  • The ETH researchers’ model could one day enable employees to prevent chronic stress in the office early on.

In Switzerland, one in three employees suffers from workplace stress. Those affected often don’t realise that their physical and mental resources are dwindling until it’s too late. This makes it all the more important to identify work-related stress as early as possible where it arises: in the workplace.

Researchers at ETH Zurich are now taking a crucial step in this direction. Using new data and machine learning, they have developed a model that can tell how stressed we are just from the way we type and use our mouse.

And there’s more: “How we type on our keyboard and move our mouse seems to be a better predictor of how stressed we feel in an office environment than our heart rate,” explains study author Mara Nägelin, a mathematician who conducts research at the Chair of Technology Marketing and the Mobiliar Lab for Analytics at ETH Zurich. Applied correctly, these findings could be used in future to prevent increased stress in the workplace early on.

Stressed people type and click differently

The ETH researchers proved in an experiment that stressed people type and move their mouse differently from relaxed people. “People who are stressed move the mouse pointer more often and less precisely and cover longer distances on the screen. Relaxed people, on the other hand, take shorter, more direct routes to reach their destination and take more time doing so,” Nägelin says.

What’s more, people who feel stressed in the office make more mistakes when typing. They write in fits and starts with many brief pauses. Relaxed people take fewer but longer pauses when typing on a keyboard.

The connection between stress and our typing and mouse behaviour can be explained with what is known as neuromotor noise theory: “Increased levels of stress negatively impact our brain’s ability to process information. This also affects our motor skills,” explains psychologist Jasmine Kerr, who researches with Nägelin and is a coauthor of the study.  

Simulating office stress as realistically as possible

To develop their stress model, the ETH researchers observed 90 study participants in the lab performing office tasks that were as close to reality as possible, such as planning appointments or recording and analysing data. They recorded the participants’ mouse and keyboard behaviour as well as their heart rates. In addition, the researchers asked the participants several times during the experiment how stressed they felt.

«We were surprised that typing and mouse behaviour was a better predictor of how stressed subjects felt better than heart rate.»      Mara Nägelin

While some participants were allowed to work undisturbed, others also had to take part in a job interview. Half of this group were also repeatedly interrupted with chat messages. In contrast to earlier studies by other scientists, where the control group often did not have to solve any tasks at all and could relax, in the ETH researchers’ experiment, all participants had to perform the office tasks. 

“We were surprised that typing and mouse behaviour was a better predictor of how stressed subjects felt better than heart rate,” Nägelin says. She explains that this is because the heart rates of the participants in the two groups did not differ as much as in other studies. One possible reason is that the control group was also given activities to perform, which is more in line with workplace reality.

Data must be protected

The researchers are currently testing their model with data from Swiss employees who have agreed to have their mouse and keyboard behaviour as well as their heart data recorded directly at their workplace using an app. The same app also regularly asks the employees about their subjective stress levels. Results should be available by the end of the year.

However, workplace stress detection also raises some thorny issues: “The only way people will accept and use our technology is if we can guarantee that we will anonymise and protect their data. We want to help workers to identify stress early, not create a monitoring tool for companies,” Kerr says. In another study involving employees and ethicists, the researchers are investigating which features an app needs to have to meet these requirements and ensure responsible handling of sensitive data. 

Further information

Naegelin M, Weibel RP, Kerr JI, Schinazi VP, La Marca R, von Wangenheim F, Hoelscher C, Ferrario A: An interpretable machine learning approach to multimodal stress detection in a simulated office environment. Journal of Biomedical Informatics 2023, 139: 104299, doi: 10.1016/j.jbi.2023.104299

Mobiliar Lab for Analytics at ETH Zurich