Widget Captioning: Generating Natural Language Description for Mobile User Interface Elements

Yang Li, Gang Li, Luheng He, Jingjie Zheng, Hong Li, Zhiwei Guan

Abstract

This paper introduces widget captioning, a novel multimodal task designed to automatically generate natural language descriptions (alt-text) for mobile user interface (UI) elements. By integrating a massive new crowdsourced dataset with a Transformer-based model that processes both raw pixels and structural view hierarchies, the authors demonstrate a significant advancement in making mobile applications more accessible and easier to navigate via voice commands.

The Accessibility Gap

For visually impaired individuals using screen readers, mobile applications lacking descriptive metadata are often unusable. Despite being a cornerstone of digital accessibility, functional descriptions are missing in over half of image-based mobile UI elements. The challenge of automating these descriptions lies in understanding context; for instance, a magnifying glass icon may represent "search contacts" in a communication app but "search music" in a media player. This research aims to automate the captioning process by teaching machines to interpret widgets based on their visual appearance, their position within the code (view hierarchy), and the surrounding screen context.

Multimodal Architecture

The authors frame widget captioning as a multimodal translation problem, utilizing an encoder-decoder architecture to synthesize diverse data sources.

Overview of the widget captioning model architecture.
  • The Structural Encoder (Transformer): This component processes the "view hierarchy"—the underlying tree structure of the UI. It encodes metadata such as widget type (e.g., Button, Checkbox), clickability, and depth within the UI tree.
  • The Image Encoder (ResNet): A Convolutional Neural Network (CNN) processes a 64x64 grayscale crop of the widget’s pixels to capture its visual style.
  • The Decoder (Transformer): This component synthesizes the structural and visual features to generate a caption word-by-word (e.g., "add to cart").

Unlike standard image captioning, the model employs parallel decoding, allowing it to use the entire screen as context to generate descriptions for all missing widgets on a page simultaneously.

The Widget Captioning Dataset

To support this task, the researchers introduced a massive new benchmark built upon the RICO dataset (a collection of Android UIs):

  • Scale: The dataset contains 162,859 language phrases covering 61,285 UI elements across nearly 22,000 unique screens from over 6,000 apps.
  • Human-in-the-loop: Each element was described by multiple crowd workers to ensure a diverse and representative set of ground-truth captions.

The Importance of Context

A primary insight of this work is that a widget's identity is defined by its neighbors. The model performs significantly better when it can "read" the text labels of nearby elements.

The same icon requires different captions based on the surrounding screen context.

As illustrated above, visual appearance alone is often insufficient for disambiguation. The authors found that structural information from the view hierarchy is frequently more informative for determining a widget's function than raw pixels. Furthermore, generating text word-by-word (decoding) proved superior to picking from a fixed list of labels (classification), as it better captures the "long tail" of unique UI actions.

Key Results and Evaluation

The "Full Model"—incorporating pixels, local structure, and screen context—outperformed all baselines across standard NLP metrics.

  • Quantitative Performance: On a subset of "Predicate + Object" captions, the full model achieved a CIDEr score of 110.1, compared to 69.6 for a model relying solely on pixels.
  • Human Evaluation: In blind testing, human raters endorsed the model’s generated captions 78.64% of the time.
  • Ablation Study: Removing the "text" property from the input caused the largest performance drop, confirming the model's heavy reliance on surrounding text to disambiguate icons.

Limitations and Future Work

Despite its success, the model occasionally suffers from "nearby confusion," where it suggests a caption based on an adjacent but unrelated field (e.g., suggesting "write street address" for a phone number field). Additionally, the model can sometimes produce generic captions like "toggle on" instead of specific functional descriptions. Future work will focus on more sophisticated graph-based encoders to better represent the complex relationships within a UI's view hierarchy.

Summary updated

BibTeX
@inproceedings{li2020widget,
  author = {Yang Li and Gang Li and Luheng He and Jingjie Zheng and Hong Li and Zhiwei Guan},
  title = {{Widget Captioning: Generating Natural Language Description for Mobile User Interface Elements}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.443},
}
Figure