Skip to content

Paddy Leaf Disease Detection using Transfer-Learning CNNs with Grad-CAM Explanations

  • 12 slides
  • 16 viva questions
  • 6 modules
  • Code included

@paddy-leaf-disease-detection-gradcamUpdated Oct 2026

MobileNetV2, EfficientNet-B0 and ResNet50 compared under stratified k-fold, with heatmaps a farmer can check

M.Sc, Computer Science · Sem 4 · Advanced · 24 weeks · Solo

More info
Level
Advanced · 24 weeks · Solo
Relevant for
Tamil Nadu
Common at
Bharathiar University, University of Madras
Syllabus
Bharathiar University M.Sc CS 2023-24 · Project Work & Viva-Voce · Semester 4
Tech stack
  • Python 3.11
  • TensorFlow 2 / Keras
  • OpenCV
  • NumPy
  • pandas
  • scikit-learn
  • Matplotlib
  • Streamlit
  • pytest
  • MATLAB Image Processing Toolbox (optional comparison)
For educational purposes only

Unlock this project

Full PPT + speaker notes, source code and setup steps, READMEFIRST, instructions and all 16 viva answers.

One-time. No subscription, no auto-renew, no drama.

Project packs

Credits never expire and work on any project. Use one here, save the rest for your friend who “will pay you back”.

  1. Pinned

    1 min

    Overview

    NelScan is a research-oriented M.Sc Computer Science dissertation that classifies common paddy (rice) leaf diseases from photographs and explains each prediction with a Grad-CAM heatmap. Paddy is the principal crop of the Cauvery delta and much of Tamil Nadu, and diseases such as bacterial leaf blight, brown spot, leaf smut and blast can cut yields sharply if they are not recognised early. Extension staff are few, and a farmer who photographs a leaf needs an answer and a reason to trust it.

    The project uses public rice-leaf disease image datasets — for example the UCI Rice Leaf Diseases dataset (three classes) — optionally supplemented with a small set of field photographs collected with the farmer's consent. Images are cleaned, resized and augmented, and transfer learning is applied with three ImageNet-pretrained backbones: MobileNetV2, EfficientNet-B0 and ResNet50, in TensorFlow-Keras. Class imbalance is handled with class weights and balanced augmentation, and every model is evaluated with stratified 5-fold cross-validation, confusion matrices and macro-F1.

    Grad-CAM shows which region of the leaf drove each decision, so the student can check whether the network is looking at lesions or at the background. A lightweight Streamlit demo lets a user upload a photo and see the predicted class, confidence and heatmap. An optional MATLAB colour-feature baseline gives a classical comparison, linking the work to the Digital Image Processing and AI & ML courses.

    Syllabus alignment

    Bharathiar University · M.Sc CS 2023-24

    Project Work & Viva-Voce · Semester 4 · 8 credits · 200 (project 100 + viva 50 + …)

    Subjects this project applies
    • Artificial Intelligence & Machine Learning
    • Python Programming
    • Digital Image Processing (MATLAB)
    • Data Science
    • Web App Development & Hosting
    How it is evaluated

    See your department's project guidelines.

    Also fits: University of Madras PG CBCS.

    1 min read · 16 viva questions

  2. 2 min

    Synopsis

    Abstract

    Early identification of paddy leaf diseases helps farmers apply the right treatment before losses spread. This dissertation investigates transfer learning with three convolutional neural network backbones — MobileNetV2, EfficientNet-B0 and ResNet50 — for classifying paddy leaf images into disease classes, and uses Gradient-weighted Class Activation Mapping (Grad-CAM) to explain predictions. The study follows a documented protocol: stratified 5-fold cross-validation, class-imbalance handling, a held-out test split and an optional field-photo test to measure the drop from laboratory images to real conditions. Results are reported in a pre-defined table; no accuracy is claimed before the experiments are run.

    Introduction

    In Tamil Nadu, paddy is grown across the kuruvai, samba and thaladi seasons, and leaf diseases are usually identified by eye by the farmer or an agricultural officer. Photographs taken on a phone are an easy input, and convolutional neural networks have become the standard tool for image classification. Training a network from scratch needs tens of thousands of labelled images; transfer learning reuses features learned on ImageNet and fine-tunes them on a few hundred or thousand leaf images.

    Existing Approaches and Research Gap

    • Classical pipelines segment lesions and extract colour and texture features (for example colour histograms or GLCM texture) followed by SVM or k-NN; they are interpretable but brittle under changing light and background.
    • CNN studies on public leaf datasets often report very high accuracy from a single random split, on clean images with plain backgrounds, and rarely show why the model decided.
    • Gap: a careful comparison of lightweight and heavy backbones under stratified k-fold, with explicit imbalance handling, Grad-CAM inspection of failure cases and an honest field-photo test.

    Proposed Work

    • Assemble and audit the dataset (duplicates, label noise, class counts).
    • Build an augmentation and preprocessing pipeline.
    • Fine-tune three backbones with identical protocol; compare accuracy, macro-F1, model size and inference time.
    • Generate Grad-CAM heatmaps for correct and incorrect predictions and analyse them.
    • Deploy the best lightweight model in a Streamlit demo.

    Feasibility

    • Technical: Python, TensorFlow and OpenCV are free; training runs on a laptop GPU or a free cloud notebook GPU.
    • Economic: no licence cost; MATLAB is used only where the college lab already has it.
    • Operational: the demo needs only a photo upload.
  3. 1 min

    Problem statement

    Paddy leaf diseases such as bacterial leaf blight, brown spot, leaf smut and blast reduce yield when they are not identified early, yet farmers depend on visual judgement and occasional visits from extension staff. Automated image classifiers exist in research papers, but many are evaluated on a single random split of clean laboratory images, give no explanation for their predictions and are too heavy to run on modest hardware, so their reported accuracy says little about real use.

    This dissertation addresses the problem of building a reliable and explainable paddy leaf disease classifier: comparing transfer-learning CNN backbones of different sizes under a rigorous stratified cross-validation protocol with class-imbalance handling, measuring performance on independent field photographs, and using Grad-CAM to verify that predictions are driven by disease lesions rather than background artefacts.

  4. 1 min

    Objectives & scope

    1. 01Assemble, audit and document a paddy leaf disease image dataset from public sources, optionally adding consented field photographs.
    2. 02Design a preprocessing and augmentation pipeline suited to leaf images captured in the field.
    3. 03Fine-tune MobileNetV2, EfficientNet-B0 and ResNet50 with an identical transfer-learning protocol in TensorFlow-Keras.
    4. 04Handle class imbalance with class weights and balanced augmentation, and compare against an unweighted run.
    5. 05Evaluate every model with stratified 5-fold cross-validation using accuracy, macro-F1, per-class recall and confusion matrices.
    6. 06Generate and analyse Grad-CAM heatmaps for correct and misclassified images.
    7. 07Compare against a classical colour-and-texture feature baseline (optional MATLAB or scikit-learn).
    8. 08Deploy the best lightweight model in a Streamlit demo showing class, confidence and heatmap.

    Scope

    In scope

    • Leaf-level image classification into a fixed set of disease classes plus healthy (where the dataset has a healthy class).
    • Three pretrained backbones, one training framework (TensorFlow-Keras), one explanation method (Grad-CAM).
    • Stratified k-fold evaluation, a held-out test split and an optional small field-photo test set.
    • A local Streamlit demo.

    Out of scope

    • Pest identification, nutrient deficiency, whole-plant or drone imagery.
    • Severity estimation or pesticide recommendations; the demo advises consulting an agricultural officer.
    • Mobile app deployment (suggested as future work with TensorFlow Lite).
  5. 1 min

    Methodology

    The dissertation follows an experimental research design in six stages over about 24 weeks.

    StageWeeksActivitiesOutput
    Literature review1–3Plant disease classification, transfer learning, Grad-CAM, evaluation pitfallsReview chapter
    Data collection & audit4–6Download public dataset(s), remove duplicates with perceptual hashing, check labels, optional field photos with consentData description, class table
    Preprocessing7–8Resize to 224×224, backbone-specific normalisation, augmentation (flips, rotation, brightness, zoom)Data pipeline
    Baseline9–10Colour histogram + texture features with SVM (optionally in MATLAB)Baseline results
    Transfer learning11–16Stage 1: frozen backbone, train head. Stage 2: unfreeze top blocks, lower learning rate. Class weights; early stoppingTrained models per fold
    Explanation & analysis17–19Grad-CAM on test images, failure analysis, field-photo testHeatmap figures
    Demo & writing20–24Streamlit app, thesis writing, viva preparationDissertation, demo

    Evaluation protocol. Hold out 15% of images as a final test set, stratified by class. On the remaining 85%, run StratifiedKFold(n_splits=5, shuffle=True, random_state=42); augmentation is applied only to training folds. Report mean ± standard deviation of accuracy and macro-F1 across folds, the confusion matrix on the test set, model size (MB), parameters and average CPU inference time per image. If field photos are collected, report them separately — they are never mixed into training.

    Results table to fill: rows = SVM baseline, MobileNetV2, EfficientNet-B0, ResNet50 (each with and without class weights); columns = CV accuracy, CV macro-F1, test accuracy, test macro-F1, field macro-F1, size, inference time.

  6. 1 min

    Architecture & tech stack

    • Python 3.11
    • TensorFlow 2 / Keras
    • OpenCV
    • NumPy
    • pandas
    • scikit-learn
    • Matplotlib
    • Streamlit
    • pytest
    • MATLAB Image Processing Toolbox (optional comparison)

    The system has an offline experiment pipeline and an online demo. Both share the same preprocessing code so the demo sees images exactly as the model did during training.

    flowchart TD
      A["Public leaf datasets"] --> C["Audit: duplicates, labels, class counts"]
      B["Optional field photos (consented)"] --> C
      C --> S["Stratified split: 85% CV pool, 15% test"]
      S --> K["StratifiedKFold (k = 5)"]
      K --> P["Preprocess and augment (train folds only)"]
      P --> T["Transfer learning: MobileNetV2 / EfficientNet-B0 / ResNet50"]
      T --> E["Metrics: accuracy, macro-F1, confusion matrix"]
      T --> G["Grad-CAM heatmaps"]
      E --> R["Results table and error analysis"]
      G --> R
      T --> M["Best lightweight model (.keras)"]
      M --> D["Streamlit demo: upload, predict, heatmap"]

    Model design

    Each backbone is loaded with ImageNet weights and include_top=False. The head is global average pooling, dropout (0.3) and a dense softmax layer with one unit per class. Stage 1 trains only the head with Adam (learning rate 1e-3); stage 2 unfreezes the top blocks and fine-tunes with 1e-5. Batch-normalisation layers stay in inference mode during fine-tuning to avoid destroying pretrained statistics on a small dataset.

    Grad-CAM

    For a predicted class, Grad-CAM computes the gradient of the class score with respect to the feature maps of the last convolutional layer, averages the gradients spatially to get one weight per channel, forms a weighted sum of the maps, applies ReLU and upsamples the result to the image size. The heatmap is overlaid on the leaf. A good model highlights lesions; a model that highlights the background or a hand reveals a dataset shortcut.

  7. 6 modules

    Modules

    • Dataset Audit & Management

      Scripts that download or load the public dataset, detect near-duplicate images with perceptual hashing, record class counts, create the stratified test split and fold indices, and save them to CSV so every experiment uses identical splits.

    • Preprocessing & Augmentation

      A tf.data pipeline that resizes to 224 by 224, applies the backbone's own preprocessing function, and augments training folds with flips, small rotations, brightness and zoom changes, without touching validation or test images.

    • Classical Baseline

      Colour histogram in HSV plus texture features fed to an SVM with scikit-learn, with an optional MATLAB implementation from the Digital Image Processing lab, giving a non-deep-learning reference point for the results table.

    • Transfer-Learning Trainer

      A single configurable trainer for MobileNetV2, EfficientNet-B0 and ResNet50 with two-stage fine-tuning, class weights, early stopping and checkpointing, run for each of the five folds and logged to CSV for later analysis.

    • Evaluation & Grad-CAM Explainer

      Computes accuracy, macro-F1, per-class recall and confusion matrices, measures model size and inference time, and generates Grad-CAM overlays for a fixed sample of correct and misclassified test images for the analysis chapter.

    • Streamlit Demo

      Upload or capture a leaf photo, see the predicted disease, top-3 probabilities and the Grad-CAM heatmap, with a clear note that the result is advisory and that an agricultural officer should confirm it.

  8. Locked

    Presentation

    12 slides with speaker notes. The outline below is free; the bullets, notes and the generated .pptx unlock with the project.

    1. Paddy Leaf Disease Detection with Transfer Learning and Grad-CAM
    2. Motivation
    3. Research Gap
    4. Objectives
    5. Dataset
    6. Methodology
    7. Backbones Compared
    8. Grad-CAM
    9. Results
    10. Confusion Matrix & Heatmaps
    11. Demo
    12. Conclusion & Future Work

    Bullets, speaker notes and the .pptx download unlock with the project.

    Presentation is locked: 12 slides, Speaker notes, .pptx download.

  9. 1 min

    Future scope

    • On-device deployment using TensorFlow Lite on Android for offline use in the field.
    • Tamil-language interface with voice output for farmers.
    • Severity estimation by segmenting lesion area as a percentage of leaf area.
    • Larger, geographically diverse field dataset from Tamil Nadu districts through agricultural colleges.
    • Other explanation methods (Grad-CAM++, occlusion sensitivity) and a quantitative comparison with expert-marked lesions.
  10. 11 sources

    References

    1. R. R. Selvaraju et al., Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization, ICCV 2017
    2. M. Sandler et al., MobileNetV2: Inverted Residuals and Linear Bottlenecks, CVPR 2018
    3. M. Tan & Q. V. Le, EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks, ICML 2019
    4. K. He, X. Zhang, S. Ren & J. Sun, Deep Residual Learning for Image Recognition, CVPR 2016
    5. UCI Machine Learning Repository — Rice Leaf Diseases dataset
    6. TensorFlow tutorial: Transfer learning and fine-tuning
    7. Keras Applications (pretrained models)
    8. Keras code example: Grad-CAM class activation visualization
    9. scikit-learn: StratifiedKFold
    10. TNAU Agritech Portal — crop protection information for rice
    11. Rafael C. Gonzalez & Richard E. Woods, Digital Image Processing, 4th ed., Pearson

    Cite this bundle

    OnlyProjects. (2026). Paddy Leaf Disease Detection using Transfer-Learning CNNs with Grad-CAM Explanations: M.Sc Computer Science project bundle [Educational resource]. https://onlyprojects.online/projects/msc-cs-paddy-leaf-disease-detection-gradcam

