Atayaz/AugmentedGrapevineDiseaseCNN
0
๐ Grape Disease Classification with CNN and Transfer Learning
This project implements two deep learning models to classify grape leaf diseases:
- `grapevine_cnn.py` โ A Convolutional Neural Network (CNN) built from scratch
- `grape_transfer_resnet.py` โ A Transfer Learning model using ResNet50
Both models are deployed using Streamlit, allowing for training visualization and image-based prediction.
๐ Dataset
Dataset Used: Augmented Grape Disease Dataset Folder Name: Final Training Data
Each subfolder contains images labeled for a specific grape disease category:
- Black Rot
- ESCA
- Leaf Blight
- Healthy
โ๏ธ How to Run
Install required packages:
pip install -r requirements.txtRun CNN model:
streamlit run grapevine_cnn.pyRun Transfer Learning model:
streamlit run grape_transfer_resnet.py๐ง Model 1: CNN (grapevine_cnn.py)
Key Features:
- 5 Convolutional layers + 3 MaxPooling layers
- Dropout layers for regularization
- Precision, Recall, and Accuracy metrics
- Uses
train_test_splitfor dataset split - Accuracy and Loss visualizations with Matplotlib
- Streamlit interface with image upload for prediction
- Model saved as
grape_cnn_model.h5
๐ง Model 2: Transfer Learning (grape_transfer_resnet.py)
Key Features:
- Based on pre-trained ResNet50 (ImageNet weights)
- Frozen convolutional base layers
- Classification head with
GlobalAveragePooling2D+ Dense layers - Uses
ImageDataGeneratorwith augmentation and validation split - EarlyStopping to prevent overfitting
- Accuracy and Loss training curves
- Streamlit image upload and prediction interface
- Model saved as
grape_resnet_model.h5
๐ผ๏ธ Streamlit Interface Includes:
- Real-time training graphs: Accuracy & Loss
- Upload your own grape leaf image for prediction
- Displays predicted disease class with confidence
