Skip to main content
PaperDalhousie University — Course Project2022

The Lepus Classifier: Exploring Image Classification with Convolutional Neural Networks

CNN image classification on an 85-image dataset of rabbits and hares

Overview

Examines methods to improve CNN performance without large datasets or specialized hardware. Trained on just 85 web-scraped images of Eastern cottontail rabbits and European hares, using Stratified K-Fold Cross Validation to handle the small, unbalanced dataset. Best configuration achieved 0.647 test accuracy (F1 0.575, precision 0.8, recall 0.625) with SGD+momentum and batch size 2. Demonstrates that even with optimal architecture choices and dropout regularization, data quantity remains the fundamental bottleneck.

Motivation

Most image classification research assumes access to large, curated datasets and GPU clusters. This project investigates the opposite scenario: what happens when you have fewer than 100 images, no specialized hardware, and need to distinguish between two visually similar species — Eastern cottontail rabbits and European hares?

Approach

85 images were scraped from the web and split using Stratified K-Fold Cross Validation to ensure balanced evaluation despite the small, uneven dataset. The CNN architecture was kept deliberately simple to avoid overfitting, with dropout regularization as the primary defense.

A systematic search over optimizers (Adam, SGD, SGD+momentum), batch sizes (2, 4, 8), and architecture depth was conducted. Each configuration was evaluated across all folds to produce reliable metrics.

Results

The best configuration — SGD with momentum and a batch size of 2 — achieved:

  • Test accuracy: 0.647
  • F1 score: 0.575
  • Precision: 0.8
  • Recall: 0.625

Smaller batch sizes consistently outperformed larger ones, likely because they introduced beneficial noise during gradient updates on such a small dataset.

Key Takeaway

Architecture and regularization can only compensate so much for insufficient data. Despite exploring a wide range of hyperparameter combinations and applying standard small-dataset techniques, accuracy plateaued well below what would be achievable with a larger corpus. The fundamental bottleneck is data quantity — not model capacity or training strategy.

Features

CNN Architecture

Convolutional neural network designed for binary classification of rabbits vs hares.

Small-Dataset Learning

Training techniques for just 85 web-scraped images without specialized hardware.

Stratified K-Fold CV

Cross validation strategy to reliably evaluate models on small, unbalanced data.

Web Scraping Pipeline

Automated collection of training images from Eastern cottontail and European hare sources.

Dropout Regularization

Regularization layers to combat overfitting on the limited training set.

Hyperparameter Tuning

Systematic exploration of optimizers, batch sizes, and architectures for peak accuracy.

Tech Stack

Python
Python
PyTorch
PyTorch
OpenCV
OpenCV