Skip to content

Kayragun/transfer-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Transfer Learning — Flower Classification with EfficientNetB0

Advanced Deep Learning project implementing transfer learning on the TensorFlow Flowers dataset using EfficientNetB0.

Why Transfer Learning?

Training a deep neural network from scratch requires massive amounts of labeled data and days of GPU time. Transfer learning sidesteps both problems: we take EfficientNetB0, already trained on 1.2 million ImageNet images, and reuse the visual features it has learned (edges, textures, shapes) for our flower classification task.

The key advantages over training from scratch:

  • Less data needed — The backbone already understands visual structure; we only need enough data to learn the flower-specific patterns on top.
  • Faster training — Phase 1 trains only the new classification head (a few thousand parameters) instead of millions. Total training time drops from hours to minutes.
  • Better accuracy — Features learned from ImageNet generalize well to new visual tasks. A randomly initialized network of the same size would underfit badly on a 3,670-image dataset.
  • Lower compute cost — No need for a large GPU cluster; a single T4 on Google Colab is sufficient.

Overview

Classifies 5 flower species (daisy, dandelion, roses, sunflowers, tulips) using a pre-trained EfficientNetB0 backbone with a two-phase training strategy: feature extraction followed by fine-tuning.

Files

File Description
transfer_learning.ipynb Main notebook — full pipeline, ready to run on Colab

Quick Start (Google Colab)

  1. Upload transfer_learning.ipynb to Google Colab
  2. Set runtime to GPU → T4 (Runtime → Change runtime type)
  3. Run all cells

No additional installs needed — tensorflow-datasets is pre-installed on Colab.

Model Architecture

EfficientNetB0 (ImageNet weights, include_top=False)
    └── GlobalAveragePooling2D
    └── Dense(256, relu)
    └── Dropout(0.5)
    └── Dense(5, softmax)

Training Strategy

Phase Epochs Learning Rate Base Model
1 — Feature Extraction 10 1e-3 Frozen
2 — Fine-tuning 5 1e-5 Last 20 layers unfrozen

Dataset

TensorFlow Flowers — 3,670 images, 5 classes, loaded automatically via tensorflow_datasets.

About

Flower classification using EfficientNetB0

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors