--- tags: - ml-intern --- # Rice Leaf Disease Detection - PRCP-1001 ## Capstone Project: Complete Jupyter Notebook This repository contains a comprehensive Jupyter notebook for the PRCP-1001 Rice Leaf Disease Detection project. ### What's Included **Single Jupyter Notebook (`Rice_Leaf_Disease_Detection.ipynb`) covering:** 1. **Task 1: Complete Data Analysis Report** - Dataset overview (119 images, 3 classes) - Class distribution visualization - Image properties analysis (dimensions, intensity, channels) - Color channel analysis (RGB distributions) - Texture and edge analysis (Sobel filters, histograms) - Data quality assessment 2. **Task 2: Model Building** - **Custom CNN** (from scratch with BatchNorm, Dropout) - **VGG16** Transfer Learning (with VGG-specific preprocessing: BGR mean subtraction) - **ResNet50** Transfer Learning (with ResNet-specific preprocessing: zero-centering) - **MobileNetV2** Transfer Learning (with MobileNet-specific preprocessing: [-1,1] scaling) - **EfficientNetB0** Transfer Learning (with EfficientNet-specific preprocessing: mean/std normalization) - Each model includes: frozen phase + fine-tuning phase 3. **Task 3: Data Augmentation Analysis Report** - Visual demonstration of 10 augmentation techniques - Combined augmentation pipeline (rotation, shift, shear, zoom, flip, brightness) - Rationale and impact analysis 4. **Model Comparison Report** - Side-by-side comparison of 9 model configurations - Accuracy, F1-Score, Precision, Recall, Training Time - Confusion matrices for all models - Classification reports - Visual bar chart comparisons 5. **Challenges Faced & Techniques Used Report** - Small dataset challenge → Augmentation + Transfer Learning - Overfitting → Dropout, EarlyStopping, BatchNorm - Variable dimensions → Standardized resizing to 224x224 - Preprocessing compatibility → Model-specific `preprocess_input` - Class imbalance → Stratified splits - Gradient issues → BatchNormalization - Learning rate selection → ReduceLROnPlateau - Fine-tuning strategy → Progressive unfreezing - Background noise → Random crops/shifts ### Dataset - **Source**: PRCP-1001 RiceLeaf.zip - **Classes**: Bacterial leaf blight (40), Brown spot (40), Leaf smut (39) - **Total**: 119 images - **Split**: 60% Train / 20% Validation / 20% Test (stratified) ### Preprocessing Note > **Each transfer learning model uses its own dedicated preprocessing pipeline** (applied inside the Keras model graph via `preprocess_input`): > > | Model | Preprocessing | > |-------|--------------| > | VGG16 | BGR + ImageNet mean subtraction | > | ResNet50 | Zero-centering (÷255 - mean) | > | MobileNetV2 | Scale to [-1, 1] (÷127.5 - 1) | > | EfficientNetB0 | Mean/std normalization per channel | ### How to Use 1. Download the dataset from the provided link 2. Extract to `./Data/` with subfolders for each class 3. Run all cells sequentially in the notebook 4. Results (plots, JSON, classification reports) are generated inline ### Requirements ``` tensorflow, numpy, pandas, matplotlib, seaborn, opencv-python, scikit-learn, scikit-image ``` --- *Submitted as part of PRCP-1001 Capstone Project* ## Generated by ML Intern This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub. - Try ML Intern: https://smolagents-ml-intern.hf.space - Source code: https://github.com/huggingface/ml-intern