- Bachelor's thesis · 2021
- Transfer learning
- VGG-16 · ResNet-18
- PyTorch
Bird Species Identification
Even expert birders disagree on a species from one photo. Can a network learn to tell them apart from only a handful of examples each?
- 20Bird species (CUB-200 subset)
- 743Training images · ~37 each
- 2Backbones compared
Which bird is this?
A Blue Jay and an Indigo Bunting are both blue; a House Sparrow and a dozen look-alikes blur together in the field. Telling species apart from a single still photo is a fine-grained recognition problem: the differences are a wing-bar here, an eye-ring there. This project learns to separate 20 species drawn from the Caltech-UCSD Birds collection, the standard benchmark for exactly this kind of task.
- Blue Jay
- Northern Cardinal
- American Goldfinch
- Indigo Bunting
- House Sparrow
- American Robin
The real dataset is photographs; these six are hand-drawn, field-guide style, for illustration. Hover and they preen a little.
A deliberately small dataset
The full CUB-200-2011 set is 11,788 photos across 200 species, each annotated with a bounding box. This project worked small on purpose: a 20-species slice: just 743 training and 372 validation images, roughly 37 photos per species. Every image is cropped to the bird's bounding box so the background can't leak in, resized to 224 × 224, and normalised to the range the pretrained network expects. With this little data, a deep network trained from scratch would simply memorise the training set, the "curse of dimensionality."
Borrow a network that already knows how to see
A network starting from zero on 743 images has nothing to go on. So the project borrows one that has already studied 1.2 million: a backbone pre-trained on ImageNet's 1,000 everyday categories. Its early layers already detect edges, textures and feather-like patterns, vision that transfers straight to birds. Those layers are frozen (their weights locked), and only a fresh final classifier (mapping features to the 20 species) is trained. Far fewer parameters to fit means it converges in a handful of epochs instead of overfitting the tiny set.
Only the small head learns at first: a few thousand new weights instead of millions.
VGG-16 or ResNet-18?
Two backbones were tried head-to-head. VGG-16 (the vgg16_bn variant, with batch-norm) is a tall, plain stack: 13 convolution layers in five blocks, then large fully-connected layers. ResNet-18 is shallower but smarter: its residual skip connections add each block's input back to its output, so gradients flow straight through and the network trains cleanly. In both, only the final layer is swapped for a clean Linear → 20.
Freeze, then fine-tune
Training ran in two phases. Phase 1 freezes the backbone and trains only the head for 20 epochs at learning rate 0.001; loss drops from 5.3 to under 1 almost at once, and accuracy leaps from 0.5% (random guessing over 20 classes) to 79.9% after a single epoch. Phase 2 unfreezes everything and fine-tunes the whole network for 20 more epochs at a gentler 0.0001, letting the backbone adapt to birds. Adam optimiser, weight decay 1e-6, gradient clipping at 1.0, on a one-cycle schedule.
The actual logged loss from the thesis: training loss falls 1.58 → 0.06, while validation loss flattens near 0.5.
Training accuracy climbs toward 100% while validation plateaus in the low-80s. That gap is the small-data ceiling, honestly reported.
A top-5 score sheet
For a given photo the model scores every species; the five highest make the score sheet, and the top one is the answer. Pick a bird to see an example, and notice the model's doubt lands on genuinely similar species (the two blues, the streaky browns). (Illustrative outputs in the shape of a confident prediction, not live inference.)
- Samples per species were uneven, so the model favoured some birds over others.
- Accuracy drops at awkward camera angles and with lower-quality photos, a finding noted in the thesis.
- With only ~37 images per species, the low-80s validation accuracy is a small-data result, not a production one.
- Next step the thesis proposes: a phone app (iOS/Android) and camera-trap deployment for wildlife monitoring.