File size: 4,915 Bytes
ed55fb6
 
54a3444
 
 
 
 
ed55fb6
 
 
 
54a3444
 
 
 
 
 
 
 
 
 
ed55fb6
 
54a3444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ed55fb6
54a3444
 
 
ed55fb6
54a3444
ed55fb6
11af8a5
54a3444
11af8a5
 
 
 
 
54a3444
11af8a5
 
 
 
54a3444
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
---
license: mit
task_categories:
- zero-shot-image-classification
- image-classification
- image-to-text
- text-to-image
language:
- en
size_categories:
- 10M<n<100M
tags:
- clip
- vision-language
- knowledge-graph
- wikidata
- image-text
- biodiversity
- species-recognition
- fine-grained-classification
pretty_name: EntityNet
---

# EntityNet

**33M web images paired with 46M texts, harvested by querying image search with 135k visual entities from Wikidata.**

EntityNet is the training set from *Using Knowledge Graphs to Harvest Datasets for Efficient CLIP Model Training* (GCPR 2025). Instead of scraping the web and filtering afterwards, we start from a knowledge graph: we extract visual entities and their attributes from Wikidata, turn them into search queries, and collect the returned images together with their alt texts.

[Paper](https://arxiv.org/abs/2505.02746) · [Code](https://github.com/lmb-freiburg/entitynet) · [Project page](https://entity-net.github.io) · [Models](https://huggingface.co/collections/lmb-freiburg/entitynet-6810b98ea9288fef9b6c09ca)

## Why use it

- **Compute-efficient CLIP training.** CLIP models trained from scratch on EntityNet reach strong ImageNet and fine-grained results with a fraction of the compute of models trained on billion-scale web crawls.
- **Structured labels, not just alt text.** Every image traces back to the Wikidata entity and query that found it. Mixing these entity labels with the alt texts during training works better than either alone.
- **Domain experts from a subset.** A 10M-image subset of living organisms (animals, plants, fungi) trains a species-recognition model that outperforms BioCLIP (trained on the same order of data, TreeOfLife-10M) on the Rare Species benchmark.

## What's covered

135k entities from 21 Wikidata super-categories:

product, substance, physical tool, animal, plant, material, vehicle, geographical feature, food, architectural structure, anatomical structure, facility, physical activity, clothing, building, musical instrument, organ, furniture, body of water, weather, precipitation

The full entity list with Wikidata IDs, attributes and parent relations is in [`entitynet-entities.parquet`](https://github.com/lmb-freiburg/entitynet/blob/main/entitynet-entities.parquet), and the generated search queries are in [`entitynet-queries.parquet`](https://github.com/lmb-freiburg/entitynet/blob/main/entitynet-queries.parquet).

## Data format

This repository contains **URLs and texts, not image files.** Use the download scripts in the GitHub repo to fetch the images and build webdataset shards.

| Split | Rows |
|---|---|
| train | 31.7M |
| validation | 19.4k |
| test | 19.3k |

Each row is one unique (deduplicated) image:

| Column | Description |
|---|---|
| `key` | Unique sample ID |
| `qh` | Hashes of the search queries that returned this image (join with `entitynet-queries.parquet`) |
| `texts` | Alt texts and page titles collected for the image |
| `images_link` | Image URLs (several URLs can point to the same image) |
| `images_contextlink` | URLs of the pages the image appeared on |
| `images_width`, `images_height` | Image size per URL |

## Quickstart

Browse the metadata:

```python
from datasets import load_dataset

ds = load_dataset("lmb-freiburg/entitynet", split="validation")
print(ds[0]["texts"], ds[0]["images_link"])
```

Download images and build training shards (see the [GitHub README](https://github.com/lmb-freiburg/entitynet) for setup):

```bash
python -m entitynet.cli.urlbuild_step1_metadata --splits val,test,train
python -m entitynet.cli.urlbuild_step2_images
python -m entitynet.cli.urlbuild_step3_tars
```

Or skip training and use a pretrained model with open_clip:

```python
import open_clip
model, _, preprocess = open_clip.create_model_and_transforms("hf-hub:lmb-freiburg/CLIP-ViT-B-16-EntityNet-33M")
```

## Limitations

- Images come from the open web. URLs go stale over time, so a fresh download will recover fewer than 33M images.
- Image copyright stays with the original owners. The MIT license covers our metadata and code, not the images.
- Web images carry web biases: stock photos and product shots are over-represented, and artistic or sketch-style depictions are under-represented.

## Citation

```bibtex
@inproceedings{ging2026entitynet,
  author    = {Simon Ging and Sebastian Walter and Jelena Bratuli{\'c} and Johannes Dienert and Hannah Bast and Thomas Brox},
  title     = {Using Knowledge Graphs to Harvest Datasets for Efficient {CLIP} Model Training},
  booktitle = {Pattern Recognition, 47th {DAGM} German Conference, {DAGM} {GCPR} 2025, Freiburg, Germany, September 23--26, 2025, Proceedings},
  series    = {Lecture Notes in Computer Science},
  publisher = {Springer Nature Switzerland},
  year      = {2026},
  pages     = {287--302},
  isbn      = {978-3-032-12840-9},
  doi       = {10.1007/978-3-032-12840-9_19}
}
```