Single-Image Food Mass Estimators Do Not Transfer Their Gram Scale Across Datasets
Organizations: University of Louisville, Louisville, KY, USA
Abstract
Estimating food mass from a photograph is central to image-based dietary assessment, but whether trained models transfer to new cameras and foods is unclear. We fine-tuned DINOv2-base on 2,253 weighed Nutrition5k dishes to predict mass from one RGB photograph and compared it with a zero-shot vision-language model, Qwen3-VL-32B, on Nutrition5k and three external datasets: ASA24 studio portions, ECUSTFD whole foods and Food Portion Benchmark meal trays. In domain, the fine-tuned model's mean absolute error was 24.8 g, less than half of Qwen's. On external datasets it did not beat Qwen. For a food it had never seen, it ranked portions by size, but no better than a count of food pixels. Its gram scale was wrong in two ways: it changed with how much of the scene the photograph showed, and it was off by a different factor for each food. Training on other foods or trays from the tested dataset cut the external error by 38 to 65%. DINOv2-large, a larger backbone trained on the same dishes, did not reduce the external error. One labeled photograph of the same food cut the model's ASA24 error to 28.3 g, better than that photograph achieved alone. Prediction intervals that held the true mass for 90% of Nutrition5k dishes held it for at most half of external photographs. Nutrition5k often photographed the same plate several times, so a random test split shared near-identical photographs with training and overstated accuracy. Single-image mass estimators therefore need labeled photographs from the setting where they are used.
Figures & tables
| Dataset (part) | Images | Content | Mass label | Role |
|---|---|---|---|---|
| Nutrition5k training set | 2,253 | Overhead cafeteria plates | Weighed | Training (5-fold CV) |
| Nutrition5k validation | 502 | Same | Weighed | Method selection |
| Nutrition5k internal test | 498 | Same | Weighed | Supporting only; near-duplicates of training (Sec. IV-D ) |
| ASA24 training set | 5,099 (6,329) | NCI studio portion photographs | FNDDS standard weights | Training; CV grouped by food |
| ASA24 test | 1,000 | Same; 162 foods, none in the training set | FNDDS standard weights | External test; once per pre-declared model |
| ECUSTFD | 1,429 | Top views of 146 whole foods (19 types), coin for scale | Weighed per object | External test; never trained on |
| Method | N5k | ASA24 | ECUSTFD | FPB |
|---|---|---|---|---|
| Qwen3-VL-32B | 60.3 | 72.9 | 40.5 | 248.5 |
| gpt-6-luna | 56.5 | 81.6 | 37.3 | 225.6 |
| Fine-tuned DINOv2-base | 24.8 | 67.9 | 44.7 | 467.5 |
| Constant prediction | 116.4 | 121.2 | 69.2 | 373.3 |
| Food | Scale ratio |
|---|---|
| Yogurt, fruit, 4-ounce container | 0.21 |
| White rice | 0.36 |
| Cream of tomato soup | 0.37 |
| Median of 162 foods | 0.88 |
| Pita bread | 2.67 |
| Saltine crackers | 3.80 |
| Test set | Method | Spearman | Scale ratio | MAE (g) | Rescaled MAE (g) |
|---|---|---|---|---|---|
| Nutrition5k (internal) | Qwen3-VL-32B, single prompt | 0.88 | 1.10 | 54.3 | 54.0 |
| DINOv2-base, Nutrition5k only | 0.98 | 1.00 | 19.7 | 19.7 | |
| DINOv2-large, Nutrition5k+ASA24 | 0.98 | 1.02 | 17.5 | 17.7 | |
| ASA24 | Qwen3-VL-32B, single prompt | 0.76 | 0.72 | 72.9 | 69.3 |
| DINOv2-base, Nutrition5k only | 0.79 | 0.96 | 67.9 | 68.4 | |
| DINOv2-large, Nutrition5k+ASA24 | 0.90 | 1.02 | 42.0 | 42.2 |
| Training data | Backbone | N5k | ASA24 | ECUSTFD | FPB |
|---|---|---|---|---|---|
| N5k | Base | 24.8 | 67.9 | 44.7 | 467.5 |
| N5k + ASA24 | Large | 23.3 | 42.0 T | 36.0 | 463.6 |
| N5k + ASA24 + FPB | Base | 24.6 | –* | – | 161.7 T |
| Validation | Test | |||
|---|---|---|---|---|
| Uncal. | Cal. | Uncal. | Cal. | |
| 1 | 37.7 | 28.7 | 42.6 | 28.3 |
| 2 | 37.7 | 25.4 | 42.6 | 27.3 |
| 3 | 37.7 | 25.2 | 43.0 | 26.7 |
| DINOv2-base, Nutrition5k | DINOv2-large, Nutrition5k+ASA24 | |||
|---|---|---|---|---|
| Test set | Coverage (95% CI) | Width (g) | Coverage (95% CI) | Width (g) |
| Nutrition5k validation | 89.8 (87.1–92.4) | 101 | – | – |
| Nutrition5k test | 91.2 (88.6–93.6) | 95 | 99.2 (98.4–99.8) | 258 |
| ASA24 | 32.1 (26.3–37.9) | 58 | 88.7 (84.8–92.4) | 156 |
| ECUSTFD | 49.3 (42.2–57.0) | 71 | 91.3 (86.2–95.6) | 199 |
| FPB | 0.9 (0.4–1.5) | 28 | 7.0 (5.6–8.5) | 69 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Value |
|---|---|
| Starting weights | DINOv2-base (86 M parameters) or DINOv2-large (300 M), as released by Meta AI |
| Input | RGB photograph, pixels, ImageNet normalization |
| Augmentation (training only) | Horizontal and vertical flips ( each); brightness and ; no cropping |
| Image features | [CLS] token concatenated with mean patch token |
| Prediction layers | 512-unit GELU layer, dropout 0.2; linear outputs for log weight (and nutrients); linear depth output from the image features |
| Main loss | Smooth- on log weight, |
| Validation | ASA24 | ECUSTFD | FPB | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | MAE | (95% CI) | MAE | (95% CI) | Scale | MAE | (95% CI) | Scale | MAE | Scale | |
| DINOv2, fine-tuned, depth (final) | 24.8 | — | 67.9 | — | 0.86 | 0.96 | 44.7 | — | 1.02 | 468 | 0.14 |
| DINOv2, fine-tuned, no depth | 25.7 | (0.2, 1.6) | 70.4 | (0.0, 5.2) | 0.86 | 1.00 | 44.4 | ( , 1.1) | 0.99 | 468 | 0.14 |
| DINOv2, frozen, depth | 35.2 | (7.6, 13.2) | 115.7 | (36.7, 58.5) | 0.82 | 0.28 | 88.2 | (32.7, 54.1) | 0.38 | 501 | 0.07 |
| DINOv2, frozen, no depth | 35.5 | (7.9, 13.6) | 116.4 | (37.3, 59.2) | 0.79 | 0.28 | 86.1 | (30.8, 51.8) | 0.41 | 501 | 0.07 |
| ResNet-50, depth, LR | 35.2 | (8.0, 13.1) | 78.3 | (3.4, 17.1) | 0.80 | 0.82 | 60.0 | (10.6, 20.0) | 1.14 | 471 | 0.14 |
| FT, depth | FT, no depth | Frozen, depth | |
| Nutrition5k validation (502 dishes) | |||
| MAE (g) | 24.8 (24.6–24.9) | 25.6 (25.3–25.8) | 35.0 (34.3–35.4) |
| ASA24 training photographs (5,099) | |||
| MAE (g) | 56.3 (55.8–56.8) | 57.1 (56.7–57.9) | 99.9 (98.5–100.5) |
| Scale | 0.99 (0.94–1.04) | 1.03 (0.96–1.11) | 0.30 (0.30–0.32) |
| 0.80 (0.80–0.81) | 0.80 (0.79–0.80) | 0.79 (0.79–0.80) | |
| Method | MAE (g) | Median AE (g) | RMSE (g) | Bias (g) | Within 50 g | MAE vs single-prompt Qwen (95% CI), g |
|---|---|---|---|---|---|---|
| Qwen3-VL-32B, single prompt | 60.35 | 41.00 | 94.34 | 60.4% | – | |
| Qwen3-VL-32B, single prompt + kNN residual correction | 47.69 | 28.66 | 73.57 | 66.5% | ( , ) | |
| Fine-tuned DINOv2-base, Nutrition5k only | 24.78 | 16.02 | 39.35 | 88.6% | ( , ) | |
| Fine-tuned DINOv2-large, Nutrition5k+ASA24 | 23.29 | 14.08 | 38.49 | 90.2% | ( , ) |
| Available from the setting of use | Most accurate | Evidence |
|---|---|---|
| Nothing | A zero-shot VLM, or no clear difference | ASA24: Qwen 72.9, fine-tuned 67.9 (difference not significant). ECUSTFD: 40.5 and 44.7 (not significant). FPB: 248.5 and 467.5. Second VLM (gpt-6-luna): 81.6, 37.3 and 225.6 |
| Labeled photographs of other foods or trays | Fine-tuned with those photographs | ASA24: 42.0 against 72.9 for Qwen. FPB: 161.7 against 248.5 |
| The food’s identity and one labeled photograph of it | Fine-tuned with per-food correction | ASA24: 28.3, against 42.6 uncorrected and 48.0 from the labeled photograph and food area alone |
| Training data from the same camera and menu | Fine-tuned | Nutrition5k validation: 24.8 against 60.4 for Qwen |
| Study and method | Dishes | MAE (g) | Inputs | Coverage |
| DietAI24 [ 5 ] | 1,000 | 45.1 | Image; FNDDS retrieval | 84.2% successful; failure handling unspecified |
| Open-KNEAD, Gemma-MoE [ 6 ] | Not stated | 66.7 | Image | Full test split |
| Liao and Li [ 16 ] , sum of per-food estimates | 502 | 36.6 | Image; LLM food detections | Official test split; trained per dataset |
| Nutrition5k RGB baseline [ 1 ] | 507 | 40.4 | Image (supervised) | Official test split |
| ViT pretrained on ImageNet-21k [ 9 ] | 10% of plates | 60.6 | Side-video frames (supervised) | Own 90/10 split by plate |
| Swin-Nutrition [ 8 ] , as re-implemented in [ 4 ] | 507 | 27.5 | Image (supervised) | Official test split; original trained on side-angle frames and reported no grams |
Cross-Dataset Generalization
Cross-dataset generalization studies whether AI models retain accuracy, calibration, and usefulness on data from sources beyond their training set.
See all 142 papers