Jiazhen Yan1, Ziqiang Li1, Fan Wang2, Boyu Wang1, Ziwen He1, Zhangjie Fu1β‘
β‘Corresponding author
1School of Computer Science, Nanjing University of Information Science and Technology 2University of Macau
- [2026-05-01]πππ DGS-Net is accepted by ICML 2026 Spotlight
- Inference code
- Pretrained models
- Training code
conda create -n DGS-Net -y python=3.10
conda activate DGS-Net
pip3 install torch torchvision
pip install -r requirements.txt
| Datasets | Paper | Url |
|---|---|---|
| UniversalFakeDetect | Towards Universal Fake Image Detectors that Generalize Across Generative Models (CVPR 2023) | Google Drive |
| AIGCDetectBench | PatchCraft: Exploring Texture Patch for Efficient AI-generated Image Detection | ModelScope |
| AIGIBench | Is Artificial Intelligence Generated Image Detection a Solved Problem? (NeurIPS 2025) | Huggingface/Baidu Netdisk |
Place them under checkpoints/:
Google Drive
Of course, you need to change [DetectionTests] in test.py when testing.
We also present our inference results in log_test.log.
[Note]: Following re-inference, we observed an approximately 0.1 discrepancy relative to the original result. The file log_test.log contains the results obtained after re-inference.
python test.py --model_path ./checkpoints/model_epoch_step2.pth
The training set uses ProGAN & SDv1.4 from AIGIBench (Is Artificial Intelligence Generated Image Detection a Solved Problem?, NeurIPS 2025) Huggingface/Baidu Netdisk.
stage 1: python train.py --name 5class-car-cat-chair-horse-sdv1.4 --dataroot /home/HDD/yjz/dataset/AIGIBench/train --classes car,cat,chair,horse,sdv1.4 --train_stage 0 --niter 3
stage 2: python train.py --name 5class-car-cat-chair-horse-sdv1.4 --dataroot /home/HDD/yjz/dataset/AIGIBench/train --classes car,cat,chair,horse,sdv1.4 --train_stage 1 --niter 1
During the stage 2 of training, it is necessary to change the model_path of stage 1 in models/clip_models: self.clip_model_frozen.load_state_dict(torch.load("/path/checkpoints/model_epoch_stage1.pth"), strict=True)
@article{yan2025dgs,
title={DGS-Net: Distillation-Guided Gradient Surgery for CLIP Fine-Tuning in AI-Generated Image Detection},
author={Yan, Jiazhen and Li, Ziqiang and Wang, Fan and Wang, Boyu and He, Ziwen and Fu, Zhangjie},
journal={arXiv preprint arXiv:2511.13108},
year={2025}
}
If you have any question about this project, please feel free to contact 247918horizon@gmail.com