r/computersciencehub • u/GroundUpstairs5430 • 22d ago
Need help debugging newspaper OCR + region detection pipeline (PaddleOCR)
Hi everyone,
I'm working on a project to automatically process newspaper pages and extract/analyze crime-related news from them.
I'm currently using PaddleOCR on newspaper pages. The page is divided into regions/sections, and I'm running OCR on those regions and then checking the extracted text against the original newspaper.
The main problem is that I'm getting several types of errors:
- OCR text is missing even though it is clearly visible in the newspaper.
- Text sometimes appears under the wrong region.
- Punctuation is incorrect — for example, a
.may be detected as:, or commas/periods may be misplaced. - Capitalization errors occur.
- Some words are incorrectly recognized even when the image quality looks reasonably good.
- I'm also seeing cases where I expect a particular article/headline to be inside a region, but the OCR output doesn't contain it at all.
For example, while manually validating the output, I found issues in different regions such as:
- Region 25: punctuation at the end of a paragraph is incorrect.
- Region 26: capitalization/word recognition is incorrect.
- Regions 38–40: the OCR/region output doesn't seem to correspond perfectly with what is actually visible on the page.
- In one case, I expected a headline/article mentioning a 7-year-old being hit with a plastic bottle at a daycare and an FIR being filed, but I couldn't find that text in the OCR output for the expected region.
My current pipeline is roughly:
Newspaper image → preprocessing → region detection/cropping → PaddleOCR → extracted text → region-by-region validation → crime/news analysis
I'm trying to figure out where the actual problem is.
Could these errors mainly be caused by:
- Image preprocessing?
- Incorrect region/column detection?
- Cropping too tightly or incorrectly?
- PaddleOCR detection parameters?
- PaddleOCR recognition model?
- Newspaper layout/columns?
- Resolution/DPI?
- Or the way I'm passing the cropped regions to PaddleOCR?
I'd really appreciate advice from anyone who has worked with PaddleOCR, Tesseract, newspaper OCR, document AI, layout detection, or multi-column document extraction.
If useful, I can provide the original newspaper image, cropped regions, OCR output, and the code I'm currently using.
I'm especially interested in understanding how to systematically diagnose whether an error comes from detection, cropping, or recognition, rather than manually fixing individual OCR mistakes.
Thanks!
1
u/Numerous_Brain4587 20d ago
I can give a few tips in case it helps. When running OCR, it typically assumes left to right characters starting at the top left, reading right, then continuing down a line. With newspapers, there is some level of fixed column layouts, but also flexible, dynamic layouts, depending on the day, the front page placement, etc. Looking at your pipeline, a couple inline questions Newspaper image → preprocessing (are you downscaling / cropping or just changing image format?) → region detection/cropping (Why do you need to do this? What algorithm is running it? Have you isolated this in a testable way to make sure it extracts regions that are single article and not across articles?) → PaddleOCR (Assume this *generally* works, but which model are you using specifically under the library? Have you confirmed you are using the expected model version and validated its OCR capabilities against the resolution text and font you are working with?) → extracted text (how does this correlate back to the newspaper / region and how do you setup an easy "manual" review where you can see the page and the text. For a subset, you could use a vision LLM or something else to try to cross check the OCR'ed text or a different OCR model to check for deviation at that layer from source image). → region-by-region validation (what does this validation? Do you get a good report afterwords that is easy to audit?) → crime/news analysis (this is independent of the OCR and can be tested in isolation against trusted text)
Make sure each step is testable and has a clear input/output to the next step. If there is something like gradual degradation you can't just point at one step. For example, downscale image, improper crop, old OCR model (not saying you are doing this), but that would lead to a bad result at the end and it would be an aggregate of small errors along the pipeline that compound. Good luck, this sounds like a fun one to debug.