Abstract
Automated analysis of mobile Graphical User Interfaces (GUIs) often struggles with the "granularity gap"—the disconnect between low-level visual elements (icons, text) and high-level functional sections (menus, lists). This paper presents UISCGD (UI Semantic Component Group Detector), a Transformer-based approach that identifies "semantic component groups"—adjacent elements that function as a single unit. By integrating UI-specific structural priors and color-coded feature maps, UISCGD achieves significant improvements in detection accuracy and downstream tasks such as automated code generation and accessibility data generation.
Introduction
In modern mobile applications, functional units are rarely composed of a single element. A "Delete" button, for instance, frequently consists of a trash can icon paired with text, both housed within a container. While human users perceive these as a single functional entity, AI models often treat them as fragmented, independent parts. This lack of semantic understanding leads to "flat" automated code that is difficult to maintain and disjointed experiences for users relying on screen readers.
The Granularity Challenge
Existing UI analysis tools typically operate at two extremes: detecting fragmented layers (the basic shapes forming an icon) or large perceptual groups (entire cards or navigation bars). UISCGD targets the "missing middle": Semantic Component Groups. These are the fundamental building blocks of a UI where adjacent text and images share a single function. By accurately detecting these groups, the tool bridges the gap between raw pixels and functional UI components.
Methodology: UISCGD
The researchers developed UISCGD by customizing the Deformable-DETR architecture with two key UI-specific innovations:
- UIED-based Colormap: To handle the visual diversity of UI elements across different apps, an unsupervised tool (UIED) generates a simplified "colormap" where text is blue and non-text elements are red. Fusing this map with the original screenshot allows the model to focus on structural relationships rather than specific pixel values, boosting precision by 2%.
- Prior Group Distribution: Recognizing that mobile layouts are highly structured (e.g., navigation at the bottom), the model incorporates a vertical prior. By dividing the screen into horizontal bands and applying a Gaussian weighting function, the detector refines bounding box predictions based on their statistical likelihood at specific screen positions.
Evaluation and Results
The model was trained and validated on a custom dataset of 1,989 mobile GUI screenshots containing 15,167 manually annotated semantic groups across diverse app categories.
- Detection Performance: UISCGD achieved an F1 score of 0.775, outperforming the base Deformable-DETR by 5.4% and other state-of-the-art baselines.
- Perceptual Grouping: For identifying larger sections like menus, the method reached an F1 score of 0.881, an 8.3% improvement over previous psychologically-inspired unsupervised methods.
- Downstream Impact: In a user study with professional engineers, the "code availability" score for auto-generated code improved from 3.14 to 4.21 (on a 5-point scale), indicating that semantic grouping produces significantly more production-ready code.
Conclusion and Future Work
UISCGD demonstrates that incorporating structural and positional priors is essential for teaching AI to understand the "big picture" of mobile interfaces. While the model currently faces challenges with mid-scroll viewport shifts and internal icon fragmentation, it provides a robust foundation for bridging the gap between design prototypes and functional, accessible code. Future research will explore integrating metadata directly from design tools like Figma to further enhance detection precision.
Summary updated