/ Модель

Характеристики

Лицензия
Своя лицензия
Базовая модель
Qwen2-VL-2B-Instruct
Библиотека
llama.cpp
Опубликована
31 окт 2026

LedgerLens-Qwen2-VL-2B-Receipts-GGUF

Изображение и текст → текст5 профессий
88скачиваний за 30 дней0лайковвеса обновлены31 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Мультимодальная модель для локального извлечения продавца, сумм, налогов и товарных позиций из фотографий чеков и счетов.

LedgerLens — дообученная модель ii42 для извлечения структурированных данных из фотографий чеков и счетов. Она принимает изображение и текстовый запрос, а результат формирует в виде JSON с продавцом, датой, валютой, итоговой суммой, налогом и позициями товаров. Модель основана на Qwen/Qwen2-VL-2B-Instruct, дообучена методом LoRA на чеках CORD и SROIE с использованием разметки датасетов и согласованных с ней ответов модели-учителя Qwen2.5-VL-7B-Instruct.

Это GGUF-артефакт для запуска через llama.cpp, включая локальную работу на устройствах без подключения к сети. Доступны варианты Q4_K_M и F16; для обработки изображений вместе с языковой моделью требуется отдельный файл vision tower/projector в формате F16. Метаданные указывают английский язык. В README приведены результаты внутренних оценок и ручные замеры на нескольких Android-устройствах, но проект не заявляет о промышленном внедрении.

Скорость на телефонах ограничивается главным образом обработкой изображений; на некоторых GPU запуск не поддерживается, а перегрев может приводить к некорректным пустым полям. Точность зависит от распределения чеков: на документах с незнакомыми продавцами авторы отмечают снижение качества. Лицензия обозначена как other; README ограничивает использование исследовательскими и некоммерческими целями.

Сценарии применения

  • извлечение итоговой суммы и валюты из фотографии чека
  • распознавание продавца и даты покупки на чеке
  • извлечение строк товаров и цен из кассового чека
  • разбор счета или инвойса в структурированный JSON
  • локальная обработка чеков на Android без отправки изображений в облако

Ограничения

Vision tower в F16 занимает значительную часть ресурсов и времени обработки; поддержка GPU зависит от устройства, а перегрев может приводить к пустым полям. Качество может снижаться на чеках продавцов, не представленных в обучении; приведённые замеры выполнены на небольшом числе устройств.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит5

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

LedgerLens: Qwen2-VL-2B distilled for offline receipt extraction (GGUF)

Photo of a receipt or invoice in, one JSON object out: vendor, date, currency, total, tax, line items. Runs fully offline with llama.cpp, including on Android phones.

This is the deployment artifact of LedgerLens, a model-compression portfolio project. Qwen2-VL-2B-Instruct was LoRA fine-tuned on CORD and SROIE receipts with targets blended from a Qwen2.5-VL-7B teacher and the datasets' gold labels, then exported to GGUF.

Research and noncommercial use only. See License below.

Files

FileSizeWhat
sft2b-teacher-agree-q4_k_m.gguf0.99 GBLanguage model, Q4_K_M
mmproj-sft2b-teacher-agree-f16.gguf1.33 GBVision tower / projector, f16

Both files are required. The vision tower is not quantized; llama.cpp's vision-encoder quantization support is immature, and this is where almost all of the on-device latency goes (see On-device).

Run it

With a recent llama.cpp build:

llama-mtmd-cli \
  -m sft2b-teacher-agree-q4_k_m.gguf \
  --mmproj mmproj-sft2b-teacher-agree-f16.gguf \
  --image receipt.jpg --temp 0 \
  -p 'Extract the following fields from this receipt or invoice image and answer with a single JSON object, nothing else:
{"vendor": string|null, "date": "YYYY-MM-DD"|null, "currency": ISO-4217 string|null, "total": number|null, "tax": number|null, "line_items": [{"description": string, "qty": number, "unit_price": number, "total": number}]}
Use null for fields not present. Do not invent values.'

Or serve it:

llama-server -m sft2b-teacher-agree-q4_k_m.gguf --mmproj mmproj-sft2b-teacher-agree-f16.gguf

