ForgeLens is a data-efficient, feature-guided CLIP-ViT framework for detecting AI-generated images with strong generalization to unseen forgery techniques. It guides the frozen CLIP-ViT to focus on forgery-relevant information within the general-purpose features it extracts, addressing a key limitation of prior frozen-network-based methods, which often retain excessive forgery-irrelevant content. ForgeLens introduces two simple and lightweight modules—WSGM and FAFormer—to guide the model’s attention toward forgery-specific cues. With only 1% of the training data, ForgeLens outperforms existing forgery detection methods.
To ensure reproducibility and avoid compatibility issues, we recommend setting up the required environment by installing the necessary packages using the following command:
pip install -r requirements.txt
Training dataset we utilize ProGAN training set to train our network following CNNDetection.
Evaluation dataset In order to fully evaluate ForgeLens, we conducted tests on the UniversalFakeDetect dataset.
🔽 Preprocessed Version (Recommended) You can also directly download our pre-split dataset, which includes three training settings:
- 1️⃣Setting-1 (1,600 samples)
- 2️⃣Setting-2 (50% of the full training set)
- 3️⃣Setting-3 (100% of the full training set)
👉 📁 Download Link.
We adopt a binary classification setting for all datasets, where:
- 0: real image
- 1: fake/generated image
We use a subset of ProGAN data for training:
Training/
├── car/
│ ├── 0_real/ # Real images
│ └── 1_fake/ # ProGAN-generated fake images
├── cat/
│ ├── 0_real/
│ └── 1_fake/
├── chair/
│ ├── 0_real/
│ └── 1_fake/
└── horse/
├── 0_real/
└── 1_fake/
Our method is evaluated on UniversalFakeDetect, using the same folder structure as the training set.
You can manage the hyperparameters in ./options/options.py.
You can perform training using the following command:
bash train_setting_1.sh # reproduce the results of training setting 1
bash train_setting_2.sh
bash train_setting_3.sh
We provide pretrained weights corresponding to the results reported in our paper.
| Training Setting | Description | Google Drive Link | Baidu Netdisk Link |
|---|---|---|---|
training_setting_1 |
1,600 samples (Recommended) | Download | Download |
training_setting_2 |
50% of full training data | Download | Download |
training_setting_3 |
100% of full training data | Download | Download |
To reproduce the results of Table 1 and Table 2 in our paper, first download the pretrained weights, then run the evaluation script as follows:
bash evaluate.shDownload the GenImage dataset from the official source or download our pre-split dataset.
First download the pretrained weights from Google Drive of Baidu Netdisk, then run the evaluation script as follows:
bash evaluate_GenImage.shYou can perform training using the following command:
bash train_GenImage.sh
If you find our project helpful, please feel free to leave a ⭐ and cite our paper:
@InProceedings{Chen_2025_ICCV,
author = {Chen, Yingjian and Zhang, Lei and Niu, Yakun},
title = {ForgeLens: Data-Efficient Forgery Focus for Generalizable Forgery Image Detection},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
month = {October},
year = {2025},
pages = {16270-16280}
}