Improve model card: Add description, links, pipeline tag, and usage example
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: image-classification
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Scaling Up AI-Generated Image Detection with Generator-Aware Prototypes
|
| 7 |
+
|
| 8 |
+
This repository contains the model presented in the paper [Scaling Up AI-Generated Image Detection via Generator-Aware Prototypes](https://huggingface.co/papers/2512.12982).
|
| 9 |
+
|
| 10 |
+
GAPL proposes a novel framework to scale up AI-generated image (AIGI) detection by addressing data heterogeneity and model bottlenecks. It learns canonical forgery prototypes and employs a two-stage training scheme with Low-Rank Adaptation to achieve state-of-the-art performance across various GAN and diffusion-based generators.
|
| 11 |
+
|
| 12 |
+
For more details, including installation and training, please refer to the [official GitHub repository](https://github.com/UltraCapture/GAPL).
|
| 13 |
+
|
| 14 |
+
## Motivation
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+
<p align="center"><em>Figure 1: Overview of our proposed Generator-Aware Prototype Learning (GAPL) framework.</em></p>
|
| 18 |
+
|
| 19 |
+
## Quick Inference
|
| 20 |
+
|
| 21 |
+
To run inference on a single image to detect whether it is **Real** or **Fake**, use the following Python code:
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
python inference.py \
|
| 25 |
+
--model_path pretrained/checkpoint.pt \
|
| 26 |
+
--image_path assets/test_image.jpg \
|
| 27 |
+
--device cuda
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
**Output Example:**
|
| 31 |
+
|
| 32 |
+
```text
|
| 33 |
+
[INFO] Loading model from pretrained/checkpoint.pt...
|
| 34 |
+
[RESULT] Image: assets/test_image.jpg
|
| 35 |
+
-> Prediction: Fake (AI-Generated)
|
| 36 |
+
-> Confidence: 99.8%
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Citation
|
| 40 |
+
|
| 41 |
+
If you find our work useful in your research, please consider citing:
|
| 42 |
+
|
| 43 |
+
```bibtex
|
| 44 |
+
@article{qin2025Scaling,
|
| 45 |
+
title={Scaling Up AI-Generated Image Detection with Generator-Aware Prototypes},
|
| 46 |
+
author={Qin, Ziheng and Ji, Yuheng and Tao, Renshuai and Tian, Yuxuan and Liu, Yuyang and Wang, Yipu and Zheng, Xiaolong},
|
| 47 |
+
journal={arXiv preprint arXiv:2512.12982},
|
| 48 |
+
year={2025}
|
| 49 |
+
}
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Acknowledgements
|
| 53 |
+
|
| 54 |
+
Our code is developed based on the following excellent open-source repositories. We appreciate their excellent work and contributions to the community:
|
| 55 |
+
|
| 56 |
+
- **[CNNDetection](https://github.com/peterwang512/CNNDetection)**
|
| 57 |
+
- **[Community Forensics](https://github.com/JeongsooP/Community-Forensics)** We leverage the dataset and borrow some code from this codebase.
|