File size: 8,233 Bytes
d021ade
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
796ab23
 
 
 
 
 
 
 
d021ade
796ab23
d021ade
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
796ab23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d021ade
9fe5378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-nc-sa-4.0
task_categories:
- zero-shot-classification
- zero-shot-image-classification
language:
- ar
- el
- en
- hi
- ja
- ko
- te
- th
- uk
- zh
tags:
- multimodal
- representation learning
- multilingual
pretty_name: Symile-M3
size_categories:
- 10M<n<100M
configs:
- config_name: symile-m3-5-m
  data_files:
  - split: train
    path: symile-m3-5-m/train-*
  - split: val
    path: symile-m3-5-m/val-*
  - split: test
    path: symile-m3-5-m/test-*
- config_name: symile-m3-5-s
  data_files:
  - split: train
    path: symile-m3-5-s/train-*
  - split: val
    path: symile-m3-5-s/val-*
  - split: test
    path: symile-m3-5-s/test-*
dataset_info:
- config_name: symile-m3-5-m
  features:
  - name: lang
    dtype: string
  - name: audio
    dtype: audio
  - name: image
    dtype: image
  - name: text
    dtype: string
  - name: cls
    dtype: string
  - name: cls_id
    dtype: int64
  - name: target_text
    dtype: string
  splits:
  - name: train
    num_bytes: 725049451643.0
    num_examples: 5000000
  - name: val
    num_bytes: 35602464495.0
    num_examples: 250000
  - name: test
    num_bytes: 36207897705.0
    num_examples: 250000
  download_size: 798705714640
  dataset_size: 796859813843.0
- config_name: symile-m3-5-s
  features:
  - name: lang
    dtype: string
  - name: audio
    dtype: audio
  - name: image
    dtype: image
  - name: text
    dtype: string
  - name: cls
    dtype: string
  - name: cls_id
    dtype: int64
  - name: target_text
    dtype: string
  splits:
  - name: train
    num_bytes: 142185812397.0
    num_examples: 1000000
  - name: val
    num_bytes: 7217779117.0
    num_examples: 50000
  - name: test
    num_bytes: 7586183683.0
    num_examples: 50000
  download_size: 159628727029
  dataset_size: 156989775197.0
---
# Dataset Card for Symile-M3
Symile-M3 is a multilingual dataset of (audio, image, text) samples. The dataset is specifically designed to test a model's ability to capture higher-order information between three distinct high-dimensional data types: by incorporating multiple languages, we construct a task where text and audio are both needed to predict the image, and where, importantly, neither text nor audio alone would suffice.
- Paper: https://arxiv.org/abs/2411.01053
- GitHub: https://github.com/rajesh-lab/symile
- Questions & Discussion: https://www.alphaxiv.org/abs/2411.01053v1

## Overview
![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/66d8e34b27d76ef6e481c2b5/mR0kJkgVyUK5rTNUOCOFx.jpeg)

