遇见数据集

WF59050/PlantVillage

收藏
Hugging Face2026-03-23 更新2026-03-29 收录
官方服务:

资源简介:

--- language: - en license: cc-by-sa-3.0 task_categories: - image-classification tags: - agriculture - plant-disease - biology dataset_info: features: - name: image dtype: image - name: image_path dtype: string - name: label dtype: class_label: names: '0': Apple___Apple_scab '1': Apple___Black_rot '2': Apple___Cedar_apple_rust '3': Apple___healthy '4': Blueberry___healthy '5': Cherry_(including_sour)___Powdery_mildew '6': Cherry_(including_sour)___healthy '7': Corn_(maize)___Cercospora_leaf_spot Gray_leaf_spot '8': Corn_(maize)___Common_rust_ '9': Corn_(maize)___Northern_Leaf_Blight '10': Corn_(maize)___healthy '11': Grape___Black_rot '12': Grape___Esca_(Black_Measles) '13': Grape___Leaf_blight_(Isariopsis_Leaf_Spot) '14': Grape___healthy '15': Orange___Haunglongbing_(Citrus_greening) '16': Peach___Bacterial_spot '17': Peach___healthy '18': Pepper,_bell___Bacterial_spot '19': Pepper,_bell___healthy '20': Potato___Early_blight '21': Potato___Late_blight '22': Potato___healthy '23': Raspberry___healthy '24': Soybean___healthy '25': Squash___Powdery_mildew '26': Strawberry___Leaf_scorch '27': Strawberry___healthy '28': Tomato___Bacterial_spot '29': Tomato___Early_blight '30': Tomato___Late_blight '31': Tomato___Leaf_Mold '32': Tomato___Septoria_leaf_spot '33': Tomato___Spider_mites Two-spotted_spider_mite '34': Tomato___Target_Spot '35': Tomato___Tomato_Yellow_Leaf_Curl_Virus '36': Tomato___Tomato_mosaic_virus '37': Tomato___healthy - name: crop dtype: string - name: disease dtype: string - name: leaf_id dtype: string config_name: color splits: - name: train num_bytes: 43596 num_examples: 43596 - name: test num_bytes: 10709 num_examples: 10709 download_size: 2000000000 dataset_size: 2000000000 --- # PlantVillage Dataset [![Paper](https://img.shields.io/badge/Paper-Read-green)](https://www.frontiersin.org/journals/plant-science/articles/10.3389/fpls.2016.01419/full) [![GitHub](https://img.shields.io/badge/GitHub-Repository-black)](https://github.com/spMohanty/PlantVillage-Dataset) <img src="https://raw.githubusercontent.com/spMohanty/PlantVillage-Dataset/master/generated_for_paper/plantvillage.jpg" alt="PlantVillage Dataset Sample" width="600"/> 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**. This dataset was introduced in the paper [**"Using Deep Learning for Image-Based Plant Disease Detection"**](https://www.frontiersin.org/journals/plant-science/articles/10.3389/fpls.2016.01419/full) by Mohanty et al. (2016). ## Quick Start The dataset comes with pre-defined **80/20 train/test splits** that preserve the leaf grouping logic (ensuring images of the same leaf do not appear in both sets). ```python from datasets import load_dataset # Load the default configuration (color images) # This automatically downloads the train and test splits. dataset = load_dataset("mohanty/PlantVillage", "color") print(dataset) # DatasetDict({ # train: Dataset({ features: [...], num_rows: 43596 }), # test: Dataset({ features: [...], num_rows: 10709 }) # }) ``` ## Dataset Configurations You can choose from three configurations depending on your needs: | Configuration | Description | Usage | |---|---|---| | **`color`** | Original RGB images (Default) | `load_dataset("mohanty/PlantVillage", "color")` | | **`grayscale`** | Grayscale versions | `load_dataset("mohanty/PlantVillage", "grayscale")` | | **`segmented`** | Background removed, leaf segmented | `load_dataset("mohanty/PlantVillage", "segmented")` | ## Advanced: Custom Splitting **Note:** The dataset **already includes** a standard train/test split (as shown in Quick Start), which is recommended for benchmarking. The instructions below are only for **advanced users** who require custom cross-validation folds. If you require a different split ratio or cross-validation scheme, you **must** strictly respect the `leaf_id` to prevent data leakage. Multiple images often capture the same physical leaf; separating them across train/test sets will bias your evaluation. Here is a complete example of how to reshuffle and split the dataset 80/20: ```python import numpy as np from datasets import load_dataset, concatenate_datasets # 1. Load the full dataset (combining default train/test splits) dataset = load_dataset("mohanty/PlantVillage", "color") full_dataset = concatenate_datasets([dataset["train"], dataset["test"]]) # 2. Get unique leaf IDs representing physical leaves all_leaf_ids = np.unique(full_dataset["leaf_id"]) # 3. Shuffle and Split Leaf IDs (e.g., 80% train, 20% test) np.random.seed(42) np.random.shuffle(all_leaf_ids) split_ratio = 0.8 split_idx = int(len(all_leaf_ids) * split_ratio) train_leaf_ids = set(all_leaf_ids[:split_idx]) test_leaf_ids = set(all_leaf_ids[split_idx:]) # 4. Filter the full dataset to create new splits # This ensures all images of a specific leaf are exclusively in one split custom_train = full_dataset.filter(lambda x: x["leaf_id"] in train_leaf_ids) custom_test = full_dataset.filter(lambda x: x["leaf_id"] in test_leaf_ids) print(f"Custom Train Size: {len(custom_train)}") print(f"Custom Test Size: {len(custom_test)}") ``` ## Dataset Features - **`image`**: PIL Image. - **`label`**: Class label (e.g., `Apple___Black_rot`). - **`leaf_id`**: Unique identifier for the physical leaf. - **`crop`**: Crop name. - **`disease`**: Disease name. ## Citation ```bibtex @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**

