EyeFormer: Predicting Personalized Scanpaths with Transformer-Guided Reinforcement Learning

Yue Jiang, Zixin Guo, Hamed Rezazadegan Tavakoli, Luis A. Leiva, Antti Oulasvirta

Abstract

Modern graphical user interfaces (GUIs) present complex, graphics-rich arrangements of text, images, and interactive elements. While existing models can accurately predict regions likely to attract attention on average, they fail to account for individual differences in viewing behavior. We introduce EyeFormer, a model that leverages a Transformer architecture as a policy network within a deep reinforcement learning framework to predict personalized scanpaths. EyeFormer predicts full scanpath information, including fixation positions and durations, across various stimulus types. We demonstrate its effectiveness in personalized prediction and its potential for GUI layout optimization.

Introduction: The Challenge of Individual Attention

When navigating a website or viewing a photograph, human eyes follow a "scanpath"—a sequence of fixations and rapid movements called saccades. Traditional computer vision models typically produce static saliency maps that represent where a population looks "on average." However, individual attention is highly idiosyncratic, driven by unique preferences, habits, and specific tasks.

Predicting these individual paths is particularly challenging in complex environments like GUIs, which are filled with dense information. Existing models often struggle to predict the specific order of fixations and, crucially, their duration. EyeFormer addresses these gaps by treating scanpath prediction as a sequential control problem.

The EyeFormer Architecture

EyeFormer combines the strengths of Transformers and Reinforcement Learning (RL) to model the temporal and spatial dynamics of human gaze.

  1. Transformer-Based Policy Network: The model uses a Vision Transformer (ViT) to encode the input image into patches. A Transformer Decoder then predicts the next fixation point by considering both the visual features and the history of previous fixations.
  2. Reinforcement Learning Framework: To optimize for non-differentiable goals—such as "Inhibition of Return" (avoiding immediate re-fixation on the same spot)—the authors employ the REINFORCE algorithm.
  3. Reward Functions: The model is trained using a multi-faceted reward function that prioritizes salient regions, encourages exploration, and minimizes the distance between predicted and ground-truth paths using Dynamic Time Warping with Duration (DTWD).

Datasets and Personalization

The model was evaluated on two distinct datasets: UEyes, featuring 1,980 GUI images (webpages, mobile interfaces, posters), and OSIE, a standard dataset of 700 natural scenes.

A key innovation of EyeFormer is its Viewer Encoder. By providing the model with a small sample of scanpaths (approximately 50) from a specific individual, the model can adapt to that user's unique viewing style. This "few-shot" personalization allows the model to significantly outperform generic population-level models.

EyeFormer predicts scanpaths across diverse stimuli, capturing individual differences between viewers.

Key Insights: Temporal Dynamics and Realism

Unlike many previous models that focus solely on spatial location, EyeFormer treats fixation duration as a core component of the prediction. A long fixation on a call-to-action button conveys different information than a fleeting glance. By integrating duration, the model captures the "flow" of visual attention more realistically.

The model predicts both the spatial sequence and the duration of fixations over time.

The combination of Transformers and RL prevents common generative pitfalls, such as "clustering" points in the center of the screen or predicting fixations in irrelevant areas. Instead, EyeFormer produces sequences that mirror the logical progression of human visual search.

Results and Applications

EyeFormer consistently outperformed state-of-the-art models like PathGAN++ and ScanDMM across multiple metrics. It achieved lower error rates in Dynamic Time Warping (DTW) and showed a high correlation with ground-truth fixation durations.

Beyond academic evaluation, the authors demonstrated a practical application: GUI Layout Optimization. By using EyeFormer as a proxy for human viewers, designers can automatically rearrange interface elements to ensure that critical information is seen in the intended order, tailored to specific user profiles.

Limitations and Future Directions

While EyeFormer represents a significant step forward, several challenges remain. The model currently operates on fixed-length paths, whereas real-world viewing is more fluid. Additionally, acquiring the data necessary for personalization (50 samples per user) remains a hurdle; future work may explore using mouse-movement proxies or webcam-based tracking. Finally, the researchers suggest that new, GUI-specific metrics are needed to better evaluate how users navigate digital interfaces compared to natural scenes.

Summary updated

BibTeX
@inproceedings{jiang2024eyeformer,
  author = {Yue Jiang and Zixin Guo and Hamed Rezazadegan Tavakoli and Luis A. Leiva and Antti Oulasvirta},
  title = {{EyeFormer: Predicting Personalized Scanpaths with Transformer-Guided Reinforcement Learning}},
  booktitle = {UIST},
  year = {2024},
  doi = {10.1145/3654777.3676436},
}
Figure