CoolFace
Modelpublic

nahid112376/ai-detection-cnn

sourceHugging Facemitupdated 9mo agoView on Hugging Face
0likes
Model Card

AI Detection CNN Model

This model detects AI-generated images using spatial features extracted from Qwen2.5-VL.

Model Description

  • —Architecture: 1D CNN with 3 convolutional layers
  • —Task: Binary classification (AI-generated vs Real images)
  • —Feature Extractor: Qwen2.5-VL-3B-Instruct
  • —Framework: PyTorch

Usage

python
from inference import test_image

# Test an image
result = test_image(
    "path/to/image.jpg",
    hf_repo_id="nahid112376/ai-detection-cnn",
    threshold=0.5
)

print(f"Label: {result['label']}")
print(f"Confidence: {result['confidence']*100:.2f}%")

Model Details

  • —Input: Spatial features from Qwen2.5-VL (shape: [numpatches, hiddendim])
  • —Output: Single regression score (0-1, threshold at 0.5)
  • —Training: Trained on demectai dataset

Installation

bash
pip install torch transformers huggingface_hub pillow numpy
pip install qwen-vl-utils

Files

  • —cnn_regression_model.pth: Trained model weights
  • —inference.py: Inference script
  • —extract_features.py: Feature extraction script

Citation

If you use this model, please cite:

bibtex
@misc{ai-detection-cnn,
  author = {bartazable},
  title = {AI Detection CNN Model},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/nahid112376/ai-detection-cnn}}
}