Table of Contents
Fetching ...

Dual Frequency Branch Framework with Reconstructed Sliding Windows Attention for AI-Generated Image Detection

Jiazhen Yan, Ziqiang Li, Fan Wang, Ziwen He, Zhangjie Fu

TL;DR

This work tackles the challenge of generalizing AI-generated image detection across diverse generators by addressing two core shortcomings: limited sensitivity to intra-local element dependencies and reliance on a single frequency domain. It introduces a reconstructed sliding window attention mechanism to capture fine-grained local artifacts and a dual-frequency framework combining four DWT subbands with FFT phase to enrich local features from multiple perspectives. The method achieves strong cross-model performance across 65 generative models (GANs and diffusion) and sets new baselines on multiple datasets, including GANGen-Detection, DiffusionForensics, UniversalFakeDetect, GenImage, and AIGIBench, with notable improvements in accuracy and robustness to perturbations. Extensive ablation and visualization studies confirm the complementary roles of the DWT tiling and FFT phase branches and the efficacy of the RSWAttention in modeling local dependencies, highlighting practical gains for robust AI-generated image detection in real-world scenarios.

Abstract

The rapid advancement of Generative Adversarial Networks (GANs) and diffusion models has enabled the creation of highly realistic synthetic images, presenting significant societal risks, such as misinformation and deception. As a result, detecting AI-generated images has emerged as a critical challenge. Existing researches emphasize extracting fine-grained features to enhance detector generalization, yet they often lack consideration for the importance and interdependencies of internal elements within local regions and are limited to a single frequency domain, hindering the capture of general forgery traces. To overcome the aforementioned limitations, we first utilize a sliding window to restrict the attention mechanism to a local window, and reconstruct the features within the window to model the relationships between neighboring internal elements within the local region. Then, we design a dual frequency domain branch framework consisting of four frequency domain subbands of DWT and the phase part of FFT to enrich the extraction of local forgery features from different perspectives. Through feature enrichment of dual frequency domain branches and fine-grained feature extraction of reconstruction sliding window attention, our method achieves superior generalization detection capabilities on both GAN and diffusion model-based generative images. Evaluated on diverse datasets comprising images from 65 distinct generative models, our approach achieves a 2.13\% improvement in detection accuracy over state-of-the-art methods.

Dual Frequency Branch Framework with Reconstructed Sliding Windows Attention for AI-Generated Image Detection

TL;DR

This work tackles the challenge of generalizing AI-generated image detection across diverse generators by addressing two core shortcomings: limited sensitivity to intra-local element dependencies and reliance on a single frequency domain. It introduces a reconstructed sliding window attention mechanism to capture fine-grained local artifacts and a dual-frequency framework combining four DWT subbands with FFT phase to enrich local features from multiple perspectives. The method achieves strong cross-model performance across 65 generative models (GANs and diffusion) and sets new baselines on multiple datasets, including GANGen-Detection, DiffusionForensics, UniversalFakeDetect, GenImage, and AIGIBench, with notable improvements in accuracy and robustness to perturbations. Extensive ablation and visualization studies confirm the complementary roles of the DWT tiling and FFT phase branches and the efficacy of the RSWAttention in modeling local dependencies, highlighting practical gains for robust AI-generated image detection in real-world scenarios.

Abstract

The rapid advancement of Generative Adversarial Networks (GANs) and diffusion models has enabled the creation of highly realistic synthetic images, presenting significant societal risks, such as misinformation and deception. As a result, detecting AI-generated images has emerged as a critical challenge. Existing researches emphasize extracting fine-grained features to enhance detector generalization, yet they often lack consideration for the importance and interdependencies of internal elements within local regions and are limited to a single frequency domain, hindering the capture of general forgery traces. To overcome the aforementioned limitations, we first utilize a sliding window to restrict the attention mechanism to a local window, and reconstruct the features within the window to model the relationships between neighboring internal elements within the local region. Then, we design a dual frequency domain branch framework consisting of four frequency domain subbands of DWT and the phase part of FFT to enrich the extraction of local forgery features from different perspectives. Through feature enrichment of dual frequency domain branches and fine-grained feature extraction of reconstruction sliding window attention, our method achieves superior generalization detection capabilities on both GAN and diffusion model-based generative images. Evaluated on diverse datasets comprising images from 65 distinct generative models, our approach achieves a 2.13\% improvement in detection accuracy over state-of-the-art methods.
Paper Structure (21 sections, 6 equations, 5 figures, 14 tables)

This paper contains 21 sections, 6 equations, 5 figures, 14 tables.

Figures (5)

  • Figure 1: Average Predicted Fake Probability in the Phase-Swapping Experiment. A smaller value of the predicted fake probability indicates that the model is more likely to classify the image as real. The experimental results show that detectors generally consider images combining real phase and fake amplitude to be more realistic, while images combining fake phase and real amplitude are judged as fake, indicating that the phase component contains stronger forgery-related artifacts than the amplitude, where the amplitude mainly reflects color and brightness.
  • Figure 2: Architecture of Our Method for Generalizable AI-Generated Image Detection. Specifically, we first design a reconstructed sliding window attention mechanism, which reconstructs the features within the sliding window and limits the attention mechanism to the local window range, forcing the attention to extract fine-grained forgery features while modeling the importance and dependencies between internal elements in the local area. At the same time, we designed a dual frequency branch framework, which facilitates the model to extract richer artifact traces from multiple perspectives by using DWT-based window tiling and the phase part of FFT. The final extracted features are passed into a classifier.
  • Figure 3: After DWT, sliding window tiling is used to tile the features of each channel into a shape of $4 \times (h \times w)$. In the subsequent LoAttention module, $4 \times 4$ features are extracted as shown in the blue box, which not only obtain features from the different frequency bands, but also retain the implicit relationships between adjacent elements.
  • Figure 4: Logit Distributions of Extracted Forgery Features. We compare the state of the art NRP tan2024rethinking and our method, both tuned with 4-class ProGAN karras2017progressive data. A total of four testing GANs and diffusion models are considered, including ProGAN karras2017progressive, R3GAN huang2024gan, BLIP li2022blip and VQDM gu2022vector, each randomly sampled 1k real and 1k fake images.
  • Figure 5: Visualization after feature extraction from the two branches. The DWT-based Window Tiling mainly strengthens local edges and fine textures around object boundaries, whereas the FFT-based phase complement produces large-scale patch-like residual patterns, revealing non-local, generator-specific structural.