Gaze-in-wild: A dataset for studying eye and head coordination in everyday activities

The study of gaze behavior has primarily been constrained to controlled environments in which the head is fixed. Consequently, little effort has been invested in the development of algorithms for the categorization of gaze events (e.g. fixations, pursuits, saccade, gaze shifts) while the head is free, and thus contributes to the velocity signals upon which classification algorithms typically operate. Our approach was to collect a novel, naturalistic, and multimodal dataset of eye + head movements when subjects performed everyday tasks while wearing a mobile eye tracker equipped with an inertial measurement unit and a 3D stereo camera. This Gaze-in-the-Wild dataset (GW) includes eye + head rotational velocities (deg/s), infrared eye images and scene imagery (RGB + D). A portion was labelled by coders into gaze motion events with a mutual agreement of 0.74 sample based Cohen’s κ. This labelled data was used to train and evaluate two machine learning algorithms, Random Forest and a Recurrent Neural Network model, for gaze event classification. Assessment involved the application of established and novel event based performance metrics. Classifiers achieve ~87% human performance in detecting fixations and saccades but fall short (50%) on detecting pursuit movements. Moreover, pursuit classification is far worse in the absence of head movement information. A subsequent analysis of feature significance in our best performing model revealed that classification can be done using only the magnitudes of eye and head movements, potentially removing the need for calibration between the head and eye tracking systems. The GW dataset, trained classifiers and evaluation metrics will be made publicly available with the intention of facilitating growth in the emerging area of head-free gaze event classification.

Human visual behavior can be viewed as a sequence of periods of stable visual input, punctuated by saccades to new locations within the visual environment. Although saccadic targeting during visual search may demonstrate an influence of visual salience 1 , the effect is overwhelmed in the presence of a task, when motor execution requires that attention be directed towards information-rich, task-relevant locations within the visual environment [2][3][4] . As a result, the dynamics of gaze coordination in natural contexts are affected by a variety of extra-retinal properties of the task, the agent, the environment, and by their interaction. These include the spatial distribution of information in the natural environment 5 , cognitive resources related to memory or higher order reasoning 6 , motor constraints that determine the dynamics of gaze shifts [7][8][9][10] , and biomechanical constraints that influence visual strategies for foot placement during locomotion 11 .
Despite the importance of extra-retinal influences upon gaze behavior during visually guided action, surprisingly little attention has been dedicated to the study of gaze behavior in more natural contexts. For instance, head movements are often suppressed through the use of a chin-rest, or by constraining target movement to only a small portion of the subject's visual field. Furthermore, target motion is often restricted to two dimensions, and sometimes viewed monocularly. In part, the study of strategies for coordination of the eyes, head, and body has been limited by a lack of suitable technology. Successful tracking of the coordination between the head and eyes in unconstrained settings requires advances in two parallel domains: the instrumentation to jointly monitor the direction of the eyes and head ("eye + head tracking"), and the algorithms to parse and categorize key oculomotor events in the rapid stream of data (i.e. "event detectors").
The present study aims to develop new event detectors for the study of eye and head coordination during natural behavior. This involves both the development of a custom eye + head tracker, and the capture of a novel dataset of head-free gaze behavior -the Gaze-In-Wild dataset (GW). GW was collected from 19 participants engaged in everyday activities using spatially and temporally calibrated equipment comprised of a hardhat with an inertial measurement unit (IMU), eye tracking glasses, and a stereo-based RGB-D (RGB imagery plus depth) sensor. A custom-made software tool which facilitates the efficient hand-labelling of the captured data was used to label a significant portion (approx. 2 hours and 15 minutes) of the GW dataset (see Section 3). We then use this labelled data for supervised training and assessment of automated event detectors.
This work builds upon a variety of techniques previously used to track head orientation during natural behavior. Published studies have demonstrated the use of rotational potentiometers and accelerometers 8 , magnetic coils 12 , or motion capture 13 for the sensing of head orientation 6 . Perhaps the highest precision eye + head tracker which allowed body movement leveraged a 5.8 m 3 custom-made armature capable of generating a pulsing magnetic field. The subject was outfitted with a head-worn receiver capable of measuring head position and orientation within its operational region 14 . Despite the high accuracy, this solution, and all solutions involving optical motion-capture are limited in that they constrain the user to a predefined capture volume. Several systems have adopted video based head motion estimation using egocentric video 10,15 and demonstrated promising results, but are too computationally expensive for real-time use, and are prone to irrecoverable track loss especially during periods of rapid head movement, occlusion of tracking features or degradation of image quality due to motion blur. Recent approaches have involved the use of head-mounted IMUs. For example, Larsson et al. used a head-mounted IMU in a study where subjects were asked to perform visual tracking tasks when watching pre-rendered stimuli projected onto a 2D screen 16 . They established that compensating for head movements results in a reduced standard deviation for the eye position signal. More recently, Tomasi et al. used two IMUs for tracking eye and head orientation relative to heading direction 17 and reported a 7.1° average angular error (σ = 5.2°). However, estimates of orientation using IMU will accrue error over time. Although solutions which fuse IMU pose estimates with head tracking based on egocentric video are promising, they have not yet been adopted in the context of eye tracking, and to do so is beyond the scope of the current work.
This work also builds upon a long history of methodologies for the automated detection of gaze events within an eye tracking signal. The simplest methods use threshold based filters and numerous descriptive features for classification 18 . Threshold based techniques require parameter tuning for each test scenario as well as being sensitive to noise and sample rate. A better solution is to use machine learning to learn a model for classifying gaze events. These algorithms have been shown to work well when the head is fixed. Pekkanen et al. proposed the Naive Segmented Linear Regression (NSLR) model 19 which segments a time sequence into distinguishable events which are then classified using continuous Hidden Markov Models (HMM). While earlier work used hand-crafted features 20 , more recent methods have employed recurrent neural networks (RNN) 21 which enable algorithms to directly learn what features are relevant to the task.

Classification Scheme and Nomenclature
Gaze classification requires distinct and separable classes that are identifiable in our daily activities. There has been some disagreement in the research community about the specific criteria for establishing a taxonomy of gaze events 22,23 . For example, one approach is to classify events based upon specific oculomotor movements, such as the two major retinal image stabilizing mechanisms: the vestibular-ocular response (VOR), and the opto-kinetic response (OKR). In VOR, the semicircular canals of the inner ear measure head rotation acceleration which results in eye movements in the opposite direction with near unity gain (i.e., the ratio of eye and head velocity is ~1, see Fig. 1). OKR is generated by retinal motion which in turn leads to compensatory eye movements to reduce retinal blur 8,[24][25][26] . It is difficult to derive a classification scheme based solely on these stabilizing mechanisms, because they may be used in isolation, or in combination, for either fixation of a target that is stationary in the exocentric frame, or pursuit of a moving target.
Our approach is to adopt an exocentric classification scheme and to discuss its applicability in classifying a broad range of coordinated head and eye movements. We define movement categories by the functional role of the eye movement, as well as the motion of an object within an exocentric frame of reference. As a result, events in our dataset is classified as follows: 1. Gaze fixation (GF) -Gaze fixation may be brought about through stabilization of the eyes and head, or during movements of the eyes and head that are compensatory and, as a result, produce a stable gaze vector on a stationary object in the world coordinate frame. Stabilized retinal image motion lies near to the range of 0.5 to 5°/s, a limit above which the target image starts to blur 24 . Hence, a wide range of miniature head compensated eye movements can be termed as gaze fixation. In our taxonomy, gaze fixations may be further categorized as: • Tremors -The resting eye and head rarely display perfect stability. Skavenski et al. identified that despite instructing subjects to remain as stationary as possible, tremor was observed in the head and eyes (<1°/s, 10 Hz) 27 . Furthermore, the characteristics of tremor is known to vary based on the nature of the instrumentation 28 and type of restraint 27 . • Drift -Drifts are slow motions of the eye that are often punctuated by microsaccades and aid in maintaining crisp visual features across the retina. While there is some disagreement on the range of drift motion, they usually display amplitudes within 0.25° and velocities less than 0.5°/s when the head is fixed 28 . • Microsaccades -Small, rapid eye movements that occur in between fixations are termed as microsaccades and usually last about 25 ms with a velocity range capped at 50°/s 28 .
• Fixation by rotational vestibular-ocular reflex (rVOR) -When the subject and target are stationary in the world reference frame, rotational motion of the head is compensated using rVOR. Fixations are maintained by the VOR system because it has a significantly lower response lag as compared to OKR 24 . Generally, a rVOR event displays near unity gain unless it is modulated due to other compensatory mechanisms such as OKR or pursuit. • Fixation by translational vestibular-ocular reflex (tVOR) -When a target is stationary in the world reference frame, image stability at the fovea during self motion or passive displacements is achieved by tVOR 29 . Unlike rVOR, wherein a counter rotation of the eye in head rotation can stabilize the entire retinal image, tVOR cannot accommodate for the entire visual field due to the large range of optic-flow motion experienced at different depth planes. Primarily a foveal image adjustment mechanism, it follows that properties of tVOR motion depend on the gaze direction and can be difficult to differentiate with pursuit movements 30 . OKR augments VOR to help maintain a stable image over stationary targets. Fixations are maintained by a combination of gain modulation and optokinetic stimulation 24,26,29,31 . While microsaccades may be triggered for retinal image adjustment, larger saccades during fixations signify shifts in attention or an inability of gain adjustment to compensate for motion such as observed during nystagmus. These visually driven eye movements work in synergy with tVOR 30 making them difficult to observe in everyday activities as opposed to controlled experiments which are designed to isolate their behavior.
2. Gaze pursuit (GP) -Also known as smooth pursuit movements 32 , gaze pursuit is the visual tracking of an object that is moving through the world frame using the eyes or a combination of the eyes and head by augmenting over our compensatory systems 24 . Gaze pursuit is often interrupted by catch-up saccades in compensation of retinal error 7 . While it is somewhat trivial to identify GP events using visual imagery, it may become difficult to differentiate them with GF (for more information refer to Supplementary Fig. 1). 3. Gaze shift (S) -A rapid shift of gaze to a new location in the world (i.e. a saccade) using the eye or eye and head in combination.
To illustrate our nomenclature, consider a situation where a person under fore-aft motion attempts to pursue a moving target. In situations such as these, the effects of stepping are compensated using VOR in the elevation direction. Relative distance and gaze angle modulates the tVOR to maintain target image at the fovea. The moving target's retinal image motion elicits a pursuit signal punctuated by predicative saccades. The pursuit motion augments over translational VOR by modulating its gain. If the eye and head pursuit movement can be distinctly identified in their velocity traces, we would consider such an event as a gaze pursuit. However, a distant or slow moving target may induce a small pursuit signal which may not be easily identifiable over opto-kinetic stabilization of the retinal image. In these situations, we would consider the event as a gaze fixation. Note that the exocentric nomenclature enables us to define multiple concurrent coordinate systems and thus requires that we specify the reference system under analysis. In this work, the reference system is chosen during the calibration process (described in section 2.2).

The Gaze-in-Wild Dataset
The aim of this work is to generate a dataset that captures complex ocular-motor strategies during natural tasks (see Fig. 2). We recruited 19 participants (7 female, age μ = 28, σ = 12.52). Informed consent was obtained from all participants prior to hardware setup to anonymously share all data recorded from them. Identifiable people in this manuscript consent to publicly share their information as presented. All methods were carried out in accordance with relevant guidelines and regulations as approved by the Institutional Review Board at Rochester Institute of Technology, FWA-00000731. Participants were tasked with performing up to four activities while wearing an eye tracker, a hardhat instrumented with sensors, and a backpack with a laptop computer (see Fig. 3). Since task demands and interpretation have been known to guide eye movements 2 , care was taken to ensure all participants received a standard set of instruction read aloud by the experimenter. Subjects were instructed to stand 1 to 2 meters away from a calibration chart within a predefined rectangular area. Once a participant was within the calibration region and facing the chart, they performed two calibration routines. After calibration was complete, participants proceeded to complete the given task. Table 1 in the Supplementary lists the calibration accuracy, tasks recorded, and the labelling status of each observer. Tasks were selected to create a wide range of head and eye poses as seen in Fig. 4. Upon completion of a task, participants returned to the calibration area to prepare for the next task. The following tasks were chosen: • Indoor navigation: Subjects were instructed to walk around an indoor corridor loop twice. Indoor navigation was chosen to elicit coordinated eye and head movements that occur naturally during walking. We observed various gaze shifts to objects such as text on posters, signboards, people walking by etc. As expected, subjects made very few to no gaze shifts towards the ground due to lack of terrain complexity 11 and very little attention demands 6 for foot placement accuracy 33 . While some of the subjects were familiar with the indoor  www.nature.com/scientificreports www.nature.com/scientificreports/ corridor layout, we did not observe any noticeable difference in their behavior compared to subjects unfamiliar with the environment.
• Ball catching: The purpose of this task was to induce gaze pursuit behavior by asking participants to play catch with the experimenter. The experimenter would change throwing strategies in the middle of the task by either bouncing the ball on the floor, passing the ball to another experimenter or rolling the ball on the ground towards the participant. The subjects tracked the ball as a series of gaze fixations and predictive catch-up/look-ahead saccades and occasionally pursued the ball during a specific period of the ball trajectory. • Object search without prior subject-object interaction: Subjects were tasked to locate and count as many objects with geometrical shapes (such as triangles, rectangles etc.) as they could find in a predetermined closed circuit corridor. This task was chosen to elicit visual search behavior in a head-free setting without biasing a subject with a particular object or shape. • Tea making: As a validation for the classic tea making paradigm 34 , we instructed subjects to go to the kitchen and make themselves a cup of tea. For this task, due to the close proximity of objects, relevant information sometimes fell outside the field of view.

