ForensicsTok: Forensics-Guided Tokenized Modeling for Image Tampering Localization

Lei Xu, Haowei Wang, Shen Chen, Taiping Yao, Bin Li, Changsheng ChenarXiv 2026

TL;DR

ForensicsTok reformulates image tampering localization by treating it as an autoregressive token generation task within a Multimodal Large Language Model (MLLM). By eliminating clunky external segmentation decoders and integrating multi-scale forensic expert features directly into the visual backbone, it achieves state-of-the-art localization performance while slashing parameter counts by 62.5% compared to previous MLLM baselines.

What Problem Does This Paper Address?

While Multimodal Large Language Models (MLLMs) excel at high-level reasoning tasks, applying them to fine-grained Image Manipulation Detection and Localization (IMDL) has proven difficult. Existing approaches typically "stitch" an MLLM to an external, off-the-shelf segmentation decoder (like SAM).

This setup introduces two major flaws:

  1. Information Bottlenecks: Passing semantic embeddings from the MLLM to an external segmentor dilutes precise spatial signals and prevents direct end-to-end supervision of the mask tokens during backpropagation.
  2. Missing Forensic Priors: Standard MLLM visual backbones are trained on natural images and lack the specialized knowledge required to detect subtle forensic anomalies, such as localized JPEG compression traces or texture inconsistencies.

Methods

ForensicsTok addresses these limitations through a unified, encoder-decoder architecture that bypasses external segmentors entirely.

Figure 2: Overview of the proposed ForensicsTok framework. The architecture integrates the Hierarchical Expert Fusion (HEF) module with the visual backbone, which efficiently incorporates expert forensic knowledge for tampering localization. ForensicsTok also employs the Token Splatting Decoder (TSD), a forensic-specific token supervision and detokenization path that maps tokens to binary masks.
  • Autoregressive Mask Generation: Instead of outputting a generic embedding, the MLLM directly predicts a sequence of discrete tokens that represent the localized tampering mask.
  • Token Splatting Decoder (TSD): To map these discrete tokens back into binary 2D masks, the authors employ a pre-trained codebook detokenizer. To stabilize training, they introduce Codebook-aware Label Smoothing ($L_{TSD}$). Standard cross-entropy treats all incorrect codes as equally wrong; TSD smoothly redistributes probability mass to semantically similar neighboring codes within the codebook, preventing gradient instability.
  • Hierarchical Expert Fusion (HEF): To inject forensic awareness, ForensicsTok extracts multi-scale features from a frozen forensic expert model (SparseViT). Instead of performing late fusion (concatenating features after the visual backbone), the HEF module uses an attention-based gating mechanism to fuse shallow (texture-focused) and deep (semantic-focused) expert features directly into the intermediate layers of the MLLM's visual encoder.

Datasets

  • Training: The model was trained on a combined pool consisting of TamperCOCO, MIML, CASIA2, and tampered samples from SID_Set (to provide exposure to AI-generated/AIGC forgeries).
  • Evaluation: To rigorously test cross-domain generalization, the model was evaluated on six entirely unseen benchmarks: CASIA1, NIST, Coverage, Columbia, Glide, and IMD.

Key Insights and Ideas

  • The "All-or-Nothing" Penalty Fix: In discrete token mask generation, visually similar local masks often map to adjacent codes in the embedding space. Standard one-hot supervision penalizes near-misses just as harshly as completely wrong codes. Codebook-aware smoothing elegantly resolves this geometric mismatch.
Figure 3: Codebook usage and rigid supervision. (a) Code usage is balanced. (b) Distinct sequences can decode to similar masks. Treating such semantically-close codes as exclusive one-hot labels causes strict supervision and instability.
  • Intermediate Fusion is Essential for Forensic Features: Forensic features (like noise patterns) are highly heterogeneous compared to the semantic features favored by MLLM visual backbones. Fusing them at intermediate stages allows the model to preserve subtle, low-level artifacts that late-stage concatenation would otherwise dilute.

Key Results

  • State-of-the-Art Localization: ForensicsTok achieved an average Intersection over Union (IoU) of 0.68 and an F1 score of 0.78 across the six evaluation datasets. This significantly outperforms MLLM baselines like SIDA (0.44 IoU / 0.57 F1) and FakeShield (0.35 IoU / 0.46 F1), and even edges out the specialized standalone expert SparseViT (0.64 IoU / 0.76 F1).
  • Drastic Efficiency Gains: By removing the external segmentor pipeline, ForensicsTok reduced total parameters by 62.5% (from ~22.66 B down to ~8.52 B) and delivered a 1.6× inference speedup (from 2.26 seconds down to 1.39 seconds) compared to FakeShield.
  • Improved Robustness: The architecture demonstrated superior resilience to real-world image degradations, maintaining higher F1 scores under Gaussian noise, resizing, and JPEG compression distortions than competing MLLM frameworks.

Limitations and Future Work

  • Computational Footprint vs. Pure Experts: Although ForensicsTok is highly efficient for an MLLM pipeline, at ~8.52 billion parameters, it remains significantly heavier than lightweight standalone forensic networks (e.g., SparseViT at ~0.05 billion parameters). It is not yet a drop-in replacement for latency-critical edge deployments.
  • Sensitivity to Strong Compression: The authors observed a noticeable performance drop under heavy JPEG compression (70% quality), as aggressive quantization tends to obliterate the fine-grained high-frequency traces the model relies on.
  • Future Directions: The team plans to expand the framework to generate natural language explanations alongside the localization masks and evaluate its capabilities on broader generative AI (AIGC) manipulation benchmarks.

Summary updated

BibTeX
@misc{xu2026forensicstok,
  author = {Lei Xu and Haowei Wang and Shen Chen and Taiping Yao and Bin Li and Changsheng Chen},
  title = {{ForensicsTok: Forensics-Guided Tokenized Modeling for Image Tampering Localization}},
  year = {2026},
  eprint = {2606.24538},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.24538},
}
Figure