Hwang713/leaf-disease-EfficientNetV2B1
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
  
๐ฟ Plant Disease Detection with EfficientNetB1
Plant-Disease-Detection-EfficientNetB1 is a deep learning-powered app that identifies 15 types of plant diseases from leaf images using a fine-tuned EfficientNetB1 model trained on the PlantVillage dataset.
๐ธ Upload an image, paste from clipboard, or use webcam input Get instant predictions on plant disease type โ with confidence score and class label.
๐ Demo
Deployed on Hugging Face Spaces: 
๐ง Model Details
- Model: EfficientNetB1 (Keras, Sequential API)
- Classes: 15 plant disease types
- Input Size: 240ร240
- Preprocessing: Normalization (0โ1), real-time data augmentation
- Training:
- Phase 1: Freeze base, train classification head
- Phase 2: Unfreeze all, fine-tune at low learning rate (
1e-5) - Validation Accuracy: ~97%
๐ Training Notebook (Kaggle)
The model was trained using TensorFlow and Keras on Kaggle. ๐ fine-tuning-efficientnetb1-plantdiseasedetection Includes:
- Stratified 80/20 data split using
ImageDataGenerator - Real-time augmentations
- Early stopping and checkpointing (best weights only)
- Final
.h5weights file exported
Features
- Classifies 15 plant diseases
- Supports upload, webcam, and clipboard paste
- Outputs predicted class name and confidence score
- Lightweight & fast inference โ powered by Gradio
โ ๏ธ Grad-CAM Note
Grad-CAM is disabled in this version due to using Sequential() with load_weights() To enable Grad-CAM, re-train with Functional API and access the last convolutional layer output.
๐ Folder Structure
12_PlantDiseaseDetection-HF/
โโโ app.py # Gradio interface
โโโ inference_utils.py # Model loading + prediction
โโโ model/
โ โโโ efficientnetb1_plant_final.weights.h5
โ โโโ class_names.json
โโโ assets/ # Demo/test images
โโโ requirements.txt
โโโ README.mdExample Output
Installation
To run locally:
git clone https://github.com/McKlay/plant-disease-type-EfficientNetB1
cd plant-disease-type-EfficientNetB1
pip install -r requirements.txt
python app.pyRequirements
tensorflow
gradio
opencv-python
numpy
Pillow๐จโ๐ป Author
Developed by Clay Mark Sarte Built with TensorFlow + Gradio Deployed to Hugging Face Spaces
โ ๏ธ Disclaimer
This tool is for educational use only. Not intended for use in real-world agricultural decisions or medical treatment.

