Abstract
Background:
Efficient, non-invasive monitoring may provide a more accurate and comprehensive understanding of seizure frequency and the development of some comorbidities in people with epilepsy. Novel keyboard technology measuring digital keypress statistics has demonstrated its practical value for neurodegenerative diseases including Parkinson’s Disease and Dementia. Smartphones integrated into daily life may serve as a low-burden longitudinal monitoring system for patients with epilepsy.
Objective:
This study aimed to assess the feasibility of keyboard statistics as an objective measure of seizure frequency for patients with epilepsy, in addition to tracking differences between cognitively normal and cognitively impaired patients.
Methods:
Six adult patients admitted to the Epilepsy Monitoring Unit (EMU) at Mayo Clinic in Rochester, Minnesota were studied. The keyboard was installed on the patient’s smartphone. In the EMU, typing statistics were correlated to electroencephalogram (EEG) confirmed seizures. After discharge, participants continued using their keyboards and kept a seizure log. We also analyzed the key press/release times and usage of participants’ keyboards for adherence.
Results:
Keyboard sessions during and after seizures assessed for key press/release differences versus baseline showed no statistically significant difference (p >0.44). Using one-way ANOVA, cognitive impairment’s potential impact on keyboard statistics was explored in patients who had neuropsychological testing (N=3). Significant differences were found between patients with and without cognitive impairment (p<.001). No significant difference was noted between patients with mild intellectual disability and normal cognitive function. (p >0.55).
Keywords: Digital Health, Non-Invasive Monitoring, Cognitive Impairment, Comorbidities
1. Introduction
According to the World Health Organization, 50 million people suffer from epilepsy worldwide, and about 3 million live in the United States [1]. Seizures are usually monitored by a video electroencephalogram (EEG) with a series of electrodes on the scalp. However, there is a need for long term, non-invasive seizure monitoring that allows individuals to continue their daily lives without the limitations of being connected to an EEG. Currently, longitudinal seizure monitoring is often done with seizure logs kept by the patient or their caretaker. There are two major drawbacks of seizure logs; they rely on the compliance and diligence of the patient or witnesses to record each seizure, and they do not capture seizures that the patient or witnesses are unaware of. Research by Poochikian-Sarkissian and colleagues revealed that their participants with epilepsy only recognized 44.5% of complex partial seizures and generalized tonic clonic seizures [2]. Evidence from chronically implanted systems in patients with focal epilepsy revealed that around half of these patients had difficulty accurately logging their seizures [3,4]. While a patient may not remember a seizure that may be clear to a witnessing caregiver (such as a generalized tonic clonic seizure), caregivers have been found to give less accurate estimates of seizure frequency than patients [5].
With the limitations of seizure logs, non-invasive seizure monitoring aims to provide an objective record of seizure occurrence in a low burden way for patients. This is important for increasing the accessibility of seizure monitoring in areas without properly equipped medical facilities and could allow proper safety measures to be enacted with real time seizure detection in hopes to reduce seizure related injury or sudden death. In addition to seizure monitoring, people with epilepsy experience cognitive impairment, mood disorders, and other comorbidities which can also be challenging to monitor reliably via traditional intermittent office visits and patient descriptions [6].
Novel keyboard technology that records key pressing behaviors in digital and mechanical keyboards has recently been used as a form of medical monitoring. Currently, this technology has been able to capture the progression of several neurodegenerative diseases including the psychomotor decline of Parkinson’s disease and cognitive decline in Alzheimer’s disease [7]. Holmes and colleagues created a framework to monitor cognitive impairment with keystroke, language, and precision data from smartphone keyboards [8], and Acien and colleagues were able to track mental fatigue with keystroke statistics from mechanical keyboards [9]. Cognitive impairment and mental fatigue are comorbidities of epilepsy [6] that current evidence suggests may be monitored with keystroke statistics. This study sought to track some of these comorbidities in patients with epilepsy as well as assess if changes in keystroke dynamics could be detected surrounding epileptic events.
2. Methods & Materials
2.1. Participants
Six adult patients admitted to the Epilepsy Monitoring Unit (EMU) at Mayo Clinic, in Rochester, MN were recruited while going through long-term monitoring (LTM). Our inclusion criteria were patients with epilepsy who had not been seizure free for over a month and did not have only nocturnal seizures. Three of the six participants underwent comprehensive neuropsychological evaluation as part of their care at the clinic. Of these patients, one was cognitively normal, and two met DSM-5 diagnostic criteria for intellectual disability (1 mild, 1 moderate) [10].
2.2. Study Design
While patients were undergoing LTM in the EMU, we installed the NeuroQwerty keyboard software which was downloaded via App Store as an app, installed and set as default keyboard in the patient’s phone. We also taught the patients to return to the original keyboard if desired.—Data such as typing texts, emails, online searches, etc were recorded while the phone was used. Various data related to key pressing behavior was documented, but details such as online searches and social media activities were intentionally not recorded for privacy concerns. Amongst this data, the average press and release times (the difference in time between key press and release) for around 3,000 sessions (continuous usage of the keyboard) was collected. Patients used the keyboard while in the EMU and continued their use after being discharged. In the EMU, full scalp EEG with video monitoring was annotated by licensed EEG technicians and epileptologists for clinical and subclinical seizure activity. After leaving the EMU participants were requested to maintain a seizure log, which is a written tool to self-report seizures and their characteristics such as date, time, duration and whether it is generalized or not. Participants were requested to record seizures too the best of their ability while using the keyboard at home and to return logs via email at the end of the study. The total participation period was intended to last 90 days (approximately 3 months); however, the company providing the keyboard software ceased operations shortly after the study began. This resulted in shorter and varied data collection durations.
The NeuroQwerty keyboard app broke down the collected data into three categories; keystroke data (press and release times), language (text structure and word complexity), and precision (finger precision and backspace and autocorrect usage). Statistical analysis was performed comparing keyboard data for 15 minutes following seizures to baseline keyboard activity, and between participants stratified by neurocognitive testing. We were constantly collecting keyboard data while the patients were using their phone. Patients weren’t instructed to use the keyboard every certain amount of time, but whenever they normally used their phone. Patient phone usage often did not exceed 15 minutes after seizures as keyboard usage was inconsistent among participants. We did not have enough data to extend the analysis beyond 15 minutes.
3. Results
3.1. Keystroke Data During and Surrounding Seizures
The participants ranged in age from 20 to 50 (M=27, SD=11.6), five were female and one was male. Total use of the keyboard ranged from 6 to 24 days (M=15.5, SD=7.4). Time in the EMU while using the keyboard ranged from 1 to 8 days (M=4.3, SD=3.1). In the EMU only three participants had seizures. Electrographically captured seizures were subclinical, or aware and mildly dyscognitive clinical seizures. Analysis of press and release times on EMU seizures was only completed for two participants who collectively had 32 samples of keyboard usage during and within 15 minutes postictal of a seizure. The third participant who had a seizure in the EMU had no keyboard sessions before the seizure and only 11 sessions while in the EMU; therefore, their limited data was not analyzed for seizure effects.
A general linear model test of repeated measures was utilized to compare average press and release times at baseline and during or within 15 minutes after seizure offset in two patients, but no statistically significant results were found.
3.2. Cognitive Impairment and Keystroke Data
Three participants underwent neuropsychological evaluation as part of their medical care. Based on results from neuropsychological evaluation and the patient’s functional status, one was categorized as cognitively normal, and the other two participants met diagnostic criteria for mild intellectual disability and moderate intellectual disability. The remaining three who did not undergo evaluation are assumed to have normal cognitive functioning or potentially only mild cognitive symptoms that permit them to remain high functioning. The mean press and release times (in seconds) and standard deviation was calculated for each participant from their collected keyboard sessions (ranging from just over 200 samples to well over 1000). The participant diagnosed with moderate intellectual disability had a notably longer press and release times on average than all other participants (M=0.337, SD=0.722), and the participant with mild intellectual disability also had a longer average (M=0.109, SD=0.182) than most participants, but it was similar to one of the participants who had not undergone neuropsychological evaluation (M=.111, SD=0.180; see Table 2).
Table 2.
Participants’ neuropsychological status with comparison of press and release times mean and standard deviation.
| Participant | Neuropsychological Status | Mean | Standard Deviation | IQR | Median |
|---|---|---|---|---|---|
| D | No Testing | 0.0785 | 0.0450 | 0.02 | 0.07 |
| F | No Testing | 0.0799 | 0.0107 | 0 | 0.08 |
| B | Normal Cognitive Functioning | 0.0875 | 0.0245 | 0.01 | 0.09 |
| A | Mild Intellectual Disability | 0.109 | 0.182 | 0.02 | 0.09 |
| E | No Testing | 0.111 | 0.180 | 0.01 | 0.08 |
| C | Moderate Intellectual Disability | 0.337 | 0.722 | 0.035 | 0.11 |
Participants are listed in ascending order of mean press release times.
While on average, the participants with intellectual disability had longer press and release times than the individual with normal cognition, there was some variability in their responses, which included both frequent long press and release times in combination with average press and release times. The box and whisker plot in Figure 1 depicts all recorded key press samples from each participant. Over 95% of samples from each participant fell in a similar range,less than .15 seconds, except for participant C who had 77% of samples less than .15 seconds.
Fig. 1.

