Sovereign 8s.is mirror of standardgalactic/PlantVillage-Dataset
  • Python 79.8%
  • Shell 20.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-02-05 22:18:10 +00:00
data_distribution_for_SVM Rename svm data distribution 2016-09-02 18:53:56 +02:00
generated_for_paper Update README with plantvillage image 2026-02-05 21:09:19 +00:00
leaf_grouping First Commit 2016-08-04 12:52:10 +02:00
logs minor reorganization 2026-02-05 21:02:56 +00:00
raw First Commit 2016-08-04 12:52:10 +02:00
scripts Update HF repo link 2026-02-05 22:11:12 +00:00
utils First Commit 2016-08-04 12:52:10 +02:00
.gitignore minor reorganization 2026-02-05 21:02:56 +00:00
CITATION.cff minor reorganization 2026-02-05 21:02:56 +00:00
generate_data_for_SVM.py Adding data generation scripts and data for the baseline experiments using SVM 2016-09-02 16:07:36 +02:00
generate_lmdb.sh First Commit 2016-08-04 12:52:10 +02:00
generate_mapstring.py First Commit 2016-08-04 12:52:10 +02:00
leaf-map.json First Commit 2016-08-04 12:52:10 +02:00
plant_village.py Update README and add HF dataset 2026-02-05 22:09:14 +00:00
README.md Format citation block 2026-02-05 22:18:10 +00:00
README_HF.md Format citation block 2026-02-05 22:18:10 +00:00

PlantVillage Dataset

Hugging Face Paper

PlantVillage Dataset Sample

The PlantVillage Dataset is an open access repository of 54,306 images of healthy and diseased plant leaves, collected to advance research in automated plant disease diagnosis. It covers 14 crop species and 26 diseases, making it one of the largest publicly available datasets for computer vision in agriculture.

This dataset was introduced in the paper "Using Deep Learning for Image-Based Plant Disease Detection" by Mohanty et al. (2016). The goal of this work is to enable the development of smartphone-based disease diagnosis systems to help farmers worldwide safeguard their yields.

The easiest way to use this dataset is via the Hugging Face Hub.

Installation:

pip install datasets

Usage: It provides pre-defined 80/20 train/test splits that strictly respect the leaf grouping logic to prevent data leakage.

from datasets import load_dataset

# Load the dataset (default: color images)
dataset = load_dataset("mohanty/PlantVillage", "color")

For more details on configurations (grayscale, segmented) and advanced splitting, see the Hugging Face Model Card.


Repository Structure

The repository is organized as follows:

.
├── raw/                  # Raw image data
│   ├── color/            # Original RGB images
│   ├── grayscale/        # Grayscale versions
│   └── segmented/        # Segmented images
├── leaf_grouping/        # Metadata for leaf grouping
├── scripts/              # Data generation scripts
├── plant_village.py      # Hugging Face dataset loader
└── README.md

Usage

Requirement: This codebase was written for Python 2.7. Please ensure you have a Python 2 environment.

Download Dataset

With git installed:

git clone https://github.com/spMohanty/PlantVillage-Dataset
cd PlantVillage-Dataset

Dataset Upload (Maintenance)

To update the dataset on Hugging Face (e.g., after modifying metadata or adding images), use the provided script. This script handles zipping the data, uploading files, and updating the README.

Prerequisites:

  1. Install huggingface_hub (pip install huggingface_hub).
  2. Login via CLI: huggingface-cli login.

Run:

python3 scripts/upload_to_hf.py

Data Generation

The shell scripts in scripts/ utilize create_db.py to generate different versions of the dataset. Note: These scripts may contain hardcoded paths specific to the original cluster environment. They are provided for reference.

To run the Python tools directly (using Python 2):

python2 create_db.py --help

Citation

If you use this dataset, please consider citing:

@article{Mohanty_Hughes_Salathé_2016,
    title   = {Using deep learning for image-based plant disease detection},
    volume  = {7},
    DOI     = {10.3389/fpls.2016.01419},
    journal = {Frontiers in Plant Science},
    author  = {Mohanty, Sharada P. and Hughes, David P. and Salathé, Marcel},
    year    = {2016},
    month   = {Sep}
} 

Author

Sharada Mohanty sharada.mohanty@epfl.ch
Marcel Salathé Marcel.Salathe@epfl.ch
Digital Epidemiology Lab, EPFL