## 3 Materials and Methods
### The Mobile Interactive Coaching Agent  
The objective of the MICA is to help users improve their productivity and performance in reading and learning by better and more reliably focusing their attention. The underlying  
Figure 3: An illustration of the eye-tracking algorithm adopted (see text). Figure 2: A screenshot demonstrating the adopted eye gaze tracking approach. The images are flipped horizontally. The blue circle marks the estimated target of the gaze on the screen. rationale is that an intelligent and interactive graphical character (an IVA) capable of monitoring the user can be used as a pedagogical agent (PA) to increase learning motivation [32]. The role of the PA is supported by some cognitive and social theories that state that the user learns more deeply when the IVA on the screen displays human-like gesturing, movements, eye contact and facial expressions, in combination with just-in-time support or guidance to guide the user's attention to the key elements of the task [48, 49, 50]. For the purposes of this study, the MICA is content-agnostic and does not verify the actual level of understanding or memorization the user has of the content read. Further developments will consider the possibility of informing the MICA about the content that is administered to the user to improve the effectiveness of the coaching process. Figure 4 shows the structure of the MICA image processing section. The face recognition module available in TFTH, based on the user recognition approach described in [12], identifies the user, thus allowing for per-user settings and calibration. This approach is common in recent operating systems such as Microsoft Windows 10 and is generally well accepted. However, it can be replaced, if needed, by more conventional user identification modules, such as (_user_id_, _password_) credentials or fingerprint recognition. In [51], we showed how an interactive virtual agent capable of estimating the orientation of the user's face can infer a rough indication of their level of participation in the activity that is being carried out. Such an indication can, in turn, trigger a reaction of the agent, aiming at re-driving the user's focus on the activity at hand. The MICA combines the eye gaze with the face orientation to estimate the actual level of engagement and the focus of a user's attention. For example, while reading, the fixation point (i.e., the point in space that is being targeted by the combination of the two eyes) is supposed to be on the reading surface and is supposed to progress, on average, toward the end of the current page (not taking into account short, errant movements and saccades). Frequent and sensible deviations from this direction usually indicate some distraction or significant cognitive difficulties with the text in either understanding or remembering something. Instead, the comprehension of graphical content (figures, schemes, tables, etc.) usually requires different fixation patterns. For the sake of this research, the MICA adopts a content-agnostic mode. Therefore, the attention level is measured by detecting the _distraction events_, or the time intervals when the user's gaze focuses out of the screen area and estimating their durations. To avoid false alarms due to saccades and short, errant eye movements, only distraction events longer than a fixed heuristic threshold \(D_{T}\), experimentally set to 0.9 s, were considered (i.e., approximately four times the average fixation time for silent reading) [52]. When the sum of the duration of all distraction events detected during a reading interval (for example, a reading interval of 60 s) exceeds a given threshold \(T_{O}\), a _distraction warning_ (DW) is raised. The MICA can manage a DW using two different approaches, according to the individual settings and (possibly) available information regarding the content being administered to the user. The first approach is to provide immediate feedback  
Figure 4: The MICA face processing architecture. to the user, asking them to refocus on the task.