Built to order

AI-Based Recipe Recommendation using Ingredients and Dietary Preferences

AI-Based Recipe Recommendation using Ingredients and Dietary Preferences is a web app that suggests recipes from the ingredients already in your kitchen. To get recommendations, you tick the ingredients you have, choose a dietary preference such as vegetarian, vegan, Jain or gluten-free, and the app ranks matching recipes by ingredient match percentage, showing cook time and exactly which ingredients are still missing. Ranking uses TF-IDF ingredient vectors and cosine similarity. Suitable for B.E./B.Tech final-year projects in Computer Science, IT and AI & Machine Learning.

Chat on WhatsApp — get a quotation

AI & Machine Learning PythonFlaskSQLiteGitpandas · NumPyHTML · CSS · JavaScriptscikit-learn TF-IDFRecipe1M datasetSoftware
AI-Based Recipe Recommendation using Ingredients and Dietary Preferences — project thumbnail preview
More project photos (3)

The problem

AI-Based Recipe Recommendation using Ingredients and Dietary Preferences answers a daily kitchen question: given the ingredients already at home, what can be cooked tonight without an extra shopping trip. Most households open the fridge, see a few vegetables, paneer and rice, and still cannot decide on a dish, because recipe sites expect the cook to pick a dish first and then buy its ingredients. Generic search returns hundreds of results that ignore what is actually available, ignore vegetarian, vegan, Jain or gluten-free requirements, and hide the missing ingredients until the cook is halfway through the method. The result is wasted food, repeated meals and abandoned recipes. A system that starts from the pantry instead of the dish changes the question: it ranks real recipes by how many of their ingredients are already available, filters out anything that breaks the cook's dietary rules, and lists exactly what is missing before cooking begins.

This is a built-to-order software project: the recommendation web app, the ranking code, the curated recipe catalogue and the complete viva kit (report, PPT, Q&A) are prepared fresh for you.

How it compares

Approach Starts from Respects diet Shows missing items
This recommender Ingredients you already have Yes — 5 hard dietary filters Yes, per recipe
Generic recipe sites Dish name or keyword Search filter only Rarely
Manual searching A dish idea Cook checks each recipe Cook works it out

SYSTEM FLOW

6 components 5 connections

Live flow
Drag to explore
100%
userCook

Cook ticks the ingredients already in the kitchen.

Follow the working sequence

How it works

AI-Based Recipe Recommendation using Ingredients and Dietary Preferences works as a three-stage pipeline that turns a ticked ingredient list into a ranked recipe shortlist. The user first ticks the ingredients available at home from a catalogue of 28 items grouped into vegetables, dairy and protein, pantry grains and spices, then picks one dietary preference and a maximum cook time. A rule filter removes every recipe that breaks the chosen preference — vegan drops dairy and eggs, Jain drops onion, garlic and potato — before any ranking happens. Each remaining recipe is represented as a TF-IDF vector over its ingredient list, so distinctive ingredients count more than common staples, and cosine similarity between the user's ingredient vector and each recipe vector produces the ranking. The app then displays each recipe with its match percentage, the ingredients already owned, the missing ingredients, cook time and difficulty, so the cook can pick a dish and a shopping list in one glance.

  1. The user ticks the ingredients available at home from the 28-item catalogue, grouped into vegetables, dairy and protein, pantry grains and spices.
  2. The user picks one dietary preference (vegetarian, vegan, Jain, gluten-free or eggetarian) and a maximum cook time of 20, 30, 45 or 60 minutes.
  3. A rule filter removes every recipe that breaks the chosen preference before any ranking happens.
  4. Each remaining recipe is converted into a TF-IDF vector over its ingredient list, with distinctive ingredients weighted above common staples such as salt and oil.
  5. Cosine similarity is computed between the user's ingredient vector and each recipe vector, and recipes are sorted by similarity.
  6. The app displays the ranked recipes with match percentage, ingredients owned, ingredients missing, cook time and difficulty.
  7. The user opens a recipe to read its numbered cooking method and the missing-ingredient list, which doubles as a shopping list.

Tech stack:

  • Python 3 · Flask

  • scikit-learn · TF-IDF vectorizer

  • Pandas · NumPy

  • Recipe1M+ dataset (MIT CSAIL)

  • HTML · CSS · JavaScript

  • SQLite

  • Matplotlib (evaluation plots)

  • Git

  • Dataset: Recipe1M+ — 1,029,720 recipes and 13,735,679 food images, published by MIT CSAIL (Marin et al., 2019, arXiv:1810.06553). The demo uses a curated subset of 12 Indian and international recipes with verified ingredient lists; dietary classes are vegetarian, vegan, Jain, gluten-free and eggetarian.

  • Task: Ranked retrieval — input is the user's available-ingredient list plus a dietary preference and a maximum cook time; output is a ranked recipe list with match percentage, missing ingredients and cook time.

  • Model: Content-based filtering with TF-IDF ingredient vectors and cosine similarity, preceded by a rule-based dietary filter. Collaborative filtering is future scope only — it needs user-rating history that the base build does not collect.

  • Metrics: Precision@5, precision@10, recall@k and mean reciprocal rank, evaluated on held-out recipe-ingredient queries. No accuracy figure is claimed, because ranking quality depends on the catalogue size and the query set used for evaluation.

