--- dataset_info: features: - name: image dtype: image - name: image_path dtype: string - name: caption dtype: string - name: merge_bbox list: - name: bbox sequence: int64 - name: text dtype: string splits: - name: train num_bytes: 7981174979729.586 num_examples: 4097983 - name: test num_bytes: 449181829.0 num_examples: 1000 download_size: 1024574096356 dataset_size: 7981624161558.586 configs: - config_name: default data_files: - split: train path: data/train-* - split: test path: data/test-* ---

TextGround4M: A Prompt-Aligned Dataset for Layout-Aware Text Rendering

TextGround4M is a large-scale dataset for prompt-grounded, layout-aware text rendering in text-to-image (T2I) generation, introduced in our AAAI 2026 paper.

arXiv Project Page Code

## Dataset Summary TextGround4M contains **4.1 million** prompt-image pairs, each annotated with: - A natural language caption where all rendered text spans are explicitly quoted - Span-level bounding boxes linking each quoted text to its spatial location in the image This fine-grained annotation enables layout-aware, prompt-grounded supervision for T2I models — a capability missing from prior datasets like MARIO-10M and AnyWord-3M. --- ## Dataset Structure ### Splits | Split | Samples | Description | |---|---|---| | `train` | ~4.1M | Training set with prompt-grounded bbox annotations | | `test` | 1,000 | TextGroundEval benchmark (Easy / Medium / Hard) | ### Data Fields | Field | Type | Description | |---|---|---| | `image` | `Image` | RGB image | | `image_path` | `string` | Original filename (UUID hex) | | `caption` | `string` | Natural language prompt with quoted text spans | | `merge_bbox` | `list` | List of `{"bbox": [x1, y1, x2, y2], "text": "..."}` | The `test` split additionally includes a `test/annotations.jsonl` file with `data_type` field (`easy` / `medium` / `hard`) for each sample. --- ## Usage ### Load with `datasets` ```python from datasets import load_dataset # Full dataset ds = load_dataset("CSU-JPG/Textground4M") # Train only train = load_dataset("CSU-JPG/Textground4M", split="train") # Test benchmark only test = load_dataset("CSU-JPG/Textground4M", split="test") ``` ### Load test split with `data_type` annotation ```python from huggingface_hub import hf_hub_download import json path = hf_hub_download("CSU-JPG/Textground4M", "test/metadata.jsonl", repo_type="dataset") records = [json.loads(l) for l in open(path)] # Each record has: image_path, caption, merge_bbox, data_type ``` --- ## License This dataset is released under the [MIT License](https://opensource.org/licenses/MIT). Please also comply with the licenses of the original source datasets used in construction. --- ## Citation ```bibtex @article{Mao_2026, title={TextGround4M: A Prompt-Aligned Dataset for Layout-Aware Text Rendering}, volume={40}, ISSN={2159-5399}, url={http://dx.doi.org/10.1609/aaai.v40i10.37736}, DOI={10.1609/aaai.v40i10.37736}, number={10}, journal={Proceedings of the AAAI Conference on Artificial Intelligence}, publisher={Association for the Advancement of Artificial Intelligence (AAAI)}, author={Mao, Dongxing and Wang, Yilin and Li, Linjie and Yang, Zhengyuan and Wang, Alex Jinpeng}, year={2026}, month=Mar, pages={7918–7926} } ```