Food Recognition & Nutrition Estimation:
YOLO Approach on Food-101 Dataset
An image-based multi-object deep learning framework comparing YOLOv8, YOLOv11, and YOLOv12, seamlessly mapped to the Indonesian Food Composition Table (TKPI) and NutriSurvey for real-time school meal accountability.
2Dept. of Public Health, STIKes Payung Negeri Pekanbaru, Riau
Vital for Human Survival. Broken in Daily Practice.
Food intake determines metabolic equilibrium and shields against chronic diseases (obesity, diabetes, hypertension, stunting). Yet monitoring food quality and portions at scale remains nearly impossible with manual tools.
Manual food diaries and 24-hour recall depend heavily on subjective user memory. They are tedious, error-prone, and unsustainable for large-scale institutional school feeding supervision.
Digital meal images provide non-invasive visual cues (color, geometry, texture). By coupling YOLO multi-object detection with the Indonesian Food Composition Table (TKPI), this study creates an objective, instant pipeline for dietary governance.
The Multi-Item Food Plate Dilemma
Why existing single-label CNN models break down on real cafeteria trays.
Most academic food recognition research applies single-label image classification. They assume 1 photo = 1 dish.
YOLO processes the complete meal plate in a single forward inference pass, predicting multi-scale bounding boxes and class labels directly.
Four Pillars of Our Investigation
Systematic transition from raw pixels to institutional dietary governance.
Benchmark Dataset Annotation
Curating Food-101 into multi-dish bounding box detection format via Roboflow, establishing an 80% train / 20% validation split.
Comparative YOLO Benchmarking
Training and empirically comparing YOLOv8, YOLOv11, and YOLOv12 across mAP@50, precision, recall, and F1-score metrics.
Indonesian Nutrition Mapping
Coupling detected class predictions to the Indonesian Food Composition Table (TKPI) and NutriSurvey for 12 key nutrients.
End-to-End System Deployment
Building a field-ready web interface with dual-AI reasoning (Gemini LLM) and Filament administrative daily audit tracking.
Research Framework: Figure 1 Architecture
Figure 1: Research Framework (Dewi Nasien et al., 2026)
Food-101 dataset annotated with bounding boxes in Roboflow and divided into 80% train / 20% validation splits.
YOLOv8, YOLOv11, and YOLOv12 trained on augmented inputs (640x640 resolution) across identical evaluation criteria.
Predicted food labels matched against Indonesian TKPI & NutriSurvey databases to calculate macro and micro nutrients.
Responsive web portal for real-time mobile camera capture, nutrition scoring, and administrative audit trails.
Dataset Curation with Roboflow
Managing the Food-101 benchmark: 101 categories, 101,000 images, and spatial bounding box labeling.
YOLOv8 vs YOLOv11 vs YOLOv12
Evaluating architectural advances across one-stage object detection backbones.
Anchor-free detection head with C2f modules. Balances feature extraction and inference speed, but has lower recall on crowded plates.
Integrates C3k2 building blocks and optimized SPPF pooling. Demonstrates faster convergence and improved boundary delineation.
Introduces area attention mechanisms into feature representations. Effectively reduces missed detections across overlapping mixed dishes.
Performance Comparison of YOLO Models
| Model | mAP@50 | Precision | Recall | F1 |
|---|---|---|---|---|
| YOLOv8 | 96.2% | 99.1% | 94.7% | 96.7% |
| YOLOv11 | 98.8% | 99.2% | 96.3% | 97.6% |
| YOLOv12 | 99.6% | 99.2% | 97.1% | 98.0% |
YOLOv8
YOLOv11
YOLOv12 (Peak)
TKPI & NutriSurvey Knowledge Engine
Translating bounding-box object detections into clinical macronutrient and micronutrient profiles.
Anchored to the official Tabel Komposisi Pangan Indonesia (Kemenkes RI) for regionally authentic ingredients and cooking methods.
Computes Energy (kcal), Protein, Fat, Carbohydrates, Dietary Fiber, Sodium, Potassium, Calcium, Iron, and Vitamins A & C.
Automatically benchmarks total meal intake against the required 30-35% daily nutritional allowance for school lunch rations.
Real-World 5-Dish Meal Tray Inference
Demonstrating Figure 6 from publication: 5 detected dishes on a single cafeteria plate.
Figure 6(b): Multi-Food Detection Bounding Boxes
National Impact: Free Nutritious Meal (MBG) Program
Safeguarding nutritional sufficiency and financial accountability for millions of students.
Catering Verification
Portion verification and photo registration before food dispatch.
Rapid Acceptance
Sub-2 second camera verification by teachers prior to student consumption.
Daily Digital Reports
Photographic logs and attendance recorded in Filament 3.
District Oversight
Transparent regional dashboards eliminating fraud and meal waste.
Conclusions & Future Research
Validated breakthroughs and future directions for edge nutrition monitoring.
YOLOv12 achieved superior metrics (99.6% mAP@50, 98.0% F1), proving one-stage detection solves the multi-dish recognition dilemma.
Nutritional values currently derive from detected classes and standard portion grammages rather than 3D volumetric depth.
Edge deployment (TensorRT/ONNX) for offline 3T schools, IoT smart kitchen scale calibration, and food waste detection.
Complete Guide to Roboflow
for YOLO Object Detection Training
End-to-end walkthrough: creating projects, batch ingestion, drawing tight bounding boxes, dataset versioning, and executing Google Colab training scripts.
Five Core Stages: From Raw Pixels to Trained Model
Create Project
Object Detection project setup in Roboflow.
Upload Images
Batch ingest food photos in JPG/PNG format.
Bounding Boxes
Tag coordinates per food dish using key [B].
Preprocessing
Resize 640x640, horizontal flips, brightness.
Colab Train
Export in YOLOv8/v11/v12 format and run GPU code.
1. Creating a New Project in Roboflow
Initialize an Object Detection project workspace.
- Log in to your Roboflow dashboard.
- Click Create New Project in top right corner.
- Enter Project Name:
food-nutrition-yolo. - Select Project Type: Object Detection (Bounding Box).
- Define primary annotation group:
food. - Click Create Project button.
2. Uploading the Raw Meal Image Dataset
Batch ingest food photos into the cloud annotation pipeline.
- Drag and drop meal folders onto the ingestion dropzone.
- Ensure supported formats: JPG, PNG, WebP.
- Wait for automated checksum and integrity validation.
- Click Save and Continue to register images for annotation.
3. Labeling and Spatial Bounding Box Annotation
Isolating food components with tight coordinates and assigned class identifiers.
- • Select unannotated images from the workspace.
- • Press shortcut key B to activate Bounding Box Tool.
- • Draw tight boxes around individual food items.
- • Assign class tags (e.g.
rice,chicken,tempeh). - • Click Add to Dataset to finalize.
Figure 3(a): Roboflow Annotation Canvas (Paper Reference)
4. Preprocessing & Data Augmentation
Standardizing dimensions and adding synthetic variations to harden generalization.
- • Train/Val Split: 80% Train, 20% Validation.
- • Resize: 640x640 pixels (Fit / Stretch).
- • Horizontal Flip: Left → Right reflection.
- • Random Brightness: ±15% variance.
- • Rotation: ±10° random angle.
Figure 3(b): 80% Training Dataset Configuration
5. Exporting Dataset in YOLO Format
Extracting Python download snippets and API tokens for Google Colab.
- Open generated dataset version under Versions.
- Click Export Dataset in top right.
- Select YOLOv8 PyTorch (also used for v11/v12).
- Choose Show download code → Continue.
- Copy Python snippet into Colab notebook.
Figure 3(c): 20% Validation Dataset Verification
6. Google Colab Training Execution (Python)
Ultralytics YOLO training pipeline with CUDA GPU acceleration.
# 1. Install Ultralytics YOLO & Roboflow SDK !pip install -q ultralytics roboflow # 2. Authenticate & Download Dataset from roboflow import Roboflow rf = Roboflow(api_key="YOUR_ROBOFLOW_API_KEY") project = rf.workspace("workspace-id").project("food-nutrition-yolo") version = project.version(1) dataset = version.download("yolov8") # 3. Train YOLOv12 / YOLOv11 Model with CUDA GPU from ultralytics import YOLO model = YOLO('yolov12n.pt') # pre-trained weights results = model.train( data=f"{dataset.location}/data.yaml", epochs=100, imgsz=640, batch=16, device=0, # CUDA GPU optimizer='AdamW', lr0=0.001, patience=20, name='food_yolo12_run' ) # 4. Evaluate Validation Metrics metrics = model.val() print(f"Validation mAP@50: {metrics.box.map50:.4f}")
7. Model Evaluation, Validation & Live Inference
Exporting best.pt weights and running inference on live meal tray photos.
Model Output Inspection:
- • weights/best.pt: Optimal model weights based on peak validation mAP@50.
- • results.png: Loss progression and precision/recall curves.
- • confusion_matrix.png: Class prediction accuracy breakdown.
Python Inference Snippet:
from ultralytics import YOLO
model = YOLO('runs/detect/food_yolo12_run/weights/best.pt')
results = model.predict('test_meal.jpg', conf=0.5, save=True)
Bounding box predictions feed directly into the nutritional database mapping engine.