nutrition-label-llm
A fine-tuned language model that turns messy OCR text from EU food labels into clean nutrition JSON.
- Type:
- Personal project
- Status:
- Finished
- Year:
- 2026
Image placeholder
The problem
OCR of food labels gives noisy text in many EU languages, with different units, decimal separators and sodium or salt naming. I built the model for the label-scan feature of Macro Micro version 1.
What I built
- A synthetic training set of 50,000 examples, split into 40,000 for training, 5,000 for validation and 5,000 for testing.
- Training scripts that fine-tune Qwen2.5-14B-Instruct with 4-bit QLoRA on a single RTX 5090.
- Handling of comma and point decimals, unit variations, label language differences and the sodium to salt conversion (sodium = salt / 2.5).
Stack
- Python
- Qwen2.5-14B-Instruct
- Unsloth
- TRL
- QLoRA
Results
- A 50,000-example synthetic dataset and a complete training pipeline, published in the repository.