Parameter Value
Recipes in demo catalogue 12 (curated, verified ingredient lists)
Ingredients tracked 28
Dietary preference options 5 (vegetarian · vegan · Jain · gluten-free · eggetarian)
Full reference dataset 1,029,720 recipes (Recipe1M+, verified)
Reference dataset images 13,735,679 food images (Recipe1M+, verified)
Ranking latency 0.6–1.2 ms per query (measured in the demo browser run)
Match score range 0–100% ingredient overlap
Cook-time filter 20–60 min (user-selectable)
Ranking method TF-IDF vectors + cosine similarity (content-based)

Project features

The app's strongest capabilities are ingredient-first matching, strict dietary filtering, transparent match scores and a step-by-step cooking view. Ingredient-first matching ranks 12 curated recipes by the share of their ingredients already in the kitchen, so the top result is the dish closest to cookable right now rather than the most popular dish overall. Dietary filtering applies five preferences — vegetarian, vegan, Jain, gluten-free and eggetarian — as hard rules before ranking, so a filtered-out recipe never appears in the results. Every recommendation shows a match percentage with a visual bar, the exact ingredients owned and missing, cook time and difficulty, making the recommendation explainable at a glance. Finally, each recipe opens into a numbered cooking method with its missing-ingredient list, so the recommendation turns directly into a cooking plan without a separate search.

  • [Ingredient-first recipe matching] Recipes are ranked by the share of their ingredients already in the kitchen, so the top result is the dish closest to cookable right now.
  • [Dietary preference filters] Five preferences — vegetarian, vegan, Jain, gluten-free and eggetarian — are applied as hard rules before ranking, so a filtered-out recipe never appears.
  • [Match percentage and missing-ingredient list] Every recommendation shows a match percentage with a visual bar, the ingredients owned and the ingredients still missing.
  • [Cook-time and minimum-match controls] The cook can limit results to 20, 30, 45 or 60 minutes and require a minimum match percentage before browsing.
  • [Step-by-step cooking method] Each recipe opens into a numbered method with its missing-ingredient list, turning the recommendation into a cooking plan.
  • [TF-IDF and cosine similarity ranking] The ranking uses TF-IDF ingredient vectors and cosine similarity, with distinctive ingredients weighted above common staples.
  • [12 curated recipes with verified ingredient lists] The demo catalogue holds 12 real Indian and international recipes, each with a verified ingredient list, cook time and difficulty.

What is included

  • Complete source code (Flask backend, scikit-learn ranking, HTML/CSS/JS frontend)
  • Working demo web app with 12 curated recipes and 28 tracked ingredients
  • Recipe1M+ dataset access and preprocessing notes
  • Project report PDF (background, method, ranking design, evaluation, results)
  • Project abstract PDF
  • PPT presentation for final review
  • Viva Q&A preparation document (TF-IDF, cosine similarity, content-based filtering, evaluation metrics)

Limitations & prerequisites

  • The demo catalogue holds only 12 recipes; scaling to the full 1,029,720-recipe Recipe1M+ corpus needs a database and indexed retrieval, listed as future scope.
  • Recommendations depend on the user ticking ingredients honestly — a wrongly ticked item changes the ranking.
  • No allergy or nutrition analysis in the base build; the filters cover dietary preference categories only.
  • Match percentage measures ingredient overlap, not taste or quality — a 100% match can still be a dish the cook dislikes.
  • Recipe1M+ recipes are mostly Western, while the demo catalogue is a curated Indian-leaning subset, so coverage of regional cuisines is limited.
  • No user accounts or rating history, so collaborative filtering is future scope, not part of the base build.

Frequently Asked Questions

Which dataset is used, and how much of it is in the demo?

Recipe1M+ from MIT CSAIL, which contains 1,029,720 recipes and 13,735,679 food images. The demo ships with a curated subset of 12 Indian and international recipes whose ingredient lists were verified by hand, because the full corpus needs a database and indexed retrieval that the base build does not include.

How does the TF-IDF and cosine similarity ranking work?

Each recipe becomes a TF-IDF vector over its ingredient list, so distinctive ingredients such as paneer or kasuri methi weigh more than common staples such as salt or oil. The user's ticked ingredients form a query vector, and cosine similarity between the query and each recipe vector produces the ranking, highest similarity first.

How do the dietary filters work, and what does Jain exclude?

Each preference is a hard rule applied before ranking, so a recipe that breaks it never appears in the results. Jain excludes onion, garlic and potato; vegan excludes dairy and eggs; gluten-free excludes wheat-based items; vegetarian excludes meat, fish and eggs.

Can new recipes or ingredients be added?

Yes — a recipe is one record with a name, ingredient list, cook time, difficulty and dietary tags, and the ranking code reads the whole catalogue at start-up, so adding a recipe only means adding that record and rebuilding the TF-IDF vectors. No change to the ranking logic is needed.

What are the main limitations?

The demo catalogue holds only 12 recipes, so it cannot cover every cuisine or craving, and scaling to the full Recipe1M+ corpus is future scope. Match percentage measures ingredient overlap rather than taste, and the base build has no allergy or nutrition analysis and no user-rating history for collaborative filtering.

Is this project suitable for a final-year project?

Yes — for Computer Science, IT and AI & Machine Learning programs, because it demonstrates information retrieval, TF-IDF vectorisation, cosine similarity, content-based filtering and evaluation with precision@k in one working web deployment. A real dataset sits behind the demo, so the report can discuss data scale, preprocessing and evaluation honestly.

Components & software requirements
  • Python 3 · Flask
  • scikit-learn · TF-IDF vectorizer
  • Pandas · NumPy
  • Recipe1M+ dataset (MIT CSAIL)
  • HTML · CSS · JavaScript
  • SQLite
  • Matplotlib (evaluation plots)
  • Git
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Related guides

All guides
Get a quotation