File size: 12,695 Bytes
9c6e082
 
 
 
 
 
 
 
 
73213f7
cff06be
 
f5909dc
cff06be
 
 
 
 
 
 
 
98296c8
cff06be
 
 
8605650
cff06be
 
 
8605650
2f441c8
8605650
cff06be
9fccbc7
cff06be
 
 
 
8605650
cff06be
 
73213f7
cff06be
 
 
 
 
 
8605650
cff06be
 
8a539fc
cff06be
8605650
98296c8
 
20dc7be
 
cff06be
8605650
cff06be
46c23b7
ceb4c74
8605650
ceb4c74
5ca3788
c778782
20b8eb5
ceb4c74
5ca3788
 
 
da17fc5
46b2d10
3f1725b
a8ac10c
ceb4c74
b97f6c3
c778782
ceb4c74
 
0b14e92
b97f6c3
 
0b14e92
b97f6c3
 
0b14e92
ceb4c74
 
0b14e92
ceb4c74
 
0b14e92
d64f300
 
 
65affe5
d64f300
 
 
 
 
 
 
 
 
 
a8ac10c
ceb4c74
 
 
 
cff06be
a8ac10c
65affe5
 
 
20dc7be
65affe5
 
 
20dc7be
98296c8
236e3ca
 
 
 
 
 
 
 
 
 
 
a5d31a8
 
 
 
 
 
 
 
 
 
 
04cbf6a
5d22c29
98296c8
 
 
cff06be
9fccbc7
f1a9f20
46c23b7
 
f1a9f20
 
cff06be
 
 
46c23b7
cff06be
609ceb1
cff06be
8605650
20dc7be
f1a9f20
cff06be
20dc7be
cff06be
20dc7be
 
 
 
 
f1a9f20
cff06be
20dc7be
 
8605650
46c23b7
 
20dc7be
5d22c29
 
98296c8
5d22c29
 
20dc7be
 
cff06be
5dd51d2
 
 
 
 
c9499e3
5dd51d2
 
 
 
 
 
 
 
c9499e3
5dd51d2
d45a420
5dd51d2
20dc7be
 
cff06be
8605650
20dc7be
 
 
 
 
cff06be
 
 
9fccbc7
2a806ab
 
 
 
 
 
cff06be
20dc7be
cff06be
 
 
 
ceb4c74
98296c8
 
cff06be
 
20dc7be
 
cff06be
 
 
8605650
5082185
 
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
---
license: cc
task_categories:
- text-to-image
tags:
- art
size_categories:
- 10M<n<100M
---
# Dataset Card for Fondant Creative Commons 25 million (fondant-cc-25m)


