Downloads · 30 days
21
23% of all-time downloads
NTX88666/Qwen2.5-VL-3B-FakeBench-LoRA
Qwen2.5-VL-3B-FakeBench-LoRA is a image-text-to-text model from NTX88666. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for peft.
This repository contains a LoRA adapter for Qwen2.5-VL-3B-Instruct fine-tuned for binary AI-generated image detection.
Downloads · 30 days
21
23% of all-time downloads
All-time downloads
91
Public
Repo size
160 MB
Likes
1
Public
Click a slice to open those files.
.safetensors149 MB · 93%
From the Hugging Face model README
This repository contains a LoRA adapter for Qwen2.5-VL-3B-Instruct fine-tuned for binary AI-generated image detection.
The adapter predicts one of two labels:
REALAI-GENERATEDThe adapter was developed as part of the project Explainable AI-Generated Image Detection with Vision-Language Models: Reasoning Strategies and Parameter-Efficient Fine-tuning.
Qwen/Qwen2.5-VL-3B-InstructThe fine-tuning experiment used a FakeBench-derived split:
The fixed 500-image test set was excluded from both training and validation.
The original dataset is not distributed with this model repository. Users should consult the original FakeBench dataset source and its terms before using or redistributing dataset content.
1e-4q_projk_projv_projo_projgate_projup_projdown_projTraining was performed on a single NVIDIA RTX PRO 6000 Blackwell 96GB GPU.
| Epoch | Train Loss | Validation Loss | Time (min) |
|---|---|---|---|
| 1 | 0.02117 | 0.002447 | 25.20 |
| 2 | 0.001283 | 0.002103 | 36.68 |
| 3 | 0.000268 | 0.002190 | 36.47 |
Epoch 2 achieved the lowest validation loss and was saved as the best_adapter.
For the controlled before/after evaluation, the base model and LoRA-adapted model used the same classification-only prompt on the same held-out 500-image test set.
| Model | Accuracy | Precision | Recall | F1 | MCC | TN | FP | FN | TP |
|---|---|---|---|---|---|---|---|---|---|
| Qwen2.5-VL-3B Base | 77.40% | 96.60% | 56.80% | 71.54% | 0.6014 | 245 | 5 | 108 | 142 |
| Qwen2.5-VL-3B + LoRA | 99.40% | 99.60% | 99.20% | 99.40% | 0.9880 | 249 | 1 | 2 | 248 |
Under this controlled in-domain setting, LoRA fine-tuning improved:
The 99.4% accuracy is an in-domain result on a held-out FakeBench split.
It should not be interpreted as evidence of broad robustness to arbitrary real-world or newly generated images. Cross-dataset and unseen-generator generalization have not yet been established.
The earlier 86.8% Qwen2.5-VL-3B result in the multi-model benchmark used a different prompt format that also requested an explanation. It is therefore not directly comparable with the 99.4% LoRA result. The controlled comparison is 77.4% Base vs 99.4% LoRA, using the same classification-only prompt.
Install the required packages:
pip install torch transformers peft qwen-vl-utils
Load the base model and this adapter:
import torch
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
from peft import PeftModel
base_model_id = "Qwen/Qwen2.5-VL-3B-Instruct"
adapter_id = "NTX88666/Qwen2.5-VL-3B-FakeBench-LoRA"
processor = AutoProcessor.from_pretrained(base_model_id)
base_model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
)
model = PeftModel.from_pretrained(
base_model,
adapter_id,
)
model.eval()
The classification instruction used during fine-tuning was:
Classify this image as REAL or AI-GENERATED.
Return only one label:
REAL
AI-GENERATED
This adapter is intended for:
It is not intended to be used as the sole source of truth for high-stakes authenticity, legal, moderation, or forensic decisions.
Current limitations include:
Future work will focus on external generalization, unseen-generator evaluation, explanation faithfulness, and grounded visual evidence.
Full training code, evaluation scripts, benchmark results, and experiment documentation are available on GitHub:
GitHub: https://github.com/tengxiaonong-hue/fake-image-detection-vlm
Hugging Face: https://huggingface.co/NTX88666/Qwen2.5-VL-3B-FakeBench-LoRA