A Chrome extension that uses machine learning to detect AI-generated images.
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
- Detect AI-generated images in real-time
- Chrome extension integration
- PyTorch-based deep learning model
- Batch processing capabilities
- Image preprocessing and normalization
- Install Python dependencies:
pip install -r requirements.txt- Load the extension in Chrome:
- Go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
ai-image-detectordirectory
- Go to
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'}results = app.batch_detect("path/to/images")
for result in results:
print(f"{result['image_path']}: {result['is_ai_generated']}")- Prepare your dataset in the
data/raw/directory - Run the training script:
python data/model/train.py- Training images should be in JPEG or PNG format
- Target size: 224x224 pixels
- Labels: Binary (0 for real, 1 for AI-generated)
- Python 3.8+
- PyTorch 2.0+
- Chrome/Chromium-based browser
- CUDA (optional, for GPU acceleration)
MIT License