Hardware setup and error categorization.
To collect naturalistic data, we instrumented participants with an MPU-6050 6-axis Inertial Measurement Unit (IMU) mounted under a hardhat, an ATMega Arduino attached behind the hardhat, a 120 Hz binocular Pupil Labs eye tracking glasses (ETG) 35 and a ZED stereo camera (see Fig. 3). To ensure its applicability in a wide variety of domains, the Gaze-in-Wild dataset provides easy access to depth of the real world stimulus calibrated from the person's FoV. Contrary to a two IMU system 17 , we chose a single IMU system to avoid using a body worn device since many applications of eye tracking are predominately head-mounted. The hardware setup weighed 700 gms (excluding laptop weight), which is similar to previous setups 8 . To reduce slippage, the hardhat was equipped with an adjustable knob to tighten its hold on a subject's head.
Pupil labs eye tracking glasses (ETG). Binocular eye trackers usually contain two eye cameras and a single world camera (which captures the scene in front of a person). Eye tracking solutions require some form of eye feature (derived from images captured from the eye camera) to Point of Regard (PoR -pixel position on the world camera) mapping to provide an accurate gaze estimate. This process is also known as eye tracker calibration. Mapping functions often vary from polynomial regression to multi-layer perceptron regression. Despite calibration, angular error tends to remain low near to the calibration region and increases radially outwards. Furthermore, there exist many sources of error which degrade the quality of gaze tracking 35 , particularly in unrestrained settings. The Pupil Labs eye tracker estimates the approximate center of eye ball rotation and a 3D pose of the pupil (modeled as a 3D disc). This enables the extraction of 3D gaze vectors with respect to the Eye-In-Head (EiH) coordinate  Note that head distribution peaks occur at 90°/s intervals.
system C E . The Pupil Labs software (version number 1.8.26) also provides a confidence value for each gaze sample which can be interpreted as a reliability measure. It is calculated as a ratio of the number of support pixels to the number of pixels on the ellipse fit of an imaged pupil. Support pixels are the edge points within a threshold distance away from the pupil ellipse fit. All gaze samples with confidence below 0.3 were discarded from analysis.
Inertial measurement unit (IMU). The MPU-6050 is a low cost 6-axis IMU that integrates a 3-axis accelerometer and a 3-axis gyroscope to estimate its pose relative to its initial position at the onset of data acquisition. The IMU is connected to an Arduino placed behind the hardhat, which in turn, is connected to the laptop backpack. The Digital Motion Processor inside the IMU provides its pose estimate at 100 Hz. The I 2 Cdevlib open source library was used to extract information from the IMU 36 . Pose estimates using an IMU sensor are known to drift due to error accumulation making it necessary to offset the IMU regularly to avoid drift in orientation measurements. Calibrating the IMU's offset at the beginning of data collection and fine tuning during post processing ensures accurate head pose within 7° (σ = 8.34°) of error for short recordings. Longer recordings may incur significant error in pose estimates unless externally corrected or reduced using a secondary sensor. Frequent head turns may also lead to an increase in head pose error so it is a good practice to reset the IMU following a few head turns 17 . While we do not hinder participants mid task, pose estimates for certain recordings (marked with γ in Supplementary Table 1) were manually corrected by a rotation operation before and after each heading change during post processing. Head angular drift and deviation in orientation are measured for all participants by the difference in head pose at the beginning and end of a task. We evaluated the sensor drift to be 0.021°/s (σ = 0.035) on average. Per participant drift can be found in Supplementary Table 1.
ZED Stereo camera. The ZED stereo camera provides a 1080p point cloud at 30 Hz which is calibrated and mapped onto the ETG coordinate system C E from its own coordinate system C Z . We found the error in depth measurement to be proportional to the distance under consideration. The euclidean 3D error was found to be less than 0.5 m at a distance of ~10 m (beyond that is considered to be infinity), which is in agreement with other independent analysis 37 .
System calibration. All measurements in the GW setup are reported in reference to a modified checker chart which is fixed in the world coordinate system (see Fig. 5). Prior to data collection, we instructed the participants to perform two calibration routines before each task. Routine 1 -This is the native offline calibration routine offered by Pupil Labs version 1.8.26 (i.e. calibration using natural features) following 3D pupil detection and gaze mapping. This routine required that subjects looked sequentially at red calibration targets placed in alternating boxes on the modified checkerboard chart.
Routine 2 -In the second routine, participants were asked to maintain a comfortable head pose while fixating on one of the calibration targets. They were then asked to move their heads horizontally or vertically while maintaining fixation at that point, thus inducing a vestibular ocular response. This routine performed a system calibration by aligning all hardware components to a common world coordinate system.  10:2539 | https://doi.org/10.1038/s41598-020-59251-5 www.nature.com/scientificreports www.nature.com/scientificreports/ Pupil labs eye tracker calibration. The angular error between the gaze POR and the location of the red calibration target within the world camera imagery is presented in Fig. 6. This measure reflects where P x and P c are the homogeneous coordinates of the red calibration target and gaze PoR. k e is the intrinsic matrix of the ETG world camera. We evaluated the calibration accuracy to be within 1° of error within 10° from the center of the calibration pattern. Individual participant eye tracker calibration error can be found in Supplementary  Table 1. The ETG eye camera has manual focus lenses which were readjusted for every participant to ensure sharp visual features.
Temporal alignment. Each individual component of our system has a fixed temporal offset from each other. This temporal offset is removed using normalized cross-correlation of the angular velocity traces between the IMU, ETG and the ZED stereo camera. Since the ZED camera utilizes visual odometry to derive a pose estimate, it is not uncommon to observe a poor pose estimate during the VOR calibration routine. In those situations, we tracked the checkerboard corners in the ZED and ETG world camera to derive a velocity estimate for each corner point. In the absence of ZED pose information, these velocity estimates were used to compute the offset between ETG and ZED using cross-correlation as described in the next section. It should be noted that there exists an inherent latency between head and eye movements during a VOR 38 . However, we remove all latency while correcting for temporal offsets (including biological latency).
ETG-IMU calibration. Initially, the IMU and ETG are defined in their own respective coordinate systems, C H and C E . When participants were fixated at a point on the calibration chart during Routine 2, their eye and head pose was defined as the Z axis of our new world coordinate system C W using rotation operations. The IMU is placed approximately 1-2 cm above the cyclopean gaze origin (an imaginary point midway on the line joining both eye centers). Instead of correcting for translation offset (which can vary by subject), we choose to align C H and C E to C W solely using rotation matrices R H W and R E W . These matrices were initially derived using vector rotations and manually fine tuned until the coordinate systems were satisfactorily aligned (Gaze-in-World (GiW) velocity, i.e., the head compensated cyclopean eye velocity is minimized). Once the head and eye orientation are defined in C W , we rotate the EiH vector using the updated head pose to obtain the GiW vector.
ETG-ZED calibration. Calibrating the ETG and ZED is required to register the depth point cloud from ZED's coordinate system C Z to the ETG scene camera C E , to obtain calibrated depth values of the visual field. The visual field is defined from the center of the world camera, hence we choose to superimpose the depth map onto the world imagery. Since the distance between each checkerboard corner point is known, we can produce a grid of corner points in world units (mm) defined in the checkerboard coordinate system C O . This grid can be aligned and projected on C E and C Z using extrinsic parameters (R, T). Corner points extracted from time synced ETG world and ZED left camera images were used to find R and T. The extracted image points and the checkerboard grid are related using Here, X O is the 3D checkerboard grid defined in C O . k Z and k E are the left ZED and world camera intrinsic matrices. For detailed information regarding this process, we refer the reader to single camera calibration, part 1, multiview geometry by Hartley et al. 39 . The transformations required to align C Z to C E can be derived as , which are used to transform the depth point cloud from C Z to C E . Once we have an aligned depth map, we trace a ray from the ETG world camera center to a subject's PoR and intersect it with the transformed point cloud to derive a 3D PoR in mm. www.nature.com/scientificreports www.nature.com/scientificreports/ Operations. All absolute angular velocity measurements (i.e. magnitudes) are calculated using a modified Two-Point Central Difference algorithm (2-P) 40 . The angular velocity ω v can be derived as δθ/δt, where δθ is given by Here, v n is a normalized unit direction vector while t n is the timing associated with sample n. δθ is the angular displacement within the elapsed time. For a fixed sampling rate f s , Pupil tracking is usually performed in the near infrared because the human iris, regardless of color in the visible spectrum, reflects well in the near infrared. This ensures adequate contrast between the iris and the pupil, which is dark when illuminated off axis. However, noise may be introduced while tracking the pupil due to many external and internal factors such as varying illumination conditions, algorithmic artifacts, lack of contrasting eye features, occluded pupils etc. These artifacts may result in high frequency noise in the pupil positional signal. Consequentially, several steps were taken to filter the gaze signal. Since the eye was imaged with a sampling frequency of f s , frequencies higher than the Nyquist frequency (f n = f s /2) were aliased into our signal as noise. To avoid aliasing, we introduced a low pass filter to suppress all frequencies higher than f n (Kaiser window, cut-off: 58 ± 2 Hz), a limit well beyond that where typical saccades exhibit significant power 41 . Furthermore, the 2-P central difference algorithm results in gain suppression near f n without exhibiting phase shifts as opposed to other non-symmetric techniques wherein signal delay is not constant. Phase offsets due to anti-aliasing filters were removed by performing Zero-Phase filtering 42 . To further reduce noise, we utilized Bilateral filtering 43 since it provides an optimal trade-off between noise removal while maintaining characteristics of eye movements (such as preserving peak saccade velocity). Non-adaptive techniques such as Gaussian filtering suppressed saccade velocity peaks while increasing their duration and potentially produce misleading characteristics which could lead to misinterpretation of eye movements. The optimal parameters for bilateral filtering were empirically derived (window length 50 ms, σ t = 18 ms, σ r = 8.75°/s). The azimuthal and elevation velocity components are calculated using small angle approximations because of numerical stability during quadrant changes. That is, ω Az = δθ Az /δt. δθ Az is approximated as sin δθ Az . Small angle approximation results in 1 % error in measurement at 14°. Assuming a maximum human angular velocity of 900°/s, the upper limit for human angular displacement cannot exceed ~8° within a sample at our sampling rate of 120 Hz, which is within 1% measurement error.

