:wolf: COYO-700M: Image-Text Pair Dataset

November 14, 2022 · View on GitHub

COYO-700M is a large-scale dataset that contains 747M image-text pairs as well as many other meta-attributes to increase the usability to train various models. Our dataset follows a similar strategy to previous vision-and-language datasets, collecting many informative pairs of alt-text and its associated image in HTML documents. We expect COYO to be used to train popular large-scale foundation models complementary to other similar datasets.

More details on the data acquisition process can be found in [our paper] (which will be updated soon).

Updates

Data Collection Process

  • We collected about 10 billion pairs of alt-text and image sources in HTML documents in CommonCrawl from Oct. 2020 to Aug. 2021. and eliminated uninformative pairs through the image and text level filtering process with minimal cost. The following figure outlines our data collection procedure.
https://en.wikipedia.org/wiki/Napoleon

Data Filtering

Image Level

  • Included all image formats that Pillow library can decode. (JPEG, WEBP, PNG, BMP, ...)
  • Removed images less than 5KB image size.
  • Removed images with an aspect ratio greater than 3.0.
  • Removed images with min(width, height) < 200.
  • Removed images with a score of OpenNSFW2 or GantMan/NSFW higher than 0.5.
  • Removed all duplicate images based on the image pHash value from external public datasets.
    • ImageNet-1K/21K, Flickr-30K, MS-COCO, CC-3M, CC-12M

Text Level

  • Collected only English text using cld3.
  • Replaced consecutive whitespace characters with a single whitespace and removed the whitespace before and after the sentence.
    • e.g. "\n \n Load image into Gallery viewer, valentine&amp;#39;s day roses\n \n" → "Load image into Gallery viewer, valentine&amp;#39;s day roses"
  • Removed texts with a length of 5 or less.
  • Removed texts that do not have a noun form.
  • Removed texts with less than 3 words or more than 256 words and texts over 1000 in length.
  • Removed texts appearing more than 10 times.
    • e.g. “thumbnail for”, “image for”, “picture of”
  • Removed texts containing NSFW words collected from profanity_filter, better_profanity, and google_twunter_lol.

Image-Text Level

  • Removed duplicated samples based on (image_phash, text).
    • Different text may exist for the same image URL.

Dataset Preview

