A framework for recipe data structure with applications for culinary and nutritional insights

arXiv cs.CL Papers

Summary

This paper presents RecipeDB2, a structured dataset of 128,942 recipes, and a scalable framework using NLP and machine learning to make recipes computable for culinary and nutritional analysis.

arXiv:2609.22099v1 Announce Type: new Abstract: 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.
Original Article
View Cached Full Text

Cached at: 09/22/26, 09:00 AM

# A framework for recipe data structure with applications for culinary and nutritional insights
Source: [https://arxiv.org/html/2609.22099](https://arxiv.org/html/2609.22099)
Mansi GoelAffiliation:Department of Computational Biology, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaAffiliation:Infosys Centre for Artificial Intelligence, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaAffiliation:Center of Excellence in Healthcare, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaSumit BhagatAffiliation:Department of Computer Science, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaSaloni SrivastavaAffiliation:Department of Computer Science, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaMalav PatelAffiliation:Department of Computational Biology, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaHardi ParikhAffiliation:Department of Computer Science, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaShlok Vinodkumar MehroliyaAffiliation:Department of Social Sciences and Humanities, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaGanesh BaglerAffiliation:Department of Computational Biology, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaAffiliation:Infosys Centre for Artificial Intelligence, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, IndiaAffiliation:Center of Excellence in Healthcare, Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\), New Delhi, 110020, India

