Abstract
The rapid advancement of generative AI has made the detection of image manipulation increasingly difficult. Traditional methods often struggle to balance low-level artifact detection with high-level semantic understanding. This paper introduces ForenAgent, a novel framework that empowers Multimodal Large Language Models (MLLMs) to act as autonomous forensic investigators. By writing and executing Python code to utilize a suite of specialized forensic tools, ForenAgent bridges the gap between pixel-level analysis and semantic reasoning. Through a two-stage training process involving supervised fine-tuning and Reinforcement Fine-Tuning (RFT) with a custom verifiable reward, ForenAgent achieves state-of-the-art performance (88.1% accuracy) on the newly introduced FABench dataset, outperforming massive closed-source models and specialized detection systems.
Introduction
Image Forgery Detection (IFD) is a critical frontier in digital security. Current approaches generally fall into two categories: low-level feature methods that analyze invisible artifacts like JPEG compression or sensor noise, and MLLM-based methods that excel at semantic content understanding but remain "blind" to subtle pixel-level traces. ForenAgent addresses this dichotomy by framing IFD as an agentic task. Instead of a single-pass classification, the model performs an interactive, multi-turn investigation, using code-in-the-loop to probe images with specialized forensic tools.
The ForenAgent Framework
ForenAgent operates as an interactive detective. It is equipped with a toolbox of 12 classic forensic and image processing tools, including Fast Fourier Transform (FFT), JPEG Ghost, Spatial Rich Models (SRM), and high-pass filters. The agent's workflow involves generating Python code to apply these tools, observing the resulting visual or textual outputs, and iterating based on its findings.
This approach allows the model to "see" artifacts that are otherwise invisible to its standard vision encoder. For example, an FFT residual might reveal periodic patterns indicative of GAN-based generation that are not apparent in the RGB space. This capability is essential because off-the-shelf models like GPT-4o and Gemini 2.5 Pro often fail to detect modern forgeries, misclassifying them as real in over 50% of cases.
Training with Verifiable Rewards
To instill logical investigative behavior, the authors utilized a two-stage training pipeline. First, a "Cold Start" phase involved supervised fine-tuning on approximately 200,000 reasoning trajectories generated by GPT-4.1. This was followed by Reinforcement Fine-Tuning (RFT) using Group Relative Policy Optimization (GRPO).
A key innovation is the Verifiable Reward system. Unlike standard RL which might only reward the final correct answer, this system incentivizes a logical workflow. The reward function favors agents that perform a global analysis before zooming in on local regions, use tools iteratively, and maintain reasoning coherence throughout the multi-turn interaction. This ensures the model doesn't just guess correctly but follows a robust forensic methodology.
Evaluation on FABench
The framework was evaluated on FABench (Forgery Agent Benchmark), a comprehensive new dataset comprising 100,000 images. FABench includes 40,000 authentic images alongside 60,000 synthetic and tampered images generated by state-of-the-art models like Midjourney-v7 and FLUX. This ensures the benchmark reflects the current high-difficulty landscape of photorealistic forgeries. Additionally, the model's generalization was tested on the SIDA-Test dataset, where it maintained a high accuracy of 80.6%.
Results and Emergent Behaviors
ForenAgent, built on a Qwen2.5-VL-7B backbone, achieved an overall accuracy of 88.1%, significantly outperforming 18 competitive baselines. The agent demonstrated several "human-like" emergent behaviors:
- Adaptive Probing: It naturally adjusts its tool usage, averaging more calls for complex tampered images (which require boundary analysis) than for synthetic ones.
- Self-Correction: The agent can recognize when a chosen crop does not contain the expected artifacts and will adjust its bounding box to re-examine other suspicious regions.
The ablation studies highlighted the importance of the RL stage; removing the custom "Tool Reward" led to a significant performance drop, confirming that the process of investigation is as vital as the tools themselves.
Conclusion
ForenAgent represents a significant step forward in making MLLMs effective for specialized, low-level tasks. By integrating code execution and forensic tool-use into a reasoning loop, it achieves high accuracy and interpretability. Future work aims to refine the model's spatial precision to enable pixel-level segmentation masks and to expand the forensic toolbox to counter evolving generative techniques.
Summary updated