File size: 3,016 Bytes
e15366b b48bfd3 18b37d3 e15366b 18b37d3 e15366b b48bfd3 8b56483 e15366b b48bfd3 e15366b b48bfd3 e15366b 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 18b37d3 b48bfd3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | ---
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! |