Skip to content

Repository files navigation

Flower Classification Project: 17-Class Identification

This project implements a deep learning pipeline to classify 17 different species of flowers using TensorFlow and Keras. The project evolved from a custom-built Convolutional Neural Network (CNN) to a high-performance Transfer Learning model using the Xception architecture.

Table of Contents

  1. Dataset
  2. Model Evolution
  3. Key Optimization Techniques
  4. Results
  5. Usage

Dataset

  • Source: Flower Datasets (Kaggle)
  • Classes: 17 flower categories.
  • Preprocessing:
    • Images resized to 180x180 pixels.
    • Data split into Training (80%), Validation (10%), and Test (10%) sets.
    • Applied Xception-specific scaling and preprocessing.

Model Evolution

Phase 1: Custom CNN from Scratch

Initially, a 5-layer CNN with Dropout was implemented. While it achieved decent training accuracy, it struggled with generalization on the validation set.

Phase 2: Transfer Learning (Xception)

To improve performance, we utilized the Xception model pre-trained on ImageNet as a feature extractor. We replaced the top layers with Global Average Pooling and a Softmax output layer tailored for 17 classes.

Key Optimization Techniques

  • Data Augmentation: Random flips, rotations, and zooms to increase dataset diversity.
  • Regularization: Dropout (0.5) to prevent overfitting.
  • Early Stopping: Monitored val_loss with a patience of 5 epochs to restore the best weights.
  • Model Checkpointing: Automatically saved the best-performing model file (transfer_learning_flower_model.keras).

Results

  • Test Accuracy: ~94.118%
  • Test Loss: ~0.272
  • The Xception model significantly outperformed the initial CNN, demonstrating the power of pre-trained weights for feature extraction.

Usage

To run the training pipeline:

  1. Ensure kaggle.json is uploaded for dataset download.
  2. Execute the notebook cells sequentially to unzip the data, define the model, and begin training.
  3. The final model is saved as transfer_learning_flower_model.keras.

About

A deep learning project classifying 17 flower species using TensorFlow and Keras. Features a custom CNN architecture compared against a transfer learning approach using the Xception model. Includes data augmentation, automated checkpointing, and performance visualization.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages