Abstract
Detecting manipulations in digital documents is becoming increasingly important for information verification purposes. Due to the proliferation of image editing software, altering key information in documents has become widely accessible. Nearly all approaches in this domain rely on a procedural approach, using carefully generated features and a hand-tuned scoring system, rather than a data-driven and generalizable approach. We frame this issue as a graph comparison problem using the character bounding boxes, and propose a model that leverages graph features using OCR (Optical Character Recognition). Our model relies on a data-driven approach to detect alterations by training a random forest classifier on the graph-based OCR features. We evaluate our algorithm's forgery detection performance on dataset constructed from real business documents with slight forgery imperfections. Our proposed model dramatically outperforms the most closely-related document manipulation detection model on this task.
Introduction
As digital documents increasingly replace physical paperwork in finance, insurance, and administration, the incentive to forge them—such as altering a salary figure or account balance—has skyrocketed. Traditional image manipulation detection relies heavily on pixel-level artifacts, lighting inconsistencies, or texture changes. However, digital documents are challenging for these methods: they are mostly white space, lack color depth, and are often subjected to printing, scanning, or JPEG compression, which destroys pixel-level clues.
Consequently, detecting document forgery requires looking at intrinsic properties—specifically, the subtle imperfections introduced when pasting or typing a fake character, such as microscopic misalignments or slight font size mismatches. Existing methods to detect these document-specific errors rely on rigid, hand-tuned scoring systems that struggle to generalize, often resulting in high false-positive rates.
Methodology
This research introduces a novel, data-driven approach to detecting forged digital documents by framing the issue as a graph comparison problem. In the barren, white-space-heavy landscape of a digital document, structural relationships are the strongest signal of tampering. A forged character might look perfectly normal in isolation, but its slight vertical offset or size mismatch relative to its neighbors is a key indicator of manipulation.
- Graph Construction: Using Tesseract OCR, bounding boxes are extracted for every character. Each character becomes a central node in a sub-graph, connected to $n$ neighboring characters on the same horizontal line of text. This allows the model to capture local context and understand what "normal" alignment looks like for a specific line.
- Feature Extraction: For each node in the sub-graph, a vector of structural and shape features is extracted. This includes bounding box dimensions, relative Y-axis displacement (a proxy for human alignment errors), Euclidean distance to the central node, 7 Hu Moments (shape descriptors invariant to scale, rotation, and translation), and the Principal Inertia Axis.
- Classification: These features are concatenated to describe the local neighborhood of a character. A Random Forest classifier is then trained to distinguish between pristine sub-graphs and manipulated ones.
Experimental Setup and Results
A custom dataset was constructed using 359 real-world finance-related documents (bank statements, tax returns, offer letters), split into 1,470 training pages and 389 testing pages. Ground-truth forgeries were created by stochastically altering 5% of the characters in the documents by either shifting them (by 1-10 pixels) or scaling them (by 7-25%). This mimics the exact types of slight imperfections introduced during copy-move or splicing forgeries.
The proposed model was evaluated against a closely related procedural baseline (Bertrand et al., 2013). The results demonstrate that the data-driven approach successfully learns the natural variance of document layouts, making it vastly more precise than procedural methods.
- Scaling Manipulations (15-25% size change): The proposed model achieved an F1 score of 0.8012 (vs. the baseline's 0.4265) and a Precision of 0.8651 (vs. 0.2927).
- Micro-Shifting Manipulations (1-5 pixel offset): Even on incredibly subtle misalignments, the model achieved an F1 score of 0.7512 (vs. 0.3795) and a Precision of 0.8604 (vs. 0.2498).
While the baseline method flagged almost everything as a forgery (abysmal precision), the proposed graph-based Random Forest maintained strong recall while keeping precision exceptionally high (~86-87%), making it viable for real-world automated auditing.
Conclusion
This work demonstrates that framing document manipulation as a graph comparison problem using OCR features provides a robust, generalizable solution for forgery detection. While the pipeline is currently bottlenecked by the accuracy of the underlying OCR engine, it offers a significant improvement over traditional procedural methods. Future work will explore graph anomaly detection methods to improve computational efficiency and hybrid approaches that combine structural OCR features with traditional pixel-based image manipulation features.
Summary updated