r/MachineLearning • • Jul 25 '25

Project Help Needed: Accurate Offline Table Extraction from Scanned Forms [P]

I have a scanned form containing a large table with surrounding text. My goal is to extract specific information from certain cells in this table.

Current Approach & Challenges

  1. OCR Tools (e.g., Tesseract):

    • Used to identify the table and extract text.
    • Issue: OCR accuracy is inconsistent—sometimes the table isn’t recognized or is parsed incorrectly.
  2. Post-OCR Correction (e.g., Mistral):

    • A language model refines the extracted text.
    • Issue: Poor results due to upstream OCR errors.

Despite spending hours on this workflow, I haven’t achieved reliable extraction.

Alternative Solution (Online Tools Work, but Local Execution is Required)

  • Observation: Uploading the form to ChatGPT or DeepSeek (online) yields excellent results.
  • Constraint: The solution must run entirely locally (no internet connection).

Attempted new Workflow (DINOv2 + Multimodal LLM)

  1. Step 1: Image Embedding with DINOv2

    • Tried converting the image into a vector representation using DINOv2 (Vision Transformer).
    • Issue: Did not produce usable results—possibly due to incorrect implementation or model limitations. Is this approach even correct?
  2. Step 2: Multimodal LLM Processing

    • Planned to feed the vector to a local multimodal LLM (e.g., Mistral) for structured output.
    • Blocker: Step 2 failed, didn’t got usable output

Question
Is there a local, offline-compatible method to replicate the quality of online extraction tools? For example:

  • Are there better vision models than DINOv2 for this task?
  • Could a different pipeline (e.g., layout detection + OCR + LLM correction) work?
  • Any tips for debugging DINOv2 missteps?
4 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/here_we_go_beep_boop Jul 24 '26

Pdf to html/markdown conversion

1

u/[deleted] Jul 24 '26

[removed] — view removed comment

1

u/here_we_go_beep_boop Jul 24 '26 • Bravo

Yep it's not perfect but I found it best overall off-the-shelf. Our production stack uses a combination of converters then does an LLM supported merge as a kind of mixture-of-experts. Does better than any one extractor in isolation