Labelling
Training and evaluating a gaze event classification model requires labelling our dataset which is one of the major contributions of this work. The GW dataset was hand-labelled by five annotators who were trained to identify head-free gaze events. They produced over 140 minutes of hand-labelled head-free gaze behavior data. The dataset contains approximately 19,000 detected fixation events, 18,000 saccades, 1,300 pursuit events, and 3,500 blinks. Using a custom labelling tool (see Fig. 7), labellers had access to eye images, scene images with PoR cross-hair, and the individual head and eye velocity traces. Using our tool, one minute of recorded data requires 45-60 minutes of annotator time. While it is possible to develop tools that allow faster labelling 44 , they may bias the labeller with automated suggestive labels. Each labeller made decisions independently and they were encouraged to leave sequences where they were uncertain of the classification untouched. These sequences, along with low confidence samples (confidence below 0.3, see section 2.1.1), were treated as unlabelled and were not used to compute statistics or to train/evaluate models. While we do observe saccades as low as 15°/s, we do not label microsaccades www.nature.com/scientificreports www.nature.com/scientificreports/ or post saccadic oscillations due to system accuracy limitations (head compensated gaze tremor was found to be μ = 0.55°/s, σ = 0.32°/s). To provide maximum flexibility to researchers, we labelled stable fixations (caused due to tremors, drift and micro-saccades) and rVOR as a single gaze event type, stationary fixation, while labelled fixations due to tVOR and optokinetic stimulation as another gaze motion category, fixation under translation (labellers used gaze following as a pseudonym). This enables researchers to isolate the influence of compensatory mechanisms using a variety of statistical methods.
Cohen's Kappa κ is a measure of the overall agreement between two raters classifying items into a given set of categories 45 . For a given gaze event category, precision p is the fraction of accurately detected samples over all retrieved samples while recall r is the fraction of accurately detected samples over all relevant samples in the groundtruth. These measures, along with the F 1 score (the harmonic mean of p and r) are applied by iteratively calculating agreement between each labeller and the rest of the group, and then reporting the average value. Note that the described iterative strategy results in p and r holding the same value. The average overall value of Cohen's Kappa κ was κ  of 0.74 (σ = 0.03, median = 0.74), and Cohen's Kappa is reported for each event type in Tables 1-3. Previous studies have shown that human coders exhibit a performance above 0.85 κ  while classifying head fixed eye movements, with a very low inter-rater variance 46 . While we have not managed to replicate such a high level of agreement, we can offer insights as to why. First, head-free gaze behavior is significantly more complex with a wide range of behaviors to be classified into the previously mentioned labelling scheme in Section 1.1. For instance, consider classification of head-free gaze behavior while attempting to catch a ball into periods of gaze fixations, saccades and pursuit. Subjects engaged in head-free gaze pursuit for a very small portion of the ball trajectory, primarily relying on a series of fixations and predictive saccades to track the moving ball. This distinction is not straightforward and can easily be overlooked during labelling. Secondly, relying on a single source of information such as visual imagery or gaze signals could lead to incorrect coding (see Supplementary Fig. 1). Signal filtering and interpolation produces artifacts which may be interpreted differently by each rater 47 . Despite the fact that we have provided multiple sources of information, it is not uncommon for a human labeller to make erroneous decisions. Lastly, while it is accepted that human coders may change their labelling strategy over time 46 and the start and end times of coded events may vary, lack of holistic task awareness could result in data misinterpretation.   Table 2. Inter-labeller event based metrics. All metrics are reported by their mean σ and inter-subject standard deviation σ. l 2 distance of the start and end time (expressed in ms) of matched events using ELC. O r is the overlap ratio between matched events using ELC. F 1 score as proposed by Hooge et al. 46 . Event κ proposed by Zemblys et al. 21 . Event κ* found using ELC event matching. For more information on each metric, please refer to Section 4.

