Skip to content

yvanyin1/conuhacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI Image Detector - Chrome Extension

A Chrome extension that uses machine learning to detect AI-generated images.

Demo

image

Project Structure

ai-image-detector/
├── data/
│   ├── raw/                 # Original images
│   ├── processed/           # Resized / normalized images
│   └── model/
│       ├── model.py         # Model architecture
│       ├── train.py         # Training logic
│       └── predict.py       # Inference logic
├── utils/
│   ├── loader.py           # Load images
│   └── preprocess.py       # Image preprocessing
├── app.py                   # Entry point
├── manifest.json            # Chrome extension manifest
├── requirements.txt         # Python dependencies
└── README.md               # This file

Features

  • Detect AI-generated images in real-time
  • Chrome extension integration
  • PyTorch-based deep learning model
  • Batch processing capabilities
  • Image preprocessing and normalization

Installation

  1. Install Python dependencies:
pip install -r requirements.txt
  1. Load the extension in Chrome:
    • Go to chrome://extensions/
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the ai-image-detector directory

Usage

Python Module

from app import AIImageDetectorApp

app = AIImageDetectorApp(model_path="path/to/model.pth")
result = app.detect_image("image.jpg")
print(result)  # {'is_ai_generated': True, 'confidence': 0.95, 'image_path': 'image.jpg'}

Batch Processing

results = app.batch_detect("path/to/images")
for result in results:
    print(f"{result['image_path']}: {result['is_ai_generated']}")

Model Training

  1. Prepare your dataset in the data/raw/ directory
  2. Run the training script:
python data/model/train.py

Data Format

  • Training images should be in JPEG or PNG format
  • Target size: 224x224 pixels
  • Labels: Binary (0 for real, 1 for AI-generated)

Requirements

  • Python 3.8+
  • PyTorch 2.0+
  • Chrome/Chromium-based browser
  • CUDA (optional, for GPU acceleration)

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors