TitanOCR handwriting reader — Qwen3.5-0.8B (run A2, GGUF)
A LoRA fine-tune of Qwen/Qwen3.5-0.8B that reads one cropped line or word of handwriting — doctor-style prescription scrawl — and writes it verbatim.
It was built for TitanOCR, where it runs on CPU as a second reader behind PP-OCR:
- every reading is force-aligned against the CTC recogniser's per-frame posteriors for the same crop, which gives pixel support and word boxes;
- the losing reading is kept;
- until a calibration fitted on human truth exists, every line whose text this model delivers is flagged for review.
Not for clinical decisions. This is a research and demo model. It makes no accuracy claim, and its readings need human review.
Files
| File | What | Bytes | sha256 |
|---|---|---|---|
titanocr-hw-qwen35-08b-a2-Q8_0.gguf | language model | 833,592,000 | 703a043c56a8b48784d88887cea0307fffe763639b614c12985b2e16eb30659a |
titanocr-hw-qwen35-08b-a2-mmproj-F16.gguf | vision projector | 204,986,560 | 5d2f94b8b31d423acc95c9443a16caab3616b45bb6f71f07dbea54684c7cf5c6 |
How it is run
The runtime is llama.cpp 30f7df1a831b (tag b11586):
llama-server --model titanocr-hw-qwen35-08b-a2-Q8_0.gguf \
--mmproj titanocr-hw-qwen35-08b-a2-mmproj-F16.gguf \
--threads 2 --threads-batch 2 --parallel 1 --seed 0 \
--reasoning off --cache-ram 0 --no-repack --jinja \\
--image-min-tokens 8 --image-max-tokens 256
Resize every crop first, exactly as in training: 128 px high (aspect kept, bicubic), both sides rounded to multiples of 32, at most 1 024 px wide — a wider line is shrunk to fit with its height still a multiple of 32 (titanocr.engines.handwriting.normalise_crop). With the token limits above, llama.cpp then never resizes it again, and a word costs ~24 image tokens.
Each request sends the image first, then the prompt htr-crop@v3 (included), with:
- greedy decoding (
temperature 0,top_k 1); max_tokens 48;- the grammar
latin-line.gbnf(included), which allows only Latin letters, digits, dose punctuation and⟨?⟩for an unreadable word.
Training (run A2)
- Data. RxHandBD's Train_Set (CC BY 4.0), cut to the ink plus a 10 % margin:
3,675 train and 193 val crops. Excluded:
- the 300-crop
rxhandbd-devsplit, used for model selection; - 295 expanded-form labels (a crop showing
Tab.labelledTablet); - anything byte-identical to the Test_Set.
- the 300-crop
- Recipe. Unsloth 2026.9.12, transformers 5.5.0, trl 0.24.0, peft 0.20.0. LoRA
r=32, alpha=32 on the vision and language layers; 3 epochs, lr 2e-4, fp16 on a Tesla T4
(Kaggle); seed 38. Training took 1665 s, and loss fell from 2.90 to
0.015. The full record is in
run.json. - Export. The adapter was merged, then converted with llama.cpp's
convert_hf_to_gguf.pyat30f7df1a831b: language model Q8_0, vision projector F16.
Development evidence — not an accuracy claim
These are 60 crops of rxhandbd-dev, never trained on, read on CPU (Apple M5, 4 threads) with
greedy decoding and the grammar.
| Reader | letters-only exact | CER | wrong among the best-ranked 50 % (token prob x pixel support) |
|---|---|---|---|
| PP-OCRv5 (TitanOCR's shipped recogniser) | 11.7 % | 0.51 | — |
| Qwen3-VL-2B + run A1 (the previous reader) | 73.3 % | 0.17 | 10.0 % |
| this model | 76.7 % | 0.14 | 6.7 % |
On the in-run val split (193 crops, measured on the GPU), letters-only exact went from 25.4% to 67.4%.
Treat these numbers with care:
- the intervals are wide (n = 60);
- it is one population of Bangladeshi prescription words;
- the golden Test_Set has not been read.
Limitations
- Narrow training data. It was trained on Bangladeshi prescription words in Latin script. Other hands, languages and scripts are untested.
- It can "correct". A fluent model can turn a misspelt word into a plausible drug name. TitanOCR checks every reading against the pixels for exactly this reason; on its own, this model has no such check.
- Uncalibrated. Its token probabilities are not P(correct).
- Speed on CPU. About 0.5 s per word crop on 2 CPU threads (Q8_0, Apple M5); a long line takes 1-1.5 s.
Licence and attribution
- Weights: Apache-2.0, as is the base model Qwen/Qwen3.5-0.8B.
- Training data: RxHandBD — Md Masudul Islam, RxHandBD: A Handwritten Prescription Word Image Dataset, Mendeley Data V3, doi:10.17632/dsb5r6vskg.3, licensed CC BY 4.0.