Matching technique
Timing offsets  www.nature.com/scientificreports www.nature.com/scientificreports/ Training labellers. Our labelling team was trained using lectures on eye movements, gaze interpretation and eye-head coordination from the literature to thoroughly understand the labelling nomenclature used in GW. They were then asked to label a common, very small subset of the dataset that was then analyzed and discussed as a group with the authors. The labellers began manually annotating the GW dataset following this group exercise. Individual weekly meetings with the authors were set to discuss periods of uncertain data.
Data cleaning and post-processing. To remove erroneous labels, we adapt the approach proposed by Zemblys et al. 20 . For our dataset, fixational events with <0.5° separation between them and within 75 ms of each other were combined into a single event. Fixations less than 50 ms and saccades greater than 150 ms in duration were automatically removed. Finally, labelled events with duration less than 10 ms were automatically removed.

Error Metrics
Evaluating the performance of automated classification systems or human labellers is not straightforward. Traditional error metrics give sample-level measurements (e.g. percentage of individual samples correctly classified) and evaluate performance on a global basis, thus oblivious to the inherent structure of the data. For instance, metrics such as accuracy, precision, recall and F 1 score are widely used to evaluate the performance of head fixed gaze classification algorithms 20,47,48 . For evaluating agreement level among labellers or classifier performance with unbalanced data (large variation in the number of samples per class), accuracy based error metrics suffer from the Accuracy Paradox 21 which means that a predictive model with high sample level scores might have a lower event prediction ability. Powers observed that symmetric kappas (e.g. Cohen's kappa), which are designed for inter-rater metrics, may not be directly suitable for automated classifiers 49 . Sample based measures fail to account for any temporal structure and may not reflect the severity of misclassifying a few, albeit structurally important, samples. Furthermore, it is more intuitive to reason in terms of correctly/incorrectly classified collections of continuous samples of the same class, or events.
Event based metrics were designed to compensate for the limitations of sample based evaluation methods. Hoppe et al. provided the percentage of correctly classified events by comparing the samples within the bounds of each groundtruth event. The category with the highest number of samples was matched with the reference event 48 . Hooge et al. proposed a set of evaluation metrics such as the event-level F 1 score, the relative timing offset (RTO) and the relative timing deviation (RTD) between matched events 46 . To compute the F 1 score for a particular gaze movement category, they treat every other category as a common opposite category. However, this operation removes all inter-category confusion. The first overlapping testing event of the same category as the groundtruth is considered as matched. Temporal offsets between event start and end times are calculated for Unmatched regions are given specific labels describing the misclassification type. For example, 'S-B' means that labeller 1 labelled the data as gaze shift whereas labeller 2 labelled the same data as blink.  www.nature.com/scientificreports www.nature.com/scientificreports/ all matched events, providing the added benefit of a measure for temporal alignment quality. Zemblys et al. proposed the event error rate (EER), which is a length normalized Levenshtein distance between event sequences 21 . Zemblys et al. also proposed the event-level Cohen's kappa measure, an extension of the event-level F 1 score 21 . These proposed event level metrics use the standard available measures (F 1 , Cohen's κ) but vary in their event matching scheme. Differing from Hooge et al., Zemblys et al. proposed that a testing event with the highest overlap ratio with a groundtruth event is to be treated as a match. Note that events of differing categories may also be considered as matched. This results in an event level confusion matrix which is used to generate an overall and per category Cohen's kappa score. Existing event level metrics improve the way we evaluate the performance of temporal classifiers but have their own individual shortcomings for varying scenarios. For instance, the majority vote method gives no penalty to unexpected short events that split longer events, and significantly influence the statistical distribution 21,48 . The event level F 1 score also does not support multi-class evaluation 21 , and the EER measure does not match events and treats all event sequences as strings. It does not consider or provide insight into temporal offsets. Furthermore, it also suffers from the Accuracy Paradox and only returns a single value as an overall rating. Last but not least, different event-matching procedures significantly affect the RTO and RTD measurements. Zemblys et al. identified that the RTO and RTD measures will be compromised when using the largest overlapping event-matching strategy 21 . Similar situations may occur when utilizing the earliest overlapping matching strategy. For example, when onset of the earliest overlapping testing event is close to the offset of a reference event. Various event based metrics are summarized in Table 4. To address some of the shortcomings of previous approaches, we devised the Event Level Cross-Category Metric (ELC) as described below.
Consider the following taxonomy: • Reference sequence -groundtruth sequence of labels.
• Testing sequence -predicted sequence of labels, usually the output of an automated classification process.
• Matched event -two events are considered matched when their start and end position roughly align in a predetermined window and meet the matching criterion (discussed below). As an example, consider sequences L1 and L2 in Fig. 8. All fixation events in L1 (marked in green) are considered as matched. • Unmatched event -All events which do not satisfy our matching criterion are considered as unmatched. Both saccades in Fig. 8, are considered as unmatched. • Detached event -We often find unmatched events in our ground truth which completely overlap with another test event and belong to the same gaze category. These type of events are considered to be detached. For example in Fig. 8, the blink in L1 (marked in yellow, the start point is matched whereas the end point has no match) is considered as a detached event. Researchers may safely consider detached events as matches per their strictness requirements and application (this operation would inflate the performance score of a classifier). • Transition point -It is assumed that all event boundaries touch each other at their transition points. Transition points have samples of different gaze behavior adjacent to it. In case event boundaries do not touch, we assume the period between them to be the none class. All entries pertaining to none, i.e blinks and unlabelled periods, are removed from consideration. Note that all events have two transition points. where start 1 and start 2 is the start positions of two events, end 1 and end 2 are end positions of two events) for each event. The mean and standard deviation of all calculated l 2 distances (per class and overall) are used as indicators of alignment quality between two labelled sequences. www.nature.com/scientificreports www.nature.com/scientificreports/ Standard metrics such as Cohen's κ and F 1 score can be derived from the confusion matrix for deeper insights or to summarize performance. 6. Applying previous steps in both directions: ELC is an asymmetrical event matching technique. It can be applied twice by interchanging the testing and reference sequences to find an average performance measure along with a sense of metric agreement. For instance, if the number of detached events is higher in a particular order, it provides insight into larger proportions of event merges in the testing sequence. Inter-labeller performance is computed by applying ELC both ways but not for human-classifier evaluation.
In Fig. 8, sequences L1p and L2p show the results of applying ELC to the labels in L1 and L2 respectively. The application of these rules eliminates many minor (mainly temporal) disagreements between sequences and considers only the regions of major disagreement as seen in sequence C2. Event Kappa utilizes the largest overlapping strategy to match events, which results in lower RTO and RTD scores 21 . For instance, event F 2 in L1 gets split into two shorter events ′ F 2 and ′ F 3 by an unexpected event ′ S 2 in L2, the metric tends to match the fixation in L1 with the largest overlapping event (F 3 ′ in this case). This leads to a poor RTO and RTD measures. However, ELC considers the start and end points of F 2 in L1 and matches them with the start of ′ F 2 and the end of ′ F 3 respectively. F 2 is considered as a matched event and the testing sequence is rewarded by increasing the F/F counter in the confusion matrix. Likewise, the testing sequence is scored negatively for the offending event, ′ S 2 , by increasing the F/S counter in the confusion matrix. The l 2 distance (functionally equivalent to RTO and RTD measurements) accurately computes the alignment quality. Interchanging L2 as the reference and L1 as the testing sequence, events F 2 ′ , S 2 ′ and F 3 ′ would be considered as unmatched events and l 2 distances would not be calculated. Overall, ELC provides a faithful indication of timing offsets using the window-based matching strategy. ELC is dependent on a parameter, i.e., the window size. The window size indicates the system tolerance for timing offsets between ground truth and testing events. Since it's easier to identify the start and end points of gaze shifts as compared to other types of gaze events, different window sizes for gaze shift related events (±25 ms) and non gaze shift related events (±35 ms) are used. Researchers may consider using larger window sizes for situations wherein event onset and offsets conditions are relaxed.

