翻篇收录说明
翻篇网页快照

Docling Found 41 Images and Described Zero. Why I Eventually Replaced My PDF Pipeline With Base64 + Vision LLMs. · Highworth AI

https://highworth.ai/en/reviews/docling-found-41-images-and-described-zero-why-i-eventually--mw3haxuy

最近抓取:2026-12-04 11:48:11(北京时间)

最近内容变化:2026-12-04 11:48:11(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

I was working on a document ingestion pipeline for an AI-powered financial research system when I encountered an interesting problem. A PDF converted successful

正文摘录

BackGPT-4oMistral OCRDeepSeek-OCRGeminiGranite-DoclingDocling Found 41 Images and Described Zero. Why I Eventually Replaced My PDF Pipeline With Base64 + Vision LLMs.Harsh Sinha⭐⭐⭐⭐Author siteNov 5, 2026Visit ChatGptVisit DeepSeekVisit GeminiVisit Granite-DoclingVisit MistralHelpful40Not helpful295% Helpful5% Not helpful0 CommentsI was working on a document ingestion pipeline for an AI-powered financial research system when I encountered an interesting problem. A PDF converted successfully. The Markdown file was generated. Headings and paragraphs appeared where they should. But the output had lost some of the most important financial information. Charts, graphs and image-heavy sections were either missing or reduced to placeholders. One of my Docling experiments detected 41 pictures and generated zero useful picture descriptions. Another experiment took 266.96 seconds to process a four-page PDF chunk. For a production financial RAG system, those are not minor inconveniences. Imagine an investor asking: "What was the company's revenue growth over the last five years?" The answer might exist only in a bar chart. The textual paragraph beside it might discuss the business strategy but never repeat the actual numbers. If the ingestion pipeline stores only the surrounding paragraphs, the retrieval system has no way to recover those figures from its text index. The document was processed, but the information was lost. That failure eventually pushed me through three generations of document extraction architecture: Docling-based parsing: Conventional OCR, layout recognition, table extraction and document understanding. Hybrid Docling + GPT-4o: Docling handled structural extraction, while GPT-4o interpreted extracted images and charts. Direct Base64 + multimodal LLM: Complete PDF pages were rendered into images, Base64-encoded and sent directly to vision models for Markdown generation, removing Docling from the extraction path entirely. The third architecture became the direction I preferred for visually complex financial documents. And the most interesting part was not that a larger model suddenly became better at OCR. It was that simplifying the pipeline removed several failure points simultaneously. 1. What Makes Financial Document Extraction So Difficult? Financial documents combine multiple information formats on the same page. A typical annual report or factsheet can contain: Ordinary text and headings. Financial tables with merged cells. Revenue, margin and profit charts. Footnotes explaining accounting assumptions. Scanned images. Multi-column layouts. Figures expressed in thousands, lakhs, crores or millions. Percentages that need to remain associated with particular years or business segments. Consider a table: Financial yearRevenue (₹ Cr)EBITDA marginFY2312,43017.2%FY2414,85018.1%FY2517,21019.4% These are illustrative figures, not extracted company data. A good document parser must preserve more than the raw strings. It must know that 17,210 is associated with FY25 revenue, that the unit is crores, and that 19.4% belongs to a different column. The problem becomes harder when the same data is presented as a chart. A conventional OCR engine may recognize the axis labels and numbers but fail to reconstruct what each bar represents. A multimodal model can reason about the visual relationships, although it can still misread numbers or hallucinate values. For financial RAG, I think of document-extraction quality in three layers: Text fidelity: Did we extract the words correctly? Structural fidelity: Did we preserve tables, headings, units, relationships and reading order? Semantic fidelity: Did we actually capture what a graph, illustration or diagram communicates? The third dimension is what many OCR pipelines miss. And if that information never reaches your vector database, better embeddings and rerankers cannot recover it. 2. Stage One: Docling-Based PDF Processing My initial approach used Docling, the open-source document conversion framework associated with IBM Research. Docling offers conventional parsing pipelines and vision-language-model-based pipelines. These should not be confused with one another. The standard pipeline typically combines PDF parsing, layout understanding, OCR where needed, table recognition and document reconstruction. The VLM pipeline instead uses a vision-language model to understand rendered document pages. My ingestion system sat within a broader pipeline involving document storage, queue-based processing, Markdown generation, chunking, embeddings and retrieval. The basic flow was: Financial PDF | v Azure Blob Storage | v Queue / Ingestion Worker | v Docling PDF Converter | +---- OCR / Layout Analysis | +---- Table Recognition | +---- Picture Extraction | v Markdown Export | v Chunking + Embeddings | v Vector Database | v Financial RAG Retrieval Docling was attractive for several reasons. It provided a structured document representation, understood more than just plain text, and supported Markdown export. It also offered a reasonable starting point for processing large collections of PDFs. For text-heavy documents, this architecture made sense. But enabling image understanding exposed multiple problems. Problem A: Picture detection did not mean picture understanding One of the biggest misconceptions I encountered was assuming that detecting an image meant its content would appear in the exported Markdown. Those were separate operations. Docling might detect a picture, generate a cropped image representation, and still export a placeholder rather than useful semantic content. In my experiments, one particularly unsuccessful run detected 41 pictures but generated no descriptions. The downstream Markdown could contain: <!-- image --> For a retrieval system, that placeholder is almost useless. It tells me an image existed. It tells me nothing about what the image contained. Problem B: Picture annotations and Markdown export were different problems Even generating descriptions was not always sufficient. The picture annotations could exist within the document representation without appearing correctly in the final Markdown output. This distinction produced additional debugging work around image annotations, export options and serialization. I also encountered an API compatibility issue where a version of export_to_markdown() rejected an image_ref_mode argument. One test involving chunk_1_9-20.pdf spent 173.65 seconds on conversion before encountering that export error. That is especially painful because the expensive document conversion has already happened, but the expected final artifact still does not exist. Interestingly, this was not an entirely isolated class of issue. Public Docling GitHub discussions have documented picture annotations being omitted from Markdown exports and inconsistent behavior around picture-description metadata. Problem C: Page-range processing and image enrichment To handle larger documents, I experimented with breaking PDFs into page ranges. However, some combinations of page-range processing and picture enrichment introduced indexing problems, including an IndexError involving conv_res.pages[page_ix]. The general engineering problem was straightforward: page indices in a converted subset must remain correctly mapped to their original positions. When that assumption breaks, extracted image content can be lost or processing can fail. Problem D: Startup and model-loading overhead There were also operational problems unrelated to extraction accuracy. On a Python 3.12 environment, I encountered slow startup and interrupted imports involving Docling's dependency chain. The traces went through modules such as Pydantic, pandas, Transformers and metadata scanning. That introduced another source of overhead before useful document extraction even started. In a persistent worker, heavy imports may be amortized. In a frequently restarted process or constrained virtual machine, startup overhead can become an important part of actual end-to-end latency. The lesson from this first architecture was clear: A library successfully detecting document elements does not guarantee that the downstream output preserves their meaning. 3. Stage Two: Hybrid Docling + GPT-4o My next approach was a hybrid. Instead of expecting Docling to understand every visual element, I separated document parsing from image interpretation. Docling continued handling the structural extraction. GPT-4o handled the visual content. The pipeline looked roughly like this: PDF | v Docling Extraction | +---- Text + Tables ---------+ | | +---- Extracted Images | | | v | Base64 Encoding | | | v | GPT-4o | | | v | Image Descriptions | | | +-------------------+ | v Enriched Markdown | v RAG Ingestion Base64 was already part of this stage. The important difference is that Base64-encoded images were being used to enrich Docling's extraction, not replace Docling itself. GPT-4o was useful for tasks such as explaining charts, interpreting diagram relationships, and identifying numeric information represented visually. That helped address one of the original problems: the text representation no longer had to ignore visual elements entirely. But the architecture still had a serious dependency. GPT-4o could only interpret the images that Docling successfully identified and passed to it. If a chart was not extracted, was incorrectly cropped, or lost the surrounding heading and axis context, the vision model received an incomplete view of the document. This is an important architectural limitation. Imagine a chart whose title says "Segment Revenue Growth" and whose legend is located outside the chart crop. An isolated image crop may omit information needed to associate individual bars with business segments. A whole-page image contains more surrounding context. The hybrid architecture also required merging outputs from two separate extraction systems. That creates its own questions: Where should each image description be in