FlavorFuse Results Explorer · final-year research

Cook with what you have.See how well it works.

A recipe recommender that ranks by the ingredients you have and the nutrition goals you set, together. This page explains the research behind it, shows every result, and states where it does not help.

Can a recommender that adapts, for each query, how much weight it gives ingredients versus nutrition do better than one with fixed settings?

The problem with the original app

The first version of FlavorFuse had two separate searches, one by text and one by nutrition. They were never combined, and both used fixed settings: the top 6 results and a similarity threshold of 0.1.

0.130NDCG@10 of the original nutrition search on nutrition-only queries
0.194NDCG@10 of picking recipes at random on the same queries

Validation split, 1,000 queries. The original search compared nutrient proportions, not amounts, and sent blank fields as zero. Replacing it with constraint-based scoring raised nutrition-only NDCG from 0.130 to 0.697.

How FlavorFuse works

Ingredients and nutrition goals each become a score from 0 to 1 for how well a recipe satisfies that part of the request. One weight α trades them off:

score = α · S_ingredients + (1 − α) · S_nutrition
  1. Read the query. Free-text ingredients, plus optional limits on seven nutrients: a target (within ±20%), a maximum or a minimum.
  2. Score every recipe twice. S_ing is TF-IDF matching over cleaned ingredient phrases. S_nut measures how well the recipe meets each limit.
  3. Choose α for this query. Two gradient-boosted models read 18 features of the query (feasibility, ingredient-match strength, how the limits look). They predict the relevance and the limit violation each α would give. The system picks the α with the best predicted trade-off.
  4. Decide how many results to show. A classifier cuts the list where recipes stop being relevant, instead of always showing six.
  5. Explain the result. Each recipe shows which ingredients it uses and whether it meets each goal. When no recipe meets every goal, a banner says these are the closest matches.

How it was tested

Real users' queries were not available, so queries are simulated from recipes in a held-out split. Train data fits the models, validation data tunes settings, and the test split was run once per suite after every setting was frozen.

Query model

2 to 4 ingredients from a recipe (common staples like salt skipped), a noise ingredient in 20% of queries, and 1 to 3 nutrition limits taken from that recipe with random slack.

Relevance grades

2 for the source recipe. 1 for recipes covering at least 2/3 of the ingredients and meeting every limit. 0 for everything else.

Three suites

Mixed: the real mix of query types. Easy: a recipe meeting every limit exists. Over-constrained: at least one limit is stricter than the source recipe meets.

Statistics

95% bootstrap confidence intervals and paired Wilcoxon tests against each baseline, on the same queries.

Compare the systems

Final test split, 2,000 queries per suite, seed 42. Pick a suite and a metric. The best value in each view is highlighted.

Why adapt α for each query

A single α cannot suit every kind of query. These numbers come from the research README.

ObservationValueSplit
Best fixed α on easy queries0.6validation
Best fixed α on over-constrained queries0.9validation
Gain from the best α for every query, chosen in hindsight (oracle)+0.022 easy, +0.047 over-constrained NDCGvalidation
Share of the oracle gain the learned α recoversabout a thirdvalidation
α = 0.6 tuned on easy queries, scored on mixed / over-constrained0.528 / 0.174test
α = 0.7 tuned on mixed queries, scored on mixed / over-constrained0.569 / 0.288test
Learned α, no tuning to the mix0.601 / 0.364test

Statistical comparisons on the test split

SuiteLearned α compared withNDCG@10 gainp-value
MixedFixed α tuned on the same data+0.0322e-5
MixedHard filter with fallback+0.0841e-14
MixedOriginal app+0.2171e-119
Over-constrainedHard filter with fallback+0.2241e-125
Over-constrainedBest fixed α+0.0777e-22

On mixed queries the learned α cuts mean constraint violation from 0.715 (original app) to 0.027.

Which query features matter

The learned α was retrained on subsets of its 18 features. The table shows NDCG gain over the best fixed α that is at least as compliant (validation split, 95% confidence interval).

FeaturesGain at λ = 1Gain at λ = 4
All 18+0.034 [0.021, 0.046]+0.048 [0.035, 0.061]
Without feasibility+0.030 [0.018, 0.043]+0.041 [0.028, 0.055]
Without ingredient features+0.023 [0.011, 0.034]+0.024 [0.012, 0.036]
Without nutrition features+0.024 [0.014, 0.036]+0.014 [0.002, 0.025]
Only feasibility (2)+0.012 [0.006, 0.018]+0.018 [0.007, 0.028]
No features (α only)00

No single group carries the gain. Feasibility alone gives little, which is why the model uses all three groups. Many intervals overlap, so this shows which parts matter, not a ranking.

Choosing how many recipes to show

On validation data (897 mixed queries with ingredients), the learned cutoff showed 0.5 to 0.8 more relevant recipes per query than the best fixed rule at the same number of irrelevant ones, at every cost setting tested (p < 1e-4). At a mid cost setting it showed 4.2 recipes on average, 2.2 of them relevant. This is a validation result and has not been run on the test split.

What the evidence supports

ClaimStatus
One unified ranking beats the two separate searchesSupported validation and test
Query-adaptive α beats fixed αSupported test split, mixed and over-constrained suites
Adaptive list sizeSupported validation only, not yet on test
Adaptive diversity re-ranking (MMR)Not supported no better than a fixed weight
Gain on easy queries over hard filteringNot supported tied: 0.701 vs 0.703
Feasibility alone as the signal for αWeak little gain without the other features
Results hold for real usersNot yet tested human study built, no results yet

The app

The research ranker is live in the web app behind POST /recommend/hybrid.

Search

One box takes ingredients or a dish name. Nutrition goals are optional: pick a quick goal like low calorie or high protein, or set a limit per nutrient.

Explained results

Every recipe shows the ingredients you have, each goal with the recipe's value and whether it is met, and the α the search chose.

Saved recipes and accounts

Sign up, log in, and save recipes with the heart button. Accounts run on a separate Node and Express server.

Admin page

Add, edit, search and delete recipes and manage users. Changes reach the recommender within about 30 seconds without a restart.

PartBuilt with
Web appReact, Vite, Tailwind
Recipe API and recommenderFastAPI, scikit-learn, NumPy, SciPy
Account serverNode, Express
DataMongoDB, 45,630 recipes

Requests take about 0.1 s once the index is built, which takes about 25 s after the server starts.

Limits

Reproduce it

Every number comes from fixed seeds and committed settings.

cd backend/research
pip install -r requirements.txt
python -m unittest discover tests                              # 47 tests
python run_experiments.py --split test --n 2000 --suite mixed  # headline table

The full protocol, all 22 findings and the tuning procedure are in the research README. The source is on GitHub.