id                                                                             url                                                                             textwidthheightimage_phashtext_lengthword_countnum_tokens_bertnum_tokens_gptnum_facesclip_similarity_vitb32clip_similarity_vitl14nsfw_score_opennsfw2nsfw_score_gantmanwatermark_scoreaesthetic_score_laion_v2
4896263451343Fishing Fleet (Monterey), California art by Art Riley. HD giclee art prints for sale at CaliforniaWatercolor.com - original California paintings, & premium giclee prints for sale600447bac58374982e0fc717825394000.3193360.2481692.54512e-050.02938610.04060097.04812
1425929344479The Gate by Pete24536003478374726575bc0f8a2046600.249390.2037356.97374e-060.008232760.07214156.98521
7456063527931Beautiful Pictures From the Shores of the Mythical Land (42600320949d1fe559e2cc905910111400.2907710.1793210.01306150.01786280.4896426.94643
3221225511175contemporary expensive lighting fixtures with minimum lighting800499e5ea35075ab912c66277800.2639160.2178960.0009908680.01371140.09607484.57594
5626407855002Nintendo Co.'s Super Mario is displayed on coffee mugs for sale at the Nintendo World store in New York, U.S., on Friday, May 17, 2013.200013099311891e9437f4f313527373500.4008780.3166500.003629680.03175190.00226936.324910
1125282207474FILE PHOTO: A rainbow appears on the Auckland skyline featuring Sky Tower in New Zealand80052585b89c0166ee63be8815161600.44531250.35058592.640485e-050.0120740.02191295.294523
1434519186493A man covers himself with algae as he poses for photographs on a beach in Qingdao, Shandong province on Tuesday, July 23, 2013. -- FILE PHOTO: REUTERS860573f2c48dabbf93810a15026353670.41650390.34277340.0250090.016080.0727756.833739

Dataset Numbers

countratio
# of image-text pairs746,972,269100.00%
# of unique urls656,114,78387.84%
# of unique image_phash579,679,13777.60%
# of unique text566,253,88875.81%

Meta-Attributes

Attributes

nametypedescription
idlongUnique 64-bit integer ID generated by monotonically_increasing_id()
urlstringThe image URL extracted from the src attribute of the <img> tag
textstringThe text extracted from the alt attribute of the <img> tag
widthintegerThe width of the image
heightintegerThe height of the image
image_phashstringThe perceptual hash(pHash) of the image
text_lengthintegerThe length of the text
word_countintegerThe number of words separated by spaces.
num_tokens_bertintegerThe number of tokens using BertTokenizer
num_tokens_gptintegerThe number of tokens using GPT2TokenizerFast
num_facesintegerThe number of faces in the image detected by SCRFD
clip_similarity_vitb32floatThe cosine similarity between text and image(ViT-B/32) embeddings by OpenAI CLIP
clip_similarity_vitl14floatThe cosine similarity between text and image(ViT-L/14) embeddings by OpenAI CLIP
nsfw_score_opennsfw2floatThe NSFW score of the image by OpenNSFW2
nsfw_score_gantmanfloatThe NSFW score of the image by GantMan/NSFW
watermark_scorefloatThe watermark probability of the image by our internal model
aesthetic_score_laion_v2floatThe aesthetic score of the image by LAION-Aesthetics-Predictor-V2

Statistics

  • Statistics for numeric columns
widthheighttext_lengthword_countnum_tokens_bertnum_tokens_gptnum_faces
mean621.78540.9968.5311.1315.7517.240.60
min20020063130
max214492250710003238111523736
watermark_scoreclip_similarity_vitb32clip_similarity_vitl14aesthetic_score_laion_v2nsfw_score_opennsfw2
mean0.1785440.2912660.2546324.7691320.012903
min0.0-0.080871-0.1762691.1717120.0
max1.00.5917960.5815428.0826070.499755
  • Image Size statistics_image_size.png
  • CLIP Similarity statistics_clip_similarity.png
  • Text Length & Word Size img.png
  • Watermark score img.png
  • Aesthetic score img.png
  • Number of faces img.png
  • For more detailed statistics on COYO-700M, please see the Data Studio report on COYO-700M.

Getting Started

Download

Usage

Experiments

We empirically validated the quality of COYO dataset by re-implementing popular models such as ALIGN, unCLIP, and ViT. We trained these models on COYO-700M or its subsets from scratch, achieving competitive performance to the reported numbers or generated samples in the original papers. Since this observation supports the high quality of our dataset, we hope it to be continuously updated with open collaboration. Our pre-trained models and training codes will be released soon along with the technical report.

ALIGN

ModelDataImageNet KNNCOCO I2TCOCO T2I
EfficientNet-B7 + BERT-baseALIGN-1.8B69.30055.40041.700
EfficientNet-B7 + BERT-baseCOYO-700M68.61859.00042.419
  • Our experiment setup followed ALIGN.
    • We increased the batch size from 16K to 64K and reduced training steps by 1/4 for faster training.

unCLIP (OpenAI DALL·E 2)

<img src=./assets/dalle2_knight.png width=80% height=80%>
<img src=./assets/dalle2_andywarhol.png width=80% height=80%>
A high quality picture of a medieval knight with golden armorA person with the head of a cat in the style of Andy Warhol
<img src=./assets/dalle2_astronaut.png width=80% height=80%>
<img src=./assets/dalle2_darthvader.png width=80% height=80%>
A pencil drawing of an astronaut riding a horseGoryeo celadon in the shape of darth vader
  • We implemented the smaller version of unCLIP to validate the effectiveness of COYO for the text-conditional generation tasks.
  • Specifically, we tried to reproduce three components of the original unCLIP: diffusion-based prior, decoder with some modifications, and super-resolution model for upscaling 64x64 into 256x256px.
  • Detailed information on our modified version of unCLIP and quantitative analysis would be included in the upcoming technical report.

ViT

ModelDataImageNet
Validation
Top-1 Acc
ViT-L/16JFT-300M87.76%
ViT-L/16COYO-Labeled-300M87.24%
  • We also provide COYO-Labeled-300M by adding machine-generated vision labels to a subset of COYO-700M for comparison with the JFT-300M.
    • We first removed the duplicated images by image_phash.
    • Then, we labeled 300M unique images into 21,841 classes by EfficientNetV2-XL trained with ImageNet-21K dataset.
  • Our experiment setup followed ViT.
  • We also provide vit pre-training, fine-tuning code for reproducibility with weight files.

Citation

If you apply this dataset to any project and research, please cite our code:

@misc{kakaobrain2022coyo-700m,
  title         = {COYO-700M: Image-Text Pair Dataset},
  author        = {Byeon, Minwoo and Park, Beomhee and Kim, Haecheon and Lee, Sungjun and Baek, Woonhyuk and Kim, Saehoon},
  year          = {2022},
  howpublished  = {\url{https://github.com/kakaobrain/coyo-dataset}},
}

People

Disclaimer & Content Warning

The COYO dataset is recommended to be used for research purposes. Kakao Brain tried to construct a "Safe" dataset when building the COYO dataset. (See Data Filtering Section) Kakao Brain is constantly making efforts to create more "Safe" datasets. However, despite these efforts, this large-scale dataset was not hand-picked by humans to avoid the risk due to its very large size (over 700M). Keep in mind that the unscreened nature of the dataset means that the collected images can lead to strongly discomforting and disturbing content for humans. The COYO dataset may contain some inappropriate data, and any problems resulting from such data are the full responsibility of the user who used it. Therefore, it is strongly recommended that this dataset be used only for research, keeping this in mind when using the dataset, and Kakao Brain does not recommend using this dataset as it is without special processing to clear inappropriate data to create commercial products.

License

The COYO dataset of Kakao Brain is licensed under CC-BY-4.0 License. The full license can be found in the LICENSE.cc-by-4.0 file. The dataset includes “Image URL” and “Text” collected from various sites by analyzing Common Crawl data, an open data web crawling project. The collected data (images and text) is subject to the license to which each content belongs.

Obligation to use

While Open Source may be free to use, that does not mean it is free of obligation. To determine whether your intended use of the COYO dataset is suitable for the CC-BY-4.0 license, please consider the license guide. If you violate the license, you may be subject to legal action such as the prohibition of use or claim for damages depending on the use.

Contact

COYO dataset was released as an open source in the hope that it will be helpful to many research institutes and startups for research purposes. We look forward to contacting us from various places who wish to cooperate with us.

coyo@kakaobrain.com