File size: 15,797 Bytes
853f993
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4d71926
7e334b7
4d71926
e8ad6e5
4d71926
e8ad6e5
4d71926
e8ad6e5
4d71926
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e8ad6e5
2d66552
4d71926
e8ad6e5
4d71926
 
e8ad6e5
4d71926
e8ad6e5
4d71926
e8ad6e5
4d71926
e8ad6e5
4d71926
 
7e334b7
4d71926
7e334b7
4d71926
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853f993
4d71926
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e8ad6e5
7e334b7
 
 
4d71926
7e334b7
 
 
 
 
 
 
 
 
 
 
 
 
4d71926
7e334b7
 
 
 
 
 
 
 
 
4d71926
e8ad6e5
0822034
4d71926
 
 
0822034
 
e8ad6e5
4d71926
7e334b7
 
4d71926
7e334b7
 
 
 
 
e8ad6e5
7e334b7
e8ad6e5
7e334b7
 
e8ad6e5
7e334b7
4d71926
 
7e334b7
 
e8ad6e5
7e334b7
e8ad6e5
7e334b7
4d71926
 
 
e8ad6e5
7e334b7
 
 
e8ad6e5
4d71926
 
 
e8ad6e5
4d71926
e8ad6e5
4d71926
e8ad6e5
7e334b7
4d71926
7e334b7
e8ad6e5
4d71926
 
 
e8ad6e5
4d71926
 
 
e8ad6e5
7e334b7
 
 
e8ad6e5
4d71926
e8ad6e5
4d71926
e8ad6e5
4d71926
e8ad6e5
4d71926
 
e8ad6e5
4d71926
 
 
e8ad6e5
4d71926
e8ad6e5
4d71926
e8ad6e5
4d71926
 
 
e8ad6e5
7e334b7
4d71926
 
 
7e334b7
853f993
4d71926
 
 
 
 
 
 
 
e8ad6e5
4d71926
e8ad6e5
7e334b7
e8ad6e5
 
 
 
 
 
 
 
 
 
 
7e334b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
---
language: [en]
license: mit
datasets: [MobileViews]
pretty_name: "MobileViews: A Large-Scale Mobile GUI Dataset"
tags:
  - mobile-ui
  - user-interfaces
  - view-hierarchy
  - android-apps
  - screenshots
task_categories:
  - question-answering
  - image-to-text
task_ids:
  - task-planning
  - visual-question-answering
---
# 🚀 MobileViews: A Large-Scale Mobile GUI Dataset

