~/SARA/PROJECTS/AI-ARTWORK-DETECTORESC HOME< HOME

> cat ai-artwork-detector.md

ai artwork detector

A fine-tuned image classifier that tells AI-generated art from human-made art, with a live upload demo.

AI Art Detector upload page with a drag-and-drop image box

1 / 5

drop in an image, or click to browse.

> about

A web app that tells you whether an artwork was made by a person or generated by AI. Behind it is a ResNet-18 fine-tuned on 160k images: AI art from DiffusionDB and human art across styles from Rococo to Ukiyo-e.

what i built

  • Prototype first — trained and evaluated a small version end to end before scaling up, to check that the pipeline and the idea worked.
  • Training pipeline — data loading with augmentation (crops, flips, color jitter, rotation) and a 70/15/15 train / validation / test split. Training runs in two stages: first only the new classifier head, with the backbone frozen, then the full network at a lower learning rate. It uses AdamW, a cosine learning-rate schedule, mixed precision and gradient accumulation.
  • Evaluation — 98.7% accuracy and 0.999 ROC-AUC on 24k held-out images, checked with a confusion matrix. The decision threshold is tuned for F1 instead of defaulting to 0.5.
  • Flask inference API — validates uploads by type and size, and loads the model weights from Hugging Face at startup, so they stay out of the repo.
  • Web app — a Next.js frontend with drag-and-drop upload, an image preview and a confidence readout, plus a prediction-history page backed by SQLite.
  • Deployment — packaged with Docker and running on Hugging Face Spaces, with memory use trimmed to fit the free tier.