Datasets:
- 1. Directory Structure
- 2. Dataset Summary
- 3. Quick Start (Out-of-the-Box Execution)
- Installation
- Task 1: Disease Classification (
tasks/01_classification) - Task 2: Lesion Detection (
tasks/02_detection) - Task 3: Instance & Semantic Segmentation (
tasks/03_segmentation) - Task 4: Image–Text Retrieval & Zero-Shot Classification (
tasks/04_clip_retrieval) - Task 5: VLM Visual Question Answering (
tasks/05_vlm_vqa)
- Installation
- 4. Licensing & Provenance
- Paper artifacts
RiMa: A Multi-Source, Group-Disjoint Multi-Task Benchmark for Rice and Maize Leaf Disease Analysis
RiMa is a unified, duplicate-clustered, and expert-verified multi-task benchmark for rice (Oryza sativa) and maize (Zea mays) leaf disease analysis across 5 vision and vision-language tasks:
- Task 1 — Disease Classification (
01_classification): Track-separated classification (rice,maize_foliar,maize_viral_tz) under group-disjoint splits and leave-one-source-out (LOSO) cross-source evaluation. - Task 2 — Lesion Detection (
02_detection): Bounding-box lesion detection with leaf-mask ignore regions (leaf_masks) that prevent unannotated secondary leaves in multi-leaf field photos from being penalized as false positives. - Task 3 — Instance & Semantic Segmentation (
03_segmentation): Instance polygon segmentation (data/seg) and pixel-level semantic masks (data/seg_sem) for leaf + lesion severity estimation. - Task 4 — Image–Text Retrieval & Zero-Shot Classification (
04_clip_retrieval): English image-text pairs across four granularity levels (name_en,scientific, expertsymptom_en, per-imagecaption_en) plus SCOLD Template $T$ evaluation. - Task 5 — Visual Question Answering (
05_vlm_vqa): 82,515 English VQA pairs across 5 diagnostic categories (perception,presence,counting,severity,grounding) under both free-form generation and label-constrained log-likelihood scoring.
1. Directory Structure
The package is zero-config and uses relative paths throughout. After extracting the archive anywhere on Windows, Linux, or macOS, all 5 tasks run out-of-the-box without editing paths:
rima/
├── images/ # 41,794 unified leaf images (000001.jpg ... 041794.jpg)
├── 01_classification/ # CSV splits for rice, maize_foliar, maize_viral_tz + sources.csv
├── 02_detection/ # COCO JSONs (with leaf_masks) + YOLO labels + data_det.yaml
├── 03_segmentation/ # COCO JSONs + YOLO polygon labels + data_seg.yaml
├── 04_clip_retrieval/ # English image-caption CSVs (train.csv, val.csv, test.csv)
├── 05_vlm_vqa/ # Dual LLaVA-conversations & VQAv2 JSONs (train/val/test.json)
├── DATASHEET.md # Gebru et al. Datasheet for Datasets + expert review record
├── README.md # Benchmark documentation & metadata
└── requirements.txt # Python dependencies
2. Dataset Summary
| Statistic | Count | Notes |
|---|---|---|
Total unified images in images/ |
41,794 | Standardized 6-digit filenames (000001.jpg–041794.jpg) |
| Active benchmark classes | 13 | 7 rice (rice) + 5 maize foliar (maize_foliar) + 3 maize viral (maize_viral_tz) |
| Quarantined / excluded images | 821 | 37 cross-source label conflicts + 784 lesion-free NLB negatives (used in DET only) |
| Active images (CLS / CLIP / VLM) | 40,973 | 28,693 train / 4,055 val / 8,225 test (100% duplicate-group disjoint) |
Detection split (02_detection) |
12,306 | 7,775 train / 1,027 val / 3,504 test (9,973 images with boxes; 35,060 lesion boxes; 12,231 leaf masks) |
Segmentation split (03_segmentation) |
7,526 | 4,636 train / 604 val / 2,270 test across 8 discrete-lesion classes |
English CLIP captions (04_clip_retrieval) |
135,895 | 94,320 train / 13,444 val / 28,131 test (name_en, scientific, symptom_en, caption_en) |
English VQA pairs (05_vlm_vqa) |
82,515 | 56,148 train / 7,782 val / 18,585 test across 5 categories (en) |
3. Quick Start (Out-of-the-Box Execution)
Installation
pip install -r requirements.txt
Note on Paths: You do not need to set any environment variables when running from inside the extracted
rima/folder. If you movetasks/elsewhere, setRIMA_DATASET=/path/to/rima.
Task 1: Disease Classification (tasks/01_classification)
cd tasks/01_classification
# Train standard track-separated baseline (ResNet-50 / ConvNeXt-T / ViT-B/16)
python train.py --track all --backbone resnet50 --epochs 15
# Leave-One-Source-Out (LOSO) cross-source generalization
python train_loso.py --backbone resnet50 --epochs 10
# Frozen-backbone linear probe (CLIP, SigLIP-2, ViT-B/16)
python eval_linear_probe.py --backbone all
Task 2: Lesion Detection (tasks/02_detection)
cd tasks/02_detection
# Evaluate YOLOv26n test predictions with leaf-mask ignore regions
python eval.py --gold-only
# Train YOLOv26n detector (automatically creates 0-byte hardlinks in data/det/yolo/images/)
python train.py det --data ../../data/det/data_det.yaml --name det_rima_yolo26n --epochs 20
Task 3: Instance & Semantic Segmentation (tasks/03_segmentation)
cd tasks/03_segmentation
# Validate fine-tuned YOLOv26n-seg checkpoint on the held-out test split (reproduces paper Table 2)
python val_seg_test.py
# Train YOLOv26n-seg from scratch
python train_yolo_seg.py seg --data ../../data/seg/data_seg.yaml --name seg_rima_yolo26n --epochs 20
Task 4: Image–Text Retrieval & Zero-Shot Classification (tasks/04_clip_retrieval)
cd tasks/04_clip_retrieval
# Evaluate SCOLD Template T retrieval & 13-way / track-aware classification (pretrained & fine-tuned SigLIP-2)
python eval_scold_template.py ../../data --backbone siglip2
python eval_scold_template.py ../../data --backbone siglip2 \
--model-path ../../artifacts/04_clip_retrieval/checkpoints/ckpt_siglip2_scold \
--out eval_scold_template_ft.json
# Fine-tune SigLIP-2 on RiMa English captions
python train_contrastive.py ../../data --scold --epochs 2 --tag siglip2_scold
Task 5: VLM Visual Question Answering (tasks/05_vlm_vqa)
cd tasks/05_vlm_vqa
# Reproduce the 1,000-image head-to-head comparison across Qwen3-VL + LoRA, SigLIP-2, and ResNet-50 (Table 5)
python eval_same_cohort.py ../../data
# Free-form English VQA evaluation (5 categories)
python eval.py ../../data --model Qwen/Qwen3-VL-4B-Instruct --per-cat 200 --prefer-gold --tag _qwen3
# Label-constrained English VQA evaluation (perception & presence)
python eval_constrained.py ../../data --model Qwen/Qwen3-VL-4B-Instruct --per-cat 200 --prefer-gold --tag _qwen3
# LoRA fine-tuning of Qwen3-VL-4B on English perception
python train_lora.py ../../data --tag qwen3vl_perception_en
4. Licensing & Provenance
All 7 upstream public sources bundled in RiMa are released under CC BY 4.0 (see DATASHEET.md and release/sources.csv for per-source DOIs, authors, and attribution). All RiMa annotations, leaf masks, duplicate-group splits, symptom descriptions, captions, VQA pairs, and benchmark code are released under CC BY 4.0.
Paper artifacts
The folder paper_artifacts/ contains the evaluation results (JSON), raw VLM answers (JSONL), training logs and run configurations behind every number reported in the RiMa paper, so that reported values can be checked. See paper_artifacts/README.md for a table mapping each paper table/figure to its files.
- Downloads last month
- 136