Source-linked AI summary

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

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

arXiv:2010.04295v1cs.LGcs.AIcs.CLcs.HC

TL;DR

Mobile UIs often lack captions needed for accessibility and language-based interaction. The paper formulates widget captioning as multimodal generation from UI structure and images, builds a large crowdsourced dataset, and evaluates deep model configurations. Its Transformer–ResNet configuration produces semantically meaningful captions, while evaluation remains limited by semantically correct captions being treated as errors and by data sparsity.

  • Problem

    Mobile UIs frequently lack widget captions, while manually composing descriptions for each element imposes substantial developer overhead.

  • Method

    The paper defines widget captioning as multimodal language generation using UI structural information, images, and screen context, supported by a crowdsourced dataset and benchmark models.

  • Results

    The Transformer structural encoder coupled with a ResNet CNN generates semantically meaningful captions for sparsely labeled UI elements, demonstrating task feasibility.

  • Takeaways & Limitations

    Widget captioning and its dataset provide a basis for connecting language generation with mobile user interfaces.

  • Takeaways & Limitations

    Automatic evaluation can treat semantically correct captions as errors, and data sparsity leaves long-tail phrases underrepresented.

Abstract

from arXiv · show

Natural language descriptions of user interface (UI) elements such as alternative text are crucial for accessibility and language-based interaction in general. Yet, these descriptions are constantly missing in mobile UIs. We propose widget captioning, a novel task for automatically generating language descriptions for UI elements from multimodal input including both the image and the structural representations of user interfaces. We collected a large-scale dataset for widget captioning with crowdsourcing. Our dataset contains 162,859 language phrases created by human workers for annotating 61,285 UI elements across 21,750 unique UI screens. We thoroughly analyze the dataset, and train and evaluate a set of deep model configurations to investigate how each feature modality as well as the choice of learning strategies impact the quality of predicted captions. The task formulation and the dataset as well as our benchmark models contribute a solid basis for this novel multimodal captioning task that connects language and user interfaces.

1 Introduction

Mobile UIs frequently lack widget captions, limiting accessibility and language-based interaction while imposing manual authoring costs on developers. The paper introduces widget captioning, a multimodal task supported by a crowdsourced dataset and benchmark models.

  • Motivation: Widget captions support screen-reader accessibility and language-based interaction capabilities such as voice commands and screen understanding.
  • Motivation: More than half of image-based mobile UI elements lack captions, and missing captions also affect a broad range of other elements.Existing tools require developers to manually compose descriptions for each element, creating substantial overhead.
  • Task formulation: Widget captioning generates descriptions for individual UI elements from visual appearance, structural properties, and screen context.Unlike traditional image captioning, it targets elements rather than entire screens and uses the whole screen as context.
  • Dataset and benchmarks: 162,859 human-created captions annotate 61,285 UI elements across 21,750 unique screens from 6,470 mobile apps.The dataset was collected through crowdsourcing from a mobile UI corpus.
  • Dataset and benchmarks: Benchmark models use multimodal UI inputs, and a Transformer structural encoder paired with a ResNet image encoder produces accurate captions while leaving room for improvement.

2 Related Work

Widget captioning extends image captioning to individual UI elements by incorporating structural and contextual information alongside images. The paper relates this task to multimodal encoding, contextual learning from screen elements, and parallel caption decoding.

  • Widget captioning versus image captioning: Widget captioning differs from image captioning by describing individual UI elements rather than entire images and by using multimodal UI information.
  • Image captioning: Image captioning commonly combines a CNN image encoder with an autoregressive language generator enhanced by neural attention.
  • Multimodal modeling: Widget captioning requires encoders that represent both UI images and structural information such as view hierarchies.
  • Learning strategy: The learning strategy uses same-screen elements as context to predict captions for elements with missing captions.Caption generation runs multiple decoding-model instances in parallel, one for each element being captioned.

3 Creating the Widget Caption Dataset