Box and whisker plot depicting all keystroke samples’ average press and release times (in seconds). Notations: *Mild Intellectual Disability, **Moderate Intellectual Disability
Lastly, a one-way ANOVA was completed to compare the effect of cognitive impairment on press and release times with the three participants who completed neuropsychological evaluations. The ANOVA revealed a statistically significant difference in press and release times between at least two groups (F(2, 1840) = [80.583], p<.001). Tukey’s HSD test of multiple comparisons revealed the mean press and release times were significantly different between the participants with moderate intellectual disability and mild intellectual disability (p<.001, 95% C.I. = [.1675, .2872]) and the participants with moderate intellectual disability and normal cognitive functioning (p<.001, 95% C.I. = [.2027, .2958]). However, no statistically significant difference was found between the patients with mild intellectual disability and normal cognitive functioning (p>.555).
As a pilot study with a small cohort, statistical power was quite limited. Given the number of participants, number of observations, and range observed in the data, we estimate we would be able to detect a mean difference of 2.9 seconds with a 5% chance of Type I (false positive) error and a 20% chance of a Type II error (false negative).
4. Discussion
This study was designed to evaluate minimally burdensome continuous assessments for participants. Besides installing the keyboard and maintaining a seizure log, other data was collected as part of routine standard of care in the EMU, including neuropsychological testing and recorded seizures. Therefore, not all our participants underwent testing or stayed long in the EMU. With the limited time frame of data collection and issues obtaining seizure logs, we had three patients with no seizures reported during their participation.
Statistically significant differences were found between key press and release times for the patient with moderate intellectual disability in comparison to the patients with mild intellectual disability and normal cognitive functioning. However, this was also the only patient to have a reported generalized tonic clonic (GTC) seizure and we were unable to obtain a seizure log during the at-home participation time frame. This raises the possibility that the prolonged press and release times were related to cognitive impairment, epileptic events, or other factors we could not control for.
No significant differences were found between average key press and release times at baseline and those occurring during or 15 minutes after a seizure. Participants might not have used their phones actively when approaching to a seizure and due to the lack of significant findings with EMU-confirmed seizures, and the fact that at-home seizure logs were returned by only half the participants, no analysis was completed on key press and release times surrounding seizures outside of the EMU. As a pilot study in a small cohort, we would not consider the lack of a significant result to be conclusive, and further investigation in a larger cohort, preferably with objective seizure monitoring at home, is worthwhile. Future direction for keyboard technology research for patients with epilepsy should further examine potential differences between key statistics surrounding seizures versus those at baseline across different timeframes with a larger cohort and more seizure data.
The scope of this study was limited by the company of the keyboard technology ceasing operations shortly after the study began. Therefore, the NeuroQwerty keyboard that was utilized in this study is no longer available; however, similar technology is available from other companies, and can be replicated by research laboratories using available software tools. Due to the study’s early termination, the participant sample size and data collection time frame was limited. Such a small sample size reduces the conclusions that could be drawn and the generalizability of results. Demographics of the recruited participants lacked equal distribution with most of our participants aged 20–25 (n=5) and female (n=5). A wide variety of data was collected including finger precision, autocorrect usage, and complexity of the message typed. However, only keystroke press and release data were assessed due to limited resources to support this pilot project.
5. Conclusion
As one of the first studies utilizing smartphone keyboard technology for patients with epilepsy, the analysis provides some evidence for the potential benefits of keyboard statistics in monitoring and revealing comorbidities of epilepsy. Further study is needed to determine if significant differences in keyboard statistics occurs during and surrounding epileptic events, and if patients use their smartphone keyboards enough to accurately capture more events, than those reported on a seizure log. This could still be quite beneficial for patients with epilepsy as numerous factors can affect cognitive functioning such as antiepileptic medications, surgeries, and continued seizures.
Table 1.
General linear model analysis of repeated measures for two participants’ keyboard sessions at baseline in comparison to keyboard sessions during and 15 minutes after a seizure.
| Source of Variation | SS | df | MS | F | P-value |
|---|---|---|---|---|---|
| Seizure State | 0.000 | 1 | 0.000 | 0.355 | 0.555 |
Table 3.
One-way ANOVA of average press and release times for participants who underwent neuropsychological testing.
| Source of Variation | SS | df | MS | F | P-value |
|---|---|---|---|---|---|
| Between Groups | 17.840 | 2 | 8.920 | 80.583 | <.001 |
| Within Groups | 203.673 | 1840 | .111 | ||
| Total | 221.513 | 1842 |
Highlights.
Statistically significant differences were found in the average press and release times in the One-Way ANOVA when comparing a patient with moderate intellectual disability to a normal cognitive functioning and mild intellectual disability patient. However, no statistically significant difference was found between the patient with mild intellectual disability and normal cognitive functioning.
While patients maintained their usage of the NeuroQwerty keyboard in place of their smartphone’s standard keyboard, sessions near seizures were occasionally lacking and no statistically significant differences were found between baseline sessions and keyboard sessions within 15 minutes following a clinically confirmed seizure.
Patients demonstrated good adherence to the keyboard technology with around 3000 keyboard sessions recorded across 6 patients over 92 days collectively.
This study suggests that applications of digital keyboard technology for identifying and monitoring cognitive impairment in people with epilepsy over long periods is feasible with minimal patient burden.
Further study is needed to assess the potential for this technology to assess other aspects of epilepsy.
Acknowledgements
The authors thank Sherry Klingerman, and Mikaela Kall.
Funding
This study was supported by the Epilepsy Foundation of America’s My Seizure Gauge grant, the Mayo Clinic Kern Center, the Mayo Clinic Clinical and Translation Science Center (NIH NCATS UL1 TR002377) and the National Institutes of Health (UG3 NS123066 to B.H.B.). J.C. was also partially supported by DARPA HR0011-20-2-0028 (to G.W.)
Footnotes
Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.
Ethical Approval and Consent to Participate
This study was approved by Mayo Clinic’s Institutional Review Board. Informed consent was obtained when participants were enrolled in the study. It was emphasized that the patients’ regular care at the clinic would not be impacted by their decision to participate or not.
Declaration of competing interests
The authors declare no known competing interests that would impact the information in this paper.
GAW is a named inventor for intellectual property developed at Mayo Clinic and licensed to Cadence Neuroscience and NeuroOne Inc. BHB has licensed intellectual property to Cadence Neuroscience and Seer Medical and has had consulting or speaking arrangements with Otsuka and Eisai Inc. Mayo Clinic has received research support and consulting fees from Cadence Neuroscience, UNEEG Medical, NeuroOne, Seer Medical, Neurelis, and Medtronic on behalf of GAW and/or BHB. The remaining authors declare no known competing interests that would impact the information in this paper.
References
- [1].Fiest KM, Sauro KM, Wiebe S, Patten SB, Kwon C-S, Dykeman J, et al. Prevalence and incidence of epilepsy: a systematic review and meta-analysis of international studies. Neurology 2017;88:296–303. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [2].Poochikian-Sarkissian S, Tai P, del Campo M, Andrade DM, Carlen PL, Valiante T, et al. Patient awareness of seizures as documented in the epilepsy monitoring unit. Canadian Journal of Neuroscience Nursing 2009;31:22–3. [PubMed] [Google Scholar]
- [3].Cui J, Balzekas I, Nurse E, Viana P, Gregg N, Karoly P, et al. Perceived seizure risk in epilepsy–Chronic electronic surveys with and without concurrent EEG. Epilepsia 2023. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [4].Cook MJ, O’Brien TJ, Berkovic SF, Murphy M, Morokoff A, Fabinyi G, et al. Prediction of seizure likelihood with a long-term, implanted seizure advisory system in patients with drug-resistant epilepsy: a first-in-man study. Lancet Neurol 2013;12:563–71. 10.1016/S1474-4422(13)70075-9. [DOI] [PubMed] [Google Scholar]
- [5].Glueckauf RL, Girvin JP, Braun JR, Bochen JL. Consistency of seizure frequency estimates across time, methods, and observers. Health Psychology 1990;9:427. [DOI] [PubMed] [Google Scholar]
- [6].Seidenberg M, Pulsipher DT, Hermann B. Association of epilepsy and comorbid conditions. Future Neurology 2009;4:663–8. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [7].Alfalahi H, Khandoker AH, Chowdhury N, Iakovakis D, Dias SB, Chaudhuri KR, et al. Diagnostic accuracy of keystroke dynamics as digital biomarkers for fine motor decline in neuropsychiatric disorders: a systematic review and meta-analysis. Scientific Reports 2022;12:7690. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [8].Holmes AA, Tripathi S, Katz E, Mondesire-Crump I, Mahajan R, Ritter A, et al. A novel framework to estimate cognitive impairment via finger interaction with digital devices. Brain Communications 2022;4:fcac194. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [9].Acien A, Morales A, Vera-Rodriguez R, Fierrez J, Mondesire-Crump I, Arroyo-Gallego T. Detection of Mental Fatigue in the General Population: Feasibility Study of Keystroke Dynamics as a Real-world Biomarker. JMIR Biomedical Engineering 2022;7:e41003. [DOI] [PMC free article] [PubMed] [Google Scholar]
- [10].American Psychiatric Association D, American Psychiatric Association. Diagnostic and statistical manual of mental disorders: DSM-5. vol. 5. American psychiatric association; Washington, DC; 2013. [Google Scholar]
