| Literature DB >> 36033235 |
Vishal Kuvar1,2, Nathaniel Blanchard3, Alexander Colby2, Laura Allen1,2, Caitlin Mills1,2.
Abstract
Task-unrelated thought (TUT), commonly referred to as mind wandering, is a mental state where a person's attention moves away from the task-at-hand. This state is extremely common, yet not much is known about how to measure it, especially during dyadic interactions. We thus built a model to detect when a person experiences TUTs while talking to another person through a computer-mediated conversation, using their keystroke patterns. The best model was able to differentiate between task-unrelated thoughts and task-related thoughts with a kappa of 0.363, using features extracted from a 15 second window. We also present a feature analysis to provide additional insights into how various typing behaviors can be linked to our ongoing mental states.Entities:
Keywords: Affective computing; Keystrokes; Machine learning; Mind wandering; Task-unrelated thought
Year: 2022 PMID: 36033235 PMCID: PMC9390119 DOI: 10.1007/s11257-022-09340-z
Source DB: PubMed Journal: User Model User-adapt Interact ISSN: 0924-1868 Impact factor: 4.230
Fig. 1Window creation for TUT and TRT
Distribution of TUTs and TRTs for 15-s and 30-s windows
| TUT | TRT | |||
|---|---|---|---|---|
| Total | Mean (SD) | Total | Mean (SD) | |
| 15 s | 374 | 4.021 (2.545) | 1425 | 15.322 (7.284) |
| 30 s | 243 | 3.283 (1.675) | 608 | 8.216 (4.171) |
Description of extracted features
| Type | Feature name | Number of features | Feature description |
|---|---|---|---|
| Non-message features | Verbosity | 1 | The number of keystrokes in the window |
| Backspace Frequency | 1 | The number of times the backspace key was hit in the window | |
| Latency | 4 | The difference between two successive keystrokes in the window (min, max, mean, median) | |
| Pause | 5 | Number of pauses for each interval (0.25 s—0.75 s, 0.75 s—1.25 s, 1.25 s—1.75 s, 1.75 s—2.25 s, 2.25 s—2.75) | |
| Message features | Length of message | 1 | Length of the recreated message in the window |
| Number of words | 1 | Number of words in the recreated message (separated by the space key) | |
| Number of sentences | 1 | Number of sentences in the recreated message (separated by period, exclamation mark, question mark) | |
| Number of messages | 1 | Number of messages sent in the window (separated by enter key) | |
| Inter-word time | 1 | Mean time between consecutive words in the recreated message | |
| Inter-sentence time | 1 | Mean time between consecutive sentences in the recreated message | |
| Inter-message time | 1 | Mean time between consecutive messages in the recreated message | |
| Word length (keystrokes) | 4 | Number of keystrokes logged to type a word (min, max, mean, median) | |
| Word length (time) | 4 | Time taken to type a word (min, max, mean, median) | |
| Sentence length (keystrokes) | 4 | Number of keystrokes logged to type a sentence (min, max, mean, median) | |
| Sentence length (timestamp) | 4 | Time taken to type a sentence (min, max, mean, median) | |
| Sentence length (words) | 4 | Number of words logged to type a sentence (min, max, mean, median) |
Kappa values for the best models for 15-s and 30-s windows
| No SMOTE | SMOTE | |
|---|---|---|
| 15 s | 0.323 (0.326) | |
| 30 s | 0.304 (0.304) | 0.331 (0.296) |
Performance metrics for 15-s and 30-s windows trained with SMOTE
| Window size | Classifier | Accuracy | ROC-AUC | F1 (TUT) | F1 (TUT) chance | F1 (TRT) | MCC |
|---|---|---|---|---|---|---|---|
| 15 s | Random forest | 0.775 | 0.692 | 0.507 | 0.333 | 0.862 | 0.372 |
| 30 s | Random forest | 0.730 | 0.690 | 0.557 | 0.461 | 0.814 | 0.373 |
Confusion matrices for each window
| Predicted values | ||||
|---|---|---|---|---|
| Actual Values | TUT | TRT | Total | |
| 15 s | TUT (0.20) | 199 | 175 | 374 |
| TRT (0.79) | 210 | 1215 | 1425 | |
| Total | 409 | 1390 | 1799 | |
| 30 s | TUT (0.30) | 140 | 103 | 243 |
| TRT (0.69) | 119 | 489 | 608 | |
| Total | 259 | 592 | 851 | |
Fig. 2Kappa distribution values of 15 s model (left), 30 s model (right)
Fig. 3Distribution of kappa values against number of TUT reports
Feature groups
| Feature group | Features included |
|---|---|
| Latency | All four of the latency features |
| Pauses | All five of the pauses’ features |
| Count | Number of words, sentences, and messages in the reconstructed window |
| Inter-element | The average time between consecutive words, sentences, and messages in the reconstructed window |
| Message length | Verbosity, length of actual message |
| Word length | All eight features that were extracted for the word length |
| Sentence length | All twelve features that were extracted for the sentence length |
Results of models trained on one feature group and by removing one feature group
| Feature groups | Train with feature group | Train with all except feature group |
|---|---|---|
| Sentence length | 0.310 | 0.269 |
| Word length | 0.213 | 0.353 |
| Inter-element | 0.174 | 0.324 |
| Count | 0.148 | 0.336 |
| Length | 0.121 | 0.330 |
| Latency | 0.050 | 0.320 |
| Pauses | 0.018 | 0.338 |
| All features | 0.343 | – |
Results of models trained on one feature and by removing one feature
| Features | Trained on one feature by itself | Removed one feature from best model |
|---|---|---|
| Sentence length, num. words, minimum | 0.192 | 0.344 |
| Sentence length, keystrokes, minimum | 0.190 | 0.328 |
| Sentence length, timestamp, mean | 0.179 | 0.304 |
| Sentence length, timestamp, minimum | 0.178 | 0.334 |
| Word length, keystrokes, mean | 0.161 | 0.320 |
| Word length, keystrokes, minimum | 0.160 | 0.355 |
| Sentence length, timestamp, median | 0.158 | 0.319 |
| Sentence length, word, mean | 0.153 | 0.347 |
| Sentence length, word, median | 0.151 | 0.343 |
| Sentence length, timestamp, maximum | 0.148 | 0.324 |
| All features | 0.343 | – |
Fig. 4Kappa values based on the number of features selected
Feature descriptive table for TUT and TRT for the 15-s window
| Features | Task-related thought (N = 1425) | Task-unrelated thought (N = 374) | ||||
|---|---|---|---|---|---|---|
| Mean | SD | Mean | SD | |||
| Maximum word length (timestamp) | 8.67 | 6.29 | 10.6 | 11.2 | 0.135 | 0.144 |
| Maximum sentence length (keystroke) | 33.1 | 8.03 | 37.2 | 13.2 | 0.302 | |
| Maximum sentence length (timestamp) | 13.4 | 6.25 | 16.6 | 10.9 | 0.246 | |
| Length of message | 27.0 | 7.53 | 34.2 | 14.0 | 0.541 | |
| Maximum sentence length (word) | 5.01 | 1.34 | 5.83 | 2.52 | 0.339 | |
| Mean word length (timestamp) | 5.06 | 5.95 | 4.08 | 8.74 | 0.340 | 0.092 |
| Minimum latency | 2.81 | 6.01 | 0.577 | 2.42 | 0.338 | |
| Inter-word time | 0.516 | 0.248 | 0.524 | 0.309 | 0.806 | 0.023 |
| 0.75 s – 1.25 s pause | 1.19 | 0.488 | 1.82 | 3.42 | 0.341 | 0.092 |
| Maximum word length (keystroke) | 13.8 | 4.95 | 12.7 | 4.84 | 0.078 | 0.171 |
Confusion matrix for the model trained on human dataset and tested on chatbot dataset
| Predicted Values | ||||
|---|---|---|---|---|
| Actual Values | TUT | TRT | Total | |
| 15 s | TUT | 41 | 42 | 83 |
| TRT | 41 | 212 | 253 | |
| Total | 82 | 254 | 336 | |