--- license: cc-by-4.0 task_categories: - other tags: - food - nutrition - density - FoodSeg103 - calories - computer-vision - food-segmentation pretty_name: FoodSeg103 Food Density & Nutrition Dataset size_categories: - n<1K --- # FoodSeg103 Food Density & Nutrition Dataset ## Dataset Summary This dataset provides **physical density** and **nutritional information** for all **103 food ingredient classes** defined in the [FoodSeg103](https://xiongweiwu.github.io/foodseg103.html) benchmark — a large-scale food image segmentation dataset introduced in the ACM MM 2021 paper *"A Large-Scale Benchmark for Food Image Segmentation"* (Wu et al., 2021). The goal is to enrich food segmentation models with physical and nutritional context, enabling downstream tasks such as **calorie estimation**, **portion size calculation**, and **nutrient profiling** from food images. --- ## What is FoodSeg103? FoodSeg103 is a large-scale benchmark for fine-grained food image segmentation containing **7,118 images** annotated with **103 ingredient classes** and pixel-wise segmentation masks. Each image contains an average of 6 ingredient labels. The dataset was curated from Recipe1M and annotated by human annotators. - **Paper:** [A Large-Scale Benchmark for Food Image Segmentation](https://arxiv.org/abs/2105.05409) - **Authors:** Xiongwei Wu, Xin Fu, Ying Liu, Ee-Peng Lim, Steven C.H. Hoi, Qianru Sun - **GitHub:** [LARC-CMU-SMU/FoodSeg103-Benchmark-v1](https://github.com/LARC-CMU-SMU/FoodSeg103-Benchmark-v1) - **License:** Apache 2.0 --- ## This Dataset For each of the 103 FoodSeg103 food classes, this dataset provides: ### Physical Density (from aqua-calc.com / USDA) Bulk/apparent density measured as grams per 250 mL metric cup, converted to standard units. Useful for estimating **food mass from volume** (e.g., from segmentation masks with depth estimation). ### Nutritional Information (per 100g, from FatSecret) 18 nutrition columns sourced from [FatSecret](https://www.fatsecret.com), which aggregates USDA FoodData Central data. --- ## Dataset Structure ### Columns | Column | Type | Description | |--------|------|-------------| | `class_id` | int | FoodSeg103 class ID (0–102) | | `class_name` | string | FoodSeg103 class label | | `food_description` | string | USDA/aqua-calc food name for density lookup | | `g_per_metric_cup` | float | Grams per 250 mL metric cup (bulk density raw) | | `density_g_per_cm3` | float | Density in g/cm³ | | `density_kg_per_m3` | float | Density in kg/m³ | | `calories_kcal` | float | Energy (kcal per 100g) | | `fat_total_g` | float | Total fat (g per 100g) | | `fat_saturated_g` | float | Saturated fat (g per 100g) | | `fat_polyunsat_g` | float | Polyunsaturated fat (g per 100g) | | `fat_monounsat_g` | float | Monounsaturated fat (g per 100g) | | `fat_trans_g` | float | Trans fat (g per 100g) | | `cholesterol_mg` | float | Cholesterol (mg per 100g) | | `sodium_mg` | float | Sodium (mg per 100g) | | `carb_g` | float | Total carbohydrates (g per 100g) | | `fiber_g` | float | Dietary fiber (g per 100g) | | `sugar_g` | float | Total sugars (g per 100g) | | `protein_g` | float | Protein (g per 100g) | | `vitamin_a_ug` | float | Vitamin A (µg RAE per 100g) | | `vitamin_c_mg` | float | Vitamin C (mg per 100g) | | `vitamin_d_ug` | float | Vitamin D (µg per 100g) | | `calcium_mg` | float | Calcium (mg per 100g) | | `iron_mg` | float | Iron (mg per 100g) | | `potassium_mg` | float | Potassium (mg per 100g) | --- ## Data Collection ### Density Data - **Source:** [aqua-calc.com](https://www.aqua-calc.com/page/density-table) (powered by USDA FoodData Central) - **Method:** Web scraping — each food matched to closest USDA entry - **Unit:** Bulk/apparent density (includes air gaps), not true solid density - **Conversion:** `density (g/cm³) = g_per_metric_cup / 250` ### Nutrition Data - **Source:** [FatSecret](https://www.fatsecret.com) (aggregates USDA FoodData Central / SR Legacy) - **Method:** Web scraping — searched by class name, fetched 100g serving page - **Unit:** Per 100g of food (consistent across all classes) --- ## Usage Examples ```python from datasets import load_dataset ds = load_dataset("arunapb/food-density-nutrition", split="train") df = ds.to_pandas() # Estimate mass from segmented volume (cm³) def estimate_mass(class_name, volume_cm3): row = df[df["class_name"] == class_name].iloc[0] return volume_cm3 * row["density_g_per_cm3"] # Estimate calories from mass def estimate_calories(class_name, mass_g): row = df[df["class_name"] == class_name].iloc[0] return (mass_g / 100) * row["calories_kcal"] # Example: 200cm³ of apple mass = estimate_mass("apple", 200) # ~105.6g cals = estimate_calories("apple", mass) # ~54.9 kcal print(f"Mass: {mass:.1f}g | Calories: {cals:.1f} kcal") ``` --- ## Intended Use Cases - **Calorie estimation** from food segmentation masks (volume → mass → calories) - **Nutritional profiling** of meals from food images - **Portion size analysis** using physical density and segmented area - **Dataset enrichment** — adding nutritional metadata to FoodSeg103 predictions - **Food computing research** — linking vision models to nutritional knowledge --- ## Limitations - Density values are **bulk/apparent densities** and vary with food preparation and packing - Nutrition values are **generic averages** — actual values vary by variety, preparation, and ripeness - Some classes (e.g. `other ingredients`, `hanamaki baozi`) are broad and have approximate values --- ## Citation ```bibtex @inproceedings{wu2021foodseg103, title = {A Large-Scale Benchmark for Food Image Segmentation}, author = {Xiongwei Wu and Xin Fu and Ying Liu and Ee-Peng Lim and Steven C.H. Hoi and Qianru Sun}, booktitle = {Proceedings of the 29th ACM International Conference on Multimedia}, year = {2021}, doi = {10.1145/3474085.3475628} } ``` --- ## License - **This dataset:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) - **FoodSeg103 class list:** Apache 2.0 (Wu et al., 2021) - **Nutritional & density data:** USDA FoodData Central (public domain)