All projects

Models & fine-tuning · 2026

Receipt & Invoice Extractor

A 2B vision-language model that reads receipts and invoices into JSON.

  1. 1Photo of a receipt or invoice
  2. 2Qwen3.5-2B with a LoRA adapter
  3. 3Fields as JSON
0.886
field F1 on 126 test documents, against 0.000 zero-shot
100%
valid JSON on the test split

Fine-tuning a small vision-language model to turn a photo of a receipt or an invoice into structured fields. One model learns both formats, Indonesian receipts from CORD and invoices from a public Donut dataset, and the instruction says which one it is looking at. The LoRA adapter is on Hugging Face.

How it works

  • Learns only the answer. The loss covers the JSON answer alone, never the prompt or the image tokens.
  • Survives a dropped VM. Checkpoints are pushed to the Hub every epoch, so a lost Colab session costs at most one epoch.
  • Scored field by field. JSON validity, precision, recall and F1 over every path and value, exact match per document, and a lenient score that forgives whitespace in the labels.

What the numbers say

Without fine-tuning the base model reads a fair share of the values (0.462 value F1) but invents its own key names, so its field F1 is zero. After LoRA, field F1 is 0.869 on receipts and 0.910 on invoices. The misses that remain are mostly item names, unit prices and IBANs with one character dropped or swapped.