defense 2025

Towards Generalizable AI-Generated Image Detection via Image-Adaptive Prompt Learning

Yiheng Li 1,2, Zichang Tan 3, Guoqing Xu 1,2, Zhen Lei 1,2,2, Xu Zhou 3, Yang Yang 1,2

0 citations

α

Published on arXiv

2508.01603

Output Integrity Attack

OWASP ML Top 10 — ML09

Key Finding

Achieves state-of-the-art mean accuracies of 95.61% on UniversalFakeDetect and 96.7% on GenImage for cross-generator AI-generated image detection.

IAPL (Image-Adaptive Prompt Learning)

Novel technique introduced


In AI-generated image detection, current cutting-edge methods typically adapt pre-trained foundation models through partial-parameter fine-tuning. However, these approaches often struggle to generalize to forgeries from unseen generators, as the fine-tuned models capture only limited patterns from training data and fail to reflect the evolving traits of new ones. To overcome this limitation, we propose Image-Adaptive Prompt Learning (IAPL), a novel paradigm that dynamically adjusts the prompts fed into the encoder according to each testing image, rather than fixing them after training. This design significantly enhances robustness and adaptability to diverse forged images. The dynamic prompts integrate conditional information with test-time adaptive tokens through a lightweight learnable scaling factor. The conditional information is produced by a Conditional Information Learner, which leverages CNN-based feature extractors to model both forgery-specific and general conditions. The test-time adaptive tokens are optimized during inference on a single sample by enforcing prediction consistency across multiple views, ensuring that the parameters align with the current image. For the final decision, the optimal input with the highest prediction confidence is selected. Extensive experiments show that IAPL achieves state-of-the-art performance, with mean accuracies of 95.61% and 96.7% on the widely used UniversalFakeDetect and GenImage datasets, respectively. Codes and weights will be released on https://github.com/liyih/IAPL.


Key Contributions

  • Image-Adaptive Prompt Learning (IAPL) paradigm that dynamically adjusts encoder prompts per test image rather than fixing them post-training, improving generalization to unseen generators
  • Conditional Information Learner using CNN-based feature extractors to model both forgery-specific and general conditions for dynamic prompt generation
  • Test-time adaptive token optimization that enforces prediction consistency across multiple views of a single sample, selecting the highest-confidence input for the final decision

🛡️ Threat Analysis

Output Integrity Attack

Directly addresses AI-generated image detection (synthetic content authenticity) — a core ML09 concern. Proposes a novel detection architecture rather than applying existing methods, making this an original forensic technique contribution.


Details

Domains
vision
Model Types
cnntransformer
Threat Tags
inference_time
Datasets
UniversalFakeDetectGenImage
Applications
ai-generated image detectiondeepfake detection