Slides, diagrams & files

12 slides. Titles are free; bullets, speaker notes and the .pptx unlock with the project.

  1. SLIDE 1

    Paddy Leaf Disease Detection with Transfer Learning and Grad-CAM

  2. SLIDE 2

    Motivation

  3. SLIDE 3

    Research Gap

  4. SLIDE 4

    Objectives

  5. SLIDE 5

    Dataset

  6. SLIDE 6

    Methodology

  7. SLIDE 7

    Backbones Compared

  8. SLIDE 8

    Grad-CAM

  9. SLIDE 9

    Results

  10. SLIDE 10

    Confusion Matrix & Heatmaps

  11. SLIDE 11

    Demo

  12. SLIDE 12

    Conclusion & Future Work

Architecture diagram

1
flowchart TD
  A["Public leaf datasets"] --> C["Audit: duplicates, labels, class counts"]
  B["Optional field photos (consented)"] --> C
  C --> S["Stratified split: 85% CV pool, 15% test"]
  S --> K["StratifiedKFold (k = 5)"]
  K --> P["Preprocess and augment (train folds only)"]
  P --> T["Transfer learning: MobileNetV2 / EfficientNet-B0 / ResNet50"]
  T --> E["Metrics: accuracy, macro-F1, confusion matrix"]
  T --> G["Grad-CAM heatmaps"]
  E --> R["Results table and error analysis"]
  G --> R
  T --> M["Best lightweight model (.keras)"]
  M --> D["Streamlit demo: upload, predict, heatmap"]