The dataset was built from Android UI screens by identifying visible clickable elements with missing captions, collecting multiple worker annotations, and analyzing their linguistic and structural properties.

  • Corpus construction: 24,571 unique screens from 6,853 mobile apps remained after filtering inaccurate view hierarchies.Workers checked whether leaf-node bounding boxes matched the screenshot elements.
  • Missing captions: 74,379 visible clickable UI elements lacked both contentDescription and text properties across 10 element categories.These fields are used by Android screen readers to announce widgets.
  • Missing captions: 95% of Floating Action Buttons, 83% of Image Views, and 57% of Image Buttons lacked captions, while more than 50% of several control types also lacked them.The affected controls included Switch, Compound Button, Check Box, and Toggle Button; 24.3% of screens had no pre-existing captions.
  • Crowdsourced annotation: 162,859 captions were collected for 61,285 UI elements across 21,750 unique screens from 6,470 mobile apps.Each retained element received at least two captions and averaged 2.66 captions from different workers.
  • Caption phrase analysis: Most captions contained two to three words, with an average length of 2.72 words and a substantial long-tail of longer captions.The human-created length distribution was similar to pre-existing captions from app developers.
  • Caption phrase analysis: Predicate-plus-object phrases were diverse and often required screen context to distinguish objects sharing the same predicate.For example, visually similar search icons could refer to searching contacts or music, motivating sequence decoding and contextual modeling.
  • View hierarchy complexities: View hierarchies had a median size of 61 nodes and median depth of 11, with ranges of 6–1,608 nodes and 3–26 levels.These distributions indicate complex UI structures containing rich structural information.

4 Widget Captioning Models

The widget captioning model encodes multimodal UI information, combining structural properties, screen context, and element images before generating captions for missing elements.

  • 4.1 Encoding the Structural Information: The model encodes structural information from UI element properties and screen context with a Transformer.Element text, type, clickability, bounds, and hierarchy position contribute to element representations, while attention models relationships among elements on the screen.
  • 4.2 Encoding Element Images: Each element image is cropped from the screenshot and resized to a 64x64x1 grayscale tensor before ResNet encoding.This fixed size balances detail preservation for large elements with memory requirements for training and serving.
  • 4.3 Decoding Captions: The structural and image encodings are combined into a latent element representation used by a Transformer decoder to generate variable-length captions.The decoder incorporates the element encoding during masked self-attention and produces token probabilities with softmax.
  • 4.3 Decoding Captions: Captions for all missing-caption elements on the same screen are decoded in parallel, and the full model is trained end-to-end with screen-level cross-entropy loss.Training uses teacher forcing, whereas prediction decodes captions autoregressively.

5 Experiments

The experiments evaluate generalization across unseen apps, compare input modalities and decoding strategies, and assess both automatic and human-perceived caption quality. Multimodal context-aware decoding performs best, although errors remain from confusion, generic outputs, and sparse long-tail phrases.

  • 5.1 Datasets: The app-wise split ensures that all test apps and screens are unseen during training, enabling evaluation of generalization to unseen conditions.The train, validation, and test sets have similar approximately 40% caption-coverage ratios, with no statistically significant difference.
  • 5.3 Metrics & Results: The full Pixel+Local+Context model achieves the best results, showing that image features, local structure, and screen context complement one another for caption generation.Pixel+Local improves over image-only encoding, while context provides additional useful information; the widget text property is especially important among structural features.
  • 5.3 Metrics & Results: The token-sequence decoding approach outperforms classification over a fixed vocabulary of 10K common caption phrases.Classification is more vulnerable to data sparsity when combinations of common words form long-tail phrases.
  • 5.3 Metrics & Results: On the predicate-object subset, Pixel+Local+Context remains the champion and gains most significantly across all metrics, indicating the value of context for determining object parts.The subset contains about 40% of test elements and includes more common words, but phrase combinations can still be long-tailed.
  • 5.4 Human Evaluation: 78.64% of human raters endorsed captions from the full model, compared with 62.42% for the Pixel Only model.Shorter captions received more endorsements, and the context-aware model remained stronger than the model without context.
  • 5.5 Error Analysis: Error analysis found confusion from nearby elements and similar appearance, overly generic captions, and semantically correct outputs penalized by automatic evaluation.Among 50 sampled validation errors, the categories included 21 nearby-element errors, 10 similar-appearance errors, 9 generic errors, and 10 model-correct cases.