Machine Learning for Gaze Event Classification
We trained two standard machine learning models for gaze event classification: a moving window based method and a recurrent neural network (RNN). The input to both classifier models is a sequence of temporally discrete sensor data vectors, i.e., D , where ∈  x n d and n is the current time step. As described in Section 5.2, these data vectors contain information from the IMU and eye tracker. For both models, we merge fixations when stationary and fixations under translation into a single gaze fixation class (see Section 1.1 and Section 3). is computed using a window size of 2s + 1 samples and the function W(·) computes the windowed feature vector. We chose the random forest (RF) classification algorithm since it works well for low-dimensional data, and our framework resembles state-of-the-art gaze event algorithms for controlled 2D environments 21 . RF is an ensemble learning method wherein multiple decision trees are trained on a subset of samples and their feature space 51 . A RF is easy to train and they are robust to noise and over-fitting, which are common problems for decision trees. For gaze classification in 2D controlled environments, Zembyls et al.
showed that RF performed well with only 16 trees and 10-dimensional features up to a 200 ms window 21 . In our experiments, we use 40 trees, a minimum leaf size of 30, and we use g randomly selected features per tree where g is the number of features for a given window size. To improve efficiency during the process of training the window-based RF classifier, we removed duplicated w vectors (samples with equal value up to the second decimal). These duplicates were instead represented by a single sample that was upweighted by the number of duplicates found (e.g. the confidence measure was scaled). No duplicates were removed from the test set.
Rather than using explicit windows, the RNN model operates on the velocity data stream, i.e the absolute, azimuthal and elevation velocity (see Section 2.3). We use two variations of the RNN model. Our one directional www.nature.com/scientificreports www.nature.com/scientificreports/ forward RNN model (fRNN) classifies the gaze at time n using only past and present information, i.e., F(x 1 , x 2 , …, x n ). This model would be especially useful for real-time gaze prediction. For offline processing, we also use a bi-directional RNN (biRNN) that has past, present, and future information as input, i.e., F(x 1 , x 2 , …, x n , …x T ). Both models are implemented with gated recurrent units (GRUs) 52 , which can handle longer-term dependencies than simple RNNs. A similar approach was used by the GazeNet architecture 21 , which used an RNN to classify events in a controlled 2D environment. To prevent the over-representation of samples that were labeled by N labellers (where N > 1), these samples were weighted by 1//N during the process of training.
The input to our model is a subset of windowed features W. Specifically, the model accepts the absolute, azimuthal and elevation EiH and head velocity as input. Multiple sequences, b, are stacked into a single batch of data. All sequences were padded with zeros to be of the same length as the longest sequence present in the batch, L. This b × L × 6 dimensional data passes through k fully connected layers which generates a nonlinear representation of EiH and head velocity. Extracted features are fed into a stack of k GRU (see Fig. 9) units with a dropout probability of 10 % which learn to associate temporal patterns with a type of gaze behavior. We use a combination of cross-entropy and generalized Dice 53 loss functions. The network was optimized using ADAM 54 for 175 epochs with a learning rate of 0.001, which we reduced linearly as the training performance improved. We experimented with the number of recurrent and linear layers and found k = 3 worked best. All codes related to GW is made publcily available.
subject. The best performing set of parameters on the holdout subject is accepted as the optimal set of weights for that model type, and for subsequent comparison against other model types. One notable exception to this procedure is the RF algorithm, which does not require a validation set. Instead, its parameters were chosen to maximize its performance while maintaining a manageable model footprint ~50 mega bytes.
Classifiers are evaluated using both sample and event level metrics (see Section 4). Classifier output is not evaluated during blinks or for unlabelled data points. As the window size increases, RF gains increasing temporal awareness which results in higher κ performance with diminishing returns. It can be observed in Fig. 10 that RF arrives at an asymptotically improving performance with a window size of 30 ms and above. Individual κ scores for each gaze class reveals that all classifiers find it difficult to distinguish gaze pursuits. Overall, sample based metrics convey that RF with a large window size outperforms RNN for detecting saccades but performs poorly on gaze pursuit samples (Table 5).
We report event based metrics and observe that biRNN outperforms RF on all measures. Interestingly, event F 1 and event κ scores computed using Zembyls et al. shows an increase in saccade classification performance (see Table 6) for biRNN over RF. However, this increase is not reflected using sample based metrics (Table 5) or event κ computed using ELC (Table 7). Notably, RF outperforms RNN based methods in l 2 scores, indicating a better ability to produce tighter fits around saccades (see Table 7). Overall, gaze pursuit classification baselines fall short on human level performance but the results are consistent with the difficulty in classifying pursuit movements over other gaze movement types in general 19,55,56 . The biRNN model produces higher ratio of detached events (G.Fix: 0.21, G.Pur: 0.20, Sac: 0.05) as compared to RF (G.Fix: 0.09, G.Pur: 0.02, Sac: 0.11) which indicates that a larger number of ground truth events completely overlapped with events of the same category but their transitions did not fall within the matching window. Since it is debatable if these detached events can be considered as matches, we omit them from all measures to avoid inflating scores.
Ablation study. To understand the role of each feature, we systematically removed essential components from the best performing model (biRNN with 3 FC and GRU layers). The input to biRNN comprises of absolute EiH/head velocity, azimuthal and elevation EiH/head velocity. This generates a signal with 6 features. Please note that azimuthal and elevation velocity store relative direction information between the eye and head (−ve sign means an anticlockwise rotation). By comparing different conditions using sample based κ score, we highlight the essential components required for head-free gaze classification in Table 8. For a detailed comparison using all metrics, please refer to Supplementary Table 2. As expected, the performance of biRNN with EiH information (only absolute eye velocity) did not vary while detecting gaze fixations and saccades, but drops by 35 % (0.37 → 0.24) while detecting pursuit events.    www.nature.com/scientificreports www.nature.com/scientificreports/ Interestingly, a few pursuit events were still detected despite the lack of head movements. This indicates that head-free eye movements during pursuit behavior show a varied velocity pattern than gaze fixations and can be differentiated without any knowledge of head motion. We also observe that there is a minor loss in performance of 10 % (0.37 → 0.33) when we remove azimuthal and elevation components. This highlights that absolute velocity information alone can provide reasonable certainty for classification.

