Yassine Mjardi
5 min read

Benchmarking Low-Cost Chinese AI Models for Complex Math OCR: PaddleOCR, Qwen, and DeepSeek

By Yassine Mjardi

Transcribing clean digital prose is largely a solved problem. Extracting and analyzing complex mathematical expressions—dense exam sheets, multi-column problem sets, handwritten derivations, and skewed phone photos—on a tight per-page budget while targeting high accuracy is a much harder problem.

Rather than jumping straight to expensive frontier APIs, I ran a focused series of benchmarks testing three Chinese open-weight and low-cost models one by one: PaddleOCR, Qwen, and DeepSeek. The goal was simple: evaluate how far each model can go on its own at parsing mathematical PDFs and photos into clean, trustworthy Markdown and LaTeX.

The honest takeaway so far: none of the individual models delivered satisfying, 100%-reliable results yet. This post documents what I tested, where each model falls short, and why the next step requires pairing models with deterministic tools and dedicated math solvers.

The Constraint: High Accuracy on a Low Budget

When working with hundreds of pages of mathematical PDFs or user-submitted phone photos, unit economics matter as much as raw capability. Heavyweight commercial vision-language models quickly become cost-prohibitive at scale, yet classic text OCR collapses the moment an equation spans two lines, mixes prose with inline notation, or nests fractions inside piecewise braces.

I wanted to know whether a single specialized OCR engine or low-cost vision/reasoning model could handle end-to-end extraction and analysis reliably enough for real mathematical workloads.

Benchmarking Each Model One by One

Instead of wiring everything into a single combined chain from day one, I tested each candidate independently against the same mix of scanned PDFs, dense problem sheets, and real phone captures:

1. PaddleOCR

  • Strengths: Fast, deterministic-feeling throughput, near-zero inference cost when self-hosted, and solid baseline recognition on printed prose, headings, and clean single-line text.
  • Where it fell short: As soon as mathematical density increases—nested radicals, multi-line aligned derivations, matrices, or handwritten annotations—layout segmentation clips bounding boxes or merges inline symbols with surrounding text. Raw formula recognition still drops delimiters and misreads tight spatial notation.

2. Qwen (Vision-Language Models)

  • Strengths: Much stronger visual understanding of spatial math relationships on cropped equations, low-DPI scans, and slightly angled phone photos. Capable of producing well-formatted LaTeX blocks when the image is clean and focused.
  • Where it fell short: Still unreliable on subtle notation under visual noise. On dense pages or handwritten work, it occasionally swaps subscripts and superscripts (an2a_n^2 vs. an2a_{n^2}), drops negative signs in exponents or integration bounds, or hallucinates standard textbook formulas instead of transcribing what is actually printed.

3. DeepSeek

  • Strengths: Strong mathematical reasoning and low token cost when analyzing already-extracted expressions, normalizing malformed LaTeX syntax, or checking step-by-step derivations in text form.
  • Where it fell short: Without rock-solid upstream visual extraction, reasoning models cannot reliably recover lost visual truth. Worse, when given ambiguous or slightly corrupted OCR output, a reasoning model can "repair" an expression into something mathematically plausible rather than what was originally written on the page—turning an obvious parse error into a silent mistake.

Common Failure Modes Across All Three

Across every single-model benchmark run, the same core reliability gaps kept surfacing:

  1. LaTeX parsing and delimiter breaks: Unbalanced braces, broken \left / \right pairs, malformed cases or array environments, and inconsistent inline vs. display math delimiters.
  2. Subscript, superscript, and sign errors: Dropped minus signs, misread prime marks (f′(x)f'(x) vs. f(x)f(x)), and visually similar symbols (∈\in vs. ε\varepsilon, uu vs. vv, ≤\le vs. <<) that alter the meaning of an entire proof or equation.
  3. Layout breaks on dense, scanned, or handwritten math: Multi-column sheets, tight margin notes, crossed-out terms, and uneven phone lighting consistently degrade both region detection and symbol accuracy.

At roughly 85–92% accuracy on hard pages, the output looks impressive in a quick demo—but for math, a single dropped sign invalidates the result. Close is not 100% reliable.

To Be Continued...

Benchmarking PaddleOCR, Qwen, and DeepSeek individually made one limitation unmistakable: relying on neural models alone—whether OCR or LLM—will not guarantee 100% mathematical accuracy. Language and vision models predict probable tokens; they do not formally verify algebraic truth.

The next phase of this work is introducing deterministic tools and dedicated math solvers alongside the models:

  1. Structural & LaTeX verification tools: Strict AST and KaTeX/LaTeX validation gates that catch syntax, delimiter, and environment errors deterministically before any output is accepted.
  2. Symbolic math solvers & CAS integration: Passing extracted expressions and intermediate reasoning steps to dedicated computer algebra and solver tooling (such as SymPy-style symbolic engines and numerical verifiers) to check equivalence, validate transformations, and catch sign or algebraic drift immediately.
  3. Tool-verified feedback loops: Whenever a solver flags an inconsistency between intermediate steps or an impossible equality, routing that exact mismatch back for targeted re-inspection rather than trusting the model's first pass.

By combining low-cost models for visual extraction with deterministic tools and math solvers for verification, the target is clear: move beyond "mostly accurate" demos toward 100% reliable mathematical extraction and analysis. I will share the results of this tool-assisted architecture in a follow-up post once benchmarked.