File size: 9,789 Bytes
c99f4ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# Recipe1M Processed Dataset Collection
<!-- 
[![Dataset](https://img.shields.io/badge/Dataset-Recipe1M-orange?style=flat-square)](https://github.com/yourusername/recipe1m-processed)
[![License](https://img.shields.io/badge/License-Check%20Original-blue?style=flat-square)](LICENSE.md) -->

## Abstract

This repository provides two complementary processed datasets derived from the Recipe1M dataset:

1. **Instruction-Ingredient Alignment Dataset** (`processed_instructions.json`): Fine-grained instruction-ingredient alignment at the fragment level with multi-granularity ingredient representations
2. **Multimodal Recipe Dataset** (`train_data.json`, `val_data.json`, `test_data.json`): Recipe data with ingredient-image mappings and recipe images for multimodal learning

Together, these datasets enable comprehensive recipe understanding tasks including ingredient recognition, instruction generation, multimodal learning, and cooking process modeling.

---

## Table of Contents

- [Dataset Overview](#dataset-overview)
- [Dataset 1: Instruction-Ingredient Alignment](#dataset-1-instruction-ingredient-alignment)
- [Dataset 2: Multimodal Recipe Data](#dataset-2-multimodal-recipe-data)
- [Combined Usage Examples](#combined-usage-examples)
- [Use Cases](#use-cases)
- [License](#license)
- [Citation](#citation)

---

## Dataset Overview

| Dataset | Files | Key Features | Primary Use Cases |
|---------|-------|--------------|-------------------|
| **Instruction-Ingredient Alignment** | `processed_instructions.json` | Fragment-level alignment, multi-granularity ingredients | Instruction parsing, ingredient extraction, process understanding |
| **Multimodal Recipe Data** | `train_data.json`, `val_data.json`, `test_data.json` | Image mappings, standardized ingredients, train/val/test splits | Multimodal learning, image-based retrieval, model training |

---

## Dataset 1: Instruction-Ingredient Alignment

### Overview

Fine-grained instruction-ingredient alignment where each cooking instruction is fragmented at ingredient boundaries and aligned with corresponding ingredient information at three levels of granularity.

### File Structure

**processed_instructions.json**
- **Format**: JSON dictionary with recipe IDs as keys
- **Recipe ID Format**: 10-character hexadecimal (e.g., `e40cfb8510`)

### Data Schema

```json
{
  "id": "recipe_id",
  "instructions": [
    {
      "instruction": "cooking step text fragment",
      "raw_ing": "original ingredient with quantity",
      "final_ing": "standardized ingredient name",
      "no_with_ing": "ingredient without modifiers"
    }
  ]
}
```

### Field Descriptions

#### Top-Level Fields

| Field | Type | Description | Example |
|-------|------|-------------|---------|
| `id` | String | Unique recipe identifier | `"e40cfb8510"` |
| `instructions` | List | Cooking steps with ingredient alignment | See below |

#### Instruction Object Fields

| Field | Type | Description | Example |
|-------|------|-------------|---------|
| `instruction` | String | Instruction text fragment | `"stir together flour,"` |
| `raw_ing` | String/null | Original ingredient with quantities | `"2 c. flour"` |
| `final_ing` | String/null | Standardized ingredient name | `"flour"` |
| `no_with_ing` | String/null | Ingredient without modifiers | `"flour"` |

**Note**: `null` values indicate instruction steps without specific ingredient references (e.g., cooking techniques, equipment preparation).

### Example Data

```json
{
  "id": "e40cfb8510",
  "instructions": [
    {
      "instruction": "stir together flour,",
      "raw_ing": "2 c. flour",
      "final_ing": "flour",
      "no_with_ing": "flour"
    },
    {
      "instruction": " soda ",
      "raw_ing": "1 teaspoon baking soda",
      "final_ing": "baking soda",
      "no_with_ing": "baking soda"
    },
    {
      "instruction": "and salt.",
      "raw_ing": "1/2 teaspoon salt",
      "final_ing": "salt",
      "no_with_ing": "salt"
    },
    {
      "instruction": "stir into a very stiff batter.",
      "raw_ing": null,
      "final_ing": null,
      "no_with_ing": null
    },
    {
      "instruction": "bake 1 hour at 325 degrees.",
      "raw_ing": null,
      "final_ing": null,
      "no_with_ing": null
    }
  ]
}
```

### Key Features

- **Instruction Fragmentation**: Instructions split at ingredient boundaries while maintaining grammatical structure
- **Multi-Granularity**: Three levels of ingredient representation (raw, final, no modifiers)
- **Complete Process**: Includes all steps, both ingredient-specific and technique-only
- **Ingredient Repetition**: Tracks multiple uses of the same ingredient throughout the recipe

---

## Dataset 2: Multimodal Recipe Data

### Overview

Structured recipe data with ingredient-image mappings, standardized ingredient names, and associated recipe images. Split into training, validation, and test sets for machine learning workflows.

### File Structure

| File | Purpose | Recipe IDs Example |
|------|---------|-------------------|
| `train_data.json` | Training set | `df203c7b00`, `da3722f92a`, ... |
| `val_data.json` | Validation set | `da3722f92a`, ... |
| `test_data.json` | Test set | `da36dcb1f9`, ... |

### Data Schema

```json
{
  "recipe_id": {
    "ing_img_ids": [image_id or null, ...],
    "ing_text_18k": ["standardized_name" or null, ...],
    "ing_texts": ["original ingredient text" or null, ...],
    "instructions": ["step 1", "step 2", ...],
    "recipe_img_ids": ["image1.jpg", "image2.jpg", ...]
  }
}
```

### Field Descriptions

| Field | Type | Description | Example |
|-------|------|-------------|---------|
| `ing_img_ids` | List[int/null] | Image IDs from ingredient database | `[17263, 8861, None, ...]` |
| `ing_text_18k` | List[str/null] | Standardized names (18K vocabulary) | `['butter', 'olive oil', None, ...]` |
| `ing_texts` | List[str/null] | Original text with quantities | `['1 teaspoon butter', '2 teaspoons olive oil', ...]` |
| `instructions` | List[str] | Cooking steps in order | `['melt butter', 'add garlic', ...]` |
| `recipe_img_ids` | List[str] | Recipe image filenames | `['50cbeb2173.jpg', '95f9aa7309.jpg', ...]` |

### Example Data

```json
{
  "da3722f92a": {
    "ing_img_ids": [17263, 8861, 11498, 3496, None, 578],
    "ing_text_18k": ["butter", "olive oil", "garlic cloves", "shrimp", None, "lemon"],
    "ing_texts": [
      "1 teaspoon butter",
      "2 teaspoons olive oil",
      "3 garlic cloves, minced or pressed",
      "1 lb california shrimp or 1 lb spiny lobster",
      None,
      "1 lemon, juice of"
    ],
    "instructions": [
      "melt butter and oil together in saute pan.",
      "add garlic, saute for one minute, and add shrimp.",
      "saute for one minute, add wine, lemon juice, salt, and pepper.",
      "saute quickly while sauce reduces and shrimp turns pink.",
      "do not overcook.",
      "sprinkle with parsley before serving."
    ],
    "recipe_img_ids": [
      "50cbeb2173.jpg",
      "95f9aa7309.jpg",
      "b81c7c2b13.jpg",
      "977929a1ff.jpg"
    ]
  }
}
```

### Key Features

- **Multimodal Alignment**: Links text ingredients to visual representations
- **Standardization**: 18K ingredient vocabulary for consistency
- **Image References**: Both ingredient images and recipe images
- **Train/Val/Test Split**: Ready for supervised learning workflows
- **Null Handling**: Graceful handling of missing image mappings


---


---

## Related Resources

These processed datasets build upon:
- **Recipe1M Dataset**: Original source of recipe data and images
- **Ingredient Image Database**: Referenced by `ing_img_ids`
- **Recipe Image Database**: Referenced by `recipe_img_ids`
- **18K Ingredient Vocabulary**: Used for standardization

---

## License

Please refer to the original Recipe1M dataset license and terms of use. These processed versions maintain the same licensing requirements as the source dataset.

---

## Citation

If you use these datasets, please cite the original Recipe1M work:

```bibtex
@inproceedings{salvador2017learning,
  title={Learning Cross-Modal Embeddings for Cooking Recipes and Food Images},
  author={Salvador, Amaia and Hynes, Nicholas and Aytar, Yusuf and Marin, Javier and 
          Ofli, Ferda and Weber, Ingmar and Torralba, Antonio},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2017}
}
```
<!-- 
For these processed datasets:

```bibtex
@misc{recipe1m_processed_collection,
  title={Recipe1M Processed Dataset Collection: Instruction-Ingredient Alignment and Multimodal Recipe Data},
  author={Your Name},
  year={2025},
  howpublished={\url{https://github.com/yourusername/recipe1m-processed}},
}
``` -->

---

## Acknowledgments

These datasets are derived from the Recipe1M dataset. We acknowledge the original authors for their valuable contribution to the research community. The processing includes instruction-ingredient alignment and multimodal mappings to enable new research directions.

---
<!-- 
## Contact

For questions or issues regarding these processed datasets, please open an issue on GitHub or contact [your contact information].

--- -->

## Appendix: Quick Reference

### Dataset 1: Instruction-Ingredient Alignment
- **Files**: `processed_instructions.json`
- **Key Features**: Fragment-level alignment, 3 granularity levels
- **Best For**: Instruction parsing, ingredient extraction

### Dataset 2: Multimodal Recipe Data  
- **Files**: `train_data.json`, `val_data.json`, `test_data.json`
- **Key Features**: Image mappings, train/val/test split
- **Best For**: Multimodal learning, ingredient recognition

### Common Recipe ID Format
- **Format**: 10-character hexadecimal
- **Example**: `da3722f92a`, `e40cfb8510`
- **Usage**: Links recipes across both datasets