How guyfloki/ai-image-detector works
Project type and purpose
• This is an open-source Python tool for binary image classification (“AI vs. human”).
• It uses a fine-tuned Convolutional Vision Transformer (CvT-13) and PyTorch for training, evaluation, and inference.
• Key use cases: batch evaluation of directories, one-off predictions, training on new data, and generating performance metrics (loss curve, confusion matrix).
File structure
• Top-level:
• LICENSE, README.md, notebooks (ai_image_detector.ipynb), metrics/, models/ (saved .pth weights)
• src/: implementation of dataset loader (custom_dataset.py), model definition (model.py), training (train.py), evaluation (evaluate.py), and inference (main.py).
• No “frontend” or web layer; this is purely a CLI/SDK style ML pipeline.
• External references in README point to Google Drive for large raw datasets and model weights, plus the Hugging Face Transformers API for the CvT-13 backbone.
README for additional insights
• Confirms the use of: PyTorch (+ torchvision/torchaudio), Transformers, NumPy, matplotlib, scikit-learn, mlxtend, Pillow, tqdm
• Workflow stages described: data preparation → training → evaluation → prediction.