语言:英语 许可协议:知识共享署名-相同方式共享3.0(CC-BY-SA-3.0) 任务类别:图像分类 标签:农业、植物病害、生物学 数据集信息: 字段: - `image`:图像数据 - `image_path`:图像路径(字符串类型) - `label`:类别标签,其类别映射如下: 0: 苹果疮痂病(Apple___Apple_scab) 1: 苹果黑腐病(Apple___Black_rot) 2: 苹果雪松苹果锈病(Apple___Cedar_apple_rust) 3: 健康苹果(Apple___healthy) 4: 健康蓝莓(Blueberry___healthy) 5: 樱桃(含酸樱桃)白粉病(Cherry_(including_sour)___Powdery_mildew) 6: 健康樱桃(含酸樱桃)(Cherry_(including_sour)___healthy) 7: 玉米灰斑病(Cercospora叶斑病)(Corn_(maize)___Cercospora_leaf_spot Gray_leaf_spot) 8: 玉米普通锈病(Corn_(maize)___Common_rust_) 9: 玉米北方叶枯病(Corn_(maize)___Northern_Leaf_Blight) 10: 健康玉米(Corn_(maize)___healthy) 11: 葡萄黑腐病(Grape___Black_rot) 12: 葡萄埃斯卡病(黑色麻疹)(Grape___Esca_(Black_Measles)) 13: 葡萄叶枯病(Isariopsis叶斑病)(Grape___Leaf_blight_(Isariopsis_Leaf_Spot)) 14: 健康葡萄(Grape___healthy) 15: 橙子黄龙病(Citrus绿斑驳病)(Orange___Haunglongbing_(Citrus_greening)) 16: 桃细菌性斑点病(Peach___Bacterial_spot) 17: 健康桃(Peach___healthy) 18: 甜椒细菌性斑点病(Pepper,_bell___Bacterial_spot) 19: 健康甜椒(Pepper,_bell___healthy) 20: 马铃薯早疫病(Potato___Early_blight) 21: 马铃薯晚疫病(Potato___Late_blight) 22: 健康马铃薯(Potato___healthy) 23: 健康树莓(Raspberry___healthy) 24: 健康大豆(Soybean___healthy) 25: 南瓜白粉病(Squash___Powdery_mildew) 26: 草莓叶灼病(Strawberry___Leaf_scorch) 27: 健康草莓(Strawberry___healthy) 28: 番茄细菌性斑点病(Tomato___Bacterial_spot) 29: 番茄早疫病(Tomato___Early_blight) 30: 番茄晚疫病(Tomato___Late_blight) 31: 番茄叶霉病(Tomato___Leaf_Mold) 32: 番茄Septoria叶斑病(Tomato___Septoria_leaf_spot) 33: 番茄二斑叶螨危害(Tomato___Spider_mites Two-spotted_spider_mite) 34: 番茄靶斑病(Tomato___Target_Spot) 35: 番茄黄化曲叶病毒病(Tomato___Tomato_Yellow_Leaf_Curl_Virus) 36: 番茄花叶病毒病(Tomato___Tomato_mosaic_virus) 37: 健康番茄(Tomato___healthy) - `crop`:作物名称(字符串类型) - `disease`:病害名称(字符串类型) - `leaf_id`:叶片唯一标识符(字符串类型) 配置名称:color 数据集划分: - 训练集(train):数据量43596字节,样本数43596 - 测试集(test):数据量10709字节,样本数10709 下载大小:2000000000字节 数据集总大小:2000000000字节 # 植物村落(PlantVillage)数据集 [![论文](https://img.shields.io/badge/Paper-Read-green)](https://www.frontiersin.org/journals/plant-science/articles/10.3389/fpls.2016.01419/full) [![GitHub仓库](https://img.shields.io/badge/GitHub-Repository-black)](https://github.com/spMohanty/PlantVillage-Dataset) <img src="https://raw.githubusercontent.com/spMohanty/PlantVillage-Dataset/master/generated_for_paper/plantvillage.jpg" alt="PlantVillage 数据集示例" width="600"/> **植物村落(PlantVillage)数据集**是开放获取的图像库,收录了54306张健康与染病植物叶片图像,旨在推动自动化植物病害诊断领域的研究。该数据集涵盖14种作物与26种病害。 本数据集由Mohanty等人于2016年在论文《**基于深度学习的图像式植物病害检测**》中首次发布。 ## 快速入门 该数据集自带预定义的**80/20训练/测试集划分**,遵循叶片分组规则(确保同一叶片的图像不会同时出现在训练集与测试集中)。 python from datasets import load_dataset # 加载默认配置(彩色图像) # 该命令将自动下载训练集与测试集 dataset = load_dataset("mohanty/PlantVillage", "color") print(dataset) # DatasetDict({ # train: Dataset({ features: [...], num_rows: 43596 }), # test: Dataset({ features: [...], num_rows: 10709 }) # }) ## 数据集配置 您可根据需求选择以下三种配置: | 配置项 | 描述 | 使用方式 | |---|---|---| | **`color`** | 原始RGB图像(默认配置) | `load_dataset("mohanty/PlantVillage", "color")` | | **`grayscale`** | 灰度版本图像 | `load_dataset("mohanty/PlantVillage", "grayscale")` | | **`segmented`** | 移除背景、仅保留叶片的分割图像 | `load_dataset("mohanty/PlantVillage", "segmented")` | ## 进阶:自定义数据集划分 **注意**:本数据集已包含标准的训练/测试集划分(如快速入门部分所示),该划分适用于基准测试。以下操作仅适用于需要自定义交叉验证折的高级用户。 若您需要不同的划分比例或交叉验证方案,必须严格遵循`leaf_id`字段以避免数据泄露。同一物理叶片通常对应多张图像,若将其拆分至不同集合会导致评估结果产生偏差。 以下为完整示例,展示如何将数据集按80/20比例重新划分: python import numpy as np from datasets import load_dataset, concatenate_datasets # 1. 加载完整数据集(合并默认的训练集与测试集) dataset = load_dataset("mohanty/PlantVillage", "color") full_dataset = concatenate_datasets([dataset["train"], dataset["test"]]) # 2. 获取代表物理叶片的唯一叶片ID all_leaf_ids = np.unique(full_dataset["leaf_id"]) # 3. 打乱并划分叶片ID(例如80%用于训练,20%用于测试) np.random.seed(42) np.random.shuffle(all_leaf_ids) split_ratio = 0.8 split_idx = int(len(all_leaf_ids) * split_ratio) train_leaf_ids = set(all_leaf_ids[:split_idx]) test_leaf_ids = set(all_leaf_ids[split_idx:]) # 4. 过滤完整数据集以创建新的划分 # 该操作可确保特定叶片的所有图像仅属于一个集合 custom_train = full_dataset.filter(lambda x: x["leaf_id"] in train_leaf_ids) custom_test = full_dataset.filter(lambda x: x["leaf_id"] in test_leaf_ids) print(f"自定义训练集大小: {len(custom_train)}") print(f"自定义测试集大小: {len(custom_test)}") ## 数据集字段说明 - **`image`**:PIL格式图像 - **`label`**:类别标签(例如`Apple___Black_rot`,即苹果黑腐病) - **`leaf_id`**:物理叶片的唯一标识符 - **`crop`**:作物名称 - **`disease`**:病害名称 ## 引用格式 bibtex @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} } ## 作者 Sharada Mohanty <sharada.mohanty@epfl.ch> Marcel Salathé <Marcel.Salathe@epfl.ch> **EPFL数字流行病学实验室**

提供机构:
WF59050
二维码
社区交流群
二维码
科研交流群
商业服务