Discussion
The main purpose of this work was to build the first dataset of labelled gaze movements collected during natural behavior 'in the wild' (outside of the laboratory), to have multiple labellers manually label the gaze events in the dataset, and to showcase the performance of two standard temporal classification techniques, Random Forest and Recurrent Neural Networks, using some common evaluation metrics. To overcome incorrect inter-event timing offsets observed in existing metrics, we introduce the ELC metric. The usefulness of a classifier lies in its ability to generalize in unseen circumstances. Hence, all our baseline performances are evaluated using the leave-one-out approach, wherein a classifier is tested on a single subject's data while trained on the rest. Despite the fact that there is variability among human labellers, there is as yet no other choice, so we rely here on their labels as the gold standard. To improve upon existing event metrics and provide a reliable measure of alignment quality, we devised a new event matching technique, ELC, which matches events based on their transition points. ELC provides some control on evaluation strictness by identifying events which belong to the same category but are not temporally aligned due to event fragmentation.
Lower gaze pursuit classification performance by classifiers. The best performing classifier for gaze pursuits is 49 % lower than the average human level performance (sample κ: 0.73 → 0.37) whereas fixation and saccade performance achieves an average of 87 % of human performance (sample κ G.Fix: 0.61 → 0.74, Sac: 0.69 → 0.75). While pursuing moving targets, we observed that participants seamlessly interchanged between fixational and pursuit movements. The distinction between these movements are difficult to observe, especially during low velocity conditions because small angular errors in orientation measurements (a phenomenon common with IMUs) could result in misinterpretation without additional context for consideration (such as scene imagery with overlaid gaze PoR), a modality currently unavailable to our classifiers. Distinction between gaze fixation and pursuit events is further compounded when the head tracks a moving target or makes anticipatory movements but gaze remains stable at a fixation point. This motion elicits a signal similar to VOR, but if we rely purely on visual inspection then these events can easily be confused with pursuit motion. Situations such as these, combined with minor orientation errors, largely contribute to fixation/pursuit confusion seen in Table 5.
Head tracking: A pursuit or fixation?. Previous research has shown that the head tracks a moving target (in our case the ball) while the eyes predict the ball location using predictive saccades 57 . We find numerous instances of gaze shifts to known targets where head movements precede eye movements in an anticipatory manner 58 to ensure that upcoming eye movements do not deviate too far from the relatively tight distribution seen in Fig. 4. Participants frequently showed tracking behavior with the head and predictive or catch-up motion with the eyes during early phase of the ball trajectory. This behavior is usually followed by gaze pursuits during the next phase, i.e. the ball height is peaked and its projected retinal velocity is low. Following the peak phase, participants made predictive saccades to their hand for successful ball interception. GW also captures instances where the head catches-up to the fixation location while maintaining a strict coupling with the ball trajectory. While some may argue that head tracking of a moving object constitutes a pursuit motion, we instructed labellers to mark those sequences as fixations because the signals are identical to a VOR (please refer to Supplementary Fig. 1).
Head and eye tracking can have different coordinate systems. Based on the ablation study, we observed that providing only the absolute velocity information achieved almost the same performance as biRNN-3, our best performing model. Interestingly, it highlights that for a slight drop in performance, future end-end classification frameworks may perform reasonably well if they simply provide unaligned eye and head motion information. While gaze fixations and saccades are distinctly identifiable using only eye-in-head (EiH) information, pursuit movements would be difficult to differentiate with a fixation without head movement information. As a sanity check, we also verified that the presence of a head tracking device improves classification of head-free pursuit movements by up to 35 % as opposed to without head movement information (sample κ: 0.24 → 0.37). It is interesting to note that despite removing head movements, the RNN classifier is still able to identify a few pursuit events which indicates that they demonstrate different EiH velocity statistics as fixations (for more information, please refer to Supplementary Table 2).
Gaze-in-world information for classification. We include head pose as an input modality for the classifiers. While it is possible to classify the gaze-in-world signal, which is the head compensated eye-in-head signal, we wanted to train algorithms which could directly capture eye and head movement dynamics along with classifying it. For instance, we often find gaze pursuit events which are dominated either by head or eye movements, a distinction which would be lost when classifying gaze-in-world information.
General limitations. Given limitations in current technology, it is unavoidable that tracking head position using a low cost IMU will accumulate error over time. All task duration were ~3 minutes long and the error in orientation at the start and end of a recording was found to be 7° on average (see Section 2.1). While this error affects the absolute velocity component by a very small margin (0.04°/s on average), it leads to unwanted shifts in the azimuth and elevation velocity component (see Supplementary Fig. 1). Despite the use of a ratcheted head strap, this error accrues, in part, due to slippage of the helmet on the head, which will cause a misalignment of (2020) 10:2539 | https://doi.org/10.1038/s41598-020-59251-5 www.nature.com/scientificreports www.nature.com/scientificreports/ the helmet-mounted ZED stereo camera and the Pupil Labs eye tracking glasses (see Section 2). Future work might further reduce slippage through using software correction, such as the estimation of rotational slip on a frame-to-frame basis by matching visual features in the stereo camera and Pupil Labs world camera imagery, or through the fusing visual pose estimates with IMU data, as is commonly used in simultaneous localization and mapping.
Limitations of event-based metrics. Although event level error metrics give researchers a better idea of the actual performance of automated classifiers or agreement level between labellers, existing event level metrics suffer from various drawbacks. The majority vote metric by Hoppe et al. remains agnostic to the testing sequences' structure. It does not penalize during event fragmentation caused by unexpected short events in the testing sequence 21,48 . Moreover, this metric could be biased by the distribution of samples. Event level F 1 score does not work well in multi-category scenario 21 and gives out unreliable RTO and RTD. EER does not provide any measure of alignment quality and suffers from the Accuracy Paradox 21 . Event matching techniques based on the largest overlap ratio, such as the event κ proposed by Zemlys et al. do not provide a reliable measure of alignment quality 21 . ELC overcomes these issues by matching events whose transition points fall within a window. A potential drawback of ELC is its dependency on the window size. Although the window size could be carefully chosen for different types of events and transitions, the metric could generate different results due to varying window sizes. For example, if a small window size was chosen, ELC would have a lower tolerance for transition ambiguity between certain event types which could result in higher misclassification scores. Furthermore, ELC is not symmetrical. To alleviate that, we propose that metrics derived using ELC should be averaged when used to evaluate inter-coder performance. While ELC overcomes certain drawbacks from previous evaluation techniques, new event level metrics are needed which accurately reflect performance, is symmetric in nature, provides a reliable measure of temporal alignment quality and is independent of an external threshold.

conclusion
This work introduces GW, a large-scale dataset for studying eye and head coordination in naturalistic conditions. Participants were asked to perform four tasks without constraining them in any manner and were free to accomplish the tasks in any manner they chose to. Approximately 2 hours and 15 minutes of gaze behavior was manually hand coded by multiple human annotators and used to train gaze classifiers. We benchmark the performance of two machine learning algorithms for classifying these events and found that both achieved near human level performance for detecting gaze fixations and saccades, but they found it difficult to distinguish gaze pursuit behavior without additional contextual information otherwise available to human coders. In an effort to produce intuitive measures for event level similarities between two sequences, we propose the ELC event matching algorithm. We verify that all commercial eye tracking solutions could benefit in classifying head-free gaze pursuit movements by including a low cost IMU. Furthermore, comparable results are observed when head-free gaze movements are classified purely based on absolute velocity information of the eye and head, which indicates that head-free gaze classification is possible without aligning the eye and head coordinate systems.
Permission to share facial imagery. All identifiable people in this manuscript consent to share their information as presented.
Data representation. All statistical figures were generated using Gramm, an open source software for data visualization 59 . All metrics reported are rounded to the second decimal.