Built to order

Food Calorie Estimation from Photos using CNN

This project estimates calories from meal photos with a two-headed CNN — an EfficientNet-B0 backbone that simultaneously classifies the dish (101 Food-101 classes) and regresses calories per 100 g. A portion multiplier and a per-dish nutrition table turn the prediction into a calorie and macro breakdown. The project is explicit about its error band: a diet-logging aid, not medical advice. Suitable for B.E./B.Tech final-year projects in Computer Science, Information Technology and AI/ML.

Food Calorie Estimation from Photos using CNN — project thumbnail preview
More project photos (2)

The problem

Diet-logging apps fail when every meal must be typed and portion-guessed by hand; photo-based estimation removes that friction. The task splits into two coupled problems: recognizing the dish, and estimating its energy content. The Food-101 dataset (Bossard, Guillaumin and Van Gool, ETH Zurich) gives 101,000 labeled food images across 101 dishes — the standard classification benchmark — while calorie values come from a curated per-dish nutrition table. A shared convolutional backbone with two heads (classification + regression) learns visual features useful to both tasks at once. The honest engineering lives in the error handling: the demo shows dish confidence next to the calorie number, states the measured error band, and never presents the estimate as medical advice.

How it works

  1. The meal photo is resized to 224x224 and normalized for the EfficientNet-B0 backbone.
  2. The backbone extracts multi-scale food features — texture, color, shape.
  3. Head A (Dense(101) + softmax, cross-entropy) predicts the dish; head B (Dense(1) + ReLU, MSE) predicts kcal per 100 g.
  4. Joint training uses a weighted loss: 0.6 × classification + 0.4 × regression.
  5. The kcal/100 g output is scaled by the dish reference weight and the user's portion multiplier.
  6. The nutrition table supplies protein/carbs/fat for the predicted dish; the demo renders the full breakdown.

Tech stack:

  • Python 3.10, TensorFlow/Keras or PyTorch
  • EfficientNet-B0 (ImageNet pre-trained)
  • Food-101 dataset (ETH Zurich)
  • Curated per-dish nutrition table
  • Flask (demo backend)
  • HTML/CSS/JavaScript (demo UI)
  • Git

Dataset & Model Details

  • Dataset: Food-101 — 101,000 images, 101 dish classes (75,750 train / 25,250 test); source: L. Bossard et al., ETH Zurich. Calorie values from a curated per-dish nutrition table joined by class label; the regression head trains on portion-annotated samples.
  • Model input: 224x224x3 image. Outputs: 101-way dish softmax + single kcal/100 g regression value.
  • Architecture: EfficientNet-B0 → Head A Dense(101)+softmax → Head B Dense(1)+ReLU; weighted joint loss.
  • Metric: dish top-1 accuracy + calorie MAE on the test split, measured after training. Design target: MAE within ±15%; the shipped report states the measured error.
Parameter Value
Dishes 101 classes (Food-101)
Input 224x224 meal photo
Outputs Dish + kcal + protein/carbs/fat
Portions 0.5x / 1x / 2x selectable
Inference Under 1 s per photo on CPU (design target)
Demo Photo upload + portion picker

Project features

  • [Two-headed architecture] One EfficientNet-B0 backbone feeds a 101-class dish classifier and a calorie regression head, trained with a weighted joint loss.
  • [Portion-aware estimates] The user picks 0.5x/1x/2x servings; the regression head's per-100-g output scales to the serving.
  • [Macro breakdown] Protein, carbs and fat computed from the per-dish nutrition table for the predicted dish.
  • [Confidence-transparent UI] Dish confidence displayed next to the calorie figure, so uncertain classifications are visible, not hidden.
  • [Curated nutrition table] Per-100-g values for all 101 dishes ships with the project and is editable.
  • [Measured error band] Calorie MAE reported from the held-out test split — the report states the band plainly.
  • [Viva-ready documentation] Report, PPT and Q&A covering multi-task learning, regression metrics and honest failure modes.

What is included

  • Python training notebook (two-head training, joint loss, evaluation)
  • Curated per-dish nutrition table (editable)
  • Trained model weights
  • Test-split evaluation: top-1 accuracy + calorie MAE from the actual run
  • Web demo (photo upload, portion picker, macro breakdown)
  • Project report PDF (methodology, error analysis, limitations)
  • PPT presentation for final review
  • Viva Q&A preparation document

Limitations & prerequisites

  • Estimates are approximate: hidden oil, sauces and true portion size are the biggest error sources.
  • Mixed plates (thali with 5 items) are read as the dominant dish; multi-dish segmentation is future scope.
  • This is a diet-logging aid, explicitly not medical or clinical nutrition advice.
  • Dishes outside the 101 Food-101 classes get the closest match, which may be wrong — confidence display mitigates this.
  • Fine-tuning benefits from a GPU; CPU training is possible but slow on 101k images.

Frequently Asked Questions

Where do the calorie numbers come from?

Food-101 provides dish labels only. A curated per-dish nutrition table (kcal/protein/carbs/fat per 100 g) ships with the project, and the regression head learns kcal-per-100-g from portion-annotated training samples.

How accurate are the estimates?

The notebook measures calorie MAE on the held-out test split; the design target is within ±15%, and the report states the measured band honestly, including failure cases like occluded portions.

Can it handle a full thali with many items?

Not yet — it predicts the dominant dish. Multi-dish segmentation is documented as future scope.

Is this medical advice?

No. The listing and the demo both state it is a diet-logging aid with an approximate error band, not clinical nutrition guidance.

Do I need a GPU?

Recommended for training on 101k images; inference and the demo run fine on CPU.

Is this project suitable for a final-year project?

Yes — for Computer Science, IT and AI/ML programs. It combines classification, regression, multi-task learning and honest error analysis on a real benchmark. Suitable for B.E./B.Tech final-year projects in Computer Science, Information Technology and AI/ML.

Components & software requirements
  • Python 3.10, TensorFlow/Keras or PyTorch
  • EfficientNet-B0 (ImageNet pre-trained)
  • Food-101 dataset (ETH Zurich)
  • Curated per-dish nutrition table
  • Flask (demo backend)
  • HTML/CSS/JavaScript (demo UI)
  • Git

Dataset & Model Details

  • Dataset: Food-101 — 101,000 images, 101 dish classes (75,750 train / 25,250 test); source: L. Bossard et al., ETH Zurich. Calorie values from a curated per-dish nutrition table joined by class label; the regression head trains on portion-annotated samples.
  • Model input: 224x224x3 image. Outputs: 101-way dish softmax + single kcal/100 g regression value.
  • Architecture: EfficientNet-B0 → Head A Dense(101)+softmax → Head B Dense(1)+ReLU; weighted joint loss.
  • Metric: dish top-1 accuracy + calorie MAE on the test split, measured after training. Design target: MAE within ±15%; the shipped report states the measured error.
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 abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation