Multi-Domain Plant Disease Detection: A YOLOv11x Benchmark on 116 Classes

License: MIT Python 3.9+ Ultralytics Colab Hugging Face


Overview

This repository contains a complete implementation of a state-of-the-art plant disease detection system using YOLOv11x trained on 23,689 images across 116 disease classes covering major food crops. The model combines two complementary datasets β€” controlled laboratory images and real-world field images β€” to achieve strong generalization across domains.

  • plantwild β€” 18,533 lab images, 89 classes (controlled environment, uniform backgrounds)
  • FieldPlant β€” 5,156 field images, 27 classes (real field conditions, pathologist-annotated)

The model achieves 69.8% mAP50, substantially outperforming existing benchmarks on field data (~38–48%) while handling 4Γ— more classes.


Model Performance

Metric Value
mAP50 69.8%
mAP50-95 68.4%
Recall 69.5%
Precision 62.2%
Total Classes 116
Total Images 23,689
Architecture YOLOv11x (57M parameters)

Top Performing Classes

Rank Class mAP50
1 Corn Stripe 99.5%
2 Corn Leaf Blight 98.8%
3 Tomato Brown Spots 97.5%
4 Raspberry Leaf 96.1%
5 Cassava Mosaic 95.5%
6 Celery Leaf 95.4%
7 Peach Leaf Curl 95.3%
8 Corn Smut 93.9%
9 Cassava Healthy 92.6%
10 Basil Leaf 92.4%

Comparison with Published Benchmarks

Study Dataset Classes Architecture mAP50
Moupojou et al. (2023) FieldPlant 27 Faster R-CNN ~38%
PlantDoc Benchmark PlantDoc 27 YOLOv5 43–48%
PlantVillage Typical PlantVillage 38 YOLOv5/v8 85–90%
Our Model Combined 116 YOLOv11x 69.8%

Dataset

Split Images Percentage
Training 16,582 70%
Validation 4,737 20%
Test 2,370 10%

Source Composition:

Source Type Images Classes Share
plantwild Laboratory 18,533 89 78.2%
FieldPlant Field 5,156 27 21.8%

Training Configuration

Parameter Value
Architecture YOLOv11x (57M parameters)
Input Size 640 Γ— 640 pixels
Batch Size 64 (A100) / 8 (T4)
Optimizer AdamW
Initial Learning Rate 0.001
Final Learning Rate 0.00001 (cosine decay)
Weight Decay 0.0005
Momentum 0.937
Warmup Epochs 3
Total Epochs 100 (early stopping at epoch 49)
Mixed Precision Enabled
Augmentations Mosaic (100%), MixUp (20%), Copy-Paste (20%), Rotation (Β±10Β°), Translation (Β±10Β°), Scaling (Β±50%), Flip (50%), HSV adjust

Export & Inference

Model Export Sizes

Format Size mAP50 (Validation)
PyTorch (FP32) 457 MB 69.8%
TFLite (FP16) 114 MB 69.5%
TFLite (INT8) 62 MB 68.2%
ONNX 113 MB 69.8%

Inference Speed

Hardware Precision Time per Image (ms) FPS
NVIDIA A100 FP16 4.4 227
NVIDIA T4 FP16 15.2 66
iPhone 14 FP16 (Core ML) ~120 8
Android Flagship INT8 (TFLite) ~180 5

Quick Start

Option 1: Google Colab

Open In Colab

  1. Click the badge above.
  2. Select Runtime β†’ Change runtime type β†’ A100 GPU (or T4 if unavailable).
  3. Run cells sequentially from top to bottom.

Option 2: Local Installation

# Clone repository
git clone https://github.com/SIV-TK/A-YOLOv11x-Benchmark-on-116-Classes-Using-Combined-Laboratory-and-Field-Images.git
cd A-YOLOv11x-Benchmark-on-116-Classes-Using-Combined-Laboratory-and-Field-Images

# Install dependencies
pip install ultralytics opencv-python matplotlib seaborn scikit-learn pandas pyyaml tqdm kagglehub

# Run the training notebook
jupyter notebook "YOLO(2).ipynb"

Option 3: Load Pre-trained Model

from ultralytics import YOLO

