Manuscript Offprint

arXiv:2610.11818

From Pixels to Structure: Lightweight Vision-Language Models for Document OCR and Structured JSON Extraction

Uddipan Basu Bir, Vincent Christlein, Andreas Maier, Mathias Zinnen

Uddipan Basu Bir 1^{1}, Vincent Christlein 1^{1}, Andreas Maier 1^{1}, and Mathias Zinnen 1^{1}

Friedrich-Alexander-Universität Erlangen–Nürnberg, Germany

{uddipan.bir.basu,vincent.christlein,andreas.maier,mathias.zinnen}@fau.de

Abstract. While massive, closed-source Vision-Language Models (VLMs) set strong benchmarks for document understanding, their dependence on commercial Application Programming Interfaces (APIs) limits adoption in institutional archives due to data autonomy concerns, recurring costs, and the environmental footprint of hyperscale computing. This is especially acute in heritage digitization, where documents include historical handwriting, domain-specific terminology (e.g., jewelry, prehistory, architecture), and non-standard layouts requiring high-dimensional structured extraction. We present a comparative study of eight open-source lightweight VLMs ( ≤\leq 7B parameters) for Optical Character Recognition (OCR)-to-structure across three university heritage collections. Given a document image, models must extract text and generate schema-compliant JavaScript Object Notation (JSON), enabling automatic validation and downstream use. We evaluate models under a constraint-aware protocol across zero-shot, few-shot, and fine-tuning settings, measuring extraction fidelity and structured-output quality using Character Error Rate (CER), Approximate Normalized Levenshtein Similarity (ANLS)*, and mean Average Precision F1 (mAP-F1). To assess practical improvements, we run controlled additional studies on a baseline fine-tuning pipeline, testing the independent impact of (i) hyperparameter optimization, (ii) classical image preprocessing (illumination flattening, denoising, and Contrast Limited Adaptive Histogram Equalization (CLAHE)), and (iii) multi-stage training, each compared directly to the finetune baseline. Finally, we analyze the trade-off between dataset-specific fine-tuning and a single multi-dataset checkpoint, where joint training enables one model to operate across collections but can shift performance between datasets. Overall, we show that carefully adapted ≤\leq 7B VLMs can provide a sustainable, private, high-performing alternative to manual transcription or commercial black-box systems, and we offer actionable guidance for heritage institutions seeking institution-controlled OCR-to-JSON extraction. Code for this paper is available at our project repository. 1^{1}

Keywords: Document OCR · VLMs · structured extraction · JSON generation · lightweight models · fine-tuning

1^{1} https://github.com/uddipan77/Analysis-of-Lightweight-Vision-Language-Models-for-Document-OCR-and-Structured-Output-Generation

U. Basu Bir et al.

Figure

Fig. 1. Document example for the Erlangen-Prehistoric dataset (left) and its target JSON structure (right). Image from the “Inventarbuch der Anthropologisch Prähistorischen Sammlung,” courtesy of the Sammlung für Ur- und Frühgeschichte, FAU Erlangen-Nürnberg. Reproduced with permission.

1 Introduction

OCR is no longer only about reading plain text. In many real applications, the goal is to extract information from documents and return it in a structured form that can be searched, validated, or directly used by downstream systems. While standard benchmarks often focus on commercial forms like invoices or ID cards, practitioners in archives, collections, and museums face the distinct challenge of digitizing specialized historical records. In this work, we focus on OCR-to-structure: given a document image, the model should output the extracted content as a structured JSON object (see fig. 1 for a representative example from an archival inventory).

Recently, VLMs have shown strong capabilities on document understanding tasks. However, many state-of-the-art models are large, closed-source, and accessible only through commercial cloud APIs. For public archives and collections, this reliance on external providers presents significant barriers regarding data autonomy, i.e., the ability of an institution to maintain sovereignty over its own digital assets. Furthermore, the massive energy consumption of hyperscale models raises concerns about the environmental sustainability of large-scale digitization projects. In practical settings such as on-device systems, cost-sensitive cloud services, or scenarios with limited Graphics Processing Unit (GPU) resources, smaller models are often preferred. This motivates our study of lightweight VLMs: models with up to 7 billion parameters that can be deployed locally on institutional hardware. While these models are attractive for deployment, it is still unclear how reliable they are at producing correct and well-structured OCR outputs, especially when the output must follow a highly specialized archival schema.

In this paper, we present a comparative study of eight lightweight VLMs for structured OCR, evaluated on records from three specialized university collections: the Erlangen-Prehistoric dataset (prehistoric artifacts at FAU Erlangen-

Nürnberg), the Pforzheim Jewelry dataset (jewelry records at HS Pforzheim), and the Regensburg Scalalogy dataset (architectural staircase forms at OTH Regensburg). We evaluate all models in zero-shot, few-shot, and fine-tuning settings. Importantly, we follow a fair protocol that respects each model's interface: some models only accept a fixed OCR-style instruction (e.g., a single keyword prompt such as "OCR"), while others allow custom prompts that explicitly request structured JSON extraction. Based on the overall results across zero-shot, few-shot, and fine-tuning evaluations, we select the top three models and investigate further improvements via additional studies. Finally, we analyze single-dataset versus multi-dataset fine-tuning to understand cross-collection transfer and deployment trade-offs.

We investigate practical questions that matter for institutional deployments. First, we study whether multi-stage training provides consistent gains over standard single-stage fine-tuning for OCR-to-JSON extraction. Second, we test whether hyperparameter optimization improves structured OCR performance. Third, we analyze whether classical image preprocessing can help models produce cleaner and more accurate JSON.

Overall, our goal is to provide clear guidance for practitioners from Galleries, Libraries, Archives, and Museums (GLAM) who want to use small VLMs for document OCR and structured extraction. We benchmark the models, identify strong lightweight choices, and study practical adaptation strategies that improve reliability without requiring external commercial APIs or excessive resources.

The main contributions of this paper are:

– We benchmark eight lightweight VLMs ( ≤\leq7B) on three specialized archival collections, evaluating structured OCR-to-JSON as a private, sustainable alternative to commercial APIs.

– We propose a constraint-aware evaluation protocol that accounts for diverse model interfaces (fixed vs. custom prompting) in zero-shot settings.

– We evaluate the impact of fine-tuning, multi-stage fine-tuning, hyperparameter optimization, and classical image preprocessing on the top-performing models to quantify their effect on extraction accuracy and schema adherence.

References (33)