Hostname: page-component-6766d58669-bkrcr Total loading time: 0 Render date: 2026-05-20T15:24:25.948Z Has data issue: false hasContentIssue false

Webcam-based online eye-tracking for behavioral research

Published online by Cambridge University Press:  01 January 2023

Xiaozhi Yang*
Affiliation:
Department of Psychology, The Ohio State University
Ian Krajbich
Affiliation:
Department of Psychology, and Department of Economics, The Ohio State University
*
Rights & Permissions [Opens in a new window]

Abstract

Experiments are increasingly moving online. This poses a major challenge forresearchers who rely on in-lab techniques such as eye-tracking. Researchers incomputer science have developed web-based eye-tracking applications (WebGazer;Papoutsaki et al., 2016) but they have yet to see them used in behavioralresearch. This is likely due to the extensive calibration and validationprocedure, inconsistent temporal resolution (Semmelmann & Weigelt, 2018),and the challenge of integrating it into experimental software. Here, weincorporate WebGazer into a JavaScript library widely used by behavioralresearchers (jsPsych) and adjust the procedure and code to reducecalibration/validation and improve the temporal resolution (from 100–1000ms to 20–30 ms). We test this procedure with a decision-making study onAmazon MTurk, replicating previous in-lab findings on the relationship betweengaze and choice, with little degradation in spatial or temporal resolution. Thisprovides evidence that online web-based eye-tracking is feasible in behavioralresearch.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
The authors license this article under the terms of the Creative Commons Attribution 3.0 License.
Copyright
Copyright © The Authors [2021] This is an Open Access article, distributed under the terms of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/3.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Figure 0

Figure 1: Experiment Design. A). Visualization of the calibration + validation process. Subjects would only see one dot at a time. During calibration only, the subject’s face was present at the top left corner of the screen, along with a green box for positioning. During validation only, the dots would change color to indicate a valid or invalid measure. B). Overview of the experiment. There was an initial calibration + validation phase to screen out problematic subjects. Next, subjects rated how much they liked 70 different food items. Then there was another calibration + validation. This was followed by 100 binary-choice trials where subjects chose which food they preferred; there was a recalibration + validation halfway through these trials.

Figure 1

Figure 2: Spatial precision (A) and temporal resolution (B) over time. (A) The hit ratio, namely the proportion of successful intertrial validation points, as a function of number of validations completed. 10 intertrial validation trials were included per subject. There was a recalibration halfway through the experiment. (B) The gaze sampling interval, namely the delay between gaze measurements, as a function of the number of choice trials completed. The white circles indicate the median values. The black bars in the center of the violins represent the interquartile range. The blue violins represent all of the observations.

Figure 2

Table 1: This table summarizes the statistics related to validation samples in another study (reported elsewhere; these statistics were not recorded for the main experiment). Each row represents a validation dot position, with the horizontal x-coordinate followed by the vertical y-coordinate, relative to the top left corner of the screen. For example, 20%;80% represents a dot at the bottom left corner of screen, 20% of the way right and 80% of the way down. Each validation sample represents a single gaze measurement produced by WebGazer. Ideally, WebGazer would give a measurement every 20ms in the experiment. Mean distances represent the average Euclidean distance between the measured gaze location and the center of the validation dot. Standard deviations are calculated for each condition using all validation samples for that condition

Figure 3

Figure 3: Validation prediction accuracy. We selected the nine equally spaced validation dots and examined the spatial distribution of observed gaze samples for each of those dots. Ideally, we would only observe gaze samples at the current dot position, as would be indicated by solid black along the diagonal and light grey everywhere else. The location of the gaze sample was calculated using Euclidean distance. If the Euclidean distance between the sample and the dot position was within 15% of the screen width (192 pixels for a laptop with 1280px screen width), then the sample was assigned to that dot. For instance, if the Euclidean distance between a sample and dot (20%; 20%) is smaller than 15% of the screen width, then the sample is assigned to (20%; 20%). The coordinates (X,Y) of the validation dots are displayed along the diagonal.

Figure 4

Figure 4: Relations between gaze and choice. A) Choice as a function of the total dwell-time difference between the left option and the right option in a given trial. B). Choosing the first seen item as a function of the first gaze dwell time. C). Choice as a function of the value differences between the two options, split by the location of the last fixation. Squares indicate final fixation left, triangles indicate final fixation right. In each plot, the red line/dots represent the results in Krajbich et al. (2010)’s dataset; the blue line/dots represent the results in the online MTurk study. The error bars represent the mean ± standard errors. The blue circles are data from individual subjects in the MTurk data.

Figure 5

Figure 5: Individual-level dwell time coefficients and p-values. (A) Coefficients and (B) p-value distributions from the online MTurk study. (C) Coefficients and (D) p-value distributions from Krajbich et al. (2010)’s dataset. (A-C) Dwell-time coefficients are extracted from the individual-level logistic regressions of choice on dwell time difference; each bar represents one subject. p-values indicate the significance of those coefficients. Negative p-values are for individuals with coefficients less than zero.

Supplementary material: File

Yang and Krajbich supplementary material

Supplementary materials
Download Yang and Krajbich supplementary material(File)
File 619.5 KB