# Load model
model = YOLO('best.pt')  # or load from https://huggingface.co/JK-TK/PlantDiseaseDetection

# Run inference
results = model('path/to/leaf_image.jpg', conf=0.25)

# Display results
results[0].show()

# Print detections
for box in results[0].boxes:
    class_id = int(box.cls[0])
    confidence = float(box.conf[0])
    class_name = model.names[class_id]
    print(f"Detected: {class_name} ({confidence:.2%})")

Resume Training

The notebook automatically saves checkpoints. To resume an interrupted training run:

from ultralytics import YOLO

model = YOLO('/content/drive/MyDrive/PlantDisease_TrainingBackup_*/training_run/weights/last.pt')
model.train(data='dataset/data.yaml', epochs=100, resume=True)

Test on Custom Images

Using Python:

from google.colab import files
from ultralytics import YOLO

model = YOLO('best.pt')
uploaded = files.upload()

for img_name in uploaded:
    results = model(img_name, conf=0.25)
    results[0].show()

Using the command line:

yolo predict model=best.pt source='path/to/image.jpg' conf=0.25

Repository Structure

β”œβ”€β”€ YOLO(2).ipynb                  # Complete training notebook
β”œβ”€β”€ README.md                      # This file
β”œβ”€β”€ LICENSE                        # MIT License
β”œβ”€β”€ best.pt                        # Pre-trained weights (69.8% mAP50)
β”œβ”€β”€ dataset/
β”‚   β”œβ”€β”€ train/images/              # 16,582 training images
β”‚   β”œβ”€β”€ train/labels/
β”‚   β”œβ”€β”€ val/images/                # 4,737 validation images
β”‚   β”œβ”€β”€ val/labels/
β”‚   β”œβ”€β”€ test/images/               # 2,370 test images
β”‚   β”œβ”€β”€ test/labels/
β”‚   └── data.yaml                  # Dataset configuration
└── publication/
    β”œβ”€β”€ comparison_bar_chart.png
    β”œβ”€β”€ training_curves.png
    β”œβ”€β”€ confusion_matrix.png
    β”œβ”€β”€ dataset_source_pie.png
    β”œβ”€β”€ dataset_split_bar.png
    β”œβ”€β”€ overall_performance.csv
    └── comparison_table.csv

Key Features

  • 116 disease classes across major food crops (corn, tomato, cassava, apple, grape, potato, banana, citrus, and more)
  • Combined-domain training (laboratory + field) for real-world generalization
  • Complete pipeline from dataset download to model export
  • Per-class mAP50, confusion matrix, and comprehensive test evaluation
  • TensorFlow Lite export for mobile deployment (FP16 and INT8)
  • Publication-ready visualizations generated automatically
  • Resume training with checkpoint saving
  • Fully reproducible with fixed random seeds

Citation

If you use this model or dataset in your research, please cite:

@software{kariuki_2026_plant_disease,
  author = {Kariuki, James Kariuki},
  title  = {Multi-Domain Plant Disease Detection: A YOLOv11x Benchmark on 116 Classes},
  year   = {2026},
  url    = {https://github.com/SIV-TK/A-YOLOv11x-Benchmark-on-116-Classes-Using-Combined-Laboratory-and-Field-Images/tree/main/YOLO.ipynb},
  note   = {mAP50: 69.8\%, 116 disease classes, 23,689 images}
}

Acknowledgments

  • plantwild β€” high-quality laboratory images
  • FieldPlant β€” real-world field annotations
  • Ultralytics β€” YOLOv11x implementation and training framework
  • Google Colab β€” free A100 GPU access
  • KaggleHub β€” easy dataset downloading

License

This project is licensed under the MIT License.


Contact

Author: Kariuki James Kariuki
GitHub: SIV-TK
Hugging Face: JK-TK/PlantDiseaseDetection
Paper / Notebook: YOLO.ipynb
Email: ST62550392025@students.ouk.ac.ke
Phone: +254 718 845 849

For questions, issues, or collaboration requests, please open an issue on GitHub.


If you find this work useful, please consider starring the repository and citing it in your publications.

Downloads last month
34
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using JK-TK/PlantDiseaseDetection 1

Evaluation results