Skip to main navigation Skip to search Skip to main content

Optimisation d’un modèle DocVQA sans OCR: Encodage hiérarchique et structurel à faible coût de documents dans un espace multimodal commun

Translated title of the thesis: Optimization of an OCR-Free DocVQA model : Hierarchical and structural encoding at low cost of documents in a common multimodal space
  • Rayane Bencharef

Student thesis: Master's thesisMaster in Engineering: Automated Manufacturing Engineering

Abstract

The number of digital documents has seen a high increase during the last decade in several sectors such as industry, medicine, academia and others. A lot of those documents come from digitalization (document images), allowing to build shared databases inside enterprises, institutions or even across the internet. These high-scale databases may directly contain numerical documents or be tabular, having extracted information from documents. However, the manual extraction of this information can be time-consuming in a context where the number of digital documents continues to grow. Thus, automating the extraction of these information at a high scale becomes a vital need, as in industrial sectors where time is a precious resource. However, such automation requires fast, accurate and low-cost systems in order to be efficient and effective in high-scale document databases. The advent of large language models (LLM) has shown good performance for information extraction on question-answering tasks (QA) with text data. However, document images are varied data, containing several entity types (picture, table, handwriting, text, etc.), and may have different structures (letter, article, etc.). Thus, these images are different from the data that LLM usually take as input, and therefore are not directly usable by them. Consequently, the task of visual question-answering on document images (DocVQA) needs to represent the document images in order to allow the LLM to answer the questions. In this context, methods based on optical character recognition tools (OCR) require additional training while adding complexity into the system (detection, recognition), and may lead to recognition errors. On the other hand, end-to-end methods (OCR-free), composed of a visual encoder and a language model decoder, have a unified architecture, allowing both to represent the document and answer the question. This type of methods can be divided into two groups. Firstly the lightweight methods, efficient with a small computational cost, but limited in performance. Then, there are the large visual language models (LVLM), which are accurate in performance but have a high computational cost that can lead to difficulties for industrial deployments. Thus, this thesis presents an OCR-free DocVQA system that learns a multimodal representation space (image-text), composed of a small hierarchical visual encoder, a multimodal projector, and a LLM. The visual encoder transforms the document image into visual tokens, projected to the language model’s representation space (embedding), through the multimodal projector. This encoder also integrates an explicit positional encoding of the document structure, preserving the reading order and element structures (table, graphics, text, etc.) in the multimodal space. The language model decoder directly uses these representations with the question to generate the answer without additional tools such as OCR. This system has been built by distilling the foundational visual encoder of an LVLM into a smaller hierarchical architecture, while keeping the LLM decoder, in order to reduce computational cost while conserving close results with the initial model. To ensure the image-text alignment of the representation, the distilled encoder has been end-to-end supervised with the LLM decoder. Then, a spatial encoding module decomposes the position of each token on the document into Fourier features has been added in order to enrich the visual tokens by their original position. These approaches have been evaluated on the DocVQA dataset, which contains industrial document images of different types (forms, letters, articles, etc.). By using the LVLM Paligemma that has a performance of 84.77% ANLS, the distillation into a smaller hierarchical architecture has reduced the visual encoder size by a factor of five, halving its latency (896ms→446ms) while leading to a gap of 2.1 points of ANLS with a performance of 82.67% ANLS. Moreover, the addition of the positional encoding has improved the extraction quality of information, reducing the gap to 1.31 points with a performance of 83.46% ANLS. Thus, the proposed system outperforms the results of lightweight OCR-free methods such as Donut, which has a performance of 66.26% ANLS, and stays competitive with LVLM as Paligemma and with OCR-based models such as UDOP (84.70% ANLS). Additional analysis on classification (RVL-CDIP) and layout analysis (DocLayNet) show that the encoder captures the global structure, where the LLM handles deeper layout reasoning at a semantic level. Finally, the model has been adapted to multi-page documents with a page selector, sharing the LLM’s first layers. This approach limits the computational cost by keeping the model to 2.6B parameters while reaching 71.73% ANLS, competing with other state-of-the-art models such as ScreenAI (72.9% ANLS/5B) and DocOwl2 (69.42% ANLS/8B), showing an efficient scaling for complex industrial contexts. In summary, this thesis shows that an image-text alignment led by an OCR-free method, which integrates the spatial geometry, enables the representation of document images of various structures and containing different entity types. Moreover, it underlines that a small hierarchical architecture reduces the system complexity while keeping a competitive response quality. Finally, the adaptation of the model to multi-page documents without additional parameters shows the extension of the system to more complex use cases. Thus, this approach presents a DocVQA more efficient and competitive for the automation of information extraction.
Date24 Nov 2025
Original languageFrench
Awarding Institution
  • École de technologie supérieure
SupervisorMohamed Cheriet (Supervisor)

Cite this

'