Let `w` represent the number of languages in the dataset (`w=2`, `w=5`, and `w=10` correspond to Symile-M3-2, Symile-M3-5, and Symile-M3-10, respectively). An (audio, image, text) sample is generated by first drawing a short one-sentence audio clip from [Common Voice](https://commonvoice.mozilla.org/en/datasets) spoken in one of `w` languages with equal probability. An image is drawn from [ImageNet](https://www.image-net.org/) that corresponds to one of 1,000 classes with equal probability. Finally, text containing exactly `w` words is generated based on the drawn audio and image: one of the `w` words in the text is the drawn image class name in the drawn audio language. The remaining `w-1` words are randomly chosen from the ImageNet class names and written in one of the `w` languages such that there is no overlap in language or class name across the `w` words in the text. The words are separated by underscores, and their order is randomized.

## Tasks
The dataset was designed to evaluate a model on the zero-shot retrieval task of finding an image of the appropriate class given the audio and text. The most probable image for a given query audio and text pair, selected from all possible candidate images in the test set, is that with the highest similarity score.

The dataset was designed to ensure that neither text nor audio alone would suffice to predict the image. Therefore, success on this zero-shot retrieval task hinges on a model's ability to capture joint information between the three modalities.

### Dataset Structure

Each sample in the dataset is a dictionary containing the following fields:

```python
{
    # language code of the audio clip
    'lang': 'ja',
    
    # audio data
    'audio': {
        'path': 'common_voice_ja_39019065.mp3',                 # Common Voice filename
        'array': array([0.00000000e+00, ..., 7.78421963e-06]),  # raw audio waveform
        'sampling_rate': 32000                                  # sampling rate in Hz
    },
    
    # image as a PIL Image object (RGB, size varies)
    'image': <PIL.JpegImageFile image mode=RGB size=500x375>,
    
    # text containing w words (one per language) separated by underscores
    'text': 'σπιτάκι πουλιών_ドーム_प्रयोगशाला कोट_мавпа-павук_gown',
    
    # target word class name in English (key in translations.json)
    'cls': 'dome',
    
    # class ID from translations.json (0 to 999)
    'cls_id': 538,
    
    # target word (class name in the language of the audio)
    'target_text': 'ドーム'
}
```

The dataset includes a `translations.json` file that maps ImageNet class names across all supported languages. Each entry contains:
- The English class name as the key
- Translations for all supported languages (`ar`, `el`, `en`, `hi`, `ja`, `ko`, `te`, `th`, `uk`, `zh-CN`)
- The ImageNet synset ID
- A unique class ID (0-999)

Example structure:
```json
{
    "tench": {
        "synset_id": "n01440764",
        "cls_id": 0,
        "ar": "سمك البنش",
        "el": "είδος κυπρίνου",
        "en": "tench",
        "hi": "टेंच",
        "ja": "テンチ",
        "ko": "텐치",
        "te": "టెంచ్",
        "th": "ปลาเทนช์",
        "uk": "линь",
        "zh-CN": "丁鱥"
    }
}
```

## Dataset Variants
We release three variants of the dataset:
- Symile-M3-2 with 2 languages: English (`en`) and Greek (`el`).
- Symile-M3-5 with 5 languages: English (`en`), Greek (`el`), Hindi (`hi`), Japanese (`ja`), and Ukrainian (`uk`).
- Symile-M3-10 with 10 languages: Arabic (`ar`), Greek (`el`), English (`en`), Hindi (`hi`), Japanese (`ja`), Korean (`ko`), Telugu (`te`), Thai (`th`), Ukrainian (`uk`), and Chinese (`zh-CN`).

Each variant is available in four sizes:
- Large (`l`): 10M training samples, 500K validation samples, 500K test samples
- Medium (`m`): 5M training samples, 250K validation samples, 250K test samples
- Small (`s`): 1M training samples, 50K validation samples, 50K test samples
- Extra Small (`xs`): 500K training samples, 25K validation samples, 25K test samples

## Usage

Before using the dataset, ensure you have the required audio and image processing libraries installed:
```bash
pip install librosa soundfile pillow
```

To load a specific version of Symile-M3, use a configuration name following the pattern `symile-m3-{num_langs}-{size}` where:
- `num_langs` is `2`, `5`, or `10`
- `size` is `xs`, `s`, `m`, or `l`

For example, to load the `xs` version of Symile-M3-5:

```python
from datasets import load_dataset

dataset = load_dataset("arsaporta/symile-m3", "symile-m3-5-xs")

print(dataset['train'][0])    # access first train sample
print(len(dataset['train']))  # get number of train samples
```

To process the dataset without loading it entirely into memory, use streaming mode to load samples one at a time:

```python
from datasets import load_dataset

dataset = load_dataset("arsaporta/symile-m3", "symile-m3-5-xs", streaming=True)

print(next(iter(dataset['train'])))
```

To download the dataset for offline use:

```python
from huggingface_hub import snapshot_download

local_dir = snapshot_download(
    repo_id="arsaporta/symile-m3",
    repo_type="dataset",
    local_dir="./symile_data",   # where to save
    subfolder="symile-m3-5-xs",  # which configuration to download
)
```

## Citation

```
@inproceedings{saporta2024symile,
  title = {Contrasting with Symile: Simple Model-Agnostic Representation Learning for Unlimited Modalities}
  author = {Saporta, Adriel and Puli, Aahlad and Goldstein, Mark and Ranganath, Rajesh}
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024}
}
```