Skip to content

spoluan/flower-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Flower Classification Project

Author: Sevendi Eldrige Rifki Poluan

Project Overview

This project trains a Convolutional Neural Network (CNN) to classify flower images into 5 categories:

  • Sunflowers (699 images)
  • Tulips (799 images)
  • Dandelions (898 images)
  • Roses (641 images)
  • Daisies (633 images)

The dataset used is the TensorFlow flower_photos dataset. The main objective is educational: to practice the full deep learning workflow, from data loading and preprocessing to model training, evaluation, and confusion matrix analysis.

Workflow Summary

The notebook flower.ipynb follows this pipeline:

  1. Import required libraries.
  2. Download and inspect the dataset.
  3. Build train/validation datasets using TensorFlow dataset utilities.
  4. Define and compile a CNN model.
  5. Train the model with early stopping.
  6. Save and reload the model.
  7. Evaluate performance and plot metrics.
  8. Generate a confusion matrix.

Tools and Libraries

  • TensorFlow / Keras
  • NumPy
  • Pandas
  • Matplotlib
  • scikit-learn

Figures

Sample Flower Images

This figure shows sample inputs from the dataset.

Sample Flower Images

Training History

This figure shows the model training history (for example, loss/accuracy trends).

Training History

Confusion Matrix

This figure shows class-wise prediction performance.

Confusion Matrix

References

Dataset and Documentation

  1. TensorFlow Flower Photos Dataset (download link used in this project): https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz
  2. TensorFlow API: image_dataset_from_directory: https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image_dataset_from_directory
  3. TensorFlow Tutorial: Image Classification: https://www.tensorflow.org/tutorials/images/classification

Related Papers

  1. Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). ImageNet Classification with Deep Convolutional Neural Networks. NeurIPS. https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf
  2. Simonyan, K., and Zisserman, A. (2015). Very Deep Convolutional Networks for Large-Scale Image Recognition (VGG). ICLR. https://arxiv.org/abs/1409.1556
  3. He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep Residual Learning for Image Recognition (ResNet). CVPR. https://arxiv.org/abs/1512.03385

Notes

  • This repository focuses on learning and experimentation.
  • For stronger performance, future versions can compare this custom CNN with transfer learning models (for example, MobileNetV2 or ResNet50).

About

This project aims to train a deep learning model using the flower-photos dataset, which consists of 5 classes of flowers: sunflowers, tulips, dandelions, roses, and daisies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors