gbanyan 338737d9a1 Add script 40: pixel-identity FAR (0% across all v4 classifiers)
Phase 1.8 follow-up. Validates the v4.0 classifier family against
the only hard ground truth in the corpus: pixel_identical_to_closest=1
(byte-identical to nearest same-CPA neighbor; mathematically impossible
under independent hand-signing).

n = 262 pixel-identical Big-4 signatures.

  Firm A   145
  KPMG       8
  PwC      107
  EY         2

FAR (lower better; Wilson 95% CI for the misclassification rate):

  PaperA box rule           0.00%  [0.00%, 1.45%]
  K=3 per-CPA hard label    0.00%  [0.00%, 1.45%]
  Reverse-anchor (calibr.)  0.00%  [0.00%, 1.45%]

Per-firm: 0% misclass on every firm.

Reverse-anchor cut chosen by prevalence calibration (overall
replicated rate matches Paper A's 49.58%). Documented v4.0
limitation: no signature-level ground truth for hand-leaning
class, so cannot ROC-optimize the cut directly.

PwC's 107 pixel-identical signatures despite being the most
hand-leaning firm overall (Script 38 per-CPA P_C1=0.31)
illustrates the within-firm heterogeneity that v4.0's K=3
mixture captures: a PwC CPA can be hand-leaning on average
while still occasionally reusing template signatures.

Implication: at the only hard ground truth available in the
corpus, all three v4.0 classifiers achieve perfect detection.
This satisfies REQ-001 acceptance for pixel-identity FAR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 15:10:03 +08:00

PDF Signature Extraction System

Automated extraction of handwritten Chinese signatures from PDF documents using hybrid VLM + Computer Vision approach.

Quick Start

Step 1: Extract Pages from CSV

cd /Volumes/NV2/pdf_recognize
source venv/bin/activate
python extract_pages_from_csv.py

Step 2: Extract Signatures

python extract_signatures_hybrid.py

Documentation

Current Performance

Test Dataset: 5 PDF pages

  • Signatures expected: 10
  • Signatures found: 7
  • Precision: 100% (no false positives)
  • Recall: 70%

Key Features

Hybrid Approach: VLM name extraction + CV detection + VLM verification Name-Based: Signatures saved as signature_周寶蓮.png No False Positives: Name-specific verification filters out dates, text, stamps Duplicate Prevention: Only one signature per person Handles Both: PDFs with/without text layer

File Structure

extract_pages_from_csv.py          # Step 1: Extract pages
extract_signatures_hybrid.py       # Step 2: Extract signatures (CURRENT)
README.md                          # This file
PROJECT_DOCUMENTATION.md           # Complete documentation
README_page_extraction.md          # Page extraction guide
README_hybrid_extraction.md        # Signature extraction guide

Requirements

Data

  • Input: /Volumes/NV2/PDF-Processing/master_signatures.csv (86,073 rows)
  • PDFs: /Volumes/NV2/PDF-Processing/total-pdf/batch_*/
  • Output: /Volumes/NV2/PDF-Processing/signature-image-output/

Status

Page extraction: Tested with 100 files, working Signature extraction: Tested with 5 files, 70% recall, 100% precision Large-scale testing: Pending Full dataset (86K files): Pending

See PROJECT_DOCUMENTATION.md for complete details.

S
Description
Automated extraction of handwritten Chinese signatures from PDF documents using hybrid VLM + Computer Vision approach. 70% recall, 100% precision.
Readme 6.9 MiB
Languages
Python 100%