![image/png](https://cdn-uploads.huggingface.co/production/uploads/6266919100f1a3335dbd966f/latKi21OzpP2gaIvMGXz5.png)

## Table of Contents
- [Table of Contents](#table-of-contents)
- [Dataset Description](#dataset-description)
  - [Changelog](#changelog)
  - [Dataset Summary](#dataset-summary)
  - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
  - [How to use it](#how-to-use-it)
  - [How to contribute](#how-to-contribute)
- [Dataset Structure](#dataset-structure)
  - [Data Instances](#data-instances)
  - [Data Fields](#data-fields)
  - [Data Splits](#data-splits)
- [Dataset Creation](#dataset-creation)
  - [Curation Rationale](#curation-rationale)
  - [Source Data](#source-data)
  - [Data Collection and Preprocessing](#data-collection-and-preprocessing)
  - [Privacy statement](#privacy-statement)
  - [Opting out](#opting-out)
- [Considerations for Using the Data](#considerations-for-using-the-data)
  - [Disclaimer](#disclaimer)
  - [Discussion of Biases](#discussion-of-biases)
- [Additional Information](#additional-information)
  - [Dataset Curators](#dataset-curators)
  - [Licensing Information](#licensing-information)
  - [Contact](#contact)


## Dataset Description
- **Homepage:** https://www.fondant.ai/
- **Repository:** https://github.com/ml6team/fondant
- **Paper:** N/A
- **Leaderboard:** N/A
- **Point of Contact:** info@fondant.ai

### Changelog
|Release|Description|
|-|-|
|v0.1| Release of the Fondant-cc-25m dataset

### Dataset Summary
Fondant-cc-25m contains 25 million image URLs with their respective [Creative Commons](https://creativecommons.org/) 
license information collected from the [Common Crawl web corpus](https://commoncrawl.org/). 
The dataset was created using [Fondant](https://fondant.ai), an open source framework that aims to simplify and speed up 
large-scale data processing by making self-contained pipeline components reusable across pipelines, infrastructures and shareable within the community.

### Supported Tasks and Leaderboards

This dataset can be used for training or fine-tuning image generation or computer vision models.

### How to use it

To execute the pipeline locally, you must have [docker compose](https://docs.docker.com/compose/),
[Python](https://python.org) >=3.8 and [Git](https://git-scm.com/) installed on your system.
To ensure a successful example run, please allocate at least 8GB of RAM to your Docker environment.

**Note:** For Apple M1/M2 ship users: 
- Make sure that Docker uses linux/amd64 platform and not arm64. In Docker Dashboard go to Settings>Features in development, make sure to uncheck `Use containerid for pulling and storing images`.
- For improved execution speed, check the box that says `Use Rosetta for x86/amd64 emulation on Apple Silicon`.

We have prepared a sample Fondant pipeline for downloading the dataset.

1) Install Fondant by running:

```bash
pip install fondant
```

2) Clone the [sample GitHub repository](https://github.com/ml6team/fondant-usecase-filter-creative-commons)

```bash
git clone https://github.com/ml6team/fondant-usecase-filter-creative-commons.git
```

3) Make sure that Docker is running, navigate to the `src` folder, and initiate the pipeline by executing:

```bash
fondant run local pipeline
```

**Note:** For local testing purposes, the pipeline will only download the first 100 images. 
If you want to download the full dataset, you will need to modify the component arguments in the `pipeline.py` file, 
specifically the following part: 

```python
load_from_hf_hub = ComponentOp(
    component_dir="components/load_from_hf_hub",
    arguments={
        "dataset_name": "fondant-ai/fondant-cc-25m",
        "column_name_mapping": load_component_column_mapping,
        "n_rows_to_load": <HERE INSERT THE NUMBER OF IMAGES YOU WANT TO DOWNLOAD>
    },
)
```

4) To visually inspect the results quickly, you can use:

```bash
fondant explore --base_path ./data
```

5) You can also choose to download images to your local machine if you prefer, we have provided an [example script](https://huggingface.co/datasets/fondant-ai/fondant-cc-25m/blob/main/extract_images.py)
that enabled this: 

To run the script, you can simply execute the following: 

```bash
python extract_images.py --parquet_file <Path to the Parquet file or folder containing the images> --save_folder <The folder where to save the images to>
```

### How to contribute

If you want to contribute to the dataset, the best way is to help us develop pipeline components for further processing. 

Creating custom pipelines for specific purposes requires different building blocks. 
Fondant pipelines can mix reusable components and custom components. 


![image/png](https://cdn-uploads.huggingface.co/production/uploads/6266919100f1a3335dbd966f/a3IM5qWNUw0mv2r8t3_oN.png)

Components we are currently looking to add are the following ([GitHub issues](https://github.com/ml6team/fondant/issues?q=is%3Aissue+is%3Aopen+label%3A%22Component+Contribution%22)):

- πŸ‘― Image-based deduplication
- πŸ–₯️✎ Automatic captioning
- 🎨 Visual quality / aesthetic quality estimation
- πŸ” Watermark detection
- πŸ”ž Not safe for work (NSFW) content detection
- πŸ“‡ CLIP embedding generation
- 😐 Face detection
- πŸ™‹πŸ»β€β™‚οΈ Personal Identifiable Information (PII) detection
- πŸ“ Text detection
- πŸ€– AI generated image detection
- πŸ‘¬ Image-text CLIP similarity
- πŸ‘¨β€πŸŽ¨ Any components that you propose to develop

We are also looking for core framework contributors and users who are willing to give feedback on usability and suggest potential improvements


## Dataset Structure

### Data Instances
Each data instance corresponds to one image. The URL of the image is in the `image_url` feature, and other features (`alt_text`, `webpage_url`, etc) provide some 
metadata. Note that images have been deduplicated only based on their URLs.

### Data Fields
- `image_url` (string): image url to download the image
- `alt_text` (string): alternative text of the image
- `webpage_url` (string): webpage source of the image
- `license_type` (string): creative commons license type of the image
- `license_location` (string): location of the license on the webpage
- `surt_url` (string): sort friendly image url with top level domain as the prefix

### Data Splits
We do not provide any canonical splits for fondant-cc-25m.

## Dataset Creation

### Curation Rationale
Current AI image generation models such as Stable Diffusion and Dall-E are trained on hundreds of millions of images from the public Internet 
including copyrighted work. This creates legal risks and uncertainties for users of these images and is unfair towards copyright holders who 
may not want their proprietary work reproduced without consent. 
By releasing a Creative Commons image dataset, we hope to mitigate legal risks and empower ethical AI development that respects copyright.
This dataset is the first step towards our goal of a 500M Creative Commons image dataset.

### Source Data
fondant-cc-25m is built from CommonCrawl dumps. These dumps are constructed from crawling publicly available web pages.

### Data Collection and Preprocessing
Permissive licenses have minimal restrictions on how the image can be copied, modified, and redistributed. 
The full list of licenses can be found [here](https://creativecommons.org/about/cclicenses/).
We examined HTML tags of the webpages for the presence of Creative Commons license URLs. A webpage was marked permissive only when a license URL was found in 
its footer, aside or sidebar. This was the case only in around 0.164% of a 100k random sample from Common Crawl. This suggests that image generation models 
trained on a random sample from the public internet may be trained on up to 99.836% copyrighted images.

Subsequently, all the image URLs present on the web page were collected together with the license information. A manual check of a random
sample of 1032 images showed that 96.32% were attributed the correct license whil 3.68% were not.
False positives could be due to parsing errors but also incorrect attributions: images indicated by the publisher to be CC which are not.
More information on our approach can be found in [this blogpost](https://blog.ml6.eu/ai-image-generation-without-copyright-infringement-a9901b64541c).

### Privacy statement
It is possible that the dataset contains personal data, in that sense that we link to images with information that relates to an identified or identifiable living individual. We already take steps to reduce the processing of personal information when collecting our dataset, by, for example, (i) removing websites that aggregate large volumes of personal information and (ii) excluding websites that contain sensitive information about individuals.

The data controller
The data controller for the processing under the GDPR is Skyhaus BV (hereafter also referred to as β€œwe” or β€œour”), a company with its registered seat in Belgium, 
9000 Ghent, Esplanade Oscar Van de Voorde 1, and with the enterprise number 0502.515.626. Our Data Protection Officer can be contacted via [dpo@skyhaus.com](mailto:privacy@fondant.ai).

We process the personal data lawfully
We base our collection of personal data that is included in the dataset on our legitimate interests according to the GDPR (article 6.1.f GDPR), for the purpose of 
establishing an open source framework for data preparation and fine-tuning of foundation models. Please note that we never store the personal data as such and that we 
never use the dataset for any other purpose. 

Execution of the rights of data subjects. 
Individuals have the right to access, correct, restrict, delete, or transfer their personal information that may be included in our dataset. 
You can exercise these rights by reaching out to [dpo@skyhaus.com](mailto:privacy@fondant.ai). Please be aware that some rights may not be absolute and that we may decline a request if 
we have a lawful reason for doing so. However, we strive to prioritize the protection of personal information and comply with the GDPR or other privacy laws. 
If you feel we have not adequately addressed a request, you have the right to lodge a complaint with your local supervisory authority. 

The PII filtering pipeline for this dataset is still a work in progress. Researchers that wish to contribute to the anonymization pipeline of the project can join 
[here](https://github.com/ml6team/fondant/tree/main#-contributing). 

### Opting out
Fondant-cc-25m is based on CommonCrawl. Their crawler honors opt-out requests in the robots.txt, see the 
[CC FAQ](https://commoncrawl.org/big-picture/frequently-asked-questions/) for details.

We are giving the public the ability to have their image removed from the dataset upon request. The process for submitting and enacting removal requests will keep 
evolving throughout the project as we receive feedback and build up more data governance tools.
If you'd like to have your data removed from the dataset, [contact us](mailto:info@fondant.ai).

## Considerations for Using the Data

### Disclaimer
Fondant is making significant efforts to respect the intellectual property rights of third parties by publishing a dataset of 
Creative Commons licensed images. Under no circumstances can Fondant be held liable by a third party for (i) the accuracy or correctness 
of the content, (ii) an alleged infringement of intellectual property rights or (iii) any other alleged claim, action, injunction or suit 
resulting from the publication or use of the dataset.

### Discussion of Biases
As toxic or biased data is prevalent on the internet, it is possible that our dataset contains such content. 

## Additional Information

### Dataset Curators
1. Sharon Grundmann, ML6, sharon.grundmann@ml6.eu
2. Matthias Richter, ML6, matthias.richter@ml6.eu
3. Robbe Sneyders, ML6, robbe.sneyders@ml6.eu

### Licensing Information
Fondant-cc-25m is a collection of images with various Creative Commons and other public licenses. Any use of all or part of the images gathered in Fondant-cc-25m 
must abide by the terms of the original licenses, including attribution clauses when relevant. We facilitate this by providing provenance information for each data point.

The list of Creative Commons license types included in the dataset can be found [here](https://creativecommons.org/about/cclicenses/).

### Contact
- Email: [info@fondant.ai](mailto:info@fondant.ai)
- Discord: [https://discord.gg/HnTdWhydGp](https://discord.gg/HnTdWhydGp)