Tech deep-dive

From photo to calories. How the AI does it.

Three stages: a vision model identifies the foods, a portion estimator sizes each one, and a nutrition database returns calories and macros. About two seconds in total, with a within-8% dietitian benchmark target.

Sign up freeFree account. No card.
Try the AI · live
Run the pipeline.
Upload a meal photo or type it. No signup.
Today0/ 2,000 kcal
Log something. I’ll do the rest.
The pipeline

Three stages. About two seconds.

Stage 1: the camera frames a plate of pasta
1  Detect
Stage 2 and 3: pasta 320, tomato sauce 120, parmesan 80, olive oil 120, total 640 kcal
2  Portion and lookup
Correct any stage: tell the AI what the photo cannot see
3  Correct
  1. 01

    Detect

    A vision model identifies each food, with a confidence score.

  2. 02

    Estimate the portion

    Plate scale, utensil cues and visual volume become grams.

  3. 03

    Look up nutrition

    Grams times USDA FoodData Central values equals calories.

Stage 1 · Detection

What is on this plate?

A vision model takes the photo and returns a structured list of foods detected, with bounding regions and confidence scores. It recognizes both individual foods (“grilled chicken,” “white rice”) and composed dishes (“Chipotle chicken bowl,” “Big Mac”).

For composed dishes from common chains, the model identifies the dish as a unit, then pulls posted nutrition data instead of summing the components. Detection is usually accurate; it's not where most error lives.

Stage 2 · Portion

The hardest stage.

The portion estimator looks at each detected food and estimates how much is there in grams. It uses plate scale (standard plate sizes are known), utensil scale (forks and spoons are secondary references), and visual volume (depth cues from shadows and color gradient).

Once volume is estimated, the model multiplies by the known density of each food (rice is about 0.7 g/cm³, beef about 1.0 g/cm³) to get grams. Portion estimation is where most of the error in any AI picture calorie counter lives. The interface compensates with a confidence range and one-tap adjust.

A plate of sliced roast beef, mashed potatoes and green beans with a fork and spoon beside it
The plate and the fork and spoon beside it set the scale; density then turns volume into grams, about 1.0 g/cm³ for beef.
Stage 3 · Lookup

Plain arithmetic, not a guess.

Calorie values are not guessed by the AI. Each detected food maps to a public nutrition database, and calories are calculated from the estimated grams.

Primary database: USDA FoodData Central. Open Food Facts for international packaged products. Restaurant chain menus stored as a curated dataset, refreshed quarterly.

Example calculation
200 g cooked white rice (detected)
× 1.30 kcal/g (USDA FDC ID 169757)
= 260 kcal
A bowl of plain cooked white rice with a spoon next to a rice cooker
200 g of cooked white rice at 1.30 kcal per gram is 260 kcal, using USDA FoodData Central values.
Error budget

Where the error lives.

Against our within-8% dietitian target, most of the remaining error comes from one stage: sizing the portion.

Typical error contribution by pipeline stage
StageTypical error contribution
Food detectionRight or wrong foodLow on common foods.
Portion estimationRight food, wrong amountDominant: the main source of error.
Nutrition lookupRight food, right amountSmall: database values are standard.
Why we don't just ask

Single-call AI is a black box.

A simpler design would be: feed the photo to a multimodal model, ask “how many calories is this?”, return the answer. We don't do this. Single-call calorie estimation can hallucinate confidently, and there's no way to debug a wrong answer or correct one stage.

The three-stage pipeline is slightly slower but transparent. If detection is wrong, one tap fixes it. If the portion is wrong, a nudge fixes it. You see what the AI saw and correct each stage independently.

Inputs handled

Six ways in. One pipeline.

  • 01PhotosThe default. Top-down or 45° angle is best.
  • 02Recipe screenshotsIngredient lists are parsed from screenshot text.
  • 03Menu screenshotsRestaurant menu item names are recognized as food entities.
  • 04Nutrition label photosRead directly. Most accurate input because lookup is exact.
  • 05Text only"I had a chicken sandwich and a small fries" works without a photo.
  • 06VoiceVoice transcription feeds the same text pipeline (in the Onmode app).
Photo to calories · FAQ

Quick answers.

Three stages: identify foods, estimate portions, look up nutrition. Detection is usually accurate. Portion estimation is the wildcard. Nutrition lookup is a deterministic database query, not a guess by the AI.
Related

Keep reading.

Keep exploring

More on this topic.

Free in your browser.Try it free