ai-image-detection / README.md
nahid112376's picture
Upload README.md with huggingface_hub
dad280d verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade
metadata
title: AI Image Detection
emoji: πŸ”
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
models:
  - nahid112376/ai-detection-cnn

πŸ” AI Image Detection

Upload an image to detect if it was generated by AI or is a real photograph.

How It Works

  1. Feature Extraction: Images are processed using Qwen2.5-VL-3B-Instruct to extract spatial features
  2. CNN Classification: A 1D CNN trained on these features detects AI generation patterns
  3. Prediction: Returns a confidence score and classification (AI-generated vs Real)

Model Details

  • Architecture: 1D CNN with 3 convolutional layers
  • Feature Extractor: Qwen2.5-VL-3B-Instruct
  • Framework: PyTorch
  • Model Repository: nahid112376/ai-detection-cnn

Usage

  1. Upload an image using the upload button, clipboard, or webcam
  2. Adjust the detection threshold (default: 0.5)
    • Higher threshold = stricter AI detection
    • Lower threshold = more sensitive detection
  3. Click "Detect AI" to get results

Technical Details

  • Input: Images of any size (automatically resized)
  • Output: Binary classification with confidence score
  • Threshold: Adjustable from 0.0 to 1.0
  • Processing: First prediction may take longer due to model loading

Performance

The model was trained on the demectai dataset and uses spatial features from Qwen2.5-VL for robust AI image detection.

Citation

@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}}
}

License

MIT License