###### Abstract

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/](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\.

###### keywords

Recipe, Nutrition, Database, Natural Language Processing, Machine Learning, Webserver

## Introduction

Cooking is the art of transforming raw ingredients into flavorful and nutritious dishes—a skill passed down through generations via recipes\[[1](https://arxiv.org/html/2609.22099#bib.bib1),[2](https://arxiv.org/html/2609.22099#bib.bib2)\]\. These recipes encode essential knowledge about processing natural ingredients, making them palatable and nutritionally beneficial\. Over time, distinct cooking styles, referred to as cuisines, have emerged, conforming to geo\-cultural constraints\. Despite technological advancements and evolving eating habits, daily dietary intake remains deeply rooted in cultural traditions\[[3](https://arxiv.org/html/2609.22099#bib.bib3)\]\. Cooking has been pivotal in the evolution of large brain sizes in*Homo sapiens*\[[4](https://arxiv.org/html/2609.22099#bib.bib4)\]and plays a crucial role in shaping the gut microbiome\[[5](https://arxiv.org/html/2609.22099#bib.bib5)\]\. Thus, recipes serve as a bridge between our taste preferences and health outcomes\.

As part of the Computational Gastronomy paradigm, building a structured and comprehensive repository of annotated recipes is essential to decode the complex interplay between taste, nutrition, and health in recipes\[[6](https://arxiv.org/html/2609.22099#bib.bib6),[7](https://arxiv.org/html/2609.22099#bib.bib7)\]\. Traditionally, recipes have been passed down orally and, more recently, as written records\[[8](https://arxiv.org/html/2609.22099#bib.bib8)\]\. However, these formats remain unstructured and unannotated, posing challenges for computational analysis\. In recent years, various datasets have been developed in the context of recipes such as Recipe1M\[[9](https://arxiv.org/html/2609.22099#bib.bib9)\], Epicurious \([https://www\.epicurious\.com/](https://www.epicurious.com/)\), Yummly \([https://www\.yummly\.com/](https://www.yummly.com/)\), and RecipeNLG\[[10](https://arxiv.org/html/2609.22099#bib.bib10)\]\. Recipe1M is a large dataset containing over one million recipes sourced from various online platforms\. However, its unstructured format comprising recipes, ingredients, and images often lacks critical metadata, including cooking techniques, preparation methods, and nutritional information\. The Epicurious dataset offers a more structured format with well\-defined ingredient lists and cooking instructions\. It includes user ratings, preparation times, and seasonal categories but lacks nutritional data\. Similarly, Yummly serves as a recipe discovery platform with a reasonably structured dataset that features ingredients, cooking steps, and dietary tags, yet it does not encompass comprehensive nutritional information\. RecipeNLG\[[10](https://arxiv.org/html/2609.22099#bib.bib10)\], designed primarily for natural language generation tasks, provides structured recipes but lacks a broader nutritional or cultural context\.

Other widely used datasets have gained prominence in recent studies\. The Food\.com dataset contains over 400,000 user\-contributed recipes along with reviews, ratings, and user interactions, making it a valuable resource for studying user preferences and recommendation systems\. Similarly, MealRec is a large\-scale dataset designed to support food recommendation and meal planning, comprising over one million meal sessions annotated with contextual features such as time, user behavior, and co\-consumed recipes\. These datasets highlight the growing diversity and reinforce the need for structured, annotated repositories to advance research in this interdisciplinary field\. RecipeDB\[[11](https://arxiv.org/html/2609.22099#bib.bib11)\]is a structured dataset that overcomes most of these shortcomings, but has a limited size and low mapping efficiency between ingredients and their nutritional profile\. The Named Entity Recognition \(NER\) performance in RecipeDB was low, which affected the prediction of named entities and the further mapping to their nutritional correlates\.

We address these limitations with a framework for recipe data structure, RecipeDB2\. Our contributions are threefold\. First, we define a compositional schema in which a recipe is represented as a set of typed ingredient entities, each grounded in a reference nutritional database and enriched with geo\-cultural and dietary annotations\. Second, we instantiate this schema at scale by combining an improved transformer\-based NER model, an embedding\-based ingredient\-to\-USDA mapping, a supervised ingredient\-category classifier, and a deterministic dietary\-style rule set, validating each component against manually curated ground truth\. Third, because these components form a pipeline, we characterize how the reliability of each stage bounds the layers that depend on it, so that the resulting estimates are interpretable rather than opaque\. RecipeDB2 builds on RecipeDB\[[11](https://arxiv.org/html/2609.22099#bib.bib11)\]while substantially extending both its size and the richness of its annotations, such as geo\-cultural cuisine, dietary style, cooking techniques, utensils, ingredient detail, and nutritional profiles\. This repository makes recipes computable, opening up new avenues for data\-driven exploration of global cuisines by accounting for their culinary nuances\.

Among other data resources related to the objectives of RecipeDB, FooDB focuses on the compilation of food chemicals \(http://foodb\.ca\)\. FoodBase\[[12](https://arxiv.org/html/2609.22099#bib.bib12)\]provides an annotated food entity resource and has been extended to include corpora such as CafeteriaSA and CafeteriaFCD, supporting sentiment analysis and food composition analysis\. Furthermore, recent developments in the domain leverage NLP workflows to extract relations between food and biomedical entities—examples include FoodChem\[[13](https://arxiv.org/html/2609.22099#bib.bib13)\]and FooDis\[[14](https://arxiv.org/html/2609.22099#bib.bib14)\], which facilitate the construction of domain\-specific food knowledge graphs\. Notably, Cenikj et al\.\[[15](https://arxiv.org/html/2609.22099#bib.bib15)\]demonstrate the integration of large language models to construct large\-scale food and biomedical knowledge graphs, illustrating the potential of advanced NLP methods in food informatics\. Other knowledge graph efforts, such as FoodKG\[[16](https://arxiv.org/html/2609.22099#bib.bib16)\], further exemplify semantics\-driven approaches for food recommendation and reasoning\. Some other databases, such as FlavorDB\[[17](https://arxiv.org/html/2609.22099#bib.bib17)\], FlavorDB2\[[18](https://arxiv.org/html/2609.22099#bib.bib18)\], BitterDB\[[19](https://arxiv.org/html/2609.22099#bib.bib19)\], and SuperSweet\[[20](https://arxiv.org/html/2609.22099#bib.bib20)\], focused on taste and olfaction, attempting to address the interaction of natural entities with human sensory machinery\. Databases such as NutriChem\[[21](https://arxiv.org/html/2609.22099#bib.bib21)\]\(nutritional factors\), and DietRx emphasized the food\-nutrition\-health axis\.

![Refer to caption](https://arxiv.org/html/2609.22099v1/Figure1_RecipeDB2.jpg)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\.RecipeDB2 is an expanded and annotated resource designed to probe the relationships between culinary practices and nutrition \(Figure[1](https://arxiv.org/html/2609.22099#Sx1.F1)\)\. Recipes are broken down into their culinary elements using advanced algorithms, creating a searchable database that reflects geo\-cultural contexts, dietary preferences \(Vegan, Pescetarian, Lacto\-Vegetarian, Ovo\-vegetarian, Ovo\-Lacto vegetarian\), cooking methods, and ingredient attributes\. It provides a detailed breakdown of each ingredient, including name, quantity, unit, state, and additional characteristics\. RecipeDB2 also integrates data from the USDA database, offering deeper nutritional insights with consequences for health\. The recipe framework for recipe data structure presents RecipeDB2 as an illustration\. This updated resource empowers researchers, nutritionists, chefs, and food enthusiasts to explore the complex relationships between food, culture, nutrition, and sensory experiences\.

## Framework Overview

### Data compilation

We created an extensive, structured database of recipes by appending the RecipeDB\[[11](https://arxiv.org/html/2609.22099#bib.bib11)\]\(118,171 recipes\) with those obtained from Archana’s Kitchen \([https://www\.archanaskitchen\.com/](https://www.archanaskitchen.com/)\) \(9,730 recipes\) and Awesome Cuisine \([https://www\.awesomecuisine\.com/](https://www.awesomecuisine.com/)\) \(1,132 recipes\)\. These datasets were selected based on several critical criteria, including their structural uniformity, the availability of geo\-cultural mapping for ingredients and dishes, and the substantial number of recipes\. The dataset encompasses a wide variety of information about each recipe, including the recipe title, list of ingredients, servings, detailed cooking instructions, preparation time, cooking time, total time, and associated recipe images\.

To facilitate detailed data extraction, we divided each recipe into two main parts: the ingredients section and the cooking instructions section\. This division helps to isolate and analyze relevant components more effectively\. Our goal was to extract structured elements and relevant culinary information from these sections, such as ingredient names, quantities, units, and preparation steps, for further analysis\. This structured data has applications in tasks ranging from nutritional estimation and recipe generation to the geo\-cultural classification of dishes\.

### Geo\-cultural mapping of recipes

Every recipe in the dataset was mapped to its geo\-cultural correlate at different levels of hierarchy: Continent, Region, Sub\-region \(Country\), Sub\-sub\-region \(State, where applicable\), and Sub\-sub\-sub\-region \(City, where applicable\)\. This multi\-level mapping provides a deeper understanding of each recipe’s geographical and cultural context\. The continent and country\-level mapping of recipes was obtained from their original data sources\. For the region\-level mapping, we employed a more flexible approach, focusing on culinary and cultural similarities rather than strictly adhering to geo\-political boundaries\. With such an approach, one can capture shared culinary traditions and influence across political borders\.

Countries were grouped into regions by virtue of their shared geo\-cultural correlates, and regions were further attached with coarse\-grained labels of continents\. The sub\-region, sub\-sub\-region, and sub\-sub\-sub\-region levels provide a more granular view down to specific countries, states, or cities, where available, further refining the geo\-cultural context of the recipes\. The data comprised 7 continents, 32 regions, 99 sub\-regions, 34 sub\-sub\-regions, and 12 sub\-sub\-sub\-regions\. Supplementary Table S1 presents the schema of the continent and region mapping, providing clarity to geo\-cultural mappings of recipes\.

### NER on ingredient section

We extracted ‘named entities’ from the ingredients section of each recipe to capture structured data essential for nutritional analysis\. We used the state\-of\-the\-art spaCy\-transformer model\[[22](https://arxiv.org/html/2609.22099#bib.bib22)\]to extract the named entities\[[23](https://arxiv.org/html/2609.22099#bib.bib23)\]\. Through this process, we identified seven critical attributes for providing relevant nutritional information about a recipe\. These attributes allow us to standardize and quantify ingredients for further analysis\. The attributes identified are as follows:

- •Name: The ingredient’s name, such as salt or pepper, provides the recipe’s foundational component\.
- •Unit: The unit of measurement associated with the ingredient, such as gram, cup, tablespoon, or teaspoon, specifying how the ingredient’s quantity is measured\.
- •Quantity: The specific amount of the ingredient, paired with the unit, for example, 1 teaspoon, 10 grams, or 2 cups, to provide a precise measurement for recipe scaling and nutritional estimation\.
- •State: The processing state or form of the ingredient, such as ground, chopped, thawed, or blanched, reflecting its preparation before use\.
- •Size: Any portion size descriptors for the ingredient, such as small, medium, or large, which further refine the quantity and help standardize serving sizes in recipes\.
- •Temperature: The temperature condition of the ingredient before or during preparation, such as hot, cold, or room temperature, can affect the cooking process and the ingredient’s properties\.
- •Dry/Fresh: A classification that identifies whether the ingredient is dry \(e\.g\., dried herbs, spices\) or fresh \(e\.g\., fresh basil, vegetables\), which influences the flavor profile and shelf life of the ingredient\.

### Standard units conversion

Ingredients in recipes most often come with a variety of measurement units\. For example, salt can be measured in tablespoons, teaspoons, pinches, dashes, packets, envelopes, etc\. Similarly, other ingredients are paired with diverse units of measurement\. RecipeDB2 data features an extensive collection of 35,474 unique ingredients and 1,163 distinct measurement units\. Table[1](https://arxiv.org/html/2609.22099#Sx2.T1)shows the 20 most popular ingredients and their unique units, where salt \(53234; 41\.28%\), garlic \(42789; 33\.18%\), onion \(37195; 28\.84%\), water \(27799; 21\.55%\), and butter \(26624; 20\.64%\) were among the most popular ingredients\. On the measurement side, Figure[2](https://arxiv.org/html/2609.22099#Sx2.F2)shows the frequency rank distribution of units, commonly used units in recipes are cup \(291,756\), teaspoon \(224,404\), tablespoon \(187,824\), lb \(417,70\), and ounce \(39,571\)\. This wide variation in ingredients and measurement units highlights the complexity of recipe creation and cooking\.

Table 1:20 most popular ingredients, their frequency, popularly used units, and unit counts\.![Refer to caption](https://arxiv.org/html/2609.22099v1/Unit_Frequency_Rank.jpeg)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\.We identified 81,240 unique ingredient\-unit pairs\. Among these, 4,961 \(6\.1%\) were already in standard units \(grams for solids \(3,932\) and milliliters for liquids \(1,029\)\), while 93\.9% were in non\-standard units\. We aimed to convert all non\-standard units into standard ones to ensure consistency across recipes\. We manually found the standard unit conversion of each unit for each ingredient\. The ingredient\-unit pairs were far too many for manual conversion, hence we sorted the pairs based on the frequency and converted frequency\-occurring pairs into their standard units\. We successfully converted 43\.90% of the most frequently used ingredient\-unit pairs into standard units\. Figure[3](https://arxiv.org/html/2609.22099#Sx2.F3)illustrates 50 commonly used ingredient\-unit pairs in our dataset\. Ingredients such as salt, black pepper, cumin, cinnamon, oregano are widely used in teaspoons, garlic with clove, beef in lb, butter, olive oil, and vegetable oil in tablespoons, water, milk, sugar, and flour in cups\.

![Refer to caption](https://arxiv.org/html/2609.22099v1/Top50_ing_unit_pair.png)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\.
### Integration of RecipeDB2 to USDA ingredient

To find the nutritional profile of ingredients, we need to accurately map ingredients from the RecipeDB2 dataset to their corresponding entries in the Standard Reference Legacy Release database \([https://fdc\.nal\.usda\.gov/](https://fdc.nal.usda.gov/)\) \(United States Department of Agriculture; USDA\)\. RecipeDB2 presents 128,942 recipes comprising 35,474 ingredients from 32 regions, while USDA has 1,050 unique ingredients\. The disparity in the number of entities between these databases is due to the many\-to\-one mappings of RecipeDB ingredients to that in USDA\. A typical USDA ingredient occurs in recipes in various avatars\.

We implemented three mapping strategies: Jaccard similarity\[[24](https://arxiv.org/html/2609.22099#bib.bib24)\], BERT\-based\[[25](https://arxiv.org/html/2609.22099#bib.bib25),[26](https://arxiv.org/html/2609.22099#bib.bib26)\], and RoBERTa\-based\[[27](https://arxiv.org/html/2609.22099#bib.bib27)\]\. Each approach leverages different techniques for identifying the best matches between ingredients based on textual similarity and contextual understanding\. The Jaccard similarity is a well\-known metric that compares two sets by measuring the intersection over the union\. We compared the ingredient names from RecipeDB2 and USDA by breaking them down into sets of tokens \(e\.g\., “ground cumin” becomes ground, cumin\)\. The Jaccard score was calculated by dividing the number of shared words \(intersection\) by the total number of unique words \(union\) between two ingredients\. BERT \(Bidirectional Encoder Representations from Transformers\) is a language model that captures the contextual meaning of words and phrases\. We used a pre\-trained BERT model for ingredient mapping to encode the RecipeDB2 and USDA ingredient names into dense vector representations\. These vectors were then compared using cosine similarity to find the closest match\. RoBERTa \(Robustly Optimized BERT Pretraining Approach\) is an improved variant of BERT designed with more robust training strategies and adjustments\. Similar to BERT, RoBERTa encodes text into contextualized vector representations, which we used to compute the similarity between RecipeDB2 and USDA ingredient names\.

We manually evaluated the mapping results for the 200 most popular ingredients\. Table[2](https://arxiv.org/html/2609.22099#Sx2.T2)shows the detailed performance comparison of RecipeDB2 ingredient mapping to that of USDA\. The BERT model outperformed the RoBERTa and Jaccard models, achieving the best overall performance with F1 scores and accuracy of 87\.90% and 79\.50%, respectively, making it the preferred method for ingredient\-to\-USDA mapping\. Out of 35,474 ingredients in RecipeDB2, 25,903 were successfully mapped to USDA using BERT with a similarity score of≥\\geq70%\. Figure[4](https://arxiv.org/html/2609.22099#Sx2.F4)\(inset\) shows the most frequently used ingredients mapping using the BERT strategy\. This process allows us to retrieve nutritional information for approximately 73\.01% of the ingredients, which we then use to calculate the nutritional profiles of the recipes\.

![Refer to caption](https://arxiv.org/html/2609.22099v1/Recipe_Size_Dist_with_Inset_Frequency_Rank.jpeg)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\.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\.
### Nutritional profile of recipes

The nutritional profile of a recipe was calculated by aggregating the nutritional values of each ingredient, factoring in their respective quantities, and applying standard unit conversions\. By mapping ingredient measurements to standardized values, this approach reasonably estimates various nutritional components, including calorific content, macro\-nutrients \(such as proteins, fats, and carbohydrates\), and essential micro\-nutrients \(like vitamins and minerals\)\. This comprehensive analysis offers valuable insights into the nutritional composition of recipes, enabling a deeper understanding of how different ingredients contribute to the overall nutritional profile of a dish\. It also facilitates comparisons across recipes, dietary trends, and regional culinary practices, enabling one to make informed choices about nutrition and meal planning\.

RecipeDB2 presents a repository of 128,942 recipes\. After applying the ingredient mapping strategy, we successfully mapped ingredients to 128,899 recipes \(fully or partially\), demonstrating that our approach covers the majority of the dataset\. However, 43 recipes remained completely unmapped due to the missing ingredient data\. These entirely unmapped recipes have fewer ingredients, with a minimum of 1 to a maximum of 8 \(Christmas Truffle\) \(see Supplementary Figure S2\)\. On average, each unmapped recipe contained 2\.5 ingredients, for a total of 115 unmapped ingredients across all 43 recipes\. This indicates that our mapping strategy efficiently maps the most popular ingredients and recipes with a larger number of ingredients\. The recipe size distribution \(in Figure[4](https://arxiv.org/html/2609.22099#Sx2.F4)indicates that before mapping, the average recipe size was 9\.978, which marginally reduced to 8\.943 post\-mapping, suggesting that our approach successfully maps most ingredients to their USDA nutritional profile\.

The macro\-nutrient analysis of the RecipeDB2 dataset provides insightful statistics that reflect the diversity and composition of recipes within the dataset \(see Supplementary Figure S3\)\. The protein content across recipes is from 0 to 285\.84 grams, indicating that some recipes may not contain protein sources and some recipes with protein\-rich ingredients such as legumes, meat, and dairy\. The average protein content across all recipes is 49\.48 grams, indicating a moderate protein level in most recipes\. Carbohydrate content significantly varies from 0 to 1203\.84 grams, pointing to recipes such as baked goods or pasta dishes containing carbohydrate\-dense ingredients\. The average carbohydrate content is 245\.20 grams, reflecting a balanced proportion of carbohydrates in the recipes\[[28](https://arxiv.org/html/2609.22099#bib.bib28)\]\. Total lipid content in the dataset ranges from 0 to 660\.41 grams, indicating the influence of fat content in recipes is likely influenced by the use of oils, nuts, and fatty cuts of meat\. The average lipid content is 102\.02 grams\. The energy values contain considerable diversity, ranging from 0 to 8745 calories, with an average energy of 1989\.01 calories across the recipes\.

### Predicting the category of ingredients

We manually categorized 10,659 ingredients out of a total of 35,474 from RecipeDB\[[11](https://arxiv.org/html/2609.22099#bib.bib11)\], which is approximately 30% of the dataset\. Left with a large number of ingredients with no category label, we implemented machine learning models to predict the category for the remaining 24,815 ingredients \(70%\)\. Analysis of the uncategorized ingredients revealed a wide distribution in frequency, with some ingredients appearing only once and some appearing in 8,844 recipes\. On average, each uncategorized ingredient appeared approximately 5\.5 times\. This suggests that one should prioritize manually labeling the categories of most frequently used ingredients\.

We represented each ingredient name as TF–IDF n\-gram vectors\. Models were trained and evaluated on the 10,659 manually labelled ingredients using a stratified 80/20 train–test split with stratification to preserve the class distribution across folds\. The models aim to automate the classification process and improve efficiency in assigning category to each ingredient\. We compared seven supervised classifiers: Random Forest \(RF\), Decision Tree \(DT\), Support Vector Machine \(SVM\), Logistic Regression \(LR\), Gradient Boosting \(GB\), Naive Bayes \(NB\), and K\-Nearest Neighbors \(KNN\)\. Performance is reported in Table[3](https://arxiv.org/html/2609.22099#Sx2.T3)as weighted\-averaged accuracy, precision, recall, and F1 score across all 34 categories\. Random Forest achieved the best performance \(accuracy 89\.12%, weighted F1 89\.16%\), with the tree\-ensemble models \(RF, DT\) and the margin\-based SVM clearly outperforming the linear \(LR, GB\) and distance/probability\-based \(NB, KNN\) baselines\. This ordering is consistent with the high\-dimensional, sparse, and lexically redundant nature of ingredient\-name features, which tree ensembles partition effectively while distance\- and density\-based methods \(KNN, NB\) degrade\.

RecipeDB2 organizes ingredients into 34 categories, the largest being Dish \(3,723\), Spice \(3,314\), Vegetable \(3,303\), Meat \(3,261\), Dairy \(2,437\), and Additive \(2,313\) \(Supplementary Figure S4\); Supplementary Figure S5 shows the regional composition of these categories\. The predicted categories feed directly into the dietary\-style annotation rules and the category\-level nutritional analysis, so the classifier’s reliability on rare categories bounds the accuracy of those downstream layers\.

ModelAccuracyPrecisionRecallF1 ScoreRF89\.1289\.3889\.1189\.16DT87\.1987\.4487\.1887\.25SVM85\.3186\.0685\.3185\.48LR82\.0483\.1782\.0482\.16GB80\.7483\.0580\.7481\.09NB70\.2071\.8670\.1967\.72KNN67\.7871\.8367\.7968\.92Table 3:Performance of machine learning models in predicting the category of each ingredient in terms of accuracy, precision, recall, and F1 score\.
### Dietary style annotations

We annotated each recipe with a dietary style using a deterministic rule set over the predicted ingredient categories\. The rules test for the presence or absence of five animal\-derived category groups, such as meat, eggs, dairy, fish, and seafood, together with acomposite\-dishguard described below\. We adopt an exclusion\-based \(conservative\) policy: a recipe receives a vegetarian/vegan label only when no ingredient from a disallowed group is present, so that mislabelling errs toward under\-claiming rather than over\-claiming a restrictive diet\. Acomposite dishis an ingredient whose entry names a prepared or multi\-component item rather than a single raw ingredient, and whose internal composition is therefore opaque to category\-level rules\. Because such items may conceal animal\-derived components \(e\.g\., anchovy in Worcestershire sauce, animal gelatin\), any recipe containing an unresolved composite dish is excluded from the positive vegan/vegetarian classes\.

#### Labelling rules\.

Let a recipe’s ingredient set be summarized by the indicator variablesmeat\\mathrm\{meat\},egg\\mathrm\{egg\},dairy\\mathrm\{dairy\},fish\\mathrm\{fish\},seafood\\mathrm\{seafood\}, andcomposite\\mathrm\{composite\}\. A recipe is labelled:

- •Vegan– if none of meat, egg, dairy, fish, seafood, or composite are present;
- •Lacto\-Vegetarian– if dairy is present, and meat, egg, fish, seafood, and composite are absent;
- •Ovo\-Vegetarian– if egg is present, and meat, dairy, fish, seafood, and composite are absent;
- •Ovo\-Lacto\-Vegetarian– if egg and dairy are present, and meat, fish, seafood, and composite are absent;
- •Pescetarian– if fish or seafood is present, and meat and composite are absent\.

The rules are applied in this order, and by construction every recipe receives exactly one label, making the assignment mutually exclusive and exhaustive over the dataset\.

## Webserver implementation

RecipeDB2 facilitates exploring and understanding the intricate relationships between cuisines, recipes, and ingredients\. With interactive data visualizations and a range of intuitive search options, users can quickly access relevant information, uncover culinary patterns, and gain deeper insights\. The platform supports in\-depth analysis of recipes and ingredients, helping users explore the rich diversity of global cuisines\.

Built as a relational database using MongoDB, RecipeDB2 is optimized for efficient data management and querying\. The web server is powered by Express, a NodeJS\-based web development framework, renowned for its minimalistic and unopinionated design\. Express facilitates seamless integration with MongoDB using libraries like Mongoose for schema modeling and efficient querying\. The frontend of RecipeDB2 is developed using ReactJS, a framework for building frontend, ensuring a responsive and user\-friendly interface\. The platform employs an NGINX HTTP server to enhance further performance, routes requests to the Express application, and enables data compression, leading to faster page load times\. ElasticSearch engine would significantly improve the platform’s search capabilities by allowing for faster, full\-text searches and more advanced query features, particularly in handling large datasets\.

RecipeDB2 \([https://cosylab\.iiitd\.edu\.in/recipedb2/](https://cosylab.iiitd.edu.in/recipedb2/)\) is optimized for modern web browsers, providing the best experience on the latest versions of Google Chrome, Firefox, Opera, Internet Explorer, and Microsoft Edge\. This cross\-browser compatibility ensures smooth navigation and interaction across different platforms and devices\.

## Use cases

### Searching recipes by cuisine

RecipeDB2 enables users to search for recipes by cuisine at the ‘region’ or ‘country’ level\. For example, users can explore the Mediterranean region and Italian as a country, or search for Italian cuisine directly\. Each search field provides an autosuggest function\. The results page displays a comprehensive list of Italian recipes, including recipe names, estimated macro\-nutrient information, and links to individual recipe pages\. Clicking on a recipe name directs users to a detailed recipe page, while the ‘More Info’ tab provides a pop\-up with an extensive nutritional profile, covering both macro\- and micro\-nutrients as provided by the USDA\.

### Searching recipe using macro\-nutrients

RecipeDB2 allows users to search for recipes based on their nutritional profiles, focusing on macro\-nutrients such as fats, protein, carbohydrates, and energy\. This feature allows users to identify recipes that meet specific dietary requirements or preferences\. Additionally, a detailed breakdown of the nutritional profile is available, offering insights into the ingredients that contribute to the overall nutritional value of each recipe\. Such nutritional transparency helps users make informed choices about their meals, catering to their health and dietary goals\.

### Multi\-search and Multi\-attribute search for ingredients and categories

The implementation of multi\-search and multi\-attribute search capabilities for ingredients and categories significantly enhances the user experience by offering flexibility in refining recipe results\. Users can conduct simultaneous searches using both ingredients included and excluded, allowing for more nuanced filtering that caters to individual dietary preferences and restrictions\. The advanced search feature further empowers users by enabling them to apply multiple criteria within the ‘Ingredients Used’ and ‘Ingredients Not Used’ tabs, ensuring a better search experience\. Additionally, users can filter recipes based on both used and unused categories simultaneously, with a choice to select multiple values within each category\.

## Discussion

RecipeDB2 is a comprehensive database that enhances culinary knowledge\. RecipeDB2 offers a detailed recipe dataset, capturing information on ingredients, preparation methods, cooking techniques, cultural origins, and nutritional profiles\. The user\-friendly RecipeDB2 interface enriches the user experience, facilitating a better exploration and understanding of recipes across diverse culinary contexts\. By integrating the culinary context of the recipes and ingredients along with their nutritional correlates, RecipeDB2 empowers users to explore culinary relationships\.

One of the primary directions in which such a structured dataset can be driven is that of generating novel recipes by applying large language models\[[29](https://arxiv.org/html/2609.22099#bib.bib29)\]\. In principle, such a novel recipe generation engine can be tailored to individual user preferences, dietary restrictions, ingredient availability, cost, and calorie content using the RecipeDB2 dataset\. The integration of culinary and nutritional details of recipes enables the users to make informed dietary choices and promotes healthier eating habits\. The database serves as a valuable resource for exploring the cultural and historical significance of various cuisines and ingredients\.

When compared to other existing recipe datasets, such as Recipe1M\[[9](https://arxiv.org/html/2609.22099#bib.bib9)\], Epicurious, Yummly, RecipeNLG\[[10](https://arxiv.org/html/2609.22099#bib.bib10)\], and RecipeDB\[[11](https://arxiv.org/html/2609.22099#bib.bib11)\], RecipeDB2 stands out for its structured and comprehensive approach to culinary data\. RecipeDB2 marks a huge step forward in culinary data by identifying named entities, mapping ingredients to find the nutritional profile, and predicting the category of ingredients\. By incorporating metadata such as preparation methods, cultural origins, dietary style, and nutritional information, RecipeDB2 improves data richness and accessibility\. This systematic approach enables more nuanced analysis and applications in culinary research while effectively resolving the limits of unorganized datasets\. RecipeDB2 empowers researchers, chefs, and food enthusiasts to delve deeper into the complex world of food\. This comprehensive approach broadens culinary expertise and emphasizes on the significant influence of food on our lives and cultures\. Future work will focus on expanding the database’s capabilities by integrating domain ontologies such as FoodOn and LanguaL to improve ingredient normalization and enable semantic reasoning across recipes, enhancing user interactivity, and promoting research in culinary sciences\. We also aim to incorporate food\-chemical relationships using external resources such as FooDB and FlavorDB2, facilitating detailed flavor and health\-centric exploration\. On the analytical front, we plan to introduce machine\-learning pipelines for nutrient prediction\[[30](https://arxiv.org/html/2609.22099#bib.bib30)\], ingredient substitution, and recipe rating models\.

## Authors’ contribution

M\.G\. scraped and cleaned the dataset, conducted the experiments, and analyzed the results\. M\.G\., S\.B\., and S\.S\. developed the webserver\. M\.G\., M\.P\., H\.P\., and S\.V\.M\. manually converted the data into standard units\. G\.B\. supervised the project\. M\.G\. and G\.B\. wrote and reviewed the manuscript\.

## Competing interests

No competing interest is declared\.

## Data Availability Statement

The datasets generated and analyzed during the current study are not publicly available due to institutional copyright restrictions\.

## Acknowledgments

GB thanks Indraprastha Institute of Information Technology Delhi \(IIIT\-Delhi\) for the computational support\. GB thanks Technology Innovation Hub \(TiH\) Anubhuti for the research grant\. MG is a research scholar in the Complex Systems Laboratory and is thankful to IIIT\-Delhi for the research fellowship\. SB, SS, MP, and HP are research interns and are thankful to IIIT\-Delhi\. This study was supported by the Infosys Centre for Artificial Intelligence and Center of Excellence in Healthcare, IIIT\-Delhi\.

## Supplementary data

Supplementary Tables and Figures are provided in the Supplementary Information at the end of this document\.

## References

- \[1\]Crosby, G\.*Cook, taste, learn: How the evolution of science transformed the art of cooking*\(Columbia University Press, 2020\)\.
- \[2\]Pollan, M\.*Cooked: A natural history of transformation*\(Penguin, 2014\)\.
- \[3\]Gatley, A\.The significance of culinary cultures to diet\.*British Food Journal*118, 40–59 \(2016\)\.
- \[4\]Wrangham, R\.*Catching Fire: How Cooking Made Us Human*\(Basic Books, 2009\)\.
- \[5\]Carmody, R\. N\.*et al\.*Cooking shapes the structure and function of the gut microbiome\.*Nature Microbiology*4, 2052–2063 \(2019\)\.
- \[6\]Bagler, G\. & Goel, M\.Computational gastronomy: capturing culinary creativity by making food computable\.*NPJ Systems Biology and Applications*10, 72 \(2024\)\.
- \[7\]Goel, M\. & Bagler, G\.Computational gastronomy: A data science approach to food\.*Journal of Biosciences*47, 12 \(2022\)\.
- \[8\]Wharton, T\.Recipes: Beyond the words\.*Gastronomica*10, 67–73 \(2010\)\.
- \[9\]Marın, J\.*et al\.*Recipe1m\+: A dataset for learning cross\-modal embeddings for cooking recipes and food images\.*IEEE Transactions on Pattern Analysis and Machine Intelligence*43, 187–203 \(2021\)\.
- \[10\]Bień, M\.*et al\.*Recipenlg: A cooking recipes dataset for semi\-structured text generation\.In*Proceedings of the 13th International Conference on Natural Language Generation*, 22–28 \(2020\)\.
- \[11\]Batra, D\.*et al\.*Recipedb: a resource for exploring recipes\.*Database*2020, baaa077 \(2020\)\.
- \[12\]Popovski, G\., Seljak, B\. K\. & Eftimov, T\.Foodbase corpus: a new resource of annotated food entities\.*Database*2019, baz121 \(2019\)\.
- \[13\]Cenikj, G\., Seljak, B\. K\. & Eftimov, T\.Foodchem: A food\-chemical relation extraction model\.In*2021 IEEE Symposium Series on Computational Intelligence \(SSCI\)*, 1–8 \(IEEE, 2021\)\.
- \[14\]Cenikj, G\., Eftimov, T\. & Seljak, B\. K\.Foodis: A food\-disease relation mining pipeline\.*Artificial intelligence in medicine*142, 102586 \(2023\)\.
- \[15\]Cenikj, G\.*et al\.*From language models to large\-scale food and biomedical knowledge graphs\.*Scientific reports*13, 7815 \(2023\)\.
- \[16\]Haussmann, S\.*et al\.*Foodkg: a semantics\-driven knowledge graph for food recommendation\.In*The Semantic Web–ISWC 2019: 18th International Semantic Web Conference, Auckland, New Zealand, October 26–30, 2019, Proceedings, Part II 18*, 146–162 \(Springer, 2019\)\.
- \[17\]Garg, N\.*et al\.*Flavordb: a database of flavor molecules\.*Nucleic Acids Research*46, D1210–D1216 \(2018\)\.
- \[18\]Goel, M\.*et al\.*Flavordb2: an updated database of flavor molecules\.*Journal of Food Science*\(2022\)\.
- \[19\]Wiener, A\., Shudler, M\., Levit, A\. & Niv, M\. Y\.Bitterdb: a database of bitter compounds\.*Nucleic Acids Research*40, D413–D419 \(2012\)\.
- \[20\]Ahmed, J\.*et al\.*Supersweet—a resource on natural and artificial sweetening agents\.*Nucleic Acids Research*39, D377–D382 \(2010\)\.
- \[21\]Jensen, K\., Panagiotou, G\. & Kouskoumvekaki, I\.Nutrichem: a systems chemical biology resource to explore the medicinal value of plant\-based foods\.*Nucleic Acids Research*43, D940–D945 \(2015\)\.
- \[22\]Goel, M\.*et al\.*Deep learning based named entity recognition models for recipes\.In*Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation \(LREC\-COLING 2024\)*, 4542–4554 \(2024\)\.
- \[23\]Diwan, N\., Batra, D\. & Bagler, G\.A named entity based approach to model recipes\.In*36th International Conference on Data Engineering Workshops \(ICDEW\)*, 88–93 \(IEEE, 2020\)\.
- \[24\]Bag, S\., Kumar, S\. K\. & Tiwari, M\. K\.An efficient recommendation generation using relevant jaccard similarity\.*Information Sciences*483, 53–64 \(2019\)\.
- \[25\]Devlin, J\., Chang, M\.\-W\., Lee, K\. & Toutanova, K\.Bert: Pre\-training of deep bidirectional transformers for language understanding\.In*Proceedings of NAACL\-HLT*, vol\. 1, 2 \(Minneapolis, Minnesota, 2019\)\.
- \[26\]Reimers, N\.Sentence\-bert: Sentence embeddings using siamese bert\-networks\.*arXiv preprint arXiv:1908\.10084*\(2019\)\.
- \[27\]Liu, Y\.Roberta: A robustly optimized bert pretraining approach\.*arXiv preprint arXiv:1907\.11692*\(2019\)\.
- \[28\]Trattner, C\., Elsweiler, D\. & Howard, S\.Estimating the healthiness of internet recipes: a cross\-sectional study\.*Frontiers in Public Health*5, 16 \(2017\)\.
- \[29\]Goel, M\.*et al\.*Ratatouille: A tool for novel recipe generation\.In*38th International Conference on Data Engineering Workshops \(ICDEW\)*, 107–110 \(IEEE, 2022\)\.
- \[30\]Ispirova, G\., Eftimov, T\., Džeroski, S\. & Seljak, B\. K\.Msgen: Measuring generalization of nutrient value prediction across different recipe datasets\.*Expert Systems with Applications*237, 121507 \(2024\)\.

## Supplementary Information

Supplementary Table[S1](https://arxiv.org/html/2609.22099#Sx11.T1)shows the mapping of RecipeDB2 continent and region, along with the recipe count\.

Table S1:Mapping of cuisines from their \(32\) Regions to \(7\) Continents and \(region\-wise\) number of recipes\.![Refer to caption](https://arxiv.org/html/2609.22099v1/Top100_ing_unit_pair.png)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\.![Refer to caption](https://arxiv.org/html/2609.22099v1/Unmapped_Recipe_Size_Distribution.jpeg)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\.![Refer to caption](https://arxiv.org/html/2609.22099v1/Macronutrients_Analysis_Dist.jpeg)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\.![Refer to caption](https://arxiv.org/html/2609.22099v1/Ingredient_Category.png)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 \(∼\\sim30%\) most frequently occurring were mapped manually, and the rest 24,815 \(∼\\sim70%\) were done using the automated, machine learning\-based protocol\.![Refer to caption](https://arxiv.org/html/2609.22099v1/Category_Region_Composition_Heatmap.jpeg)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\.

Similar Articles

SIMMER: Cross-Modal Food Image–Recipe Retrieval via MLLM-Based Embedding

arXiv cs.CL

SIMMER proposes a novel MLLM-based embedding approach for cross-modal food image-recipe retrieval, replacing traditional dual-encoder architectures with a unified encoder and achieving state-of-the-art results on the Recipe1M dataset with significant improvements over prior methods.

RecipeBook by Shofo

Product Hunt

RecipeBook by Shofo offers video training data by the hour with over 25 million clips for AI model training.