GitPedia

DeepLearning PlantDiseases

Training and evaluating state-of-the-art deep learning CNN architectures for plant disease classification task.

From MarkoArsenovic·Updated June 7, 2026·View on GitHub·

This is the source code of the experiment described in chapter [Deep Learning for Plant Diseases: Detection and Saliency Map Visualisation](https://link.springer.com/chapter/10.1007/978-3-319-90403-0_6) in a book **Human and Machine Learning, 2018**. The project is written primarily in Python, distributed under the Other license, first published in 2017. Key topics include: cnn-classification, deep-learning, deep-learning-cnn, deep-learning-visualization, occlusion.

Deep Learning for the plant disease detection

This is the source code of the experiment described in chapter Deep Learning for Plant Diseases: Detection and Saliency Map Visualisation in a book Human and Machine Learning, 2018.

Training and evaluating state-of-the-art deep architectures for plant disease classification task using pyTorch. <br/>
Models are trained on the preprocessed dataset which can be downloaded here.<br/>
Dataset is consisted of 38 disease classes from PlantVillage dataset and 1 background class from Stanford's open dataset of background images - DAGS.
<br/>
80% of the dataset is used for training and 20% for validation.

Usage:

  1. Train all the models with train.py and store the evaluation stats in stats.csv:
    python3 train.py
  2. Plot the models' results for every archetecture based on the stored stats with plot.py:
    python3 plot.py

Results:

The models on the graph were retrained on final fully connected layers only - shallow, for the entire set of parameters - deep or from its initialized state - from scratch.

ModelTraining typeTraining time [~h]Accuracy Top 1
AlexNetshallow0.870.9415
AlexNetfrom scratch1.050.9578
AlexNetdeep1.050.9924
DenseNet169shallow1.570.9653
DenseNet169from scratch3.160.9886
DenseNet169deep3.160.9972
Inception_v3shallow3.630.9153
Inception_v3from scratch5.910.9743
Inception_v3deep5.640.9976
ResNet34shallow1.130.9475
ResNet34from scratch1.880.9848
ResNet34deep1.880.9967
Squeezenet1_1shallow0.850.9626
Squeezenet1_1from scratch1.050.9249
Squeezenet1_1deep2.100.992
VGG13shallow1.490.9223
VGG13from scratch3.550.9795
VGG13deep3.550.9949

NOTE: All the others results are stored in stats.csv

Graph

Results

Visualization Experiments

@Contributor: Brahimi Mohamed

Prerequisites:

Train the new model or download pretrained models on 10 classes of Tomato from PlantVillage dataset: AlexNet or VGG13.

Occlusion Experiment

Occlusion experiments for producing the heat maps that show visually the influence of each region on the classification.

Usage:

Produce the heat map and plot with occlusion.py and store the visualizations in output_dir:

python3 occlusion.py /path/to/dataset /path/to/output_dir model_name.pkl /path/to/image disease_name

Visualization Examples on AlexNet:

Early Blight
Early blight - original, size 80 stride 10, size 100 stride 10
Late Blight
Late blight - original, size 80 stride 10, size 100 stride 10
Septoria Leaf Spot
Septoria leaf spot - original, size 50 stride 10, size 100 stride 10

Saliency Map Experiment

Saliency map is an analytical method that allows to estimate theimportance of each pixel, using only one forward and one backward pass through the network.

Usage:

Produce the visualization and plot with saliency.py and store the visualizations in output_dir:

python3 occlusion.py /path/to/model /path/to/dataset /path/to/image class_name

Visualization Examples on VGG13:

Early Blight
Early blight - Original, Naive backpropagation , Guided backpropagation
Late Blight
Late blight - Original, Naive backpropagation , Guided backpropagation
Septoria Leaf Spot
Septoria leaf spot - Original, Naive backpropagation , Guided backpropagation


NOTE: When using (any part) of this repository, please cite Deep Learning for Plant Diseases: Detection and Saliency Map Visualisation:

@Inbook{Brahimi2018,
  author     = "Brahimi, Mohammed and Arsenovic, Marko and Laraba, Sohaib and Sladojevic, Srdjan and Boukhalfa, Kamel and Moussaoui, Abdelouhab",
  editor     = "Zhou, Jianlong and Chen, Fang",
  title      = "Deep Learning for Plant Diseases: Detection and Saliency Map Visualisation",
  bookTitle  = "Human and Machine Learning: Visible, Explainable, Trustworthy and Transparent", year="2018",
  publisher  = "Springer International Publishing",
  address    = "Cham",
  pages      = "93--117",
  url        = "https://doi.org/10.1007/978-3-319-90403-0_6"
}

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from MarkoArsenovic/DeepLearning_PlantDiseases via the GitHub API.Last fetched: 6/24/2026