**MobileViews** is a large-scale dataset designed to support research on mobile agents and mobile user interface (UI) analysis. The first release, **MobileViews-600K**, includes over **600,000** mobile UI screenshot-view hierarchy (VH) pairs collected from over **20,000 apps** on the Google Play Store. This dataset is based on the [DroidBot](https://honeynet.github.io/droidbot/), which we have optimized for large-scale data collection, capturing more comprehensive interaction details while maintaining consistency with DroidBot’s output structure.

[**📖 Read the Paper**](https://arxiv.org/abs/2409.14337) — If you’d like to dive deeper into the details of how we construct this dataset, or explore the training experiments we conduct using `MobileViews`, we encourage you to check out our paper. The paper, along with this dataset, contains everything you need to understand our process and replicate or build upon our findings!

## 🤗 Table of Contents

- [🚀 MobileViews: A Large-Scale Mobile GUI Dataset](#-mobileviews-a-large-scale-mobile-gui-dataset)
  - [🤗 Table of Contents](#-table-of-contents)
  - [🥳 NEWS](#-news)
  - [🧐 Dataset Overview](#-dataset-overview)
    - [Folder Structure](#folder-structure)
    - [1. MobileViews\_Screenshots\_ViewHierarchies](#1-mobileviews_screenshots_viewhierarchies)
      - [Screenshot-VH File Descriptions](#screenshot-vh-file-descriptions)
    - [2. MobileViews\_Apps\_CompleteTraces](#2-mobileviews_apps_completetraces)
      - [App Trace Folder Structure](#app-trace-folder-structure)
  - [🔎 Detailed Metadata and File Descriptions](#-detailed-metadata-and-file-descriptions)
    - [AppMetadata.csv Columns](#appmetadatacsv-columns)
    - [Index and Parquet files for `MobileViews_Screenshots_ViewHierarchies`](#index-and-parquet-files-for-mobileviews_screenshots_viewhierarchies)
    - [Index files for `MobileViews_Apps_CompeleteTraces`](#index-files-for-mobileviews_apps_compeletetraces)
  - [🌏 How to Download](#-how-to-download)
    - [Download via Hugging Face Python Library](#download-via-hugging-face-python-library)
  - [📋 Usage Guidelines](#-usage-guidelines)
    - [Using `zip` and `parquet` Files in `MobileViews_Screenshots_ViewHierarchies`](#using-zip-and-parquet-files-in-mobileviews_screenshots_viewhierarchies)
    - [Mapping Screenshots and States in `MobileViews_Apps_CompleteTraces`](#mapping-screenshots-and-states-in-mobileviews_apps_completetraces)
  - [🌟 Future Updates and Feedback](#-future-updates-and-feedback)
  - [🔖 Citation](#-citation)


## 🥳 NEWS

- **`2024/11`****New Release!** We’ve expanded the dataset to include comprehensive interaction data, now featuring traces and action sequences for `20,000+` apps.
- **`2024/10`****Initial Launch!** The `MobileViews` dataset is live with `600,000+` unique screenshot-VH pairs, deduplicated across `20,000+` Android apps.

## 🧐 Dataset Overview

### Folder Structure

The dataset is organized into two main folders:

1. **MobileViews_Screenshots_ViewHierarchies**: Contains the core screenshot-VH pairs in both `.zip` and `.parquet` formats. All pairs are globally deduplicated based on their image hash values, ensuring unique UI states across the dataset.
2. **MobileViews_Apps_CompleteTraces**: Provides complete interaction traces for individual apps, including states, actions, and transitions.

### 1. MobileViews_Screenshots_ViewHierarchies

This folder contains 600K screenshot-VH pairs, formatted in both `.zip` and `.parquet` formats. Each `.zip` and `.parquet` file pair, along with their respective CSV index files, follows a consistent data structure for easy access.

- **`Parquets/`**: `.parquet` files with binary data for screenshots and JSON content for VHs.
- **`Zip_Files/`**: `.zip` files with individual `.jpg` screenshots and `.json` VH files.
- **`Index_CSV/`**: `csv` files, like `MobileViews_index_0-150000.csv`, that map screenshot IDs to their corresponding VH files.

#### Screenshot-VH File Descriptions

- **`MobileViews_0-150000.zip`**, **`MobileViews_0-150000.parquet`** and **`MobileViews_index_0-150000.csv`**: This set, containing IDs from 0 to 150,000.
- **`MobileViews_150001-291197.zip`**, **`MobileViews_150001-291197.parquet`** and **`MobileViews_index_150001-291197.csv`**: This set, containing IDs from 150,001 to 291,197.
- **`MobileViews_300000-400000.zip`**, **`MobileViews_300000-400000.parquet`** and **`MobileViews_index_300000-400000.csv`**: This set, containing IDs from 300,000 to 400,000.
- **`MobileViews_400001-522301.zip`**, **`MobileViews_400001-522301.parquet`** and **`MobileViews_index_400001-522301.csv`**: This set, containing IDs from 400,001 to 522,301.

### 2. MobileViews_Apps_CompleteTraces

The `MobileViews_Apps_CompleteTraces` folder is a new addition, providing complete interaction traces for apps. Each app trace includes screenshots, VH files, and actions taken within the app, organized as follows:

- **`Zip_Files/`**: Each `.zip` file represents a batch of app data, named with an index and total screenshot count (e.g., `001_8348.zip` : the first batch with 8,348 screenshots).
  - Inside each zip file are **200 subfolders**, each named by an app’s package name and containing interaction data for that app. Details on each app’s interaction data structure are provided below.
- **`OneExample.zip`**: A sample app trace illustrating the folder structure and contents for a single app. This zip file includes all files and subfolders needed to explore the sample app trace offline. After downloading and extracting `OneExample.zip`, you can open `index.html` in a web browser to interactively view the app trace structure, metadata, and interactions.
- **`Index_CSV.zip`**: This zip file contains all the `.csv` files listing the app package names and screenshot counts for each corresponding zip file (e.g., `001_8348.csv` for `001_8348.zip`).

#### App Trace Folder Structure

Each app’s folder within a zip file includes:

- **`states/`**: 
  - **Screenshots**: `.jpg` files for each interaction state (e.g., `screen_1.jpg`).
  - **View Hierarchies**: `.json` and `.xml` files for each screenshot's UI structure (e.g., `state_1.json` and `window_dump_1.xml`). The `.json` format, captured by DroidBot’s internal logic via Android Accessibility Service, and the `.xml` format, captured via ADB commands, are nearly identical but differ in specific attributes.
- **`views/`**: UI elements related to interactions, such as clicked or scrolled elements for each state transition.
- **`actions.csv`**: A log of interactions within the app, with each action recorded in three columns:
  - `from_state`: The state before the action.
  - `to_state`: The state after the action.
  - `action`: The specific interaction, such as an `intent` command or `touch` on a UI element (e.g., `<button>`, `<p>`), often with details like the element's `alt` text and bounding box coordinates.
- **`index.html`**: Open in a browser for an interactive visualization of app traces. Click nodes or edges to view metadata and interaction details for each UI state and transition.
- **`utg.js`**: Supports `index.html` with structured app trace data, including UI states, transitions, and app metadata.
- **`stylesheets/`**: CSS and JavaScript files for `index.html` rendering.

## 🔎 Detailed Metadata and File Descriptions

### AppMetadata.csv Columns

The `AppMetadata.csv` file contains detailed information about each app. Columns include:

| Column              | Description                          | Column              | Description                          |
|---------------------|--------------------------------------|---------------------|--------------------------------------|
| `title`             | App title                           | `installs`          | Number of installs                   |
| `minInstalls`       | Minimum number of installs          | `realInstalls`      | Real number of installs              |
| `score`             | App score (rating)                  | `ratings`           | Number of ratings                    |
| `reviews`           | Number of reviews                   | `histogram`         | Rating distribution                  |
| `price`             | App price                           | `free`              | Whether the app is free (True/False) |
| `offersIAP`         | Offers in-app purchases (True/False)| `inAppProductPrice` | In-app product price                 |
| `developer`         | Developer name                      | `developerId`       | Developer ID                         |
| `genre`             | App genre                           | `genreId`           | Genre ID                             |
| `categories`        | App categories                      | `contentRating`     | Content rating (e.g., Everyone, Teen)|
| `adSupported`       | App is ad-supported (True/False)    | `containsAds`       | App contains ads (True/False)        |
| `released`          | App release date                    | `lastUpdatedOn`     | Date of latest update                |
| `appId`             | Unique app identifier               |                      |                                      |


### Index and Parquet files for `MobileViews_Screenshots_ViewHierarchies`

1. Index CSV: Located in `MobileViews_Screenshots_ViewHierarchies/Index_CSV`, mapping screenshot IDs to their VH files.

    | Column       | Description                               |
    |--------------|-------------------------------------------|
    | `Image File` | Filename of the screenshot (e.g., 0.jpg)  |
    | `JSON File`  | Filename of the VH (e.g., 0.json) |

    **Example:**
    ```csv
    Image File,JSON File
    300000.jpg,300000.json
    300001.jpg,300001.json
    ```

2. **Parquet Columns**

    | Column          | Description                                                              |
    |-----------------|--------------------------------------------------------------------------|
    | `image_content` | Binary data representing the image file (e.g., screenshot in `.jpg` format) |
    | `json_content`  | JSON content representing the VH for the corresponding image |

    **Example Data in Parquet:**

    | image_content          | json_content                                                         |
    |------------------------|----------------------------------------------------------------------|
    | Binary image data       | `{"viewHierarchy": {"bounds": [0, 0, 1080, 1920], "viewClass": ...}`  |
    | Binary image data       | `{"viewHierarchy": {"bounds": [0, 0, 1080, 1920], "viewClass": ...}`  |
    | Binary image data       | `{"viewHierarchy": {"bounds": [0, 0, 1080, 1920], "viewClass": ...}`  |

### Index files for `MobileViews_Apps_CompeleteTraces`

Each index CSV in `MobileViews_Apps_CompleteTraces/Index_CSV.zip` lists the app package names and screenshot count in the corresponding zip file.

| apk_name                    | state_number |
|-----------------------------|--------------|
| com.sportzentral.app        | 25           |
| com.boostedproductivity.app | 23           |

## 🌏 How to Download

### Download via Hugging Face Python Library

**Install the library:**

```bash
pip install huggingface_hub
```

**Download specific files:**

```python
from huggingface_hub import hf_hub_download

# Download specific files
hf_hub_download(repo_id="mllmTeam/MobileViews", filename="MobileViews_Screenshots_ViewHierarchies/Parquets/MobileViews_0-150000.parquet")
hf_hub_download(repo_id="mllmTeam/MobileViews", filename="MobileViews_Screenshots_ViewHierarchies/Zip_Files/MobileViews_0-150000.zip")
hf_hub_download(repo_id="mllmTeam/MobileViews", filename="AppMetadata.csv")
```

**Download the entire repository:**

```python
from huggingface_hub

import snapshot_download

# Download the entire repository
snapshot_download(repo_id="mllmTeam/MobileViews")
```

## 📋 Usage Guidelines

### Using `zip` and `parquet` Files in `MobileViews_Screenshots_ViewHierarchies`

To verify file integrity before using the `zip` files, follow the steps below.

**Zip File Example**

```bash
# Follow these steps to validate and extract MobileViews_0-150000.zip before using its contents.
zip -T MobileViews_0-150000.zip   # Expected output: test of MobileViews_0-150000.zip OK

# Verify file counts for JSON and JPG files
unzip -l MobileViews_0-150000.zip | grep ".json" | wc -l  # Expected: 150001
unzip -l MobileViews_0-150000.zip | grep ".jpg" | wc -l   # Expected: 150001

# Check file size and SHA256 checksum
du -sh MobileViews_0-150000.zip  # Expected: 23G
sha256sum -c MobileViews_0-150000.zip.sha256  # Expected: MobileViews_0-150000.zip: OK

# Unzip
unzip MobileViews_0-150000.zip
```

**Parquet File Usage**

Parquet files are a columnar storage format that allows for efficient data handling, especially for large datasets. Each `.parquet` file contains binary data for screenshots and JSON data for VHs.

To explore or extract data from `.parquet` files, use the `useparquet.py` script provided. This script includes helpful functions, such as `check_row_count`, `save_n_images_and_jsons`, and `save_all_images_and_jsons`, to facilitate quick access to images and VHs.

```bash
pip install pyarrow

# Uncomment the function you need and run the helper script to interact with the .parquet file
python path/to/useparquet.py
```

### Mapping Screenshots and States in `MobileViews_Apps_CompleteTraces`

Each app's folder contains screenshots, states, and actions data. Use our screenshot-state mapping script (`MobileViews_Apps_CompleteTraces/screenshot_state_mapping.py`) to generate a CSV file mapping `screen_id`, `state_str (a unique hash representing each screenshot)`, `structure_str (a hash focusing on UI structure only)`, `vh_json_id` and `vh_xml_id`.

The script provides two main functions: 
- `process_single_folder(single_folder_path)` for one apk folder
- `process_multiple_folders(parent_folder_path)` for multiple APK folders

```bash
# Specify your folder path and uncomment the desired function:
# Run the script
python path/to/screenshot_state_mapping.py
```
You can also find the example output in `MobileViews_Apps_CompleteTraces/OneExample.zip`

## 🌟 Future Updates and Feedback

We’re continuously expanding the `MobileViews` dataset by crawling more apps and capturing a wider range of interactions. Future releases will bring even more data, making `MobileViews` an increasingly valuable resource for mobile UI research. 

If you have any questions, encounter issues, or want to share feedback, please don’t hesitate to reach out via email or leave a comment. We’re here to help and genuinely appreciate suggestions that could improve the dataset. Your insights are invaluable as we work to make `MobileViews` as helpful and impactful as possible for the research community.

Thank you for your support and for helping us grow `MobileViews`!

## 🔖 Citation

If you use this dataset in your research, please cite our work as follows:

```
@misc{gao2024mobileviewslargescalemobilegui,
      title={MobileViews: A Large-Scale Mobile GUI Dataset}, 
      author={Longxi Gao and Li Zhang and Shihe Wang and Shangguang Wang and Yuanchun Li and Mengwei Xu},
      year={2024},
      eprint={2409.14337},
      archivePrefix={arXiv},
      primaryClass={cs.HC},
      url={https://arxiv.org/abs/2409.14337}, 
}
```