Object Detection for Graphical User Interface: Old Fashioned or Deep Learning or a Combination?

Jieshan Chen, Mulong Xie, Zhenchang Xing, Chunyang Chen, Xiwei Xu, Liming Zhu, Guoqiang LiESEC/SIGSOFT FSE 2020 · DOI

Introduction

Detecting Graphical User Interface (GUI) elements—such as buttons, icons, and text fields—is a critical task for automated software engineering, enabling tools to test applications, search UI designs, or convert screenshots into code. While many existing tools adapt general-purpose computer vision (CV) algorithms, this research demonstrates that GUIs differ fundamentally from natural images in ways that challenge standard models.

GUIs require extreme localization accuracy; a bounding box offset by just a few pixels can cause an automated tool to miss a functional element. Furthermore, GUIs are significantly more "packed" than natural scenes. While a standard image in the MS COCO dataset typically contains about 7 objects, a mobile screenshot averages 28, often tightly clustered.

Comparison of object density between the Rico GUI dataset and MS COCO (2015).

Methodology

The researchers conducted a large-scale empirical study benchmarking seven representative detection methods across two categories:

  • Traditional "Old-Fashioned" Methods: REMAUI and Xianyu, which rely on Canny edge detection and contour aggregation.
  • Deep Learning (DL) Models: Faster RCNN (two-stage), YOLOv3 (one-stage), and CenterNet (anchor-free).

The study also evaluated text detection using Tesseract (traditional OCR) and EAST (a DL scene-text detector). Based on the findings, the authors proposed a hybrid method that avoids a "one-size-fits-all" approach. It utilizes a top-down coarse-to-fine strategy for non-text widgets and the EAST detector for text elements, followed by a ResNet50 classifier to determine element types.

Key Results and Insights

The empirical study utilized the Rico dataset, comprising over 50,000 screenshots from 8,018 Android apps. The results demonstrated that while deep learning methods generally outperform traditional edge-detection in coverage, they often struggle with the high density and visual similarity of GUI elements.

Performance comparison of different object detection methods on the GUI dataset.

Key findings include:

  • Two-Stage Superiority: Faster RCNN outperformed one-stage models like YOLOv3. The separation of region proposal and classification helps manage the visual similarity between different GUI classes (e.g., a spinner vs. a button).
  • Text as "Scene Text": GUI text is often colorful or overlaid on complex backgrounds. Scene-text detectors like EAST proved far more effective than traditional OCR tools.
  • Hybrid Success: The proposed hybrid approach achieved an overall F1-score of 0.573. This represents a 19.4% increase in F1-score for non-text elements over the best DL baseline (Faster RCNN) and a 47.7% increase in overall F1-score across all elements.

Conclusion

This study reveals that standard CV models are often ill-suited for the unique constraints of GUI element detection. By combining traditional image processing for layout analysis with specialized deep learning for text and classification, the researchers achieved a new state-of-the-art. Future work will explore incorporating semantic metadata and handling dynamic UI content to resolve functional ambiguities.

Summary updated

BibTeX
@inproceedings{chen2020object,
  author = {Jieshan Chen and Mulong Xie and Zhenchang Xing and Chunyang Chen and Xiwei Xu and Liming Zhu and Guoqiang Li},
  title = {{Object Detection for Graphical User Interface: Old Fashioned or Deep Learning or a Combination?}},
  booktitle = {ESEC/SIGSOFT FSE},
  year = {2020},
  doi = {10.1145/3368089.3409691},
}
Figure