6 Conclusion

The paper presents widget captioning as a multimodal task for generating UI-element descriptions and shows that a Transformer structural encoder with a ResNet CNN can produce semantically meaningful captions.

  • Widget captioning automatically generates language descriptions for UI elements using structural and image input.
  • The task addresses missing captions that limit mobile accessibility and language-based interaction.
  • A Transformer structural encoder coupled with a ResNet CNN generated semantically meaningful captions for sparsely labeled screen elements.
  • The dataset supports modeling captions for a broad range of UI elements, including elements classified through their view-hierarchy classes and ancestors.

B The Annotation Interface

The annotation interface helps crowd workers caption highlighted UI elements by combining the screen image, app context, task guidance, and submission controls.

  • The interface displays the mobile UI screenshot with the target element highlighted by a red bounding box.
  • Annotators receive the app description from Google Play Store as background context for the screen.
  • Annotators follow task guidelines and can submit a caption or skip cases where the element is incorrectly highlighted or cannot be described.

C Phrase Distribution

The corpus contains substantial preexisting widget text, and its caption-length distribution is similar to that of captions created by human workers.

  • 476,912 UI elements in the corpus contain text from app content or developers, providing structural input for generating descriptions.
  • Human-created captions and preexisting UI text have similar length distributions.

D Predicate-Object Phrases

The predicate-object analysis identifies captions whose verbs and nouns are likely to require contextual and structural information from the UI hierarchy.

  • The evaluation subset begins with 22 verbs occurring more than 1,000 times in the corpus.
  • Researchers manually identified 194 nouns whose interpretation is likely to require contextual and structural information from the view hierarchy.
  • Predicate-object captions contain at least one selected verb and one selected noun.

E Model Configurations & Training

The paper compares template matching with multimodal neural configurations and trains these models using image pre-training, hyperparameter tuning, and Transformer-style optimization. Validation accuracy is reported for each configuration, while ablation analysis examines the contribution of UI-element features.

  • Model Configurations: Template Matching predicts a test element's caption using the caption of the most pixel-similar training example.Similarity is computed with cosine similarity between pixel values, and all training examples serve as templates.
  • Evaluation: Validation performance is reported for Pixel Only, Pixel+Local, Pixel+Local+Context, and PLC Classification on the full and predicate-object subsets.Table 5 contains the configuration accuracies, while the four models contain 3.73M, 4.24M, 5.33M, and 5.33M parameters respectively.
  • Model Configurations: Pixel+Local computes structural encoding by passing the element embedding e_i through a multi-layer perceptron and linear projection.The projection uses trainable parameters W_e, while the perceptron is parameterized by θ_e.
  • Training: Image encoders are pre-trained with a denoising auto-encoder so images from elements without caption labels can contribute to representation learning.The reconstruction decoder uses five transposed-convolution layers with residual connections and is discarded after pre-training.
  • Training: The study tunes hidden sizes, encoder/decoder depth, widget-text pooling, and Transformer learning-rate constants across multiple candidate settings.Training uses Adam with linear warmup followed by exponential decay on four Tesla V100 GPU cores.

F Ablation Study

The ablation study tests how UI view-hierarchy features affect captioning performance, while accompanying figures provide generated-caption examples and caption-word distribution information. Removing text produces the largest reported accuracy decline.

  • F Ablation Study: Each removed UI-element feature decreases the overall performance of the Pixel+Local+Context model.The ablation results are presented in Table 6.
  • F Ablation Study: Removing the text feature causes the largest accuracy drop among the ablated UI-element features.This identifies text as the most influential feature in the reported ablation comparison.
  • Qualitative Examples: Figures 11 and 12 show model-predicted captions alongside human-worker reference captions for highlighted elements in screenshots.The examples come from the held-out test dataset.
  • Caption Analysis: Figure 10 represents the top 300 unique captions by their first four words, with word ordering radiating from the center and arc length proportional to caption frequency.The figure encodes how often captions contain each word in the displayed four-word sequences.
Loading 2010.04295v1…