The problem
Telling a Beagle from a Foxhound is far harder than telling a dog from a cat: fine-grained classes differ only in subtle cues like ear set, muzzle shape and coat texture. Training a deep network from scratch for 120 such classes would need enormous data and compute. Transfer learning is the professional answer — reuse visual features learned from ImageNet and retrain only the classifier head. The Stanford Dogs dataset (Khosla et al., Stanford Vision Lab) provides 20,580 annotated images across 120 breeds with a standard train/test split, making it the established benchmark. This project implements the full pipeline: preprocessing, two-stage fine-tuning, augmentation for per-breed data scarcity, honest test-split evaluation, and a photo-upload demo showing top-3 breeds with breed facts.
Uploads a dog photo in the web demo.
Follow the working sequence
How it works
- The photo is resized to 224x224 and normalized with ImageNet mean/std statistics.
- The frozen ResNet-50 backbone converts it into a 2048-dimensional feature vector of fur texture, ear geometry and proportions.
- The classification head (global average pooling → Dense(512) → dropout → Dense(120)) maps features to breed logits.
- Softmax converts logits to 120 probabilities; the demo reports the top three.
- Stage-one training fits only the head (Adam, lr 1e-3); stage two fine-tunes the last block at lr 1e-5.
- Final evaluation runs once on the held-out test split for top-1/top-5 accuracy.
Tech stack:
- Python 3.10, PyTorch or TensorFlow/Keras
- ResNet-50 (ImageNet pre-trained)
- Stanford Dogs dataset (Khosla et al.)
- Albumentations / torchvision transforms
- Flask (demo backend)
- HTML/CSS/JavaScript (demo UI)
- Git
Dataset & Model Details
- Dataset: Stanford Dogs — 20,580 images, 120 breeds (~150 per breed), with bounding-box annotations; source: Aditya Khosla et al., Stanford Vision Lab. Standard split: 12,000 train / 8,580 test.
- Model input: 224x224x3 normalized image. Output: 120-way softmax (breed probabilities).
- Architecture: ResNet-50 backbone (ImageNet init) → GlobalAvgPool → Dense(512) → Dropout → Dense(120).
- Metric: top-1 / top-5 accuracy on the test split, measured after training; per-breed precision analysis included. No accuracy figure is claimed before the training run.
| Parameter | Value |
|---|---|
| Classes | 120 dog breeds |
| Input | 224x224 RGB photo |
| Backbone | ResNet-50, ImageNet pre-trained |
| Fine-tune | Head + last residual block |
| Inference | Under 1 s per photo on CPU (design target) |
| Demo | Photo upload + top-3 breed cards |
Project features
- [120-breed classifier] ResNet-50 backbone with a retrained classification head covering all 120 Stanford Dogs breeds.
- [Two-stage fine-tuning] Head-only training first, then the last residual block unfrozen at a low learning rate with cosine decay.
- [Top-3 predictions with breed cards] Each prediction shows probabilities plus group, size, coat and temperament notes per breed.
- [Augmentation pipeline] Random crop, flip, color jitter and ±15° rotation counter the small per-breed sample sizes.
- [Per-breed error analysis] Confusion analysis highlights commonly confused pairs (e.g. Malamute vs. Husky) with measured numbers.
- [Photo-upload web demo] Upload any dog photo; get breed probabilities in under a second on CPU.
- [Honest evaluation] Top-1/top-5 accuracy measured once on the 8,580-image held-out test split — reported as measured.
What is included
- Python training notebook (two-stage transfer learning, augmentation, evaluation)
- Fine-tuned model weights
- Test-split evaluation: top-1/top-5 accuracy + per-breed error analysis from the actual run
- Photo-upload web demo with breed information cards
- Project report PDF (methodology, ablations, measured results)
- PPT presentation for final review
- Viva Q&A preparation document
Limitations & prerequisites
- Classifies single-breed photos best; mixed-breed dogs get the closest single label, not a mix breakdown.
- Needs a reasonably clear, front-facing photo; heavy occlusion or tiny distant dogs degrade accuracy.
- Rare breeds with the fewest training images score lower — the per-breed analysis shows exactly which.
- Fine-tuning benefits from a GPU; CPU-only training works but takes considerably longer.
- Breed facts in the demo are reference notes, not veterinary advice.
Frequently Asked Questions
Why transfer learning instead of training from scratch?
With ~150 images per breed, from-scratch training overfits badly. ImageNet features already encode fur, ears and faces; retraining just the head reaches strong accuracy in a fraction of the time — the notebook includes the comparison.
What dataset is used?
Stanford Dogs: 20,580 images across 120 breeds with a standard 12,000/8,580 train/test split, from the Stanford Vision Lab. Results are reproducible against a known benchmark.
Can it identify mixed breeds?
Not reliably — it outputs the single closest breed. Multi-label mixed-breed prediction is listed as future scope in the report.
How accurate is it?
The notebook measures top-1 and top-5 accuracy on the held-out test split and reports the measured numbers with a per-breed breakdown. Nothing is claimed before training.
Do I need a GPU?
Recommended for fine-tuning (much faster), but the pipeline runs on CPU end to end, and demo inference is CPU-friendly.
Is this project suitable for a final-year project?
Yes — for Computer Science, IT and AI/ML programs. It demonstrates transfer learning, fine-grained classification, augmentation strategy and honest evaluation on a real benchmark. Suitable for B.E./B.Tech final-year projects in Computer Science, Information Technology and AI/ML.
Components & software requirements
- Python 3.10, PyTorch or TensorFlow/Keras
- ResNet-50 (ImageNet pre-trained)
- Stanford Dogs dataset (Khosla et al.)
- Albumentations / torchvision transforms
- Flask (demo backend)
- HTML/CSS/JavaScript (demo UI)
- Git
Dataset & Model Details
- Dataset: Stanford Dogs — 20,580 images, 120 breeds (~150 per breed), with bounding-box annotations; source: Aditya Khosla et al., Stanford Vision Lab. Standard split: 12,000 train / 8,580 test.
- Model input: 224x224x3 normalized image. Output: 120-way softmax (breed probabilities).
- Architecture: ResNet-50 backbone (ImageNet init) → GlobalAvgPool → Dense(512) → Dropout → Dense(120).
- Metric: top-1 / top-5 accuracy on the test split, measured after training; per-breed precision analysis included. No accuracy figure is claimed before the training run.
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.