CoolFace
Datasetpublic

benjac8/bio-bite-recovery-nutrition

Bio-Bite — Recovery Nutrition Dataset A synthetic dataset of 10,000 recovery profiles paired with matching recovery recipes. Each row links a physiological state (strain, sleep, HRV) to a rule-grounded nutritional target and a generated recipe intended to address it. Built for the Bio-Bite project: an app that reads the recovery data a smartwatch already collects — strain, sleep, HRV — and turns it into a personalized recovery meal and a next-day plan. Dataset… See the full description on the dataset page: https://huggingface.co/datasets/benjac8/bio-bite-recovery-nutrition.

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes122downloads
Dataset Card

Bio-Bite — Recovery Nutrition Dataset

A synthetic dataset of 10,000 recovery profiles paired with matching recovery recipes. Each row links a physiological state (strain, sleep, HRV) to a rule-grounded nutritional target and a generated recipe intended to address it.

Built for the Bio-Bite project: an app that reads the recovery data a smartwatch already collects — strain, sleep, HRV — and turns it into a personalized recovery meal and a next-day plan.


Dataset summary

Rows10,000
Features17 (text + numeric + categorical)
LanguageEnglish
Generated byQwen/Qwen2.5-3B-Instruct (zero-shot prompting, run locally on a free Colab T4 GPU)
Seeds6 seeded chunks (seed = 1…6), merged and de-duplicated

Features

ColumnTypeDescription
Physiological_StatetextVerbal description of the athlete's state
recovery_categorycategoricalOne of 6 recovery goals (label for retrieval evaluation)
strain_levelnumericTraining strain, 0–21 (WHOOP-style scale)
sleep_hoursnumericHours slept
hrvnumericHeart-rate variability
Nutritional_NeedtextThe evidence-based need derived from the state
Recipe_NametextDish name
IngredientstextComma-separated ingredients
InstructionstextNumbered preparation steps
Prep_TimenumericMinutes
calories, protein_g, carbs_g, fat_g, magnesium_mgnumericEstimated nutrition
cuisine, diet_tagcategorical8 cuisines, 5 dietary patterns

