Author: Sevendi Eldrige Rifki Poluan
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.
The notebook flower.ipynb follows this pipeline:
- Import required libraries.
- Download and inspect the dataset.
- Build train/validation datasets using TensorFlow dataset utilities.
- Define and compile a CNN model.
- Train the model with early stopping.
- Save and reload the model.
- Evaluate performance and plot metrics.
- Generate a confusion matrix.
- TensorFlow / Keras
- NumPy
- Pandas
- Matplotlib
- scikit-learn
This figure shows sample inputs from the dataset.
This figure shows the model training history (for example, loss/accuracy trends).
This figure shows class-wise prediction performance.
- TensorFlow Flower Photos Dataset (download link used in this project): https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz
- TensorFlow API: image_dataset_from_directory: https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image_dataset_from_directory
- TensorFlow Tutorial: Image Classification: https://www.tensorflow.org/tutorials/images/classification
- 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
- Simonyan, K., and Zisserman, A. (2015). Very Deep Convolutional Networks for Large-Scale Image Recognition (VGG). ICLR. https://arxiv.org/abs/1409.1556
- He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep Residual Learning for Image Recognition (ResNet). CVPR. https://arxiv.org/abs/1512.03385
- 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).


