Volume II
Write-up
FitHub · Write-up · October 20, 2026
How I chose a model for food photos
Seven vision models, 50 dishes with ground truth, and thresholds set before the run. None of the models passed them — and that is a result too.
- 50
- dishes with measured weight, calories and macros
- 7
- models in the final, 13 across two passes
- 700
- calls: 50 photos × 2 repeats
- $2.37
- cost of the final run
- 0 of 7
- passed all four thresholds
01 / Task
What counts as a win
FitHub counts calories from a photo, and every recognition is a paid call to a vision model. The bot’s default setting is qwen3-vl-235b, and in this comparison it is the baseline.1 I wanted to find out whether it was worth replacing, and with what.
Before the first run I wrote down what I would count as a win. The thresholds have been in the config since October 18; the first run was on the 19th.2
- Calorie error
- ≤ 20%mean across all photos, as % of ground truth
- Price
- ≤ $0.004per photo, actual cost of the call
- Response time
- ≤ 10 sfor 95% of requests
- Failures
- ≤ 5%broken and empty responses
02 / Method
pp — percentage points: the difference between two percentages, not a percentage of a percentage.
The same conditions for everyone
The ground truth is 50 dishes from the open Nutrition5k dataset (Google Research, 2021, CC BY 4.0 license): portion weight, calories and macros are already measured there. Russian names and type tags were added for the project: 25 simple dishes and 25 mixed ones; 27 contain hidden calories — oil, sauce, cheese; 14 small portions and 9 large ones.3
The models get the same system prompt and the same response schema as the bot, at temperature 0; all photos are resized to one size — 1024 pixels on the long side.4 First came a broad pass: 10 models, 1,100 calls, $1.60. Then the final: 7 models, two answers for each of the 50 photos — 700 calls for $2.37; calls already paid for in the first pass were not repeated.5
The code computes the metrics, the threshold cut and the tables; I make the decision. Significance comes from a paired bootstrap: the set of 50 photos is resampled 2,000 times with a fixed seed, separately for the median (the typical photo) and for the mean (misses included).6
Selection process: who does what
Decisions are mine, calculations are the code’s. The last step is still ahead.
- 01meWrite down thresholdswhat counts as a win — in
config.jsonbefore the run - 02meBuild the ground truth50 dishes from Nutrition5k, my own type tags
- 03eval codeCheck and prepare
validate: gaps, duplicates, non-numbers;prepare: 1024 px, JPEG 80 - 04eval codeRun the modelsthe bot’s prompt and response schema, temperature 0; a rerun does not pay again for finished work
- 05eval codeMetrics and cut
score: errors, failures, latency, price, thresholds - 06eval codeAnalysis without new calls
analyze: significance, price vs accuracy, weight vs composition - 07meChoose the modelthe decision and its cost — section 04
- 08meCheck on my own photosrequired before switching the model in the botthe pipeline is ready, no results yet
eval commands per the README and the testing docs; the code was written by AI agents to my specs.Source: README.md:12–21 · docs/TESTING.md:90–106Text version eight steps
- Me: write the win thresholds into
config.jsonbefore the run. - Me: build the ground truth — 50 dishes from Nutrition5k with my own type tags.
- Code:
validatechecks the table and the photos,prepareresizes the photos to 1024 px and JPEG 80. - Code:
runruns the models with the bot’s prompt and response schema at temperature 0; a rerun does not pay again for finished work. - Code:
scorecomputes errors, failures, latency, price and the threshold cut. - Code:
analyzeexamines a finished run without new calls: significance, price vs accuracy, weight vs composition. - Me: choose the model.
- Me: check the chosen model on my own photos — required before switching it in the bot. The pipeline is ready; there are no results in the repository yet.
03 / Results
What the run showed
Five observations, from the general to the specific.
3.1 Nobody passed the thresholds
Mean calorie error ranges from 29.0 to 40.2% against a 20% threshold.7 Nobody passed price and speed together either: only slow models stay within $0.004 per photo, and only expensive ones within 10 seconds.
Four thresholds and seven finalists
Values are from the run’s summary table; a circle with a check mark means the threshold is passed, a circle with a cross means it is not.
| Model | Caloriesmean ≤ 20% | Price per photo≤ $0.004 | Latency, p95≤ 10 s | Failures≤ 5% | Passed |
|---|---|---|---|---|---|
gemini-3.6-flashchosen | 30.3% — failed | $0.00589 — failed | 8.8 s — passed | 0% — passed | 2 of 4 |
gemini-4-argon | 30.2% — failed | $0.00622 — failed | 9.7 s — passed | 0% — passed | 2 of 4 |
gemini-3.8-flash | 29.0% — failed | $0.00521 — failed | 14.4 s — failed | 0% — passed | 1 of 4 |
gemini-3.7-flash | 31.9% — failed | $0.00482 — failed | 15.0 s — failed | 0% — passed | 1 of 4 |
deepseek-v4.1-flash | 33.9% — failed | $0.00051 — passed | 18.2 s — failed | 0% — passed | 2 of 4 |
qwen3.8-flash | 34.1% — failed | $0.00049 — passed | 37.4 s — failed | 2% — passed | 2 of 4 |
qwen3-vl-235bbot’s model | 40.2% — failed | $0.00057 — passed | 35.9 s — failed | 0% — passed | 2 of 4 |
Table 1Final: 50 photos × 2 repeats. The p95 latency was measured under parallel requests — not the same measurement as in Fig. 6.Source: results/2026-10-20-final.md:22–42 · src/metrics.ts:195–210
3.2 On a typical photo the models are indistinguishable
Median error ranges from 25.0 to 31.3%. The median gaps are 0.1 to 5.8 pp, while the 95% intervals, 12.8–21.9 pp wide, cross zero for all seven pairs. Fifty photos are not enough to say which model is better on an ordinary plate.
By the mean the picture is different: gemini-3.6-flash is 9.6 pp more accurate than the bot’s model — 30.0% versus 39.6%, interval 1.0 to 20.4, zero not crossed. Two more Google models beat the bot’s model just as significantly: the confidence for all three is 98.8–99.7%.9
Is the difference between the models significant?
Dot — the gap in error, in percentage points; line — the 95% interval. If the line crosses zero, the difference cannot be told apart from a lucky selection of photos. Right of zero means the first model of the pair is more accurate.
- not significant: the interval crosses zero
- significant
qwen3-vl-235b shows 30.8%, not the 31.3% from the summary table.Source: results/2026-10-20-final.md:60–73Text version table, 8 comparisons
| Pair | Statistic | Gap | 95% interval | Significant |
|---|---|---|---|---|
gemini-3.6-flash · gemini-4-argon | median | 0.1 pp | −11.3…6.4 | no |
gemini-4-argon · gemini-3.8-flash | median | 0.6 pp | −7.9…4.9 | no |
gemini-3.8-flash · qwen3.8-flash | median | 0.1 pp | −6.1…12.8 | no |
qwen3.8-flash · deepseek-v4.1-flash | median | 1.1 pp | −11.0…8.9 | no |
deepseek-v4.1-flash · gemini-3.7-flash | median | 3.1 pp | −5.8…10.7 | no |
gemini-3.7-flash · qwen3-vl-235b | median | 0.9 pp | −8.3…10.5 | no |
gemini-3.6-flash · qwen3-vl-235b | median | 5.8 pp | −7.7…14.2 | no |
gemini-3.6-flash · qwen3-vl-235b | mean | 9.6 pp | 1.0…20.4 | yes |
3.3 The difference lies in gross misses
The median describes the typical photo, while rare large misses noticeably shift the mean. Since the models are equal by the median but not by the mean, the difference sits in the tail. The chosen model was off by more than 50% on 4 photos out of 50, the bot’s model on 14; the two other Google leaders on 14–16% of photos.10
Gross misses: 50 photos, one cell each
Filled cells are photos where the calorie estimate differed from the ground truth by more than 50%.
gemini-3.6-flashchosen
8%4 photos out of 50
with error above 50%
qwen3-vl-235bbot’s model
28%14 photos out of 50
with error above 50%
final.md:5) · commit eadeb72 · .gitignore:12–193.4 Price varies more than accuracy
Price ranges from $0.49 to $6.22 per thousand photos, a 12.7-fold spread. Three models sit on the Pareto frontier: qwen3.8-flash, gemini-3.8-flash and gemini-3.6-flash — no other model beats them on price and median error at once. But the points on the frontier are only 0.1–0.7 pp apart, and the test does not confirm a difference that small.11
Price versus accuracy
Median calorie error and price per thousand recognitions. The error axis starts at zero, which shows how close the models are.
gemini-3.6-flash— chosenqwen3-vl-235b— bot’s model at the time of the run- others
- on the Pareto frontier
results/2026-10-20-final.md:46–58 · src/analysis.ts:250–306 · src/cli.ts:473–480Text version table, 7 models
| Model | $ per 1000 photos | Median error | On frontier |
|---|---|---|---|
qwen3.8-flash | $0.49 | 25.7% | yes |
deepseek-v4.1-flash | $0.51 | 27.3% | no |
qwen3-vl-235b | $0.57 | 31.3% | no |
gemini-3.7-flash | $4.82 | 29.9% | no |
gemini-3.8-flash | $5.21 | 25.6% | yes |
gemini-3.6-flash | $5.89 | 25.0% | yes |
gemini-4-argon | $6.22 | 25.0% | no |
3.5 Asking for grams helps, but not enough
Calories scale almost linearly with mass, so a model’s answer can be rescaled to the correct portion weight; what remains is the composition error.12 The bot’s model has a weight error of 41.4%, the chosen one 22.1%. But even with the exact weight, none of them would fit within 20%: the composition error ranges from 21.0 to 30.0%.
Portion weight or composition
Light bar — portion weight error; dark bar — composition error, i.e. what would remain if the exact weight were substituted.
- weight error
- composition error
gemini-3.6-flash— chosenqwen3-vl-235b— bot’s model at the time of the run- others
results/2026-10-20-final.md:75–87 · src/analysis.ts:59–91Text version table, 7 models
| Model | Weight error | Composition error | Total error |
|---|---|---|---|
gemini-3.8-flash | 23.9% | 21.0% | 28.7% |
gemini-3.6-flash | 22.1% | 21.4% | 30.0% |
gemini-4-argon | 22.5% | 21.3% | 30.1% |
gemini-3.7-flash | 24.0% | 21.4% | 31.8% |
qwen3.8-flash | 27.8% | 23.7% | 32.8% |
deepseek-v4.1-flash | 24.9% | 25.2% | 33.0% |
qwen3-vl-235b | 41.4% | 30.0% | 39.6% |
A constant correction does not help either. Google models underestimate calories: the median multiplier is ×1.12–1.17. But multiplying by a constant only increases the mean error: for gemini-3.6-flash, from 30.0 to 31.4%.13
04 / Decision
gemini-3.6-flash — with a caveat
The decision is to replace qwen3-vl-235b with gemini-3.6-flash.14 The three Google models are indistinguishable from each other in accuracy and significantly more accurate than the bot’s model by the mean. Among them I chose by what can be measured reliably: response time and the share of gross misses.
By median response time the chosen model is the fastest — 5.7 seconds versus 6.3 and 9.2 for the two other leaders, and the slowest of its ten responses took 9.5 seconds. The bot’s model has almost the same median, 6.0 seconds, but its worst case is 38.3.15
Response time per single request
Dot — median; circle — the slowest of ten responses.
gemini-3.6-flash— chosenqwen3-vl-235b— bot’s model at the time of the run- others
- median → worst case
qwen3.8-flash, on five. This is not the p95 from the thresholds: that one was measured under parallel requests.Source: results/2026-10-20-final.md:12–18Text version table, 7 models
| Model | Median | Worst case | Photos timed |
|---|---|---|---|
gemini-3.6-flash | 5.7 s | 9.5 s | 10 |
qwen3-vl-235b | 6.0 s | 38.3 s | 10 |
gemini-4-argon | 6.3 s | 17.9 s | 10 |
gemini-3.8-flash | 9.2 s | 13.8 s | 10 |
qwen3.8-flash | 10.2 s | 15.5 s | 5 |
deepseek-v4.1-flash | 17.4 s | 56.5 s | 10 |
gemini-3.7-flash | — | — | not measured |
Price — $0.00589 per photo: above my own $0.004 threshold and 10.3 times the cost of the bot’s model — $5.89 versus $0.57 per thousand photos.16
Decision record · October 20, 2026
Model for photo recognition- Context
- No model passed all four thresholds. By the median the models are indistinguishable; by the mean three Google models are significantly more accurate than the bot’s model.
- Decision
gemini-3.6-flashinstead ofqwen3-vl-235b.- Why this one
- Of the three leaders, the fastest (median 5.7 s) and the least likely to be off by more than 50%: 8% of photos versus 14–16%.
- What it costs
- Recognition price ×10.3; above my own threshold of $0.004 per photo.
- Condition
- Before the model is switched in the bot — a check on my own photos. That is what the project documentation says.
Decision log nine entries: decision, rationale, outcome
- D1Thresholds — before the first run
In the README, the section “What counts as a win” is the first step; the thresholds were recorded on October 18, the first run happened on October 19.
Outcome: no model passed.
- D2Ground truth — Nutrition5k
Weight, calories and macros of every dish are already measured; CC BY 4.0 license.
Outcome: good for comparing models with each other, but it is not absolute truth and may have ended up in the models’ training data.
- D3Measure what the bot does
The prompt and response schema are taken from the bot’s code; otherwise the eval would not measure the product.
Outcome: temperature 0 and one photo size for all models.
- D4Two passes: broad and final
In the first pass six models got three runs each and four got one; calls already paid for went into the final without being paid for again.
Outcome: 13 models over two passes: $1.60 and $2.37.
results/2026-10-19-pass1.md:3·results/2026-10-20-final.md:3–4·README.md:90–92 - D5The composite score only ranks
The criteria weights were picked by hand, so the raw numbers are always shown alongside.
Outcome: the decision is based on percentage error and price.
- D6Test significance by the median and by the mean
A gap of a couple of points on 50 photos may turn out to be a lucky selection; the median does not see the tail of misses.
Outcome: by the median the pairs are indistinguishable; by the mean three Google models are significantly better than the bot’s model.
- D7Replace
qwen3-vl-235bwithgemini-3.6-flashOf the three indistinguishable leaders, the fastest and the least likely to be off by more than 50%.
Outcome: decision recorded; the price is above my own threshold.
- D8Before switching in the bot — my own photos
The ground truth was shot in a studio, from above, in even light, while people take photos with a phone.
Outcome: the pipeline is ready; there are no results in the repository.
- D9Without weights, measure agreement, not accuracy
My own photos come without weighing; the consensus for each model is computed without that model itself.
Outcome: the report states plainly that agreement is not accuracy.
Status in the bot. This page does not claim that the switch has been made. The code default is still qwen3-vl-235b, the production value is set on the hosting, and the project documentation requires a check on my own photos before switching.17
05 / What’s next
First, my own photos
The reference set was shot in a studio, from above, in even light, while people photograph their lunch with a phone. There is already a pipeline for the check: drop photos into a folder and push — GitHub Actions runs them through five models and posts the report as a commit comment.18
- photos in
eval/inbox/ - push
- GitHub Actions: 5 models
- report as a commit comment
Ten photos cost about twenty cents, and if a run comes to more than 120 calls, it does not start by default.19 If the photos are not weighed, the report shows not accuracy but how well the models agree with each other. These are different things: on dense food with hidden fat, the models underestimate in unison.
06 / Limitations
What not to trust here
An open dataset, studio photos, 50 photos and table-based ground truth — this is where the conclusions may not carry over to a real user.20
- The dataset may have been in training dataNutrition5k has been public since 2021: part of the accuracy may be memory rather than vision.
- These are not user photosStudio, shot from above, even light. Phone photos look different.
- Ground truth is not the plate’s chemistryCalories were computed from ingredient masses and reference tables. Part of a model’s “error” is the ground truth’s error.
- Fifty photos mean wide intervals“No difference detected” does not mean “no difference”.
- No held-out checkAll 50 photos took part in the selection; the winner was not run on held-out photos.
- Speed measured on ten photosOne request at a time; for
qwen3.8-flash, on five. The shares of gross misses are taken from the HTML report; there are no raw responses in the repository.
Sources
Where the numbers come from
All paths are in the FitHub repository at commit 9721995. The run results live in a separate branch that has not been merged into main yet.
2026-10-20-final.md7 models, 700 calls First pass
2026-10-19-pass1.md10 models, 1,100 calls Tools
apps/bot-api/evalcommands, config, ground truth
- Default model —
apps/bot-api/src/config.ts:23–27; the run’s baseline (baseline) —config.json:23.↩ - Thresholds —
config.json:33–38, first recorded in commit6b23a75(2026-10-18, 22:48 UTC); first run —results/2026-10-19-pass1.md:1.↩ dataset/SOURCE.md:3–16; labels — counted from thetagscolumn indataset/labels.csv.↩README.md:81–83·src/client.ts:6–12·config.json:25–32.↩results/2026-10-19-pass1.md:3·results/2026-10-20-final.md:3–4·README.md:90–92.↩results/2026-10-20-final.md:60–73·src/analysis.ts:308–416· commitdd05bb6, commit71a648f.↩results/2026-10-20-final.md:22–42; the threshold is compared against the mean error —src/metrics.ts:195–210.↩results/2026-10-19-pass1.md:17–43.↩results/2026-10-20-final.md:62–73·results/2026-10-20-final.md:7–10. “Confidence” is the share of resamples in which the better model stayed ahead.↩- Shares — from the run’s HTML report (link in
final.md:5); 8% and 14–16% — also in commiteadeb72. Raw responses are not versioned:.gitignore:12–19.↩ results/2026-10-20-final.md:46–58; frontier —src/analysis.ts:250–306, accuracy axis — median:src/cli.ts:473–480.↩src/analysis.ts:59–91·results/2026-10-20-final.md:75–87.↩results/2026-10-20-final.md:89–101·src/analysis.ts:99–125.↩results/2026-10-20-final.md:7–10· commiteadeb72.↩results/2026-10-20-final.md:12–18.↩results/2026-10-20-final.md:24–30·results/2026-10-20-final.md:50–56.↩apps/bot-api/src/config.ts:23–27·docs/TESTING.md:100.↩docs/TESTING.md:100–106·.github/workflows/eval-inbox.yml:1–9·config.json:15–22.↩inbox/README.md:40–45.↩dataset/SOURCE.md:22–32·README.md:145–146·results/2026-10-20-final.md:12–18.↩
Ground truth: Nutrition5k — Thames et al., Google Research, CVPR 2021, CC BY 4.0 license. No photos from the dataset appear on this page.
Questions about this write-up or about FitHub? Message me on Telegram.