CVPR 2026
Jianwei Fei*, Yunshu Dai, Xiaoyu Zhou, Zhihua Xia, Alessandro Piva
University of Florence · Sun Yat-sen University · Jinan University
- Training code
- Pretrained checkpoints
- Additional documentation
- Evaluation code
The Dynamic-Architecture Image Reconstructor (DAIR) used in this project is released as an independent repository:
https://github.com/jumpycat/DAIR
Please refer to the DAIR repository for details regarding the simulator implementation.
gensign_extractor is a lightweight fully convolutional network for directly extracting (predicting) a hidden noise pattern. The model is based on DenoisingFCNWithSkip.
train_gensign.pyTraining script. Uses the pretrained DAIR to computegt_noise = imgs - recon_imgsas the supervision signal, and trainsgensign_extractor(referred to asnoiserin the script) to fit this noise.gensign_extractor.pyModel definition (DenoisingFCNWithSkip), i.e., the network architecture of the signature extractor.extract_gensign.pyInference script. Loads the trained extractor weights, reads all images in a given folder, runs forward inference on each, takes the fractional part of the output as the final extracted signature noise, and saves it as an image.Pretrained Weightsgensign_extractor weights (Google Drive). After downloading, place it anywhere and pass its path via--checkpoint.
Training
python train_gensign.py \
--train_dir /path/to/train_images \
--resume /path/to/encoder_decoder_checkpoint.pthExtracting Signature Noise
python extract_gensign.py \
--input_dir /path/to/images \
--output_dir /path/to/output \
--checkpoint /path/to/gensign_extractor.pthThe extracted results are saved in output_dir as <original_filename>_noise.png, with one extracted noise image per input image.
We provide checkpoints trained on different datasets:
| Training Data | Download |
|---|---|
| GenImage-SD1.4 | Link |
| ProGAN (4-class) | Link |
| ProGAN (20-class) | Link |
The Dual Detector is the core classification framework that fuses semantic features and generative signature features to detect AI-generated images. It employs a two-stream architecture:
- Stream 1 (Semantic): A pre-trained CLIP vision model fine-tuned using LoRA.
- Stream 2 (Signature): A frozen GenSign Extractor (
noiser) coupled with an EfficientNet backbone to process generative noise residuals.
During training, the model dynamically leverages the DAIR Simulator to perform targeted data augmentation, improving generalization across different generative models.
dual_model.py: Defines theDualStreamModelarchitecture, LoRA injection, and the feature fusion head.datasets.py: Modularized dataset classes and loaders handling real/fake label mapping and transformations.eval_utils.py&utils.py: Modular evaluation logic for computing Accuracy, AUC, and AP, alongside utility functions.train_genimg.py: Training pipeline tailored for the GenImage dataset structure.train_progan.py: Training pipeline tailored for the ProGAN dataset structure (e.g., CNNDetection) with multi-dataset evaluation.
To train the Dual Detector, you must provide the pre-trained checkpoints for both the DAIR simulator (for data augmentation) and the GenSign Extractor (as the frozen feature extractor for Stream 2).
Use train_dual_detector_progan_with_aug.py to enable image distortion augmentation.
python train_genimg.py \
--train_dir /path/to/GenImage/train \
--val_dir /path/to/GenImage/val \
--eval_datasets_root /path/to/GenImage/valdata \
--ae_resume /path/to/dair_simulator.pth \
--noiser_resume /path/to/gensign_extractor.pth \
--stream1_model openai/clip-vit-large-patch14 \
--stream2_model efficientnet-b0 \
--aug_target all \
--aug_prob 0.2 \
--batch_size 8
python train_progan.py \
--train_dir /path/to/progan_train \
--train_subfolders car cat chair horse \
--ae_resume /path/to/dair_simulator.pth \
--noiser_resume /path/to/gensign_extractor.pth \
--stream1_model openai/clip-vit-large-patch14 \
--stream2_model efficientnet-b0 \
--aug_target all \
--aug_prob 0.2 \
--batch_size 8
- Using
1/0as the label for fake images can lead to asymmetric results. We recommend using1as the label for real images. - Using the default threshold of
0.5may produce results inconsistent with AUC and AP. We mainly report AP and AUC; computing accuracy (Acc) may require additional threshold calibration, as0.5may not be the optimal choice.
@inproceedings{fei2026enabling,
title={Enabling Supervised Learning of Generative Signatures for Generalized AI-Generated Images Detection},
author={Fei, Jianwei and Dai, Yunshu and Zhou, Xiaoyu and Xia, Zhihua and Piva, Alessandro},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={14084--14094},
year={2026}
}Jianwei Fei: fei_jianwei@163.com