A-LIST food-text reader (EmbeddingGemma 2)
Reads a typed food-diary entry ("2 eggs, toast with butter, half an avocado") into 24 nutrition numbers on device, in one forward pass: calories, protein, carbohydrates, fat, fiber, sugar, saturated fat, water (ml), glycemic index, then 15 micronutrients (vitamins A, C, D, E, K, B6, B12, folate, calcium, iron, magnesium, zinc, potassium, selenium, omega-3), in that order and in real units.
Fine-tuned from google/embeddinggemma-2 (text tower only, Apache 2.0) with a regression head, on de-identified food entries labeled by a teacher model. The vocabulary is pruned to the 13,266 pieces seen in training (145M parameters).
Files (v1/)
| File | Runtime | Input | Size |
|---|---|---|---|
FoodTextEmbedder.mlpackage |
Core ML (iOS 17+), int8 weights; run on the Neural Engine | input_ids int32 [1,128], right-padded with 0 |
146 MB |
food_text_embedder_int8pc.onnx |
ONNX Runtime, int8 per-channel weights | input_ids int64 [1,L], unpadded |
169 MB |
food_tokenizer.json |
Gemma BPE pieces, ids and merges for the pruned vocabulary | โ | 1.5 MB |
Output nutrition float [1,24].
Tokenization: clip to 2,000 code points; text = "task: classification | query: " + entry;
U+0020 โ โ; BPE over code points by merge rank (compare pieces by bytes); unknown code points fall
back to <0xXX> byte pieces; ids = bos + pieces + eos, truncated to 128 keeping eos.
Precision: EmbeddingGemma 2 activations overflow fp16 on Core ML's CPU path โ run the Core ML model on the Neural Engine (or use the ONNX model, which computes in fp32).
Accuracy
Agreement with the teacher within ยฑ25% (or a small absolute slack), 1,500 held-out-user entries:
| Calories | Carbs | Protein | Micros (mean) | |
|---|---|---|---|---|
| Core ML, iPhone 16 Neural Engine (6.4 ms) | 0.795 | 0.776 | 0.844 | 0.870 |
| ONNX, Galaxy Z Fold 7 CPU (23 ms) | 0.785 | 0.775 | 0.847 | 0.870 |
Numbers the user typed ("650 cal", "30g protein") should override the model's estimate for that field.
- Downloads last month
- 264
Model tree for NateRunsA-LIST/alist-food-text-embedder
Base model
google/embeddinggemma-2