← Back

Transfer Learning with CNN — Cats vs Dogs v2

Transfer Learning with CNN — Cats vs Dogs v2

EfficientNetB0 + Transfer Learning on cats vs dogs dataset. Feature extraction + fine-tuning approach. Model deployed on Hugging Face.

Technologies

Python TensorFlow Transfer Learning EfficientNetB0 Deep Learning

What I Did

Built a Transfer Learning model using EfficientNetB0 backbone to classify cats vs dogs.

Trained using two-phase approach:

  1. Feature Extraction Phase: Freeze backbone, train classification head
  2. Fine-tuning Phase: Unfreeze backbone layers, retrain with small learning rate

Results

MetricAccuracy
After Feature Extraction~50.98%
After Fine-tuning~70.52%

Dataset

Dataset: Microsoft Cats vs Dogs (microsoft/cats_vs_dogs)

  • ~23,000 training images
  • ~5,800 validation images
  • 2 classes: Cat, Dog

Model Architecture

Base Model: EfficientNetB0 (pre-trained on ImageNet) Head: GlobalAveragePooling2D + Dropout + Dense layer

Training Strategy:

  • Phase 1: Freeze base, train head (feature extraction)
  • Phase 2: Unfreeze and fine-tune with tiny learning rate

Key Learning: What is Transfer Learning?

Transfer learning means reusing weights from a model already trained on millions of images (ImageNet) instead of training from scratch.

Why it works:

  • Pre-trained backbone already learned edges, textures, shapes
  • We reuse that knowledge for our specific task (cats vs dogs)
  • Much faster and requires less data than training from scratch

Two phases:

  1. Freeze base + train head: Get ~50% accuracy fast
  2. Fine-tune base + head: Improve to ~70% accuracy

🔗 GitHub: Tranfer-Lrearning-with-CNN

🔗 Model on Hugging Face: nipunsgeeth/Cats_vs_Dogs_cnn_v2


Transfer learning is the practical way to do deep learning — reuse pre-trained knowledge. 🚀

"Exploring technology through creative projects"

— K.M.N.Sangeeth Kariyapperuma

Navigation
HomeProjectsBlog
Connect

© 2026 NipunSGeeTH. All rights reserved.

Crafted with Love ❤️