Leveraging Contrastive Learning for a Similarity-Guided Tampered Document Data Generation Pipeline

Mohamed Dhouib, Davide Buscaldi, Sonia Vanier, Aymen Shabou
2/19/2026
cs.CV

No official code found. Best implementation: Mohamed-Dhouib/TDOC (5 stars, Apache-2.0, last commit 2026-04-12).

Abstract

Detecting tampered text in document images is a challenging task due to data scarcity. To address this, previous work has attempted to generate tampered documents using rule-based methods. However, the resulting documents often suffer from limited variety and poor visual quality, typically leaving highly visible artifacts that are rarely observed in real-world manipulations. This undermines the model's ability to learn robust, generalizable features and results in poor performance on real-world data. Motivated by this discrepancy, we propose a novel method for generating high-quality tampered document images. We first train an auxiliary network to compare text crops, leveraging contrastive learning with a novel strategy for defining positive pairs and their corresponding negatives. We also train a second auxiliary network to evaluate whether a crop tightly encloses the intended characters, without cutting off parts of characters or including parts of adjacent ones. Using a carefully designed generation pipeline that leverages both networks, we introduce a framework capable of producing diverse, high-quality tampered document images. We assess the effectiveness of our data generation pipeline by training multiple models on datasets derived from the same source images, generated using our method and existing approaches, under identical training protocols. Evaluating these models on various open-source datasets shows that our pipeline yields consistent performance improvements across architectures and datasets.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

[CVPR 2026 findings] Official repository for the paper "Leveraging Contrastive Learning for a Similarity-Guided Tampered Document Data Generation Pipeline".

51C++, CudaFeb 19, 20266 months agoApache-2.0

Similar Papers

Cite this paper

@article{dhouib2026leveraging,
  title  = {Leveraging Contrastive Learning for a Similarity-Guided Tampered Document Data Generation Pipeline},
  author = {Mohamed Dhouib and Davide Buscaldi and Sonia Vanier and Aymen Shabou},
  year   = {2026},
  eprint = {2602.17322},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.17322v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.17322.svg)](https://codeofpaper.com/paper/2602.17322)

Discussion