# Machine Learning-Based Detection of Cognitive Impairment from Eye-Tracking in Smooth Pursuit Tasks
## 2 Materials and Methods
### Data Analysis
#### 2.4.1 Data Preprocessing  
Eye-tracking data were recorded as two sequences of \((x,y)\) screen coordinates, one for each eye, and their corresponding timestamps \(t\), with a sampling rate of 90 Hz. The dot position on the screen was recorded as a separate time series of positions \((x,y)\) on the screen with its own timestamps \(t^{*}\) at a frequency of 60 Hz. To begin with, we removed events containing invalid gaze coordinates, which typically occur when the eye-tracker is unable to register the eyes, such as during blinks or when participants look away from the screen. We also excluded five participants due to the high prevalence of invalid gaze coordinates in their recordings. Specifically, ignoring gaps of less than 150 ms caused by blinking, we excluded the participants whose ratio of invalid samples to the total was greater than 10% for all three repetitions of a specific type of task. Finally, since dot and gaze positions are sampled according to different time grids, we undersampled gaze positions at 60 Hz. We also excluded an additional six participants with the incompleted recording that might be due to the unstable connection to the database at the time of recording. To gain clearer insights into the differences between the two groups (CI vs. HC), we transformed the raw data into features relevant to the medical domain. These features were as follows: ME (mean squared error between the dot and the gaze), ME of the gaze speed (computed with finite differences), ME when initializing smooth pursuit (first 0.7 s), gaze gain coefficient (computed as the amplitude at the oscillation frequency of the Fourier \begin{table}
\begin{tabular}{l c c c c c} \hline \hline  & **Healthy** & **Borderline** & **MCI** & **Possible AD** & **CI** \\ \hline N & 53 & 32 & 19 & 11 & 62 \\ \hline _Gender_ & & & & & \\ \hline Female & 40 & 24 & 12 & 9 & 45 \\ Male & 13 & 8 & 7 & 2 & 17 \\ \hline _Age_ & & & & & \\ \hline Median & 63 & 68.5 & 72 & 83 & 72 \\ Range & 48–83 & 60–87 & 43–91 & 72–94 & 43–94 \\ \hline _MMSE_ & & & & & \\ \hline Mean & 28.98 \(\pm\) 1.03 & 28.38 \(\pm\) 1.21 & 26.79 \(\pm\) 1.65 & 23.64 \(\pm\) 2.46 & 27.05 \(\pm\) 2.36 \\ \hline _ACE-R_ & & & & & \\ \hline Mean & 94.26 \(\pm\) 2.91 & 87.41 \(\pm\) 4.21 & 81.53 \(\pm\) 6.83 & 62.36 \(\pm\) 7.98 & 81.16 \(\pm\) 10.84 \\ \hline _GDS–15_ & & & & & \\ \hline Mean & 1.25 \(\pm\) 1.93 & 1.56 \(\pm\) 1.81 & 2.16 \(\pm\) 2.54 & 3.18 \(\pm\) 3.22 & 2.03 \(\pm\) 2.37 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Gender, age, and cognitive scores distribution per diagnosis/group. transformed data), range spanned by gaze, number of fixations [18], percentage of invalid samples, number of predictive saccades [18], and the average distance between the gaze position of the two eyes. Among these features, all of them besides the ME were filtered by their high p-values of a Mann-Whitney U test between healthy controls and cognitively impaired subjects. Thus, we decided to only include ME for further analyses. Following data cleaning, we computed the ME values as follows. Please note that this feature was calculated for each of the six tasks--one for each combination of stimulus speed (slow, medium, fast) and direction (horizontal, vertical); the same is true also for the other features above. \[\text{ME}= \begin{cases}\sum_{i}(x_{d}-x_{g})^{2},&\text{horizontal smooth pursuit}\\ \sum_{i}(y_{d}-y_{g})^{2},&\text{vertical smooth pursuit}\end{cases} , \tag{1}\]  
where \((x_{d},y_{d})\) are the dot positions, and \((x_{g},y_{g})\) are the gaze positions. Once the ME was computed for both eyes, the minimum value was kept as the final feature. The choice of only keeping the best performing eye was made due to the existence of a dominant eye. Moreover, due to calibration errors, one of the two eyes might have been recorded incorrectly, and choosing the minimum error helps alleviate this problem. Finally, since we had a value for each one of the three repetitions, we took the average over the repetitions.