guilindev's picture
Replace walkthrough with full 105-second USD invoice workflow
3ecef03 verified
Raw History Blame Contribute Delete
6.91 kB
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Document Verification Lab Β· Guilin Zhang</title><link rel="stylesheet" href="style.css"></head><body>
<header><a class="wordmark" href="#">D<span>V</span>L <b>DOCUMENT VERIFICATION LAB</b></a><nav><a href="#workbench">Explore</a><a href="#results">Results</a><a href="https://github.com/GuilinDev/document-verification-lab" target="_blank" rel="noopener">GitHub β†—</a></nav></header>
<main><section class="hero"><div><p class="eyebrow">AN EXPERIMENT BY GUILIN ZHANG</p><h1>The numbers add up.<br>Do they match the page?</h1><p class="lede">An independent visual check for document automation. Explore real outputs from MiniCPM-OCR and OCR Jev, then decide what deserves a second look.</p><a class="button" href="#workbench">Inspect the evidence ↓</a></div><aside><strong>120</strong><span>generated invoices</span><div><b>40 calibration</b><b>80 held out</b></div><p>Recorded GPU inference Β· interactive review routing</p></aside></section>
<section id="workbench"><div class="section-heading"><div><p class="eyebrow">01 / FOLLOW THE EVIDENCE</p><h2>One source. Two different questions.</h2></div><span class="small">Fixed payment-region crops Β· synthetic invoices</span></div>
<div class="presets"><button data-case="invoice-090-consistent_amounts" class="active">Amounts Γ—10 Β· stress test</button><button data-case="invoice-090-currency">Wrong currency Β· stress test</button><button data-case="invoice-097">An actual OCR error</button><button data-case="invoice-090-reference">Correct transcription</button></div>
<div class="selectors"><label>Dataset <select id="dataset"><option value="stress">Deliberate stress tests</option><option value="test">Held-out OCR outputs</option><option value="calibration">Calibration OCR outputs</option></select></label><label class="wide">Case <select id="case"></select></label><span id="caseMeta"></span></div>
<div class="evidence"><article class="panel"><div class="panel-head"><b>1. SOURCE PIXELS</b><a id="fullPage" target="_blank" rel="noopener">Full invoice β†—</a></div><div class="imagebox"><img id="source" alt="Original payment region"></div><p class="caption">The verifier receives this image, the candidate text, and its rendered image.</p></article><article class="panel"><div class="panel-head"><b>2. CANDIDATE TEXT</b><span id="candidateKind"></span></div><pre id="ocr"></pre><details><summary>Inspect the exact candidate rendering</summary><img id="render" alt="Candidate text as rendered for the verifier"></details></article></div>
<div class="decisions"><article><p class="eyebrow">STRUCTURAL RULES</p><h3 id="ruleTitle"></h3><p id="ruleDetail"></p></article><article><p class="eyebrow">VISUAL CONSISTENCY SCORE</p><h3 id="score"></h3><div class="meter"><i id="scoreBar"></i></div><p>A 0–1 model score for agreement with the source pixels. Higher means stronger predicted agreement; it is not a calibrated guarantee.</p></article><article id="routePanel"><p class="eyebrow">FROZEN REVIEW POLICY</p><h3 id="route"></h3><p id="routeDetail"></p><span id="truth" class="badge"></span></article></div>
<details class="audit"><summary>Open the audit trail: labels, model output and timing</summary><pre id="audit"></pre></details></section>
<section id="results"><div class="section-heading"><div><p class="eyebrow">02 / TEST THE TRADEOFF</p><h2>More AI also means more review.</h2></div><span>80 held-out regions Β· 3 critical-field errors</span></div><div class="result-grid"><article class="panel comparison"><h3>The frozen operating point</h3><table><thead><tr><th>Policy</th><th>Reviewed</th><th>Errors caught</th><th>Correct items reviewed</th></tr></thead><tbody><tr><td>Rules</td><td>3 / 80</td><td>3 / 3</td><td>0</td></tr><tr><td>Rules + verifier</td><td>16 / 80</td><td>3 / 3</td><td>13</td></tr></tbody></table><p>In this pilot, rules caught every natural error. The verifier added 13 correct items to the review queue. Its extra value needs evidence on harder, representative data.</p></article><article class="panel"><h3>Try a different threshold</h3><p>Exploratory view of the same held-out records. The published result uses the frozen calibration threshold.</p><label class="range-label">Review below <output id="thresholdLabel"></output><input id="threshold" type="range" min="0" max="1" step="0.001"></label><button id="reset" class="quiet">Reset to frozen threshold</button><div class="mini-stats"><div><strong id="reviewCount"></strong><span>sent to review</span></div><div><strong id="caughtCount"></strong><span>errors caught</span></div><div><strong id="escapedCount"></strong><span>errors accepted</span></div></div><p id="risk"></p></article></div>
<div class="stress-summary"><b>A different result on deliberate stress tests</b><p>Rules missed all 24 internally consistent currency and amount substitutions. Adding the verifier routed all 24 to review. These are designed probes, reported separately from natural OCR errors.</p><span>12 currency substitutions + 12 amount multiplications</span></div></section>
<section id="how"><p class="eyebrow">03 / FROM READING TO WORKFLOW</p><h2>Keep visual correctness and business checks separate.</h2><div class="flow"><div><b>Read</b><p>MiniCPM-OCR 1.0<br>1.3B parameters<br>Image β†’ text</p></div><span>β†’</span><div><b>Verify</b><p>MiniCPM-OCR Jev<br>2B parameters<br>Image + text + render β†’ score</p></div><span>β†’</span><div><b>Route</b><p>Rules + threshold<br>Keep evidence attached<br>Human review when needed</p></div><span>β†’</span><div><b>Check context</b><p>Purchase order, receipt,<br>supplier and policy<br>Business validation</p></div></div><div class="business"><b>Correct OCR can still fail a business check.</b><p id="businessExample"></p></div><p class="context">Supplier-invoice intake is a useful application for this pattern. Workday describes OCR, validation and exception handling in its <a href="https://www.workday.com/en-us/perspectives/finance/what-is-automated-invoice-processing.html" target="_blank" rel="noopener">public overview of automated invoice processing β†—</a>. This is a personal experiment using synthetic data.</p></section>
<section id="film" hidden><p class="eyebrow">WATCH / FULL USD WORKFLOW Β· 1:45</p><h2>Follow one dollar invoice from upload to correction.</h2><video controls preload="metadata" src="walkthrough.mp4?v=usd-full-105"></video></section>
<footer><div><b>Built to be inspected.</b><p>Open inputs, model revisions, raw scores and evaluation code.</p></div><div><a href="https://github.com/GuilinDev/document-verification-lab">Code & methodology β†—</a><a href="https://huggingface.co/openbmb/MiniCPM-OCR-Jev">Upstream verifier β†—</a><a href="evidence.json" download>Download evidence JSON ↓</a></div></footer></main><script src="app.js"></script></body></html>