Manuscript Offprint

arXiv:2609.05876

FACT: A Forensic Agent with Compiled Tool-Use Trajectories for AI-Generated Image Detection

Jiaoyang Chen, Bin Hu, Jingyu Hu, Kun Zhou, Qin Zhang, Zhengzhe Liu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

AI-generated image detection is increasingly open-world: new image generators produce highly realistic images that make visual artifacts harder to identify. Existing detectors usually rely on a fixed set of forensic cues, so a detector that works well for one generator family may fail on another. We introduce FACT (Forensic Agent with Compiled Tool-use Trajectories), which learns an image-conditioned tool-use policy for forensic analysis. Instead of applying a fixed detector, FACT decides which forensic tools to call, interprets the returned evidence, and stops when sufficient evidence has been collected. FACT follows an Evolve-Distill-Refine pipeline: it evolves an execution-verified forensic skill, compiles the skill into action-observation tool-use trajectories, distills them into a compact agent, and refines the policy with cost-aware GRPO. Across two internal and four public benchmarks, FACT achieves the best performance among all compared methods, including on recent generators held out from all FACT training stages, deepfakes, and manipulated images.

Introduction

The visual boundary between photographs and AI-generated images is rapidly disappearing. Modern generators reproduce coherent geometry, realistic materials, legible text, and plausible lighting, leaving few artifacts that casual inspection can reliably identify. Figure 1 turns this ambiguity into a simple question: which images are synthetic? The same ambiguity also challenges automatic detection. As image generators become more realistic and diverse, a cue that separates real and synthetic images for one generator family may not remain reliable for another. Image authentication is therefore an open-world problem.

This open-world setting is difficult for a single fixed detector because existing methods rely on different forensic priors: CNN-synthesis artifacts (Wang et al. 2020); representations from large pretrained vision-language models (Ojha,

Figure

Figure 1: Can you tell which images are real and which are generated by AI? 1^{1}

Li, and Lee 2023); generator-diverse training across thousands of models in Community Forensics (Park and Owens 2024); high-level semantic and high-/low-frequency features in AIDE (Yan et al. 2025a); camera-derived photographic priors in SDAIE (Zhong et al. 2025); multimodal detection, localization, and explanation in SIDA (Huang et al. 2024); and pattern-aware planning and self-reflection in Veritas (Tan et al. 2025). These cues are useful, but their reliability varies across generator families. In our balanced evaluation in Table 1, Veritas, AIDE, Community Forensics, and SDAIE each lead on different generator subsets. A fixed detector therefore commits to one evidence profile before seeing the image. The central question is instead: which evidence should be acquired for this particular image?

We address this image-conditioned evidence-acquisition problem with an agentic formulation: the model must decide which evidence to acquire, interpret returned observations, and stop when the evidence is sufficient. The most recent published agentic framework, UniShield, takes an initial step by routing each image to a predicted forgery domain and expert type before executing the selected detector (Huang et al. 2025). However, this remains closer to one-step routing than to a full forensic investigation. In open-world AI-generated image detection, useful evidence can vary from image to image even within the same broad forgery category. A forensic agent should therefore update its decision as new observations arrive and determine whether additional evidence is

∗^{*}Corresponding author.

Copyright © 2027, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

1^{1}In Fig. 1, the first two images are AI-generated, while the last two are real photographs.

MethodNanoNanoGPT-SD3.5SD3Z-Image
BananaProImage-1LMTurbo
VERITAS0.740.750.760.500.640.35
SIDA0.700.610.510.530.580.57
SDAIE0.640.540.360.690.701.00
AIDE0.520.840.550.490.500.98
Comm.0.670.560.590.520.830.71

Table 1: Detector specialization across recent generators. Each column is a balanced real-versus-synthetic subset. “Comm.” denotes Community Forensics; L and M denote Large and Medium. Darker cells indicate higher accuracy, and bold values mark the best detector in each subset.

still needed.

The limitation of one-step routing suggests that a forensic agent must do more than choose a detector once. A deployable agent must satisfy three requirements. First, it needs procedural knowledge: image-level labels do not specify how to investigate, which evidence to acquire, or how to reconcile conflicting cues. Second, it needs specialization: a general-purpose model can discover procedures, but deployment requires a compact agent specialized for forensic tool use and evidence-conditioned decisions. Third, it needs budget-aware stopping: the agent must decide when another tool call justifies its cost and when further evidence may become redundant or misleading under changing image quality and disagreement among heterogeneous forensic experts.

In this paper, we introduce FACT (Forensic Agent with Compiled Tool-use Trajectories), an Evolve–Distill–Refine pipeline for learning a deployable forensic investigation policy. To acquire procedural knowledge, Evolve represents forensic expertise as an explicit skill and improves it through a propose–execute–verify loop, accepting a revision only when rerunning the full tool interaction improves measured behavior. To achieve specialization, Distill uses the verified skill to guide a strong teacher in the real tool environment, compiling the procedure into action–observation trajectories and behaviorally cloning them into a compact agent. To enable budget-aware stopping, Refine applies cost-aware GRPO after distillation, rewarding final correctness while penalizing unnecessary evidence acquisition. At deployment, FACT uses only the compact forensic agent. For each test image, the agent decides whether to call a forensic tool, use the returned observation, or stop with a final real/AI decision. The skill-evolution components and the general model are used only during training.

We evaluate FACT on two balanced internal benchmarks and four public benchmarks. STD3K evaluates robustness under source diversity, containing 3,200 images from 21 generator/source groups and multiple real-image sources; the final refined FACT checkpoint achieves 91.40%. NewGen-900 evaluates generalization to nine recent generator families held out from all FACT training stages; FACT obtains 82.44% without generator-specific fine-tuning.

On public benchmarks, FACT obtains 87.53% on Chameleon (Yan et al. 2025a), 88.35% balanced accuracy

on LOKI (Ye et al. 2025), 98.77% on AIGCDetectionBenchmark (Zhong et al. 2023), and 94.44% on HydraFake (Tan et al. 2025). Across all six benchmarks, FACT achieves the best performance among the methods compared under each corresponding protocol, covering visually challenging synthetic images, recent generators held out from all FACT training stages, and broader forgery settings involving deepfakes and manipulated images.

Our contributions are threefold:

  • We formulate AI-generated image detection as an image-conditioned tool-use problem. Rather than applying a fixed detector, the agent selectively acquires signal-level and model-based forensic evidence, updates its decision from returned observations, and stops when the evidence is sufficient.

  • We propose an Evolve–Distill–Refine pipeline that learns such a forensic agent from image-level labels. It evolves an executable forensic skill, compiles the skill into action–observation tool-use trajectories, distills them into a specialized policy, and further optimizes tool selection and stopping with cost-aware GRPO.

  • We demonstrate strong performance and broad applicability across six benchmarks. FACT consistently outperforms its constituent tools, majority-vote ensembling, and recent detector baselines, while generalizing to recent generators held out from all FACT training stages and remaining effective on deepfakes and manipulated images.

References (42)