Organizations: Department of Computational Biology, Indraprastha Institute of Information Technology Delhi (IIIT-Delhi), New Delhi, 110020, India · Infosys Centre for Artificial Intelligence, Indraprastha Institute of Information Technology Delhi (IIIT-Delhi), New Delhi, 110020, India · Center of Excellence in Healthcare, Indraprastha Institute of Information Technology Delhi (IIIT-Delhi), New Delhi, 110020, India · Department of Computer Science, Indraprastha Institute of Information Technology Delhi (IIIT-Delhi), New Delhi, 110020, India · Department of Social Sciences and Humanities, Indraprastha Institute of Information Technology Delhi (IIIT-Delhi), New Delhi, 110020, India
Cooking is a complex process that transforms raw ingredients into delicious and nutritious dishes, yet the recipes that encode this process remain largely free text; readable by people but not directly computable. Existing recipe collections capture fragments of this information, but no shared representation links a recipe's structured ingredient composition, its geo-cultural provenance, and its nutritional profile within a single queryable schema. We address this representation gap by formalizing a framework for recipe data structure that decomposes each recipe into typed ingredient entities, grounds those entities in a reference nutritional database, and annotates them with geo-cultural and dietary context. We present RecipeDB2, a structured compilation of 128,942 recipes with 35,474 ingredients from 32 regions and 99 countries. Ingredient phrases are parsed into seven culinary attributes using a transformer-based named-entity model; ingredients are linked to the USDA reference tables through a BERT embedding strategy (F1 = 87.90 on a manually adjudicated set of the 200 most frequent ingredients), yielding 148 nutritional parameters per mapped ingredient; a Random Forest classifier propagates 34 ingredient categories across the full vocabulary; and a deterministic, conservative rule set assigns each recipe a dietary style. Through RecipeDB2 (https://cosylab.iiitd.edu.in/recipedb2/), we demonstrate a scalable framework for making recipes computable, turning culinary heritage (long treated as an artistic rather than a quantitative object) into a data-driven analysis.
Figures & tables
Figure 1: The flow diagram depicting the framework for recipe data structure involving data compilation, curation, annotations, mapping, and estimation of the nutritional profiles. Building this framework involved the application of multiple machine-learning models. A deep-learning based named entity recognition model was used for extracting relevant culinary elements from the ingredient phrases. BERT was implemented to map ingredients from the recipes to those in the USDA nutrition table. A Random Forest model was used to predict the ingredient category. This framework for recipe data structure is generic and scalable.
Table 1: 20 most popular ingredients, their frequency, popularly used units, and unit counts.
Figure 2: Frequency rank distribution of units. The data indicates a presence of a thick-tailed (scale-free) distribution suggesting that few units are present in disproportionately high frequency.
Figure 3: A list of 50 most popular ingredient-unit pairs. An ingredient may have one or more units with which it occurs in the recipe’s text. For a longer list, please see Supplementary Figure S1.
Figure 4: Recipe size distribution before and after mapping to USDA suggesting no significant difference between the two. (inset) Frequency rank distribution before and after mapping to USDA.
Top X Ingredients
Model
Accuracy
Precision
Recall
F1 Score
10
BERT
80.00
80.00
100
88.88
RoBERTa
60.00
60.00
100
75.00
Jaccard
20.00
40.00
28.57
33.33
20
BERT
70.00
70.00
100
82.35
RoBERTa
50.00
50.00
100
66.67
Jaccard
25.00
57.14
25.00
34.78
Table 2: Comparison of performance of models in accurately mapping RecipeDB2 to USDA ingredient using metrics accuracy, precision, recall, and F1 score. The word embeddings were generated for the BERT, RoBERTa, and Jaccard models.
Model
Accuracy
Precision
Recall
F1 Score
RF
89.12
89.38
89.11
89.16
DT
87.19
87.44
87.18
87.25
SVM
85.31
86.06
85.31
85.48
LR
82.04
83.17
82.04
82.16
GB
80.74
83.05
80.74
81.09
NB
70.20
71.86
70.19
67.72
Table 3: Performance of machine learning models in predicting the category of each ingredient in terms of accuracy, precision, recall, and F1 score.
Continent
Region
Recipe Count
African
Middle Eastern
325
African
Northern Africa
1610
African
Rest Africa
2774
Asian
Chinese
5954
Asian
Indian Subcontinent
13780
Asian
Japanese
2063
Table S1: Mapping of cuisines from their (32) Regions to (7) Continents and (region-wise) number of recipes.
Figure S1: Visualization of the 100 most popular ingredient-unit pairs derived from the dataset. This figure illustrates the frequency of each ingredient along with its corresponding measurement unit, providing insights into common culinary practices. For example, ingredients such as ‘sugar’ are frequently measured in cups, while ‘spices’ are often measured in teaspoons or grams.
Figure S2: Statistics of 43 recipes that were left out of the BERT mapping protocol. The distribution of the recipe sizes has an average of 2.5, indicating that most of the recipes for which no ingredient was mapped to USDA consisted of a small number of ingredients. Christmas Truffle was an outlier, exhibiting a significantly larger recipe size of 8, suggesting it may involve ingredients that are difficult to find a corresponding USDA match.
Figure S3: Macro-nutrient analysis of recipes illustrating the distribution of key nutritional components. a. Protein distribution (grams), b. Carbohydrates (grams), c. Total lipids (fats) (grams), and d. Energy (calories). The data highlights variations in macro-nutrient composition across the recipes along with their mean and standard deviation, thus providing insights into the scatter of these macro-nutrients.
Figure S4: Frequency of ingredients in each of the 34 categories after implementing the Random Forest-based strategy. A total of 35,474 ingredients were mapped, of which 10,659 ( ∼ 30%) most frequently occurring were mapped manually, and the rest 24,815 ( ∼ 70%) were done using the automated, machine learning-based protocol.
Figure S5: Ingredient category composition of recipes for different cuisines (Region). For each cuisine, the heatmap represents the fraction of ingredients belonging to each ingredient category, highlighting the dominant and less prevalent ingredient categories in each cuisine. Additives, Spices, and Vegetables are among the most dominant ingredient categories, with a very heavy representation in the recipes, in general.
We present Epicure, a family of three sibling skip-gram ingredient embeddings retrained from scratch on a multilingual recipe corpus. We aggregate 4.14M recipes from 11 sources spanning seven languages, English, Chinese, Russian, Vietnamese, Spanish, Turkish, Indonesian, German, and Indian-English, and normalise the raw ingredient strings to 1,790 canonical entries via an LLM-augmented pipeline. A 203,508-edge ingredient-ingredient NPMI graph and an 80,019-edge typed FlavorDB ingredient-compound graph, 2,247 typed compound nodes across 15 categories, seed three Metapath2Vec variants that share architecture and hyperparameters and differ only in the random-walk schema: Cooc walks the co-occurrence graph only, Chem walks the typed compound metapaths only, and Core blends both via injected ingredient-ingredient walks at controlled mixing, placing each model at a distinct point on the chemistry-vs-recipe-context spectrum.
Computational nutrition needs precise ingredient data, but current databases are incomplete, inconsistent, and built for human reference rather than automated reasoning. LLMs could help fill these gaps, but single-pass outputs are unreliable and can introduce silent errors into downstream computation. We present a quality-controlled LLM pipeline for ingredient data acquisition that combines robust statistical estimation, domain-specific invariant checks, and a web-fetch fallback. An illustrative Heap's Law fit to 233 recipes suggests that unique-ingredient growth is sub-linear and front-loaded: the projected ratio of unique ingredients to recipes falls from 1.74 at 100 recipes to 0.19 at 5,000. For each ingredient attribute, repeated LLM queries are treated as samples from a model-induced answer distribution, and we apply robust point estimators and normalised confidence scores across numerical, Boolean, multiple-choice, open categorical, and optional integer types. An invariant guard layer enforces nutritional and logical self-consistency within each ingredient record. Minor numeric inconsistencies are reconciled via a linear program that minimises worst-case percentage deviation while preserving semantic zeros, and major violations are escalated to web-evidence-grounded repair, then human review only if that fails. On a curated 30-ingredient reference set, the pipeline achieves 98.4% exact match on nutrient flags and cuts median absolute percentage error on nutrient ratios from 31.9% for the median-aggregated baseline to 10.1%, a reduction of 21.8 percentage points, at an API cost of about $1 per ingredient. This frames LLM-assisted database construction as a controlled data-engineering workflow that makes uncertainty operational rather than discarding it.
James Izzard, Hassan Eshkiki, Fabio Caraffini
Swansea University, Department of Computer Science, Bay Campus, Swansea, SA1 8EN, Wales, UK
A chef's intuition about flavor, texture, and cultural identity represents tacit knowledge that is difficult to articulate yet central to culinary practice. We show that this knowledge is already encoded in FlavorGraph's 300-dimensional ingredient embeddings, trained on recipe cooccurrence and food chemistry, and that it can be systematically recovered. An LLM-augmented curation pipeline consolidates 6,653 raw FlavorGraph ingredients into 1,032 canonical entries, substantially strengthening the recoverable structure. We identify at least fifteen independently classifiable dimensions spanning taste, texture, geography, food processing, and culture.