Skip to content

Janice0381/Fall2025-Computer-Vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌿 Plant Disease Classification with EfficientNet and XAI

Leaf Segmentation · Domain Gap Reduction · Explainable AI

Python PyTorch EfficientNet


🔍 Overview

This repository implements a complete pipeline for plant disease classification and model interpretability.

We address the domain discrepancy between laboratory images (PlantVillage) and real-world field images (PlantDoc) by proposing a class-dependent leaf segmentation pipeline.

We train EfficientNet-B1 models on the processed datasets and utilize XAI (Explainable AI) methods—Grad-CAM, Score-CAM, and Layer-CAM—to visually verify whether the model focuses on the correct disease lesions.

Key Features

  • Domain Gap Reduction: Segmentation-based preprocessing to isolate leaves from complex backgrounds.
  • Efficient Classification: Fine-tuned EfficientNet-B1 for robust performance on small datasets.
  • Explainability (XAI): Attention visualization (Grad-CAM / Score-CAM / Layer-CAM) to improve reliability.

📁 Project Structure

├── demo.ipynb                     # Demo notebook for running XAI (Grad-CAM, etc.)
├── preprocessing/
│   └── segmentation_final.ipynb   # Preprocessing & segmentation pipeline
├── checkpoints/
│   ├── doc_model_best.pt          # Trained model for PlantDoc
│   └── village_model_best.pt      # Trained model for PlantVillage
├── samples/                       # Test images for demo
│   ├── Potato_Early_blight.JPG
│   └── Tomato_leaf_late_blight.jpg
├── results/                       # Saved XAI results
│   ├── PlantDoc-Result/
│   └── PlantVillage-Result/
├── requirements.txt               # Python dependencies
└── README.md

🛠️ Installation

1) Clone the repository

git clone https://github.com/Janice0381/Fall2025-Computer-Vision.git
cd Fall2025-Computer-Vision

2) Install dependencies (Python 3.8+ recommended)

pip install -r requirements.txt

🚀 How to Run Demo

  1. Check model & data

    Ensure the .pt model files are located in the checkpoints/ directory.

  2. Run the notebook

    jupyter notebook demo.ipynb
  3. View results After running the notebook, the original image and its corresponding heatmaps (Grad-CAM, Score-CAM, Layer-CAM) will be saved in the results/ directory.

👥 Contributors

Minji Kim

Gayoung Kim

Seun Kim

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors