gbanyan 8ac09888ae Add script 33: reverse-anchor spike (PAPER_C_STRONG verdict)
Follow-up to Script 32 verdict C. Tests whether using the non-Firm-A
population (515 CPAs) as a "fully-replicated reference" recovers the
Paper A hand-signed signal through deviation analysis on Firm A.

Methodology:
  * Robust 2D Gaussian fit (MCD, support_fraction=0.85) on
    (cos_mean, dh_mean) of all_non_A CPAs.  Reference center =
    (cos=0.946, dh=8.29).
  * Score Firm A CPAs by symmetric Mahalanobis distance, log-
    likelihood, and directional cosine left-tail percentile.
  * Cross-validate against Paper A's per-CPA hand_frac proxy
    (signatures with cos<=0.95 OR dh>5).

Key findings:
  * Directional metric (-cos_left_tail_pct) vs Paper A hand_frac:
    Spearman rho = +0.744 (p < 1e-30) -- PAPER_C_STRONG.
  * Symmetric Mahalanobis vs hand_frac: rho = -0.927 (p < 1e-73).
    The negative sign is a feature, not a bug: Firm A bifurcates
    into two anomaly directions from the non-Firm-A reference --
    (a) ultra-replicated CPAs (cos>=0.985, dh~1) sitting beyond
    the reference's high-cos tail, and (b) hand-signed CPAs
    (cos~0.95, dh~6-7) sitting near or below the reference
    center.  Symmetric distance lumps both into a positive
    magnitude; directional metrics distinguish them.

Implication: a "Paper C" reframing is statistically supported.
Use non-Firm-A as the replication reference, not Firm A as the
hand-signed anchor.  This removes the "why is Firm A ground
truth?" reviewer attack and reveals the bifurcation structure
that Paper A's symmetric framing obscures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:09:36 +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%