--- title: GrapeVineClassification_TL emoji: πŸ‡ colorFrom: red colorTo: red sdk: streamlit app_file: src/streamlit_app.py pinned: false short_description: Transfer Learning model for grape leaf disease. license: mit --- # πŸ‡ Grapevine Leaf Disease Classifier (CNN – Transfer Learning with ResNet50) This web app demonstrates a **Convolutional Neural Network using Transfer Learning (ResNet50 pretrained on ImageNet)** to classify grapevine leaf images into one of the following four disease categories: - **Black Rot** - **Esca (Black Measles)** - **Leaf Blight (Isariopsis Leaf Spot)** - **Healthy** The model was developed using **TensorFlow/Keras** and fine-tuned on a custom grapevine leaf dataset. It is deployed via **Streamlit on HuggingFace Spaces** and predicts disease labels with class probabilities. --- ## πŸš€ How to Use 1. Upload a grapevine leaf image (`.jpg`, `.jpeg`, `.png`) 2. Click **β€œPredict Disease”** 3. The app will display: - πŸ” Predicted disease - πŸ“Š Confidence score - πŸ“ˆ Probability distribution across all classes --- ## 🧠 Model Details | **Attribute** | **Value** | |--------------------|-----------| | Model Type | CNN with Transfer Learning (ResNet50) | | Pretrained Weights | ImageNet | | Input Image Size | 160 Γ— 160 pixels (adapted for ResNet) | | Loss Function | `categorical_crossentropy` | | Optimizer | Adam | | Metrics | Accuracy, Precision, Recall | | Framework | TensorFlow / Keras | | Deployment | Streamlit (HuggingFace Spaces) | | Classes | 4 total | --- ## πŸ“‚ File Structure β”œβ”€β”€ src/ β”‚ └── streamlit_app.py # Streamlit web app β”œβ”€β”€ grape_cnn_TL_ResNet50_final.keras # Final saved model β”œβ”€β”€ grape_training_history.pkl # Training history β”œβ”€β”€ README.md # Project documentation └── requirements.txt # Python dependencies yaml Code kopieren --- ## πŸ› οΈ Technologies Used - **Python** - **TensorFlow / Keras** - **ResNet50 (Transfer Learning)** - **NumPy, PIL** - **Streamlit** --- ## πŸ“Š Example Output Predicted Disease: Esca (Black Measles) Confidence: 45.25% Probability per Class: Black Rot β†’ 17.96% Esca (Black Measles) β†’ 18.90% Leaf Blight β†’ 17.89% Healthy β†’ 45.25% yaml Code kopieren --- ## πŸ‘€ Author Developed by **Enes Yamac (EnYa32)** as part of a Deep Learning project involving custom CNNs and Transfer Learning techniques for agricultural image classification. --- ## πŸ“Œ License This project is released under the **MIT License**. --- ## πŸ’‘ Notes - This version uses **Transfer Learning with ResNet50**. - A separate version using a **pure CNN (trained from scratch)** is available as another Space. --- ## πŸ”— Related Projects πŸ”Ή **Grapevine Disease Classifier – CNN (No Transfer Learning)** πŸ”Ή Future enhancements: Grad-CAM integration & model comparison --- ✨ *Thank you for testing this Transfer Learning version!* Your feedback is appreciated!