Fusing Global and Local Features for Generalized AI-Synthesized Image Detection

Yan Ju, Shan Jia, Lipeng Ke, Hongfei Xue, Koki Nagano, Siwei Lyu

Introduction

As Generative Adversarial Networks (GANs) and DeepFake technologies continue to evolve, the boundary between authentic and AI-synthesized imagery has blurred to the point of human indistinguishability. While existing detection algorithms perform exceptionally well in "closed-world" scenarios—where the testing data originates from the same generative model used during training—they frequently collapse in "open-world" environments. In these real-world settings, detectors encounter images from unknown architectures, varying resolutions, or partial manipulations.

The fundamental challenge lies in the nature of the features being extracted. Most current methods rely either on global structural features, which may overlook subtle pixel-level anomalies, or local patches, which fail to capture overall structural inconsistencies. This paper proposes a novel two-branch neural network designed to bridge this gap by fusing global structure with high-resolution local artifacts through an automated attention mechanism.

Methodology: The Two-Branch Framework

The authors introduce a framework that captures complementary information through two distinct pathways, ensuring that both the "big picture" and the "microscopic fingerprints" are analyzed.

1. Global Branch

The global branch utilizes a standard ResNet50 backbone to extract spatial and structural features from the entire image. To process the image through the network, it is resized to a standard input dimension. While resizing is necessary for computational efficiency, it often destroys high-frequency artifacts, which is why the global branch is supplemented by a local counterpart.

2. Local Branch with Patch Selection Module (PSM)

The core innovation of this research is the Patch Selection Module (PSM). Rather than selecting random patches or requiring manual annotation of manipulated areas, the PSM leverages activation maps from the global branch. These maps identify "informative" regions—areas where the model detects high energy or potential artifacts. To ensure diversity and avoid redundancy, the module employs Non-Maximum Suppression (NMS) to select a set of distinct, high-resolution patches directly from the original, unresized image.

3. Attention-based Feature Fusion Module (AFFM)

Once the global and local embeddings are extracted, they are integrated using a multi-head attention mechanism similar to those found in Transformers. This module learns the correlations between global structural cues and local textural anomalies, effectively weighting the features that are most indicative of forgery. This fusion allows the model to make a final classification based on a holistic understanding of the image.

Experimental Setup and Generalization

To prove the model's robustness, the researchers focused on a "one-to-many" generalization test. The model was trained on a single dataset consisting of 362,000 real images (LSUN) and 362,000 fake images generated by ProGAN.

Testing was conducted on a massive, diverse suite of 128,424 images from 19 different models, including:

  • GAN Architectures: StyleGAN (v1, v2, and v3), CycleGAN, BigGAN, and StarGAN.
  • DeepFakes: FaceForensics++ and Celeb-DF.
  • Other Synthesis: Vision Transformers, Perceptual Loss models, and low-level vision synthesis.

This rigorous setup tests whether the model has learned the fundamental essence of "AI-synthesis" rather than simply memorizing the specific artifacts of the ProGAN training set.

Key Results

The proposed method, referred to as Our_PSM, demonstrated significant improvements over state-of-the-art baselines:

  • Superior Generalization: The model achieved a Mean Average Precision (mAP) of 91.7% across all 19 unseen models, significantly outperforming standard CNN-based augmentation methods (86.3%).
  • Open-World Performance: When all test images were aggregated into a single large dataset, the model reached a 96.9% Global AP.
  • Zero-Shot Success: The model successfully detected images from architectures it had never encountered, such as StyleGAN3 and various DeepFake models, confirming the effectiveness of the global-local fusion.
  • Robustness to Degradation: The detector maintained high accuracy even when images were subjected to Gaussian blurring or JPEG compression, which typically obscure the digital signatures of AI generation.

Discussion and Future Work

The research highlights that while global features are essential for structural integrity, local patches are superior at catching "checkerboard" artifacts or frequency anomalies typical of GAN upsampling layers. By bypassing the destructive nature of resizing through the local branch, the model preserves critical evidence.

However, limitations remain. The authors note that resizing in the global branch can still hinder the detection of certain high-resolution artifacts. Additionally, the current Patch Selection Module is not yet fully differentiable, representing an opportunity for future optimization to allow for end-to-end training. As generative models shift toward Diffusion-based architectures, the nature of local artifacts may change, necessitating continued research into diverse training strategies to maintain detection efficacy.

Summary updated

BibTeX
@inproceedings{ju2022fusing,
  author = {Yan Ju and Shan Jia and Lipeng Ke and Hongfei Xue and Koki Nagano and Siwei Lyu},
  title = {{Fusing Global and Local Features for Generalized AI-Synthesized Image Detection}},
  booktitle = {ICIP},
  year = {2022},
  url = {https://openreview.net/forum?id=XRsUagG58_3},
}
Figure