--- title: GrapeVineClassification emoji: 🍇 colorFrom: red colorTo: red sdk: streamlit app_file: src/streamlit_app.py pinned: false short_description: Custom CNN model for grapevine leaf disease classification. license: mit --- # 🍇 Grapevine Leaf Disease Classifier (CNN – No Transfer Learning) This web app demonstrates a **Convolutional Neural Network (CNN) model trained from scratch (without Transfer Learning)** 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 deployed via **Streamlit**. It processes images and predicts the most likely disease with a probability score. --- ## 🚀 How to Use 1. Upload a grapevine leaf image (`.jpg`, `.jpeg`, `.png`) 2. Click **"Predict Disease"** 3. The app will display: - ➤ Predicted disease class - 📊 Confidence score - 📈 Full probability distribution across all classes --- ## 🧠 Model Details | **Attribute** | **Value** | |--------------------|-----------| | Model Type | CNN (no Transfer Learning) | | Input Image Size | 160 × 160 pixels | | Loss Function | `categorical_crossentropy` | | Optimizer | Adam | | Metrics | Accuracy, Precision, Recall | | Framework | TensorFlow / Keras | | Deployment | Streamlit with Docker (HuggingFace Spaces) | | Classes | 4 total | --- ## 📂 File Structure ├── src/ │ └── app.py # Streamlit application ├── cnn_model.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** - **NumPy, PIL** - **Streamlit** - **Docker (for deployment on HuggingFace)** --- ## 📊 Example Output Predicted Disease: Esca (Black Measles) Confidence: 47.54% Probability per Class: Black Rot → 17.49% Esca (Black Measles) → 47.54% Leaf Blight → 17.49% Healthy → 17.49% yaml Code kopieren --- ## 👤 Author Developed by **Enes Yamac (EnYa32)** as part of a Deep Learning project involving custom CNNs and Transfer Learning architectures for agricultural image classification. --- ## 📌 License This project is released under the **MIT License**. --- ## 💡 Notes - This version uses a **pure CNN trained from scratch**, without any pre-trained ImageNet models. - A second version using **Transfer Learning (ResNet50)** is available as a separate Space. --- ## 🔗 Related Projects 🔹 *Upcoming*: **Grapevine Disease Classifier – Transfer Learning (ResNet50)** --- ✨ *Thank you for visiting this Space!* Feel free to test the app and provide feedback.