Files

Viva questions & answers

3 of 16 questions free. Explain each answer in your own words before you move on.

  1. Concept

    What is transfer learning and why is it suitable for this problem?

    Transfer learning reuses a network trained on a large dataset such as ImageNet and adapts it to a new task. Early layers already detect edges, colours and textures, which also describe leaf lesions, so with only a few hundred or thousand paddy images I fine-tune instead of training millions of weights from scratch.

  2. Concept

    Explain how Grad-CAM works.

    Grad-CAM takes the gradient of the predicted class score with respect to the last convolutional feature maps, averages each channel's gradients to get an importance weight, forms a weighted sum of the maps, applies ReLU to keep positive evidence and upsamples it over the image to show which leaf regions drove the decision.

  3. Concept

    Why did you compare MobileNetV2, EfficientNet-B0 and ResNet50?

    They represent different size and design trade-offs: MobileNetV2 uses depthwise separable convolutions and is small enough for phones, EfficientNet-B0 balances depth, width and resolution, and ResNet50 is a heavier residual network. Comparing them shows whether extra capacity actually helps on a small leaf dataset.

+13 more questions

They and the answers unlock with the project. Try answering the ones above yourself first. Your examiner will.

For educational purposes only. Use this bundle to understand how the project works, then build and write your own. Submitting it verbatim is between you, your conscience and your external examiner.