top | item 47195785

Seeking Advice on Improving OCR for Watermarked PDFs in My RAG Pipeline

2 points| hundredtrillion | 1 day ago

I’ve been developing a small RAG pipeline and ran into a specific technical issue involving OCR. I’m using PyMuPDF for extraction, and whenever a PDF contains a centered watermark on each page, the OCR becomes noisy—text breaks, artifacts show up, and the output degrades enough that it affects chunking and retrieval accuracy downstream.

The document is otherwise clean, so I’m trying to understand whether this is a known limitation of PyMuPDF or if there are better approaches for handling watermarked PDFs before OCR. I’m working with an RTX 4000 (8GB VRAM), so I’m also trying to stay within reasonable GPU constraints.

I’d really appreciate any ideas on:

more robust OCR libraries or models that handle watermarks well

preprocessing strategies to suppress watermark text

better extraction pipelines for RAG use cases

or any general advice on improving this part of the system

The project is open-source, and if anyone is interested in digging deeper, finding issues, or contributing improvements, here’s the repository:

GitHub: https://github.com/Hundred-Trillion/L88-Full

If you find it useful, starring the repo helps increase visibility so more people with domain expertise might notice it.

Thanks in advance for any insights.

2 comments

order

NoahZuniga|20 hours ago

I've had a lot of success doing "OCR" with gemini-<n>-pro. It gives incredibly accurate text (Most documents ~20 pages long have 0 errors), but no coordinates of the text. I don't need to coordinates so that's fine by me.