How it was built (and why it's defensible)

The physiology → nutrition mapping is encoded in code, not invented by the model. For each of the 6 recovery categories, recovery-nutrition heuristics (protein-containing foods after resistance exercise, carbohydrate-containing foods after endurance work, nutrient-dense foods for general recovery, and fluids/electrolytes after heavy sweating) define the Nutritional_Need and plausible ranges for strain/sleep/HRV. The language model writes the recipe against that target.

Two deterministic generation-time guardrails reject many non-compliant outputs before they enter the dataset:

  1. 1.Dietary guardrail — regex rejection of any recipe containing an ingredient disallowed by its diet_tag (with plant-compound exceptions so "almond milk" and "peanut butter" aren't false positives).
  2. 2.Language guardrail — langdetect rejection of any non-English output.

EDA findings

Size & balance

10,000 rows × 17 features. All three categorical dimensions are well balanced, with no dominant class:

  • —Recovery goals: sleep-deprived (1,778) → strength-recovery (1,549); max/min ratio 1.15
  • —Cuisines: Italian (1,329) → Mexican (1,138); ratio 1.17
  • —Diets: vegetarian (2,143) → vegan (1,787); ratio 1.20

[image]

Recovery goals, cuisines and diets are evenly represented — no dominant class.

[image]

Distributions of every numeric feature. Note the long right tails on `magnesium_mg` and `calories`, discussed under limitations below.

Data quality

CheckResult
Missing values0
Duplicate rows0
Duplicate recipe names0
Instructions under 20 chars0
Original dietary checker0 flags under its limited rule set
Stricter post-hoc dietary audit95 rows flagged for manual review
Non-English rows0 ✅ guardrail confirmed

The stricter audit was added after the original EDA. It conservatively flags 5 vegan-tagged recipes containing `ghee` and 90 gluten-free-tagged rows that name at least one potentially gluten-containing grain (wheat, barley, farro, spelt, bulgur, or seitan). These flags expose a real limitation of the first regex checker; they are not silently removed because doing so would invalidate the published embedding row order. The app applies a broader downstream guardrail, and the dataset must not be treated as allergen-certified.

The encoded science shows up in the data

Mean values per recovery goal — every prediction from the encoded principles is borne out:

recovery_categoryprotein_gcarbs_gfat_gmagnesium_mgcaloriesPrep_Time
endurance-recovery16.458.010.8146.2456.325.8
high-stress14.838.713.8180.9401.227.6
rehydration12.941.410.5116.0375.628.0
rest-day13.949.811.4144.8412.432.3
sleep-deprived12.248.69.5179.8385.514.7
strength-recovery24.143.514.6155.1469.927.4
  • —Strength-recovery has the highest protein (24.1 g) — 65% above the next-highest category. Muscle repair signal is clear.
  • —Endurance-recovery has the highest carbs (58.0 g) — glycogen replenishment.
  • —Sleep-deprived and high-stress have the highest magnesium (179.8 / 180.9 mg) — this reflects an encoded dataset heuristic, not evidence that a meal treats insomnia, anxiety, stress, or cortisol levels.
  • —Sleep-deprived has by far the shortest prep (14.7 min) vs 32.3 for rest-day — exhausted users get fast meals.

[image]

The encoded rules are visible in the data: protein peaks for strength-recovery, carbohydrate for endurance-recovery, and magnesium for the sleep-deprived and high-stress states.

[image]

Prep-time distribution per goal. The sleep-deprived band is both lower and tighter — the generation constraint held.

[image]

Ingredient profiles differ by recovery state: protein sources dominate strength-recovery, while greens, seeds and nuts dominate the sleep-deprived and high-stress meals.

Correlations — and an important nuance

Pairwise correlations with the physiological inputs are weak: strain_level ↔ protein_g = 0.21 and sleep_hours ↔ magnesium_mg = −0.12.

The directions are correct (more strain → more protein; less sleep → more magnesium), but the magnitudes are small because the relationship is mediated by `recovery_category`, not linear in the raw numbers. Strain ranges overlap across categories by design (a strain of 13 could be strength-recovery or sleep-deprived), so the grouped means above are the honest measure of effect — a 65% protein difference between categories that a linear correlation of 0.21 badly understates. This is why the recommender matches on the state description, not on raw numeric distance.

Stronger structural correlations appear where you'd expect within recipes: calories ↔ protein_g = 0.57, calories ↔ fat_g = 0.44, calories ↔ carbs_g = 0.43, and sleep_hours ↔ hrv = 0.55 (both encoded as recovery indicators).

[image]

[image]

The two targeted relationships. The trend directions are correct but the slopes are shallow — the effect is carried by `recovery_category`, not by the raw numbers.

Model artifacts flagged (limitations)

Being sceptical of synthetic data, the following generator artifacts were identified and are documented rather than hidden:

  • —Macros are LLM estimates, not computed from ingredient nutrition tables. Relative patterns across categories are reliable; absolute values are approximate.
  • —Implausible extremes survive validation: protein_g and fat_g reach a minimum of 0, and magnesium_mg reaches 970 mg (far above a realistic single-meal amount). Range bounds caught gross errors but not all edge cases.
  • —240 meals under 250 kcal — light for a recovery meal; some outputs are snacks rather than full meals.
  • —Outliers (IQR): calories 607, protein 504, magnesium 220, carbs 76, fat 170, prep time 3. Retained deliberately — culinary variety produces genuinely wide macro ranges — but flagged for downstream use.
  • —Minor formatting inconsistency in instruction numbering (1. vs #1).
  • —Diet-label conflicts require manual review: a stricter 5 Aug 2026 audit flagged 95 rows that the original checker missed (5 vegan/ghee and 90 gluten-free/potentially gluten-containing grain conflicts). This is documented rather than hidden; correcting the rows requires a versioned dataset release and regenerated embeddings.

Intended use & limitations

⚠️ Educational prototype — not medical or nutritional advice. This dataset is synthetic and generated by a language model; it has not been reviewed by a registered dietitian. It is intended for research and educational use in recommendation and generation systems. Consult a qualified professional for personal nutrition or training guidance.

Scientific claim boundaries and sources are documented in SCIENTIFIC_BASIS.md.

Assignment alignment

Course requirementEvidence in this repository
English-only text dataset with at least 10,000 examplesbiobite_full_clean.csv — exactly 10,000 rows × 17 features
Dataset generated with a pretrained Hugging Face modelQwen/Qwen2.5-3B-Instruct; reproducible prompting code in notebooks/data_generation.ipynb
EDA published in the Dataset READMEBalance, quality, nutrition patterns, correlations, plots and limitations above
EDA notebook uploadednotebooks/Part2_EDA.ipynb — 17/17 code cells executed with no saved errors
Three Hugging Face embedding models evaluatedE5, BGE and MiniLM, plus a TF-IDF baseline, in notebooks/Part3_Embeddings_RecSys.ipynb
Best embedding model selected and publishedE5 is the best neural retriever and is published at `benjac8/biobite-retriever`
Recommendation pipeline sanity-checked72 external queries, precision@3, MRR, nDCG@10, category breakdown and error analysis
Hugging Face generation model evaluatedThree Qwen sizes tested on 18 fixed cases in notebooks/Part4_Generation.ipynb
Working Gradio application`benjac8/Bio-Bite` reads the pinned dataset and model repos

The Space contains the saved embedding file, recommendation code, generation code and three one-click Quick Starters required by the brief. The Dataset, Model and Space are kept as three separate, linked Hugging Face repositories.

Retrieval and generation evaluation v2

Method scope: classification, regression and clustering

Bio-Bite is primarily a retrieval and recommendation system, not a classical supervised-learning pipeline. It does not train K-Means clusters or a regression model. The six recovery_category values are predefined, rule-grounded labels; they were not discovered by clustering. In the app, a classification-like router selects one of those six categories by combining semantic retrieval (65%) with an explainable wearable-range fit (35%). This is a deterministic hybrid routing decision, not a separately trained classifier. Correlation and grouped-mean analyses are reported in the EDA, but no continuous nutrition target is predicted with regression.

The repository includes a leakage-free retrieval benchmark with 72 balanced queries (12 per recovery category). recovery_category and Nutritional_Need are excluded from the embedded corpus text. Results include precision@3 with a bootstrap 95% confidence interval, MRR, nDCG@10, per-category metrics and latency. TF-IDF scored precision@3 = 0.634; e5-small-v2 was the best neural retriever at 0.551 and is published as the clearly attributed, non-fine-tuned `benjac8/biobite-retriever` deployment snapshot.

Generation was evaluated deterministically on 18 cases spanning all six categories, diets, ingredient exclusions and preparation-time limits. Qwen/Qwen2.5-3B-Instruct won with a 66.7% overall pass rate, 77.8% valid JSON and a 100% science-claim pass rate. Invalid generations are rejected by the app and handled through its documented graceful-degradation path.

After deployment, the live ZeroGPU Space passed all eight required end-to-end scenarios functionally: Strength, Endurance, Sleep, Stress, Rest, Hydration, conflicting text/structured sleep values, and Vegan/no-nuts/15-minute constraints. The latest saved run returned three recommendations, a validated recipe and a next-day plan in every case. On 4 Aug 2026 the model generated 1/8 recipes and the constraint-preserving deterministic fallback served 7/8 after the free daily ZeroGPU quota was exhausted. Screenshot OCR was separately verified with Sleep 5.5 h, Strain 18.2 and HRV 32. The test artifact records generator use separately from functional success.

Reproducibility

All randomness is seeded (SEED = 42; chunk seeds 1–6). The generation notebook (data_generation.ipynb) and the EDA notebook (Part2_EDA.ipynb) are included in this repository and run top-to-bottom on a free Colab GPU.

Files

  • —biobite_full_clean.csv — the dataset (10,000 rows)
  • —data_generation.ipynb — synthetic data generation
  • —Part2_EDA.ipynb — exploratory data analysis
  • —notebooks/Part3_Embeddings_RecSys.ipynb — executed model comparison and recommender checks
  • —notebooks/Part4_Generation.ipynb — executed generation-model comparison
  • —eda_plots/ — all figures from the EDA (displayed above)
  • —evaluation/ — v2 benchmark scripts and fixed evaluation cases
  • —artifacts/evaluation_v2/ — generated comparison tables and configurations
  • —evaluation/dietary_audit_20260805.py — reproducible stricter diet-label audit
  • —artifacts/dietary_audit_20260805.csv — the 95 rows flagged for manual review
  • —artifacts/live_space_tests_20260804.json — latest recorded 8/8 live verification