# Using Keystroke Dynamics in a Multi-Agent System for User Guiding in Online Social Networks
## 3 System Description
#### Keystroke Dynamics Analyzer Agents  
In this section the two new agents that perform sentiment and stress analysis on keystroke dynamics data will be presented, and their design and implementation explained, with information about the training of the machine learning models used. Regarding the keystroke dynamics sentiment analyzer agent, it was trained using keystroke dynamics data from the keystroke dynamics Pesedia self-reported dataset mentioned in this section, and the sentiment labels in the dataset were used during the training of the ANN. The architecture of this neural network can be seen in Figure 2. The collected keystroke dynamics data contains information about the text typing patterns of users, which include text typing speed and character frequency. Text typing speed features included averaged latency for different features, which are listed in Table 1. For the case of character frequency features, the selected ones are the frequencies of pulsation for certain keys, which are listed in Table 1 as well. Several of the features selected are commonly used in keystroke dynamics analysis (e.g., the interval of time between releasing a key and pressing another, the interval for typing a key sequence, the interval between subsequent key presses, dwell time), and digraph and trigraph features apply these concepts to two-key and three-key sequences [13]. The selected typing speed features are the following:  
* Key press: Measures the average key press time of users or dwell time (the time a key is pressed), which is included for being able to detect variations on general key dwelling speed that might be caused by sentiment polarities or stress level variations. * Key release and press interval: Measures the average interval of time which takes a user to release a key and press another one. It serves the purpose of detecting variations of key input speed on a different action that the key press--in this case, the interval between releasing a key and pressing another, which denotes the time in which the user starts inputting different information after finishing one. * Key press and second press interval: Similar to the previous one, this time the average interval between two key presses is measured. This interval measures the time that the user uses from starting to input one piece of information to inputting another. * Key release and second release interval: Measures the average interval between two key releases, which represents the time that the user spends from some information being inputted to more getting input as well. * Key press related to digraphs: Since digraph features are timing characteristics for two-key sequences, this feature measures the key press timing related to sequences of two keys; that is, the average key press timing in the digraphs detected at the text, using a list of common digraphs for detecting them. This feature captures timing information which is associated with commonly typed digraphs, which might offer useful information in addition to the previously presented features. * Key release and press interval related to digraphs: The feature that measures average release and press interval for common digraphs. * Key press related to trigraphs: Average key press timing for common trigraphs. * Key release and press interval related to digraphs: Average release and press interval for common trigraphs. * Digraph typing: Averaged value of total time for inputting a digraph. * Trigraph typing: Analog to the previous feature but for the case of trigraphs. * General typing speed: The feature that represents average typing speed. The selected character frequency features do not describe or represent keystroke timing information, but instead aim to represent user behaviors such as corrections (delete, backspace) and moving between parts of the webpage (page up, page down, home, end, key up, key down, key left, key right), which might be affected by the sentiment polarity or stress levels.