NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

All Patches Matter, More Patches Better: Enhance AI-Generated Image Detection via Panoptic Patch Learning

Zheng Yang, Ruoxin Chen, Zhiyuan Yan, Ke-Yue Zhang, Xinghe Fu, Shuang Wu, Xiujun Shu, Taiping Yao, Junchi Yan, Shouhong Ding, Xi Li · OpenReview

Abstract

The exponential growth of AI-generated images (AIGIs) underscores the urgent need for robust and generalizable detection methods. This paper identifies a "Few-Patch Bias" in current detectors, which act as "Lazy Learners" by fixating on a minority of conspicuous artifacts. We propose the Panoptic Patch Learning (PPL) framework, built on two principles: (1) All Patches Matter, as synthetic artifacts are distributed across the entire image due to the uniform generation process; and (2) More Patches Better, as leveraging distributed evidence improves generalization. PPL employs Random Patch Replacement and Patch-wise Contrastive Learning to force models to utilize artifacts across all regions. Extensive experiments show PPL achieves state-of-the-art performance, reaching 97.2% accuracy on the GenImage benchmark.

The "Lazy Learner" Problem

Detecting AIGIs is a high-stakes challenge. As generative models like Stable Diffusion and Midjourney evolve, detectors trained on older data often fail to generalize to newer versions. The authors identify Few-Patch Bias as a root cause: most detectors find a few conspicuous artifacts (like a specific texture or warped edge) in a tiny portion of the image and base their entire decision on those. If a new generative model fixes those specific artifacts, the detector becomes useless.

However, due to the uniform nature of generative math, synthetic traces are actually distributed across every single patch of an image. The challenge is forcing a neural network to stop taking shortcuts and instead look at the "panoptic" (whole) distribution of these artifacts.

Panoptic Patch Learning (PPL)

The PPL framework addresses this bias through two primary mechanisms:

  1. Random Patch Replacement (RPR): This data augmentation technique randomly substitutes synthetic patches with real counterparts during training. If a model relies solely on a "dominant" patch to identify a fake, and that patch is replaced, the model is forced to find artifacts in remaining, underutilized regions.
  2. Patch-wise Contrastive Learning (PCL): PCL enforces a loss at the patch level, ensuring that the feature embeddings of all synthetic patches are pulled closer together while being pushed away from real patches. This ensures a consistent discriminative capability regardless of where the patch appears in the frame.

Experimental Results

The PPL framework was evaluated across several rigorous benchmarks, demonstrating significant improvements in both generalization and robustness.

Visualization of attention maps and performance comparison across different settings.

Superior Generalization

On the GenImage benchmark (Setting-I), which tests cross-generator generalization (e.g., training on Stable Diffusion and testing on ADM or GLIDE), PPL reached 97.2% mean accuracy, significantly outperforming previous methods like UnivFD (79.9%) and C2P-CLIP (95.8%).

Performance on Hard Cases

In the Chameleon setting (Setting-II), which features high-quality, human-imperceptible synthetic images, most detectors struggle to exceed 60% accuracy. PPL achieved a state-of-the-art 70.5% accuracy, demonstrating its ability to detect subtle artifacts that others miss.

Robustness to Masking

The authors used Total Direct Effect (TDE) analysis to prove that PPL successfully shifts model attention from a few "lucky" patches to a uniform distribution across the whole image. When subjected to random masking, PPL showed only a 5% decline in recall, whereas naively trained models saw accuracy plummet by nearly 19% when key patches were removed.

Conclusion

By moving beyond the "Lazy Learner" trap, Panoptic Patch Learning ensures that AI-generated image detectors are more robust and generalizable. By treating every patch as a source of forensic evidence, PPL provides a more reliable defense against the rapidly evolving landscape of generative AI. Future work will explore scaling these principles to even larger foundation models and addressing increasingly subtle, "in-the-wild" synthetic artifacts.

Summary updated

BibTeX
@inproceedings{yang2026all,
  author = {Zheng Yang and Ruoxin Chen and Zhiyuan Yan and Ke-Yue Zhang and Xinghe Fu and Shuang Wu and Xiujun Shu and Taiping Yao and Junchi Yan and Shouhong Ding and Xi Li},
  title = {{All Patches Matter, More Patches Better: Enhance AI-Generated Image Detection via Panoptic Patch Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=ob7PJs8kPU},
}
Figure