Hybrid Multi-Phase Page Matching and Multi-Layer Diff Detection for Japanese Building Permit Document Review
Organizations: Faculty of Engineering and Design, Kagawa University
Abstract
We present a hybrid multi-phase page matching algorithm for automated comparison of Japanese building permit document sets. Building permit review in Japan requires cross-referencing large PDF document sets across revision cycles, a process that is labor-intensive and error-prone when performed manually. The algorithm combines longest common subsequence (LCS) structural alignment, a seven-phase consensus matching pipeline, and a dynamic programming optimal alignment stage to robustly pair pages across revisions even when page order, numbering, or content changes substantially. A subsequent multi-layer diff engine -- comprising text-level, table-level, and pixel-level visual differencing -- produces highlighted difference reports. Evaluation on real-world permit document sets achieves F1=0.80 and precision=1.00 on a manually annotated ground-truth benchmark, with zero false-positive matched pairs.
Figures & tables
| Approach | Page Reorder | Visual Diff | Domain-Specific | Legal Links |
|---|---|---|---|---|
| DiffPDF [ 2 ] | – | – | – | |
| ChangeDistiller [ 13 ] | – | – | – | |
| LayoutParser [ 8 ] | – | – | – | – |
| Ours |
| Method | Prec. | Rec. | F1 |
|---|---|---|---|
| Sequential (baseline) | 0.22 | 0.22 | 0.22 |
| LCS only | 1.00 | 0.67 | 0.80 |
| Seven-phase only | 1.00 | 0.67 | 0.80 |
| Ours (full) | 1.00 | 0.67 | 0.80 |
| Pair | Pages | Text ext. | Match |
|---|---|---|---|
| Pair 1 (extract) | 7.7 s | 2.8 ms | |
| Pair 2 (full) | 6.4 s | 19 ms |
Legal Document Analysis
Legal document analysis uses language technologies to classify, extract, compare, and reason over statutes, contracts, policies, and court decisions.
See all 76 papers