Lesson 5.10core5 h

Project: train and deploy an image classifier

From a folder of images to a public web demo, with error analysis

Everything in this phase becomes real when you ship something: a model trained on your own data, evaluated honestly, explained with Grad-CAM and running on a public URL that a friend can try. This project is the first rung of the portfolio ladder in 11.3 Portfolio project ladder, and its pattern — fine-tune a pretrained model, evaluate with a confusion matrix, deploy with Gradio on Hugging Face Spaces — repeats for the LLM (8.13 Project: fine-tune a small LLM with LoRA and ship a chat app), RAG (9.11 Project: a cited RAG assistant over your own documents, with evals) and agent (10.12 Project: build a research agent with tools, an MCP server and an eval harness) projects later.

You'll be able to

  • Assemble and split a custom image dataset without leakage
  • Fine-tune a pretrained backbone with a modern recipe and track experiments
  • Perform error analysis with confusion matrices, top losses and Grad-CAM
  • Export the model and deploy a Gradio demo on Hugging Face Spaces
  • Write a concise, honest project report

Key ideas

  1. Deduplicate and split at the source level before anything else; near-duplicate leakage is the most common reason a beginner's accuracy is fake.
  2. Always report a trivial baseline and a frozen-embedding baseline before fine-tuning.
  3. Log every run and change one variable at a time; correct normalization and model.eval() are the two silent killers.
Show 3 more key ideas
  1. Error analysis is the product: confusion pairs, top-loss images, Grad-CAM shortcuts, calibration temperature and a shift test.
  2. Deploy with Gradio on a free Hugging Face Space; ship the class names and preprocessing config with the weights.
  3. Use the test set exactly once, for the final number in the README.

Suggested path through this lesson