|
--- |
|
dataset_info: |
|
features: |
|
- name: question_id |
|
dtype: int64 |
|
- name: image |
|
dtype: image |
|
- name: caption |
|
dtype: string |
|
- name: stacked_image |
|
dtype: image |
|
- name: only_it_image |
|
dtype: image |
|
- name: only_it_image_small |
|
dtype: image |
|
- name: crossed_text |
|
sequence: string |
|
splits: |
|
- name: test |
|
num_bytes: 19073565 |
|
num_examples: 100 |
|
download_size: 19047792 |
|
dataset_size: 19073565 |
|
configs: |
|
- config_name: default |
|
data_files: |
|
- split: test |
|
path: data/test-* |
|
license: cc-by-sa-4.0 |
|
task_categories: |
|
- visual-question-answering |
|
- mask-generation |
|
language: |
|
- en |
|
pretty_name: VCR |
|
arxiv: 2406.06462 |
|
size_categories: |
|
- n<1K |
|
--- |
|
# The VCR-Wiki Dataset for Visual Caption Restoration (VCR) |
|
|
|
๐ [Paper](https://arxiv.org/abs/2406.06462) | ๐ฉ๐ปโ๐ป [GitHub](https://github.com/tianyu-z/vcr) | ๐ค [Huggingface Datasets](https://huggingface.co/vcr-org) | ๐ [Evaluation with lmms-eval](https://github.com/EvolvingLMMs-Lab/lmms-eval) |
|
|
|
This is the official Hugging Face dataset for VCR-Wiki, a dataset for the [Visual Caption Restoration (VCR)](https://arxiv.org/abs/2406.06462) task. |
|
|
|
VCR is designed to measure vision-language models' capability to accurately restore partially obscured texts using pixel-level hints within images. text-based processing becomes ineffective in VCR as accurate text restoration depends on the combined information from provided images, context, and subtle cues from the tiny exposed areas of masked texts. |
|
|
|
![image/jpg](https://raw.githubusercontent.com/tianyu-z/VCR/main/assets/main_pic_en_easy.jpg) |
|
|
|
We found that OCR and text-based processing become ineffective in VCR as accurate text restoration depends on the combined information from provided images, context, and subtle cues from the tiny exposed areas of masked texts. We develop a pipeline to generate synthetic images for the VCR task using image-caption pairs, with adjustable caption visibility to control the task difficulty. However, this task is generally easy for native speakers of the corresponding language. Initial results indicate that current vision-language models fall short compared to human performance on this task. |
|
|
|
## Evaluation |
|
|
|
We recommend you to evaluate your model with [lmms-eval](https://github.com/EvolvingLMMs-Lab/lmms-eval). Before evaluating, please refer to the doc of `lmms-eval`. |
|
|
|
```console |
|
pip install git+https://github.com/EvolvingLMMs-Lab/lmms-eval.git |
|
|
|
# We use MiniCPM-Llama3-V-2_5 and vcr_wiki_en_easy as an example |
|
python3 -m accelerate.commands.launch \ |
|
--num_processes=8 \ |
|
-m lmms_eval \ |
|
--model minicpm_v \ |
|
--model_args pretrained="openbmb/MiniCPM-Llama3-V-2_5" \ |
|
--tasks vcr_wiki_en_easy \ |
|
--batch_size 1 \ |
|
--log_samples \ |
|
--log_samples_suffix MiniCPM-Llama3-V-2_5_vcr_wiki_en_easy \ |
|
--output_path ./logs/ |
|
``` |
|
|
|
`lmms-eval` supports the following VCR `--tasks` settings: |
|
|
|
* English |
|
* Easy |
|
* `vcr_wiki_en_easy` (full test set, 5000 instances) |
|
* `vcr_wiki_en_easy_500` (first 500 instances in the vcr_wiki_en_easy setting) |
|
* `vcr_wiki_en_easy_100` (first 100 instances in the vcr_wiki_en_easy setting) |
|
* Hard |
|
* `vcr_wiki_en_hard` (full test set, 5000 instances) |
|
* `vcr_wiki_en_hard_500` (first 500 instances in the vcr_wiki_en_hard setting) |
|
* `vcr_wiki_en_hard_100` (first 100 instances in the vcr_wiki_en_hard setting) |
|
* Chinese |
|
* Easy |
|
* `vcr_wiki_zh_easy` (full test set, 5000 instances) |
|
* `vcr_wiki_zh_easy_500` (first 500 instances in the vcr_wiki_zh_easy setting) |
|
* `vcr_wiki_zh_easy_100` (first 100 instances in the vcr_wiki_zh_easy setting) |
|
* Hard |
|
* `vcr_wiki_zh_hard` (full test set, 5000 instances) |
|
* `vcr_wiki_zh_hard_500` (first 500 instances in the vcr_wiki_zh_hard setting) |
|
* `vcr_wiki_zh_hard_100` (first 100 instances in the vcr_wiki_zh_hard setting) |
|
|
|
## Dataset Statistics |
|
|
|
We show the statistics of the original VCR-Wiki dataset below: |
|
|
|
![image/png](https://cdn-uploads.huggingface.co/production/uploads/62bb1e0f3ff437e49a3088e5/CBS35FnFi9p0hFY9iJ0ba.png) |
|
|
|
## Dataset Construction |
|
|
|
![image/png](https://raw.githubusercontent.com/tianyu-z/VCR/main/assets/vcr_pipeline.png) |
|
|
|
* **Data Collection and Initial Filtering**: The original data is collected from [wikimedia/wit_base](https://huggingface.co/datasets/wikimedia/wit_base). Before constructing the dataset, we first filter out the instances with sensitive content, including NSFW and crime-related terms, to mitigate AI risk and biases. |
|
|
|
* **N-gram selection**: We first truncate the description of each entry to be less than 5 lines with our predefined font and size settings. We then tokenize the description for each entry with spaCy and randomly mask out 5-grams, where the masked 5-grams do not contain numbers, person names, religious or political groups, facilities, organizations, locations, dates and time labeled by spaCy, and the total masked token does not exceed 50\% of the tokens in the caption. |
|
|
|
* **Create text embedded in images**: We create text embedded in images (TEI) for the description, resize its width to 300 pixels, and mask out the selected 5-grams with white rectangles. The size of the rectangle reflects the difficulty of the task: (1) in easy versions, the task is easy for native speakers but open-source OCR models almost always fail, and (2) in hard versions, the revealed part consists of only one to two pixels for the majority of letters or characters, yet the restoration task remains feasible for native speakers of the language. |
|
|
|
* **Concatenate Images**: We concatenate TEI with the main visual image (VI) to get the stacked image. |
|
|
|
* **Second-round Filtering**: We filter out all entries with no masked n-grams or have a height exceeding 900 pixels. |
|
|
|
## Data Fields |
|
|
|
* `question_id`: `int64`, the instance id in the current split. |
|
* `image`: `PIL.Image.Image`, the original visual image (VI). |
|
* `stacked_image`: `PIL.Image.Image`, the stacked VI+TEI image containing both the original visual image and the masked text embedded in image. |
|
* `only_id_image`: `PIL.Image.Image`, the masked TEI image. |
|
* `caption`: `str`, the unmasked original text presented in the TEI image. |
|
* `crossed_text`: `List[str]`, the masked n-grams in the current instance. |
|
|
|
## Disclaimer for the VCR-Wiki dataset and Its Subsets |
|
|
|
The VCR-Wiki dataset and/or its subsets are provided under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. This dataset is intended solely for research and educational purposes in the field of visual caption restoration and related vision-language tasks. |
|
|
|
Important Considerations: |
|
|
|
1. **Accuracy and Reliability**: While the VCR-Wiki dataset has undergone filtering to exclude sensitive content, it may still contain inaccuracies or unintended biases. Users are encouraged to critically evaluate the dataset's content and applicability to their specific research objectives. |
|
|
|
2. **Ethical Use**: Users must ensure that their use of the VCR-Wiki dataset aligns with ethical guidelines and standards, particularly in avoiding harm, perpetuating biases, or misusing the data in ways that could negatively impact individuals or groups. |
|
|
|
3. **Modifications and Derivatives**: Any modifications or derivative works based on the VCR-Wiki dataset must be shared under the same license (CC BY-SA 4.0). |
|
|
|
4. **Commercial Use**: Commercial use of the VCR-Wiki dataset is permitted under the CC BY-SA 4.0 license, provided that proper attribution is given and any derivative works are shared under the same license. |
|
|
|
By using the VCR-Wiki dataset and/or its subsets, you agree to the terms and conditions outlined in this disclaimer and the associated license. The creators of the dataset are not liable for any direct or indirect damages resulting from its use. |
|
|
|
## Citation |
|
|
|
If you find VCR useful for your research and applications, please cite using this BibTeX: |
|
|
|
```bibtex |
|
@article{zhang2024vcr, |
|
title = {VCR: Visual Caption Restoration}, |
|
author = {Tianyu Zhang and Suyuchen Wang and Lu Li and Ge Zhang and Perouz Taslakian and Sai Rajeswar and Jie Fu and Bang Liu and Yoshua Bengio}, |
|
year = {2024}, |
|
journal = {arXiv preprint arXiv: 2406.06462} |
|
} |
|
``` |