The prompt above is the exact string the model was trained and evaluated with (PROMPT in the repo's schema.py). Use it verbatim; the model expects it inside the standard Qwen ChatML template, which llama.cpp applies automatically.

Expected output for a valid receipt is a single JSON object, for example:

{"vendor": "OJC MARKETING SDN BHD", "date": "2019-01-15", "currency": "SGD", "total": 193.0, "tax": null,
 "line_items": [{"description": "KINGS SAFETY SHOES KWD 805", "qty": 1, "unit_price": 193.0, "total": 193.0}]}

Results

Every number comes from the project's eval harness and is recorded in results/results.csv. Scoring only counts the fields each dataset annotates (SROIE has no line items or tax; CORD has no vendor, date or currency). "EM" is exact match after normalization.

VariantSplit (n)JSON validTotal EMField EM (mean)Line-item F1
Stock Qwen2-VL-2B, Q4_K_M (zero-shot)SROIE (347)96.0%90.2%77.3%—
Teacher Qwen2.5-VL-7B, 4-bit (zero-shot)CORD (100)97.0%85.0%86.0%87.7%
Teacher Qwen2.5-VL-7B, 4-bit (zero-shot)SROIE (347)96.5%94.2%90.1%—
Distilled 2B, fp16CORD (100)100%92.0%93.5%94.7%
Distilled 2B, fp16SROIE (347)100%96.8%94.3%—
This file: Distilled 2B, GGUF Q4_K_MCORD (100)100%91.0%92.0%93.8%
This file: Distilled 2B, GGUF Q4_K_MSROIE (347)100%96.5%95.2%—

Read the teacher comparison correctly: the teacher is zero-shot and 4-bit, the student is fine-tuned on in-distribution data with gold-quality supervision on every annotated field. This is task specialization beating general zero-shot inference, not a 2B model out-reasoning a 7B one.

Memorization check. SROIE train and test share 72.6% of vendor strings. On the 95 test receipts whose vendor never appears in training, this GGUF scores 91.6% total EM and 75.8% vendor EM, versus 96.5% and higher on the full split. A real but modest drop, and still well above the stock model on the same subset.

On-device (Android)

Measured with the project's React Native app (llama.rn), same two files, one real SROIE test receipt, exact-match output in every run listed:

PhoneSoC / GPUPathTime per receipt
Nothing Phone (3)Snapdragon 8s Gen 4 / Adreno 825OpenCL GPU~19 s (cold: 31 s)
Nothing Phone (3)sameCPU only~2 min
HONOR REA-NX9Snapdragon 7 Gen 1 / Adreno 644CPU only5 min 20 s
HONOR (Dimensity-class)778G+, no OpenCLCPU only11.3 min

Over 99% of CPU-only time is the fp16 vision-tower prefill, not text generation. The GPU path is chip-gated: it crashed on load on Adreno 6xx-class GPUs, so the app only enables it on verified 8-series hardware. Also observed and documented in the repo: severe thermal throttling degraded output to null fields rather than just slowing down; the same phone produced exact matches again once cool.

These are manual measurements on three devices, not a benchmark suite. The project has no production deployment and no users.

Training

  • Student: Qwen/Qwen2-VL-2B-Instruct, LoRA SFT, checkpoint chosen by held-out eval loss.
  • Teacher: Qwen2.5-VL-7B-Instruct (4-bit), zero-shot labels on the CORD and SROIE train splits.
  • Targets: field-level blend. Where the dataset annotates a field, the teacher's value is used only if it agrees with gold; unannotated fields take the teacher's read.
  • Compute: Kaggle free-tier T4s, chunked across sessions.
  • Export: convert_hf_to_gguf.py from llama.cpp, then llama-quantize to Q4_K_M.

Full code, data converters, harness and scripts: https://github.com/iivek/LedgerLens

Training data and attribution

See DATA_LICENSES.md.

License

These weights are released under the PolyForm Noncommercial License 1.0.0. Full terms and the required notice: MODEL_LICENSE.md.

Independently of that choice, SROIE's unconfirmed dataset license means any checkpoint trained on it, including this one, is research-use-only until the organizers confirm otherwise.

Required Notice: Copyright iivek (LedgerLens) — model weights trained on CORD (CC BY 4.0, NAVER CLOVA) and SROIE (ICDAR 2019 RRC Task 3, license unconfirmed, research-use-only)

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · llama.cpp

Нельзя запустить

GGUF-веса поддерживаются только для текстовых LLM (llama.cpp).

Ревизия весов
11ff360

0 моделей