Beyond the Last Layer: Global Inter-Layer Aggregation for AI-Generated Image Detection
The rapid development of generative models has made AI-generated images increasingly close to real images. It has also brought several challenges to detectors, including rapid generator updates, large changes in data distribution, and limited cross-dataset generalization. Many existing methods based on pretrained vision encoders primarily use the global representation from the last layer, potentially leaving useful information from intermediate layers underexplored. To address this issue, we propose Global Inter-Layer Aggregation (GILA). GILA extracts global representations from different depths of a frozen encoder, models interactions among layer representations through inter-layer self-attention, and adaptively aggregates the resulting contextualized representations. The method is not tied to a single pretraining objective and does not require fine-tuning the pretrained encoder. We evaluated GILA on three vision backbones with different pretraining objectives, ten seen generators, and three external datasets. The experimental results show that GILA makes better use of multi-layer information in pretrained encoders and improves detection performance and cross-dataset generalization.