Patterns of smartphone typing performance by time awake in US training physicians: implications for unobtrusive ambulatory mental fatigue assessment

preprint OA: closed
📄 Open PDF Full text JSON View at publisher
Full text 47,857 characters · extracted from preprint-html · click to expand
Patterns of smartphone typing performance by time awake in US training physicians: implications for unobtrusive ambulatory mental fatigue assessment | medRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-P4HH5NV'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search Patterns of smartphone typing performance by time awake in US training physicians: implications for unobtrusive ambulatory mental fatigue assessment View ORCID Profile Yu Fang , Peter Yang , Elena Frank , Cathy Goldstein , Aidan G.C. Wright , Amy S.B. Bohnert , Vik Kheterpal , Srijan Sen , View ORCID Profile Zhenke Wu doi: https://doi.org/10.1101/2025.08.20.25334076 Yu Fang 1 Michigan Neuroscience Institute, University of Michigan Medical School , Ann Arbor, MI, USA MSE Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Yu Fang For correspondence: yfang{at}umich.edu Peter Yang 2 Department of Statistics, University of Michigan , Ann Arbor, MI, USA BS Find this author on Google Scholar Find this author on PubMed Search for this author on this site Elena Frank 1 Michigan Neuroscience Institute, University of Michigan Medical School , Ann Arbor, MI, USA PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site Cathy Goldstein 3 Department of Neurology, University of Michigan Medical School , Ann Arbor, MI, USA MD Find this author on Google Scholar Find this author on PubMed Search for this author on this site Aidan G.C. Wright 4 Department of Psychology, University of Michigan , Ann Arbor, MI, USA 5 Eisenberg Family Depression Center, University of Michigan , Ann Arbor, MI PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site Amy S.B. Bohnert 6 Department of Psychiatry, University of Michigan Medical School , Ann Arbor, MI, USA 7 Department of Anesthesiology, University of Michigan Medical School , Ann Arbor, MI, USA PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site Vik Kheterpal 8 CareEvolution , Ann Arbor, MI, USA MD Find this author on Google Scholar Find this author on PubMed Search for this author on this site Srijan Sen 1 Michigan Neuroscience Institute, University of Michigan Medical School , Ann Arbor, MI, USA 5 Eisenberg Family Depression Center, University of Michigan , Ann Arbor, MI 6 Department of Psychiatry, University of Michigan Medical School , Ann Arbor, MI, USA MD, PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site Zhenke Wu 9 Department of Biostatistics, University of Michigan , Ann Arbor, MI, USA PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Zhenke Wu Abstract Full Text Info/History Metrics Supplementary material Data/Code Preview PDF 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 Apple 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. Typing performance, especially typing speed, has a significant non-linear adjusted relationship with time awake. At the population-level, typing speed increases and peaks around 7.5 hours since awake and has a substantial decrease around 15.3 hours of time awake, highly consistent with classical lab-based active task Psychomotor Vigilance Test findings that showed increased response lapses beyond 15.8 hours of wake period. Our findings are relevant for developing a ubiquitous and unobtrusive tool to assess, monitor, and manage mental fatigue on a continuous basis in everyday life, especially for populations in high-risk and high-stake settings. 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 to complete. 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 fatigue detection tools cannot be used for real-time, continuous detection of mental fatigue 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 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 6 – 8 ) recorded by electroencephalography (EEG) is related to increase in typing time and typing errors. 9 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. 10 Based on these validations of using typing performance as an indicator of mental fatigue, 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. 11 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. Apple SensorKit (Apple Inc.) 12 , 13 is an innovative technological framework that allows researchers to passively collect data from various sensors on participants’ iPhones. Specifically, the keyboard sensor captures the configuration of the phone’s keyboard and monitors its usage pattern, such as typing speed and accuracy, without recording the actual content typed. 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 14 , the scalability of a passive iPhone based mental fatigue marker is immense. This study aims to utilize the data collection capabilities of the Apple keyboard sensor 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 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. Interns starting residency in 2023 were invited to participate via email 2 to 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 $50 if they already have a Fitbit, an Apple watch or a Garmin watch (Garmin Ltd., Olathe, KS). Interns received up to $80 additional compensation throughout the year for continued participation. iPhone users among the participants were offered enrollment in the Apple 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 15 . No additional incentives were provided for opting into the collection of SensorKit data. The institutional review board at the University of Michigan approved the study. Data collection Keyboard Sensor Data The keyboard usage and measurement of participants were collected through Apple’s SensorKit, a novel framework supported by Apple allowing researchers to obtain additional data collected from sensors of study participants’ iPhones. The SensorKit’s Keyboard Usage sensor 16 provides information about keyboard usage including typing duration (seconds, ‘ totalTypingDuration ’), typing speed (characters per second, ‘ typingSpeed ’), total taps (counts, ‘ totalTaps ’), and totalDeletes (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 ( Figure S1 ). The keyboard sensor data from the first two months (July and August, 2023) of intern year was 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 half-hour grid point ( t ). First, the average typing speed for subject s was calculated by: Second, the average typing accuracy, represented by the rate of deletions, 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 each half-hour grid point ( t ): and where μ (·) and σ (·) represent the mean and the standard deviation of all records of typing speeds or deletes rate over all time points for subject s , respectively. Sleep Measures Similar to validation tests for the PVT 17 , 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 18 , 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 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). 19 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 20 ; 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’ 21 and ‘glmtoolbox’ 22 . 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 (the sine and cosine of its radian format), 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. 23 , 24 When visualizing the smoothed relationship between time awake and typing performances, we included 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. 25 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 to 12 hours, 12 to 18 hours, and 18 to 24 hours. Each stratum was fit with model (4) respectively. Sensitivity Analyses First, 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’). Second, 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 4151 interns starting residency in July 2023 were invited and 1437 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 Figure 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 devices (not on the same days). 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 average of individual mean rate of deletion was 7.3% (SD = 3.0%). The average of individual median wake up time was at 06:23 am (SD = 108.7 minutes). Figure S2 shows the distributions of time awake, typing speed, and rate of deletion of the recorded typing sessions. Figure 2 illustrates an example of recorded sleep episodes and typing sessions of one random subject throughout 62 days. View this table: View inline View popup Download powerpoint Table 1. Sample characteristics (N = 366) Download figure Open in new tab Figure 1. Study sample flow chart Download figure Open in new tab Figure 2. 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 Figure 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 ( Figure S2A ) thus the error bars were wider for these times. View this table: View inline View popup Table 2. The relationship between time awake and typing speed. Left: unadjusted - model (1); Middle: adjusted - model (2); Right: adjusted with interactions - model (3). Download figure Open in new tab Figure 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 (B). There were different individual patterns of the change of typing speed over the course of time awake, as the two examples illustrated in Figure 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 ). Download figure Open in new tab Figure 4. 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 ( Figure 3B ). Figure S3 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 ). View this table: View inline View popup 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.( Figure 5 ) Download figure Open in new tab Figure 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: 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 ( Figure S4 ). 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 an Apple Watch, a Fitbit, or a 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 ( Figures S5, S6 ). 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.8×10 -4 , p = 0.59) or rate of deletion ( β = 3.2×10 -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.1×10 -5 , p = 0.24; β quadratic = 3.7×10 -6 , p = 0.27) or rate of deletion ( β linear = -6.0×10 -5 , p = 0.26; β quadratic = 2.2×10 -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. Using over 45,000 typing episodes assessed through Apple 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 17 , 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. 26 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 Figure 4 , individuals differ in the timing and shape of their typing speed peaks and troughs since time awake. Furthermore, given time since awakening from sleep, abnormality may be identified using the actual typing speed when compared with personal past trends. This raises interesting scientific questions and has important applied implications. For instance, 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). However, 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 rate of deletion, remained relatively stable with time awake and time of day. Thus, typing accuracy does not appear to be as sensitive a measure of mental fatigue but 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. 5 , 9 – 11 , 27 – 30 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 Apple SensorKit and wearable watches, 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 Apple 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 covariates, such as caffeine and nicotine intake, medication, medical history 31 , and motivation of typing, that were not measured thus not accounted for in the study. 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 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. Data Availability SensorKit data cannot be shared publicly because of Apple's data sharing restrictions. De-identified general study enrollment and survey data are available via the ICPSR repository ( https://www.openicpsr.org/openicpsr/project/129225/version/V1/view ) or from the corresponding author upon reasonable request and completion of a data use agreement with the University of Michigan. https://www.openicpsr.org/openicpsr/project/129225/version/V1/view References 1. ↵ Ricci , J. A. , Chee , E. , Lorandeau , A. L. & Berger , J. Fatigue in the U.S. workforce: prevalence and implications for lost productive work time . J. Occup. Environ. Med . 49 , 1 – 10 ( 2007 ). OpenUrl CrossRef PubMed Web of Science 2. ↵ McCormick , F. et al. Surgeon fatigue: a prospective analysis of the incidence, risk, and intervals of predicted fatigue-related impairment in residents . Arch. Surg . 147 , 430 – 435 ( 2012 ). OpenUrl CrossRef PubMed Web of Science 3. ↵ Basner , M. & Dinges , D. F. Maximizing sensitivity of the psychomotor vigilance test (PVT) to sleep loss . Sleep 34 , 581 – 591 ( 2011 ). OpenUrl CrossRef PubMed Web of Science 4. ↵ Basner , M. , Mollicone , D. & Dinges , D. F. Validity and sensitivity of a brief Psychomotor Vigilance Test (PVT-B) to total and partial sleep deprivation . Acta Astronaut . 69 , 949 – 959 ( 2011 ). OpenUrl CrossRef PubMed Web of Science 5. ↵ Pimenta , A. , Carneiro , D. , Novais , P. & Neves , J. Analysis of human performance as a measure of mental fatigue . in Lecture Notes in Computer Science 389–401 ( Springer International Publishing, Cham , 2014 ). 6. ↵ Lorist , M. M. & Jolij , J. Trial history effects in stroop task performance are independent of top-down control . PLoS One 7 , e39802 ( 2012 ). OpenUrl PubMed 7. Wascher , E. & Getzmann , S. Rapid mental fatigue amplifies age-related attentional deficits . J. Psychophysiol . 28 , 215 – 224 ( 2014 ). OpenUrl 8. ↵ Hopstaken , J. F. , van der Linden , D. , Bakker , A. B. & Kompier , M. A. J. A multifaceted investigation of the link between mental fatigue and task disengagement . Psychophysiology 52 , 305 – 315 ( 2015 ). OpenUrl CrossRef PubMed 9. ↵ de Jong , M. , Jolij , J. , Pimenta , A. & Lorist , M. M. Age modulates the effects of mental fatigue on typewriting . Front. Psychol . 9 , 1113 ( 2018 ). OpenUrl PubMed 10. ↵ Ross , M. K. et al. Naturalistic smartphone keyboard typing reflects processing speed and executive function . Brain Behav . 11 , e2363 ( 2021 ). OpenUrl PubMed 11. ↵ de Jong , M. , Bonvanie , A. M. , Jolij , J. & Lorist , M. M. Dynamics in typewriting performance reflect mental fatigue during real-life office work . PLoS One 15 , e0239984 ( 2020 ). OpenUrl PubMed 12. ↵ SensorKit . Apple Developer Documentation https://developer.apple.com/documentation/sensorkit . 13. ↵ Langholm , C. , Kowatsch , T. , Bucci , S. , Cipriani , A. & Torous , J. Exploring the potential of apple SensorKit and digital phenotyping data as new digital biomarkers for mental health research . Digit. Biomark . 7 , 104 – 114 ( 2023 ). OpenUrl PubMed 14. ↵ Singh , S. iPhone Users & Sales Statistics 2025 [Latest Data] . DemandSage https://www.demandsage.com/iphone-user-statistics/ ( 2025 ). 15. ↵ Funk , C. et al. Feasibility and acceptability of collecting passive phone usage and sensor data via Apple SensorKit . medRxiv 2025.02.06.25321806 ( 2025 ) doi: 10.1101/2025.02.06.25321806 . OpenUrl Abstract / FREE Full Text 16. ↵ SRSensorKeyboardMetrics . Apple Developer Documentation https://developer.apple.com/documentation/sensorkit/srsensorkeyboardmetrics?language=objc . 17. ↵ Van Dongen , H. P. A. , Maislin , G. , Mullington , J. M. & Dinges , D. F. The cumulative cost of additional wakefulness: dose-response effects on neurobehavioral functions and sleep physiology from chronic sleep restriction and total sleep deprivation . Sleep 26 , 117 – 126 ( 2003 ). OpenUrl CrossRef PubMed Web of Science 18. ↵ HealthKit . Apple Developer Documentation https://docs.developer.apple.com/documentation/healthkit . 19. ↵ The R Project for Statistical Computing . https://www.R-project.org/ . 20. ↵ Sullivan Pepe , M. & Anderson , G. L. A cautionary note on inference for marginal regression models with longitudinal data and general correlated response data . Commun. Stat. Simul. Comput . 23 , 939 – 951 ( 1994 ). OpenUrl 21. ↵ Højsgaard , S. , Halekoh , U. & Yan , J. The R Package geepack for Generalized Estimating Equations . J. Stat. Soft . 15 , 1 – 11 ( 2006 ). OpenUrl 22. ↵ Set of Tools to Data Analysis using Generalized Linear Models [R package glmtoolbox version 0.1.12] . ( 2024 ). 23. ↵ Vanegas , L. H. , Rondón , L. M. & Paula , G. A. Generalized Estimating Equations using the new R package glmtoolbox . R J . 15 , 105 – 133 ( 2023 ). OpenUrl CrossRef 24. ↵ Xu , J. , Zhang , J. & Fu , L. Variable selection in generalized estimating equations via empirical likelihood and Gaussian pseudo-likelihood . Commun. Stat. Simul. Comput . 48 , 1239 – 1250 ( 2019 ). OpenUrl 25. ↵ cosinor: Tools for Estimating and Predicting the Cosinor Model . Comprehensive R Archive Network (CRAN) https://CRAN.R-project.org/package=cosinor . 26. ↵ Borbély , A. A. , Daan , S. , Wirz-Justice , A. & Deboer , T. The two-process model of sleep regulation: a reappraisal . J Sleep Res 25 , 131 – 143 ( 2016 ). OpenUrl CrossRef PubMed 27. ↵ Al-Libawy , H. , Al-Ataby , A. , Al-Nuaimy , W. , Al-Taee , M. A. & Al-Jubouri , Q. Fatigue detection method based on smartphone text entry performance metrics . in 2016 9th International Conference on Developments in eSystems Engineering (DeSE) (IEEE , 2016 ). doi: 10.1109/dese.2016.9 . OpenUrl CrossRef 28. Salen , P. , Gould , P. , Ghattas , F. , Stoltzfus , J. & Stankewicz , H. 148 typing speed and accuracy as neurocognitive measures of emergency medicine resident physician fatigue . Ann. Emerg. Med . 78 , S60 – S61 ( 2021 ). OpenUrl 29. Pimenta , A. , Carneiro , D. , Novais , P. & Neves , J. Monitoring Mental Fatigue through the Analysis of Keyboard and Mouse Interaction Patterns . Hybrid Artificial Intelligent Systems 222–231 ( 2013 ). 30. ↵ Al-Libawy , H. , Al-Ataby , A. , Al-Nuaimy , W. , Al-Taee , M. A. & Al-Taee , A. M. A fatigue prediction cognitive model for naturalistic typing environment . in 2017 10th International Conference on Developments in eSystems Engineering (DeSE) (IEEE , 2017 ). doi: 10.1109/dese.2017.36 . OpenUrl CrossRef 31. ↵ Didikoglu , A. et al. Associations between light exposure and sleep timing and sleepiness while awake in a sample of UK adults in everyday life . Proceedings of the National Academy of Sciences 120 , e2301608120 ( 2023 ). OpenUrl CrossRef PubMed View the discussion thread. Back to top Previous Next Posted August 24, 2025. Download PDF Supplementary Material 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. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following Patterns of smartphone typing performance by time awake in US training physicians: implications for unobtrusive ambulatory mental fatigue assessment Message Subject (Your Name) has forwarded a page to you from medRxiv Message Body (Your Name) thought you would like to see this page from the medRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share Patterns of smartphone typing performance by time awake in US training physicians: 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 medRxiv 2025.08.20.25334076; doi: https://doi.org/10.1101/2025.08.20.25334076 Share This Article: Copy Citation Tools Patterns of smartphone typing performance by time awake in US training physicians: 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 medRxiv 2025.08.20.25334076; doi: https://doi.org/10.1101/2025.08.20.25334076 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 Psychiatry and Clinical Psychology Subject Areas All Articles Addiction Medicine (568) Allergy and Immunology (863) Anesthesia (300) Cardiovascular Medicine (4435) Dentistry and Oral Medicine (444) Dermatology (382) Emergency Medicine (608) Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1509) Epidemiology (15229) Forensic Medicine (30) Gastroenterology (1124) Genetic and Genomic Medicine (6600) Geriatric Medicine (668) Health Economics (997) Health Informatics (4536) Health Policy (1368) Health Systems and Quality Improvement (1613) Hematology (541) HIV/AIDS (1264) Infectious Diseases (except HIV/AIDS) (15916) Intensive Care and Critical Care Medicine (1103) Medical Education (623) Medical Ethics (146) Nephrology (667) Neurology (6599) Nursing (346) Nutrition (998) Obstetrics and Gynecology (1144) Occupational and Environmental Health (957) Oncology (3332) Ophthalmology (974) Orthopedics (369) Otolaryngology (420) Pain Medicine (436) Palliative Medicine (130) Pathology (663) Pediatrics (1693) Pharmacology and Therapeutics (691) Primary Care Research (711) Psychiatry and Clinical Psychology (5447) Public and Global Health (9232) Radiology and Imaging (2198) Rehabilitation Medicine and Physical Therapy (1370) Respiratory Medicine (1196) Rheumatology (593) Sexual and Reproductive Health (712) Sports Medicine (530) Surgery (712) Toxicology (99) Transplantation (289) Urology (265) (function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a00bd2c14857f047',t:'MTc3OTYyMDcwNQ=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00