Patterns of smartphone typing performance by time awake: implications for unobtrusive ambulatory mental fatigue assessment
Yu Fang, Peter Yang, Elena Frank, Cathy Goldstein, Aidan G. C. Wright, Amy S. B. Bohnert, Vik Kheterpal, Srijan Sen, Zhenke Wu, Tianzhen Chen, Louise Millard

TL;DR
Smartphone typing speed changes predict mental fatigue, offering a real-time, unobtrusive way to monitor alertness in high-risk jobs.
Contribution
Using smartphone typing data to detect mental fatigue in real-world settings, without lab equipment.
Findings
Typing speed peaks around 7.5 hours after waking and declines significantly after 15.3 hours awake.
The decline in typing speed aligns with lab-based tests showing lapses in attention after prolonged wakefulness.
Smartphone typing metrics can serve as a scalable, continuous tool for mental fatigue assessment.
Abstract
Mental fatigue undermines workplace safety and productivity. Early detection of subtle declines in objective alertness and cognitive performance in workers can enable timely interventions to prevent costly errors and safeguard employee health. However, conventional assessments often require controlled laboratory conditions and prolonged testing, limiting their real-world applicability. Here, we demonstrate an approach that utilizes smartphone keyboard metrics in everyday use to provide a more scalable, continuous, and ambulatory method for evaluating mental fatigue. We examined the adjusted association between novel yet widely available SensorKit typing performance metrics and wearable-derived time since waking from a most recent major sleep episode or napping among 366 first-year training physicians in the United States who generated 45,042 typing sessions over a two-month period.…
Genes, proteins, chemicals, diseases, species, mutations and cell lines named across the full text — each resolved to its canonical identifier and authoritative record.
Click any figure to enlarge with its caption.
Fig 1
Fig 2
Fig 3
Fig 4
Fig 5- —http://dx.doi.org/10.13039/100000025National Institute of Mental Health
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSleep and Work-Related Fatigue · Human-Automation Interaction and Safety · Ergonomics and Musculoskeletal Disorders
Introduction
Mental fatigue is a driving risk factor for impairment of workplace safety and productivity and increase in work errors, especially for occupations with long work hours or shift schedules, such as healthcare workers [1, 2]. Mental fatigue in real-world performance is predominantly influenced by two main factors: sleep deprivation and prolonged time on task. At present, the methods to reliably measure mental fatigue require active participation. For instance, the Psychomotor Vigilance Test (PVT), the most widely utilized tool for detecting these fatigue-related signals [3], requires several minutes of active participation to complete, even with the developed brief versions [4], and is generally restricted to laboratory settings. Thus, current tools cannot be used for real-time, continuous detection of mental fatigue signals in the real world without interrupting regular activities. Therefore, alternative measures are needed to address the gap.
Recent research has investigated the connection between typing performance and mental fatigue, using both naturalistic and controlled environments to assess how cognitive functions influence typing speed and accuracy. Pimenta et al. proposed an unobtrusive method for measuring an individual’s level of fatigue through the interaction patterns of the individual with the mouse and keyboard of the computer [5, 6]. Al-libawy et al. proposed various methods to predict fatigue status using smartphone text entry performance metrics such as hold time and digraph time [7, 8]. de Jong et al. further reported that typing markers of computer keyboard could inform the mental fatigue status, by showing that decreased P3 brain potential amplitude (known to be related to mental fatigue [9–11]) recorded by electroencephalography (EEG) is related to increase in typing time and typing errors [12]. Ross et al. discovered that typing speed on smartphones is positively associated with performances in the digital version of trail making test, a neuropsychological test that assesses visual attention, processing speed, and task switching [13]. Based on these validations of using typing performance as an indicator of mental fatigue, de Jong et al. found that typing markers are susceptible to changes in behavior related to mental fatigue, with dynamic changes over different time scales such as time-on-task, time-of-day, and day-of-week in an uncontrolled work environment [14]. A study of emergency medicine resident physicians demonstrated significant decrements in typing speed during night shift compared to day shift and evening shift [15]. These studies underscore the value of typing performance as a non-intrusive and reliable indicator for monitoring mental fatigue across various settings. However, these studies have been constrained by small sample sizes (all fewer than 100) and the need for a customized keyboard application to capture typing metrics, limiting the robustness of their conclusions and the utility and scalability of the tools utilized.
SensorKit (Apple Inc.) [16,17] is an innovative technological framework on iPhone that enables researchers to request relevant sensor data from consented participants via a study app that reads the data on-device after said participant grants permission. Metrics from on-device sensors for iPhone help to optimize user experience without sharing personal data off-device, including not with Apple. Specifically, the keyboard sensor captures the configuration of the phone’s keyboard and monitors its usage pattern, such as typing speed and accuracy, during the use of any App or other phone function, without recording the actual content typed or identifying the App or function. This capability provides a powerful tool for passively examining typing performance on a large scale, without the need for additional software installation. With over 1.3 billion active iPhone users worldwide [18], the scalability of a passive iPhone based mental fatigue marker is immense. This study aims to utilize the data collection capabilities for the native iPhone keyboard to investigate whether passively collected keyboard performance could serve as an indicator of mental fatigue. To accomplish this aim, this study considers first year medical residents (interns), who typically endure long work hours, difficult decisions, and sleep deprivation, representing an ideal population for studying mental fatigue.
Methods
Ethics statement
The study was approved by the University of Michigan Institutional Review Board (HUM00033029) and all subjects provided informed consent after receiving a complete description of the study.
Study design
The Intern Health Study is an annual cohort study that follows the stress and mental health of first-year physician residents (interns) across the United States. In the 2023 cohort of Intern Health Study, interns starting residency in 2023 were invited to participate via email 2–3 months before the start of internship (July 2023). Participants completed the main study consent and a baseline survey that collected demographic information and then logged into the MyDataHelps mobile application (CareEvolution, Ann Arbor, MI). Upon enrollment, participants were provided with their choice of wearable devices including Fitbit Charge 4, Inspire 2 (Google Fitbit, San Francisco, CA), Apple Watch (Apple Inc., Cupertino, CA), or 80 additional compensation throughout the year for continued participation. iPhone users among the participants were offered enrollment in the SensorKit arm of the study (Ambient Light, Keyboard Usage, Message Usage, Phone Usage, and Visits) through additional consenting processes, see Funk et al. 2025 for details [19]. No additional incentives were provided for opting into the collection of SensorKit data.
Data collection
iPhone keyboard metrics.
The keyboard usage and measurement of participants were collected through SensorKit, which is a novel framework supported by Apple allowing researchers to obtain additional data collected from sensors of consented study participants’ iPhones. The Keyboard Usage sensor [20] of SensorKit provides information about keyboard usage including typing duration (seconds, ‘totalTypingDuration’), typing speed (characters per second, ‘typingSpeed’), total taps (counts, ‘totalTaps’), and total deletes (counts, ‘totalDeletes’). Other keyboard features, such as width and height of the keyboard (both in millimeters), as well as the active keyboard languages (‘inputModes’) were also recorded. The date and time of each typing event were recorded, and the typing events were grouped to the nearest half-hour session for privacy reasons (i.e., daily at 00:00, 00:30, …, 23:00, 23:30, 24:00). For privacy protection, any of the words typed, or any information about keyboard extensions or stickers were not collected (S1 Fig).
The iPhone keyboard metrics from the first two months (July and August, 2023) of the intern year were included in the analysis. From the original measures of keyboard usage, we derived two metrics that reflect average typing performance for the multiple typing events (i) grouped by typing session at each day’s each half-hour grid point (t), where t represents the actual date and time stamp rounded to the nearest half-hour. All subjects share the same set of grid points; we calculate the typing metrics for subject s at t only if there is at least one associated typing session. First, the average typing speed for subject s at t was calculated by:
Second, the average typing accuracy, represented by the rate of deletions, for subject s at t was calculated by:
Finally, because this study focuses on examining changes within individuals over the course of time since awake, typing speed and rate of deletions were converted to standardized z-scores for each subject s at t:
and
where and represent the mean and the standard deviation of all records of typing speeds ( ) or deletes rate ( ) over all day all time points for subject s, respectively.
Sleep measures
Similar to validation tests for the PVT [21], we used time awake as the metric representative of the level of mental fatigue due to the build-up of the homeostatic sleep drive during sustained wakefulness. Sleep timing (bedtime and wake time) of the participants were recorded by the wearable devices. Fitbit and Garmin watches directly provided the bedtime and wake time of each sleep episode. Apple Watch provided intraday sleep stage data via HealthKit [22], from which we combined any sleep stages that were separated by gaps of <30 mins into one sleep episode for each subject, and extracted the bedtime and wake time from each sleep episode.
Next, for each subject, we linked each typing session with a preceding sleep episode if 1) no other sleep episode occurred in between; 2) the time interval between the previous wake time and the typing session was no more than 24 hours. Then for each typing session, time awake was derived as the time interval between the timestamp of the typing initiation (rounded to the nearest half hour) and the wake time of its linked most recent sleep episode.
Statistical analysis
All statistical analyses were conducted with the use of R version 4.3.2 (The R Foundation, Vienna, AUT) [23].
We utilized generalized estimating equations (GEE) modeling, which is capable of adjusting for repeated measures from the same subject, to formally examine the population-average association between time awake and typing performance. We used an independent working correlation matrix to produce robust inferential results to protect against potential endogeneity [24]; however, this analysis still acknowledges the dependence of typing performance outcomes within each subject in the calculation of the coefficient estimates, intervals, and p-values. The analyses were performed with R packages ‘geepack’ [25] and ‘glmtoolbox’ [26].
We fitted two sets of models, one with typing speed zscore as the outcome, and the other with rate of deletion zscore as the outcome. To account for potential non-linear relationships, both linear and quadratic terms of time awake were included as primary predictors in the analysis. Three nested models were analyzed:
The first model assessed the relationship between the typing performance metrics and time awake without adjustment for other covariates. The second model examined this relationship after adjusting for covariates, including age, biological sex, time of day (modeled using the sine and cosine of its radian format to capture the circular nature of time and flexibly represent rhythms of any phase and amplitude), total typing duration (and its quadratic term), duration of previous sleep period (and its quadratic term), whether the day is weekend, wearable device types, keyboard area, and the other typing performance metric (if the outcome is typing speed zscore, then rate of deletion zscore is included as a covariate, vice versa). The third model further explored whether factors including age, sex, wearable device types, and duration of last sleep episode moderated the relationship between typing performances and time awake. Model fit was compared by the Schwartz-type penalized Gaussian Pseudo-likelihood Criterion (SGPC) (lower values are better) which was shown to outperform other existing methods in selecting variables and performs well regardless of whether the working correlation structure is correctly specified or not [27,28].
When visualizing the smoothed relationship between time awake and typing performances, we included a generalized additive model (GAM) smoothed prediction fitting line using a model similar to model (2), but replacing the linear and quadratic terms of time awake with a natural spline term (df = 3) of time awake, to better capture the possible higher order of non-linear relationship:
The typing performances could potentially also be affected by time of day, independent of hours awake. To test whether typing performances present diurnal rhythmicity, we fit cosinor models, with typing performances as outcome, and time of day as the time variable, using the ‘cosinor’ package.[29] In addition, to separate the effects of time awake and time of day on typing performances, we made an illustration with 4 strata where time awake was set at less than 6 hours, 6–12 hours, 12–18 hours, and 18–24 hours. Each stratum was fit with model (4) respectively.
Sensitivity analyses
First, to mitigate potential skewness arising from a small number of typing sessions occurring beyond 18 hours awake, we repeated the analysis by restricting to the typing sessions with a maximum of 18 hours awake.
Second, to eliminate the impact of different language settings on typing performance, we repeated the analysis by restricting to the typing sessions where the input mode was US English (‘en_US’).
Third, to clarify whether wearable device type affected results, we conducted a sensitivity analysis by repeating the same analysis within three subgroups that contain typing sessions associated with only Fitbit-recorded, Apple Watch-recorded, or Garmin-recorded sleep episodes. Each subgroup was fit with its own model:
Finally, the wearable and SensorKit data analyzed were collected from the first two months of medical internship, however, it is important to note that sleep at baseline (the period after enrollment but before the beginning of internship) might have influenced the results. To account for this, we re-ran model (3) including only the participants with baseline sleep data and added baseline sleep duration as an additional covariate, both with itself and its interaction with time awake.
Results
Sample characteristics
4,151 interns starting residency in July 2023 were invited and 1,437 interns enrolled in 2023 Intern Health Study. After excluding non-iPhone users, subjects who opted out of the SensorKit keyboard usage data collection, and the ones who didn’t provide sufficient data, 366 participants from 24 specialties and 154 residency programs were included in the final analyses (see Fig 1 for study flow chart). Table 1 provides the descriptive statistics of demographics and the collected typing and sleep data for the included subjects. There were 212 (57.9%) female participants, with mean age of 27.7 years old (SD = 2.7). The proportion of Fitbit, Apple Watch, and Garmin Watch users were 15.0%, 80.1% and 6.3%, respectively, with 5 subjects using more than one type of device (not on the same day). In all, 45,042 typing sessions linked with a preceding sleep episode were recorded. The individual mean typing speeds ranged from 2.1 to 6.6 characters per second (c/s) and averaged at 4.6 c/s (SD = 0.8 c/s). The individual mean rate of deletion ranged from 1% to 25%, and averaged at 7.3% (SD = 3.0%). The average of individual median wake up time was at 06:23 am (SD = 108.7 minutes). Time awake was significantly correlated with both the sine (r = -0.46, p < 0.001) and cosine (r = 0.67, p < 0.001) transformations of time-of-day, i.e., the time awake tends to be longest near midnight (peak of cosine) and shortest in the morning (peak of sine). S2 Fig shows the distributions of time awake, typing speed, and rate of deletion of the recorded typing sessions. Fig 2 illustrates an example of recorded sleep episodes and typing sessions of one random subject throughout 62 days.
Table 1: Sample characteristics (N = 366).
Study sample flow chart.
Recorded sleep episodes (red blocks) and typing sessions (blue bars) for a randomly chosen subject between the start of internship on July 1st to September 1st, 2023.Recall that each typing session was rounded to the nearest 30-min mark for privacy considerations and may contain multiple typing events.
The relationship between time awake and typing speed
According to SGPC, the adjusted model (2) had the best fit for the relationship between time awake and typing speed. Based on model (2), typing speed was significantly associated with both the linear and quadratic terms of time awake, after adjusting for the covariates (Table 2****, middle column). The negative coefficient for quadratic term of time awake suggests that the relationship between time awake and typing speed follows an inverted U-shape, as shown in Fig 3A. Based on the GAM-smoothed prediction from model (4), the typing speed increased upon waking and peaked to approximately 0.098 SD above average at around 7.5 hours after wake-up, and declined to over 0.1 SD below average at about 15.3 hours awake. The numbers of typing sessions occurring after being awake for more than 19 hours were relatively lower (S2A Fig) thus the error bars were wider for these times.
Table 2: The relationship between time awake and typing speed. Left: unadjusted - model (1); Middle: adjusted - model (2); Right: adjusted with interactions - model (3).
Average typing speed (A) and average rate of deletions (B) by number of hours awake.Typing speed and rate of deletions were converted to individual z-scores. The error bars represent 95%CI. The GAM-smoothed prediction lines from covariate-adjusted model (4) were plotted (green). The Blue solid line represents the individual average (z-score = 0), while the red dashed line represents -0.1 standard deviation in (A) and +0.1 standard deviation in (B).
There were different individual patterns of the change of typing speed over the course of time awake, as the two examples illustrated in Fig 4. Among several factors including age, sex, the type of wearable device used, and the duration of the most recent sleep episode, no covariate demonstrated a significant moderating effect on the relationship between time awake and typing speed (Table 2****, right column).
Average typing speed by hours awake for two example subjects.Typing speeds were converted to individual z-scores. The Blue solid line represents the individual average (z-score = 0), while the red dashed line represents -0.1 standard deviation below the individual average.
The relationship between time awake and rate of deletion
The adjusted model (2) had the best data fit for the relationship between time awake and rate of deletion according to SGPC. Based on model (2). After adjusting for covariates, the rate of deletion was significantly associated with both the linear and quadratic terms of time awake (Table 3****, middle column). Despite this significant association, the change in deletion rate was minimal, with none of the predicted rates of deletion exceeding 0.1 standard deviations above the average (Fig 3B). S3 Fig illustrates two examples of individual patterns showing different trends in the rate of deletion over time awake. We did not find any significant moderating effect of age, sex, the type of wearable device used, and the duration of the most recent sleep episode, on the relationship between time awake and rate of deletion (Table 3****, right column).
Table 3: Relationship between time awake and typing accuracy (rate of deletion). Left: unadjusted - model (1); Middle: adjusted - model (2); Right: adjusted with interactions - model (3)).
Diurnal rhythmicity
As shown above, time of day has a significant effect on tying speed (Table 2) but not rate of deletion (Table 3). After adjusting for covariates, typing speed exhibits significant diurnal rhythmicity with an amplitude of 0.10 (SE = 0.01), and the peak of the rhythm occurs at 11:49am. Across all four strata of different lengths of time awake, typing speed is consistently higher during the day compared to the night, with overall lower typing speed in longer time awake strata.(Fig 5)
The relationship between time of the day with typing speed stratified by time awake.Dataset was split into 4 subgroups: < 6 hours, 6-12 hours, 12-18 hours, and 18-24 hours. Each subgroup was fitted with model (4) respectively. The GAM-smoothed prediction lines from each model were plotted.
Sensitivity analyses: Restriction to a maximum of 18 hours awake
There were 43,413 (96.4% of all 45,042) recorded typing sessions from 365 subjects (99.7% of all 366) that occurred within 18 hours awake. Analyses conducted on this subset yielded similar results (S4 Fig).
Sensitivity analyses: The effect of input languages
There were 40,834 (90.7% of all 45,042) recorded typing sessions from 363 subjects (99.2% of all 366) having the input mode of US English. Analyses conducted on this subset yielded similar results (S5 Fig).
Sensitivity analyses: The effect of wearable device types
Among 45,042 typing sessions included in the analysis, there were 32,940, 9,111, and 2,991 typing sessions linked with a sleep episode recorded by a Fitbit, Apple Watch or Garmin watch, respectively. No significant interaction was found between the device types and time awake on both of the typing performances (Tables 2 and 3). In addition, sensitivity analyses that repeated the same analysis within three device type subgroups, which contain typing sessions linked with only Fitbit-measured, Apple Watch-measured, or Garmin-measured sleep episodes, showed similar patterns with the results including all data (S6, S7 Figs).
Sensitivity analyses: The effect of baseline sleep duration
There were 320 participants with at least one day of sleep data at baseline, contributing 41,048 typing episodes in total. Baseline sleep duration had no significant effect on either typing speed (β = 1.8x10^-4^, p = 0.59) or rate of deletion (β = 3.2x10^-4^, p = 0.19). There was also no significant interaction between baseline sleep duration and time awake (linear and quadratic terms) on typing speed (βlinear = -8.1x10^-5^, p = 0.24; βquadratic = 3.7x10^-6^, p = 0.27) or rate of deletion (βlinear = -6.0x10^-5^, p = 0.26; βquadratic = 2.2x10^-6^, p = 0.36).
Discussion
In this study, we investigated the potential utility of real-time, unobtrusive and ambulatory smartphone keyboard typing performance metrics to continuously and passively measure mental fatigue signals. Using over 45,000 typing episodes assessed through SensorKit and sleep information recorded by wearable devices, among over 350 medical interns, we found that typing speed was significantly associated with time awake, after adjusting for its diurnal rhythmicity, and other confounding factors. Specifically, we found that the typing speed increased upon waking and peaked at 0.098 SD above average 7.5 hours after wake-up and then declined to over 0.1 SD below average by 15.3 hours awake. These results remained robust after considering the effect of input languages and the type of wearable devices measuring sleep time.
Traditional tools of assessing alertness and fatigue, such as the PVT, that require active participation for assessment, have limited ability to continuously detect mental fatigue in the real world. Our findings suggest typing performance, especially smartphone typing speed, may be a promising new tool to passively and continuously follow mental fatigue in a naturalistic setting. Monitoring smartphone typing speed takes advantage of the ubiquitous use of mobile phones, imposes virtually no burden on the users while protecting user privacy. This tool could be valuable in real-word settings such as ensuring the work safety and quality of shift workers who are prone to fatigue-related errors. It could also be applied in areas where continuous alertness is essential, such as healthcare, manufacturing, public safety and transportation, to provide real-time feedback and inform interventions such as scheduling adjustments, timely breaks, and targeted wellness programs that enhance worker safety and operational efficiency. The tool could also be useful for individuals, providing information on when they should focus on cognitively demanding tasks and when they should disengage.
Our findings from typing speed are consistent with findings from active assessments of mental fatigue using tools such as the PVT. For example, the critical wake period beyond which PVT response lapse increased was estimated to be 15.8 hours [21], aligning closely with our observation regarding the amount of time awake (15.3 hours) when typing speed reduced to 0.1SD below average. Yet it is also important to note that our analyses identified periods of elevated typing speeds suggesting above-average alertness earlier in the day (~7–8 hrs after awakening). Future research directly comparing PVT and typing speed within the same group of subjects would help to further demonstrate the validity of using typing speed as a real-world and passively-sensed proxy for PVT.
The significant associations between typing speed with both time awake and time of day is consistent with the well-described two-process model of sleep [30]. This model describes the interaction of two distinct processes to produce consolidated periods of wakefulness and sleep: the homeostatic process (Process S) drives sleep need based on prior sleep and wakefulness, and the central circadian pacemaker (Process C) times the propensity for alertness to align with the daylight period. In a normally entrained, non-sleep deprived individual, upon awakening the homeostatic sleep drive is low but accumulates throughout the day with sustained wakefulness. The circadian alerting signal increases in opposition to the growing homeostatic sleep drive such that wakefulness can be sustained across the daylight period until bedtime. Approximately two hours prior to habitual sleep onset, the circadian alerting signal drops and in conjunction with an elevated homeostatic sleep drive, promotes sleep onset. Our findings align with these processes, with an initial increase in typing speed commensurate with an increasing circadian alerting signal (process C) followed by a decline in typing speed that aligns with an accumulation of the homeostatic sleep drive (process S) and drop in the circadian alerting signal. Further research exploring these dynamics may provide better predictions of cognitive performance and fatigue.
In addition to our findings related to the average trend among participants, we also found that there are individual differences in the relationship between typing speed and time awake. As illustrated in Fig 4, individuals differed in the timing and shape of their typing speed peaks and troughs with reference to time awake. Furthermore, meaningful departures from personal past typing speed trends can help to identify additional important driving factors. Specifically, continuous data collection enables establishment of personalized models that can be interrogated for associations with other individual differences (e.g., genotype, chronotype, type of work) and within-person predictors (e.g., exertion, breaks). Based on the results of the interaction tests, basic demographics like age and sex, as well as baseline and previous sleep duration, did not seem to be the factors moderating the relationship between time awake and typing speed. Future work is warranted in identifying between and within individual characteristics that may signal differences in mental fatigue development. From an applied perspective, tailored models could be developed to anticipate potential critical periods that maximize alertness and minimize fatigue for use in personalized feedback and intervention. Ongoing individualized monitoring of typing performance trends could also serve as a sentinel for unexpected critical drops in alertness.
In contrast to typing speed, typing accuracy, represented by the rate of deletion, remained relatively stable with time awake and time of day. This suggests that rate of deletion may not be as sensitive a measure of mental fatigue under the conditions studied. One possible explanation is that deletions during typing can reflect not just mistakes, but ongoing, deliberate editing, such as when composing charts or work emails, thus limiting its usefulness as a fatigue indicator. Additionally, autocorrection features on devices may further confound accuracy measures. Therefore, while typing accuracy seems less sensitive to time awake in this context, it warrants further exploration.
This study has several strengths. First, the study benefits from high statistical power with longitudinal data collected over two months from more than 350 subjects, resulting in over 45,000 typing episodes, a much larger sample than previous studies on typing performance and mental fatigue signals [5–8, 12–15]. Second, the study population, medical interns, typically endure long work hours and follow shift work schedules, which ensures that the collected data are well-distributed across various times of the day and durations of wakefulness. Additionally, interns frequently engage in typing on their phones for both professional and personal purposes. This group is also susceptible to fatigue-related work errors. These characteristics make medical interns an important and ideal group to study mental fatigue and its related markers. Third, with SensorKit and wearable technology, we were able to objectively collect both typing and sleep data in a naturalistic setting. This approach provides better accuracy than self-reported data, such as sleep diaries; and places minimal burden on subjects compared to assigning specific typing tasks. The utilization of SensorKit also allows massive scalability of the tool for mental fatigue assessment, if future studies confirm and extend findings from the study.
There are also some limitations to this study. First, there may be other confounding factors, such as caffeine and nicotine intake, medication, medical history [31], workload and demands, as well as motivation and context of typing, that could influence the associations between typing performance and time awake. For example, a higher workload may cause fatigue to accumulate more rapidly after shorter periods awake, while caffeine consumption may increase alertness even after extended wakefulness. Additionally, typing speed may differ between texting with friends and work-related emailing that requires greater cognitive effort. In fact, even during the periods associated with the highest average typing speed, there are still >40% typing sessions with individual typing speed z-scores below -0.1 (S8 Fig), reflecting meaningful variability that may be driven by these contextual factors. However, these factors were not measured and thus not accounted for in our study. Future studies could benefit from systematically examining these contextual influences. Second, the study sample was limited to young, healthy adults engaged in medical internships. Conducting additional research with diverse population groups will help to better determine the generalizability of this innovative tool. Third, due to device-wearing habits and the limited battery life, there was missingness in sleep data collection. To mitigate this issue, we restricted the time interval between the previous wake and the subsequent typing session to 24 hours or less. This approach helps prevent inaccurately prolonged wake periods linked with typing sessions due to unrecorded sleep episodes. Finally, this study did not take into account the time spent at work, which could be another factor contributing to mental fatigue. Future analyses, incorporating other SensorKit metrics such as location types, may provide deeper insight into this aspect.
In summary, our findings highlight the promise of using typing performance, particularly typing speed, as a novel and practical method for unobtrusive, ambulatory mental fatigue assessment in the real world. This approach, utilizing common smartphone technology, has the potential to provide valuable insights into cognitive alertness and fatigue and to offer a scalable low-cost, low-burden and privacy-preserving tool that can be embedded organically in everyday life. Future studies should aim to further validate and refine this approach across diverse populations and settings, as well as explore and evaluate personalized intervention strategies.
Supporting information
S1 FigSensorKit Keyboard Usage data collection.(DOCX)
S2 FigThe numbers of: typing sessions by hours awake (A), subjects by hours awake (B), typing sessions by typing speed (C), and typing sessions by rate of deletion (D) in the sample.(DOCX)
S3 FigAverage rate of deletion of two example subjects by hours awake.(DOCX)
S4 FigAverage typing speed (A) and average rate of deletions (B) by number of hours awake, limited to a maximum of 18 hours awake.(DOCX)
S5 FigAverage typing speed (A) and average rate of deletions (B) by number of hours awake, US English input mode only.(DOCX)
S6 FigAverage typing speed versus hours awake, by the type of wearable device recording sleep.(DOCX)
S7 FigAverage rate of deletion versus hours awake, by the type of wearable device recording sleep.(DOCX)
S8 FigProportion of typing sessions with low speed by hours awake in the sample.(DOCX)
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Ricci JA, Chee E, Lorandeau AL, Berger J. Fatigue in the U.S. workforce: prevalence and implications for lost productive work time. J Occup Environ Med. 2007;49(1):1–10. doi: 10.1097/01.jom.0000249782.60321.2a 17215708 · doi ↗ · pubmed ↗
- 2Mc Cormick F, Kadzielski J, Landrigan CP, Evans B, Herndon JH, Rubash HE. Surgeon fatigue: a prospective analysis of the incidence, risk, and intervals of predicted fatigue-related impairment in residents. Arch Surg. 2012;147(5):430–5. doi: 10.1001/archsurg.2012.84 22785637 · doi ↗ · pubmed ↗
- 3Basner M, Dinges DF. Maximizing sensitivity of the psychomotor vigilance test (PVT) to sleep loss. Sleep. 2011;34(5):581–91. doi: 10.1093/sleep/34.5.581 21532951 PMC 3079937 · doi ↗ · pubmed ↗
- 4Basner M, Mollicone D, Dinges DF. Validity and sensitivity of a brief psychomotor vigilance test (PVT-B) to total and partial sleep deprivation. Acta Astronaut. 2011;69(11–12):949–59. doi: 10.1016/j.actaastro.2011.07.015 22025811 PMC 3197786 · doi ↗ · pubmed ↗
- 5Pimenta A, Carneiro D, Novais P, Neves J. Monitoring mental fatigue through the analysis of keyboard and mouse interaction patterns. In: Lecture notes in computer science. Springer Berlin Heidelberg; 2013. 222–31. doi: 10.1007/978-3-642-40846-5_23 · doi ↗
- 6Pimenta A, Carneiro D, Novais P, Neves J. Analysis of human performance as a measure of mental fatigue. In: Lecture notes in computer science. Springer International Publishing; 2014. 389–401. doi: 10.1007/978-3-319-07617-1_35 · doi ↗
- 7Al-Libawy H, Al-Ataby A, Al-Nuaimy W, Al-Taee MA, Al-Jubouri Q. Fatigue detection method based on smartphone text entry performance metrics. In: 2016 9th International Conference on Developments in e Systems Engineering (De SE). 2016. 40–4. doi: 10.1109/dese.2016.9 · doi ↗
- 8Al-Libawy H, Al-Ataby A, Al-Nuaimy W, Al-Taee MA, Al-Taee AM. A fatigue prediction cognitive model for naturalistic typing environment. In: 2017 10th International Conference on Developments in e Systems Engineering (De SE). 2017. 227–31. doi: 10.1109/dese.2017.36 · doi ↗
