Downloads · 30 days
0
PulinduVR/corn-gray-leaf-spot-xai
corn-gray-leaf-spot-xai is a image classification model from PulinduVR. Use it when you need a label for an image. The card lists the license as mit.
This repository provides four PyTorch models trained for binary classification of corn (maize) leaf images into the following categories: - Healthy - Gray Leaf Spot (Cercospora Leaf Spot)
Downloads · 30 days
0
Access
Public
Updated Dec 28, 2025
Repo size
221 MB
Likes
0
Public
Click a slice to open those files.
.pth221 MB · 100%
From the Hugging Face model README
This repository provides four PyTorch models trained for binary classification of corn (maize) leaf images into the following categories:
The models were developed as part of a research study focused on improving the transparency and trustworthiness of deep learning–based plant disease detection systems using explainable artificial intelligence techniques.
Training Dataset:
PlantVillage dataset (Corn Healthy and Corn Gray Leaf Spot classes)
External Evaluation Dataset:
PlantDoc dataset (used to evaluate generalization performance)
All trained models were analyzed using Gradient-weighted Class Activation Mapping (Grad-CAM) to visualize the spatial regions of the leaf images that most strongly influenced model predictions. This helps verify whether the models focus on biologically meaningful disease symptoms rather than irrelevant background features.
Users can perform inference on their own corn leaf images using the provided
inference.py script.
git clone https://huggingface.co/PulinduVR/corn-gray-leaf-spot-xai
python -m venv venv
source venv/bin/activate # Linux / macOS
venv\Scripts\activate # Windows
pip install -r requirements.txt
python inference.py --image ./path/to/image --model_path ./saved_models/path/to/model/you/want --model_type [EfficientNet / ResNet]
python inference.py --image ./test_images/healthy.jpg --model_path ./saved_models/EfficientNet_basic/model.pth --model_type EfficientNet
python inference.py --image ./test_images/diseased.jpg --model_path ./saved_models/ResNet50_basic/model.pth --model_type ResNet
Below are examples of the corn leaf.
| Healthy Maize Leaf | Gray Leaf Spot (Cercospora zeae-maydis) |
|---|---|
![]() | ![]() |
| Prediction: Healthy | Prediction: Gray Leaf Spot |
Refer to inference.py for implementation details related to:
If you use these models or this repository in your research, please cite our paper:
Explainable Deep Learning for Early Detection of Corn Gray Leaf Spot Using Grad-CAM
This project is intended for academic and research use.
Please review the licenses of the PlantVillage and PlantDoc datasets before any
commercial deployment.