--- license: mit task_categories: - image-classification - image-to-text language: - en tags: - agriculture - plant-disease - crop-disease - nepal - sharegpt - multimodal pretty_name: Nepali Crop Disease Dataset size_categories: - 10K Mendeley Data (`6243z8r6t6`) was originally scoped for inclusion but was > dropped from this build. **Please refer to each original source for its own license and citation requirements** — this dataset does not override or supersede those terms. If you are a maintainer of one of the source datasets and have concerns about inclusion or attribution, please open a discussion on this repo. ## Dataset Structure ``` train//*.jpg val//*.jpg test//*.jpg labels_registry.jsonl sharegpt.jsonl zips/dataset_part_*.zip # full archive, for bulk download ``` ### `labels_registry.jsonl` One row per image: ```json {"image": "train/tomato/abc123.jpg", "split": "train", "crop": "tomato", "disease": "early blight", "label_source": "metadata"} ``` ### `sharegpt.jsonl` One conversation per image, formatted for VLM instruction finetuning: ```json { "id": "0000001", "image": "train/tomato/abc123.jpg", "conversations": [ {"from": "human", "value": "\nWhat crop is shown in this image, and does it have any disease? If so, name the disease."}, {"from": "gpt", "value": "This is a Tomato leaf affected by early blight."} ] } ``` Healthy images get an explicit no-disease answer; images where the disease label couldn't be confidently determined are marked as such rather than guessed. ## How to Load ### As an image folder (classification) ```python from datasets import load_dataset ds = load_dataset( "imagefolder", data_dir="train", # or point at an extracted local copy ) ``` ### As ShareGPT conversations (VLM finetuning) ```python from datasets import load_dataset ds = load_dataset( "json", data_files="sharegpt.jsonl", ) ``` Note: `image` paths in `sharegpt.jsonl` are relative to the repo root (e.g. `train/tomato/abc123.jpg`) — resolve them against your local copy of the `train/val/test` folders (or the extracted `zips/` archive) before loading images. ### From the zipped archive ```python from huggingface_hub import hf_hub_download import zipfile local_zip = hf_hub_download( repo_id="w4ashabii/nepali_crop_data", repo_type="dataset", filename="zips/dataset_part_000.zip", ) with zipfile.ZipFile(local_zip) as zf: zf.extractall("training_data") ``` ## Known Limitations - Crop and disease labels are extracted via keyword matching where source metadata wasn't available (`label_source: "foldername"`) — these may contain classification errors and should be spot-checked before use in high-stakes applications. - Crops with fewer than 300 available images were dropped to keep the balancing meaningful — this dataset does **not** cover every crop present in the original source datasets, only the 9 that had enough images. - Balancing is enforced at the **crop** level (equal images per crop) and approximately at the **disease** level within each crop (round-robin sampling) — it is not a strict guarantee of equal counts per individual disease across the whole dataset. Check `labels_registry.jsonl` if you need exact per-disease counts. - Image quality, resolution, and photographic conditions vary across the source datasets. ## Citation If you use this dataset, please cite the original source datasets listed above in addition to this repository.