|
---
|
|
title: πΌ EfficientNetV2B0 Flower Classifier
|
|
emoji: πΈ
|
|
colorFrom: yellow
|
|
colorTo: pink
|
|
sdk: gradio
|
|
app_file: app.py
|
|
pinned: true
|
|
---
|
|
[](https://huggingface.co/spaces/McKlay/efficientnet-flower-classifier)
|
|
[](https://www.gradio.app/)
|
|
[](https://opensource.org/licenses/MIT)
|
|
|
|

|
|

|
|

|
|

|
|
|
|

|
|
|
|
# πΌ EfficientNetV2B0 Flower Classifier
|
|
|
|
An elegant and efficient image classifier trained to recognize 5 flower types: **daisy**, **dandelion**, **roses**, **sunflowers**, and **tulips**.
|
|
Powered by **TensorFlow**, fine-tuned using **EfficientNetV2B0**, and deployed with **Gradio** on **Hugging Face Spaces**.
|
|
|
|

|
|

|
|

|
|
|
|
---
|
|
|
|
## Live Demo
|
|
|
|
π **Try the app here**: [Hugging Face Space](https://huggingface.co/spaces/McKlay/efficientnet-flower-classifier)
|
|
|
|
Upload a flower image and get the top 5 predictions with confidence scores.
|
|
|
|
---
|
|
|
|
## Model Details
|
|
|
|
- **Backbone**: EfficientNetV2B0 (`keras.applications`)
|
|
- **Framework**: TensorFlow 2.x
|
|
- **Dataset**: TensorFlow Flowers (~3,700 images, 5 classes)
|
|
- **Classes**: `daisy`, `dandelion`, `roses`, `sunflowers`, `tulips`
|
|
- **Validation Accuracy**: **91.28%**
|
|
- **Training Strategy**:
|
|
- Stage 1: 5 epochs (base frozen)
|
|
- Stage 2: 5 epochs (fine-tuning all layers)
|
|
- **Preprocessing**: `preprocess_input()` scaled to [-1, 1]
|
|
|
|
---
|
|
|
|
## π Training Notebooks
|
|
|
|
β
Kaggle: [Flower Recognition β Fine-Tuning EfficientNetV2B0](https://www.kaggle.com/code/claymarksarte/flower-recognition-fine-tuning)
|
|
Full training notebook with dataset loading, preprocessing, model building, and evaluation.
|
|
|
|
β οΈ Colab: (Archived) Training started in [Google Colab](https://colab.research.google.com/) but was moved to Kaggle due to GPU quota limitations.
|
|
You can still view the original Colab notebook here: [Colab Fine-Tuning](https://colab.research.google.com/drive/1fSrxw2Pi48Adu25s1BcQFr2MnkLOCNzH?usp=sharing)
|
|
|
|
---
|
|
|
|
## ## π Project Structure
|
|
|
|
efficientnet-flower-classifier/
|
|
βββ app.py # Gradio app (entry point)
|
|
βββ models/
|
|
β βββ flower_model.h5 # Trained Keras model
|
|
βββ requirements.txt
|
|
βββ README.md
|
|
|
|
---
|
|
|
|
## Run Locally
|
|
|
|
```bash
|
|
git clone https://github.com/YOUR_USERNAME/8_FlowerRecognition-HF.git
|
|
cd 8_FlowerRecognition-HF
|
|
pip install -r requirements.txt
|
|
python app.py
|
|
```
|
|
|
|
---
|
|
|
|
## Dependencies
|
|
|
|
- tensorflow
|
|
- gradio
|
|
- numpy
|
|
- pillow
|
|
|
|
---
|
|
|
|
## Acknowledgments
|
|
|
|
- [TensorFlow Flower Dataset](https://www.tensorflow.org/datasets/catalog/tf_flowers)
|
|
|
|
- [EfficientNetV2 Paper](https://arxiv.org/abs/2104.00298) β Tan & Le
|
|
|
|
---
|
|
|
|
## π§βπ» Author
|
|
|
|
Clay Mark Sarte
|
|
[GitHub](https://github.com/McKlay) | [LinkedIn](https://www.linkedin.com/in/clay-mark-sarte-283855147/)
|
|
|
|
|